結果
| 問題 | No.1765 While Shining | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-02-07 10:45:36 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 150 ms / 2,000 ms | 
| コード長 | 186 bytes | 
| コンパイル時間 | 89 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 14,728 KB | 
| 最終ジャッジ日時 | 2024-06-12 01:07:28 | 
| 合計ジャッジ時間 | 4,088 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 22 | 
ソースコード
#yuki1765 n=int(input()) a=list(map(int,input().split())) cnt=0 x=0 if a[0]==1: x=1 for i in range(1,n): if a[i]!=a[i-1]: cnt+=x else: cnt+=x x=0 if a[i]==1: x+=1 print(cnt)
