結果

問題 No.438 Cwwプログラミング入門
ユーザー vwxyz
提出日時 2023-07-14 08:24:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 531 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-15 16:26:18
合計ジャッジ時間 7,007 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 98
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

X,Y,Z=map(int,readline().split())
if Z:
    ans="NO"
    for x in range(-5000,5001):
        if Y and (Z-x*X)%Y or Y==0 and Z-x*X:
            continue
        if Y:
            y=(Z-x*X)//Y
        else:
            y=0
        if abs(x)+abs(y)<=5000:
            if x>0:
                ans="w"*abs(y)+"c"+"cC"*(x-1)+("C"*y if y>=0 else "W"*(-y))
            else:
                ans="c"*abs(x)+"w"+"wC"*(y-1)+("C"*x if x>=0 else "W"*(-x))
            break
else:
    ans="ccW"
print(ans)
0