| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1040921 | Andrey | Magic Show (APIO24_show) | C++17 | 2 ms | 832 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Alice.h"
#include<bits/stdc++.h>
using namespace std;
std::vector<std::pair<int,int>> Alice(){
long long x = setN(5000);
vector<pair<int,int>> haha(0);
for(int i = 2; i <= 5000; i++) {
haha.push_back({x%(i-1)+1,i});
}
return haha;
}
#include "Bob.h"
#include<bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
if(b == 0) {
return a;
}
return gcd(b,a%b);
}
long long lcm(long long a, long long b) {
return (a/gcd(a,b))*b;
}
long long Bob(std::vector<std::pair<int,int>> haha){
long long c = 1,ost = 0;
for(int i = 0; i < haha.size(); i++) {
int a = haha[i].first,b = haha[i].second;
if(a > b) {
swap(a,b);
}
while(ost%(b-1) != a-1) {
ost+=c;
}
c = lcm(c,b-1);
}
if(ost == 0) {
return c;
}
else {
return ost;
}
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
