結果
問題 | No.1292 パタパタ三角形 |
ユーザー | とりゐ |
提出日時 | 2021-10-27 08:54:08 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 300 bytes |
コンパイル時間 | 393 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 75,264 KB |
最終ジャッジ日時 | 2024-04-16 11:12:05 |
合計ジャッジ時間 | 2,458 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 41 ms
51,968 KB |
testcase_01 | AC | 40 ms
52,096 KB |
testcase_02 | AC | 40 ms
52,224 KB |
testcase_03 | AC | 40 ms
51,712 KB |
testcase_04 | AC | 42 ms
51,840 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 | 64 ms
64,768 KB |
testcase_15 | AC | 64 ms
65,024 KB |
testcase_16 | AC | 66 ms
65,280 KB |
ソースコード
s=input() S=set() x,y=0,0 S.add((0,0)) n=len(s) for i in range(n): if i%2==0: if s[i]=='a': x+=1 elif s[i]=='b': y+=1 else: x-=1 y-=1 else: if s[i]=='a': x-=1 elif s[i]=='b': y-=1 else: x+=1 y+=1 S.add((x,y)) print(len(S))