結果
問題 | No.2127 Mod, Sum, Sum, Mod |
ユーザー | tails |
提出日時 | 2023-03-16 15:04:50 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 287 bytes |
コンパイル時間 | 841 ms |
コンパイル使用メモリ | 22,528 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-18 09:21:20 |
合計ジャッジ時間 | 1,911 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 0 ms
5,248 KB |
testcase_01 | AC | 0 ms
5,376 KB |
testcase_02 | AC | 5 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 0 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 0 ms
5,376 KB |
testcase_08 | AC | 0 ms
5,376 KB |
testcase_09 | AC | 0 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 0 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 0 ms
5,376 KB |
testcase_15 | AC | 0 ms
5,376 KB |
testcase_16 | AC | 1 ms
5,376 KB |
testcase_17 | AC | 0 ms
5,376 KB |
testcase_18 | AC | 1 ms
5,376 KB |
testcase_19 | AC | 1 ms
5,376 KB |
testcase_20 | AC | 0 ms
5,376 KB |
testcase_21 | AC | 1 ms
5,376 KB |
testcase_22 | AC | 5 ms
5,376 KB |
testcase_23 | AC | 4 ms
5,376 KB |
testcase_24 | AC | 0 ms
5,376 KB |
testcase_25 | AC | 0 ms
5,376 KB |
testcase_26 | AC | 2 ms
5,376 KB |
testcase_27 | AC | 1 ms
5,376 KB |
testcase_28 | AC | 5 ms
5,376 KB |
testcase_29 | AC | 0 ms
5,376 KB |
コンパイルメッセージ
main.c:9:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 9 | main(){ | ^~~~ main.c: In function ‘main’: main.c:11:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 11 | scanf("%d%d",&n,&i); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | typedef __int128_t t; main.c:11:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 11 | scanf("%d%d",&n,&i); | ^~~~~ main.c:11:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:11:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘t *’ {aka ‘__int128 *’} [-Wformat=] 11 | scanf("%d%d",&n,&i); | ~^ ~~ | | | | | t * {aka __int128 *} | int * main.c:11:19: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘t *’ {aka ‘__int128 *’} [-Wformat=] 11 | scanf("%d%d",&n,&i); | ~^ ~~ | | | | int * t * {aka __int128 *} main.c:18:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 18 | printf("%d",a%998244353); | ^~~~~~ main.c:18:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:18:9: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:18:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:18:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘t’ {aka ‘__int128’} [-Wformat=] 18 | printf("%d",a%998244353); | ~^ ~~~~~
ソースコード
typedef __int128_t t; t f(t i,t n,t v){ t i2=i*(i+1)/2; t i3=i2*(i*2+1)/3; t n2=n*(n+1)/2; t v2=v*(v+1)/2; return i*n2-i2*(n+1)*v+i3*v2; } main(){ t n=0,i=0,a=0,v; scanf("%d%d",&n,&i); while(i){ v=n/i; a+=f(i,n,v); i=n/(v+1); a-=f(i,n,v); } printf("%d",a%998244353); }