結果
問題 | No.1292 パタパタ三角形 |
ユーザー | 👑 H20 |
提出日時 | 2020-11-20 22:47:38 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,378 bytes |
コンパイル時間 | 801 ms |
コンパイル使用メモリ | 86,944 KB |
実行使用メモリ | 109,296 KB |
最終ジャッジ日時 | 2023-09-30 19:44:32 |
合計ジャッジ時間 | 3,595 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 75 ms
71,344 KB |
testcase_01 | AC | 74 ms
71,428 KB |
testcase_02 | AC | 73 ms
71,168 KB |
testcase_03 | WA | - |
testcase_04 | AC | 72 ms
71,384 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 111 ms
90,540 KB |
testcase_15 | AC | 111 ms
90,564 KB |
testcase_16 | WA | - |
ソースコード
S = input() x = 0 y = 0 pattern = 0 LIST = [(0,0)] for i in range(len(S)): if pattern==0: if S[i]=='a': y -= 1 pattern=3 if S[i]=='b': x -= 1 pattern=1 if S[i]=='c': x += 1 pattern=5 elif pattern==1: if S[i]=='a': x -= 1 pattern=0 if S[i]=='b': x += 1 pattern=0 if S[i]=='c': y += 1 pattern=2 elif pattern==2: if S[i]=='a': x -= 1 pattern=5 if S[i]=='b': y -= 1 pattern=1 if S[i]=='c': x -= 1 pattern=3 elif pattern==3: if S[i]=='a': y += 1 pattern=0 if S[i]=='b': x += 1 pattern=4 if S[i]=='c': x -= 1 pattern=2 elif pattern==4: if S[i]=='a': x += 1 pattern=1 if S[i]=='b': x -= 1 pattern=3 if S[i]=='c': y -= 1 pattern=5 elif pattern==5: if S[i]=='a': x += 1 pattern=2 if S[i]=='b': x -= 1 pattern=0 if S[i]=='c': y += 1 pattern=4 LIST.append((y,x)) print(len(set(LIST)))