제출 #1269790

#제출 시각아이디문제언어결과실행 시간메모리
1269790mariza로봇 대회 (IOI23_robot)C++20
15 / 100
36 ms5448 KiB
#include "robot.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

pair<ll, char> create_instruction(ll c, ll w, ll s, ll e, ll n){
    // cout<<c<<" "<<w<<" "<<s<<" "<<e<<" "<<n<<endl;
    if(s==-2 && e==-2){
        return {1,'T'};
    }
    else if(w==0 || s==0 || e==0 || n==0){
        if(w==0) return {1,'W'};
        else if(s==0) return {1,'S'};
        else if(e==0) return {1,'E'};
        else if(n==0) return {1,'N'};
    }
    else{
        if(n==1) return {2,'N'};
        else if(e==1) return {2,'E'};
        else if(s==1) return {2,'S'};
        else if(w==1) return {2,'W'};
    }
}

void program_pulibot(){
    for(int c=0; c<=1; c++){
        for(int w=-2; w<=2; w++){
            for(int s=-2; s<=2; s++){
                for(int e=-2; e<=2; e++){
                    for(int n=-2; n<=2; n++){
                        if(w!=0 && w!=1 && s!=0 && s!=1 && e!=0 && e!=1 && n!=0 && n!=1) continue;
                        ll x;
                        char y;
                        tie(x,y)=create_instruction(c,w,s,e,n);
                        set_instruction({c,w,s,e,n},x,y);
                    }
                }
            }
        }
    }
}

컴파일 시 표준 에러 (stderr) 메시지

robot.cpp: In function 'std::pair<long long int, char> create_instruction(ll, ll, ll, ll, ll)':
robot.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^
#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...