Submission #1063626

# Submission time Handle Problem Language Result Execution time Memory
1063626 2024-08-17T21:32:35 Z alexdd Magic Show (APIO24_show) C++17
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
std::vector<std::pair<int,int>> Alice()
{
    long long k = setN(5000);
    vector<pair<int,int>> edges;
    for(int i=2;i<=5000;i++)
    {
        edges.push_back({k%i+1,i+1});
    }
    return edges;
}
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
long long lca(long long x, long long y)
{
    return x/__gcd(x,y)*y;
}
long long Bob(std::vector<std::pair<int,int>> edges)
{
    long long rest=0,mult=1;
    for(auto [x,y]:edges)
    {
        int m=y-1;
        int r=x-1;
        while(rest%m!=r)
            rest+=mult;
        mult = lca(mult,m);
    }
    return rest;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -