답안 #1026317

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1026317 2024-07-17T22:12:51 Z HD1 Vision Program (IOI19_vision) C++14
14 / 100
5 ms 1240 KB
#include "vision.h"
#include<bits/stdc++.h>
#define sz(x) ll(x.size())
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
const ll MAX=1e6;
int n, m, k;
vector<int>c,z,f,q, ans;
void looks(int dist_c, int dist_f){
    int aux=dist_c;
    int a=1, b=1;
    //cout<<"aa "<<dist_c<<' '<<dist_f<<'\n';
    for(int i=0; i<sz(c)-dist_c; i++){
        z.pb(add_and({c[i],c[aux]}));
        aux++;
    }
    aux=dist_f;
    //cout<<"ss"<<'\n';
    for(int i=0; i<sz(f)-dist_f; i++){
        q.pb(add_and({f[i],f[aux]}));
        aux++;
    }
    if(!(sz(z) && sz(q)))return;
     a=add_or(z);
     b=add_or(q);
    ans.pb(add_and({a,b}));
    q.clear();
    z.clear();
    //cout<<"ns"<<'\n';
}
void construct_network(int H, int W, int K){
	n=H;
	m=W;
	k=K;
    for(int i=0; i<n; i++){//por filas
        for(int j=0; j<m; j++){
            q.pb(i*m+j);
        }
        f.pb(add_or(q));
        q.clear();
    }
    for(int j=0; j<m; j++){//por columnas
        for(int i=0; i<n; i++){
            z.pb(i*m+j);
        }
        c.pb(add_or(z));
        z.clear();
    }
    //diferentes columnas y filas
    for(int dis=1; dis<k; dis++){
        looks(dis, k-dis);
    }
    //cout<<"avocado???????????????????????????????????"<<'\n';
    int a=add_or({add_xor(c),add_xor(f)});//debe ser 1 else 0
    //cout<<a<<" waaaaaaaaaaa"<<'\n';
    z.clear();
    q.clear();
    //igual columna
    int aux=k;
    for(int i=0; i<sz(c)-k; i++){
        z.pb(add_and({c[i],c[aux]}));
        aux++;
    }
    int b=0;
    if(sz(z)){
        b=add_and({a,add_or(z)});
        ans.pb(b);
    }
    //cout<<sz(ans)<<"<<<<<<<<"<< '\n';
    // igual fila
    aux=k;
    for(int i=0; i<sz(f)-k; i++){
        q.pb(add_and({f[i],f[aux]}));
        aux++;
    }
    if(sz(q)){
        //cout<<"nsssss"<<'\n';
        b=add_and({a,add_or(q)});
        ans.pb(b);
    }
    add_or(ans);
    return;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Incorrect 0 ms 348 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Incorrect 0 ms 348 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Incorrect 0 ms 348 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Incorrect 0 ms 348 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 1 ms 1240 KB WA in grader: Too many instructions
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
5 Correct 2 ms 860 KB Output is correct
6 Correct 2 ms 860 KB Output is correct
7 Incorrect 2 ms 860 KB on inputs (0, 0), (100, 27), expected 0, but computed 1
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 1116 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 2 ms 860 KB Output is correct
8 Correct 3 ms 860 KB Output is correct
9 Correct 5 ms 1112 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Incorrect 0 ms 348 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
10 Halted 0 ms 0 KB -