# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
222463 | rainy | Grudanje (COCI19_grudanje) | C++14 | 58 ms | 4476 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define MAXN 112345
#define MAXQ 112345
using namespace std;
char wd[MAXN];
int N;
int Q,A[MAXQ],B[MAXQ];
int P[MAXN];
bool st3=true;
int ss[MAXQ];
bool isp(){
for(int i=0;i<Q;i++)
if(ss[i]>0)return false;
return true;
}
int main(){
scanf("%s",&wd);
for(int i=0;i<10;i++){
if(wd[i]!='a'&&wd[i]!='\0')st3=false;
if(wd[i]=='\0'){N=i;break;}
}
scanf("%d",&Q);
for(int i=0;i<Q;i++){scanf("%d%d",&A[i],&B[i]);A[i]--;B[i]--;}
for(int i=0;i<N;i++){
scanf("%d",&P[i]);
P[i]--;
}
memset(ss,0,sizeof(ss));
assert(st3);
if(st3){
for(int i=0;i<Q;i++){
ss[i]=B[i]-A[i];
printf("%d: %d, %d, %d\n",i,ss[i],B[i],A[i]);
}
if(isp()){
printf("0\n");return 0;
}
for(int i=0;i<N;i++){
//printf("i=%d\n",i);
for(int j=0;j<Q;j++){
if(A[j]<=P[i]&&P[i]<=B[j]){ss[j]--;}
}
if(isp()){
printf("%d\n",i+1);
return 0;
}
}
}
return 0;
}
Compilation message (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... |
# | 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... |