1 solutions

  • 0
    @ 2024-1-6 1:44:11

    这道题考的计算机基础知识。 只需知道

    1. 1 MB = 1024 KB
    2. 1 KB = 1024 B
    3. 1 B(Byte,字节) = 8 b(bit,位) 则我们可以把MB换算为KB,再换算为B,最后换算成b,除以32就能得到答案 C++的记得开long long。

    C++:

    long long x = 256;
    x *= 1024 * 1024 * 8;
    cout << x / 32;
    

    Python:

    ans = 256
    ans *= 1024 * 1024 * 8
    print(ans // 32)
    
    • 1

    Information

    ID
    15235
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By