結果
問題 | No.836 じょうよ |
ユーザー | tails |
提出日時 | 2020-10-22 19:15:43 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 607 bytes |
コンパイル時間 | 218 ms |
コンパイル使用メモリ | 31,896 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-21 09:26:05 |
合計ジャッジ時間 | 2,261 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 2 ms
5,376 KB |
testcase_15 | AC | 1 ms
5,376 KB |
testcase_16 | AC | 2 ms
5,376 KB |
testcase_17 | AC | 3 ms
5,376 KB |
testcase_18 | AC | 2 ms
5,376 KB |
testcase_19 | AC | 2 ms
5,376 KB |
testcase_20 | AC | 2 ms
5,376 KB |
testcase_21 | AC | 1 ms
5,376 KB |
testcase_22 | AC | 1 ms
5,376 KB |
testcase_23 | AC | 1 ms
5,376 KB |
testcase_24 | AC | 1 ms
5,376 KB |
testcase_25 | AC | 1 ms
5,376 KB |
testcase_26 | AC | 1 ms
5,376 KB |
testcase_27 | AC | 1 ms
5,376 KB |
testcase_28 | AC | 1 ms
5,376 KB |
testcase_29 | AC | 1 ms
5,376 KB |
testcase_30 | AC | 1 ms
5,376 KB |
testcase_31 | AC | 1 ms
5,376 KB |
testcase_32 | AC | 1 ms
5,376 KB |
testcase_33 | AC | 1 ms
5,376 KB |
testcase_34 | AC | 1 ms
5,376 KB |
testcase_35 | AC | 1 ms
5,376 KB |
testcase_36 | AC | 1 ms
5,376 KB |
testcase_37 | AC | 2 ms
5,376 KB |
testcase_38 | AC | 1 ms
5,376 KB |
testcase_39 | AC | 1 ms
5,376 KB |
testcase_40 | AC | 1 ms
5,376 KB |
コンパイルメッセージ
main.c:6:1: warning: return type defaults to 'int' [-Wimplicit-int] 6 | main(){ | ^~~~ main.c: In function 'main': main.c:9:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 9 | scanf("%ld%ld%d",&l,&r,&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:9:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 9 | scanf("%ld%ld%d",&l,&r,&n); | ^~~~~ main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:14:19: warning: implicit declaration of function 'sprintf' [-Wimplicit-function-declaration] 14 | int s0len=sprintf(s0,"%ld\n",d); | ^~~~~~~ main.c:14:19: note: include '<stdio.h>' or provide a declaration of 'sprintf' main.c:14:19: warning: incompatible implicit declaration of built-in function 'sprintf' [-Wbuiltin-declaration-mismatch] main.c:14:19: note: include '<stdio.h>' or provide a declaration of 'sprintf' main.c:22:30: warning: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration] 22 | for(;i<l;++i)memcpy(w,s0,s0len),w+=s0len; | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memcpy' +++ |+#include <string.h> 1 | #pragma GCC optimize("Ofast") main.c:22:30: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch] 22 | for(;i<l;++i)memcpy(w,s0,s0len),w+=s0len; | ^~~~~~ main.c:22:30: note: include '<string.h>' or provide a declaration of 'memcpy' main.c:23:30: warning: incompatible implicit declaration of built-in function 'memcpy' [-Wbuiltin-declaration-mismatch] 23 | for(;i<r;++i)memcpy(w,s1,s1len),w+=s1len; |
ソースコード
#pragma GCC optimize("Ofast") #pragma GCC target("avx") char buf[3200000]; main(){ long l,r; int n; scanf("%ld%ld%d",&l,&r,&n); ++r; long d=(r-l)/n; char s0[32],s1[32]; int s0len=sprintf(s0,"%ld\n",d); int s1len=sprintf(s1,"%ld\n",d+1); l%=n; r%=n; char*w=buf; int i=0; if(l<=r){ for(;i<l;++i)memcpy(w,s0,s0len),w+=s0len; for(;i<r;++i)memcpy(w,s1,s1len),w+=s1len; for(;i<n;++i)memcpy(w,s0,s0len),w+=s0len; }else{ for(;i<r;++i)memcpy(w,s1,s1len),w+=s1len; for(;i<l;++i)memcpy(w,s0,s0len),w+=s0len; for(;i<n;++i)memcpy(w,s1,s1len),w+=s1len; } write(1,buf,w-buf); _exit(0); }