Submission #19356

#TimeUsernameProblemLanguageResultExecution timeMemory
19356algoshipdaΣ (kriii4_P2)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long lld; const int MOD = 1e9 + 7; int fpow(int n, int k) { if(k == 0) return 1; if(k % 2){ return 1ll * n * fpow(n, k - 1) % MOD; } int h = fpow(n, k / 2); return 1ll * h * h % MOD; } int main() { int t; cin >> t; int s = 0; while(t--){ int n, k; cin >> k >> n; int g = gcd(k, n);; s += 1ll * n * fpow(k, MOD - 2) % MOD; s %= MOD; } cout << s << '\n'; }

Compilation message (stderr)

P2.cpp: In function ‘int main()’:
P2.cpp:25:19: error: ‘gcd’ was not declared in this scope
   int g = gcd(k, n);;
                   ^
P2.cpp:25:7: warning: unused variable ‘g’ [-Wunused-variable]
   int g = gcd(k, n);;
       ^