답안 #291816

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
291816 2020-09-05T20:08:53 Z medmdg Vision Program (IOI19_vision) C++14
46 / 100
12 ms 1272 KB
#include<bits/stdc++.h>
#include "vision.h"
using namespace std;
void construct_network(int H, int W, int K){
    vector<int> hori;
    vector<int> vert;
    int bh=H*W;
    int eh;
    for(int i=0;i<H;i++){
        vector<int> al;
        for(int j=0;j<W;j++){
            al.push_back(j+i*W);
        }
        eh=add_or(al);
        hori.push_back(eh);
    }
    int bv=eh+1;
    int ev;
    for(int i=0;i<W;i++){
        vector<int> al;
        for(int j=i;j<H*W;j+=W){
            al.push_back(j);
        }
        ev=add_or(al);
        vert.push_back(ev);
    }
    vector<int> dishori;
    vector<int> disvert;
    int end=ev;
    vector<int> OH;
    for(int i=bh;i<=eh;i++){
        OH.push_back(i);
    }
    dishori.push_back(add_xor(OH));
    vector<int> OV;
    for(int i=bv;i<=ev;i++){
        OV.push_back(i);
    }
    disvert.push_back(add_xor(OV));
    end+=2;
    for(int i=1;i<=min(H-1,K);i++){
        vector<int> h;
        for(int j=bh;j<=eh-i;j++){
            vector<int> hp;
            hp.push_back(j);
            hp.push_back(j+i);
            end=add_and(hp);
            h.push_back(end);
        }
        if(h.size()){
            dishori.push_back(add_or(h));
            end++;
        }else{
            break;    
        }
    }
    for(int i=1;i<=min(W-1,K);i++){
        vector<int> h;
        for(int j=bv;j<=ev-i;j++){
            vector<int> hp;
            hp.push_back(j);
            hp.push_back(j+i);
            end=add_and(hp);
            h.push_back(end);
        }
        if(h.size()){
            disvert.push_back(add_or(h));
            end++;
        }else{
            break;
        }
    }
    int last;
    for(int i=0;i<=K;i++){
        if((int)(disvert.size())>i&&(int)(dishori.size())>K-i){
            vector<int> f;
            f.push_back(disvert[i]);
            f.push_back(dishori[K-i]);
            last=(add_and(f));
        }
    }
    vector<int> nb;
    for(int i=end+1;i<=last;i++){
        nb.push_back(i);
    }
    last=add_or(nb);
    return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:83:22: warning: 'last' may be used uninitialized in this function [-Wmaybe-uninitialized]
   83 |     for(int i=end+1;i<=last;i++){
      |                     ~^~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 256 KB Output is correct
15 Correct 0 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 256 KB Output is correct
15 Correct 0 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
19 Correct 1 ms 256 KB Output is correct
20 Correct 0 ms 256 KB Output is correct
21 Correct 0 ms 256 KB Output is correct
22 Correct 1 ms 256 KB Output is correct
23 Correct 0 ms 256 KB Output is correct
24 Correct 1 ms 256 KB Output is correct
25 Correct 1 ms 384 KB Output is correct
26 Correct 1 ms 384 KB Output is correct
27 Correct 1 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 256 KB Output is correct
15 Correct 0 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
19 Correct 1 ms 256 KB Output is correct
20 Correct 0 ms 256 KB Output is correct
21 Correct 0 ms 256 KB Output is correct
22 Correct 1 ms 256 KB Output is correct
23 Correct 0 ms 256 KB Output is correct
24 Correct 1 ms 256 KB Output is correct
25 Correct 1 ms 384 KB Output is correct
26 Correct 1 ms 384 KB Output is correct
27 Correct 1 ms 384 KB Output is correct
28 Correct 1 ms 384 KB Output is correct
29 Correct 1 ms 384 KB Output is correct
30 Correct 1 ms 384 KB Output is correct
31 Correct 1 ms 384 KB Output is correct
32 Correct 1 ms 384 KB Output is correct
33 Correct 1 ms 384 KB Output is correct
34 Correct 1 ms 384 KB Output is correct
35 Correct 2 ms 384 KB Output is correct
36 Correct 1 ms 384 KB Output is correct
37 Correct 1 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 256 KB Output is correct
15 Correct 0 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
19 Correct 1 ms 256 KB Output is correct
20 Correct 0 ms 256 KB Output is correct
21 Correct 0 ms 256 KB Output is correct
22 Correct 1 ms 256 KB Output is correct
23 Correct 0 ms 256 KB Output is correct
24 Correct 1 ms 256 KB Output is correct
25 Correct 1 ms 384 KB Output is correct
26 Correct 1 ms 384 KB Output is correct
27 Correct 1 ms 384 KB Output is correct
28 Correct 1 ms 384 KB Output is correct
29 Correct 1 ms 384 KB Output is correct
30 Correct 1 ms 384 KB Output is correct
31 Correct 1 ms 384 KB Output is correct
32 Correct 1 ms 384 KB Output is correct
33 Correct 1 ms 384 KB Output is correct
34 Correct 1 ms 384 KB Output is correct
35 Correct 2 ms 384 KB Output is correct
36 Correct 1 ms 384 KB Output is correct
37 Correct 1 ms 384 KB Output is correct
38 Correct 10 ms 1148 KB Output is correct
39 Correct 2 ms 512 KB Output is correct
40 Correct 5 ms 768 KB Output is correct
41 Correct 3 ms 512 KB Output is correct
42 Correct 7 ms 1020 KB Output is correct
43 Correct 3 ms 512 KB Output is correct
44 Correct 9 ms 1148 KB Output is correct
45 Incorrect 3 ms 1148 KB WA in grader: Too many instructions
46 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 3 ms 1148 KB WA in grader: Too many instructions
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 4 ms 640 KB Output is correct
5 Correct 5 ms 768 KB Output is correct
6 Correct 6 ms 892 KB Output is correct
7 Correct 8 ms 892 KB Output is correct
8 Correct 2 ms 512 KB Output is correct
9 Correct 7 ms 1020 KB Output is correct
10 Correct 10 ms 1272 KB Output is correct
11 Incorrect 3 ms 1148 KB WA in grader: Too many instructions
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 1152 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 7 ms 768 KB Output is correct
8 Correct 6 ms 768 KB Output is correct
9 Correct 12 ms 1152 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 1 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 256 KB Output is correct
15 Correct 0 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
19 Correct 1 ms 256 KB Output is correct
20 Correct 0 ms 256 KB Output is correct
21 Correct 0 ms 256 KB Output is correct
22 Correct 1 ms 256 KB Output is correct
23 Correct 0 ms 256 KB Output is correct
24 Correct 1 ms 256 KB Output is correct
25 Correct 1 ms 384 KB Output is correct
26 Correct 1 ms 384 KB Output is correct
27 Correct 1 ms 384 KB Output is correct
28 Correct 1 ms 384 KB Output is correct
29 Correct 1 ms 384 KB Output is correct
30 Correct 1 ms 384 KB Output is correct
31 Correct 1 ms 384 KB Output is correct
32 Correct 1 ms 384 KB Output is correct
33 Correct 1 ms 384 KB Output is correct
34 Correct 1 ms 384 KB Output is correct
35 Correct 2 ms 384 KB Output is correct
36 Correct 1 ms 384 KB Output is correct
37 Correct 1 ms 384 KB Output is correct
38 Correct 10 ms 1148 KB Output is correct
39 Correct 2 ms 512 KB Output is correct
40 Correct 5 ms 768 KB Output is correct
41 Correct 3 ms 512 KB Output is correct
42 Correct 7 ms 1020 KB Output is correct
43 Correct 3 ms 512 KB Output is correct
44 Correct 9 ms 1148 KB Output is correct
45 Incorrect 3 ms 1148 KB WA in grader: Too many instructions
46 Halted 0 ms 0 KB -