結果

問題 No.438 Cwwプログラミング入門
ユーザー mkawa2mkawa2
提出日時 2020-04-24 15:15:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,042 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 15,456 KB
最終ジャッジ日時 2023-08-05 04:04:41
合計ジャッジ時間 8,738 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
15,456 KB
testcase_01 AC 16 ms
8,220 KB
testcase_02 AC 17 ms
8,416 KB
testcase_03 AC 16 ms
8,208 KB
testcase_04 AC 16 ms
8,284 KB
testcase_05 AC 16 ms
8,320 KB
testcase_06 AC 16 ms
8,220 KB
testcase_07 AC 16 ms
8,220 KB
testcase_08 AC 17 ms
8,308 KB
testcase_09 AC 16 ms
8,364 KB
testcase_10 AC 16 ms
8,412 KB
testcase_11 AC 17 ms
8,236 KB
testcase_12 AC 16 ms
8,364 KB
testcase_13 AC 16 ms
8,256 KB
testcase_14 AC 17 ms
8,104 KB
testcase_15 AC 16 ms
8,332 KB
testcase_16 AC 16 ms
8,436 KB
testcase_17 AC 16 ms
8,448 KB
testcase_18 AC 16 ms
8,404 KB
testcase_19 AC 16 ms
8,292 KB
testcase_20 AC 17 ms
8,424 KB
testcase_21 AC 16 ms
8,364 KB
testcase_22 AC 18 ms
8,292 KB
testcase_23 AC 17 ms
8,296 KB
testcase_24 AC 16 ms
8,252 KB
testcase_25 AC 16 ms
8,240 KB
testcase_26 AC 16 ms
8,304 KB
testcase_27 AC 17 ms
8,264 KB
testcase_28 AC 16 ms
8,048 KB
testcase_29 AC 16 ms
8,428 KB
testcase_30 AC 16 ms
8,288 KB
testcase_31 AC 16 ms
8,188 KB
testcase_32 AC 16 ms
8,188 KB
testcase_33 AC 16 ms
8,332 KB
testcase_34 AC 16 ms
8,332 KB
testcase_35 AC 16 ms
8,224 KB
testcase_36 AC 16 ms
8,236 KB
testcase_37 AC 16 ms
8,428 KB
testcase_38 AC 16 ms
8,224 KB
testcase_39 AC 16 ms
8,268 KB
testcase_40 AC 16 ms
8,416 KB
testcase_41 AC 16 ms
8,420 KB
testcase_42 AC 16 ms
8,284 KB
testcase_43 AC 16 ms
8,368 KB
testcase_44 AC 16 ms
8,412 KB
testcase_45 AC 16 ms
8,208 KB
testcase_46 AC 16 ms
8,248 KB
testcase_47 AC 16 ms
8,340 KB
testcase_48 AC 29 ms
8,252 KB
testcase_49 AC 21 ms
8,192 KB
testcase_50 AC 15 ms
8,340 KB
testcase_51 AC 20 ms
8,368 KB
testcase_52 AC 16 ms
8,332 KB
testcase_53 AC 21 ms
8,408 KB
testcase_54 AC 15 ms
8,268 KB
testcase_55 AC 19 ms
8,220 KB
testcase_56 AC 20 ms
8,300 KB
testcase_57 AC 19 ms
8,376 KB
testcase_58 AC 15 ms
8,380 KB
testcase_59 AC 21 ms
8,376 KB
testcase_60 AC 32 ms
8,268 KB
testcase_61 AC 16 ms
8,256 KB
testcase_62 AC 16 ms
8,332 KB
testcase_63 AC 17 ms
8,224 KB
testcase_64 AC 28 ms
8,404 KB
testcase_65 AC 16 ms
8,392 KB
testcase_66 AC 17 ms
8,360 KB
testcase_67 AC 16 ms
8,280 KB
testcase_68 WA -
testcase_69 AC 376 ms
8,404 KB
testcase_70 WA -
testcase_71 AC 103 ms
8,428 KB
testcase_72 TLE -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
testcase_84 -- -
testcase_85 -- -
testcase_86 -- -
testcase_87 -- -
testcase_88 -- -
testcase_89 -- -
testcase_90 -- -
testcase_91 -- -
testcase_92 -- -
testcase_93 -- -
testcase_94 -- -
testcase_95 -- -
testcase_96 -- -
testcase_97 -- -
testcase_98 -- -
testcase_99 -- -
testcase_100 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def extgcd(a,b,c):
    if b==0:return c//a,0,abs(a)
    x,y,g=extgcd(b,a%b,c)
    return y,x-y*(a//b),g

def main():
    mx=10000
    x,y,z=MI()
    if mx//2*max(x,y)<z:
        print("NO")
        exit()
    cx,cy,g=extgcd(x,y,z)
    if z%g:
        print("NO")
        exit()
    p=(cx>0)*2-1
    while (abs(cx)+abs(cy))*2-1>mx and (cx>0)*2-1==p:
        cx,cy=cx-p*y,cy+p*x
    if (cx,cy)==(0,0):
        cx,cy=y//g,-x//g
    if (abs(cx)+abs(cy))*2-1>mx:
        print("NO")
        exit()
    if cx>0:ans="w"*abs(cy)+"c"*cx+"C"*(cx-1)+("C" if cy>0 else "W")*abs(cy)
    else:ans="c"*abs(cx)+"w"*cy+"C"*(cy-1)+("C" if cx>0 else "W")*abs(cx)
    print(ans)

main()
0