Submission #1157786

#TimeUsernameProblemLanguageResultExecution timeMemory
1157786SmuggingSpunMagic Show (APIO24_show)C++20
35 / 100
1097 ms376 KiB
#include<bits/stdc++.h>
#include "Alice.h"
using namespace std;
typedef long long ll;
vector<pair<int, int>>Alice(){
    ll X = setN(5000);
    vector<pair<int, int>>ans;
    for(int i = 2; i <= 5000; i++){
        ans.emplace_back(X % (i - 1) + 1, i);
    }
    return ans;
}
#include<bits/stdc++.h>
#include "Bob.h"
using namespace std;
typedef long long ll;
template<class T>bool maximize(T& a, T b){
    if(a < b){
        a = b;
        return true;
    }
    return false;
}
ll Bob(vector<pair<int, int>>edge){
    int max_v = 0, start;
    for(auto& [u, v] : edge){
        if(maximize(max_v, v)){
            start = u;
        }
    }
    max_v--;
    for(int i = start - 1; i <= 25000000; i += max_v){
        bool can = true;
        for(auto& [u, v] : edge){
            if(i % (v - 1) + 1 != u){
                can = false;
                break;
            }
        }
        if(can){
            return i;
        }
    }
}

Compilation message (stderr)

# 2번째 컴파일 단계

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