結果

問題 No.161 制限ジャンケン
ユーザー nebukuro09
提出日時 2016-09-03 14:37:39
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 582 bytes
コンパイル時間 600 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-15 18:38:05
合計ジャッジ時間 1,172 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

a = dict((x, y) for x, y in zip('GCP', map(int, raw_input().split())))
s = raw_input()
b = dict((c, s.count(c)) for c in 'GCP')
ans = 0

print a
print b
print
for s, t in zip('GCP', 'CPG'):
    if a[s] <= b[t]:
        ans += a[s]*3
        b[t] -= a[s]
        a[s] = 0
    else:
        ans += b[t]*3
        a[s] -= b[t]
        b[t] = 0

print a
print b
print ans
print 
for s in 'GCP':
    if a[s] <= b[s]:
        ans += a[s]
        b[s] -= a[s]
        a[s] = 0
    else:
        ans += b[s]
        a[s] -= b[s]
        b[s] = 0
        
       
print a
print b

print ans
0