# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
878877 | AndreasK | Fountain (eJOI20_fountain) | C++14 | 279 ms | 5112 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,Q;
cin>>N>>Q;
int c;
pair <int,int> A[N];//diameter capacity
int ps[N];
for (c=0;c<N;c++){
cin>>A[c].first>>A[c].second;
if (c==0)
ps[c]=A[c].second;
else
ps[c]=ps[c-1]+A[c].second;
}
while (Q--){
int where,how_many;
cin>>where>>how_many;
where--;int mx=0;
int start=where;
int stop=N-1;
while (start<stop){
int mid=(start+stop)/2;
if (ps[mid]<how_many)
start=mid+1;
else
stop=mid-1;
}
if (start!=N+1)
cout<<start<<'\n';
else
cout<<0<<'\n';
}
return 0;}
컴파일 시 표준 에러 (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... |