結果
| 問題 | No.438 Cwwプログラミング入門 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-28 23:40:26 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 512 bytes |
| 記録 | |
| コンパイル時間 | 186 ms |
| コンパイル使用メモリ | 77,496 KB |
| 最終ジャッジ日時 | 2025-12-03 22:27:43 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 21 WA * 24 TLE * 1 -- * 52 |
ソースコード
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'