Submission #1312253

#TimeUsernameProblemLanguageResultExecution timeMemory
1312253azamuraiMagic Show (APIO24_show)C++20
Compilation error
0 ms0 KiB
#include <vector>
#include <bits/stdc++.h>
#include "Alice.h"

using namespace std;

// 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(){
	long long x = setN(5000);
	vector <pair<int,int>> edges;
	for (int i = 1; i <= 5000; i++) {
		if (i == x) continue;
		edges.push_back({i, x});
	}
	return edges;
}
#include <vector>
#include <bits/stdc++.h>
#include "Bob.h"

using namespace std;

// 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){
	map <int,int> cnt;
	for (int i = 0; i < Sz(V); i++) {
		int u = V[i].first, v = V[i].second;
		cnt[u]++; cnt[v]++;
	}
	long long ans = 0;
	for (auto to : cnt) {
		if (to.second > 1) ans = to.first;
	}
	return ans;
}

Compilation message (stderr)

# 2번째 컴파일 단계

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:12:29: error: 'Sz' was not declared in this scope
   12 |         for (int i = 0; i < Sz(V); i++) {
      |                             ^~