submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s432301970
p03671
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=1;i<=n;++i) #define YES cout<<"YES"<<endl #define NO cout<<"NO"<<endl using namespace std; int main(){ int a[3],max=0,sum=0; rep(i,3) cin >> a[i]; rep(i,3){ if (max<a[i]) max=a[i]; sum L= a[i]; } cout << sum-max << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:8: error: expected ';' before 'L' 12 | sum L= a[i]; | ^~ | ;
s018120445
p03671
C++
#include <stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a&b&c); int est; if(a>b) est=a; else est=b; if(c>est) est=c; printf("%d",a+b+c-est); return 0; }
a.cc: In function 'int main()': a.cc:4:20: error: invalid operands of types 'int*' and 'int' to binary 'operator&' 4 | scanf("%d%d%d",&a&b&c); | ~~^~ | | | | | int | int*
s132915462
p03671
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); if(a+b <= b+c && a+b <= a+c)System.println(a+b); else if (b+c <= a+b && b+c <= a+c)System.println(b+c); else System.println(a+c); } }
Main.java:8: error: cannot find symbol if(a+b <= b+c && a+b <= a+c)System.println(a+b); ^ symbol: method println(int) location: class System Main.java:9: error: cannot find symbol else if (b+c <= a+b && b+c <= a+c)System.println(b+c); ^ symbol: method println(int) location: class System Main.java:10: error: cannot find symbol else System.println(a+c); ^ symbol: method println(int) location: class System 3 errors
s255414786
p03671
C++
#include<algorithm> #include<vector> using namespace std; int main(){ vector<int> n(3); cin >> n[0] >> n[1] >> n[2]; sort(n.begin(),n.end()); cout << n[0] << endl; }
a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin >> n[0] >> n[1] >> n[2]; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<vector> +++ |+#include <iostream> 3 | using namespace std; a.cc:8:5: error: 'cout' was not declared in this scope 8 | cout << n[0] << endl; | ^~~~ a.cc:8:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:8:21: error: 'endl' was not declared in this scope 8 | cout << n[0] << endl; | ^~~~ a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 2 | #include<vector> +++ |+#include <ostream> 3 | using namespace std;
s996449334
p03671
C++
#include<iostream> #include<string> using namespace std; string s; int main(){ cin>>s; if(s.size()%2==1) s=s.substr(0,s.size()-1); while(s.size()){ if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2){ cout<<s.size()<<endl; return 0; } s=s.substr(0,s.size()-2); } return 0; }
a.cc: In function 'int main()': a.cc:11:59: error: expected ';' before '{' token 11 | if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2){ | ^ | ; a.cc:11:26: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result] 11 | if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2){ | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:54, 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.h:3755:5: note: declared here 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ a.cc:15:25: error: expected ')' before ';' token 15 | s=s.substr(0,s.size()-2); | ^ | ) a.cc:11:3: note: to match this '(' 11 | if(s.substr(0,s.size()/2)==s.substr(s.size()/2,s.size()/2){ | ^ a.cc:15:2: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int](0, (s.std::__cxx11::basic_string<char>::size() - 2)))' from 'std::__cxx11::basic_string<char>' to 'bool' 15 | s=s.substr(0,s.size()-2); | ~^~~~~~~~~~~~~~~~~~~~~~~ | | | std::__cxx11::basic_string<char>
s641563414
p03671
C++
#include<iostream> #include<algorithm> int main(){ int a,b,c; cin>>a>>b>>c; cout<<min(min(a+b,a+c),b+c)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>a>>b>>c; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:11: error: 'min' was not declared in this scope; did you mean 'std::min'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc:7:7: error: 'min' was not declared in this scope; did you mean 'std::min'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~ | std::min /usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc:7:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s845473433
p03671
C++
#include<iostream> #include<algorithm> int main(){ int a,b,c; cin>>a>>b>>c; cout<<min(min(a+b,a+c),b+c)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>a>>b>>c; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:11: error: 'min' was not declared in this scope; did you mean 'std::min'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc:7:7: error: 'min' was not declared in this scope; did you mean 'std::min'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~ | std::min /usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc:7:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s511507452
p03671
C++
#include<iostream> #include<algorithm> int main(){ int a,b,c; cin>>a>>b>>c; cout<<min(min(a+b,a+c),b+c)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>a>>b>>c; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:11: error: 'min' was not declared in this scope; did you mean 'std::min'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc:7:7: error: 'min' was not declared in this scope; did you mean 'std::min'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~ | std::min /usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc:7:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout<<min(min(a+b,a+c),b+c)<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s507161867
p03671
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int a,b,c; cin >> a >> b >>c; cout << a + b + c - max(a, b, c) << endl; }
In file included from /usr/include/c++/14/string:51, 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_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]': a.cc:8:25: required from here 8 | cout << a + b + c - max(a, b, c) << endl; | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function 306 | if (__comp(__a, __b)) | ~~~~~~^~~~~~~~~~
s207471257
p03671
C++
#include <iostream> #include <algorithm> using namespace std; int main(void){ int a[3]; cin >> a[0] >> a[1] >> a[2]; sort(a, a+n); cout << a[0]+a[1] << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:13: error: 'n' was not declared in this scope 7 | sort(a, a+n); | ^
s821062341
p03671
C++
#include<bits/stdc++.h> const int INF = 1e9; const int MOD = 1e9+7; using LL = long long; const LL LINF = 1e18; using namespace std; #define COUT(v) cout<<(v)<<endl #define CIN(n) int(n);cin >> (n) #define SCIN(s) string(s);cin >> (s) #define YES(n) cout<<((n)? "YES" : "NO")<<endl #define Yes(n) cout<<((n)? "Yes" : "No")<<endl #define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE" ) << endl #define Possible(n) cout << ((n) ? "Possible" : "Impossible" ) <<endl #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) for(int i=0;i<(n);++i) #define REPR(i,n) for(int i=n;i>=0;i--) #define FOREACH(x,a) for(auto& (x) : (a) ) #define ALL(obj) (obj).begin(),(obj).end() #define P pair<int,int> #define I vector<int> #define V vector #define S set<int> #define pb(v) push_back(v) int main(){ CIN(a);CIN(b);CIN(c); COUT(max({a+b,a+c,b+c)); return 0; }
a.cc: In function 'int main()': a.cc:30:26: error: expected '}' before ')' token 30 | COUT(max({a+b,a+c,b+c)); | ~ ^ a.cc:7:24: note: in definition of macro 'COUT' 7 | #define COUT(v) cout<<(v)<<endl | ^
s102493843
p03671
C++
#include <iostream> using namespace std; int main(){ int a, b, c; cin >> a >> b >> c; cout << a+b+c-max(a,b,c); }
In file included from /usr/include/c++/14/string:51, 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_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]': a.cc:7:21: required from here 7 | cout << a+b+c-max(a,b,c); | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function 306 | if (__comp(__a, __b)) | ~~~~~~^~~~~~~~~~
s582748391
p03671
C++
#include <iostream> using namespace std; int main(){ int a[3],i,j=0; for(i=0;i<3;i++){ cin >> a[i]; j += a[i]; } cout << j-max(a); }
a.cc: In function 'int main()': a.cc:10:22: error: no matching function for call to 'max(int [3])' 10 | cout << j-max(a); | ~~~^~~ In file included from /usr/include/c++/14/string:51, 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_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: candidate expects 2 arguments, 1 provided /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, 1 provided
s581369066
p03671
C++
int main() { int a, b, c; cin >> a; cin >> b; cin >> c; if (a + b <= a + c) { if (a + b <= b + c) { cout << a + b << endl; } } else { if (a + c <= b + c) { cout << a + c << endl; } else { cout << b + c << endl; } } }
a.cc: In function 'int main()': a.cc:3:9: error: 'cin' was not declared in this scope 3 | cin >> a; | ^~~ a.cc:9:25: error: 'cout' was not declared in this scope 9 | cout << a + b << endl; | ^~~~ a.cc:9:42: error: 'endl' was not declared in this scope 9 | cout << a + b << endl; | ^~~~ a.cc:14:25: error: 'cout' was not declared in this scope 14 | cout << a + c << endl; | ^~~~ a.cc:14:42: error: 'endl' was not declared in this scope 14 | cout << a + c << endl; | ^~~~ a.cc:17:25: error: 'cout' was not declared in this scope 17 | cout << b + c << endl; | ^~~~ a.cc:17:42: error: 'endl' was not declared in this scope 17 | cout << b + c << endl; | ^~~~
s956592233
p03671
C
#include <stdio.h> int main(){ int a,b,c; int p1,p2,p3,min; scanf("%d%d%d",&a,&b,&c); p1 = a+b; p2 = b+c; p3 = a+c; if(p1<=p2 && p1<=p3){ min = p1; } else if(p2<=p1 && p2<=p3){ min = p2; } else if(p3<=p1 && p3<==p2){ min = p3; } printf("%d\n",min); return 0; }
main.c: In function 'main': main.c:19:27: error: expected expression before '=' token 19 | else if(p3<=p1 && p3<==p2){ | ^
s585114038
p03671
C
#include <stdio.h> int main(){ int a,b,c; int p1,p2,p3,min; scanf("%d%d%d",&a,&b,&c); p1 = a+b; p2 = b+c; p3 = a+c; if(p1<p2){ if(p1<p3){ min = p1; } elif(p3<p1){ min = p3; } } elif(p2<p1){ if(p2<p3){ min = p2; } } printf("%d\n",min); return 0; }
main.c: In function 'main': main.c:18:9: error: implicit declaration of function 'elif' [-Wimplicit-function-declaration] 18 | elif(p3<p1){ | ^~~~ main.c:18:20: error: expected ';' before '{' token 18 | elif(p3<p1){ | ^ | ; main.c:22:16: error: expected ';' before '{' token 22 | elif(p2<p1){ | ^ | ;
s993842736
p03671
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int a,b,c; cin >> a >> b >> c; cout << min(a+b,a+c,b+c) << endl; return 0; }
In file included from /usr/include/c++/14/string:51, 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_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]': a.cc:8:13: required from here 8 | cout << min(a+b,a+c,b+c) << endl; | ~~~^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function 284 | if (__comp(__b, __a)) | ~~~~~~^~~~~~~~~~
s872880481
p03671
C++
#include<iostream> using namespace std; int a[200000], b[200000]; int main() { int n; cin >> n; if (n < =20000) { for (int i = 1; i <=n; i++) cin >> a[i]; for (int j = 1; j <=n; j++) { b[j] = a[j]; if (j > 1) { int temp; int m = (j + 1) / 2; if (j % 2) { for (int i = 0;; i++) { temp = b[m + i + 1]; b[m + i + 1] = b[m - i -1]; b[m - i -1] = temp; if (m - i -1 == 1) break; } } else { for (int i = 1;; i++) { temp = b[m + i ]; b[m + i] = b[m - i + 1]; b[m - i + 1] = temp; if (m - i + 1 == 1) break; } } } } } for (int i = 1; i < n; i++) cout << b[i] << " "; cout << b[n]; return 0; }
a.cc: In function 'int main()': a.cc:8:17: error: expected primary-expression before '=' token 8 | if (n < =20000) | ^
s739857742
p03671
C++
#include <bits/stdc++.h> #include<iostream> #include<cstdio> #include<vector> #include<queue> #include<map> #include<cstring> #include<string> #include <math.h> #include<algorithm> // #include <boost/multiprecision/cpp_int.hpp> #include<functional> // #define int long long #define inf 1000000007 #define pa pair<int,int> #define ll long long #define pal pair<double,pa> #define ppa pair<int,int> #define ppap pair<pa,pa> #define ssa pair<string,int> #define mp make_pair #define pb push_back #define EPS (1e-10) #define equals(a,b) (fabs((a)-(b))<EPS) #define VI vector<int> using namespace std; class pas{ public: int x,y; pas(int x=0,int y=0):x(x),y(y) {} pas operator + (pas p) {return pas(x+p.x,y+p.y);} pas operator - (pas p) {return pas(x-p.x,y-p.y);} pas operator * (int a) {return pas(x*a,y*a);} pas operator / (int a) {return pas(x/a,y/a);} // double absv() {return sqrt(norm());} int norm() {return x*x+y*y;} bool operator < (const pas &p) const{ return x != p.x ? x<p.x: y<p.y; } bool operator == (const pas &p) const{ return x==p.x && y==p.y; } }; int a[60]; signed main(){ int m,n; cin>>a[0]>>a[1]>>a[2]: sort(a,a+3); cout<<a[1]+a[2]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:49:33: error: expected ';' before ':' token 49 | cin>>a[0]>>a[1]>>a[2]: | ^ | ;
s812014416
p03671
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in =new Scanner(System.in); int a =in.nextInt(); int b =in.nextInt(); int c =in.nextInt(); int d =a+b; int e =a+c; int f =b+c; if(d>=e) { if(e>=f) { System.out.println(f); } else { System.out.println(e); } } else if(d<e) { if(d>=f) { System.out.println(f); } else { System.out.println(d); } } }
Main.java:34: error: reached end of file while parsing } ^ 1 error
s902432609
p03671
C++
#include <iostream> using namespace std; int main(){ int a, b, c; cin >> a >> b >> c; cout << min({a+b,b+c,c+a}) << endl; }
a.cc: In function 'int main()': a.cc:7:12: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 7 | cout << min({a+b,b+c,c+a}) << endl; | ~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, 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_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided
s117269733
p03671
C
#include<stdio.h> main() { int a,b,c,d,e,f; printf("Input is given from Standard Input in the following format:\n"); scanf("%d%d%d",&a,&b,&c); d=a+b;e=a+c,f=b+c; if(1<=a&&a<10000&&b>=1&&b<=10000&&c>=1&&c<=10000) { if(b<c&&a<c) { printf("%d\n",d); printf("Buying a %d-yen bell and a %d-yen bell costs %d yen.\n",a,b,d); printf("Buying a %d-yen bell and a %d-yen bell costs %d yen.\n",a,c,e); printf("Buying a %d-yen bell and a %d-yen bell costs %d yen.\n",b,d,f); printf("The minimum among these is %d yen.\n",d); } if(a<b&&c<b) { printf("%d\n",e); printf("Buying a %d-yen bell and a %d-yen bell costs %d yen.\n",a,b,d); printf("Buying a %d-yen bell and a %d-yen bell costs %d yen.\n",a,c,e); printf("Buying a %d-yen bell and a %d-yen bell costs %d yen.\n",b,d,f); printf("The minimum among these is %d yen.\n",e); } if(b<a&&c<a) { printf("%d\n",f); printf("Buying a %d-yen bell and a %d-yen bell costs %d yen.\n",a,b,d); printf("Buying a %d-yen bell and a %d-yen bell costs %d yen.\n",a,c,e); printf("Buying a %d-yen bell and a %d-yen bell costs %d yen.\n",b,d,f); printf("The minimum among these is %d yen.\n",f); } else { if(a<=c&&b<=c)
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main() | ^~~~ main.c: In function 'main': main.c:37:13: error: expected expression at end of input 37 | if(a<=c&&b<=c) | ^~ main.c:37:13: error: expected declaration or statement at end of input main.c:37:13: error: expected declaration or statement at end of input main.c:37:13: error: expected declaration or statement at end of input
s985600607
p03671
C++
#include<iostream> #include<vector> using namespace std; int main(void) { vector<int> x(3); cin >> x[0] >> x[1] >> x[2]; sort(x.begin(), x.end()); cout << x[0] + x[1] << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:1: error: 'sort' was not declared in this scope; did you mean 'short'? 8 | sort(x.begin(), x.end()); | ^~~~ | short
s743559194
p03671
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int Max = a; if (b > Max) Max = b; if (c > Max) Max = c; cou << a + b + c - Max << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: 'cou' was not declared in this scope; did you mean 'cos'? 11 | cou << a + b + c - Max << endl; | ^~~ | cos
s889304070
p03671
C++
#include <cstdio> #include <algorithm> #include <iostream> #include <vector> #include <cmath> #include <string> #define pb push_back #define mod 1000000007 using namespace std; typedef long long int ll; int main(void){ int a,b,c; cin>>a>>b>>c; cout<<min(a+b,a+c,b+c)<<endl; return 0; }
In file included from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]': a.cc:15:12: required from here 15 | cout<<min(a+b,a+c,b+c)<<endl; | ~~~^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function 284 | if (__comp(__b, __a)) | ~~~~~~^~~~~~~~~~
s212035311
p03671
Java
import java.util.Scanner; import java.util.Stack; class Main { public static void main(String[] args) { new Main().compute(); } void compute() { Scanner sc = new Scanner(System.in); int[] a = new int[3]; for (int i = 0; i < 3; i++) { a[i] = sc.nextInt(); } Arrays.sort(a); System.out.println(a[0] + a[1]); } }
Main.java:16: error: cannot find symbol Arrays.sort(a); ^ symbol: variable Arrays location: class Main 1 error
s852777958
p03671
C++
#include <iostream> #include <string> using namespace std; int main(void){ int a,b,c; cin>>a>>b>>c; if(a+b<=a+c){ cout<<a+b<<endl; break; }else if(a+c<=b+c){ cout<<a+c<<endl; break; }else if(b+c<=a+b){ cout<<b+c<<endl; break; } return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: break statement not within loop or switch 9 | break; | ^~~~~ a.cc:12:9: error: break statement not within loop or switch 12 | break; | ^~~~~ a.cc:15:9: error: break statement not within loop or switch 15 | break; | ^~~~~
s909546669
p03671
C++
#include <iostream> using namespace std; int main(){ int a, b, c; cin >> a >> b >> c; if (a >> b && a >> c) cout << b + c << endl; else if (b >> a && b >> c) cout << a + b << endl; else cout << a + c << endl; return 0;
a.cc: In function 'int main()': a.cc:9:10: error: expected '}' at end of input 9 | return 0; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s055699550
p03671
C++
#include <isotream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; if (a > b) { int t = a; a = b; b = t; } if (b > c) { int t = b; b = c; c = t; } cout << a+b << endl; }
a.cc:1:10: fatal error: isotream: No such file or directory 1 | #include <isotream> | ^~~~~~~~~~ compilation terminated.
s944743605
p03671
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a, b, c, d; cin >> a >> b >> c; if( a > b ){ d = a; a = b; b = d; } if( b > c ){ d = b; b = c; c = d; } if( a > b ){ d = a; a = b; b = d; } cout << a + b << endl; return 0;
a.cc: In function 'int main()': a.cc:16:14: error: expected '}' at end of input 16 | return 0; | ^ a.cc:3:15: note: to match this '{' 3 | int main(){ | ^
s642509665
p03671
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a, b, c; cin >> a >> b >> c; if( a > b ){ int d = a; a = b; b = d; } if( b > c ){ d = b; b = c; c = d; } if( a > b ){ d = a; a = b; b = d; } cout << a + b << endl; return 0;
a.cc: In function 'int main()': a.cc:10:1: error: 'd' was not declared in this scope 10 | d = b; b = c; c = d; | ^ a.cc:13:1: error: 'd' was not declared in this scope 13 | d = a; a = b; b = d; | ^ a.cc:16:10: error: expected '}' at end of input 16 | return 0; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s275318258
p03671
C++
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String num = br.readLine(); String[] str = num.split(" ", 0); List<Integer> a = new ArrayList<>(); a.add(Integer.parseInt(str[0],0)); a.add(Integer.parseInt(str[1],1)); a.add(Integer.parseInt(str[2],2)); Collections.sort(a); System.out.println((a.get(0)+a.get(1))); } }
a.cc:2:1: error: 'import' does not name a type 2 | import java.io.BufferedReader; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.io.InputStreamReader; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.util.ArrayList; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: 'import' does not name a type 5 | import java.util.Collections; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import java.util.List; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:8:1: error: expected unqualified-id before 'public' 8 | public class Main { | ^~~~~~
s752799988
p03671
C++
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String num = br.readLine(); String[] str = num.split(" ", 0); List<Integer> a = new ArrayList<>(); a.add(Integer.parseInt(str[0])); a.add(Integer.parseInt(str[1])); a.add(Integer.parseInt(str[2])); Collections.sort(a); System.out.println((a.get(0)+a.get(1))); } }
a.cc:2:1: error: 'import' does not name a type 2 | import java.io.BufferedReader; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.io.InputStreamReader; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.util.ArrayList; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: 'import' does not name a type 5 | import java.util.Collections; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import java.util.List; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:8:1: error: expected unqualified-id before 'public' 8 | public class Main { | ^~~~~~
s271436748
p03671
C++
#include <iostream> #include<algorithm> #include<string> using namespace std; int n,a,b; int main (){ cin>>n>>a>>b;cout<<a+b+c-max(n,max(a,b))<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:24: error: 'c' was not declared in this scope 8 | cin>>n>>a>>b;cout<<a+b+c-max(n,max(a,b))<<endl; | ^
s656233716
p03671
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) int main(){ vector<int> data(3); REP(i,3){ cin>>data[i]; } sort(ALL(data)); cout<<data[0]+data[1]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:10: error: 'ALL' was not declared in this scope 13 | sort(ALL(data)); | ^~~
s625633564
p03671
C++
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include <sstream> #include<iomanip> #include <ctype.h> //#include<bits/stdc++.h> using namespace std; int main() {
a.cc: In function 'int main()': a.cc:26:13: error: expected '}' at end of input 26 | int main() { | ~^
s068907692
p03671
C++
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include <sstream> #include<iomanip> #include <ctype.h> //#include<bits/stdc++.h> using namespace std; int main() {
a.cc: In function 'int main()': a.cc:26:13: error: expected '}' at end of input 26 | int main() { | ~^
s434326295
p03671
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c;cin>>a>>b>>c; vector<int>v; v.pb(a); v.pb(b); v.pb(c); sort(v.begin(),v.end()); cout<<v[0]+v[1]<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:6:7: error: 'class std::vector<int>' has no member named 'pb' 6 | v.pb(a); | ^~ a.cc:7:7: error: 'class std::vector<int>' has no member named 'pb' 7 | v.pb(b); | ^~ a.cc:8:7: error: 'class std::vector<int>' has no member named 'pb' 8 | v.pb(c); | ^~
s615589849
p03671
C++
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if(a <= b <= c) { printf("%d\n", a + b); } else if(a <= b >= c) { printf("%d\n", a + c); } else if(a >= b <= c && a <= c) { printf("%d\n", b + a); } else if(a >= b <= c %% a >= c) { printf("%d\n", a + c); } else if(a >= b >= c) { printf("&d\n", c + b) } else if(a == b == c) { printf("&d\n", a + b); } return 0; }
a.cc: In function 'int main()': a.cc:15:24: error: expected primary-expression before '%' token 15 | } else if(a >= b <= c %% a >= c) { | ^ a.cc:18:22: error: expected ';' before '}' token 18 | printf("&d\n", c + b) | ^ | ; 19 | } else if(a == b == c) { | ~
s013489815
p03671
C++
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if(a <= b <= c) { printf("%d\n", a + b); } else if(a <= b >= c) { printf("%d\n", a + c); } else if(a >= b <= c && a <= c) { printf("%d\n", b + a); } else if(a >= b <= c %% a >= c) { printf("%d\n", a + c); } else if(a >= b >= c) { printf("&d\n", c + b) } else if(a == b == c) { printf("&d\n", a + b); } return 0; }
a.cc: In function 'int main()': a.cc:15:24: error: expected primary-expression before '%' token 15 | } else if(a >= b <= c %% a >= c) { | ^ a.cc:18:22: error: expected ';' before '}' token 18 | printf("&d\n", c + b) | ^ | ; 19 | } else if(a == b == c) { | ~
s106924566
p03671
C++
abc = list(map(int, input().split())) m =10**5 for i in range(2): m = min(m,abc[i]+abc[i+1]) print(m)
a.cc:1:1: error: 'abc' does not name a type 1 | abc = list(map(int, input().split())) | ^~~
s889983435
p03671
C++
#include<bits/stdc++.h> using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return 0;}
a.cc:1:25: warning: extra tokens at end of #include directive 1 | #include<bits/stdc++.h> using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return 0;} | ^~~~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s701176323
p03671
C++
#include<bits/stdc++.h>using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return 0;}
a.cc:1:30: warning: extra tokens at end of #include directive 1 | #include<bits/stdc++.h>using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return 0;} | ^~~~~~~~~ a.cc:1:9: fatal error: bits/stdc++.h>usin: No such file or directory 1 | #include<bits/stdc++.h>using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return 0;} | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.
s154110567
p03671
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; cout<<a+b+c-max(a,max(b,c))<<endl; return0; }
a.cc: In function 'int main()': a.cc:7:1: error: 'return0' was not declared in this scope 7 | return0; | ^~~~~~~
s851304544
p03671
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; cout<<a+b+c-max(a,max(b,c))<<endl; return0; }
a.cc: In function 'int main()': a.cc:7:1: error: 'return0' was not declared in this scope 7 | return0; | ^~~~~~~
s023180207
p03671
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; cout<<a+b+c-max(a,max(b,c))<<endl; return0; }
a.cc: In function 'int main()': a.cc:7:1: error: 'return0' was not declared in this scope 7 | return0; | ^~~~~~~
s026826533
p03671
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; cout<<a+b+c-max(a,max(b,c))<<endl; return0; }
a.cc: In function 'int main()': a.cc:7:1: error: 'return0' was not declared in this scope 7 | return0; | ^~~~~~~
s388529299
p03671
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; cout<<a+b+c-max(a,max(b,c))<<endl; return0; }
a.cc: In function 'int main()': a.cc:7:1: error: 'return0' was not declared in this scope 7 | return0; | ^~~~~~~
s997296005
p03671
C++
#include <bits/stdc++.h> using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return0;}
a.cc: In function 'int main()': a.cc:2:89: error: 'return0' was not declared in this scope 2 | using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return0;} | ^~~~~~~
s024598210
p03671
C++
#include <bits/stdc++.h>using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return0;}
a.cc:1:31: warning: extra tokens at end of #include directive 1 | #include <bits/stdc++.h>using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return0;} | ^~~~~~~~~ a.cc:1:10: fatal error: bits/stdc++.h>usin: No such file or directory 1 | #include <bits/stdc++.h>using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return0;} | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.
s351904091
p03671
C++
#include<bits/stdc++.h> using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return0;}
a.cc:1:25: warning: extra tokens at end of #include directive 1 | #include<bits/stdc++.h> using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return0;} | ^~~~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s391914389
p03671
C++
#include<bits/stdc++.h>using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return0;}
a.cc:1:30: warning: extra tokens at end of #include directive 1 | #include<bits/stdc++.h>using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return0;} | ^~~~~~~~~ a.cc:1:9: fatal error: bits/stdc++.h>usin: No such file or directory 1 | #include<bits/stdc++.h>using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<a+b+c-max(a,max(b,c))<<endl;return0;} | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.
s410160638
p03671
C++
#include<bits/stdc++.h>using namespace std; const int N = 3;int i;vector<int> afs;int main() {afs.resize(N);for(i = 0; i < N; i++) {cin >> afs[i];}sort(afs.begin(),afs.end());cout << afs[0] + afs[1] << endl;return 0;}
a.cc:1:30: warning: extra tokens at end of #include directive 1 | #include<bits/stdc++.h>using namespace std; const int N = 3;int i;vector<int> afs;int main() {afs.resize(N);for(i = 0; i < N; i++) {cin >> afs[i];}sort(afs.begin(),afs.end());cout << afs[0] + afs[1] << endl;return 0;} | ^~~~~~~~~ a.cc:1:44: error: extended character   is not valid in an identifier 1 | #include<bits/stdc++.h>using namespace std; const int N = 3;int i;vector<int> afs;int main() {afs.resize(N);for(i = 0; i < N; i++) {cin >> afs[i];}sort(afs.begin(),afs.end());cout << afs[0] + afs[1] << endl;return 0;} | ^ a.cc:1:9: fatal error: bits/stdc++.h>usin: No such file or directory 1 | #include<bits/stdc++.h>using namespace std; const int N = 3;int i;vector<int> afs;int main() {afs.resize(N);for(i = 0; i < N; i++) {cin >> afs[i];}sort(afs.begin(),afs.end());cout << afs[0] + afs[1] << endl;return 0;} | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.
s509997616
p03671
C++
#!/usr/bin # -*- coding:"utf-8" -*- a, b, c = map(int, input().split()) if a <= b: if c <= b: x = a + c else: x = a + b else: if c <= a: x = b + c else: x = b + a print(x)
a.cc:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin | ^ a.cc:2:3: error: invalid preprocessing directive #- 2 | # -*- coding:"utf-8" -*- | ^ a.cc:4:1: error: 'a' does not name a type 4 | a, b, c = map(int, input().split()) | ^
s057419593
p03671
C++
include <stdlib.h> #include <iostream> #include <sstream> #include <queue> #define FOR(x, y, z) for(int x = 0; y; x++) #define rep(x, z, y) for(int x = (z); x < (y); x++) #define all(x) x.begin(),x.end() #define len(x) (sizeof(x) / sizeof(x[0])) #define sp_str(str, sp_word) istringstream stream(str); string res; while(getline(stream,res,sp_word)) #define rem_space(x) x.erase(remove(all(x), ' '),x.end()) #define scl(x) fgets(x, sizeof x, stdin) #define down_queue(x) priority_queue<x> #define up_queue(x) priority_queue<x, vector<x>, greater<x>> using namespace std; int main(){ up_queue(int) bels; string line; getline(cin,line); sp_str(line,' ') bels.push(atoi(res.c_str())); int anser = bels.top(); bels.pop(); anser += bels.top(); printf("%d\n",anser); return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <stdlib.h> | ^~~~~~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 179 | _GLIBCXX
s610002490
p03671
C
#include<bits/stdc++.h> using namespace std; int main() { unsigned long int ball_1, ball_2, ball_3, total_1, total_2, sum_1, sum_2, sum_3; scanf("%d%d%d", &ball_1, &ball_2, &ball_3); sum_1=ball_1+ball_2; sum_2=ball_1+ball_3; sum_3=ball_2+ball_3; total_1=(sum_1<=sum_2)?sum_1:sum_2; total_2=(total_1<=sum_3)?total_1:sum_3; printf("Buying any two bells costs %d yen.\n",total_2); return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s227295238
p03671
C++
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <stack> #include <iomanip> #include <queue> #include <deque> #include <sstream> #include <stdio.h> #include <string> #include <cmath> #include <map> #include <utility> using namespace std; #define s(n) scanf("%d",&n) #define sc(n) scanf("%c",&n) #define ss(n) scanf("%s",&n) #define MOD 1000000007 #define ll long long int #define vi vector<int> #define vii vector< vector<int> > #define PI 3.1415926535897932384626433832795 int main() { int a,b,c; cin >> a >> b >> c; cout << (a+b+c-max(max(a,b),c); return 0; }
a.cc: In function 'int main()': a.cc:30:31: error: expected ')' before ';' token 30 | cout << (a+b+c-max(max(a,b),c); | ~ ^ | )
s927732755
p03671
C
#include<stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); // 出力 if((a+b)>(a+c) && (b+c)>(a+c)){ printf("%d\n",a+c); }else if((a+c)>(a+b) && (b+c)>(a+b)){ printf("%d\n",a+b); }else{ printf("%d\n",B+c); } return 0; }
main.c: In function 'main': main.c:13:19: error: 'B' undeclared (first use in this function) 13 | printf("%d\n",B+c); | ^ main.c:13:19: note: each undeclared identifier is reported only once for each function it appears in
s112951319
p03671
C
#include<stdio.h> #include<stdlib.h> int main(void){ int a; int b; int c; scanf("%d %d %d",&a, &b, &c); if(1<=a<=10000 && 1<=b<=10000 && 1<=c<=10000){ if((a+b)<=(b+c) && (a+b)<=(a+c)){ printf("%d",a+b); } else if { ((b+c)<=(a+b) && (b+c)<=(a+c)){ printf("%d",b+c); } else if { ((a+c)<=(a+b) && (a+c)<=(b+c)){ printf("%d",a+c); } } else { exit(1); } return 0; }
main.c: In function 'main': main.c:13:19: error: expected '(' before '{' token 13 | } else if { | ^ | ( main.c:14:43: error: expected ';' before '{' token 14 | ((b+c)<=(a+b) && (b+c)<=(a+c)){ | ^ | ; main.c:24:1: error: expected declaration or statement at end of input 24 | } | ^ main.c:24:1: error: expected declaration or statement at end of input
s747286114
p03671
C++
#include <iostream> #include <fstream> #include <cstdio> #include <cassert> #include <complex> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <cstdlib> #include <cstring> #include <iomanip> #include <numeric> #include <sstream> #include <ctime> #include <cctype> #include <set> #include <map> #include <queue> #include <bitset> #include <deque> #include <stack> #include <memory.h> using namespace std; #define ll long long ll exp_mod(int a,int b,int p) { ll ans=1; ll cur=a; while (b>0){ if (b%2==1) ans=(ans*cur) % p; cur=(cur*cur) % p; b/=2; } return ans; }   int main(int argc,char **argv) { int n,x,y; cin>>n; map<int,int> h; for (int i=0; i < n+1; ++i) { int k; cin>>k; map<int,int> it=h.find(k); if (it != h.end()) { x=it->second; y=i+1; } else h[k]=i+1; } const int P=1000000007; ll a=1; ll b=1; int exp=1; for (int k=1;k<= n+1; ++k) { int w=exp_mod(k,P-2,P); a=(a*(n+2-k))%P; a=(a*w)%P;   if (k>=2) { b=(b*(n+x-y-k+2))%P; b=(b*prev_exp)%P; } exp=w; int c=(a-b)%P; if (c<0)c+=P; cout<<c; } return 0; }
a.cc:37:1: error: extended character   is not valid in an identifier 37 |   | ^ a.cc:61:1: error: extended character   is not valid in an identifier 61 |   | ^ a.cc:37:1: error: '\U000000a0' does not name a type 37 |   | ^
s525398839
p03671
C
#include <stdio.h> int main(void){ int a, b, c, min; scanf("%d %d %d", &a, &b, &c); if(a < 1 || 10000 < a || b < 1 || 10000 < b || c < 1 || 10000 < c){ return 1; } min = 0; int min = a+b; if(a+c > min){ min = a+c; } if(b+c > min){ min = b+c; } printf("%d\n", min); return 0; }
main.c: In function 'main': main.c:15:8: error: redeclaration of 'min' with no linkage 15 | int min = a+b; | ^~~ main.c:5:17: note: previous declaration of 'min' with type 'int' 5 | int a, b, c, min; | ^~~
s319904534
p03671
C++
inp = [ a for int(a) in input().split()] inp.sort() return inp[0] + inp[1]
a.cc:1:1: error: 'inp' does not name a type; did you mean 'int'? 1 | inp = [ a for int(a) in input().split()] | ^~~ | int
s369330478
p03671
Java
import java.util.Scanner; import java.util.Random; import java.util.Arrays; class Main { public static void main(String[] args) { int a = new int[3]; for (int i = 0; i < 3; i++) { a[i] = sc.nextInt(); } Arrays.sort(a); System.out.println(a[0] + a[1]); } }
Main.java:9: error: incompatible types: int[] cannot be converted to int int a = new int[3]; ^ Main.java:11: error: array required, but int found a[i] = sc.nextInt(); ^ Main.java:11: error: cannot find symbol a[i] = sc.nextInt(); ^ symbol: variable sc location: class Main Main.java:13: error: no suitable method found for sort(int) Arrays.sort(a); ^ method Arrays.sort(int[]) is not applicable (argument mismatch; int cannot be converted to int[]) method Arrays.sort(long[]) is not applicable (argument mismatch; int cannot be converted to long[]) method Arrays.sort(short[]) is not applicable (argument mismatch; int cannot be converted to short[]) method Arrays.sort(char[]) is not applicable (argument mismatch; int cannot be converted to char[]) method Arrays.sort(byte[]) is not applicable (argument mismatch; int cannot be converted to byte[]) method Arrays.sort(float[]) is not applicable (argument mismatch; int cannot be converted to float[]) method Arrays.sort(double[]) is not applicable (argument mismatch; int cannot be converted to double[]) method Arrays.sort(Object[]) is not applicable (argument mismatch; int cannot be converted to Object[]) method Arrays.<T#1>sort(T#1[],Comparator<? super T#1>) is not applicable (cannot infer type-variable(s) T#1 (actual and formal argument lists differ in length)) method Arrays.<T#2>sort(T#2[],int,int,Comparator<? super T#2>) is not applicable (cannot infer type-variable(s) T#2 (actual and formal argument lists differ in length)) where T#1,T#2 are type-variables: T#1 extends Object declared in method <T#1>sort(T#1[],Comparator<? super T#1>) T#2 extends Object declared in method <T#2>sort(T#2[],int,int,Comparator<? super T#2>) Main.java:14: error: array required, but int found System.out.println(a[0] + a[1]); ^ Main.java:14: error: array required, but int found System.out.println(a[0] + a[1]); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 6 errors
s381347224
p03671
Java
import java.util.Scanner; import java.util.Random; import java.util.Arrays; class Main { public static void main(String[] args) { int a = new int[3]; for (int i = 0; i < 3; i++) { int a[i] = sc.nextInt(); } Arrays.sort(a); System.out.println(a[0] + a[1]); } }
Main.java:11: error: ']' expected int a[i] = sc.nextInt(); ^ Main.java:11: error: ';' expected int a[i] = sc.nextInt(); ^ 2 errors
s210133207
p03671
Java
package ans_20170701; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int ans = 0; // 最安値の合計 if(a <= b){ ans = a; }else{ ans = b; } if(b <= c){ ans = ans + b; }else{ ans = ans + c; } // 出力 System.out.println(ans)); sc.close(); } }
Main.java:29: error: ';' expected System.out.println(ans)); ^ 1 error
s480554615
p03671
C++
include <iostream> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; cout<<min(a+b,min(b+c,a+c)); return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope 6 | cin>>a>>b>>c; | ^~~ a.cc:7:9: error: 'cout' was not declared in this scope 7 | cout<<min(a+b,min(b+c,a+c)); | ^~~~ a.cc:7:23: error: 'min' was not declared in this scope; did you mean 'main'? 7 | cout<<min(a+b,min(b+c,a+c)); | ^~~ | main a.cc:7:15: error: 'min' was not declared in this scope; did you mean 'main'? 7 | cout<<min(a+b,min(b+c,a+c)); | ^~~ | main
s764840689
p03671
C++
# include < stdio .h > int main () { int a, b, c; cin>>a>>b>>c; int max =a; if(b> max ) max =b; if(c> max ) max =c; cout<< a+b+c-max ; return 0; }
a.cc:1:11: fatal error: stdio .h : No such file or directory 1 | # include < stdio .h > | ^~~~~~~~~~~~ compilation terminated.
s435357438
p03671
C++
#include<bits/stdc++.h> using namespace std; int main(){ vector<int>v(3); for(int i=0; i<3:i++)cin>>v[i]; sort(v.begin(),v.end()); cout<<v[0]+v[1]<<endl; }
a.cc: In function 'int main()': a.cc:5:14: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions] 5 | for(int i=0; i<3:i++)cin>>v[i]; | ^ a.cc:5:17: error: expected ';' before ':' token 5 | for(int i=0; i<3:i++)cin>>v[i]; | ^ | ; a.cc:6:5: error: could not convert 'std::sort<__gnu_cxx::__normal_iterator<int*, vector<int> > >(v.std::vector<int>::begin(), v.std::vector<int>::end())' from 'void' to 'bool' 6 | sort(v.begin(),v.end()); | ~~~~^~~~~~~~~~~~~~~~~~~ | | | void a.cc:7:22: error: expected ')' before ';' token 7 | cout<<v[0]+v[1]<<endl; | ^ | ) a.cc:5:4: note: to match this '(' 5 | for(int i=0; i<3:i++)cin>>v[i]; | ^
s224787855
p03671
Java
import java.util.*; public class B4 { public static void main(String[]args){ Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int [] a = new int [n]; for(int i=0;i<n;i++){ a[i] = stdIn.nextInt(); } int [] b = new int [n]; int [] c = new int [n]; for(int i=1;i<=n;i++){ b[i-1] = a[i-1]; for(int j=0;j<i;j++){ c[j] = b[i-j-1]; } for(int j=0;j<i;j++){ b[j] = c[j]; } } for(int i=0;i<n;i++){ System.out.print(b[i]+" "); } } }
Main.java:2: error: class B4 is public, should be declared in a file named B4.java public class B4 { ^ 1 error
s217452321
p03671
C
#include <stdio.h> int main(void) { int a[3]; int min =10000000; scanf("%d %d %d",&a[0],&a[1],&a[2]); for(int i=0;i<3;i++){ for(j=0;j<3;j++){ if(i!=j){ if(a[i]+a[j]<min){ min = a[i]+a[j]; } } } } printf("%d\n",min); }
main.c: In function 'main': main.c:9:21: error: 'j' undeclared (first use in this function) 9 | for(j=0;j<3;j++){ | ^ main.c:9:21: note: each undeclared identifier is reported only once for each function it appears in
s959727258
p03671
C++
#include <cstdio> #include <vector> #define _USE_MATH_DEFINES #include <math.h> #include <cstring> #include <numeric> #include <algorithm> #include <stdlib.h>> #include <functional> #include <string> #include <array> #include <map> #include <queue> #include <limits.h> #include <set> #include <stack> #include <random> #include <complex> #include <unordered_map> #include <nmmintrin.h> #include <chrono> #define rep(i,s,n) for(int i = (s); (n) > i; i++) #define REP(i,n) rep(i,0,n) #define RANGE(x,a,b) ((a) <= (x) && (x) <= (b)) #define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b)) #define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d)) #define PW(x) ((x)*(x)) #define ALL(x) (x).begin(), (x).end() #define MODU 1000000007 #define bitcheck(a,b) ((a >> b) & 1) #define bitset(a,b) ( a |= (1 << b)) #define bitunset(a,b) (a &= ~(1 << b)) #define MP(a,b) make_pair((a),(b)) #define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second)) #define pritnf printf #define scnaf scanf #define itn int #ifdef _MSC_VER #define __builtin_popcount _mm_popcnt_u32 #define __builtin_popcountll _mm_popcnt_u64 #endif using namespace std; typedef long long ll; typedef pair< int, int> pii; typedef pair< ll, ll> pll; ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a%b); } template< typename A, size_t N, typename T> void Fill(A(&array)[N], const T & val) { std::fill((T*)array, (T*)(array + N), val); } class Graph { public: int vn; int sumcost = 0; vector< vector< pii> > g; Graph(int n) { vn = n; g.resize(n); } virtual void con(int a, int b, int w) = 0; int getWeight(int f, int t) { auto itr = lower_bound(ALL(g[f]), make_pair(t, INT_MIN)); if (itr != g[f].end()) return itr->second; return INT_MIN; } int Costsum() { return sumcost; } void scan(int edcount, bool oindexed, bool w) { REP(i, edcount) { int a, b, c = 1; scanf(" %d %d", &a, &b); if (w)scanf(" %d", &c); con(a - oindexed, b - oindexed, c); } } }; class BiDGraph : public Graph {//無向 public: BiDGraph(int n) : Graph(n) {} void con(int a, int b, int w = 1) { g[a].push_back({ b, w }); g[b].push_back({ a, w }); sumcost++; } }; struct UnionFind { vector< int> data; UnionFind(int size) : data(size, -1) { } bool unionSet(int x, int y) { //xの入ってる集合と yの入ってる集合を併合 x = root(x); y = root(y); if (x != y) { if (data[y] < data[x]) swap(x, y); data[x] += data[y]; data[y] = x; } return x != y; } bool findSet(int x, int y) { //xとyが同じ集合に入っているかどうかを判定 return root(x) == root(y); } int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); } bool isroot(int x) { return data[x] < 0; } int size(int x) { return -data[root(x)]; } }; BiDGraph Kruskal(BiDGraph g) {//最小全域 森 UnionFind uf(g.vn); priority_queue< pair< int, pii>, vector< pair< int, pii> >, greater< pair< int, pii> > > que; REP(i, g.g.size()) { for (auto itr : g.g[i]) { int f = i, t = itr.first; if (f < t) swap(f, t); que.push({ itr.second, { f, t } }); } } BiDGraph MST(g.vn); int alcou = 0; while (alcou < g.vn) { pair< int, pii> cur = que.top(); que.pop(); if (uf.findSet(cur.second.first, cur.second.second)) continue; if (uf.data[cur.second.first] == -1) alcou++; if (uf.data[cur.second.second] == -1) alcou++; uf.unionSet(cur.second.first, cur.second.second); MST.con(cur.second.first, cur.second.second); } return MST; } template <typename T> class SkewHeap { SkewHeap l, r; T val; static meld(SkewHeap* a, SkewHeap* b){ if (!a) return b; if (!b) return a; i(a) } }; signed main() { int n, m; scanf(" %d %d", &n, &m); BiDGraph g(n); vector< pii> ed(m); REP(i, m) { int a, b, w; scanf(" %d %d %d", &a, &b, &w); ed[i] = { a, b }; g.con(a - 1, b - 1, w); } BiDGraph mst = Kruskal(g); int sum = 0; for (auto itr : mst.g) { for (auto itr2 : itr) { sum += itr2.second; } } sum /= 2; vector< pii> eu(n); int euc = 0; function< void(int, int)> tour = [&](int c, int p) { eu[c].first = euc; euc++; for (auto itr : mst.g[c]) { if (itr.first != p) { tour(itr.first, c); } } eu[c].second = euc; euc++; }; tour(0, -1); map< pii, int> ans; function< SkewHeap(int, int, int)> dfs = [&](int c, int p, int w) { SkewHeap heap; for (auto itr : mst.g[c]) { if (itr.first != p) { heap.meld(dfs(itr.first, c, itr.second)); } } for (auto itr : mst.g[c]) { heap.push(itr.second, itr.first); } if (p > 0) { while (1) { pii cur = heap.top(); if (eu[c].first < eu[cur.second].first & & eu[cur.second].second < eu[c].second) { heap.pop(); } else { ans[{p, c}] = sum - w + cur.first; break; } } } }; dfs(0, -1, 0); return 0; }
a.cc:8:20: warning: extra tokens at end of #include directive 8 | #include <stdlib.h>> | ^ a.cc:149:18: error: field 'l' has incomplete type 'SkewHeap<T>' 149 | SkewHeap l, r; | ^ a.cc:147:7: note: definition of 'class SkewHeap<T>' is not complete until the closing brace 147 | class SkewHeap { | ^~~~~~~~ a.cc:149:21: error: field 'r' has incomplete type 'SkewHeap<T>' 149 | SkewHeap l, r; | ^ a.cc:147:7: note: definition of 'class SkewHeap<T>' is not complete until the closing brace 147 | class SkewHeap { | ^~~~~~~~ a.cc:152:16: error: ISO C++ forbids declaration of 'meld' with no type [-fpermissive] 152 | static meld(SkewHeap* a, SkewHeap* b){ | ^~~~ a.cc: In static member function 'static int SkewHeap<T>::meld(SkewHeap<T>*, SkewHeap<T>*)': a.cc:156:9: error: expected ';' before '}' token 156 | } | ^ a.cc: In function 'int main()': a.cc:195:42: error: template argument 1 is invalid 195 | function< SkewHeap(int, int, int)> dfs = [&](int c, int p, int w) { | ^ a.cc: In lambda function: a.cc:196:26: error: class template argument deduction failed: 196 | SkewHeap heap; | ^~~~ a.cc:196:26: error: no matching function for call to 'SkewHeap()' a.cc:147:7: note: candidate: 'template<class T> SkewHeap()-> SkewHeap<T>' 147 | class SkewHeap { | ^~~~~~~~ a.cc:147:7: note: template argument deduction/substitution failed: a.cc:196:26: note: couldn't deduce template parameter 'T' 196 | SkewHeap heap; | ^~~~ a.cc:147:7: note: candidate: 'template<class T> SkewHeap(SkewHeap<T>)-> SkewHeap<T>' 147 | class SkewHeap { | ^~~~~~~~ a.cc:147:7: note: candidate expects 1 argument, 0 provided a.cc:199:46: error: expression cannot be used as a function 199 | heap.meld(dfs(itr.first, c, itr.second)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:208:98: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 208 | if (eu[c].first < eu[cur.second].first & & eu[cur.second].second < eu[c].second) { | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:195:50: error: cannot convert 'main()::<lambda(int, int, int)>' to 'int' in initialization 195 | function< SkewHeap(int, int, int)> dfs = [&](int c, int p, int w) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | | | main()::<lambda(int, int, int)> 196 | SkewHeap heap; | ~~~~~~~~~~~~~~ 197 | for (auto itr : mst.g[c]) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 198 | if (itr.first != p) { | ~~~~~~~~~~~~~~~~~~~~~ 199 | heap.meld(dfs(itr.first, c, itr.second)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 200 | } | ~ 201 | } | ~ 202 | for (auto itr : mst.g[c]) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 203 | heap.push(itr.second, itr.first); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 204 | } | ~ 205 | if (p > 0) { | ~~~~~~~~~~~~ 206 | while (1) { | ~~~~~~~~~~~ 207 | pii cur = heap.top(); | ~~~~~~~~~~~~~~~~~~~~~ 208 | if (eu[c].first < eu[cur.second].first & & eu[cur.second].second < eu[c].second) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 209 | heap.pop(); | ~~~~~~~~~~~ 210 | } | ~ 211 | else { | ~~~~~~ 212 | ans[{p, c}] = sum - w + cur.first; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 213 | break; | ~~~~~~ 214 | } | ~ 215 | } | ~ 216 | } | ~ 217 | }; | ~ a.cc:219:12: error: 'dfs' cannot be used as a function 219 | dfs(0, -1, 0); | ~~~^~~~~~~~~~
s764444454
p03671
C
#include <stdio.h> int main(void){ int a, b, c; int min; scanf("%d%d%d", &a, &b, &c); if if(a<=b){ if(b<=c){ min = a + b; }else{min = a + c; } }else{if(a<=c){ min = b + a; }else{min = b + c; } } printf("minPrice = %d\n", min); return 0; }
main.c: In function 'main': main.c:8:4: error: expected '(' before 'if' 8 | if(a<=b){ | ^~ | (
s732656967
p03671
C++
#include<stdio,h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a+b>=b+c){ if(b+c<=a+c){ printf("%d",b+c); }else{ printf("%d",a+c); } }else{ if(a+b>=a+c){ printf("%d",a+c); }else{ if(a+c>=b+c){ printf("%d",b+c); }else{ printf("%d",a+c); } } } return 0; }
a.cc:1:9: fatal error: stdio,h: No such file or directory 1 | #include<stdio,h> | ^~~~~~~~~ compilation terminated.
s060346358
p03671
Java
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); scan.close(); int p = (a + b); int q = (a + c); int r = (b + c); if(p < q && p < r){ System.out.println(p); } else if(q < p && q < r){ System.out.println(q); } else if(r < p && r < q){ System.out.println(r); } else if(r = p && r = q){ System.out.println(p); } } }
Main.java:25: error: bad operand types for binary operator '&&' else if(r = p && r = q){ ^ first type: int second type: int Main.java:25: error: incompatible types: int cannot be converted to boolean else if(r = p && r = q){ ^ 2 errors
s738151598
p03671
Java
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); scan.close(); int p = (a + b); int q = (a + c); int r = (b + c); if(p < q && p < r){ System.out.println(p); } else if(q < p && q < r){ System.out.println(q); } else if(r < p && r < q){ System.out.println(r); } else if(r = p && r = q) System.out.println(p); } } }
Main.java:29: error: class, interface, enum, or record expected } ^ 1 error
s700697598
p03671
C++
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); scan.close(); int p = (a + b); int q = (a + c); int r = (b + c); if(p < q && p < r){ System.out.println(p); } else if(q < p && q < r){ System.out.println(q); } else if(r < p && r < q){ System.out.println(r); } else if(r = p && r = q) System.out.println(p); } } }
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:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~ a.cc:29:1: error: expected declaration before '}' token 29 | } | ^
s261510073
p03671
C++
#include <stdio.h> int main(void) { int a,b,c; int x,y,z; int min; scanf_s("%d", &a); scanf_s("%d", &b); scanf_s("%d", &c); x = a + b; y = b + c; z = c + a; min = x; if(x>y){ min = y; if(y>z){ min=z; } } else if(x>z){ min = z; } printf("%d\n", min); return 0; }
a.cc: In function 'int main()': a.cc:9:20: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | scanf_s("%d", &a); | ^~~~~~~ | scanf
s571644379
p03671
C++
#include <stdio.h> int main(void) { int a,b,c; int x,y,z; int min; scanf_s("%d", &a); scanf_s("%d", &b); scanf_s("%d", &c); x = a + b; y = b + c; z = c + a; min = x; if(x>y){ min = y; if(y>z){ min=z; } } else if(x>z){ min = z; } printf("%d\n", min); return 0; }
a.cc: In function 'int main()': a.cc:9:20: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | scanf_s("%d", &a); | ^~~~~~~ | scanf
s815892585
p03671
C++
#include <stdio.h> int main(void) { int a,b,c; int x,y,z; int min; scanf_s("%d", &a); scanf_s("%d", &b); scanf_s("%d", &c); x = a + b; y = b + c; z = c + a; min = x; if(x>y){ min = y; if(y>z){ min=z; } } else if(x>z){ min = z; } printf("%d\n", min); return 0; }
a.cc: In function 'int main()': a.cc:9:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | scanf_s("%d", &a); | ^~~~~~~ | scanf
s938837017
p03671
C++
#include <stdio.h> int main(void) { int a,b,c; int x,y,z; int min; scanf_s("%d", &a); scanf_s("%d", &b); scanf_s("%d", &c); x = a + b; y = b + c; z = c + a; min = x; if(x>y){ min = y; if(y>z){ min=z; } else if(x>z){ min = z; } printf("%d\n", min); return 0; }
a.cc: In function 'int main()': a.cc:9:12: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | scanf_s("%d", &a); | ^~~~~~~ | scanf a.cc:30:10: error: expected '}' at end of input 30 | } | ^ a.cc:4:9: note: to match this '{' 4 | { | ^
s867773998
p03671
C++
#include <stdio.h> int main(void) { int a,b,c; int x,y,z; int min; scanf_s("%d", &a); scanf_s("%d", &b); scanf_s("%d", &c); x = a + b; y = b + c; z = c + a; min = x; if(x>y){ min = y; if(y>z){ min=z; } else if(x>z){ min = z; } printf("%d\n", min); return 0; }
a.cc: In function 'int main()': a.cc:9:8: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | scanf_s("%d", &a); | ^~~~~~~ | scanf a.cc:30:6: error: expected '}' at end of input 30 | } | ^ a.cc:4:5: note: to match this '{' 4 | { | ^
s112527594
p03671
C++
#include <stdio.h> int main(void) { int a,b,c; int x,y,z; int min; scanf("%d", &a); scanf("%d", &b); scanf("%d", &c); x = a + b; y = b + c; z = c + a; min = x; if(x>y){ min = y; if(y>z){ min=z; } else if(x>z){ min = z; } printf("%d\n", min); return 0; }
a.cc: In function 'int main()': a.cc:30:6: error: expected '}' at end of input 30 | } | ^ a.cc:4:5: note: to match this '{' 4 | { | ^
s138797787
p03671
C++
#include <stdio.h> int main(void) { int a,b,c; int x,y,z; int min; scanf("%d", a); scanf("%d", b); scanf("%d", c); x = a + b; y = b + c; z = c + a; min = x; if(x>y){ min = y; if(y>z){ min=z; } else if(x>z){ min = z; } printf("%d\n", min); return 0; }
a.cc: In function 'int main()': a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s464823079
p03671
C++
#include <stdio.h> int main(void) { int a,b,c; int x,y,z; int min; scanf("%d", a); scanf("%d", b); scanf("%d", c); x = a + b; y = b + c; z = c + a; min = x; if(x>y){ min = y; if(y>z){ min=z; } else if(x>z){ min = z; } printf("%d\n", min) return 0; }
a.cc: In function 'int main()': a.cc:27:23: error: expected ';' before 'return' 27 | printf("%d\n", min) | ^ | ; 28 | 29 | return 0; | ~~~~~~ a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s759586673
p03671
C++
#include <stdio.h> int main(void) { int a,b,c; int x,y,z; int min; scanf("%d", a); scanf("%d", b); scanf("%d", c); x = a + b; y = b + c; z = c + a; min = x; if(x>y){ min = y; if(y>z){ min=z; } else if(x>z){ min = z; } return 0; }
a.cc: In function 'int main()': a.cc:28:2: error: expected '}' at end of input 28 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s822713647
p03671
C++
#include <stdio.h> int main(void) { int a,b,c; int x,y,z; int min; scanf_s("%d", a); scanf_s("%d", b); scanf_s("%d", c); x = a + b; y = b + c; Z = c + a; min = x; if(x>y){ min = y; if(y>z){ min=z; } else if(x>z){ min = z; } return 0; }
a.cc: In function 'int main()': a.cc:9:4: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | scanf_s("%d", a); | ^~~~~~~ | scanf a.cc:15:4: error: 'Z' was not declared in this scope 15 | Z = c + a; | ^ a.cc:28:2: error: expected '}' at end of input 28 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s425782188
p03671
C++
#include <stdio.h> int main(void) { int a,b,c; int x,y,z; scanf_s("%d", a); scanf_s("%d", b); scanf_s("%d", c); x = a + b; y = b + c; Z = c + a; min = x; if(x>y){ min = y; if(y>z){ min=z; } else if(x>z){ min = z; } return 0; }
a.cc: In function 'int main()': a.cc:8:4: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 8 | scanf_s("%d", a); | ^~~~~~~ | scanf a.cc:14:4: error: 'Z' was not declared in this scope 14 | Z = c + a; | ^ a.cc:16:4: error: 'min' was not declared in this scope; did you mean 'main'? 16 | min = x; | ^~~ | main a.cc:27:2: error: expected '}' at end of input 27 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s139500568
p03671
C++
#include<iostream> using namespace std; int main() { const size_t NUM = 3; int values[NUM]; for (int i = 0; i < NUM; ++i) { cin >> values[i]; } int sum; int min = numeric_limits<int>::max(); for (int i = 0; i < NUM - 1; ++i) { for (int j = i + 1; j < NUM; ++j) { sum = values[i] + values[j]; if (sum < min) { min = sum; } } } cout << min << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:19: error: 'numeric_limits' was not declared in this scope 16 | int min = numeric_limits<int>::max(); | ^~~~~~~~~~~~~~ a.cc:16:34: error: expected primary-expression before 'int' 16 | int min = numeric_limits<int>::max(); | ^~~
s480756013
p03671
C
#include <stdio.h> int main(void){ int a; int b; int c; int d; int min; int min2; int goukei; scanf("%d%d%d",&a,&b,&c); if(1<a&&b&&c<10000){ d = (a + b + c)/3; if(a>d){ min = b; min2 = c; }else if(b>d){ min = a; min2 = c; }else if(c>d){ min = a; min2 = b; }else{ min = a; min2 = b; } goukei = min + min2; printf("%d\n",goukei); return 0; }else{ return 1; } } c
main.c:44:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input 44 | c | ^
s463570308
p03671
C++
#include <stdio.h> #include <stlib.h> int main(void){ int a,b,c; scanf("%d%d%d",&a,&b,&c); int n,m,k; n=a+b; m=a+c; k=b+c; int min = n; if(min>m){ min=m; printf("%d",min); }else if(min>k){ min=k; printf("%d",min); }else{ printf("%d",min); }
a.cc:2:10: fatal error: stlib.h: No such file or directory 2 | #include <stlib.h> | ^~~~~~~~~ compilation terminated.
s028680977
p03671
C
#include <stdio.h> int main(void) { int n,j; scanf("%d", &n); int a[n]; j for (int i = 0; i < n; i++) { scanf("%d", &a[i]); j = 0; while (j =! i) { a[j] = a[i-j]; j++; } } for (int c = 0; c < n; c++) { printf("%d ",a[c]); } return 0 } }
main.c: In function 'main': main.c:7:2: error: expected ';' before 'for' 7 | j | ^ | ; 8 | for (int i = 0; i < n; i++) { | ~~~ main.c: At top level: main.c:29:1: error: expected identifier or '(' before '}' token 29 | } | ^
s533611368
p03671
C++
#include <stdio.h> int main(void){ int a,b,c,n; scanf("%d%d%d",&a,&b,&c); if(a<b && b<c){ n=a+b; printf("%d",n); }else if(a<b && c<b){ n=a+c; printf("%d",n); }else(b<a && b<c){ n=b+c; printf("%d",n); } }
a.cc: In function 'int main()': a.cc:13:24: error: expected ';' before '{' token 13 | }else(b<a && b<c){ | ^ | ;
s524628504
p03671
C++
#include <stdio.h> int main(void){ int a,b,c; sscanf("%d", &a); sscanf("%d", &b); sscanf("%d", &c); int max = a; if(max < b){ max = b; } if(max = c){ max = c; } printf("%d\n",a+b+c-max); return 0; }
a.cc: In function 'int main()': a.cc:5:18: error: cannot convert 'int*' to 'const char*' 5 | sscanf("%d", &a); | ^~ | | | int* In file included from a.cc:1: /usr/include/stdio.h:431:43: note: initializing argument 2 of 'int sscanf(const char*, const char*, ...)' 431 | const char *__restrict __format, ...) __THROW; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ a.cc:6:18: error: cannot convert 'int*' to 'const char*' 6 | sscanf("%d", &b); | ^~ | | | int* /usr/include/stdio.h:431:43: note: initializing argument 2 of 'int sscanf(const char*, const char*, ...)' 431 | const char *__restrict __format, ...) __THROW; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ a.cc:7:18: error: cannot convert 'int*' to 'const char*' 7 | sscanf("%d", &c); | ^~ | | | int* /usr/include/stdio.h:431:43: note: initializing argument 2 of 'int sscanf(const char*, const char*, ...)' 431 | const char *__restrict __format, ...) __THROW; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
s682775293
p03671
C++
#include <stdio.h> int main(void){ int a,b,c; sscanf("%d", &a); sscanf("%d", &b); sscanf("%d", &c); int max = a; if(max < b) max = b; if(max = c) max = c; printf("%d\n",a+b+c-max); return 0; }
a.cc: In function 'int main()': a.cc:5:18: error: cannot convert 'int*' to 'const char*' 5 | sscanf("%d", &a); | ^~ | | | int* In file included from a.cc:1: /usr/include/stdio.h:431:43: note: initializing argument 2 of 'int sscanf(const char*, const char*, ...)' 431 | const char *__restrict __format, ...) __THROW; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ a.cc:6:18: error: cannot convert 'int*' to 'const char*' 6 | sscanf("%d", &b); | ^~ | | | int* /usr/include/stdio.h:431:43: note: initializing argument 2 of 'int sscanf(const char*, const char*, ...)' 431 | const char *__restrict __format, ...) __THROW; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ a.cc:7:18: error: cannot convert 'int*' to 'const char*' 7 | sscanf("%d", &c); | ^~ | | | int* /usr/include/stdio.h:431:43: note: initializing argument 2 of 'int sscanf(const char*, const char*, ...)' 431 | const char *__restrict __format, ...) __THROW; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
s741960089
p03671
C++
#include <stdio.h> int main(void){ int a,b,c; sscanf(buf, "%d", &a); sscanf(buf, "%d", &b); sscanf(buf, "%d", &c); int max = a; if(max < b) max = b; if(max = c) max = c; printf("%d",a+b+c-max); return 0; }
a.cc: In function 'int main()': a.cc:5:12: error: 'buf' was not declared in this scope 5 | sscanf(buf, "%d", &a); | ^~~
s211385640
p03671
C++
#include <stdio.h> int main(void){ int a,b,c; int x; sscanf(buf, "%d", &a); sscanf(buf, "%d", &b); sscanf(buf, "%d", &c); x = a + b; if(x > b + c) x = b + c; if(x > c + a) x = c + a; printf("一番安いのは %d です。\n",x); return 0; }
a.cc: In function 'int main()': a.cc:7:12: error: 'buf' was not declared in this scope 7 | sscanf(buf, "%d", &a); | ^~~
s077862764
p03671
C++
#include <stdio.h> int main(void){ int a,b,c; int x; sscanf("%d", &a); sscanf("%d", &b); sscanf("%d", &c); x = a + b; if(x > b + c) x = b + c; if(x > c + a) x = c + a; printf("一番安いのは %d です。\n",x); return 0; }
a.cc: In function 'int main()': a.cc:7:18: error: cannot convert 'int*' to 'const char*' 7 | sscanf("%d", &a); | ^~ | | | int* In file included from a.cc:1: /usr/include/stdio.h:431:43: note: initializing argument 2 of 'int sscanf(const char*, const char*, ...)' 431 | const char *__restrict __format, ...) __THROW; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ a.cc:8:18: error: cannot convert 'int*' to 'const char*' 8 | sscanf("%d", &b); | ^~ | | | int* /usr/include/stdio.h:431:43: note: initializing argument 2 of 'int sscanf(const char*, const char*, ...)' 431 | const char *__restrict __format, ...) __THROW; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ a.cc:9:18: error: cannot convert 'int*' to 'const char*' 9 | sscanf("%d", &c); | ^~ | | | int* /usr/include/stdio.h:431:43: note: initializing argument 2 of 'int sscanf(const char*, const char*, ...)' 431 | const char *__restrict __format, ...) __THROW; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
s358339001
p03671
C
#include<stdio.h> int main(void){ int a,b,c; printf("数字を3つ入力してください"); scanf("%d%d%d",&a,&b,&c) int max = a; if (b>max) max = b; if (c>max) max = c; printf("合計金額は%d\n", a + b + c - max) return (0); }
main.c: In function 'main': main.c:6:28: error: expected ';' before 'int' 6 | scanf("%d%d%d",&a,&b,&c) | ^ | ; 7 | int max = a; | ~~~ main.c:8:10: error: 'max' undeclared (first use in this function) 8 | if (b>max) max = b; | ^~~ main.c:8:10: note: each undeclared identifier is reported only once for each function it appears in main.c:10:45: error: expected ';' before 'return' 10 | printf("合計金額は%d\n", a + b + c - max) | ^ | ; 11 | return (0); | ~~~~~~
s882777666
p03671
C++
#include<stdio.h> int main() { int a,b,c; do{ scanf("%d %d %d",&a,&b,&c); }while(!(1<=a && a<=10000 && 1<=b && b<=10000 && 1<=c && c<=10000)) int max; max = a; if(b > max) max = b; if(c > max) max = c; printf("%d\n",a+b+c-max); return 0; }
a.cc: In function 'int main()': a.cc:9:72: error: expected ';' before 'int' 9 | }while(!(1<=a && a<=10000 && 1<=b && b<=10000 && 1<=c && c<=10000)) | ^ | ; 10 | 11 | int max; | ~~~
s468554590
p03671
C++
#include<stdio.h> int main() { int a,b,c; do{ scanf("%d %d %d",&a,&b,&c); }while(!(1<=a && a<=10000 && 1<=b && b<=10000 && 1<=c && c<=10000)) int max = a; if(b > max) max = b; if(c > max) max = c; printf("%d\n",a+b+c-max); return 0; }
a.cc: In function 'int main()': a.cc:9:72: error: expected ';' before 'int' 9 | }while(!(1<=a && a<=10000 && 1<=b && b<=10000 && 1<=c && c<=10000)) | ^ | ; 10 | 11 | int max = a; | ~~~