답안 #755696

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
755696 2023-06-10T15:05:45 Z Rafi22 Vision Program (IOI19_vision) C++14
0 / 100
12 ms 1616 KB
#include <bits/stdc++.h>
#include "vision.h"


using namespace std;

#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define ll long long
ll mod=1000000007;
int inf=1000000007;
ll infl=1000000000000000007;

int it;

const int N=207;

int orX[N];
int pX[N];
int orY[N];
int pY[N];

/*
int add_not(int x)
{
    it++;
    cout<<it<<endl;
    cout<<"NOT "<<x<<endl;
    return it;
}
int add_or(vector<int>x)
{
    it++;
    cout<<it<<endl;
    cout<<"OR ";
    for(auto a:x) cout<<a<<" ";
    cout<<endl;
    return it;
}
int add_xor(vector<int>x)
{
    it++;
    cout<<it<<endl;
    cout<<"XOR ";
    for(auto a:x) cout<<a<<" ";
    cout<<endl;
    return it;
}
int add_and(vector<int>x)
{
    it++;
    cout<<it<<endl;
    cout<<"AND ";
    for(auto a:x) cout<<a<<" ";
    cout<<endl;
    return it;
}*/

vector<int>add(vector<int>V,int k)
{
    vector<int>res;
    res.pb(add_xor({V[0],k}));
    int w=add_and({V[0],k});
    for(int i=1;i<=8;i++)
    {
        res.pb(add_xor({V[i],w}));
        w=add_and({V[i],w});
    }
    return res;
}

void construct_network(int n,int m,int k)
{
    it=n*m-1;
    int N=add_not(0);
    for(int i=0;i<n;i++)
    {
        vector<int>V;
        for(int j=0;j<m;j++) V.pb(i*m+j);
        orX[i]=add_or(V);
    }
    pX[0]=add_and({0,N});
    for(int i=1;i<=n;i++) pX[i]=add_xor({pX[i-1],orX[i-1]});
    for(int j=0;j<m;j++)
    {
        vector<int>V;
        for(int i=0;i<n;i++) V.pb(i*m+j);
        orY[j]=add_or(V);
    }
    pY[0]=add_and({0,N});
    for(int j=1;j<=m;j++) pY[j]=add_xor({pY[j-1],orY[j-1]});
    vector<int>ans;
    for(int i=0;i<=8;i++) ans.pb(add_and({0,N}));
    for(int i=1;i<=n;i++) ans=add(ans,pX[i]);
    for(int j=1;j<=m;j++) ans=add(ans,pY[j]);
    int Z=add_and({0,N});
    int O=add_not(Z);
    vector<int>wyn;
    for(int i=0;i<=8;i++)
    {
        if(k&(1<<i)) wyn.pb(add_xor({Z,ans[i]}));
        else wyn.pb(add_xor({O,ans[i]}));
    }
    add_and(wyn);
}

/*
int main()
{
    construct_network(2,3,2);
    return 0;
}
*/
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 596 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 1616 KB on inputs (80, 199), (81, 199), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -