Submission #1691202
Source Code Expand
#include <iostream> typedef long long ll; using namespace std; ll gcd(ll a, ll b){ if(b==0) return a; return gcd(b, a%b); } ll lcm(ll a, ll b){ if(a<b) swap(a, b); LL g = gcd(a, b); return a/(g*b); } int main(void){ int N; cin >> N; ll T; ll ans = 1LL; for(int i=0; i<N; i++){ cin >> T; ans = lcm(ans, T); } cout << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Multiple Clocks |
User | u_sho |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 439 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘ll lcm(ll, ll)’: ./Main.cpp:12:5: error: ‘LL’ was not declared in this scope LL g = gcd(a, b); ^ ./Main.cpp:13:15: error: ‘g’ was not declared in this scope return a/(g*b); ^