結果
問題 | No.1396 Giri |
ユーザー | tails |
提出日時 | 2021-02-18 17:44:35 |
言語 | C (gcc 12.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 416 bytes |
コンパイル時間 | 248 ms |
コンパイル使用メモリ | 30,336 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 23:18:01 |
合計ジャッジ時間 | 1,056 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
コンパイルメッセージ
main.c:8:1: warning: return type defaults to 'int' [-Wimplicit-int] 8 | main(){ | ^~~~ main.c: In function 'main': main.c:10:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 10 | scanf("%d",&n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #pragma GCC optimize("Ofast") main.c:10:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 10 | scanf("%d",&n); | ^~~~~ main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:11:15: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration] 11 | int h=sqrt(n),i=3; | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt' +++ |+#include <math.h> 1 | #pragma GCC optimize("Ofast") main.c:11:15: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch] 11 | int h=sqrt(n),i=3; | ^~~~ main.c:11:15: note: include '<math.h>' or provide a declaration of 'sqrt' main.c:30:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 30 | printf("%ld",a); | ^~~~~~ main.c:30:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:30:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:30:9: note: include '<stdio.h>' or provide a declaration of 'printf'
ソースコード
#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define MD 998244353 char d[1234567]; main(){ int n; scanf("%d",&n); int h=sqrt(n),i=3; long a=1,b=1l<<~__builtin_clzl(n); for(;i<=h;i+=2){ if(!d[i>>1]){ a=b; int c=1; while(c*i<=n)c*=i; b=b*c%MD; for(int j=i*i;j<=n;j+=i*2){ d[j>>1]=1; } } } for(;i<=n;i+=2){ if(!d[i>>1]){ a=b; b=b*i%MD; } } printf("%ld",a); }