제출 #1346462

#제출 시각아이디문제언어결과실행 시간메모리
1346462phamngocphuc2008마술쇼 (APIO24_show)C++20
5 / 100
3 ms1092 KiB
#include <vector>
#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().
using namespace std;
const int nodes = 5000;

const int sub1 = 5000;
using pii = pair<int,int>;

namespace subtask1
{
    std::vector<std::pair<int,int>> solve(int x)
    {
        vector<pii> ans;
        for(int i = 1; i <= nodes; ++i) if(i != x) ans.push_back({i,x});
        return ans;

    }
}

std::vector<std::pair<int,int>> Alice(){
	// add your code here
	
	// change below into your code
    int x = setN(sub1);
    return subtask1::solve(x);
}
#include <vector>
#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().
const int nodes = 5000;

long long Bob(std::vector<std::pair<int,int>> V)
{
    vector<bool> used(nodes+1);
    for(auto [a, b] : V)
    {
        if(used[a]) return a;
        if(used[b]) return b;
        used[a] = true;
        used[b] = true;
    }
}

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

# 2번째 컴파일 단계

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