結果
問題 | No.836 じょうよ |
ユーザー | tails |
提出日時 | 2020-10-22 19:15:43 |
言語 | C (gcc 13.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 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 41 |
コンパイルメッセージ
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); }