結果
問題 | No.2373 wa, wo, n |
ユーザー |
![]() |
提出日時 | 2023-07-07 21:54:10 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 118 ms / 2,000 ms |
コード長 | 1,332 bytes |
コンパイル時間 | 896 ms |
コンパイル使用メモリ | 82,496 KB |
実行使用メモリ | 90,240 KB |
最終ジャッジ日時 | 2024-07-21 17:47:30 |
合計ジャッジ時間 | 4,291 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 39 |
ソースコード
# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1")# from bisect import *from collections import *# from heapq import *# from itertools import *# from math import *# from datetime import *# from decimal import * # PyPyだと遅い# from string import ascii_lowercase,ascii_uppercase# import numpy as npimport sysimport os# sys.setrecursionlimit(10**6) # PyPyだと遅いINF = 10**18MOD = 998244353# MOD = 10**9 + 7isFile = os.path.exists("input.txt")File = open("input.txt", "r", encoding="utf-8") if isFile else sys.stdindef input():return File.readline()[:-1]# ///////////////////////////////////////////////////////////////////////////N = int(input())S = deque(input())for _ in range(INF):# print(S)if len(S) == 0:breakif len(S) == 1:if S[0] not in ["n", "?"]:print("No")exit()else:breakif S[0] == "n":S.popleft()continueelif S[0] == "w":S.popleft()if S[0] not in ["a", "o", "?"]:print("No")exit()else:S.popleft()else:if S[0] != "?":print("No")exit()else:S.popleft()if S[0] in ["a", "o"]:S.popleft()print("Yes")