제출 #1186565

#제출 시각아이디문제언어결과실행 시간메모리
1186565omar1312Magic Show (APIO24_show)C++20
5 / 100
2 ms380 KiB
#include "Alice.h"
#include <bits/stdc++.h>

using namespace std;

#define ll long long

const int mod = 1000000007, N = 200005;

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

using namespace std;

#define ll long long

const int mod = 1000000007, N = 200005;
bool f[N+2];
// 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){
	int mx = 0;
	for(auto&[u, v] : V){
		if(f[u])mx = u;
		else mx = v;
		f[u] |= 1;
		f[v] |= 1;
	}
	return mx;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...