# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1028561 | 2024-07-20T04:47:01 Z | onbert | Vision Program (IOI19_vision) | C++17 | 21 ms | 3304 KB |
#include "vision.h" #include <bits/stdc++.h> using namespace std; int n, m; int id(int x, int y) { return x*m + y; } void construct_network(int N, int M, int k) { n = N, m = M; int nn[2] = {n, m}; int ok[4]; for (int I=0;I<=1;I++) { int sz = nn[I], kn = min(k, sz-1); vector<int> OR(sz), XOR(sz), NOTXOR(sz), TWO(sz), range; for (int i=0;i<sz;i++) { vector<int> cur; if (I==0) for (int j=0;j<m;j++) cur.push_back(id(i, j)); else for (int j=0;j<n;j++) cur.push_back(id(j, i)); OR[i] = add_or(cur); XOR[i] = add_xor(cur); NOTXOR[i] = add_not(XOR[i]); TWO[i] = add_and({NOTXOR[i], OR[i]}); } for (int l=0, r=kn; r<sz; l++, r++) { // if (I==1) cout << l << " " << r << endl; vector<int> cur; for (int j=l;j<=r;j++) cur.push_back({OR[j]}); int x = add_or(cur), y = add_xor(cur), z = add_not(y); range.push_back(add_and({x, z})); } vector<int> ck = TWO; for (int x:range) ck.push_back(x); ok[I] = add_or(ck); } for (int I=2;I<=3;I++) { int sz = nn[I]; vector<int> OR; if (I==2) { for (int i=-n+1;i<m;i++) { vector<int> cur; for (int x=0, y=i; x<n; x++, y++) { if (x>=0 && x<n && y>=0 && y<m) cur.push_back(id(x, y)); } if (cur.size()!=0) OR.push_back(add_or(cur)); } } else if (I==3) { for (int i=0;i<2*m;i++) { vector<int> cur; for (int x=0, y=i; x<n; x++, y--) { if (x>=0 && x<n && y>=0 && y<m) cur.push_back(id(x, y)); } if (cur.size()!=0) OR.push_back(add_or(cur)); } } vector<int> range; for (int l=0, r=k; r<OR.size(); l++, r++) { // cout << l << " " << r << endl; range.push_back(add_and({OR[l], OR[r]})); } ok[I] = add_or(range); } int diag = add_or({ok[2], ok[3]}); int a = add_and({ok[0]}), b = add_and({ok[1]}), c = add_and({ok[2]}), d = add_and({ok[3]}); int ans = add_and({ok[0], ok[1], diag}); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 360 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Incorrect | 0 ms | 348 KB | WA in grader: Instruction with no inputs |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 360 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Incorrect | 0 ms | 348 KB | WA in grader: Instruction with no inputs |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 360 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Incorrect | 0 ms | 348 KB | WA in grader: Instruction with no inputs |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 360 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Incorrect | 0 ms | 348 KB | WA in grader: Instruction with no inputs |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 604 KB | Output is correct |
2 | Correct | 2 ms | 604 KB | Output is correct |
3 | Correct | 2 ms | 604 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Incorrect | 0 ms | 388 KB | WA in grader: Instruction with no inputs |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 436 KB | Output is correct |
3 | Correct | 2 ms | 676 KB | Output is correct |
4 | Correct | 2 ms | 604 KB | Output is correct |
5 | Incorrect | 0 ms | 348 KB | WA in grader: Instruction with no inputs |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 2948 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 644 KB | Output is correct |
4 | Correct | 3 ms | 860 KB | Output is correct |
5 | Correct | 1 ms | 604 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 7 ms | 1628 KB | Output is correct |
8 | Correct | 8 ms | 1628 KB | Output is correct |
9 | Correct | 21 ms | 3304 KB | Output is correct |
10 | Correct | 0 ms | 344 KB | Output is correct |
11 | Correct | 0 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 360 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Incorrect | 0 ms | 348 KB | WA in grader: Instruction with no inputs |
5 | Halted | 0 ms | 0 KB | - |