제출 #1200951

#제출 시각아이디문제언어결과실행 시간메모리
1200951crispxx마술쇼 (APIO24_show)C++20
5 / 100
2 ms384 KiB
#include "Alice.h"

#include <bits/stdc++.h>
using namespace std;

#define all(x) x.begin(), x.end()
#define pb push_back
#define ar array
#define nl '\n'

// 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().

std::vector<std::pair<int,int>> Alice(){
	vector<pair<int, int>> edges;
	int X = setN(5000);
	for(int i = 1; i <= 5000; i++) {
		if(i != X) edges.pb({X, i});
	}
	return edges;
}
#include "Bob.h"

#include <bits/stdc++.h>
using namespace std;

#define all(x) x.begin(), x.end()
#define pb push_back
#define ar array
#define nl '\n'

// 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(std::vector<std::pair<int,int>> V){
	vector<int> cnt(5001);
	for(int i = 0; i < (int)V.size(); i++) {
		auto [u, v] = V[i];
		for(auto j : {u, v}) {
			cnt[j]++;
			if(cnt[j] == 2) return j;
		}
	}
}

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

# 2번째 컴파일 단계

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