結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
TLwiegehtt
|
| 提出日時 | 2015-07-13 02:26:34 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 756 bytes |
| コンパイル時間 | 362 ms |
| コンパイル使用メモリ | 21,632 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-13 13:28:08 |
| 合計ジャッジ時間 | 1,501 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 46 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d", &d);
| ^~~~~~~~~~~~~~~
main.c:17:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
17 | scanf("%s", s);
| ^~~~~~~~~~~~~~
main.c:21:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
21 | scanf("%s", s);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main(void){
int i,d;
int okMax = 0;
char s[10];
char week[60];
scanf("%d", &d);
for(i=0;i<d;i++){
week[i] = 'x';
}
scanf("%s", s);
for(i=d;i<(d+7);i++){
week[i] = s[i-d];
}
scanf("%s", s);
for(i=(d+7);i<(d+14);i++){
week[i] = s[i-(d+7)];
}
for(i=(d+14);i<(d+d+14);i++){
week[i] = 'x';
week[i+1] = '\0';
}
printf("%s\n", week);
for(i=0;i<(d+14+1);i++){
int ok=0;
int j,rest = d;
char tmp[60]={0};
strcpy(tmp, week);
for(j=0;j<rest;j++){
tmp[i+j] = 'o';
}
for(j=0;;j++){
if(tmp[j] == 'o'){
ok++;
}else{
if(okMax < ok ){
okMax = ok;
}
ok = 0;
}
if(tmp[j] == '\0'){break;}
}
}
printf("%d\n", okMax);
return 0;
}
TLwiegehtt