結果

問題 No.439 チワワのなる木
コンテスト
ユーザー nebukuro09
提出日時 2016-10-28 23:40:03
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
RE  
実行時間 -
コード長 512 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,049 ms
コンパイル使用メモリ 80,896 KB
実行使用メモリ 81,280 KB
最終ジャッジ日時 2026-05-18 05:15:49
合計ジャッジ時間 5,193 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

x, y, z = map(int, raw_input().split())
visited = set()
d = [(x, 'cC'), (y, 'wC'), (-x, 'cW'), (-y, 'wW')]

stack = [(x, 'c'), (y, 'w')]
while len(stack) > 0:
    num, code = stack.pop()
    #print num
    if num in visited or num < 0:
        continue
    if num == z:
        print code
        exit()
    visited.add(num)
    if len(code) >= 9999:
        continue
    for nn, nc in d:
        if num+nn not in visited and num+nn >= 0:
            stack.append((num+nn, code+nc))

print 'mourennaihasimasenn'
0