Submission #291763

# Submission time Handle Problem Language Result Execution time Memory
291763 2020-09-05T18:41:03 Z medmdg Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "vision.h"
using namespace std;
vector<int> DT(int H,int W,int i,int K){
    vector<int> ans;
    for(int j=0;j<H*W;j++){
        if(abs(j%W-i%W)+abs(j/W-i/W)==K){
            ans.push_back(j);
        }
    }
    return ans;
}
void construct_network(int H, int W, int K){
    int l;
    for(int i=0;i<H;i++){
        vector<int> ans;
        for(int j=0;j<W;j++){
            ans.push_back(j+i*W);
        }
        l=add_or(ans);
    }
    vector<int> cas;
    vector<int> an;
    for(int j=H*W;j<=l;j++){
        an.push_back(j);
    }
    cas.push_back(add_xor(an));
    int be=l+1;
    int en=l+1;
    for(int i=1;i<=K;i++){
        vector<int> ans;
        vector<int> no;
        for(int j=H*W,j<=l-i;j++){
            ans.push_back(j);
            ans.push_back(j+i);
            en=add_and(ans);
            no.push_back(en);
        }
        cas.push_back(add_or(no));
        en++;
    }
    int ll;
    for(int i=0;i<W;i++){
        vector<int> ans;
        for(int j=i;j<H*W;j+=W){
            ans.push_back(j);
        }
        ll=add_or(ans);
    }
    vector<int> cass;
    vector<int> ann;
    for(int j=en+1;j<=ll;j++){
        an.push_back(j);
    }
    cass.push_back(add_xor(an));
    int enn=ll+1;
    for(int i=1;i<=K;i++){
        vector<int> ans;
        vector<int> no;
        for(int j=en,j<=ll-i;j++){
            ans.push_back(j);
            ans.push_back(j+i);
            enn=add_and(ans);
            no.push_back(en);
        }
        cass.push_back(add_or(no));
        en++;
    }
    vector<int> tr;
    tr.push_back(cas[K]);
    tr.push_back(cass[]);
    en=add_and(tr);
    for(int i=1;i<=K;i++){
        vector<int> trr;
        trr.push_back(cas[K-i]);
        trr.push_back(cass[i]);
        en=add_and(trr);
        trr[0]=en;
        trr[1]=en-1;
        en=add_or(trr);
    }
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:33:24: error: expected ';' before '<=' token
   33 |         for(int j=H*W,j<=l-i;j++){
      |                        ^~
      |                        ;
vision.cpp:33:24: error: expected primary-expression before '<=' token
   33 |         for(int j=H*W,j<=l-i;j++){
      |                        ^~
vision.cpp:60:23: error: expected ';' before '<=' token
   60 |         for(int j=en,j<=ll-i;j++){
      |                       ^~
      |                       ;
vision.cpp:60:23: error: expected primary-expression before '<=' token
   60 |         for(int j=en,j<=ll-i;j++){
      |                       ^~
vision.cpp:71:23: error: expected primary-expression before ']' token
   71 |     tr.push_back(cass[]);
      |                       ^
vision.cpp:28:9: warning: unused variable 'be' [-Wunused-variable]
   28 |     int be=l+1;
      |         ^~