結果
問題 | No.414 衝動 |
ユーザー | tails |
提出日時 | 2021-02-22 18:58:08 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 7 ms / 1,000 ms |
コード長 | 259 bytes |
コンパイル時間 | 121 ms |
コンパイル使用メモリ | 29,184 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 09:44:33 |
合計ジャッジ時間 | 944 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 7 ms
5,248 KB |
testcase_04 | AC | 1 ms
5,248 KB |
testcase_05 | AC | 6 ms
5,248 KB |
testcase_06 | AC | 6 ms
5,248 KB |
testcase_07 | AC | 6 ms
5,248 KB |
testcase_08 | AC | 6 ms
5,248 KB |
testcase_09 | AC | 6 ms
5,248 KB |
testcase_10 | AC | 1 ms
5,248 KB |
testcase_11 | AC | 1 ms
5,248 KB |
testcase_12 | AC | 1 ms
5,248 KB |
コンパイルメッセージ
main.c:4:1: warning: return type defaults to 'int' [-Wimplicit-int] 4 | main(){ | ^~~~ main.c: In function 'main': main.c:6:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf("%ld",&m); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #pragma GCC optimize("Ofast") main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | scanf("%ld",&m); | ^~~~~ main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:8:17: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 8 | printf("2 %ld",m/2); | ^~~~~~ main.c:8:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:8:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:8:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:9:17: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 9 | exit(0); | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | #pragma GCC optimize("Ofast") main.c:9:17: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 9 | exit(0); | ^~~~ main.c:9:17: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:13:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 13 | printf("%ld %ld",i,m/i); | ^~~~~~ main.c:13:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:14:25: warning: incompatible implicit decl
ソースコード
#pragma GCC optimize("Ofast") #pragma GCC target("avx2") main(){ long m; scanf("%ld",&m); if((m&1)==0){ printf("2 %ld",m/2); exit(0); } for(long i=3;i<1000000;i+=2){ if(m%i==0){ printf("%ld %ld",i,m/i); exit(0); } } printf("1 %ld",m); }