답안 #817150

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
817150 2023-08-09T09:52:01 Z Pikachu Vision Program (IOI19_vision) C++17
0 / 100
1 ms 304 KB
#include <bits/stdc++.h>
#include "vision.h"

using namespace std;


const int maxprime = 46;
int prime[46] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199};

const int maxn = 210;
int n, m, k;
int row[maxn];
int col[maxn];
int row2[maxn];
int col2[maxn];

int getIndex(int x, int y)
{
    return x * m + y;
};

void solvemax100()
{
    for (int i = 0; i < n; i++) {
        vector<int> tmp;
        for (int j = 0; j < m; j++) {
            tmp.push_back(getIndex(i, j));
        }
        row[i] = add_or(tmp);
    }

    for (int j = 0; j < m; j++) {
        vector<int> tmp;
        for (int i = 0; i < n; i++) {
            tmp.push_back(getIndex(i, j));
        }
        col[j] = add_or(tmp);
    }

    for (int i = 1; i < n; i++) {
        vector<int> tmp;
        for (int j = 0; j + i < n; j++) {
            tmp.push_back(add_and({row[j], row[j + i]}));
        }
        row2[i] = (int)tmp.size() == 1 ? tmp.back() : add_or(tmp);
    }
    row2[0] = n == 1 ? : add_not(add_or(vector<int>(row2 + 1, row2 + n)));
    
    for (int i = 1; i < m; i++) {
        vector<int> tmp;
        for (int j = 0; j + i < m; j++) {
            tmp.push_back(add_and({col[j], col[j + i]}));
        }
        col2[i] = (int)tmp.size() == 1 ? tmp.back() : add_or(tmp);
    }
    col2[0] = m == 1 ? 1 : add_not(add_or(vector<int>(col2 + 1, col2 + m)));

    vector<int> tmp;
    for (int i = 0; i <= min(n - 1, k); i++) {
        int j = k - i;
        if (!(0 <= j <= m)) continue;
        tmp.push_back(add_and({row2[i], col2[j]}));
    }

    add_or(tmp);
}

void solvemin1()
{

}

void solve00()
{

}

void solvek1()
{

}

void construct_network(int n, int m, int k) 
{
    ::n = n;
    ::m = m;
    ::k = k;
    if (max(n, m) <= 100) solvemax100();
    else if (min(n, m) == 1) solvemin1();
    else if (k == 1) solvek1();
    else solve00();
}

Compilation message

vision.cpp: In function 'void solvemax100()':
vision.cpp:47:24: warning: the omitted middle operand in '?:' will always be 'true', suggest explicit middle operand [-Wparentheses]
   47 |     row2[0] = n == 1 ? : add_not(add_or(vector<int>(row2 + 1, row2 + n)));
      |                        ^
vision.cpp:61:17: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses]
   61 |         if (!(0 <= j <= m)) continue;
      |               ~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 304 KB on inputs (0, 0), (0, 2), expected 1, but computed 0
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 304 KB on inputs (0, 0), (0, 2), expected 1, but computed 0
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 304 KB on inputs (0, 0), (0, 2), expected 1, but computed 0
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 304 KB on inputs (0, 0), (0, 2), expected 1, but computed 0
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Integer parameter [name=num_gates] equals to 0, violates the range [1, 10000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Integer parameter [name=num_gates] equals to 0, violates the range [1, 10000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 304 KB on inputs (0, 0), (0, 2), expected 1, but computed 0
3 Halted 0 ms 0 KB -