submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s477070980
p03633
C++
//0:45 #include <stdio.h> #include <string.h> #include <algorithm> typedef long long ll; ll max(ll a, ll b){return(a>b)?a:b;} ll min(ll a, ll b){return(a<b)?a:b;} ll abs(ll a){return(a<0)?-a:a;} ll gcd(ll a, ll b){ if(b > a){ ll tmp = b; b = a; a = tmp; } if(b == 0) return a; else return gcd(b, a%b); } ll lcm(ll a, ll b){ ll gcdi = gcd(a,b); return a/gcdi*(b); } int main(){ int N; scanf("%d",&N); ll tc,t; scanf("%lld",&tc); for(int i = 1; i < N; i ++){ scanf("%lld",&t); tc = lcm(tc,t); } printf("%lld\n",tc); } ~
a.cc:36:2: error: expected class-name at end of input 36 | ~ | ^
s059494835
p03633
C++
#include <iostream> using namespace std; using ll = long long; ll gcd(ll a, ll b){ if(b == 0) return a; return gcd(b, a%b); } ll lcm(ll a, ll b){ ll g = gcd(a, b); return a / g * b; } int main(void){ int N; cin >> N; ll ans = 1LL; for(int i = 0; i < N; ++i){ ll T; cin >> T: ans = lcm(ans, T); } cout << ans << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:24:17: error: found ':' in nested-name-specifier, expected '::' 24 | cin >> T: | ^ | :: a.cc:24:16: error: 'T' is not a class, namespace, or enumeration 24 | cin >> T: | ^
s852356163
p03633
C++
#include <bits/stdc++.h> #include <boost/multiprecision/cpp_int.hpp> namespace mp = boost::multiprecision; using namespace std; mp::cpp_int gcd(mp::cpp_int x, mp::cpp_int y) { mp::cpp_int r; while((r = x % y) != 0) { x = y; y = r; } return y; } mp::cpp_int lcm(mp::cpp_int x, mp::cpp_int y) { return (x * y / gcd(x, y)); } int main() { int N; cin >> N; long int number[N]; for (int i = 0; i < N; ++i) { cin >> number[i]; } long int ans = number[0]; for (int i = 1; i < N; ++i) { ans = lcm(ans, number[i]); } cout << ans << endl; }
a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory 2 | #include <boost/multiprecision/cpp_int.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s628888865
p03633
C++
#include <iostream> using namespace std; typedef long long int llint; llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);} llint lcm(llint a,llint b){return a/gcd(a,b)*b;} int main(void){ llint n,i,q,ans=1; cin>>n; vector<int>a(n); for(i=0;i<n;i++){ cin>>q; ans=lcm(ans,q); } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'vector' was not declared in this scope 10 | vector<int>a(n); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | using namespace std; a.cc:10:16: error: expected primary-expression before 'int' 10 | vector<int>a(n); | ^~~
s603260771
p03633
C++
#include <iostream> using namespace std; int gcd (int a,int b) { if (b==0) return a; return gcd (b,a%b); } int lcm(int a, int b) { int g = gcd(a,b); return a/g*b; } int main(int argc, char const *argv[]) { int n; cin>>n; int ans ; for (int i = 0; i < n; ++i) { int t; cin>>t; ans = lcm(ans,t) } cout<<ans<<endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:20:33: error: expected ';' before '}' token 20 | ans = lcm(ans,t) | ^ | ; 21 | } | ~
s868519151
p03633
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; long long T[N]; for(int i = 0; i < N; i++){ cin >> T[i]; } unsigned long long maxV = 0; for(int i = 0; i < N; i++){ maxV = max(T[i], maxV); } while(1){ int i; for(i = 0; i < N; i++){ if(maxV % T[i] != 0 ){ maxV += maxV; break; } } if(i == N){ cout << maxV << endl; break; } } return 0; }
a.cc: In function 'int main()': a.cc:13:19: error: no matching function for call to 'max(long long int&, long long unsigned int&)' 13 | maxV = max(T[i], maxV); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:13:19: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int') 13 | maxV = max(T[i], maxV); | ~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:13:19: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 13 | maxV = max(T[i], maxV); | ~~~^~~~~~~~~~~~
s202534513
p03633
C++
#include<bits/stdc++.h> #define LL long long using namespace std; int main(){ int n; cin>>n; LL a[n]; for(int i=0;i<n;++i) cin>>a[i]; sort(a,a+n); for(int i=0;i<n-1;++i){ LL tmp1=a[i] LL tmp2=a[i+1] if(!(tmp1%tmp2)) a[i]=a[i+1]=tmp1; else a[i]=a[i+1]=tmp1*tmp2; } cout<<a[n-1]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:2:12: error: expected ',' or ';' before 'long' 2 | #define LL long long | ^~~~ a.cc:12:5: note: in expansion of macro 'LL' 12 | LL tmp2=a[i+1] | ^~ a.cc:14:5: error: 'else' without a previous 'if' 14 | else a[i]=a[i+1]=tmp1*tmp2; | ^~~~ a.cc:14:27: error: 'tmp2' was not declared in this scope; did you mean 'tmp1'? 14 | else a[i]=a[i+1]=tmp1*tmp2; | ^~~~ | tmp1
s925880460
p03633
Java
static int gcd(int a, int b) { if (b == 0) return a; if (a < b) { int t = a; a = b; b = t; } return gcd(b, a % b); } static int lcm(int a, int b) { return a * b / gcd(a, b); }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. static int gcd(int a, int b) { ^ (use --enable-preview to enable unnamed classes) 1 error
s387683540
p03633
C
#include<stdio.h> int main(void){ int N,i,j,r,a,b,c,d; int T[100]; scanf("%d",&N); for(i = 0;i<N;i++) scanf("%d",&T[i]); a = T[0]; for(j = 1;j<N;j++){ d = a; r = T[j]; while(r!=0){ b = a%r; a = r; r = b; } c = d * T[j]/a; } printf("%s\n",); }
main.c: In function 'main': main.c:24:17: error: expected expression before ')' token 24 | printf("%s\n",); | ^
s410938825
p03633
C
#include<stdio.h> int main(void){ int N,i,r,a,b,c,d; int T[100]); scanf("%d",&N); for(i = 0;i<N;i++) scanf("%d",T[i]); a = T[0]; for(j = 1;j<N;j++){ d = a; r = T[j]; while(r!=0){ b = a%r; a = r; r = b; } c = d * T[j]/a; } printf("%s\n",); }
main.c: In function 'main': main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before ')' token 5 | int T[100]); | ^ main.c:5:13: error: expected statement before ')' token main.c:9:16: error: 'T' undeclared (first use in this function) 9 | scanf("%d",T[i]); | ^ main.c:9:16: note: each undeclared identifier is reported only once for each function it appears in main.c:13:7: error: 'j' undeclared (first use in this function) 13 | for(j = 1;j<N;j++){ | ^ main.c:24:17: error: expected expression before ')' token 24 | printf("%s\n",); | ^
s752330848
p03633
C++
from fractions import gcd n = int(input()) def lcm(l, t): return l * t // gcd(l, t) ans = 1 for i in range(n): t = int(input()) ans = lcm(ans, t) print(ans)
a.cc:1:1: error: 'from' does not name a type 1 | from fractions import gcd | ^~~~
s018236009
p03633
C++
#include "bits/stdc++.h" using namespace std; #define MOD 1000000007 #define FOR(i,a,b) for(long long i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define dump(x) cout << #x << " = " << (x) << endl; #define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; typedef long long ll; typedef pair<ll,ll> P; typedef vector<vector<P>> Graph; ll gcd(ll a,ll b){ ll x = a; ll y = b; if(a<b){ ll tmp = a; a = b; b = tmp; } ll r = a % b; while(r!=0){ a = b; b = r; r = a % b; } return x/b * y; } int main(){ int n; cin >> n; ll t[n]; REP(i,n){ cin >> t[i]; if(t[i] ) } if(n == 1){ cout << t[0] << endl; return 0; } ll ans = gcd(t[0],t[1]); REP(i,n-2){ ans = gcd(ans,t[i+2]); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:41:3: error: expected primary-expression before '}' token 41 | } | ^
s034062835
p03633
C++
#include<iostream> using namespace std; typedef long long LL; LL time_seq[100]; LL gcd(LL a, LL b) { if (b == 0) return a; else return gcd(b, a % b); } int main() { int N; LL lcm; cin >> N; for (int i = 0; i < N; i++) cin >> time_seq[i]; sort(time_seq, time_seq + N); lcm = 1; for (int i = 0; i < N; i++) { lcm *= LL(1.0 * time_seq[i] / gcd(max(lcm, time_seq[i]), min(lcm, time_seq[i]))); } cout << lcm << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:5: error: 'sort' was not declared in this scope; did you mean 'short'? 18 | sort(time_seq, time_seq + N); | ^~~~ | short
s087569593
p03633
C++
#include <bits/stdc++.h> #define rep(i, a, b) for(int i=(a);i<(b);++i) using namespace std; typedef long long ll; typedef pair<int, int> P; const int INF = (1 << 30) - 1; const ll INF64 = ((ll)1 << 62) - 1; const ll MOD = 1e9 + 7; const double PI = 3.1415926535897932384626433832795; ll euclid(ll x,ll y){ int mem = 0; if(x < y){ //x > y mem = x; x = y; y = mem; } if (!(x % y == 0)) { euclid(y ,x % y); } return y; } ll lsm(ll a,ll b){ return a / euclid(a, b) * b; } int main() { int n,ans = 1; ll tim[100]; cin >> n; for(int i = 0; i < n; ++i)cin >> tim[i]; for (int i = 0; i < n; ++i) { ans = lsm(ans, tim[i]) } cout << ans << endl; // cout << euclid(64, 16) << endl; return 0; }
a.cc: In function 'int main()': a.cc:39:39: error: expected ';' before '}' token 39 | ans = lsm(ans, tim[i]) | ^ | ; 40 | } | ~
s993019490
p03633
C++
#include <bits/stdc++.h> #define rep(i, a, b) for(int i=(a);i<(b);++i) using namespace std; typedef long long long long long long ll; typedef pair<int, int> P; const int INF = (1 << 30) - 1; const ll INF64 = ((ll)1 << 62) - 1; const ll MOD = 1e9 + 7; const double PI = 3.1415926535897932384626433832795; ll euclid(ll x,ll y){ int mem = 0; if(x < y){ //x > y mem = x; x = y; y = mem; } if (!(x % y == 0)) { euclid(y ,x % y); } return y; } int main() { int n,ans = 1; ll tim[100]; cin >> n; for(int i = 0; i < n; ++i)cin >> tim[i]; for (int i = 0; i < n-1; ++i) { ans = tim[i] * tim[i+1] / euclid(tim[i+1],ans); } cout << tim[n-1] << endl; // cout << euclid(64, 16) << endl; return 0; }
a.cc:5:19: error: 'long long long' is too long for GCC 5 | typedef long long long long long long ll; | ^~~~ a.cc:5:24: error: 'long long long' is too long for GCC 5 | typedef long long long long long long ll; | ^~~~ a.cc:5:29: error: 'long long long' is too long for GCC 5 | typedef long long long long long long ll; | ^~~~ a.cc:5:34: error: 'long long long' is too long for GCC 5 | typedef long long long long long long ll; | ^~~~
s445472823
p03633
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include <cstdio> #include <bits/stdc++.h> #include <set> #include <stdio.h> using namespace std; using ll =long long; ll gcd(ll a, ll b){ if (b==0) return a; else gcd(b,a%b); } ll lcm(ll a, ll b){ ll v=gcd(a,b); ll ans =a/g*b; return ans; } int main (void) { int N; cin >> N; ll T[N]; ll ans=0; for (int i=0; i<N; i++) { cin >> T[i]; if (i==0){ ans=T[i]; continue; } else{ ans=lcm(ans,T[i]); } } cout << ans; }
a.cc: In function 'll lcm(ll, ll)': a.cc:20:13: error: 'g' was not declared in this scope 20 | ll ans =a/g*b; | ^ a.cc: In function 'll gcd(ll, ll)': a.cc:15:11: warning: control reaches end of non-void function [-Wreturn-type] 15 | else gcd(b,a%b); | ~~~^~~~~~~
s000371987
p03633
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include <cstdio> #include <bits/stdc++.h> #include <set> #include <stdio.h> using namespace std; using ll =long long; ll gcd(ll a, ll b){ if (b==0) return a; else gcd(b,a%b); } ll lcm(ll a, ll b){ ll v=gcd(a,b); ll ans =a*b/g; return ans; } int main (void) { int N; cin >> N; ll T[N]; ll ans=0; for (int i=0; i<N; i++) { cin >> T[i]; if (i==0){ ans=T[i]; continue; } else{ ans=lcm(ans,T[i]); } } cout << ans; }
a.cc: In function 'll lcm(ll, ll)': a.cc:20:15: error: 'g' was not declared in this scope 20 | ll ans =a*b/g; | ^ a.cc: In function 'll gcd(ll, ll)': a.cc:15:11: warning: control reaches end of non-void function [-Wreturn-type] 15 | else gcd(b,a%b); | ~~~^~~~~~~
s511233505
p03633
C++
#include<bits/stdc++.h> using namespace std; typedef ll long long; int main() { int n; cin >> n; ll ans = 1; for (int i = 0;i < n;i++) { ll a; cin >> a; ans = lcm(a, ans); } cout << ans << endl; }
a.cc:3:9: error: 'll' does not name a type 3 | typedef ll long long; | ^~ a.cc: In function 'int main()': a.cc:8:9: error: 'll' was not declared in this scope 8 | ll ans = 1; | ^~ a.cc:10:19: error: expected ';' before 'a' 10 | ll a; | ^~ | ; a.cc:11:24: error: 'a' was not declared in this scope 11 | cin >> a; | ^ a.cc:12:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 12 | ans = lcm(a, ans); | ^~~ | abs a.cc:14:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | cout << ans << endl; | ^~~ | abs
s542844304
p03633
C++
#include<bits/stdc++.h> using namespace std; typedef ll long long int main() { int n; cin >> n; ll ans = 1; for (int i = 0;i < n;i++) { ll a; cin >> a; ans = lcm(a, ans); } cout << ans << endl; }
a.cc:3:9: error: 'll' does not name a type 3 | typedef ll long long | ^~
s227849531
p03633
C++
#include <iostream> using namespace std; using Num = long long; Num gcd(Num m,Num n){ if(n == 0)return m; return gcd(b,a%b); } Num lcm(Num m,Num n){ return m * n / gcd(m,n); } int main(){ int n; Num ans = 1; cin >> n; for(int i=0;i<n;i++){ Num t; cin >> t; ans = lcm(ans,t); } cout << ans; return 0; }
a.cc: In function 'Num gcd(Num, Num)': a.cc:7:20: error: 'b' was not declared in this scope 7 | return gcd(b,a%b); | ^ a.cc:7:22: error: 'a' was not declared in this scope 7 | return gcd(b,a%b); | ^
s690900726
p03633
C++
#include <iostream> #include <cstdint> using namespace std; typedef __int64 Num Num gcd(Num m,Num n){ Num temp; while(m % n != 0){ temp = n; n = m % n; m = temp; } return n; } Num lcm(Num m,Num n){ return m * n / gcd(m,n); } int main(){ int n; Num ans = 1; cin >> n; for(int i=0;i<n;i++){ Num t; cin >> t; ans = lcm(ans,t); } cout << ans; return 0; }
a.cc:5:9: error: '__int64' does not name a type; did you mean '__int64_t'? 5 | typedef __int64 Num | ^~~~~~~ | __int64_t a.cc:16:1: error: 'Num' does not name a type 16 | Num lcm(Num m,Num n){ | ^~~ a.cc: In function 'int main()': a.cc:21:9: error: 'Num' was not declared in this scope 21 | Num ans = 1; | ^~~ a.cc:24:20: error: expected ';' before 't' 24 | Num t; | ^~ | ; a.cc:25:24: error: 't' was not declared in this scope 25 | cin >> t; | ^ a.cc:26:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 26 | ans = lcm(ans,t); | ^~~ | abs a.cc:26:23: error: 'lcm' was not declared in this scope 26 | ans = lcm(ans,t); | ^~~ a.cc:28:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 28 | cout << ans; | ^~~ | abs
s535840241
p03633
C++
#include <iostream> using namespace std; typedef __int64 Num Num gcd(Num m,Num n){ Num temp; while(m % n != 0){ temp = n; n = m % n; m = temp; } return n; } Num lcm(Num m,Num n){ return m * n / gcd(m,n); } int main(){ int n; Num ans = 1; cin >> n; for(int i=0;i<n;i++){ Num t; cin >> t; ans = lcm(ans,t); } cout << ans; return 0; }
a.cc:3:9: error: '__int64' does not name a type; did you mean '__int64_t'? 3 | typedef __int64 Num | ^~~~~~~ | __int64_t a.cc:14:1: error: 'Num' does not name a type 14 | Num lcm(Num m,Num n){ | ^~~ a.cc: In function 'int main()': a.cc:19:9: error: 'Num' was not declared in this scope 19 | Num ans = 1; | ^~~ a.cc:22:20: error: expected ';' before 't' 22 | Num t; | ^~ | ; a.cc:23:24: error: 't' was not declared in this scope 23 | cin >> t; | ^ a.cc:24:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 24 | ans = lcm(ans,t); | ^~~ | abs a.cc:24:23: error: 'lcm' was not declared in this scope 24 | ans = lcm(ans,t); | ^~~ a.cc:26:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 26 | cout << ans; | ^~~ | abs
s851352525
p03633
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long[] t = new long[N]; for(int i = 0;i < N;i++){ t[i] = sc.nextLong(); } Arrays.sort(t); long ans = t[N-1]; for(int i = 0;i < N;i++){ if(ans%a[N-1-i] != 0){ ans *= a[N-1-i]; } } System.out.println(ans); }}
Main.java:13: error: cannot find symbol if(ans%a[N-1-i] != 0){ ^ symbol: variable a location: class Main Main.java:14: error: cannot find symbol ans *= a[N-1-i]; ^ symbol: variable a location: class Main 2 errors
s063847293
p03633
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long[] t = new long[N]; for(int i = 0;i < n;i++){ t[i] = sc.nextLong(); } Arrays.sort(t); long max = t[N-1]; for(long i = max;;i += max){ boolean ok = true; for(int j = 0;j < N;j++){ if(i%t[j] != 0){ ok = false; break; } } if(ok){ System.out.println(i); break; } } }}
Main.java:7: error: cannot find symbol for(int i = 0;i < n;i++){ ^ symbol: variable n location: class Main 1 error
s346459616
p03633
C++
#include <iostream> using namespace std; long long gcd(ll a, ll b) { if(b == 0) return a; return gcd(b, a % b); } long long lcm(ll a,ll b){ return a * (b / gcd(a, b)); } int main() { int N; cin >> N; long long ans = 1; for(int i = 0; i < N; i++) { long long t; cin >> t; ans = lcm(ans, t); } cout << ans << endl; return 0; }
a.cc:3:15: error: 'll' was not declared in this scope 3 | long long gcd(ll a, ll b) { | ^~ a.cc:3:21: error: 'll' was not declared in this scope 3 | long long gcd(ll a, ll b) { | ^~ a.cc:3:25: error: expression list treated as compound expression in initializer [-fpermissive] 3 | long long gcd(ll a, ll b) { | ^ a.cc:7:15: error: 'll' was not declared in this scope 7 | long long lcm(ll a,ll b){ | ^~ a.cc:7:20: error: 'll' was not declared in this scope 7 | long long lcm(ll a,ll b){ | ^~ a.cc:7:24: error: expression list treated as compound expression in initializer [-fpermissive] 7 | long long lcm(ll a,ll b){ | ^ a.cc: In function 'int main()': a.cc:16:22: error: 'lcm' cannot be used as a function 16 | ans = lcm(ans, t); | ~~~^~~~~~~~
s608617943
p03633
C++
#include <iostream> #include <experimental/numeric> #include <boost/range/irange.hpp> using namespace std; using namespace boost; using uint = unsigned int; using ll = long long int; using ull = unsigned long long int; int main() { uint N; cin >> N; ull m{1}; for (auto &&i: irange(0U, N)){ ull a; cin >> a; m = experimental::lcm<ull, ull>(m,a); } cout << m; return 0; }
a.cc:3:10: fatal error: boost/range/irange.hpp: No such file or directory 3 | #include <boost/range/irange.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s643339650
p03633
C++
// ConsoleApplication9.cpp : アプリケーションのエントリ ポイントを定義します。 // #include "stdafx.h" #include <iostream> #include <algorithm> using namespace std; long long int LCD(long long int a, long long int b) { long long int i, j, r,tmp,k, sum,LCD; i = a; j = b; if(b>a){ tmp = a; a = b; b = tmp; } r = a % b; while (r != 0) { a = b; b = r; r = a % b; } return i*j/r; } int main() { int N, i, j, k, l, cnt; long long int sum; long long int T[100]; cin >> N; for (i = 0; i < N; i++) { cin >> T[i]; } sum = LCD(T[0], T[1]); for (i = 1; i < N-1; i++) { sum=LCD(sum, T[i + 1]); } cout << sum << endl; return 0; }
a.cc:5:10: fatal error: stdafx.h: No such file or directory 5 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s952782724
p03633
C++
#include <iostream> #include <algorithm> using namespace std; int solve(int i,int j){ long long a=max(i,j),b=min(i,j); while(a%b!=0){ a-=b*(a/b); long long x=max(a,b),y=min(a,b); a=x; b=y; } return i*j/b; } int main(void){ long long n; cin>>n; vector<long long> t(n); for(int i=0;i<n;i++){ cin>>t[i]; } long long ans=solve(t[0],t[1]); for(int i=0;i<n;i++){ ans=solve(ans,t[i]); } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:19:5: error: 'vector' was not declared in this scope 19 | vector<long long> t(n); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <algorithm> +++ |+#include <vector> 3 | using namespace std; a.cc:19:12: error: expected primary-expression before 'long' 19 | vector<long long> t(n); | ^~~~ a.cc:21:14: error: 't' was not declared in this scope 21 | cin>>t[i]; | ^ a.cc:23:25: error: 't' was not declared in this scope 23 | long long ans=solve(t[0],t[1]); | ^
s924840914
p03633
C++
for(int i=0;i<N-1;i++){ head=clk[i]; next=clk[i+1]; if(head>next){ clk[i+1]=head/gcd(head,next)*next; }else{ clk[i+1]=head/gcd(next,head)*next; } } long long gcd(long long a,long long b){ long long rem; while(1){ rem=a%b; a=b; b=rem; if(b==0){ break; } } return a; }
a.cc:1:1: error: expected unqualified-id before 'for' 1 | for(int i=0;i<N-1;i++){ | ^~~ a.cc:1:13: error: 'i' does not name a type 1 | for(int i=0;i<N-1;i++){ | ^ a.cc:1:19: error: 'i' does not name a type 1 | for(int i=0;i<N-1;i++){ | ^
s685118251
p03633
C++
#include<iostream> #include<math.h> using namespace std; int main() { int a,t[101],ans=0,h; bool ok=true; cin>>a; for(int i=0;i<a;i++) {cin>>t[i]; ans=max(t[i],ans);} h=ans; for(int i=1; ;i++) {h=ans*i; for(int j=0;j<t.size();j++) {if(h%t[j]!=0) ok=false; break;} if(ok==true) cout<<h;} return 0; }
a.cc: In function 'int main()': a.cc:15:18: error: request for member 'size' in 't', which is of non-class type 'int [101]' 15 | for(int j=0;j<t.size();j++) | ^~~~
s639690083
p03633
C++
#include<iostream> #include<math.h> using namespace std; int main() { int a,t[101],ans=0; bool ok=true; cin>>a; for(int i=0;i<a;i++) {cin>>t[i]; ans=max(t[i],ans);} h=ans; for(int i=1; ;i++) {h=ans*i; for(int i=0;i<t.size();i++) {if(h%t[i]!=0) ok=false; break;} if(ok==true) cout<<h;} return 0; }
a.cc: In function 'int main()': a.cc:12:1: error: 'h' was not declared in this scope 12 | h=ans; | ^ a.cc:15:18: error: request for member 'size' in 't', which is of non-class type 'int [101]' 15 | for(int i=0;i<t.size();i++) | ^~~~
s705942697
p03633
C++
#include "stdafx.h" #include <iostream> //#include "bits/stdc++.h" #define M unsigned long long using namespace std; M gcd(M a, M b) { if (b == 0) return a; a %= b; return gcd(b, a); } M lcm(M a, M b) { return a / gcd(a, b)*b; } int main() { int num; M clock[101], temp; cin >> num; for (int i = 1; i < num; i++) { cin >> clock[i]; if (i == 1) temp = clock[1]; else temp = (temp, clock[i]); } printf("%lld", temp); return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s153710498
p03633
C++
#include <iostream> #include <stack> #include <math.h> #define M unsigned __int64 using namespace std; M gcd(M a, M b) { if (b == 0) return a; a %= b; return gcd(b, a); } M lcm(M a, M b) { return a / gcd(a, b)*b; } int main() { int num; M clock[101], temp; cin >> num; for (int i = 1; i <= num; i++) { cin >> clock[i]; if (i == 1) temp = clock[1]; else temp = (temp, clock[i]); } cout << temp; return 0; }
a.cc:6:3: error: expected initializer before 'gcd' 6 | M gcd(M a, M b) { | ^~~ a.cc:13:3: error: expected initializer before 'lcm' 13 | M lcm(M a, M b) { | ^~~ a.cc: In function 'int main()': a.cc:19:11: error: expected initializer before 'clock' 19 | M clock[101], temp; | ^~~~~ a.cc:22:31: warning: pointer to a function used in arithmetic [-Wpointer-arith] 22 | cin >> clock[i]; | ^ a.cc:22:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'clock_t() noexcept' {aka 'long int() noexcept'}) 22 | cin >> clock[i]; | ~~~ ^~ ~~~~~~~~ | | | | | clock_t() noexcept {aka long int() noexcept} | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:22:31: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} 22 | cin >> clock[i]; | ~~~~~~~^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:22:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'short int' [-fpermissive] 22 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:22:31: error: cannot bind rvalue '(short int)(clock + ((sizetype)i))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:22:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'short unsigned int' [-fpermissive] 22 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:22:31: error: cannot bind rvalue '(short unsigned int)(clock + ((sizetype)i))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:22:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'int' [-fpermissive] 22 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:22:31: error: cannot bind rvalue '(int)(clock + ((sizetype)i))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:22:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'unsigned int' [-fpermissive] 22 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:22:31: error: cannot bind rvalue '(unsigned int)(clock + ((sizetype)i))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:22:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long int' [-fpermissive] 22 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:22:31: error: cannot bind rvalue '(long int)(clock + ((sizetype)i))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:22:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long unsigned int' [-fpermissive] 22 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:22:31: error: cannot bind rvalue '(long unsigned int)(clock + ((sizetype)i))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:22:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long long int' [-fpermissive] 22 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:22:31: error: cannot bind rvalue '(long long int)(clock + ((sizetype)i))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:22:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long long unsigned int' [-fpermissive] 22 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:22:31: error: cannot bind rvalue '(long long unsigned int)(clock + ((sizetype)i))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:22:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'void*' [-fpermissive] 22 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:22:31: error: cannot bind rvalue '(void*)(clock + ((sizetype)i))' to 'void*&' /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed: a.cc:22:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive] 22 | cin >> clock[i]; |
s578077677
p03633
C++
#include<stdio.h> #include <iostream> #include <bits/stdc++.h> #define M unsigned __int64 using namespace std; M lcm(M a, M b) { return a / __gcd(a, b)*b; } int main() { int num; M clock[101],temp; cin >> num; for (int i = 1; i <= num; i++) { cin >> clock[i]; if (i == 1) temp = clock[1]; else temp = (temp, clock[i]); } cout << temp; return 0; }
a.cc:6:3: error: expected initializer before 'lcm' 6 | M lcm(M a, M b) { | ^~~ a.cc: In function 'int main()': a.cc:12:11: error: expected initializer before 'clock' 12 | M clock[101],temp; | ^~~~~ a.cc:15:31: warning: pointer to a function used in arithmetic [-Wpointer-arith] 15 | cin >> clock[i]; | ^ a.cc:15:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'clock_t() noexcept' {aka 'long int() noexcept'}) 15 | cin >> clock[i]; | ~~~ ^~ ~~~~~~~~ | | | | | clock_t() noexcept {aka long int() noexcept} | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:2: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:15:31: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} 15 | cin >> clock[i]; | ~~~~~~~^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:15:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'short int' [-fpermissive] 15 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:15:31: error: cannot bind rvalue '(short int)(clock + ((sizetype)i))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:15:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'short unsigned int' [-fpermissive] 15 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:15:31: error: cannot bind rvalue '(short unsigned int)(clock + ((sizetype)i))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:15:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'int' [-fpermissive] 15 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:15:31: error: cannot bind rvalue '(int)(clock + ((sizetype)i))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:15:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'unsigned int' [-fpermissive] 15 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:15:31: error: cannot bind rvalue '(unsigned int)(clock + ((sizetype)i))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:15:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long int' [-fpermissive] 15 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:15:31: error: cannot bind rvalue '(long int)(clock + ((sizetype)i))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:15:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long unsigned int' [-fpermissive] 15 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:15:31: error: cannot bind rvalue '(long unsigned int)(clock + ((sizetype)i))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:15:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long long int' [-fpermissive] 15 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:15:31: error: cannot bind rvalue '(long long int)(clock + ((sizetype)i))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:15:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long long unsigned int' [-fpermissive] 15 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:15:31: error: cannot bind rvalue '(long long unsigned int)(clock + ((sizetype)i))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:15:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'void*' [-fpermissive] 15 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:15:31: error: cannot bind rvalue '(void*)(clock + ((sizetype)i))' to 'void*&' /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed: a.cc:15:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive] 15 | cin >> clock[i]; | ~~~~~~~^ | | |
s463011176
p03633
C++
#include <iostream> #include "bits/stdc++.h" #include <stack> #include <math.h> #define M unsigned __int64 using namespace std; M lcm(M a, M b) { return a / gcd(a, b)*b; } int main() { int num; M clock[101],temp; cin >> num; for (int i = 1; i <= num; i++) { cin >> clock[i]; if (i == 1) temp = clock[1]; else temp = (temp, clock[i]); } cout << temp; return 0; }
a.cc:7:3: error: expected initializer before 'lcm' 7 | M lcm(M a, M b) { | ^~~ a.cc: In function 'int main()': a.cc:13:11: error: expected initializer before 'clock' 13 | M clock[101],temp; | ^~~~~ a.cc:16:31: warning: pointer to a function used in arithmetic [-Wpointer-arith] 16 | cin >> clock[i]; | ^ a.cc:16:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'clock_t() noexcept' {aka 'long int() noexcept'}) 16 | cin >> clock[i]; | ~~~ ^~ ~~~~~~~~ | | | | | clock_t() noexcept {aka long int() noexcept} | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:16:31: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} 16 | cin >> clock[i]; | ~~~~~~~^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:16:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'short int' [-fpermissive] 16 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:16:31: error: cannot bind rvalue '(short int)(clock + ((sizetype)i))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:16:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'short unsigned int' [-fpermissive] 16 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:16:31: error: cannot bind rvalue '(short unsigned int)(clock + ((sizetype)i))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:16:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'int' [-fpermissive] 16 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:16:31: error: cannot bind rvalue '(int)(clock + ((sizetype)i))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:16:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'unsigned int' [-fpermissive] 16 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:16:31: error: cannot bind rvalue '(unsigned int)(clock + ((sizetype)i))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:16:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long int' [-fpermissive] 16 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:16:31: error: cannot bind rvalue '(long int)(clock + ((sizetype)i))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:16:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long unsigned int' [-fpermissive] 16 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:16:31: error: cannot bind rvalue '(long unsigned int)(clock + ((sizetype)i))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:16:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long long int' [-fpermissive] 16 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:16:31: error: cannot bind rvalue '(long long int)(clock + ((sizetype)i))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:16:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'long long unsigned int' [-fpermissive] 16 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:16:31: error: cannot bind rvalue '(long long unsigned int)(clock + ((sizetype)i))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:16:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'void*' [-fpermissive] 16 | cin >> clock[i]; | ~~~~~~~^ | | | clock_t (*)() noexcept {aka long int (*)() noexcept} a.cc:16:31: error: cannot bind rvalue '(void*)(clock + ((sizetype)i))' to 'void*&' /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed: a.cc:16:31: error: invalid conversion from 'clock_t (*)() noexcept' {aka 'long int (*)() noexcept'} to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive] 16 | cin >> clock[i]; | ~~~~~~~^ | | |
s911055901
p03633
C
#include<stdio.h> /*long long int xbys(long long int a[],int n) { int i; long long int m,zxgbs,x,y; m=a[0]; for(i=0;i<n-1;i++) { x=m; y=a[i+1]; zxgbs=zzxc(x,y); m=x/zxgbs*y/zxgbs*zxgbs; } return m; }*/ long long int ntm(long long int a,long long int b) { long long int num; if(a<b) { num=a; a=b; b=num; } if(a%b==0) return b; else return ntm(b,a%b); } int main(void) { int n,i; long long int t[105],out,mid,zxgbs,x,y; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%lld",&t[i]); } out=t[0]; mid=t[0]; for(i=1;i<n;i++){ x=mid; y=t[i]; zxgbs=ntm(mid,t[i]); mid=out=x/zxgbs*y/zxgbs*zxgbs; } printf("%lld",out); } return 0; }
main.c:50:5: error: expected identifier or '(' before 'return' 50 | return 0; | ^~~~~~ main.c:51:1: error: expected identifier or '(' before '}' token 51 | } | ^
s423933157
p03633
C
#include<stdio.h> /*long long int xbys(long long int a[],int n) { int i; long long int m,zxgbs,x,y; m=a[0]; for(i=0;i<n-1;i++) { x=m; y=a[i+1]; zxgbs=zzxc(x,y); m=x/zxgbs*y/zxgbs*zxgbs; } return m; }*/ long long int ntm(long long int a,long long int b) { long long int num; if(a<b) { num=a; a=b; b=num; } if(a%b==0) return b; else return ntm(b,a%b); } int main(void) { int n,i; long long int t[105],out,mid,zxgbs,x,y; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%lld",&t[i]); } out=t[0]; mid=t[0]; for(i=1;i<n;i++){ x=mid; y=t[i]; zxgbs=ntm(mid,t[i]); mid=out=x/zxgbs*y/zxgbs*zxgbs; } printf("%lld",out); } return 0; }
main.c:50:5: error: expected identifier or '(' before 'return' 50 | return 0; | ^~~~~~ main.c:51:1: error: expected identifier or '(' before '}' token 51 | } | ^
s635186298
p03633
C
#include<stdio.h> long long int xbys(long long int a[],int n) { int i; long long int m,zxgbs,x,y; m=a[0]; for(i=0;i<n-1;i++) { x=m; y=a[i+1]; zxgbs=zzxc(x,y); m=x/zxgbs*y/zxgbs*zxgbs; } return m; } long long int zzxc(long long int a,long long int b) { long long int num; if(a<b) { num=a; a=b; b=num; } if(a%b==0) return b; else return zzxc(b,a%b); } int main(void) { int n,i; long long int t[105],max=0,out,mid; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%lld",&t[i]); if(max<t[i]) max=t[i]; } if(max==1000000000000000000) printf("1000000000000000000"); else { out=xbys(t,n); /*mid=t[0]; for(i=1;i<n;i++){ out=xbys(mid,t[i]); mid=out;*/ } printf("%lld",out); } return 0; }
main.c: In function 'xbys': main.c:11:23: error: implicit declaration of function 'zzxc' [-Wimplicit-function-declaration] 11 | zxgbs=zzxc(x,y); | ^~~~ main.c: At top level: main.c:17:15: error: conflicting types for 'zzxc'; have 'long long int(long long int, long long int)' 17 | long long int zzxc(long long int a,long long int b) | ^~~~ main.c:11:23: note: previous implicit declaration of 'zzxc' with type 'int()' 11 | zxgbs=zzxc(x,y); | ^~~~ main.c:53:5: error: expected identifier or '(' before 'return' 53 | return 0; | ^~~~~~ main.c:54:1: error: expected identifier or '(' before '}' token 54 | } | ^
s981443785
p03633
C
#include<stdio.h> long long int xbys(long long int a[],int n) { int i; long long int m,zxgbs,x,y; m=a[0]; for(i=0;i<n-1;i++) { x=m; y=a[i+1]; zxgbs=zzxc(x,y); m=x/zxgbs*y/zxgbs*zxgbs; } return m; } long long int zzxc(long long int a,long long int b) { long long int num; if(a<b) { num=a; a=b; b=num; } if(a%b==0) return b; else return zzxc(b,a%b); } int main(void) { int n,i; long long int t[105],max=0,out,mid; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%lld",&t[i]); if(max<t[i]) max=t[i]; } if(max==1000000000000000000) printf("1000000000000000000"); else { out=xbys(t,n); /*mid=t[0]; for(i=1;i<n;i++){ out=xbys(mid,t[i]); mid=out;*/ } printf("%lld",out); } return 0; }
main.c: In function 'xbys': main.c:11:23: error: implicit declaration of function 'zzxc' [-Wimplicit-function-declaration] 11 | zxgbs=zzxc(x,y); | ^~~~ main.c: At top level: main.c:17:15: error: conflicting types for 'zzxc'; have 'long long int(long long int, long long int)' 17 | long long int zzxc(long long int a,long long int b) | ^~~~ main.c:11:23: note: previous implicit declaration of 'zzxc' with type 'int()' 11 | zxgbs=zzxc(x,y); | ^~~~ main.c:53:5: error: expected identifier or '(' before 'return' 53 | return 0; | ^~~~~~ main.c:54:1: error: expected identifier or '(' before '}' token 54 | } | ^
s199268942
p03633
C
#include<stdio.h> long long int xbys(long long int a[],int n) { int i; long long int m,zxgbs,x,y; m=a[0]; for(i=0;i<n-1;i++) { x=m; y=a[i+1]; zxgbs=zzxc(x,y); m=x/zxgbs*y/zxgbs*zxgbs; } return m; } long long int zzxc(long long int a,long long int b) { long long int num; if(a<b) { num=a; a=b; b=num; } if(a%b==0) return b; else return zzxc(b,a%b); } int main(void) { int n,i; long long int t[105],max=0,out,mid; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%lld",&t[i]); if(max<t[i]) max=t[i]; } if(max==1000000000000000000) printf("1000000000000000000"); else { out=xbys(t,n); /*mid=t[0]; for(i=1;i<n;i++){ out=xbys(mid,t[i]); mid=out;*/ } printf("%lld",out); } return 0; }
main.c: In function 'xbys': main.c:11:23: error: implicit declaration of function 'zzxc' [-Wimplicit-function-declaration] 11 | zxgbs=zzxc(x,y); | ^~~~ main.c: At top level: main.c:17:15: error: conflicting types for 'zzxc'; have 'long long int(long long int, long long int)' 17 | long long int zzxc(long long int a,long long int b) | ^~~~ main.c:11:23: note: previous implicit declaration of 'zzxc' with type 'int()' 11 | zxgbs=zzxc(x,y); | ^~~~ main.c:53:5: error: expected identifier or '(' before 'return' 53 | return 0; | ^~~~~~ main.c:54:1: error: expected identifier or '(' before '}' token 54 | } | ^
s645276451
p03633
C
#include<stdio.h> long long int xbys(long long int a[],int n) { int i; long long int m,zxgbs,x,y; m=a[0]; for(i=0;i<n-1;i++) { x=m; y=a[i+1]; zxgbs=zzxc(x,y); m=x/zxgbs*y/zxgbs*zxgbs; } return m; } long long int zzxc(long long int a,long long int b) { long long int num; if(a<b) { num=a; a=b; b=num; } if(a%b==0) return b; else return zzxc(b,a%b); } int main(void) { int n,i; long long int t[105],max=0,out,mid; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%lld",&t[i]); if(max<t[i]) max=t[i]; } if(max==1000000000000000000) printf("1000000000000000000"); else { out=xbys(t,n); /*mid=t[0]; for(i=1;i<n;i++){ out=xbys(mid,t[i]); mid=out;*/ } printf("%lld",out); } return 0; }
main.c: In function 'xbys': main.c:11:23: error: implicit declaration of function 'zzxc' [-Wimplicit-function-declaration] 11 | zxgbs=zzxc(x,y); | ^~~~ main.c: At top level: main.c:17:15: error: conflicting types for 'zzxc'; have 'long long int(long long int, long long int)' 17 | long long int zzxc(long long int a,long long int b) | ^~~~ main.c:11:23: note: previous implicit declaration of 'zzxc' with type 'int()' 11 | zxgbs=zzxc(x,y); | ^~~~ main.c:53:5: error: expected identifier or '(' before 'return' 53 | return 0; | ^~~~~~ main.c:54:1: error: expected identifier or '(' before '}' token 54 | } | ^
s145780845
p03633
C++
#include <stdio.h> #include <bits/stdc++.h> #define LL unsigned __int64 using namespace std; LL gcd(LL a , LL b) { if(b==0) return a; a%=b; return gcd(b,a); } LL lcm(LL a,LL b){ if (a>=1000000000000000000||b>=1000000000000000000) return 1000000000000000000; return a*b/gcd(a,b); } int main() { int count; LL arr[100]; scanf("%d",&count); for(int i=0;i<count;i++){ scanf("%lld",&arr[i]); } LL temp; temp = lcm(arr[0],1); for(int i=1;i<count;i++){ temp = lcm(temp,arr[i]); } // printf("%llu", temp); cout << temp; // fclose(stdout); return 0; }
a.cc:5:4: error: expected initializer before 'gcd' 5 | LL gcd(LL a , LL b) | ^~~ a.cc:12:4: error: expected initializer before 'lcm' 12 | LL lcm(LL a,LL b){ | ^~~ a.cc: In function 'int main()': a.cc:23:8: error: expected initializer before 'arr' 23 | LL arr[100]; | ^~~ a.cc:26:23: error: 'arr' was not declared in this scope 26 | scanf("%lld",&arr[i]); | ^~~ a.cc:28:8: error: expected initializer before 'temp' 28 | LL temp; | ^~~~ a.cc:29:5: error: 'temp' was not declared in this scope; did you mean 'tm'? 29 | temp = lcm(arr[0],1); | ^~~~ | tm a.cc:29:16: error: 'arr' was not declared in this scope 29 | temp = lcm(arr[0],1); | ^~~
s691307870
p03633
C++
#include <stdio.h> #include <bits/stdc++.h> #define LL unsigned __int64 using namespace std; LL gcd(LL a , LL b) { if(b==0) return a; a%=b; return gcd(b,a); } LL lcm(LL a,LL b){ if (a>=1000000000000000000||b>=1000000000000000000) return 1000000000000000000; return a*b/gcd(a,b); } int main() { int count; LL arr[100]; scanf("%d",&count); for(int i=0;i<count;i++){ scanf("%lld",&arr[i]); } LL temp; temp = lcm(arr[0],1); for(int i=1;i<count;i++){ temp = lcm(temp,arr[i]); } // printf("%llu", temp); cout << temp; return 0; }
a.cc:5:4: error: expected initializer before 'gcd' 5 | LL gcd(LL a , LL b) | ^~~ a.cc:12:4: error: expected initializer before 'lcm' 12 | LL lcm(LL a,LL b){ | ^~~ a.cc: In function 'int main()': a.cc:22:8: error: expected initializer before 'arr' 22 | LL arr[100]; | ^~~ a.cc:25:23: error: 'arr' was not declared in this scope 25 | scanf("%lld",&arr[i]); | ^~~ a.cc:27:8: error: expected initializer before 'temp' 27 | LL temp; | ^~~~ a.cc:28:5: error: 'temp' was not declared in this scope; did you mean 'tm'? 28 | temp = lcm(arr[0],1); | ^~~~ | tm a.cc:28:16: error: 'arr' was not declared in this scope 28 | temp = lcm(arr[0],1); | ^~~
s740757034
p03633
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <stack> #include <queue> #include <vector> #include <set> #include <cmath> #define FOR(i,a,b) for(int i=a;i<b;i++) #define MA(i,j) make_pair(i,j) #define PA pair<int,int> #define PB push_back #define PQ priority_queue<int> #define PGQ priority_queue<int,vector<int>,greater<int> > #define VE vector<int> #define VP vector<PA> #define MOD 1000000007 #define INF 1000000007 using namespace std; // long long GCD(long long a,long long b){ return b?GCD(b,a%b):a; } long long LCM(long long a,long long b){ return a/GCD(a,b)*b; } int main(){ long long N,T[100],X=1; cin>>N; FOR(i,0,N){ cin>>Y[i]; X=LCM(X,Y[i]); } cout<<X<<endl; return 0; }
a.cc: In function 'int main()': a.cc:33:10: error: 'Y' was not declared in this scope 33 | cin>>Y[i]; | ^
s516973425
p03633
C++
int main() { int numbers[101] ; int n ; bool flag = true ; cin >> n ; for(int i = 0 ; i < n ; i++){ cin >> numbers[i] ; } sort(numbers, numbers + n) ; int max = numbers[n - 1] ; for(int j = 0 ; max <= pow(10, 8); max++){ while(max % numbers[j] == 0){ if(j < n - 1) j++ ; else { flag = false ; break ; } } if(!flag) { cout << max ; break ; } } return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin >> n ; | ^~~ a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(numbers, numbers + n) ; | ^~~~ | short a.cc:13:28: error: 'pow' was not declared in this scope 13 | for(int j = 0 ; max <= pow(10, 8); max++){ | ^~~ a.cc:23:13: error: 'cout' was not declared in this scope 23 | cout << max ; | ^~~~
s938351602
p03633
C++
#include <iostream> #include <algorithm> #include <cmath> using namespace std ; int main(int argc, const char * argv[]) { int numbers[100] ; int n ; bool flag = true ; cin >> n ; for(int i = 0 ; i < n ; i++){ cin >> numbers[i] ; } sort(numbers, numbers + n) ; int max = numbers[n - 1] ; for(int j = 0 ; max <= pow(10, 8); max++){ while(max % numbers[j] == 0){ if(j < n - 1) j++ ; else { flag = false ; break ; } } if(!flag) { cout << max ; break ; } }
a.cc: In function 'int main(int, const char**)': a.cc:31:6: error: expected '}' at end of input 31 | } | ^ a.cc:6:41: note: to match this '{' 6 | int main(int argc, const char * argv[]) { | ^
s216325173
p03633
Java
import java.util.Scanner; public class Main{ public static long gcm(long b,long r){ long _r; if(b<r) gcm(r,b); _r=b%r; if(_r==0)return r; else gcm(r,_r); } public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); long[] T = new long[n]; for(int i=0;i<n;i++){ T[i]=scan.nextInt(); } for(int i=0;i<n-1;i++){ T[i+1]=T[i]*T[i+1]/gcm(T[i+1],T[i]); } System.out.println(T[n-1]); } }
Main.java:11: error: missing return statement } ^ 1 error
s217188115
p03633
Java
import java.util.Scanner; public class Main{ public static long gcm(long b,long r){ long _r; if(b<r) return gcm(r,b); _r=b%r; if(_r==0)return r; else gcm(r,_r); } public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); long[] T = new long[n]; for(int i=0;i<n;i++){ T[i]=scan.nextInt(); } for(int i=0;i<n-1;i++){ T[i+1]=T[i]*T[i+1]/gcm(T[i+1],T[i]); } System.out.println(T[n-1]); } }
Main.java:11: error: missing return statement } ^ 1 error
s188850543
p03633
Java
import java.util.Scanner; public class Main{ public static long gcm(long b,long r){ int _r; if(b<r) return gcm(r,b); _r=b%r; if(_r==0)return r; else gcm(r,_r); } public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); long[] T = new long[n]; for(int i=0;i<n;i++){ T[i]=scan.nextInt(); } for(int i=0;i<n-1;i++){ T[i+1]=T[i]*T[i+1]/gcm(T[i+1],T[i]); } System.out.println(T[n-1]); } }
Main.java:8: error: incompatible types: possible lossy conversion from long to int _r=b%r; ^ 1 error
s951870652
p03633
Java
import java.util.Scanner; public class Main{ public static long gcm(int b,int r){ int _r; if(b<r) return gcm(r,b); _r=b%r; if(_r==0)return r; else gcm(r,_r); } public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); long[] T = new long[n]; for(int i=0;i<n;i++){ T[i]=scan.nextInt(); } for(int i=0;i<n-1;i++){ T[i+1]=T[i]*T[i+1]/gcm(T[i+1],T[i]); } System.out.println(T[n-1]); } }
Main.java:21: error: incompatible types: possible lossy conversion from long to int T[i+1]=T[i]*T[i+1]/gcm(T[i+1],T[i]); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
s906395303
p03633
Java
import java.util.Scanner; public class Main{ public static int gcm(int b,int r){ int _r; if(b<r) return gcm(r,b); _r=b%r; if(_r==0)return r; else gcm(r,_r); } public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); long[] T = new long[n]; for(int i=0;i<n;i++){ T[i]=scan.nextInt(); } for(int i=0;i<n-1;i++){ T[i+1]=T[i]*T[i+1]/gcm(T[i+1],T[i]); } System.out.println(T[n-1]); } }
Main.java:21: error: incompatible types: possible lossy conversion from long to int T[i+1]=T[i]*T[i+1]/gcm(T[i+1],T[i]); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
s585568233
p03633
Java
import java.util.Scanner; public class Main{ public static int gcm(int b,int r){ int _r; if(b<r) return gcm(r,b); _r=b%r; if(_r==0)return r; else gcm(r,_r); } public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); long int[] T = new int[n]; for(int i=0;i<n;i++){ T[i]=scan.nextInt(); } for(int i=0;i<n-1;i++){ T[i+1]=gcm(T[i+1],T[i]) } System.out.println(T[n-1]); } }
Main.java:16: error: not a statement long int[] T = new int[n]; ^ Main.java:16: error: ';' expected long int[] T = new int[n]; ^ Main.java:21: error: ';' expected T[i+1]=gcm(T[i+1],T[i]) ^ 3 errors
s982352696
p03633
C
#include<stdio.h> long long gcd(long long a,long long b){ int temp; if(a < b){ temp = a; a = b; b = temp; } if(a%b == 0){ return b; }else{ return gcd(b,a%b); } } int main() { long long n; long long gcd(long long a,long long b); long long c[109],sum; while(~scanf("%d",&n)) { sum=0; for(int i=0;i<n;i++) scanf("%lld",&c[i]); while(n==1) { scanf("%lld\n",a[0]); return 0; } for(int i=0;i<n-1;i++) { sum=(c[i]/gcd(c[i],c[i+1]))*c[i+1]; c[i+1]=sum; } printf("%lld\n",sum); } }
main.c: In function 'main': main.c:27:40: error: 'a' undeclared (first use in this function) 27 | scanf("%lld\n",a[0]); | ^ main.c:27:40: note: each undeclared identifier is reported only once for each function it appears in
s908976979
p03633
C
#include<stdio.h> long long gcd(long long a,long long b){ int temp; if(a < b){ temp = a; a = b; b = temp; } if(a%b == 0){ return b; }else{ return gcd(b,a%b); } } int main() { long long n; long long gcd(long long a,long long b); long long c[109],sum; while(~scanf("%d",&n)) { sum=0; for(int i=0;i<n;i++) scanf("%lld",&c[i]); while(n==1) { scanf("%lld",a[0]); return 0; } for(int i=0;i<n-1;i++) { sum=(c[i]/gcd(c[i],c[i+1]))*c[i+1]; c[i+1]=sum; } printf("%lld\n",sum); } }
main.c: In function 'main': main.c:27:38: error: 'a' undeclared (first use in this function) 27 | scanf("%lld",a[0]); | ^ main.c:27:38: note: each undeclared identifier is reported only once for each function it appears in
s782581963
p03633
C
#include<stdio.h> unsigned long long int divisor(unsigned long long int a,unsigned long long int b) { unsigned long long int temp; if(a<b) {temp=a;a=b;b=temp;} while(b!=0) {temp=a%b;a=b;b=temp;} return (a); } unsigned long long int multiple(unsigned long long int a,unsigned long long int b) { int divisor(unsigned long long int a,unsigned long long int b); unsigned long long int temp; temp=divisor(a,b); return (a/temp%b*b); } unsigned long long int lcmN(unsigned long long int a[],unsigned long long int len) { unsigned long long int i=0,temp; while(i<len-1) { temp=multiple(a[i],a[i+1]); i++; a[i]=temp; } return temp; } int main() { unsigned long long int n,i; unsigned long long int t[110]; scanf("%llu",&n); for(i=0;i<n;i++) { scanf("%llu",&t[i]); } printf("%llu\n",lcmN(t,n)); return 0; }
main.c: In function 'multiple': main.c:12:9: error: conflicting types for 'divisor'; have 'int(long long unsigned int, long long unsigned int)' 12 | int divisor(unsigned long long int a,unsigned long long int b); | ^~~~~~~ main.c:2:24: note: previous definition of 'divisor' with type 'long long unsigned int(long long unsigned int, long long unsigned int)' 2 | unsigned long long int divisor(unsigned long long int a,unsigned long long int b) | ^~~~~~~
s297968898
p03633
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <cmath> using namespace std; #define ll long long const int N=10005; const int mod=1e9+7; const int maxn=1e7; la[101]; gcd(ll x,ll y) { c; m=x,n=y; while(y!=0){ c=x%y; x=y; y=c; } return m/x*n; } int main() { int n; cin>>n; ll m,s,l; cin>>m; if(n==1) cout<<m<<endl; else if(n>1){ cin>>l; s=gcd(l,m); for(int i=0;i<n-2;i++){ cin>>m; s=gcd(s,m); } cout<<s<<endl; } return 0; }
a.cc:12:2: error: 'la' does not name a type; did you mean 'll'? 12 | la[101]; | ^~ | ll a.cc:13:3: error: ISO C++ forbids declaration of 'gcd' with no type [-fpermissive] 13 | gcd(ll x,ll y) | ^~~ a.cc: In function 'int gcd(long long int, long long int)': a.cc:14:8: error: 'c' was not declared in this scope 14 | { c; m=x,n=y; | ^ a.cc:14:11: error: 'm' was not declared in this scope 14 | { c; m=x,n=y; | ^ a.cc:14:15: error: 'n' was not declared in this scope 14 | { c; m=x,n=y; | ^
s980920606
p03633
C
#include<stdio.h> unsigned long long int divisor(unsigned long long int a,unsigned long long int b) { unsigned long long int temp; if(a<b) {temp=a;a=b;b=temp;} while(b!=0) {temp=a%b;a=b;b=temp;} return (a); } unsigned long long int multiple(unsigned long long int a,unsigned long long int b) { int divisor(unsigned long long int a,unsigned long long int b); unsigned long long int temp; temp=divisor(a,b); return (a/temp%b*b); } unsigned long long int lcmN(unsigned long long int a[],unsigned long long int len) { unsigned long long int i=0,temp; while(i<len-1) { temp=multiple(a[i],a[i+1]); i++; a[i]=temp; } return temp; } int main() { unsigned long long int n,i; unsigned long long int t[110]; scanf("%llu",&n); for(i=0;i<n;i++) { scanf("%llu",&t[i]); } printf("%llu\n",lcmN(t,n)); return 0; }
main.c: In function 'multiple': main.c:12:9: error: conflicting types for 'divisor'; have 'int(long long unsigned int, long long unsigned int)' 12 | int divisor(unsigned long long int a,unsigned long long int b); | ^~~~~~~ main.c:2:24: note: previous definition of 'divisor' with type 'long long unsigned int(long long unsigned int, long long unsigned int)' 2 | unsigned long long int divisor(unsigned long long int a,unsigned long long int b) | ^~~~~~~
s902387763
p03633
C
#include<stdio.h> unsigned long long int divisor(unsigned long long int a,unsigned long long int b) { unsigned long long int temp; if(a<b) {temp=a;a=b;b=temp;} while(b!=0) {temp=a%b;a=b;b=temp;} return (a); } unsigned long long int multiple(unsigned long long int a,unsigned long long int b) { int divisor(unsigned long long int a,unsigned long long int b); unsigned long long int temp; temp=divisor(a,b); return (a/temp%b*b); } unsigned long long int lcmN(unsigned long long int a[],unsigned long long int len) { unsigned long long int i=0,temp; while(i<len-1) { temp=multiple(a[i],a[i+1]); i++; a[i]=temp; } return temp; } int main() { unsigned long long int n,i; unsigned long long int t[110]; scanf("%llu",&n); for(i=0;i<n;i++) { scanf("%llu",&t[i]); } printf("%llu\n",lcmN(t,n)); return 0; }
main.c: In function 'multiple': main.c:12:9: error: conflicting types for 'divisor'; have 'int(long long unsigned int, long long unsigned int)' 12 | int divisor(unsigned long long int a,unsigned long long int b); | ^~~~~~~ main.c:2:24: note: previous definition of 'divisor' with type 'long long unsigned int(long long unsigned int, long long unsigned int)' 2 | unsigned long long int divisor(unsigned long long int a,unsigned long long int b) | ^~~~~~~
s358821783
p03633
C
#include<stdio.h> int divisor(long long int a,long long int b) { long long int temp; if(a<b) {temp=a;a=b;b=temp;} while(b!=0) {temp=a%b;a=b;b=temp;} return (a); } int multiple(long long int a,long long int b) { long long int divisor(long long int a,long long int b); long long int temp; temp=divisor(a,b); return (a*b/temp); } int lcmN(long long int a[],long long int len) { long long int i=0,temp; while(i<len-1) { temp=multiple(a[i],a[i+1]); i++; a[i]=temp; } return temp; } int main() { long long int n,i; long long int t[110]; scanf("%lld",&n); for(i=0;i<n;i++) { scanf("%lld",&t[i]); } printf("%lld\n",lcmN(t,n)); return 0; }
main.c: In function 'multiple': main.c:12:23: error: conflicting types for 'divisor'; have 'long long int(long long int, long long int)' 12 | long long int divisor(long long int a,long long int b); | ^~~~~~~ main.c:2:5: note: previous definition of 'divisor' with type 'int(long long int, long long int)' 2 | int divisor(long long int a,long long int b) | ^~~~~~~
s152409489
p03633
C++
#include <iostream> #include <string> #include <algorithm> #include <map> #include <cmath> #define MOD 1000000007; #define PI = 3.14159265358979323846; using namespace std; int main() { int N; long long T[100]; cin >> N; for (int i = 0; i < N; i++) { cin >> T[i]; } sort(T, T + N); for (int i = 1; i < T[N - 1]; i++) { long long A = T[N - 1] * i; if (A > ULLONG_MAX) { break; } for (int j = 0; j < N - 1; j++) { if (A % T[j] != 0) { break; } if (j == N - 2) { cout << A << endl; return 0; } } } }
a.cc: In function 'int main()': a.cc:27:25: error: 'ULLONG_MAX' was not declared in this scope 27 | if (A > ULLONG_MAX) | ^~~~~~~~~~ a.cc:6:1: note: 'ULLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 5 | #include <cmath> +++ |+#include <climits> 6 | #define MOD 1000000007;
s032138281
p03633
C++
#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; }
a.cc: In function 'll lcm(ll, ll)': a.cc:12:5: error: 'LL' was not declared in this scope; did you mean 'll'? 12 | LL g = gcd(a, b); | ^~ | ll a.cc:13:15: error: 'g' was not declared in this scope 13 | return a/(g*b); | ^
s106626910
p03633
C++
# Here your code ! n=gets.to_i array=[] n.times{ array<<gets.to_i } if n==1 puts array[0] else a=array[0] i=1 (array.length-1).times{ b=array[i] c=a.lcm(b) a=c i=i+1 } puts a end
a.cc:1:3: error: invalid preprocessing directive #Here 1 | # Here your code ! | ^~~~ a.cc:4:1: error: 'n' does not name a type 4 | n=gets.to_i | ^ a.cc:12:1: error: expected unqualified-id before 'if' 12 | if n==1 | ^~ a.cc:33:1: error: 'puts' does not name a type 33 | puts a | ^~~~
s021201353
p03633
C++
#include <stdio.h> #include <stdlib.h> long long int GCD2(long long int A,long long int B){ long long int C; long long int gcd2; if (A<B){ C=B%A; if (C==0){ gcd2=A; } if (C!=0){ gcd2=GCD2(C,A); } } else{ C=A%B; if (C==0){ gcd2=B; } if (C!=0){ gcd2=GCD2(C,B); } } return gcd2; } long long int GCD(int N,long long int *T){ int NN=N/2; int new_N; int i; long long int ans; long long int *new_T; if (N>1){ if (N==NN*2){ new_N=NN; new_T=malloc(new_N*sizeof(long long int)); for (i=0;i<NN;i++){ new_T[i]=(T[i*2]/GCD2(T[i*2],T[i*2+1]))*T[i*2+1]; } } else{ new_N=NN+1; new_T=malloc(new_N*sizeof(long long int)); for (i=0;i<NN;i++){ new_T[i]=(T[i*2]/GCD2(T[i*2],T[i*2+1]))*T[i*2+1]; } new_T[new_N-1]=T[N-1]; } ans=GCD(new_N,new_T); } if (N==1){ ans=T[0]; } return ans; } int main(){ int N; int i; scanf("%d",&N); long long int *T=malloc(N*sizeof(long long int)); for (i=0;i<N;i++){ scanf("%lld",&T[i]); } long long int ans=GCD(N,T); printf("%lld\n",ans); return 0; }
a.cc: In function 'long long int GCD(int, long long int*)': a.cc:37:37: error: invalid conversion from 'void*' to 'long long int*' [-fpermissive] 37 | new_T=malloc(new_N*sizeof(long long int)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | void* a.cc:44:37: error: invalid conversion from 'void*' to 'long long int*' [-fpermissive] 44 | new_T=malloc(new_N*sizeof(long long int)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | void* a.cc: In function 'int main()': a.cc:63:32: error: invalid conversion from 'void*' to 'long long int*' [-fpermissive] 63 | long long int *T=malloc(N*sizeof(long long int)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ | | | void*
s875082463
p03633
C++
#include <cstdio> #include <cstdint> #include <numeric> int main() { int N; scanf("%d", &N); intmax_t T; scanf("%jd", &T); for (int i=1; i<N; ++i) { intmax_t t; scanf("%jd", &t); T = std::__detail::__lcm(T, t); } printf("%jd\n", T); return 0; }
a.cc: In function 'int main()': a.cc:15:24: error: '__lcm' is not a member of 'std::__detail' 15 | T = std::__detail::__lcm(T, t); | ^~~~~
s353252951
p03633
C
#include <stdio.h> long long int gcd(long long int x, long long int y) { return y ? gcd(y, x % y) : x; } long long int lcm(long long int x, long long int y) { return x/gcd(x, y)*y; } int main() { int N, i; long long int ans = 1LL; long long int T; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%ld" &T); ans = lcm(ans, T); } printf("%lld\n", ans); return 0; }
main.c: In function 'main': main.c:20:21: error: invalid operands to binary & (have 'char *' and 'long long int') 20 | scanf("%ld" &T); | ~~~~~ ^ | | | char *
s088835636
p03633
C++
#include <bits/stdc++.h> using namespace std; using ll= long long; ll gcd(ll a,ll b){ if(b==0) return a; return gcd(b,a%b); } ll lcm(ll a,ll b){ ll g=gcd(a,b); return a/g*b; } int main(){ int N; cin >> N; ll ans = 1LL; for(int i=0;i<N;++i) { ll T; cin >>T ans = lcm(ans, T) } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:9: error: expected ';' before 'ans' 23 | cin >>T | ^ | ; 24 | ans = lcm(ans, T) | ~~~
s884689252
p03633
C++
#include <bits/stdc++.h> using namespace std; using ll= long long; ll gc(ll a,ll b){ if(b==0) return a; return gcd(b,a%b); } ll lcm(ll a,ll b){ ll g=gcd(a,b); return a/g*b; } int main(){ int N; cin >> N; ll ans = 1LL for(int i=0;i<N;i++) { ll T; cin >>T ans = lcm(ans, T) } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:2: error: expected ',' or ';' before 'for' 20 | for(int i=0;i<N;i++) | ^~~ a.cc:20:14: error: 'i' was not declared in this scope 20 | for(int i=0;i<N;i++) | ^
s339591020
p03633
C++
#include <bits/stdc++.h> using namespace std; using ll= long long ll gc(ll a,ll b){ if(b==0) return a; return gcd(b,a%b); } ll lcm(ll a,ll b){ ll g=gcd(a,b); return a/g*b; } int main(){ int N; cin >> N; ll ans = 1LL for(int i=0;i<N;i++) { ll T; cin >>T ans = lcm(ans, T) } cout << ans << endl; return 0; }
a.cc:3:20: error: expected ';' before 'll' 3 | using ll= long long | ^ | ; 4 | 5 | ll gc(ll a,ll b){ | ~~ a.cc:10:1: error: 'll' does not name a type 10 | ll lcm(ll a,ll b){ | ^~ a.cc: In function 'int main()': a.cc:18:2: error: 'll' was not declared in this scope 18 | ll ans = 1LL | ^~ a.cc:20:14: error: 'i' was not declared in this scope 20 | for(int i=0;i<N;i++) | ^ a.cc:27:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 27 | cout << ans << endl; | ^~~ | abs
s505361093
p03633
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; float T[N],tmp,a,b,r,x; for(int i=0;i<N;i++) { cin >> T[i]; } for(int i=0; i<N; ++i) { for (int j=i+1; j<N; ++j) { if (T[i] < T[j]) { tmp = T[i]; T[i] = T[j]; T[j] = tmp; } } } x=a*b; a=T[0]; b=T[N]; r = a % b; while(r!=0){ a = b; b = r; r = a % b; } cout << x/b << endl; return 0; }
a.cc: In function 'int main()': a.cc:27:9: error: invalid operands of types 'float' and 'float' to binary 'operator%' 27 | r = a % b; | ~ ^ ~ | | | | | float | float a.cc:31:11: error: invalid operands of types 'float' and 'float' to binary 'operator%' 31 | r = a % b; | ~ ^ ~ | | | | | float | float
s658003287
p03633
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,a,b,r,; cin >> N; float T[N],tmp; for(int i=0;i<N;i++) { cin >> T[i]; } for(int i=0; i<N; ++i) { for (int j=i+1; j<N; ++j) { if (T[i] < T[j]) { tmp = T[i]; T[i] = T[j]; T[j] = tmp; } } } x=a*b; a=T[0]; b=T[N]; r = a % b; while(r!=0){ a = b; b = r; r = a % b; } cout << x/b << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:14: error: expected unqualified-id before ';' token 5 | int N,a,b,r,; | ^ a.cc:23:3: error: 'x' was not declared in this scope 23 | x=a*b; | ^
s930217189
p03633
C++
#include <bits/stdc++.h> using namespace std; ll gcd(ll m,ll n){ if(n==0) return m; return gcd(n,m%n); } ll lcm(ll m,ll n){ ll g = gcd(m,n); return (m/g)*n; } int main(){ ll ans=1,tmp; int n; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%lld",&tmp); ans = lcm(ans,tmp); } printf("%lld\n",ans); };
a.cc:4:1: error: 'll' does not name a type 4 | ll gcd(ll m,ll n){ | ^~ a.cc:9:1: error: 'll' does not name a type 9 | ll lcm(ll m,ll n){ | ^~ a.cc: In function 'int main()': a.cc:15:5: error: 'll' was not declared in this scope 15 | ll ans=1,tmp; | ^~ a.cc:19:23: error: 'tmp' was not declared in this scope; did you mean 'tm'? 19 | scanf("%lld",&tmp); | ^~~ | tm a.cc:20:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 20 | ans = lcm(ans,tmp); | ^~~ | abs a.cc:22:21: error: 'ans' was not declared in this scope; did you mean 'abs'? 22 | printf("%lld\n",ans); | ^~~ | abs
s112880696
p03633
C++
#include "stdafx.h" #include <iostream> #include <stdio.h> #include <string> #include <vector> #include <algorithm> using namespace std; using LL = unsigned long long; LL gcd(LL a, LL b) { if (b == 0) return a; return gcd(b, a%b); } LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g * b; // Be careful not to overflow } int main() { LL n; LL a[100] = { 0 }; cin >> n; if (n == 1) { LL hoge; cin >> hoge; cout << hoge; return 0; } for (LL i = 0; i < n; i++) { cin >> a[i]; } LL temp = lcm(a[0], a[1]); for (LL i = 2; i < n; i++) { temp = lcm(temp, a[i]); } cout << temp; return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s488317079
p03633
C++
#include "stdafx.h" #include <iostream> #include <stdio.h> #include <string> #include <vector> #include <algorithm> using namespace std; using LL =unsigned long long; LL gcd(LL a, LL b) { if (b == 0) return a; return gcd(b, a%b); } LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g * b; // Be careful not to overflow } int main() { LL n; LL a[100] = { 0 }; cin >> n; for (LL i = 0; i < n; i++) { cin >> a[i]; } LL temp = (a[0],a[1]); for (LL i = 2; i < n; i++) { temp = lcm(temp, a[i]); } cout << temp; return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s346222945
p03633
C++
#include<iostream> using namespace std; int gcd(int a,int b) { if(b==0) return a; return (b,a%b); } int main() { int n,t,i=0,a[100000]; cin>>t; while(t--) { cin>>a[i++]; } for(int j=0;j<i;j++) res=(res*a[j])/gcd(res,a[j]); cout<<res; return 0; }
a.cc: In function 'int main()': a.cc:21:9: error: 'res' was not declared in this scope 21 | res=(res*a[j])/gcd(res,a[j]); | ^~~ a.cc:23:9: error: 'res' was not declared in this scope 23 | cout<<res; | ^~~
s524545921
p03633
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; long long ans = 1; long long t; for (int i = 0; i < n; i++) { cin >> t; ans = ans / __gcd(ans, t) * t; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:29: error: '__gcd' was not declared in this scope 13 | ans = ans / __gcd(ans, t) * t; | ^~~~~
s695779836
p03633
Java
import java.math.BigInteger; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Scanner; public class C { public static void main(String[] args) { Scanner sc = new Scanner(System.in); List<BigInteger> list = new ArrayList<>(); int N = sc.nextInt(); for(int i = 0; i < N; i++) { list.add( new BigInteger(sc.next()) ); } List<BigInteger> newList = new ArrayList<>(new HashSet<BigInteger>(list)); BigInteger result = LCM(newList.get(0), newList.get(1)); for(int i = 2; i < newList.size(); i++) { result = LCM(result, newList.get(i)); } System.out.println(result); } private static BigInteger LCM(BigInteger a, BigInteger b) { return a.multiply(b).divide(a.gcd(b)); } }
Main.java:7: error: class C is public, should be declared in a file named C.java public class C { ^ 1 error
s368041423
p03633
C++
#include<iostream> #include<stdio.h> #include<string.h> using namespace std; long long gys(long long m,long long n) { long long t; int b; if(m<n) { t=m; m=n; n=t; } do{ b=m%n; m=n; n=b; }while(n!=0); return m; } long long gbs(long long m,long long n) { int b; long long sum; b=gys(m,n); sum=m/b*n; return sum; } int main() { long long a[105],b; int n,i; memset(t,0,sizeof(t)); while(scanf("%d",&n)!=EOF) { for(i=0;i<n;i++) scanf("%lld",&a[i]); b=gbs(a[0],a[1]); for(i=2;i<n;i++) b=gbs(b,a[i]); cout<<b<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:34:12: error: 't' was not declared in this scope 34 | memset(t,0,sizeof(t)); | ^
s353505428
p03633
C++
#include <iostream> #include <math.h> #include <vector> #include <memory> #include <time.h> #include <thread> #include <chrono> using namespace std; int main() { int n; cin >> n; unsigned long long *t = new unsigned long long[n]; for (int i = 0; i < n; i++) { cin >> t[i]; } unsigned long long max = 0; for (int i = 0; i < n; i++) { if (max < t[i]) max = t[i]; } vector<unsigned long long> loop_list; for (int i = 0; i < n; i++) { if ((max % t[i]) != 0) { loop_list.push_back(t[i]); } } int count = 1; while (1) { bool is_failed = false; for (int i = 0; i < loop_list.size(); i++) { if (((max * count) % loop_list[i]) != 0) { is_failed = true; break; } } if (is_failed) { if(cout >100){ cout << (unsigned long long)1000000000000000000; } if(max*count >=(unsigned long long)1000000000000000000){ cout << (unsigned long long)1000000000000000000; } count++; } else { break; } } cout << max * count; return 0; }
a.cc: In function 'int main()': a.cc:56:33: error: no match for 'operator>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 56 | if(cout >100){ | ~~~~ ^~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:56:33: note: candidate: 'operator>(int, int)' (built-in) 56 | if(cout >100){ | ~~~~~^~~~ a.cc:56:33: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:48, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 462 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 56 | if(cout >100){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 507 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 56 | if(cout >100){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1714 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 56 | if(cout >100){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1774 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 56 | if(cout >100){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 56 | if(cout >100){ | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 695 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 56 | if(cout >100){ | ^~~ /usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 702 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 56 | if(cout >100){ | ^~~ /usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed: a.cc:56:34: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 56 | if(cout >100){ | ^~~ /usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 56 | if(cout >100){ | ^~~ /usr/include/c++/14/bits/basic_string.h:3929:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3929 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3929:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 56 | if(cout >100){ | ^~~ /usr/include/c++/14/bits/basic_string.h:3942:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3942 | operator>(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3942:5: note: template argument deduction/substitution failed: a.cc:56:34: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>' 56 | if(cout >100){ | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2619:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2619 | operator>(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2619:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::tuple<_UTypes ...>' 56 | if(cout >100){ | ^~~ In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:2102:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator>(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)' 2102 | operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:2102:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::vector<_Tp, _Alloc>' 56 | if(cout >100){ | ^~~ In file included from /usr/include/c++/14/memory:78, from a.cc:4: /usr/include/c++/14/bits/unique_ptr.h:943:5: note: candidate: 'template<class _Tp, class _Dp, class _Up, class _Ep> bool std::operator>(const unique_ptr<_Tp, _Dp>&, const unique_ptr<_Up, _Ep>&)' 943 | operator>(const unique_ptr<_Tp, _Dp>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/unique_ptr.h:943:5: note: template argument deduction/substitution failed: a.cc:56:34: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::unique_ptr<_Tp, _Dp>' 56 | if(cout >100){ | ^~~ /usr/include/c++/14/bits/unique_ptr.h:951:5: note: candidate: 'template<class _Tp, class _Dp> bool std::operator>(const unique_ptr<_Tp, _Dp>&, nullptr_t)' 951 | operator>(const unique_ptr<_Tp, _
s352732206
p03633
C++
#include <iostream> #include <math.h> #include <vector> #include <memory> #include <time.h> #include <thread> #include <chrono> using namespace std; int main() { int n; cin >> n; unsigned long long *t = new unsigned long long[n]; for (int i = 0; i < n; i++) { cin >> t[i]; } unsigned long long max = 0; for (int i = 0; i < n; i++) { if (max < t[i]) max = t[i]; } vector<unsigned long long> loop_list; for (int i = 0; i < n; i++) { if ((max % t[i]) != 0) { loop_list.push_back(t[i]); } } int count = 1; while (1) { bool is_failed = false; for (int i = 0; i < loop_list.size(); i++) { if (((max * count) % loop_list[i]) != 0) { is_failed = true; break; } } if (is_failed) { if(cout >>100){ cout << (unsigned long long)1000000000000000000; } if(max*count >=(unsigned long long)1000000000000000000){ cout << (unsigned long long)1000000000000000000; } count++; } else { break; } } cout << max * count; return 0; }
a.cc: In function 'int main()': a.cc:56:33: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 56 | if(cout >>100){ | ~~~~ ^~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:56:33: note: candidate: 'operator>>(int, int)' (built-in) 56 | if(cout >>100){ | ~~~~~^~~~~ a.cc:56:33: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:56:35: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 56 | if(cout >>100){ | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:56:28: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 56 | if(cout >>100){ | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:56:35: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 56 | if(cout >>100){ | ^~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:56:35: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 56 | if(cout >>100){ | ^~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:56:35: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 56 | if(cout >>100){ | ^~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:56:35: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 56 | if(cout >>100){ | ^~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:56:35: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 56 | if(cout >>100){ | ^~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:56:35: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 56 | if(cout >>100){ | ^~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int]': a.cc:56:14: required from here 56 | if(cout >>100){ | ^~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s521550131
p03633
C++
#include<iostream> #include<string> #include<cstudio> using namespace std; long long gcd(long long a, long long b) { if (b > a) { long long tmp = a; a = b; b = tmp; } if (b == 0) return a; else return gcd(b, a%b); } int main() { int n; long long t[100] = {0}; long long val; scanf("%d", &n); scanf(" %lld", &val); for (int i=1; i<n; i++) { long long tmp; scanf(" %lld", &tmp); long long r = gcd(val, tmp); val = val / r * tmp; } printf("%lld\n", val); return 0; }
a.cc:3:9: fatal error: cstudio: No such file or directory 3 | #include<cstudio> | ^~~~~~~~~ compilation terminated.
s265126066
p03633
C++
#include<iostream> #include<string> #include<cstudip> using namespace std; long long gcd(long long a, long long b) { if (b > a) { long long tmp = a; a = b; b = tmp; } if (b == 0) return a; else return gcd(b, a%b); } int main() { int n; long long t[100] = {0}; long long val; scanf("%d", &n); scanf(" %lld", &val); for (int i=1; i<n; i++) { long long tmp; scanf(" %lld", &tmp); long long r = gcd(val, tmp); val = val / r * tmp; } printf("%lld\n", val); return 0; }
a.cc:3:9: fatal error: cstudip: No such file or directory 3 | #include<cstudip> | ^~~~~~~~~ compilation terminated.
s606786227
p03633
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; using lint = long; auto lcm = [](lint a, lint b) { return a / __gcd(a, b) * b }; lint res; for (int i = 0; i < N; ++i) { lint a; cin >> a; res = i == 0 ? a : lcm(res, a); } cout << res << endl; }
a.cc: In lambda function: a.cc:8:61: error: expected ';' before '}' token 8 | auto lcm = [](lint a, lint b) { return a / __gcd(a, b) * b }; | ^~ | ;
s931745199
p03633
C++
#include<iostream> using namespace std; int gcd(int a,int b){ if(a==0) return b; else return gcd(b%a,a); } int main(){ int n; int clock[110]; cin>>n; for(int i=0;i<n;i++) cin>>clock[i]; int temp=clock[0]; for(int i=1;i<n;i++){ flag=gcd(temp,clock[i]); temp*=(clock[i]/flag); } cout<<temp<<endl; }
a.cc: In function 'int main()': a.cc:14:17: error: 'flag' was not declared in this scope 14 | flag=gcd(temp,clock[i]); | ^~~~
s151914174
p03633
C++
#include<iostream> #include<cstdio> #include<string> #include<algorithm> #define REP(i,n) for(int i=0;i<(n);i++) using namespace std; typedef long long ll; ll int gcd(ll int m1,ll int m2){ return (m2==0)? m1:gcd(m2,m1&m2); } int main(){ ll int n,t[10000],smp,ans=1; cin>>n; while(n--){ cin>>smp; ans=smp/gcd(ans,smp)*smp; } cout<<ans<<endl; return 0; }
a.cc:8:12: error: two or more data types in declaration of 'm1' 8 | ll int gcd(ll int m1,ll int m2){ | ^~ a.cc:8:21: error: expected ')' before ',' token 8 | ll int gcd(ll int m1,ll int m2){ | ~ ^ | ) a.cc:8:1: error: two or more data types in declaration of 'gcd' 8 | ll int gcd(ll int m1,ll int m2){ | ^~ a.cc:8:25: error: expected initializer before 'int' 8 | ll int gcd(ll int m1,ll int m2){ | ^~~ a.cc: In function 'int main()': a.cc:12:9: error: two or more data types in declaration of 'n' 12 | ll int n,t[10000],smp,ans=1; | ^~ a.cc:12:9: error: two or more data types in declaration of 't' a.cc:12:9: error: two or more data types in declaration of 'smp' a.cc:12:9: error: two or more data types in declaration of 'ans' a.cc:13:14: error: 'n' was not declared in this scope 13 | cin>>n; | ^ a.cc:15:22: error: 'smp' was not declared in this scope 15 | cin>>smp; | ^~~ a.cc:16:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 16 | ans=smp/gcd(ans,smp)*smp; | ^~~ | abs a.cc:16:25: error: 'gcd' was not declared in this scope 16 | ans=smp/gcd(ans,smp)*smp; | ^~~ a.cc:18:15: error: 'ans' was not declared in this scope; did you mean 'abs'? 18 | cout<<ans<<endl; | ^~~ | abs
s551075861
p03633
C++
#include <iostream> using namespace std; long long nod(long long a, long long b) { while (a != b) if (a > b) a = a mod b; else b = b mod a; return a; } int main() { int n; long long a, b; cin >> n; cin >> a; for (int i = 1; i < n; i++) { cin >> b; a = a / nod(a, b) * b; } cout << a; }
a.cc: In function 'long long int nod(long long int, long long int)': a.cc:8:12: error: expected ';' before 'mod' 8 | a = a mod b; | ^~~~ | ; a.cc:10:12: error: expected ';' before 'mod' 10 | b = b mod a; | ^~~~ | ;
s034635975
p03633
C++
#include<iostream> using namespace std; long long gcd(long long a,long long b) { if(!b)return a;return gcd(b,a%b); } long long T,N,rez; int main() { cin>>N; cin>>rez;N--; while(N--){cin>>T;rez=(rez/gcd(rez,T))*T; cout<<rez; }
a.cc: In function 'int main()': a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:9:1: note: to match this '{' 9 | { | ^
s082883084
p03633
C
#include <stdio.h> #include <stdlib.h> long long int printGCD(long long int v1, long long int v2) { long long int a, b, r; if(a > b) { a = v1; b = v2; } else { a = v2; b = v1; } while(b != 0) { r = a % b; a = b; b = r; } return a; } long long int printLCM(long long int v1, long long int v2) { long long int a, b, c, GCD, check1, check2, check3; a = v1; b = v2; check1 = 0; check2 = 0; check3 = 0; GCD = printGCD(a, b); c = GCD; while(a > 0) { a = a / 10; check1++; } while(b > 0) { b = b / 10; check2++; } while(c > 0) { c = c / 10; check3++; } a = v1; b = v2; if(check1 + check2 - check3 >= 18) return 1000000000000000000LL; return (long long int)(a * b / GCD); } int main(void) { long long int array[100]; int N, i; scanf("%d", &N); for(i = 0; i < N; i++) { scanf("%lld", &array[i]); } for(i = 0; i < N-1; i++) { array[i+1] = printLCM(array[i], array[i+1]); } printf("%lld", array[i]);
main.c: In function 'main': main.c:69:9: error: expected declaration or statement at end of input 69 | printf("%lld", array[i]); | ^~~~~~
s539335715
p03633
C++
def gcd(a,b): if a<b: d=a a=b b=d if b==0: b=1 c=a%b if c==0: return b else: return 2 def lcm(a,b): c=gcd(a,b) return a/c*b n=int(input()) t=[0]*n for lop2 in range(n): t[lop2]=int(input()) ans=t[0] for lop in range(1,n): ans=lcm(ans,t[lop]) print(int(ans))
a.cc:1:1: error: 'def' does not name a type 1 | def gcd(a,b): | ^~~
s232812214
p03633
C++
def gcd(a,b): if a<b: d=a a=b b=d if b==0: b=1 c=a%b if c==0: return b else: return 2 def lcm(a,b): c=gcd(a,b) return a/c*b n=int(input()) t=[0]*n for lop2 in range(n): t[lop2]=int(input()) ans=t[0] for lop in range(1,n): ans=lcm(ans,t[lop]) print(int(ans))
a.cc:1:1: error: 'def' does not name a type 1 | def gcd(a,b): | ^~~
s067074298
p03633
C++
def gcd(a,b): if a<b: d=a a=b b=d if b==0: b=1 c=a%b if c==0: return b else: return 2 def lcm(a,b): c=gcd(a,b) return a/c*b n=int(input()) t=[0]*n for lop2 in range(n): t[lop2]=int(input()) ans=t[0] for lop in range(1,n): ans=lcm(ans,t[lop]) print(int(ans))
a.cc:1:1: error: 'def' does not name a type 1 | def gcd(a,b): | ^~~
s009445715
p03633
C++
#include #include #include #include #include using namespace std; const int INT__MAX = 2147483647; const int MOD = 1000000007; long long int gcd(long long int num1, long long int num2) { long long int a, b, qwe; if (num1 > num2) { a = num1; b = num2; } else { a = num2; b = num1; } qwe = a%b; while (qwe != 0) { a = b; b = qwe; qwe = a%b; } return b; } int main() { int N; long long int T[105]; long long int hoge, fuga; cin >> N; for (int i = 1; i <= N; i++) { cin >> T[i]; } if(N==1){ cout<<T[1]<<endl; }else{ hoge = gcd(T[1], T[2]); fuga = (T[1] / hoge)*T[2]; for (int i = 1; i < N; i++) { hoge = gcd(fuga, T[i + 1]); fuga = (fuga / hoge)*T[i + 1]; } cout << fuga << endl; } return 0; }
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME> 1 | #include | ^ a.cc:2:10: error: #include expects "FILENAME" or <FILENAME> 2 | #include | ^ a.cc:3:10: error: #include expects "FILENAME" or <FILENAME> 3 | #include | ^ a.cc:4:10: error: #include expects "FILENAME" or <FILENAME> 4 | #include | ^ a.cc:5:10: error: #include expects "FILENAME" or <FILENAME> 5 | #include | ^ a.cc: In function 'int main()': a.cc:38:1: error: 'cin' was not declared in this scope 38 | cin >> N; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #include a.cc:46:1: error: 'cout' was not declared in this scope 46 | cout<<T[1]<<endl; | ^~~~ a.cc:46:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:46:13: error: 'endl' was not declared in this scope 46 | cout<<T[1]<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #include a.cc:58:1: error: 'cout' was not declared in this scope 58 | cout << fuga << endl; | ^~~~ a.cc:58:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:58:17: error: 'endl' was not declared in this scope 58 | cout << fuga << endl; | ^~~~ a.cc:58:17: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s266490835
p03633
C++
#include <iostream> #include <string> #include <algorithm> #include <cstdio> #include <vector> #include <queue> #include <set> #include <numeric> #include <cmath> using namespace std; typedef unsigned long long int lld; const lld mod = 1e9+7; const lld INF = 1e9; //const lld MAXN = 1e9; lld gcd(lld x,lld y) { if (y == 0) { return x; } return gcd(y,x%y); } lld lcm(lld x,lld y) { return x * (y / gcd(x,y)); } int main() { lld n,t[100] = {0}; cin >> n; for(int i = 0; i < n; i++) { cin >> t[i]; } if (n == 1) { cout << t[0] << end; return 0; } lld sol = lcm(t[0],t[1]); for(int i = 2; i < n; i++) { sol = lcm(t[i],sol); } cout << sol << endl; return 0; }
a.cc: In function 'int main()': a.cc:46:30: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 46 | cout << t[0] << end; | ~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function t
s664888838
p03633
C++
#include <iostream> #include <string> #include <algorithm> #include <cstdio> #include <vector> #include <queue> #include <set> #include <numeric> #include <cmath> using namespace std; typedef unsigned long long int lld; const lld mod = 1e9+7; const lld INF = 1e9; //const lld MAXN = 1e9; lld gcd(lld x,lld y) { if (y == 0) { return x; } return gcd(y,x%y); } lld lcm(lld x,lld y) { return x * (y / gcd(x,y)); } int main() { lld n,t[100] = {0}; cin >> n; for(int i = 0; i < n; i++) { cin >> t[i]; } if (n == 1) { cout << t[i] << end; return 0; } lld sol = lcm(t[0],t[1]); for(int i = 2; i < n; i++) { sol = lcm(t[i],sol); } cout << sol << endl; return 0; }
a.cc: In function 'int main()': a.cc:46:27: error: 'i' was not declared in this scope 46 | cout << t[i] << end; | ^
s726805851
p03633
C++
#include <algorithm> #include <iostream> #include <list> #include <map> //連想配列 #include <queue> #include <set> // #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> //動的配列 using namespace std; using ll = long long; ll gcd(ll a, ll b){ if(b==0)return a; return gcd(b,a%b); } ll lcm(ll a ,ll b){ ll g = gcd(a,b); return a/g*b; } int main() { int N; cin >> N; ll ans = ll 1; for(int i=0;i<N;++i){ ll T; cin >> T; ans = lcm(ans,T); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:28:15: error: expected primary-expression before numeric constant 28 | ll ans = ll 1; | ^
s673544413
p03633
C++
/* * ________________________________________ * | | / / * | | / / Pritish Thakkar ! * ____|_|_ _/_/___________________________ * | | / / * | | / / Dream Big ! Work Hard ! * ____|_|/_/______________________________ */ #include<bits/stdc++.h> #define pb push_back #define mkp make_pair #define inf 1000000007 #define rep(i,n) for(int i=0;i<n;i++) #define fr first #define sc second #define clr(a) memset(a,0LL,sizeof a); #define pi 3.141592653589793 #define gc getchar #define all(v) v.begin(), v.end() #define filein freopen("input.in" , "r" , stdin) #define fileout freopen("output.out" , "w" , stdout) #define test ll t; cin >> t; while(t--) #define ntest ll t; t = 1; while(t--) #define sz(x) x.size() #define pass {} using namespace std; typedef unsigned long long ull; typedef long long ll; typedef vector<ll> vi; typedef pair<ll,ll> ii; typedef vector<ii> vii; typedef set<ll>::iterator sit; typedef map<ll,ll>::iterator mit; typedef vector<int>::iterator vit; template<class T>inline bool read(T &x){int c=gc();int sgn=1;while(~c&&c<'0'||c>'9'){if(c=='-')sgn=-1;c=gc();}for(x=0;~c&&'0'<=c&&c<='9';c=gc())x=x*10+c-'0';x*=sgn;return ~c;} //_____________________________ bool isUpper(char c) {return (c >= 'A' && c <= 'Z');} bool isLower(char c) {return (c >= 'a' && c <= 'z');} bool iplpha(char c) {return (c >= 'A' && c <= 'Z')||(c >= 'a' && c <= 'z');} bool iplnum(char c) {return (c >= 'A' && c <= 'Z')||(c >= 'a' && c <= 'z')||(c >= '0' && c <= '9');} char toUpper(char c){return isUpper(c)?c:c-'a'+'A';} char toLower(char c){return isLower(c)?c:c+'a'-'A';} template<typename t> t gcd(t a, t b){return ((b == 0) ? a : gcd(b, a%b));} template<typename t> t lcm(t a, t b){return (a * (b / gcd(a, b)));} ll modpow(ll base, ll expo, ll mod){ base = base % mod; ll ret = 1LL;while(expo > 0){ if(expo & 1LL){ret =( ret * base) % mod;} base = (base * base )% mod;expo >>= 1LL; } return ret; } bool p[10000001]; vi primes; void sieve(ll n){ memset(p,1,sizeof p); p[0] = p[1] = 0; for(int i = 2 ; i <= sqrt(n) ; i++){ if(p[i]){ for(int j = i * i ; j < n ; j+=i){p[j] = 0;} } } for(int i = 2 ; i <= n ; i ++){if(p[i]){primes.pb(i);}} } bool isPrime(ll n){ if(n < 1000001){ return p[n]; } ll ans = 0; for(int i= 0 ; i < primes.size() && primes[i] * primes[i] <= n ; i ++){ if(n % primes[i] == 0){return 0;} }return 1; } ll phi(ll n){ ll ans = n; vi v; v.clear(); for(int i = 0; i < primes.size() && primes[i] * primes[i] <= n; i ++){ if(n % primes[i] == 0){ v.push_back(primes[i]); while(n % primes[i] == 0){ n /= primes[i]; } } } if(n != 1){ v.push_back(n);} for(int i = 0 ; i < v.size() ; i ++){ ans = ans - ans / v[i]; } return ans; } ull nCr(ll n, ll r){ if(r > n / 2){ r = n - r; } ull ret = 1; for(ll i = 1 ; i<= r ; i ++){ ret *= (n - r + i); ret /= i; } return ret; } template<class T > string toString(T n){ string v = ""; while(n){ v.pb(n % 10 + '0'); n /= 10; } reverse(all(v)); return v; } ll toInt(string s){ ll ret = 0; for(int i = 0 ; i < s.size() ; i ++){ ret = ret * 10 + (s[i] - '0'); } return ret; } ll binary_search(ll *a, int lo, int hi, ll key){ while(lo <= hi){ ll mid = (lo + hi) / 2; if(a[mid] == key){ return mid; }else if(a[mid] < key){ lo = mid + 1; }else{ hi = mid - 1; } } return -1; } //__________________________________ void solve(){ ntest{ ll n; cin >> n; ll a[n]; ll i; ll ans = 1 rep(i,n){ cin >> a[i]; ans = lcm(ans, a[i]); } cout << ans << endl; } } //________________________________ int main(int argc, char *argv[]){ std::ios::sync_with_stdio(0); // filein; fileout; solve(); } // -------------------1-------------------------------
a.cc: In function 'void solve()': a.cc:15:41: error: expected ',' or ';' before 'for' 15 | #define rep(i,n) for(int i=0;i<n;i++) | ^~~ a.cc:161:7: note: in expansion of macro 'rep' 161 | rep(i,n){ | ^~~ a.cc:15:60: error: expected ';' before ')' token 15 | #define rep(i,n) for(int i=0;i<n;i++) | ^ a.cc:161:7: note: in expansion of macro 'rep' 161 | rep(i,n){ | ^~~
s515317954
p03633
C++
#include <cstdint> #include <iostream> using namespace std; uint64 gcd(uint64 a, uint64 b) { if (b == 0) { return a; } return gcd(b, a % b); } int main() { uint64 N; cin >> N; uint64 l = 1; for (uint64_t i = 0; i < N; i++) { uint64 val; cin >> val; l = l / gcd(l, val) * val; } cout << l << endl; return 0; }
a.cc:6:1: error: 'uint64' does not name a type; did you mean 'uint64_t'? 6 | uint64 gcd(uint64 a, uint64 b) | ^~~~~~ | uint64_t a.cc: In function 'int main()': a.cc:17:3: error: 'uint64' was not declared in this scope; did you mean 'uint64_t'? 17 | uint64 N; | ^~~~~~ | uint64_t a.cc:18:10: error: 'N' was not declared in this scope 18 | cin >> N; | ^ a.cc:20:9: error: expected ';' before 'l' 20 | uint64 l = 1; | ^~ | ; a.cc:22:11: error: expected ';' before 'val' 22 | uint64 val; | ^~~~ | ; a.cc:23:12: error: 'val' was not declared in this scope 23 | cin >> val; | ^~~ a.cc:24:5: error: 'l' was not declared in this scope 24 | l = l / gcd(l, val) * val; | ^ a.cc:24:13: error: 'gcd' was not declared in this scope 24 | l = l / gcd(l, val) * val; | ^~~ a.cc:27:11: error: 'l' was not declared in this scope 27 | cout << l << endl; | ^
s345441313
p03633
C++
import java.util.Scanner; import java.util.Arrays; public class Main{ public static int getGcd(int x,int y){ if(y%x==0){ return x; }else{ return getGcd(y%x,x); }//14,21 21%14 7,14 2,7 } //最小公倍数 public static int getLcm(int x,int y){ return x/getGcd(x,y)*y; } public static void main(String[]args){ Scanner sc = new Scanner(System.in); //System.out.println(getLcm(14,21)); int N =sc.nextInt(); int abc[] = new int[N]; int answer = 1; int lcm=0; for(int i=0; i<N;i++){ abc[i] = sc.nextInt(); } Arrays.sort(abc); //System.out.println(Arrays.toString(abc)); for(int j=0;j<N-1;j++){ abc[j+1]= getLcm(abc[j],abc[j+1]); //2つめに =2,3の最小公倍数6を入れる //3つめに6,4となり、12が入る } System.out.println(abc[N-1]); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Arrays; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main{ | ^~~~~~
s874434458
p03633
C++
import java.util.Scanner; import java.util.Arrays; public class Begginer70{ public static int getGcd(int x,int y){ if(y%x==0){ return x; }else{ return getGcd(y%x,x); }//14,21 21%14 7,14 2,7 } //最小公倍数 public static int getLcm(int x,int y){ return x/getGcd(x,y)*y; } public static void main(String[]args){ Scanner sc = new Scanner(System.in); //System.out.println(getLcm(14,21)); int N =sc.nextInt(); int abc[] = new int[N]; int answer = 1; int lcm=0; for(int i=0; i<N;i++){ abc[i] = sc.nextInt(); } Arrays.sort(abc); //System.out.println(Arrays.toString(abc)); for(int j=0;j<N-1;j++){ abc[j+1]= getLcm(abc[j],abc[j+1]); } System.out.println(abc[N-1]); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Arrays; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Begginer70{ | ^~~~~~
s830928721
p03633
C
#include <stdio.h> int main(void) { int n=0,i=0,r=0,tmp=0; scanf("%d",&n); unsigned __int64 t[200]; t[0]=1; for (i=1;i<n+1;++i) { scanf("%d",&t[i]); if(t[i]>t[i-1]){ tmp=t[i]; t[i]=t[i-1]; t[i-1]=tmp; } int x=t[i]*t[i-1]; r=t[i]%t[i-1]; while(r!=0){ t[i]=t[i-1]; t[i-1]=r; r=t[i]%t[i-1]; } t[i]=x/t[i-1]; } printf("%d", t[n]); }
main.c: In function 'main': main.c:9:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 't' 9 | unsigned __int64 t[200]; | ^ main.c:9:18: error: 't' undeclared (first use in this function) main.c:9:18: note: each undeclared identifier is reported only once for each function it appears in
s639351716
p03633
C
#include <stdio.h> int main(void) { int n=0,i=0,r=0,tmp=0; scanf("%d",&n); __int64 t[200]; t[0]=1; for (i=1;i<n+1;++i) { scanf("%d",&t[i]); if(t[i]>t[i-1]){ tmp=t[i]; t[i]=t[i-1]; t[i-1]=tmp; } int x=t[i]*t[i-1]; r=t[i]%t[i-1]; while(r!=0){ t[i]=t[i-1]; t[i-1]=r; r=t[i]%t[i-1]; } t[i]=x/t[i-1]; } printf("%d", t[n]); }
main.c: In function 'main': main.c:9:1: error: unknown type name '__int64'; did you mean '__int64_t'? 9 | __int64 t[200]; | ^~~~~~~ | __int64_t