제출 #1261608

#제출 시각아이디문제언어결과실행 시간메모리
1261608nerrrmin마술쇼 (APIO24_show)C++20
5 / 100
2 ms380 KiB
#include <vector>
#include "Alice.h"
#define pb push_back
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 > > v;
    int n = 5000;
    for (int i = 1; i <= n; ++ i)
    {
        if(i == x)continue;
        v.pb(make_pair(i, x));
    }
    return v;
}
#include <vector>
#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().
int deg[5005];
long long Bob(std::vector<std::pair<int,int>> V){
	// add your code here
	int ans = 0;
	for (auto &[ver, ner]: V)
    {
        deg[ver] ++;
        deg[ner] ++;
        if(deg[ver] > 1)ans = ver;
        if(deg[ner] > 1)ans = ner;
    }
    return ans; // change this into your code
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...