답안 #152217

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
152217 2019-09-06T19:37:10 Z stefdasca Vision Program (IOI19_vision) C++14
0 / 100
3 ms 760 KB
#include "vision.h"
#include<bits/stdc++.h>

using namespace std;
vector<int> fct(int K, vector<int>mn)
{
    vector<int>k1;
    for(int i = K; i < mn.size(); ++i)
        k1.push_back(add_xor({add_and({mn[i-K], mn[i]})}));
    return k1;
}
void construct_network(int H, int W, int K)
{
    vector<int>mn, sc;
    for(int i = H - 1; i >= 0; --i)
    {
        vector<int>pz;
        for(int a = i, b = 0; a < H && b < W; ++a, ++b)
            pz.push_back(a * W + b);
        if(i == H-1)
            mn.push_back(add_xor(pz));
        else
            mn.push_back(add_xor({mn.back(), add_xor(pz)}));
    }
    for(int i = 1; i < W; ++i)
    {
        vector<int>pz;
        for(int a = 0, b = i; a < H && b < W; ++a, ++b)
            pz.push_back(a * W + b);
        mn.push_back(add_xor({mn.back(), add_xor(pz)}));
    }
    for(int i = 0; i < W; ++i)
    {
        vector<int>pz;
        for(int a = 0, b = i; a < H && b >= 0; ++a, --b)
            pz.push_back(a * W + b);
        if(i == H-1)
            sc.push_back(add_xor(pz));
        else
            sc.push_back(add_xor({sc.back(), add_xor(pz)}));
    }
    for(int i = 1; i < H; ++i)
    {
        vector<int>pz;
        for(int a = i, b = W - 1; a < H && b >= 0; ++a, --b)
            pz.push_back(a * W + b);
        sc.push_back(add_xor({sc.back(), add_xor(pz)}));
    }
    add_and({add_or({add_or(fct(K-1, mn)), add_or(fct(K-1, sc))}), add_not(add_or(fct(K, mn))), add_not(add_or(fct(K, sc)))});
}

Compilation message

vision.cpp: In function 'std::vector<int> fct(int, std::vector<int>)':
vision.cpp:8:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = K; i < mn.size(); ++i)
                    ~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Runtime error 2 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Runtime error 2 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Runtime error 2 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Runtime error 2 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 504 KB Output is correct
2 Correct 3 ms 504 KB Output is correct
3 Correct 3 ms 504 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 760 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Runtime error 2 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -