結果
問題 | No.1396 Giri |
ユーザー | tails |
提出日時 | 2021-02-18 17:37:17 |
言語 | C (gcc 12.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 419 bytes |
コンパイル時間 | 276 ms |
コンパイル使用メモリ | 30,592 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-14 23:14:45 |
合計ジャッジ時間 | 1,098 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,812 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | AC | 1 ms
6,940 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("%ld",&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("%ld",&n); | ^~~~~ main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:12:16: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration] 12 | long h=sqrt(n); | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt' +++ |+#include <math.h> 1 | #pragma GCC optimize("Ofast") main.c:12:16: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch] 12 | long h=sqrt(n); | ^~~~ main.c:12:16: note: include '<math.h>' or provide a declaration of 'sqrt' main.c:31:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 31 | printf("%ld",a); | ^~~~~~ main.c:31:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:31:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:31: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(){ long n; scanf("%ld",&n); long a=1,b=1l<<~__builtin_clzl(n); long h=sqrt(n); long i=3; for(;i<=h;i+=2){ if(!d[i]){ a=b; long c=1; while(c*i<=n)c*=i; b=b*c%MD; for(long j=i*i;j<=n;j+=i*2){ d[j]=1; } } } for(;i<=n;i+=2){ if(!d[i]){ a=b; b=b*i%MD; } } printf("%ld",a); }