結果
| 問題 | No.204 ゴールデン・ウィーク(2) |
| コンテスト | |
| ユーザー |
FF256grhy
|
| 提出日時 | 2015-05-08 23:21:17 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 593 bytes |
| 記録 | |
| コンパイル時間 | 91 ms |
| コンパイル使用メモリ | 39,680 KB |
| 実行使用メモリ | 10,060 KB |
| 最終ジャッジ日時 | 2026-09-15 16:27:10 |
| 合計ジャッジ時間 | 2,237 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 WA * 23 |
ソースコード
#include <stdio.h>
int note[16];
int main(void) {
int d;
char c[15];
scanf("%d%s%s", &d, c, &c[7]);
c[14] = 'x';
int kinou = 'x', cnt = 0;
note[0] = 15;
int i;
for(i = 0; i < 15; i++) {
if(kinou != c[i]) {
cnt++;
}
note[cnt]++;
kinou = c[i];
}
note[cnt] += 15;
int max = d;
for(i = 1; i < cnt - 1; i += 2) {
int len;
len = note[i] + ( note[i - 1] <= d ? note[i - 1] + note[i - 2] : d );
if(max < len) { max = len; }
len = note[i] + ( note[i + 1] <= d ? note[i + 1] + note[i + 2] : d );
if(max < len) { max = len; }
}
printf("%d\n", max);
return 0;
}
FF256grhy