結果

問題 No.2373 wa, wo, n
ユーザー shobonvipshobonvip
提出日時 2023-07-07 21:33:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 79,648 KB
最終ジャッジ日時 2023-09-28 22:31:46
合計ジャッジ時間 5,535 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,404 KB
testcase_01 AC 76 ms
71,120 KB
testcase_02 AC 76 ms
71,376 KB
testcase_03 AC 75 ms
71,308 KB
testcase_04 AC 73 ms
71,376 KB
testcase_05 AC 75 ms
71,480 KB
testcase_06 AC 74 ms
71,316 KB
testcase_07 AC 74 ms
71,400 KB
testcase_08 AC 75 ms
71,356 KB
testcase_09 AC 74 ms
71,528 KB
testcase_10 AC 74 ms
71,484 KB
testcase_11 AC 76 ms
71,396 KB
testcase_12 AC 77 ms
71,240 KB
testcase_13 AC 76 ms
71,316 KB
testcase_14 AC 95 ms
78,936 KB
testcase_15 AC 89 ms
76,548 KB
testcase_16 AC 93 ms
79,224 KB
testcase_17 AC 90 ms
76,820 KB
testcase_18 AC 86 ms
76,012 KB
testcase_19 AC 87 ms
76,936 KB
testcase_20 AC 90 ms
78,772 KB
testcase_21 AC 86 ms
77,160 KB
testcase_22 AC 89 ms
77,640 KB
testcase_23 AC 91 ms
79,124 KB
testcase_24 AC 76 ms
71,356 KB
testcase_25 AC 76 ms
71,360 KB
testcase_26 AC 75 ms
71,348 KB
testcase_27 AC 76 ms
71,244 KB
testcase_28 AC 75 ms
71,484 KB
testcase_29 AC 76 ms
71,332 KB
testcase_30 AC 77 ms
71,328 KB
testcase_31 AC 75 ms
71,448 KB
testcase_32 AC 96 ms
79,608 KB
testcase_33 AC 93 ms
79,596 KB
testcase_34 AC 85 ms
79,524 KB
testcase_35 AC 89 ms
79,516 KB
testcase_36 AC 89 ms
79,648 KB
testcase_37 AC 86 ms
79,440 KB
testcase_38 AC 83 ms
79,308 KB
testcase_39 AC 84 ms
79,352 KB
testcase_40 AC 95 ms
79,608 KB
testcase_41 AC 95 ms
79,616 KB
testcase_42 AC 86 ms
79,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
dp0 = [0]*(n+1)
dp1 = [0]*(n+1)
dp0[0] = 1
for i in range(n):
	if s[i] == "w":
		if dp0[i]: dp1[i+1] = 1
	elif s[i] == "a" or s[i] == "o":
		if dp1[i]: dp0[i+1] = 1
	elif s[i] == "n":
		if dp0[i]: dp0[i+1] = 1
	elif s[i] == "?":
		if dp0[i]:
			dp1[i+1] = 1
			dp0[i+1] = 1
		if dp1[i]: dp0[i+1] = 1

if dp0[n]: print("Yes")
else: print("No")
0