結果
| 問題 |
No.2742 Car Flow
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-21 14:48:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 203 bytes |
| コンパイル時間 | 437 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 98,560 KB |
| 最終ジャッジ日時 | 2024-10-13 13:34:43 |
| 合計ジャッジ時間 | 5,947 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 WA * 46 |
ソースコード
N=int(input())
A=list(map(int,input().split()))
sum=sum(A)
if sum==0 or sum==N:print(0)
MOD=998244353
cnt=0
for i in range(N):
if A[i]==0 and A[(i+1)%N]==1:cnt+=1
ans=cnt*pow(N,-1,MOD)%MOD
print(ans)