Submission #981031

#TimeUsernameProblemLanguageResultExecution timeMemory
981031vjudge1Robot Contest (IOI23_robot)C++17
Compilation error
0 ms0 KiB
#include "robot.h"
#include <algorithm>
#include <fstream>
#include <vector>
#include <queue>
#include <stack>
#include <iostream>
#include <cmath>
#include <queue>
#include <set>
#include <string>
#include <cstring>
#include <map>
#include <unordered_map>
#include <unordered_set>
#define F first
#define S second
#define PB push_back
using namespace std;
const long long MOD=1e9+7, INF=1e18;
const int INFI=1e9;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<pair<int, ii>> viii;
typedef vector<vii> vvii;
typedef vector<ll> vll;
typedef vector<vll> vvll;

void program_pulibot(){
    vi aux={0, -2, 0, 0, -2};
    for(int i=-2;i<=1;i++)
        for(int j=-2;j<=1;j++)
            for(int k=-2;k<=1;k++)
                set_instruction({i, j, 0, k}, 1, 'E');
    for(int i=-2;i<=1;i++)
        for(j=-2;j<=-1;j++)
            for(int k=-2;k<=1;k++)
                set_instruction({i, 0, j, k}, 1, 'S');
    for(int i=-1;i<=1;i++)
        for(j=-1;j<=1;j++)
            set_instruction({i, -2, -2, j}, 1, 'T');
}

Compilation message (stderr)

robot.cpp: In function 'void program_pulibot()':
robot.cpp:39:13: error: 'j' was not declared in this scope
   39 |         for(j=-2;j<=-1;j++)
      |             ^
robot.cpp:41:53: error: could not convert '{i, 0, j, k}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   41 |                 set_instruction({i, 0, j, k}, 1, 'S');
      |                                                     ^
      |                                                     |
      |                                                     <brace-enclosed initializer list>
robot.cpp:43:13: error: 'j' was not declared in this scope
   43 |         for(j=-1;j<=1;j++)
      |             ^
robot.cpp:44:51: error: could not convert '{i, -2, -2, j}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   44 |             set_instruction({i, -2, -2, j}, 1, 'T');
      |                                                   ^
      |                                                   |
      |                                                   <brace-enclosed initializer list>