# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
726890 | 2023-04-19T13:46:40 Z | kerem | Slagalica (COCI19_slagalica2) | C++14 | 67 ms | 340 KB |
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define fir first #define sec second #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); int32_t main(){ int n,k=0,l,r,a,b,c,d,i,j,sayac=1; cin >> n; for(int ind=0;ind<n;ind++){ int x,y; cin >> x >> y; if(x==5) l=1,a=y,k++; else if(x==6) l=0,a=y,k--; else if(x==7) r=1,d=y,k++; else if(x==8) r=0,d=y,k--; else if(sayac==1) i=x,b=y,sayac++; else j=x,c=y; if(x==1) k+=2; if(x==4) k-=2; } if(k!=0){ cout << -1; return 0; } cout << a << " "; if(n==3){ if(i==2 and l==1){ cout << -1; return 0; } if(i==3 and l==0){ cout << -1; return 0; } cout << b << " "; } if(n==4){ if(i>j) {int temp=i;i=j;j=temp;temp=b;b=c;c=temp;} if(i==1 and j==2) cout << c << " " << b << " "; if(i==1 and j==3) cout << b << " " << c << " "; if(i==1 and j==4){ if(l==0) cout << b << " " << c << " "; else cout << c << " " << b << " "; } if(i==2 and j==2){ if(l==1){ cout << -1; return 0; } cout << min(c,b) << " " << max(c,b) << " "; } if(i==2 and j==4) cout << c << " " << b << " "; if(i==3 and j==3){ if(l==0){ cout << -1; return 0; } cout << min(c,b) << " " << max(c,b) << " "; } if(i==3 and j==4) cout << b << " " << c << " "; } cout << d; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 67 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 41 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 54 ms | 212 KB | Output is correct |
2 | Incorrect | 46 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 40 ms | 212 KB | Output is correct |
2 | Incorrect | 42 ms | 276 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 47 ms | 288 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 45 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 45 ms | 280 KB | Output is correct |
2 | Incorrect | 43 ms | 288 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 51 ms | 276 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 51 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 48 ms | 284 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 41 ms | 276 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 41 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |