結果
| 問題 | No.3323 岩井星式ジャンケン |
| コンテスト | |
| ユーザー |
tokugh
|
| 提出日時 | 2025-11-01 15:17:57 |
| 言語 | Julia (2.11.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,412 bytes |
| コンパイル時間 | 357 ms |
| コンパイル使用メモリ | 8,096 KB |
| 実行使用メモリ | 241,060 KB |
| 最終ジャッジ日時 | 2025-11-01 15:18:21 |
| 合計ジャッジ時間 | 23,281 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 7 |
ソースコード
toI(s=readline()) = parse(Int,s)
toVI(s=readline()) = map(toI,eachsplit(s))
rep(f,n) = [f() for _ in 1:n]
@enum YN Yes=1 No=0
function (@main)(ARGS)
n,m = toVI()
ss = rep(readline,n)
solve(n,m,ss) |> println
# join(stdout,solve()," "); println()
end
function solve(n,m,ss)
ss = Set(ss)
res = Char[]
for i in 1:m
g = c = p = 0
for s in ss
if s[i] == 'G'
g += 1
elseif s[i] == 'C'
c += 1
elseif s[i] == 'P'
p += 1
end
end
if g == c == 0
push!(res,'C')
while length(res) < m
push!(res,'P')
end
return join(res)
elseif c == p == 0
push!(res,'P')
while length(res) < m
push!(res,'P')
end
return join(res)
elseif p == g == 0
push!(res,'G')
while length(res) < m
push!(res,'P')
end
return join(res)
elseif g == 0
push!(res,'C')
filter!(s->first(s) != 'P',ss)
elseif c == 0
push!(res,'P')
filter!(s->first(s) != 'G',ss)
elseif p == 0
push!(res,'G')
filter!(s->first(s) != 'C',ss)
else
return "-1"
end
end
return "-1"
end
tokugh