結果
| 問題 | No.438 Cwwプログラミング入門 |
| コンテスト | |
| ユーザー |
hanorver
|
| 提出日時 | 2016-10-29 14:03:40 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 108 ms / 2,000 ms |
| コード長 | 641 bytes |
| 記録 | |
| コンパイル時間 | 668 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-05-22 02:47:44 |
| 合計ジャッジ時間 | 14,185 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 98 |
ソースコード
from math import *
x,y,z=map(int,input().split())
v=w=total=6000;h=abs;r=range
if z==0:print("ccW");exit()
for a in r(-6000,6000):
b=(z-a*x)
if y:b/=y
d=int(b);e=ceil(b)
if d==e and(a!=0 or b!=0)and a*x+e*y==z and h(a)+h(e)<total:
total=h(a)+h(e);v=a;w=e
if total+total-1>10000:
print("mourennaihasimasenn")
else:
s=v>0
for i in r(h([v,w][s])):
print("cw"[s],end="")
for i in r(h([w,v][s])):
print("wc"[s],end="")
for i in r(h([w,v][s])-1):
print("C",end="")
if v<0:
for i in r(h(v)):
print("W",end="")
elif w<0:
for i in r(h(w)):
print("W",end="")
else:
for i in r(h([v,w][s])):
print("C",end="")
print()
hanorver