結果
| 問題 |
No.582 キャンディー・ボックス3
|
| コンテスト | |
| ユーザー |
dptbl
|
| 提出日時 | 2017-10-27 22:47:48 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 502 bytes |
| コンパイル時間 | 688 ms |
| コンパイル使用メモリ | 105,972 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-12 22:11:38 |
| 合計ジャッジ時間 | 1,418 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 2 |
ソースコード
import core.bitop;
import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.format;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;
void main()
{
int n = readln.chomp.to!int;
auto c = readln.chomp.split.map!(to!int).filter!"a != 0";
if (c.any!"a >= 3") {
"B".writeln;
return;
}
if (c.count(2) >= 2) {
"B".writeln;
}
writeln = c.filter!(a => a <= 2).sum() % 2 == 1 ? "A" : "B";
}
dptbl