提出 #53582098


ソースコード 拡げる

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;
}

提出情報

提出日時
問題 A - Exponential Plant
ユーザ iluem100
言語 C++ 20 (gcc 12.2)
得点 100
コード長 193 Byte
結果 AC
実行時間 1 ms
メモリ 1732 KB

コンパイルエラー

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);
      |     ~~~~~^~~~~~~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 3
AC × 24
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
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 (火)
23:02:37 +00:00