| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 975964 | vjudge1 | Fountain (eJOI20_fountain) | C++17 | 255 ms | 4436 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// bismillah subtask gampang
int main() {
int soal, elang;
cin >> soal >> elang;
vector<int> prefsum(soal + 1, 0);
for (int i = 1; i <= soal; i++)
{
int x, y;
cin >> x >> y;
prefsum[i] = prefsum[i - 1] + y;
}
for (int i = 0; i < elang; i++)
{
int l, c;
cin >> l >> c;
int idx = upper_bound(prefsum.begin(), prefsum.end(), prefsum[l - 1] + c) - prefsum.begin();
cout << (idx == (soal + 1) ? 0 : idx) << endl;
}
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
