結果
問題 | No.1505 Zero-Product Ranges |
ユーザー |
![]() |
提出日時 | 2023-09-10 03:23:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 711 bytes |
コンパイル時間 | 1,702 ms |
コンパイル使用メモリ | 192,816 KB |
最終ジャッジ日時 | 2025-02-16 20:55:32 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 48 |
ソースコード
#include <bits/stdc++.h> #include<iostream> #include<map> #include<vector> #include <algorithm> #include<math.h> #include <iomanip> #include<set> #include <numeric> #include<string> using ll = long long; using namespace std; int main() { ll n, cnt = 0, t; cin >> n; for (int i = 0; i < n; i++){ cin >> t; if (t == 0){ cnt += n - i; continue; } if (t == 1){ for (int j = i + 1; j < n; j++){ cin >> t; if (t == 0){ cnt += (n - j)*(j - i + 1); i = j; break; } } } } cout << cnt << endl; }