제출 #1227387

#제출 시각아이디문제언어결과실행 시간메모리
1227387dizzy_groovyMagic Show (APIO24_show)C++20
0 / 100
4 ms364 KiB
#include <bits/stdc++.h> #include "Alice.h" 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(). std::vector<std::pair<int,int>> Alice(){ int n = 5000; long long x = setN(n); vector<pair<int, int>> v; for (int i = 1; i < n; i++) { v.push_back({i + 1, (x % i) + 1}); } return v; }
#include <bits/stdc++.h> #include "Bob.h" using namespace std; using ll = long long; // 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) { ll ans = 0; ll ansmod = 1; for (auto &i : V) { i.first--; i.second--; if (i.first > i.second) swap(i.first, i.second); cout << i.first << " " << i.second << " " << endl; while (ans % i.second != i.first) ans += ansmod; ansmod *= i.second / __gcd((ll)i.second, ansmod); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...