submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s737034126
p04047
C++
#include <cstdio> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> vec; for(int i = 0; i < 2*n; i ++) { int x; cin >> x; vec.push_back(x); } sort(vec.begin(), vec.end()); int sum = 0; for(int i = 0; i < 2*n; i +...
a.cc: In function 'int main()': a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(vec.begin(), vec.end()); | ^~~~ | short
s995033348
p04047
C++
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> l; for (int i = 0; i< 2*n;i++) { int t; cin >> t; l.push_back(t); } sort(l.begin(), l.end()); int sum = 0; for (int i = 0; i< n; i++) { sum += l[2*i]; } cout << sum << endl; r...
a.cc: In function 'int main()': a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'short'? 17 | sort(l.begin(), l.end()); | ^~~~ | short
s967857886
p04047
C++
//座標軸 glBegin(GL_LINES); glVertex2d(-1,0); glVertex2d(1,0); glVertex2d(-1.5/2,1); glVertex2d(-1.5/2,-1); glEnd(); //文字 PrintText(-0.8,0,"0"); Print(-1,0.5,"0.0000001"); Print(-1,-0.5,"0.0000001"); PrintText(-0.25,0,"1"); PrintText(0.25,0,"2"); PrintText(0.75,0,"3"); ...
a.cc:3:12: error: expected constructor, destructor, or type conversion before '(' token 3 | glBegin(GL_LINES); | ^ a.cc:4:15: error: expected constructor, destructor, or type conversion before '(' token 4 | glVertex2d(-1,0); | ^ a.cc:5:15: error: expected constructor...
s590113351
p04047
C++
#include <GL/glut.h> #include <stdio.h> #include <GL/glpng.h> #include <GL/gl.h> #include <stdlib.h> void Display(void); void Reshape(int, int); void Mouse(int, int, int, int); void Keyboard(unsigned char, int, int); // Added void PassiveMotion(int, int); void Motion(int, int); void Entry(int); void Timer(int); void...
a.cc:2:10: fatal error: GL/glut.h: No such file or directory 2 | #include <GL/glut.h> | ^~~~~~~~~~~ compilation terminated.
s483547245
p04047
C++
#include <algorithm> #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> using namespace std; int n, ans; vector<int> l; int main() { cin >> n; for (int i = 1; i <= 2 * n; ++i) { int a; cin >> a; l.push_back(a); } sort(l.begin(), l.end());...
a.cc:9:1: error: 'vector' does not name a type 9 | vector<int> l; | ^~~~~~ a.cc: In function 'int main()': a.cc:15:9: error: 'l' was not declared in this scope 15 | l.push_back(a); | ^ a.cc:17:10: error: 'l' was not declared in this scope 17 | sort(l.begin(), l.end()); | ...
s312257116
p04047
C
#include<cstdio> #include<algorithm> using namespace std; #define Mod 1000000007 #define ll long long #define tc getchar() inline int read(void){ int a=0;static char c; while((c=tc)<'0'||c>'9'); while(c>='0'&&c<='9')a=a*10+c-'0',c=tc; return a; } ll fac[8005],inv[8005],n,f[4005][4005],x[200005],y[200005...
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s664729673
p04047
C++
#include <iostream> using namespace std; int main(void){ int n; int tmp; int sum = 0; cin >> n; int a[200]={999}; for(int i=0;i<(2*n)-1;i++){ for(int j=i;j<(2*n);j++){ if(a[i]<a[j]){ tmp=a[i]; a[i]=a[j]; a[j]=tmp; } } } for(i=1;i<N;i++){ if(a[2*i]!=999) sum += a[2*i]; } cout << sum <<...
a.cc: In function 'int main()': a.cc:19:13: error: 'i' was not declared in this scope 19 | for(i=1;i<N;i++){ | ^ a.cc:19:19: error: 'N' was not declared in this scope 19 | for(i=1;i<N;i++){ | ^
s203237760
p04047
C++
#include <iostream> int main(void){ int n; int tmp; sum = 0; cin >> n; int a[200]={999}; for(int i=0;i<(2*n)-1;i++){ for(int j=i;j<(2*n);j++){ if(a[i]<a[j]){ tmp=a[i]; a[i]=a[j]; a[j]=tmp; } } } for(i=1;i<N;i++){ if(a[2*i]!=999) sum += a[2*i]; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:6:9: error: 'sum' was not declared in this scope 6 | sum = 0; | ^~~ a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin >> n; | ^~~ | std::cin In file included from a.cc:1: /usr/inc...
s170461757
p04047
Java
import java.io.IOException; import java.util.Arrays; import java.util.Scanner; public class ProblemA { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] skewers = new int[n * 2]; for (int i = 0; i < n * 2; i++) { s...
Main.java:5: error: class ProblemA is public, should be declared in a file named ProblemA.java public class ProblemA { ^ 1 error
s670959305
p04047
Java
import java.io.IOException; import java.util.Arrays; import java.util.Scanner; public class ProblemA { public static void main(String[] args) { try { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] skewers = new int[n * 2]; for (int i = 0; i...
Main.java:5: error: class ProblemA is public, should be declared in a file named ProblemA.java public class ProblemA { ^ 1 error
s850151326
p04047
C++
import java.util.Arrays; import java.util.Scanner; public class AtcoderAgc1A { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); int [] values = new int[n * 2]; for (int i = 0; i < n * 2; i++) { values[i] = input.ne...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Arrays; | ^~~~~~ 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.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-t...
s591237315
p04047
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> vec (N); for(int i = 0;i < N;i++){ cin >> vec.at(i); } sort(vec.begin(),vec.end()); int awnser = 0; for(int i = 0;i < N;i++){ awnser += max(vec.at(2i),vec.at(2i+1)); } cout << awnser << endl; }
a.cc: In function 'int main()': a.cc:14:37: error: no matching function for call to 'std::vector<int>::at(std::complex<double>)' 14 | awnser += max(vec.at(2i),vec.at(2i+1)); | ~~~~~~^~~~ In file included from /usr/include/c++/14/vector:66, from /us...
s162306982
p04047
C++
#--- define function ---# def num_check(n, l): if 2 * n == len(l): return True else: return False #--- main ---# num = int(input()) l = input().split() list = [int(i) for i in l] if not num_check(num, list): print("Invalid numbers.") exit() list.sort() meet = 0 for i in range(num): ...
a.cc:1:2: error: invalid preprocessing directive #-- 1 | #--- define function ---# | ^~ a.cc:8:2: error: invalid preprocessing directive #-- 8 | #--- main ---# | ^~ a.cc:2:1: error: 'def' does not name a type 2 | def num_check(n, l): | ^~~
s214557909
p04047
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include <cstdio> #include <bits/stdc++.h> #include <set> using namespace std; using ll =long long; int main (void) { int N; cin >> N; int a[N]; int b=0; int sum=0; for (int i=0; i<N; i++) { cin >> b; a[i]...
a.cc: In function 'int main()': a.cc:22:5: error: request for member 'sort' in 'a', which is of non-class type 'int [N]' 22 | a.sort(); | ^~~~
s733669136
p04047
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> l(2*n); for (int i = 0; i < 2*n; ++i) cin >> l[i]; sort(l.begin(), l.end()); ll ans = 0; for (int i = 0; i < n; ++i) ans += l[2*i]; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:3: error: 'll' was not declared in this scope; did you mean 'l'? 9 | ll ans = 0; | ^~ | l a.cc:11:31: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | for (int i = 0; i < n; ++i) ans += l[2*i]; | ^...
s146490722
p04047
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; public class ACG001B { public static void main(String args[]) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Integer N = Integer.parseInt(br.read...
Main.java:6: error: class ACG001B is public, should be declared in a file named ACG001B.java public class ACG001B { ^ 1 error
s726228867
p04047
C
#include<iostream> #include<algorithm> using namespace std; int n; int l[120]={}; int main() { cin>>n; for(int i=1;i<=2*n;i++) { cin>>l[i]; } sort(l+1,l+2*n+1); int anss=0; for(int i=1;i<=2*n;i++) if(i%2!=0) { anss+=l[i]; } cout<<anss<<endl; return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s390995103
p04047
C
#include<bits/stdc++.h> using namespace std; int n; int l[120]={}; int main() { cin>>n; for(int i=1;i<=2*n;i++) { cin>>l[i]; } sort(l+1,l+2*n+1); int ans=0; for(int i=1;i<=2*n;i++) if(i%2!=0) { ans+=l[i]; } cout<<ans<<endl; return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s854228819
p04047
C
#include<bits/stdc++.h> using namespace std; int n,a[110],b[110],ans=0,minn,k; int main() { scanf("%d",&n); n*=2; for(int i=1;i<=n;i++)scanf("%d",&a[i]); for(int i=1;i<=n;i++) { minn=10000; k=0; for(int j=i+1;j<=n;j++) { if(abs(a[i]-a[j])<minn && a[i]!=10000 && a[j]!=10000) { min...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s521677118
p04047
C++
7:51:08 九只羊 2018/4/19 7:51:08 #include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int l[120]={}; for(int i=1;i<=2*n;i++) { cin>>l[i]; } sort(l+1,l+2*n+1); long long ans=0; for(int i=1;i<=2*n;) { ans+=l[i]; i+=2; } cout<<ans<<endl; return 0; }
a.cc:1:6: error: invalid digit "8" in octal constant 1 | 7:51:08 | ^~ a.cc:2:23: error: invalid digit "8" in octal constant 2 | 九只羊 2018/4/19 7:51:08 | ^~ a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 7:51:08 | ^ In file included from /usr/...
s244054685
p04047
C
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int l[120]={}; for(int i=1;i<=2*n;i++) { cin>>l[i]; } sort(l+1,l+2*n+1); long long ans=0; for(int i=1;i<=2*n;) { ans+=l[i]; i+=2; } cout<<ans<<endl; return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s845867014
p04047
C
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int l[120]={}; for(int i=1;i<=2*n;i++) { cin>>l[i]; } sort(l+1,l+2*n+1); long long ans=0; for(int i=1;i<=2*n;) { ans+=l[i]; i+=2; } cout<<ans<<endl; return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s427874857
p04047
C
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int l[120]={}; for(int i=1;i<=2*n;i++) { cin>>l[i]; } sort(l+1,l+2*n+1); long long ans=0; for(int i=1;i<=2*n;i+=2) ans+=l[i]; cout<<ans<<endl; return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s201350866
p04047
C
#include <bits/stdc++.h> using namespace std; const int N=1e4; int n,s; int a[N]; int main() { cin>>n; n*=2; for (int i=0;++i<=n;) cin>>a[i]; sort(a+1,a+n+1); for (int i=1;i<=n;i+=2) s+=a[i]; cout<<s; return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s081578573
p04047
C
#include<bits/stdc++.h> using namespace std; int n,a[2001],sum=0; inline void init() { scanf("%d",&n); n*=2; for (int i=1;i<=n;i++) scanf("%d",&a[i]); sort(a+1,a+n+1); } inline void work() { for (int i=1;i<=n;i++) if (i%2==1) sum+=a[i]; } int main() { init(); work(); printf("%d\n",sum); return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s236789967
p04047
C
#include<bits/stdc++.h> using namespace std; int main() { int n,a[220]={},ans=0; cin>>n; for(int i=1;i<=2*n;i++) cin>>a[i]; sort(a+1,a+2*n+1); for(int i=1;i<=2*n;i+=2) { ans+=a[i]; } cout<<ans; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s972518110
p04047
C++
#include <iostream> #include <string> #include <string.h> #include <map> #include <set> #include <vector> #include <stdio.h> #include <math.h> #include <algorithm> #include <queue> #include <cmath> #include <cstdio> using namespace std; int a[100]; int main(){ int n; cin>>n; for(int i=0;i<n;i++) cin>>a[i]; sort(a.begin...
a.cc: In function 'int main()': a.cc:20:8: error: request for member 'begin' in 'a', which is of non-class type 'int [100]' 20 | sort(a.begin().a.end()); | ^~~~~
s536110669
p04047
C++
input(),print(sum(sorted(list(map(int,input().split())))[::2]))
a.cc:1:8: error: expected constructor, destructor, or type conversion before ',' token 1 | input(),print(sum(sorted(list(map(int,input().split())))[::2])) | ^ a.cc:1:14: error: expected constructor, destructor, or type conversion before '(' token 1 | input(),print(sum(sorted(list(map(int,input().sp...
s137897851
p04047
C++
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n; n = sc.nextInt(); int[] a = new int[2*n]; for(int i=0; i<2*n; i++) a[i] = sc.nextInt(); Arrays.sort(a); int cnt=0; for(int i=0; i<2*n; i+=2) cnt+=a[i]; System.out.println(c...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ 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 { | ^~~~~~
s886277148
p04047
C++
gets;p gets.split.map(&:to_i).sort.each_slice(2).map(&:min).inject :+
a.cc:1:1: error: 'gets' does not name a type 1 | gets;p gets.split.map(&:to_i).sort.each_slice(2).map(&:min).inject :+ | ^~~~ a.cc:1:6: error: 'p' does not name a type 1 | gets;p gets.split.map(&:to_i).sort.each_slice(2).map(&:min).inject :+ | ^
s824063457
p04047
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int n,a[102],cnt=0,; int main() { scanf("%d",&n); for(int i=1;i<=2*n;i++) scanf("%d",&a[i]); sort(a+1,a+2*n+1); for(int i=1;i<=2*n-1;i+=2) cnt+=min(a[i],a[i+1]); printf("%d",cnt); return 0; }
a.cc:5:20: error: expected unqualified-id before ';' token 5 | int n,a[102],cnt=0,; | ^
s020054211
p04047
C++
v#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define int long long int dx[] = {1, 0, -1, 0, 1, -1, -1, 1}; int dy[] = {0, 1, 0, -1, 1, 1, -1, -1}; int N; int L[200]; signed main() { cin >> N; for (int i = 0; i < 2 * N; i++) { cin >> L[i]; } sort(L, L + 2 * N); ...
a.cc:1:2: error: stray '#' in program 1 | v#define _USE_MATH_DEFINES | ^ a.cc:1:1: error: 'v' does not name a type 1 | v#define _USE_MATH_DEFINES | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/...
s847408034
p04047
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> #include<cstring> #include<map> #include<set> #include<deque> #include<caserrt> using namespace std; #define sz(x) (int)(x.size()) #define fi(a,b) for(int i=a;i<b;++i) #define fj(a,b) for(int j=a;j<b;++j) #define fo(a,b) for(int o=a;o<b;++o) #de...
a.cc:9:9: fatal error: caserrt: No such file or directory 9 | #include<caserrt> | ^~~~~~~~~ compilation terminated.
s000583005
p04047
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector <int> x(2*n); for(int i = 0; i < 2*n;i++){ cin >> x[i]; }   sort(x.begin(),x.end()); int answer = 0; for(int i = 0;i < n;i++){ answer = x[2*i]; cout << answer << endl; return 0; } }
a.cc:16:1: error: extended character   is not valid in an identifier 16 |   sort(x.begin(),x.end()); | ^ a.cc: In function 'int main()': a.cc:16:1: error: '\U000000a0' was not declared in this scope 16 |   sort(x.begin(),x.end()); | ^
s247670468
p04047
C++
#include <bits/stdc++.h> int main(){ int n; cin >> n; vector<int> x(2*n); for(int i=0; i<2*n; ++i) cin >> x[i]; sort(x.begin(), x.end()); int ans = 0; for(int i=0; i<n; ++i) ans += x[2*i]; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:4:4: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | cin >> n; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 's...
s867695011
p04047
C++
1. using namespace std; 2.   3. int main() 4. { 5. int n; 6. cin >> n; 7. vector<int> x(2*n); 8. for(int i=0; i<2*n; ++i) 9. cin >> x[i]; 10.   11. sort(x.begin(), x.end()); 12. int ans = 0; 13. for(int i=0; i<n; ++i) 14. ans += x[2*i]; 15. cout << ans << endl; 16.   17. ...
a.cc:2:4: error: extended character   is not valid in an identifier 2 | 2.   | ^ a.cc:10:5: error: extended character   is not valid in an identifier 10 | 10.   | ^ a.cc:16:5: error: extended character   is not valid in an identifier 16 | 16.   | ^ a.cc:1:1: error: expected unqual...
s602924013
p04047
C++
//InTheNameOfGod #include<bits/stdc++.h> using namespace std; #define ll long long #define rep(i,j,k) for(int i=j;i<k;++i) #define rrep(i,j,k) for(int i=j;i>=k;i--) #define pb push_back #define lb(i) i&(-i); const int maxn =2e6+6; int n,a[maxn]; int main() { ios_base::sync_with_stdio(false);cin.tie(0); cin>>n; ...
a.cc: In function 'int main()': a.cc:16:16: error: expected ';' before 'cin' 16 | sort(a,a+n)cin>>a[i]; | ^~~ | ;
s889869038
p04047
C++
//InTheNameOfGod #include<bits/stdc++.h> using namespace std; #define ll long long #define rep(i,j,k) for(int i=j;i<k;++i) #define rrep(i,j,k) for(int i=j;i>=k;i--) #define pb push_back #define lb(i) i&(-i); const int maxn =2e6+6; int n,a[maxn]; int main() { ios_base::sync_with_stdio(false);cin.tie(0); cin>>n; ...
a.cc: In function 'int main()': a.cc:5:20: error: expected ',' or ';' before 'for' 5 | #define rep(i,j,k) for(int i=j;i<k;++i) | ^~~ a.cc:18:5: note: in expansion of macro 'rep' 18 | rep(i,0,n) | ^~~ a.cc:18:9: error: 'i' was not declared in this scope 18 | rep(i,0,n...
s629767438
p04047
C++
#include <iostream> #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[2*n]; for(int i=0;i<2*n;i++) cin>>a[i]; int s=0; sort(a,a+2*n); for(int i=0;i<2*n;i+=2) s=(a[i]>a[i+1])?s+a[i+1]:s+a[i]); cout << s; }
a.cc: In function 'int main()': a.cc:14:40: error: expected ';' before ')' token 14 | s=(a[i]>a[i+1])?s+a[i+1]:s+a[i]); | ^ | ;
s511641046
p04047
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n; cin >> n; int a[2n]; for(int i=0;i<2n;i++) cin>>a[i]; int s=0; sort(a,a+2n); for(int i=0;i<2n;i++) s=s+((a[i]>a[i+1])?a[i+1]:a[i]); cout << s; }
a.cc: In function 'int main()': a.cc:8:15: error: unable to find numeric literal operator 'operator""n' 8 | int a[2n]; | ^~ a.cc:9:23: error: unable to find numeric literal operator 'operator""n' 9 | for(int i=0;i<2n;i++) | ^~ a.cc:10:14: error: 'a...
s210247942
p04047
C++
include <iostream> #include <algoithm> using namespace std; int main() { int n; cin >> n; int a[2n]; for(int i=0;i<2n;i++) cin>>a[i]; int s=0; sort(a,a+2n); for(int i=0;i<2n;i++) s=s+((a[i]>a[i+1])?a[i+1]:a[i]); cout << s; }
a.cc:2:10: fatal error: algoithm: No such file or directory 2 | #include <algoithm> | ^~~~~~~~~~ compilation terminated.
s060257919
p04047
C++
#include <iostream> #include <algorithm> using namespace std; main() { int n; cin>> n; int a[2n]; for(int i=0;i<2n;i++) cin >> a[i]; sort (a,a+2n); int s=0; for(int i=0;i<2n;i+=2) { s=s+((a[i]>a[i+1])?a[i+1]:a[i]); } cout << s; }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~ a.cc: In function 'int main()': a.cc:8:11: error: unable to find numeric literal operator 'operator""n' 8 | int a[2n]; | ^~ a.cc:9:19: error: unable to find numeric literal operator ...
s274919694
p04047
C++
#include <iostream> using namespace std; int main() {
a.cc: In function 'int main()': a.cc:5:2: error: expected '}' at end of input 5 | { | ~^
s166529292
p04047
C++
#include <bits.stdc++.h> using namespace std; int n; int a[202]; int main() { cin >> n; for(int i = 0; i < 2 * n; i++) cin >> a[i]; sort(a,a+2*n); int ans = 0; for(int i = 0; i < 2 * n; i += 2) ans += a[i]; cout << ans << endl; }
a.cc:1:10: fatal error: bits.stdc++.h: No such file or directory 1 | #include <bits.stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s211703351
p04047
C++
#include<iostream> using namespace std; int main(){ int n; cin >> n; int l[2*n]; int i,j; for(i=0;i<2*n;i++){ cin >> l[i]; } for(i=0;i<2*n;i++){ for(j=0j<2*n-1-i;j++){ if(l[j]>l[j+1]){ int x=l[j]; l[j]=l[j+1]; l[j+1]=x; } } } int ans; for(i=0;i<n;i++){ ans +=l[i*2]; } cout << ans <<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: invalid operands of types '__complex__ int' and 'int' to binary 'operator<' 12 | for(j=0j<2*n-1-i;j++){ | ~~^~~~~~~~ | | | | | int | __complex__ int a.cc:12:21: error: expected ';' before ')' token 12 | f...
s834586013
p04047
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int N; int L[N]; for(int i = 0; i < 2*N; i++){ cin >> L[i]; } sort(L, L+2N); int sum = 0; for(int i = 0; i < N; i++){ sum += L[2*N]; } cout << sum << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:13: error: unable to find numeric literal operator 'operator""N' 12 | sort(L, L+2N); | ^~
s210716867
p04047
C++
#include <iostraem> #include <algorithm> using namespace std; int main(){ int N; int L[N]; for(int i = 0; i < 2*N; i++){ cin >> L[i]; } sort(L, L+2N); int sum = 0; for(int i = 0; i < N; i++){ sum += L[2*N]; } cout << sum << endl; return 0; }
a.cc:1:10: fatal error: iostraem: No such file or directory 1 | #include <iostraem> | ^~~~~~~~~~ compilation terminated.
s141310213
p04047
C++
#include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; void solve(vector<int> &v) { sort(v.begin(),v.end()); // reverse(v.begin(), v.end()); int res = 0; for(size_t i = 0 ; i < v.size()-1 ; i+=2) { res += min(v[i],v[i+1]); } cout << res << endl; } int main(void) { int ...
a.cc: In function 'int main()': a.cc:32:15: error: 'v2' was not declared in this scope; did you mean 'v'? 32 | solve(v2); | ^~ | v
s676211997
p04047
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main_tmp(void) { int n; cin >> n; vector<int> v(n); int idx=0; while(n--) { cin >> v[idx++]; } sort(v.begin(),v.end()); reverse(v.begin(), v.end()); if(v.size() >= 2) { cout << v[1] << endl; }else { cout << v[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
s001571395
p04047
C++
#include <iostream> #include <vector> using namespace std; int main(void) { int n; cin >> n; vector<int> v(n); int idx=0; while(n--) { cin >> v[idx++]; } sort(v.begin(),v.end()); reverse(v.begin(), v.end()); if(v.size() >= 1) { cout << v[1] << endl; }else { cout << v[0] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(v.begin(),v.end()); | ^~~~ | short a.cc:15:9: error: 'reverse' was not declared in this scope 15 | reverse(v.begin(), v.end()); | ^~~~~...
s925131358
p04047
C++
#include <iostream> using namespace std; int main(void) { int n; cin >> n; vector<int> v(n); int idx=0; while(n--) { cin >> v[idx++]; } sort(v.begin(),v.end()); reverse(v.begin(), v.end()); if(v.size() >= 1) { cout << v[1] << endl; }else { cout << v[0] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'vector' was not declared in this scope 7 | vector<int> v(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> ...
s282379812
p04047
C++
n = input() a = sorted(map(int, raw_input().split())) print sum([a[2 * i] for i in xrange(n)])
a.cc:1:1: error: 'n' does not name a type 1 | n = input() | ^
s362182072
p04047
C++
#include <iostream> #include <vector> int main(int argc, char* argv[]) { int n; scanf("%d", &n); std::vector<int> input(2*n); for(int i = 0; i < input.size(); ++i){ scanf("%d", &input[i]); } sort(input.begin(), input.end()); int ans = 0; for(int i = 0; i < input.size(); i += 2){...
a.cc: In function 'int main(int, char**)': a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(input.begin(), input.end()); | ^~~~ | short
s378896913
p04047
C++
#define _CRT_SECURE_NO_WARNINGS #include<cstdio> #include<vector> #include<string> #include<iostream> #include<algorithm> #include<map> #include<iterator> #include<set> #include<stack> #include<queue> #include<fstream> #include<iomanip> #include <unordered_map> #include <unordered_set> #include <numeric> #include<cmath...
a.cc: In function 'int main()': a.cc:26:23: error: 'memset' was not declared in this scope 26 | #define FILL(a,value) memset(a, value, sizeof(a)) | ^~~~~~ a.cc:153:9: note: in expansion of macro 'FILL' 153 | FILL(M, -1); | ^~~~ a.cc:19:1: note: 'memset' is defined ...
s465239723
p04047
C++
#include<iostream> using namespace std; int main(){count << 3; return 0;}
a.cc: In function 'int main()': a.cc:4:12: error: 'count' was not declared in this scope 4 | int main(){count << 3; return 0;} | ^~~~~
s721706968
p04047
Java
import java.util.Scanner; public class BBQ { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int[] L = new int[2*N]; int temp = 0, result = 0; for (int i = 0; i < 2*N; i++) { L[i] = scanner.nextInt(); ...
Main.java:3: error: class BBQ is public, should be declared in a file named BBQ.java public class BBQ { ^ 1 error
s184665114
p04047
Java
import java.util.*; public class Main { public void main(String[] args) { Scanner sc = new Scanner(System.in); int maxCnt = sc.nextInt(); int[] arr = new int[maxCnt*1]; for (int i = 0; i < arr.length; i++) { arr[i] = sc.nextInt(); } sort(arr, 0, arr.length); int sum = 0; for(int i = 0; i < maxCnt * 2; i+=2...
Main.java:46: error: cannot find symbol temp = arr[end]; ^ symbol: variable temp location: class Main Main.java:48: error: cannot find symbol arr[start] = temp; ^ symbol: variable temp location: class Main 2 errors
s040653895
p04047
Java
public void main(String[] args) { Scanner sc = new Scanner(System.in); int maxCnt = sc.nextInt(); int[] arr = new int[maxCnt*1]; for (int i = 0; i < arr.length; i++) { arr[i] = sc.nextInt(); } sort(arr, 0, arr.length); int sum = 0; for(int i = 0; i < maxCnt * 2; i+=2) { sum += arr[i+1]; } System.out.p...
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) 1 error
s173234705
p04047
C++
#include<iostream> #include<cmath> #include<algorithm> #include<iomanip> #include<string> #include<vector> #include<cstdio> #include<cstring> #include<map> #include<set> #include<fstream> #include<sstream> #include<queue> #include<iterator> using namespace std; vector<int> g[2000]; int n,k; int dfs(int x,int pre,int d,...
a.cc:68:13: error: redefinition of 'std::vector<int> g [2000]' 68 | vector<int> g[2000]; | ^ a.cc:16:13: note: 'std::vector<int> g [2000]' previously declared here 16 | vector<int> g[2000]; | ^ a.cc:69:5: error: redefinition of 'int n' 69 | int n,k; | ^ a.cc:17:5: ...
s772026084
p04047
C++
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <stdlib.h> #include <queue> #include <set> #include <string> #include <string.h> #include <cstring> #include <stdio.h> #include <fstream> #include <stack> #include <iomanip> //#include <conio.h> //#include <windows.h> //#include <time...
a.cc: In function 'void bfs(int)': a.cc:36:37: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int' 36 | que.push(make_pair<int,int>(x,0)); | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include...
s528603438
p04047
C++
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <stdlib.h> #include <queue> #include <set> #include <string> #include <string.h> #include <cstring> #include <stdio.h> #include <fstream> #include <stack> #include <iomanip> //#include <conio.h> #include <windows.h> #include <time.h> ...
a.cc:16:10: fatal error: windows.h: No such file or directory 16 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s440079820
p04047
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.Random; import java.util.StringTokenizer; public class AGC { public static void main (String[] args) {new AGC();} AGC() { FastScanner fs = new FastScanner(); P...
Main.java:8: error: class AGC is public, should be declared in a file named AGC.java public class AGC { ^ 1 error
s586805497
p04047
C
#include<stdio.h> main() { int n,a[100],i.ans; scanf("%d",&n); i=0; while( scanf("%d ",&a[i]); printf("%d",ans); }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main() | ^~~~ main.c: In function 'main': main.c:4:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 4 | int n,a[100],i.ans; | ^ main.c:6:1: error: 'i' undeclared (first use in this functio...
s817383375
p04047
C
#include<stdio.h> int main(){ int n,temp; scanf("%d",&n); /* printf("n;%d",n); printf("\n"); printf("k;%d",k); printf("\n");*/ int i[n-1]; int max[k-1]; int count=0; int total=0; // for(int j=0;j<k;j++){ // max[j] = 0; // } for(int j=0;j<n;j++){ scanf...
main.c: In function 'main': main.c:13:13: error: 'k' undeclared (first use in this function) 13 | int max[k-1]; | ^ main.c:13:13: note: each undeclared identifier is reported only once for each function it appears in
s305908365
p04047
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class MysteriousLight { public static void main(String[] args) throws NumberFormatException, IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in...
Main.java:6: error: class MysteriousLight is public, should be declared in a file named MysteriousLight.java public class MysteriousLight { ^ 1 error
s777835417
p04047
Java
package main; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class MysteriousLight { public static void main(String[] args) throws NumberFormatException, IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamRe...
Main.java:7: error: class MysteriousLight is public, should be declared in a file named MysteriousLight.java public class MysteriousLight { ^ 1 error
s094903228
p04047
Java
package main; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; public class BBQEasy { public static void main(String[] args) throws NumberFormatException, IOException { // TODO Auto-generated method stub // TOD...
Main.java:9: error: class BBQEasy is public, should be declared in a file named BBQEasy.java public class BBQEasy { ^ 1 error
s635598420
p04047
C++
#include <iostream> #include <algorithm> #include <string> int N_MAX = 1000; int N; using namespace std; int main(int argc, const char * argv[]) { int L[N_MAX]; int i; memset(L, 0, sizeof(L)); cin >> N; for(i = 0; i < 2*N; i++) { cin >> L[i]; } sort(L, L+2*N); ...
a.cc: In function 'int main(int, const char**)': a.cc:14:5: error: 'memset' was not declared in this scope 14 | memset(L, 0, sizeof(L)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#incl...
s968776435
p04047
C++
213213
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 213213 | ^~~~~~
s501900016
p04047
C++
#include <iostream> #include <sstream> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> #define INF 999999999 #define llong long long #define pb(a) push_back(a) #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n...
a.cc: In function 'int main()': a.cc:19:18: error: 'sort' was not declared in this scope; did you mean 'short'? 19 | #define VSORT(v) sort(v.begin(), v.end()); | ^~~~ a.cc:41:3: note: in expansion of macro 'VSORT' 41 | VSORT(L); | ^~~~~
s196662903
p04047
C++
#include <algorithm> sort(l,l+n*2); while(count < n*2){ ans += min(l[count],l[count+1]); count+=2; } cout << ans << "\n"; return 0; }
a.cc:2:9: error: expected constructor, destructor, or type conversion before '(' token 2 | sort(l,l+n*2); | ^ a.cc:4:5: error: expected unqualified-id before 'while' 4 | while(count < n*2){ | ^~~~~ a.cc:8:5: error: 'cout' does not name a type 8 | cout << ans << "\n"; ...
s128059461
p04047
C++
#include <iostream> using namespace std; int main() { int n,count=0,ans; cin >> n; int l[n*2]; for(int i = 0; i < n*2; i++){ cin >> l[i]; } sort(l,l+n*2); while(count < n*2){ ans += min(l[count],l[count+1]); count+=2; } cout << ans << "\n"; ...
a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(l,l+n*2); | ^~~~ | short
s308754508
p04047
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int arr[(2 * n) + 5]; for(int i = 1; i <= 2 * n; ++i) { cin >> arr[i]; } sort(arr + 1, arr + 1 + 2*n); int ans = 0; for(int i = 1; i <= n; ++i) { ans += arr[(2 * i) - 1]; /cout << arr[2 * i - 1]; } cout << ans; return 0; }
a.cc: In function 'int main()': a.cc:19:17: error: expected primary-expression before '/' token 19 | /cout << arr[2 * i - 1]; | ^
s894451742
p04047
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; const double pi = acos(-1); #define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++) #define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define __GET_MACRO3(_1, _2, _...
a.cc: In function 'int main()': a.cc:20:14: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector' 20 | vector<11> L(2,n); | ^ a.cc:20:14: note: expected a type, got '11' a.cc:20:14: error: template argument 2 is invalid ...
s781290584
p04047
C++
#include <iostream> #include <cstdio> #include <vector> using namespace std; int main(void) { int n; scanf("%d", &n); n <<= 1; vector<int> a(n); for(int i = 0;i < n;i++) scanf("%d", &a[i]); sort(a.begin(), a.end()); int res = 0; for(int i = 0;i < n;i += 2) res += a[i]; printf("%d\n", res); }
a.cc: In function 'int main()': a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(a.begin(), a.end()); | ^~~~ | short
s821540665
p04047
C++
#include <algorithm> #include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> #include <cmath> using namespace std; int n,l[105],ans; void work() { scanf("%d",&n),n*; for (int i=1; i<=n; i++) scanf("%d",&l[i]); sort(l+1,l+n+1); for (int i=1; i<=n; i+=2) ans+=l[i]; printf("%d",ans); } int ma...
a.cc: In function 'void work()': a.cc:13:26: error: expected primary-expression before ';' token 13 | scanf("%d",&n),n*; | ^
s305811854
p04047
C++
#include<iostream> #include<vector> #include<algorithm> #include<cstring> #include<cstdio> #include<cmath> #include<cstdlib> #include<ctime> #include<queue> #include<set> using namespace std; const int N=2e6; int gi() { int w=0;bool q=1;char c=getchar(); while ((c<'0'||c>'9') && c!='-') c=getchar(); if (c=='-') q=0,...
a.cc: In function 'void link(int, int)': a.cc:24:50: error: reference to 'next' is ambiguous 24 | inline void link(int a,int b) { d[to[++tot]=b]++,next[tot]=head[a],head[a]=tot; } | ^~~~ In file included from /usr/include/c++/14/string:47, from ...
s602296858
p04047
C++
#include <iostream> #include <algorithm> #include <cstdio> #include <cmath> #include <math.h> #include <string> #include <string.h> #include <stack> #include <queue> #include <vector> #include <utility> #include <set> #include <map> #include <stdlib.h> #include <iomanip> using namespace std; #define ll long long #def...
In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = long long int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': ...
s531605944
p04047
C++
/********************** * AGC001 -A *********************************/ #include <iostream> int main() { int skewer_num = 0, ans = 0; std::cin >> skewer_num; skewer_num *= 2; int skewer_array[200]; for (int i = 0; i < skewer_num; ++i) { std::cin >> skewer_array[i]; } std::sort(skewer_arr...
a.cc: In function 'int main()': a.cc:13:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 13 | std::sort(skewer_array,skewer_array+skewer_num); | ^~~~ | qsort
s455774393
p04047
C++
/********************** * AGC001 -A *********************************/ #include <iostream> int main() { int skewer_num = 0, ans = 0; std::cin >> skewer_num; skewer_num *= 2; int skewer_array[skewer_num]; for (int i = 0; i < skewer_num; ++i) { std::cin >> skewer_array[i]; } std::sort(sk...
a.cc: In function 'int main()': a.cc:14:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 14 | std::sort(skewer_array,skewer_array + skewer_num); | ^~~~ | qsort
s693008885
p04047
Java
import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Scanner; public class Tester { public static void main(String[] args) { Scanner in = new Scanner(System.in); List<Integer> list = new ArrayList<>(); in.nextInt(); while(in.hasNextInt()) { list.add(in.ne...
Main.java:6: error: class Tester is public, should be declared in a file named Tester.java public class Tester { ^ 1 error
s421932171
p04047
C++
#include <iostream> #include <vector> using namespace std; int main() { int tmp, N, ans = 0; vector<int> L; cin >> N; for(int i=0;i<2*N;i++) { cin >> tmp; L.push_back(tmp); } sort(L.begin(), L.end()); for(int i=0;i<2*N;i+=2) { ans += L[i]; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(L.begin(), L.end()); | ^~~~ | short
s380308479
p04047
C++
QAQ
a.cc:1:1: error: 'QAQ' does not name a type 1 | QAQ | ^~~
s549559561
p04047
C++
//AGC 006-A #define _USE_MATH_DEFINES #include <iostream> #include <cmath> #include <stdlib.h> #include <algorithm> #include <cstdio> #include <vector> #include <cstring> #include <numeric> #include <string> #include <map> #include <sstream> using namespace std; int main(){ int N, MeatNum = 0; vector<int> L[20...
a.cc: In function 'int main()': a.cc:22:42: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 22 | for(int i = 0; i < 2*N; i++) cin >> L[i]; | ~~~ ^~ ~~~~ | ...
s170447836
p04047
C++
//AGC 006-A #define _USE_MATH_DEFINES #include <iostream> #include <cmath> #include <stdlib.h> #include <algorithm> #include <cstdio> #include <vector> #include <cstring> #include <numeric> #include <string> #include <map> #include <sstream> using namespace std; int main(){ int N, MeatNum = 0; vector<int> L[20...
a.cc: In function 'int main()': a.cc:22:42: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 22 | for(int i = 0; i < 2*N; i++) cin >> L[i]; | ~~~ ^~ ~~~~ | ...
s795618723
p04047
Java
import java.io.*; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.StringTokenizer; /** * Created by vikas.k on 25/12/16. */ public class A { public static void main(String[] args){ MyScanner sc = new MyScanner(); out = new PrintWriter(new Buffered...
Main.java:10: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s713692225
p04047
Java
import java.util.Scanner; import java.util.Arrays; public class AA{ public static void main(String[] args){ Scanner kbs=new Scanner(System.in); int kushi=kbs.nextInt(); int goukei=0; int[] nagasa=new int[2*kushi]; for(int i=0;i<2*kushi;i++){ nagasa[i]=kbs.nextInt(); } Arrays.sort(nagasa); for(int i=0;i<2*ku...
Main.java:4: error: class AA is public, should be declared in a file named AA.java public class AA{ ^ 1 error
s362279768
p04047
C++
#include <iostream> int main(){;int n,ans=0;cin>>n;vector<Int> v(2*n);for(int i=0;i<2*n;++i){cin>>v[i];} sort(v.begin(),v.end());for(int i=1;i<2*n;i+=2){ans+=v[i];}cout<<ans<<endl;}
a.cc:1:21: warning: extra tokens at end of #include directive 1 | #include <iostream> int main(){;int n,ans=0;cin>>n;vector<Int> v(2*n);for(int i=0;i<2*n;++i){cin>>v[i];} sort(v.begin(),v.end());for(int i=1;i<2*n;i+=2){ans+=v[i];}cout<<ans<<endl;} | ^~~ /usr/bin/ld: /usr/lib/gcc/x86_64-lin...
s858568345
p04047
C++
#include <iostream> #include<vector> using namespace std; int main(int argc, const char * argv[]) { int n = 0; int count = 0; vector<int> vec; cin >> n; int x = 0; // int i = 0; for (int j = 0; j< n*2 ; j++) { cin>>x; vec.push_back(x); } sort(vec.begin(),vec.end(...
a.cc: In function 'int main(int, const char**)': a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'? 17 | sort(vec.begin(),vec.end()); | ^~~~ | short
s853537640
p04047
C++
#include<bits/stdc++.h> using namespace std; int main() { cin >> n; vector<int> vec; for(int i(0); i < n; i++) { int x; cin >> x; vec.push_back(x); } int ans(0); sort(vec.begin(), vec.end()); for(int i(0); i + 1 < (int)vec.size(); i += 2) { ans += min(vec[i], vec[i + 1]); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:4:16: error: 'n' was not declared in this scope; did you mean 'yn'? 4 | cin >> n; | ^ | yn
s208753421
p04047
C++
n = int(raw_input()) l = map(int, raw_input().split()) l.sort() sum = 0 for i in range(0, n, 2): sum += i print sum
a.cc:1:1: error: 'n' does not name a type 1 | n = int(raw_input()) | ^
s180270918
p04047
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cstdio> #include <queue> #include "math.h" #include <complex> #include <iomanip> #define ifor(i,a,b) for (int i=(a);i<(b);i++) #define rfor(i,a,b) for (int i=(b)-1;i>=(a);i--) #define rep(i,n) for (int i=0;i<(n);i++) #define rrep(i,n...
a.cc: In function 'int main()': a.cc:28:18: error: expression cannot be used as a function 28 | cout << 3(N-gcd(N,X))<<endl; | ~^~~~~~~~~~~~
s203963174
p04047
C++
#include<iostream> #include<vector> #include<cstdio> #include<algorithm> using namespace std; vector<int> edge[2010]; int dis[2010]; bool used[2010]; int n, k; int main() { int a, b,ma=100000; cin >> n >> k; for (int i = 0; i < n - 1; i++) { scanf("%d %d", &a, &b); a--; b--; edge[a].push_back(b); edge[b].p...
a.cc: In function 'int main()': a.cc:22:25: error: 'evencalc' was not declared in this scope 22 | evencalc(i, i, 0); | ^~~~~~~~ a.cc:31:53: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp...
s683931842
p04047
C++
include <iostream> #include <algorithm> #include<functional> using namespace std; int main(void) { // Here your code ! int a, size; int ans = 0; cin >> a; size = a * 2; int *b = new int[size]; for (int i = 0; i < size; i++) cin >> b[i]; sort(b, b + size,greater<int>()); for (int j = 1; j <size;j=j+...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __...
s197932274
p04047
C++
#include <iostream> using namespace std; #define MAX_N 100 int N; int L[2*MAX_N]; int main(){ cin >> N; for(int i=0; i<2*N; i++) cin >> L[i]; sort(L, L+2*N); int sol=0; for(int i=0; i<N; i++) sol+=L[2*i]; cout << sol << endl; }
a.cc: In function 'int main()': a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(L, L+2*N); | ^~~~ | short
s253542781
p04047
C++
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<vector> #include<queue> #include<map> #include<list> #include<map> #include<stack> #include<cstdlib> #define P(p) cout << (p) << endl; #define rep(i, n) for(int i = 0; i < n; i++) using namespace std; int main(){ int n,num,sum = 0; ve...
a.cc: In function 'int main()': a.cc:27:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 27 | sort(v.begin(),v.end()); | ^~~~ | sqrt
s707396321
p04047
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; n *= 2; int l[n]; for(int i = 0; i < n; i++){ cin >> l[i]; } sort(l, l + n); int total = 0; for(int i = 0; i < n; i += 2){ total += min(l[i], l[i + 1]); } cout << total << endl; }
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(l, l + n); | ^~~~ | short
s119644285
p04047
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner s = new Scanner(System.in); int n = s.nextInt(); int ans = 0; int[] a = new int[2*n]; for(int i=0;i<2*n;i++) a[i] = s.nextInt(); Arrays.sort(a); for(int i=0;i<2n;i+=2) ans += Math.min(a[i],a[i+1]); System.out.println(ans); } }
Main.java:13: error: ';' expected for(int i=0;i<2n;i+=2) ans += Math.min(a[i],a[i+1]); ^ Main.java:13: error: ')' expected for(int i=0;i<2n;i+=2) ans += Math.min(a[i],a[i+1]); ^ Main.java:13: error: ';' expected for(int i=0;i<2n;i+=2) ans += Math.min(a[i],a[i+1]); ^ 3...
s509969054
p04047
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; int l[101]; for(int i=0; i<2*n; i++) cin >> l[i]; sort(l, l+2*n); int ret = 0; for(int i=0; i<n; i++) ret += min(l[2*i], l[2*i+1]); cout << ret << endl; }
a.cc: In function 'int main()': a.cc:8:5: error: 'sort' was not declared in this scope; did you mean 'short'? 8 | sort(l, l+2*n); | ^~~~ | short
s150328060
p04047
C++
#include <iostream> using namespace std; int main() { int n, a[205], ans = 0; cin >> n; n *= 2; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a+n); for (int i = 0; i < n; i += 2) ans += a[i]; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'short'? 9 | sort(a, a+n); | ^~~~ | short