# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
576665 | 2022-06-13T09:01:00 Z | Yazan_SA | Exam (eJOI20_exam) | C++14 | 1000 ms | 1108 KB |
#include<bits/stdc++.h> #define ll long long #define endl "\n" #define start cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); using namespace std; int main() { start //freopen("survive.in", "r", stdin); int t=1; //cin>>t; while(t--) { int n, arr[100000], arrb[100000]; cin>>n; int ans=0; for(int i=0; i<n; cin>>arr[i++]); for(int i=0; i<n; cin>>arrb[i++]); for(int i=0; i<n; i++) { int mx=-1, mn=1e9; bool is=1; if(arr[i]>arrb[i]) continue; if(arr[i]==arrb[i]) { ans++; is=0; continue; } for(int j=i-1; j>=0&&is; j--) { mx=max(mx, arr[j]); mn=min(mn, arrb[j]); if(arrb[i]==arr[j] && mx<=mn || j==i-1 && arrb[i]==arr[j]) { ans++; is=0; } } mx=-1; mn=1e9; for(int j=i+1; j<n&&is; j++) { mx=max(mx, arr[j]); mn=min(mn, arrb[j]); if(arrb[i]==arr[j] && mx<=mn || j==i+1 && arrb[i]==arr[j]) { ans++; is=0; } } } cout<<ans; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 1096 KB | Output is correct |
2 | Correct | 1 ms | 1100 KB | Output is correct |
3 | Incorrect | 1 ms | 980 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1108 KB | Output is correct |
2 | Correct | 5 ms | 1108 KB | Output is correct |
3 | Execution timed out | 1067 ms | 1108 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 980 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 18 ms | 1100 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 1096 KB | Output is correct |
2 | Correct | 1 ms | 1100 KB | Output is correct |
3 | Incorrect | 1 ms | 980 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 1096 KB | Output is correct |
2 | Correct | 1 ms | 1100 KB | Output is correct |
3 | Incorrect | 1 ms | 980 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |