제출 #1370599

#제출 시각아이디문제언어결과실행 시간메모리
1370599Sam_a17마술쇼 (APIO24_show)C++20
35 / 100
2 ms364 KiB
#include "Alice.h"
#include <bits/stdc++.h>
#include <vector>
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().

vector<pair<int, int>> Alice()
{
    int n = 50;
    long long x = setN(n);

    vector<pair<int, int>> ans;
    for (long long i = 1; i < n; i++)
    {
        ans.push_back({x % i + 1, i + 1});
    }

    return ans;
}
#include "Bob.h"
#include <bits/stdc++.h>
#include <vector>
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)
{
    long long ans = 0, period = 1;
    for (int i = 0; i < V.size(); ++i)
    {
        long long dv = V[i].second - 1, rem = V[i].first - 1;
        while (ans % dv != rem)
        {
            ans += period;
        }
        period *= dv / __gcd(dv, period);
    }

    return ans;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…