Submission #1241553

#TimeUsernameProblemLanguageResultExecution timeMemory
1241553dostsRobot Contest (IOI23_robot)C++20
15 / 100
101 ms5960 KiB
#include "robot.h"
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2")
//#define int long long
#define pii pair<int,int>
#define vi vector<int>
#define ff first
#define ss second
#define sp << " " <<
#define all(x) x.begin(),x.end()
#define big(x) ((int)(x.size()))
using namespace std;
const int MOD = 1e9+7, LIM = 1e6+1, inf = 2e9;
map<vi,int> memo;

int code = 2;

void koy(vi v,char A,int c)  {
    if (memo[v]) return;
    for (int i = 0;i<5;i++) {
        if (v[i] == -3) {
            for (int j = -2;j<=code;j++) {
                v[i] = j;
                koy(v,A,c);
            }
            return;
        }
        if (v[i] == -4) {
            for (int j = 0;j<=code;j++) {
                v[i] = j;
                koy(v,A,c);
            }
            return;
        }
        if (v[i] == -5) {
            for (int j = -2;j<=-1;j++) {
                if (!j) continue;
                v[i] = j;
                koy(v,A,c);
            }
            return;
        }
    }
    memo[v] = 1;
    set_instruction(v,c,A);
}

void program_pulibot()
{
    //-4 --> sağlıklı
    //-3 --> herşey
    //-5 --> gidilemeyen
    #define good -4
    #define bad -5
    #define her -3
    #define out -2
    //bitir
    koy({good,her,out,out,her},'T',1);

    //gidebilcek varsa git
    koy({good,0,her,her,her},'W',1);
    koy({good,her,0,her,her},'S',1);
    koy({good,her,her,0,her},'E',1);
    koy({good,her,her,her,0},'N',1);

    //backtrack varsa backtrack
    koy({good,1,her,her,her},'W',2);
    koy({good,her,1,her,her},'S',2);
    koy({good,her,her,1,her},'E',2);
    koy({good,her,her,her,1},'N',2);

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...