結果
問題 | No.342 一番ワロタww |
ユーザー | kokatsu |
提出日時 | 2021-12-18 20:49:12 |
言語 | D (dmd 2.107.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 774 bytes |
コンパイル時間 | 1,275 ms |
コンパイル使用メモリ | 158,384 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-04 15:26:00 |
合計ジャッジ時間 | 2,900 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 2 ms
4,376 KB |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | AC | 2 ms
4,376 KB |
testcase_04 | AC | 1 ms
4,376 KB |
testcase_05 | AC | 2 ms
4,376 KB |
testcase_06 | AC | 2 ms
4,380 KB |
testcase_07 | AC | 2 ms
4,380 KB |
testcase_08 | AC | 2 ms
4,380 KB |
testcase_09 | AC | 2 ms
4,380 KB |
testcase_10 | AC | 2 ms
4,380 KB |
testcase_11 | AC | 2 ms
4,380 KB |
testcase_12 | AC | 2 ms
4,380 KB |
testcase_13 | AC | 2 ms
4,380 KB |
testcase_14 | WA | - |
testcase_15 | AC | 1 ms
4,380 KB |
testcase_16 | AC | 1 ms
4,376 KB |
ソースコード
import std; void main() { dstring S = readln.chomp.to!dstring; dchar[][] res; dchar[] now; dchar pre; int cnt, num; foreach (i, s; S) { if (s == 'w') { ++num; } else { if (pre == 'w' && !now.empty) { if (cnt < num) { cnt = num; res = [now]; } else if (cnt == num) { res ~= now; } now = []; num = 0; } now ~= s; } pre = s; } if (cnt < num) { res = [now]; } else if (cnt == num) { res ~= now; } foreach (r; res) { r.writeln; } }