Submission #1197838

#TimeUsernameProblemLanguageResultExecution timeMemory
1197838ansori마술쇼 (APIO24_show)C++20
100 / 100
1 ms368 KiB
#include <vector> #include "Alice.h" #include<bits/stdc++.h> using namespace std; const int N = 3696; // 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 setN(int N); std::vector<std::pair<int,int>> Alice(){ long long x = setN(N); vector<pair<int , int>> G; for(int i = 2;i <= N; ++ i){ G.push_back({x % (i - 1) + 1 , i}); } return G; }
#include <vector> #include "Bob.h" #include<bits/stdc++.h> #define fi first #define se second 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; long long lc = 1; for(auto to : V){ long long m = to.se - 1 , r = to.fi; while(ans % m != (r - 1)) ans += lc; //cout << m << ' ' << r << ' ' << lc << ' '<< '\n'; int gc = m / __gcd(m , lc); if(1e18 / gc < lc) break; lc *= gc; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...