結果
問題 | No.1505 Zero-Product Ranges |
ユーザー |
![]() |
提出日時 | 2023-06-18 22:22:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 45 ms / 2,000 ms |
コード長 | 265 bytes |
コンパイル時間 | 2,061 ms |
コンパイル使用メモリ | 191,948 KB |
最終ジャッジ日時 | 2025-02-14 22:45:55 |
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 49 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main(){ll N, A, ans=0, l=-1;cin >> N;for (int i=0; i<N; i++){cin >> A;if (A == 0) l=i;ans += l+1;}cout << ans << endl;return 0;}