제출 #1361249

#제출 시각아이디문제언어결과실행 시간메모리
1361249blameazu마술쇼 (APIO24_show)C++20
100 / 100
2 ms1092 KiB
#include <bits/stdc++.h>
using namespace std;

#include "Alice.h"

vector<pair<int,int> > Alice() {
    vector<pair<int, int> > edges;
    long long x = setN(5000);
    for(int i = 2; i <= 5000; i++) {
        edges.push_back({x%(i-1)+1, i});
    }
    return edges;
}
#include <bits/stdc++.h>
using namespace std;

#include "Bob.h"

long long Bob(vector<pair<int,int> > edges){
    long long ans = 0;
    __int128_t now = 1;
    for(auto &[a, b] : edges) {
        a--;
        b--;
        while(ans%b != a) {
            ans += now;
        }
        // cerr << a << ' ' << b << '\n';
        now = lcm(now, b);
        if(now > 1e18) return ans;
    }
    return ans;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…