답안 #841983

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
841983 2023-09-02T09:40:13 Z vjudge1 Speedrun (RMI21_speedrun) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;
 
typedef long long ll;

// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
// #pragma optimization_level 3
 
// Defines
 
#define pb push_back // kak push_back 5
#define endl '\n'
#define FOR(i,start,end) for(int i = start;i < end;i ++)
#define REV(i,start,end) for(int i = start;i >= end;i --)
#define precal(x) fixed << setprecision(x)
#define F first
#define S second
#define sz(x) (ll)x.size()
#define all(x) (x).begin(),(x).end()
#define m_p make_pair
#define mt make_tuple
#define str to_string

// #ifndef ONLINE_JUDGE
//     #define cerr if(false) cerr
// #endif
 

int k[1001][1001];

void setHintLen(int l){

}

void setHint(int i, int j, bool b){

}

int getLength(){

}

bool getHint(int j){

}

bool goTo(int x){
    
}

void assignHints(int subtask, int N, int A [], int B []){
    if(subtask == 1){
        setHintLen(N);
        for(int i = 1;i <= N - 1;i ++){
            k[A[i]][B[i]] = 1,k[B[i]][A[i]] = 1;
        }
        for(int i = 1;i <= N;i ++){
            for(int j = 1;j <= N;j ++){
                if(i == j) continue;
                setHint(i,j,bool(k[i][j]));
            }
        }
    }
    return;
}

void speedrun(int subtask, int N, int start ){
    if(subtask == 1){
        bool used[N + 1],pr[N + 1];
        used[start] = true,pr[start] = start;
        int l = getLength(),pos = start,cnt = 1;
        while(cnt != N){
            used[pos] = true;
            for(int i = 1;i <= N;i ++){
                if(used[i] == true) continue;
                bool f = getHint(i);
                if(f == true){
                    pr[i] = pos;
                    bool k = goTo(i);
                    pos = i;
                    cnt ++;
                    break;
                }
                if(i == N){
                    goTo(pr[pos]);
                    pos = pr[pos];
                }
            }
        }
    }
    return;
}

Compilation message

speedrun.cpp: In function 'int getLength()':
speedrun.cpp:45:1: warning: no return statement in function returning non-void [-Wreturn-type]
   45 | }
      | ^
speedrun.cpp: In function 'bool getHint(int)':
speedrun.cpp:49:1: warning: no return statement in function returning non-void [-Wreturn-type]
   49 | }
      | ^
speedrun.cpp: In function 'bool goTo(int)':
speedrun.cpp:53:1: warning: no return statement in function returning non-void [-Wreturn-type]
   53 | }
      | ^
speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:83:26: warning: unused variable 'k' [-Wunused-variable]
   83 |                     bool k = goTo(i);
      |                          ^
speedrun.cpp:75:13: warning: unused variable 'l' [-Wunused-variable]
   75 |         int l = getLength(),pos = start,cnt = 1;
      |             ^
/usr/bin/ld: /tmp/cc3uCjEL.o: in function `setHintLen(int)':
stub.cpp:(.text+0xc0): multiple definition of `setHintLen(int)'; /tmp/ccTPYTVN.o:speedrun.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/cc3uCjEL.o: in function `setHint(int, int, bool)':
stub.cpp:(.text+0x150): multiple definition of `setHint(int, int, bool)'; /tmp/ccTPYTVN.o:speedrun.cpp:(.text+0x10): first defined here
/usr/bin/ld: /tmp/cc3uCjEL.o: in function `getLength()':
stub.cpp:(.text+0x200): multiple definition of `getLength()'; /tmp/ccTPYTVN.o:speedrun.cpp:(.text.unlikely+0x0): first defined here
/usr/bin/ld: /tmp/cc3uCjEL.o: in function `getHint(int)':
stub.cpp:(.text+0x210): multiple definition of `getHint(int)'; /tmp/ccTPYTVN.o:speedrun.cpp:(.text.unlikely+0x4): first defined here
/usr/bin/ld: /tmp/cc3uCjEL.o: in function `goTo(int)':
stub.cpp:(.text+0x420): multiple definition of `goTo(int)'; /tmp/ccTPYTVN.o:speedrun.cpp:(.text.unlikely+0x8): first defined here
collect2: error: ld returned 1 exit status