Submission #53582098


Source Code Expand

Copy
#include <cstdio>
int main(int argc, char * argv[]){
int h;
int i, j;
scanf("%d", &h);
for(i=1, j=0; i-1<=h; i*=2, j++);
printf("%d", j);
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <cstdio>

int main(int argc, char * argv[]){
    int h;

    int i, j;

    scanf("%d", &h);

    for(i=1, j=0; i-1<=h; i*=2, j++);

    printf("%d", j);

    return 0;
}

Submission Info

Submission Time
Task A - Exponential Plant
User iluem100
Language C++ 20 (gcc 12.2)
Score 100
Code Size 193 Byte
Status AC
Exec Time 1 ms
Memory 1732 KB

Compile Error

Main.cpp: In function ‘int main(int, char**)’:
Main.cpp:3:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
    3 | int main(int argc, char * argv[]){
      |          ~~~~^~~~
Main.cpp:3:27: warning: unused parameter ‘argv’ [-Wunused-parameter]
    3 | int main(int argc, char * argv[]){
      |                    ~~~~~~~^~~~~~
Main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%d", &h);
      |     ~~~~~^~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 24
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 02_hand_00.txt, 02_hand_01.txt, 02_hand_02.txt, 02_hand_03.txt, 02_hand_04.txt, 02_hand_05.txt, 02_hand_06.txt, 02_hand_07.txt, 02_hand_08.txt, 02_hand_09.txt, 02_hand_10.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 1648 KB
00_sample_01.txt AC 1 ms 1728 KB
00_sample_02.txt AC 1 ms 1608 KB
01_random_00.txt AC 1 ms 1576 KB
01_random_01.txt AC 0 ms 1560 KB
01_random_02.txt AC 0 ms 1624 KB
01_random_03.txt AC 0 ms 1612 KB
01_random_04.txt AC 1 ms 1624 KB
01_random_05.txt AC 0 ms 1712 KB
01_random_06.txt AC 1 ms 1588 KB
01_random_07.txt AC 0 ms 1620 KB
01_random_08.txt AC 0 ms 1600 KB
01_random_09.txt AC 0 ms 1560 KB
02_hand_00.txt AC 0 ms 1724 KB
02_hand_01.txt AC 0 ms 1732 KB
02_hand_02.txt AC 0 ms 1588 KB
02_hand_03.txt AC 0 ms 1612 KB
02_hand_04.txt AC 0 ms 1592 KB
02_hand_05.txt AC 0 ms 1600 KB
02_hand_06.txt AC 1 ms 1632 KB
02_hand_07.txt AC 0 ms 1724 KB
02_hand_08.txt AC 1 ms 1732 KB
02_hand_09.txt AC 1 ms 1632 KB
02_hand_10.txt AC 0 ms 1660 KB


2025-03-18 (Tue)
07:48:00 +00:00