QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#90110#3332. Frigde of Your DreamsChatGPTAC ✓3ms3468kbC++455b2023-03-22 13:24:062023-03-22 13:24:08

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-22 13:24:08]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3468kb
  • [2023-03-22 13:24:06]
  • 提交

answer

#include <iostream>
#include <string>
#include <bitset>

using namespace std;

int main() {
    int n;
    cin >> n;
    
    while (n--) {
        string bin;
        cin >> bin;
        
        // Convert binary string to unsigned long long
        bitset<24> bits(bin);
        unsigned long long val = bits.to_ullong();
        
        // Convert to decimal and output
        cout << val << endl;
    }
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 3468kb

input:

900
000000000000000000000001
111111111111111111111111
000110111110011011111101
000010111101000111110110
001111000111011010010100
111100111101011000010001
111100000101000100011011
101010000100011000111111
100000101011010010110010
000000110110010110011000
010010010001000110001100
101110000100000010010...

output:

1
16777215
1828605
774646
3962516
15980049
15749403
11028031
8565938
222616
4788620
12075157
7047968
1208410
9821035
6285667
14807203
16642367
15964916
4236558
16078925
793187
7975216
14668246
10167382
2974478
15798201
9141013
10033030
9383093
1019221
13718980
15442885
633948
6122586
5208174
1675569...

result:

ok 900 lines

Extra Test:

score: 0
Extra Test Passed