답안 #824692

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
824692 2023-08-14T08:53:05 Z Magikarp4000 Vision Program (IOI19_vision) C++17
0 / 100
3 ms 1360 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define OPTM ios_base::sync_with_stdio(0); cin.tie(0);
#define INF int(1e9+7)
#define ln '\n' 
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define FOR(i,s,n) for (int i = s; i < n; i++)
#define FORR(i,n,s) for (int i = n; i > s; i--)
#define FORX(u, arr) for (auto u : arr)
#define PB push_back
#define F first
#define S second
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define UM unordered_map
#define US unordered_set
#define PQ priority_queue
#define ALL(v) v.begin(), v.end()
const ll LLINF = 1e18+1;

void construct_network(int H, int W, int K) {
    int cur = H*W;
    // everything
    FOR(i,0,H) {
        vector<int> v;
        FOR(j,0,W) v.PB(i*W+j);
        add_or(v);
        cur++;
    }
    FOR(j,0,W) {
        vector<int> v;
        FOR(i,0,H) v.PB(i*W+j);
        add_or(v);
        cur++;
    }
    // row
    int base = H*W;
    FOR(i,0,H) {
        FOR(j,0,H-i) {
            vector<int> v = {base+j, base+j+i};
            add_and(v);
            cur++;
        }
    }
    base = H*W+H+W;
    int rst = cur;
    FOR(i,0,H) {
        vector<int> v;
        FOR(j,0,H-i) v.PB(base+j);
        add_or(v);
        cur++;
        base += H-i;
    }
    
    int ren = cur;
    // col
    base = H*W+H;
    FOR(i,0,W) {
        FOR(j,0,W-i) {
            vector<int> v = {base+j, base+j+i};
            add_and(v);
            cur++;
        }
    }
    base = ren;
    int cst = cur;
    FOR(i,0,W) {
        vector<int> v;
        FOR(j,0,W-i) v.PB(base+j);
        add_or(v);
        cur++;
        base += W-i;
    }
    int cen = cur;
    // sum
    FOR(i,0,K+1) {
        if (i > H-1 || K-i > W-1) continue;
        vector<int> v = {rst+i, cst+K-i};
        add_and(v);
        cur++;
    }
    int sen = cur;
    // final
    vector<int> v;
    FOR(i,cen,sen) v.PB(i);
    add_or(v);
    cur++;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 976 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 1360 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -