답안 #1021455

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1021455 2024-07-12T18:28:21 Z vjudge1 Vision Program (IOI19_vision) C++17
0 / 100
3 ms 1240 KB
#include "vision.h"
#include<vector>
#include<iostream>
using namespace std;

void construct_network(int H, int W, int K){
    int x,y,p;
    vector<int>r;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            vector<int>t;
            for(int k=0;k<K;k++){
                x=i+k;
                y=j-K+k;
                if(0<=x&&x<H&&0<=y&&y<W)t.push_back(x*W+y);
                x=i+K-k;
                y=j+k;
                if(0<=x&&x<H&&0<=y&&y<W)t.push_back(x*W+y);
            }
            if(!t.empty()){
                p=t[0];
                for(int k=1;k<t.size();k++)p=add_or({p,t[k]});
            }
            p=add_and({p,i*W+j});
            r.push_back(p);
        }
    }
    p=r[0];
    for(int i=1;i<r.size();i++)p=add_or({p,r[i]});
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:22:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |                 for(int k=1;k<t.size();k++)p=add_or({p,t[k]});
      |                             ~^~~~~~~~~
vision.cpp:29:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     for(int i=1;i<r.size();i++)p=add_or({p,r[i]});
      |                 ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 600 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 3 ms 1020 KB Output is correct
4 Incorrect 1 ms 984 KB WA in grader: Too many instructions
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1240 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -