제출 #1349795

#제출 시각아이디문제언어결과실행 시간메모리
1349795blameazu마술쇼 (APIO24_show)C++20
0 / 100
2 ms580 KiB
#include <bits/stdc++.h>
using namespace std;
#include "Alice.h"

// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

vector<pair<int,int> > Alice(){
	long long x = setN(5000);
    vector<pair<int, int> > re;
    for(int i = 1; i <= 5000; i++) if(i != (int)x) {
        re.push_back({(int)x, i});
    }
    return re;
}
#include <bits/stdc++.h>
using namespace std;

#include "Bob.h"

// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

long long Bob(vector<pair<int,int> > edges){
	int n = 5000;
    vector<int> deg(n+1);
    for(auto &[a, b] : edges) deg[a]++, deg[b]++;
    for(int i = 1; i <= n; i++) if(deg[i] != 1) {
        return (long long)i;
    }
}

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

# 2번째 컴파일 단계

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...