# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
957757 | I_am_Polish_Girl | Bigger segments (IZhO19_segments) | C++14 | 1 ms | 348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <cmath>
#include <random>
#include <chrono>
using namespace std;
#define int long long
int log_ = 10;
int inf = 1000000000000000000;
int mod = 998244353;
signed main()
{
ios_base::sync_with_stdio();
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
vector <int> a(n);
vector <int> pref;
int pr = 0;
pref.push_back(0);
for (int i = 0; i < n; i++)
{
cin >> a[i];
pr += a[i];
pref.push_back(pr);
}
int l = 0;
int r = pref[1];
int col = 1;
while (true)
{
int x = r + r - l;
if (x > pref[pref.size() - 1])
{
break;
}
col++;
int ind = lower_bound(pref.begin(), pref.end(), x) - pref.begin();
int lx = l;
l = r;
r = pref[ind];
int m = (r + lx + 1) / 2;
ind = lower_bound(pref.begin(), pref.end(), x) - pref.begin();
ind--;
l = pref[ind];
}
cout << col;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |