# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
494923 | uncripted | Fountain (eJOI20_fountain) | C++11 | 529 ms | 35352 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//unfin
#include<bits/stdc++.h>
#define s second
#define f first
using namespace std;
pair<long long,long long> go[100005][20];
long long par[100005];
long long d[100005];
long long c[100005];
int main(){
long long n,q;
cin>>n>>q;
for(long long i=1; i<=n; i++){
cin>>d[i];
cin>>c[i];
}
d[n+1]=INT_MAX;
d[0]=INT_MAX;
stack<long long> s;
s.push(n+1);
for(long long i=n; i>=1; i--){
while(d[i]>=d[s.top()]){
s.pop();
}
go[i][0].s=s.top();
par[s.top()]=i;
go[i][0].f=c[i];
s.push(i);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |