C - Product and GCD Solved. 题意: 给出$n个数$的乘积,求$这n个数$的最大的可能是GCD 思路: 分解质因子,那么$每个质因子的贡献就是其质因子个数/ n的乘积$ #include <bits/stdc++.h> using namespace std; #define ll long long ll n, p; int main() { while (scanf("%lld%lld", &n, &p) != EOF) { )…
C - Product and GCD 题解 直接分解质因数,然后gcd每次多一个质因数均摊到每个\(N\)上的个数 代码 #include <bits/stdc++.h> #define fi first #define se second #define pii pair<int,int> #define mp make_pair #define pb push_back #define enter putchar('\n') #define space putchar(' '…
A. New Year and the Christmas Ornament 签到. #include <bits/stdc++.h> using namespace std; int a, b, c; int main() { while (scanf("%d%d%d", &a, &b, &c) != EOF) { , c - )); printf( + ); } ; } B. New Year and the Treasure Geolocati…
A. Definite Game 签. #include <bits/stdc++.h> using namespace std; int main() { int a; while (scanf("%d", &a) != EOF) { [](int x) { ; i >= ; --i) if (x % i) { printf("%d\n", x - i); return; } printf("%d\n", x); }(…
A:Martadella Stikes Again 水. #include <bits/stdc++.h> using namespace std; #define ll long long int t; ll R, r; int main() { scanf("%d", &t); while (t--) { scanf("%lld%lld", &R, &r); if (R * R > 2ll * r * r) puts(&…
A - Easy Number Game 水. #include <bits/stdc++.h> using namespace std; #define ll long long #define N 100010 ll arr[N]; int n, m; int main() { int t; scanf("%d", &t); while (t--) { scanf("%d%d", &n, &m); ; i <= n; +…
A - Candy Game 水. #include <bits/stdc++.h> using namespace std; #define N 1010 int t, n; int a[N], b[N]; int main() { scanf("%d", &t); while (t--) { scanf("%d", &n); ; i <= n; ++i) scanf("%d", a + i); ; i <…