結果
問題 | No.1313 N言っちゃダメゲーム (4) |
ユーザー | tails |
提出日時 | 2020-12-10 12:12:16 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 531 bytes |
コンパイル時間 | 1,599 ms |
コンパイル使用メモリ | 29,568 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 19:55:24 |
合計ジャッジ時間 | 2,393 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 0 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 | 0 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 0 ms
5,376 KB |
testcase_11 | AC | 0 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 2 ms
5,376 KB |
testcase_14 | AC | 2 ms
5,376 KB |
testcase_15 | AC | 2 ms
5,376 KB |
testcase_16 | AC | 3 ms
5,376 KB |
testcase_17 | AC | 2 ms
5,376 KB |
testcase_18 | AC | 2 ms
5,376 KB |
testcase_19 | AC | 2 ms
5,376 KB |
testcase_20 | AC | 1 ms
5,376 KB |
testcase_21 | AC | 2 ms
5,376 KB |
testcase_22 | AC | 1 ms
5,376 KB |
testcase_23 | AC | 2 ms
5,376 KB |
testcase_24 | AC | 1 ms
5,376 KB |
testcase_25 | AC | 2 ms
5,376 KB |
testcase_26 | AC | 1 ms
5,376 KB |
testcase_27 | AC | 1 ms
5,376 KB |
testcase_28 | AC | 3 ms
5,376 KB |
testcase_29 | AC | 3 ms
5,376 KB |
testcase_30 | AC | 3 ms
5,376 KB |
testcase_31 | AC | 3 ms
5,376 KB |
testcase_32 | AC | 3 ms
5,376 KB |
testcase_33 | AC | 2 ms
5,376 KB |
testcase_34 | AC | 2 ms
5,376 KB |
testcase_35 | AC | 2 ms
5,376 KB |
testcase_36 | AC | 2 ms
5,376 KB |
testcase_37 | AC | 2 ms
5,376 KB |
コンパイルメッセージ
main.c:10:1: warning: return type defaults to 'int' [-Wimplicit-int] 10 | main(){ | ^~~~ main.c: In function 'main': main.c:12:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 12 | scanf("%d%d%s",&n,&k,s); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #pragma GCC optimize("Ofast") main.c:12:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 12 | scanf("%d%d%s",&n,&k,s); | ^~~~~ main.c:12:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:28:25: warning: implicit declaration of function 'sprintf' [-Wimplicit-function-declaration] 28 | sprintf(wp,"%7d",i+1); | ^~~~~~~ main.c:28:25: note: include '<stdio.h>' or provide a declaration of 'sprintf' main.c:28:25: warning: incompatible implicit declaration of built-in function 'sprintf' [-Wbuiltin-declaration-mismatch] main.c:28:25: note: include '<stdio.h>' or provide a declaration of 'sprintf' main.c:33:17: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration] 33 | write(1,"0",1); | ^~~~~ main.c:37:9: warning: implicit declaration of function '_exit'; did you mean '_Exit'? [-Wimplicit-function-declaration] 37 | _exit(0); | ^~~~~ | _Exit
ソースコード
#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char s[200000+4]; char w[200000]; char wbuf[200000*8]; char*wpend=wbuf+(sizeof wbuf); char*wp=wbuf+(sizeof wbuf); main(){ int n,k; scanf("%d%d%s",&n,&k,s); int nw=0; for(int i=n;i--;){ int hoge; if(s[i]=='o'){ hoge=nw?0:1; }else{ hoge=0; } nw+=hoge; w[i]=hoge; if(i+k<n){ nw-=w[i+k]; } if(i<k && hoge){ wp-=8; sprintf(wp,"%7d",i+1); wp[7]=10; } } if(wp==wpend){ write(1,"0",1); }else{ write(1,wp,wpend-wp); } _exit(0); }