# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1055812 | 2024-08-13T05:47:57 Z | 캐나다 선발고사 레전드(#11109) | Pizza Party (CCO24_day1problem2) | C++17 | 251 ms | 22100 KB |
#include <bits/stdc++.h> using namespace std; int n; int a[1000001]; int b[1000001]; int ra[1000001]; int rb[1000001]; int r0[1000001]; int r1[1000001]; typedef pair<int,int> P; vector<P> v; int main(void) { scanf("%d",&n); bool flag=true; int c1=0; for(int i=1;i<=n;i++) { scanf("%d",&a[i]); if (a[i]==1) { c1++; } } for(int i=1;i<=n;i++) { scanf("%d",&b[i]); if (b[i]==1) { c1--; } if (b[i]!=a[n+1-i]) { flag=false; } } if (c1!=0) { printf("-1"); return 0; } if (flag) { printf("1\n"); for(int i=1;i<=n;i++) { printf("1"); if (i!=n) { printf(" "); } } printf("\n"); for(int i=1;i<=n;i++) { printf("1"); if (i!=n) { printf(" "); } } return 0; } printf("2\n"); printf("1\n"); for(int i=1;i<=n;i++) { printf("%d",a[i]); if (i!=n) { printf(" "); } } printf("\n"); for(int i=1;i<=n;i++) { printf("%d",b[i]); if (i!=n) { printf(" "); } } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 180 ms | 12236 KB | Expected EOLN |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Integer element c_i[2] equals to 3140, violates the range [1, 2] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 251 ms | 22100 KB | Integer element c_i[2] equals to 134990, violates the range [1, 2] |
2 | Halted | 0 ms | 0 KB | - |