# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1000377 | 2024-06-17T10:47:02 Z | vjudge1 | Exam (eJOI20_exam) | C++17 | 3 ms | 604 KB |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; vector<int> vec1,vec2; for(int n1=n;n1>0;n1--) { int x; cin>>x; vec1.push_back(x); } for(int n1=n;n1>0;n1--) { int x; cin>>x; vec2.push_back(x); } if(n<=10) { int br=0; int ress=0; for(;br<1<<n;br++) { bool b[vec1.size()]={false}; for(int i=0,br2=br;i<vec1.size();i++,br2=br2>>1) { if(br2&1==1) { b[i]=true; } } int res=0; for(int i=0;i<vec1.size();i++) { if(b[i]==true) { int maxx=vec1[i]; int j=i+1; for(;j<vec1.size() && b[j]==true;j++) { maxx=max(maxx,vec1[j]); } j--; for(int k=i;k<=j;k++) { if(vec2[k]==maxx) res++; } i=j; } else { if(vec1[i]==vec2[i]) res++; } } ress=max(ress,res); } cout<<ress; } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Incorrect | 0 ms | 348 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 596 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 604 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Incorrect | 0 ms | 348 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Incorrect | 0 ms | 348 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |