結果
問題 | No.3040 Aoiスコア |
ユーザー |
![]() |
提出日時 | 2025-03-01 02:17:30 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 865 bytes |
コンパイル時間 | 292 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 629,880 KB |
最終ジャッジ日時 | 2025-03-01 02:17:35 |
合計ジャッジ時間 | 5,762 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 MLE * 1 |
ソースコード
import sysinput = sys.stdin.readlinemod=998244353N,M=map(int,input().split())S=input().strip()E=[[] for i in range(N)]for i in range(M):x,y=map(int,input().split())x-=1y-=1E[x].append(y)E[y].append(x)ko=S.count("?")LIST=[]for i in range(N):for to in E[i]:for toto in E[to]:if i==toto:continueLIST.append((i,to,toto))POW26=[1]for i in range(10000):POW26.append(POW26[-1]*26%mod)ANS=0for x,y,z in LIST:count=0if S[x]=="a":passelif S[x]=="?":count+=1else:continueif S[y]=="o":passelif S[y]=="?":count+=1else:continueif S[z]=="i":passelif S[z]=="?":count+=1else:continueANS=(ANS+POW26[ko-count])%modprint(ANS)