Submission #1342953

#TimeUsernameProblemLanguageResultExecution timeMemory
1342953neelamneelam19Magic Show (APIO24_show)C++20
5 / 100
3 ms1092 KiB
#include <vector>
#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>> ans;
    
    for(int i=1; i<=5000; i++){
        if (i==x) continue;
        ans.push_back({i,x});
    }
    
    
    return ans;
}
#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().

long long Bob(std::vector<std::pair<int,int>> V){
    vector<int> count(5001,0);
    
    for(int i=0; i<4999; i++){
        count[V[i].first]++; count[V[i].second]++;
    }
    int max=0;
    for(int i=1; i<5001; i++){
        if(count[i]>count[max]) max =i;
    }
    
    return max;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...