# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
921495 | Batorgil952 | Matching (CEOI11_mat) | C++14 | 2052 ms | 23980 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 ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
using namespace std;
const int N=1e6+6;
int a[N], b[N], c[N], d[N];
vector< int > v;
int main(){
int n, m, i, j, p, vn;
scanf("%d",&n);
scanf("%d",&m);
for(i=1; i<=n; i++){
scanf("%d",&b[i]);
c[b[i]]=i;
}
for(i=1; i<=m; i++){
scanf("%d",&a[i]);
}
for(i=1; i<=m-n+1; i++){
p=0;
for(j=1; j<n; j++){
if(a[b[j]+i-1]>a[b[j+1]+i-1]) p++, j=n;
}
if(p==0){
v.pb(i);
}
}
vn=v.size();
printf("%d\n", vn);
for(i=0; i<vn; i++){
printf("%d ", v[i]);
}
printf("\n");
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |