submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s465948412
p03767
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (int)(n); i++) int main{ int N; cin >> N; vector<int> v(3*N); rep(i, N) cin >> v.at(i); sort(v.begin(), v.end(), greater<int>()); rep (i, N){ int sum += v.at(2*N); } cout << sum << endl; }
a.cc:5:5: error: cannot declare '::main' to be a global variable 5 | int main{ | ^~~~ a.cc:6:9: error: expected primary-expression before 'int' 6 | int N; | ^~~ a.cc:6:9: error: expected '}' before 'int' a.cc:5:9: note: to match this '{' 5 | int main{ | ^ a.cc:7...
s034049640
p03767
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (int)(n); i++) int main{ int N; cin >> N; vector<int> v(3*N); rep(i, N) cin >> v.at(i); sort(v.begin(), v.end(), greater<int>()); rep (i, N){ int sum += v.at(2*N); } cout << sum << endl; }
a.cc:5:5: error: cannot declare '::main' to be a global variable 5 | int main{ | ^~~~ a.cc:6:9: error: expected primary-expression before 'int' 6 | int N; | ^~~ a.cc:6:9: error: expected '}' before 'int' a.cc:5:9: note: to match this '{' 5 | int main{ | ^ a.cc:7...
s102333493
p03767
C++
n = int(input()) a = list(map(int, input().split())) a.sort() ans = 0 for i in range(n): ans += a[-(i+1)*2] print(ans)
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s051286906
p03767
C++
#include <bits/stdc++.h> #include <vector> #include <iostream> using namespace std; int main() { int N; cin >>N; vector<int> vec(3*N); for(int i=0;i < 3*N;i++){ cin >>vec[i]; } int sum =0; for(int i=0;i < 3*N;i++){ for(int j=0;j < 3*N && i != j;j++){ for(int k=0;k < 3*N && k != i && k != j;...
a.cc: In function 'int main()': a.cc:19:15: error: 'class std::vector<int>' has no member named 'erace'; did you mean 'erase'? 19 | vec.erace(vec.begin()+j); | ^~~~~ | erase a.cc:23:15: error: 'class std::vector<int>' has no member named 'erace'; did you mean 'erase'...
s752277674
p03767
C++
#include <bits/stdc++.h> #include <vector> using namespace std; int main() { int N; cin >>N; vector<int> vec(3*N); for(int i=0;i < 3*N;i++){ cin >>vec[i]; } int sum =0; for(int i=0;i < 3*N;i++){ for(int j=0;j < 3*N && i != j;j++){ for(int k=0;k < 3*N && k != i && k != j;k++){ if((ve...
a.cc: In function 'int main()': a.cc:18:15: error: 'class std::vector<int>' has no member named 'erace'; did you mean 'erase'? 18 | vec.erace(vec.begin()+j); | ^~~~~ | erase a.cc:22:15: error: 'class std::vector<int>' has no member named 'erace'; did you mean 'erase'...
s799449529
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >>N; vector<int> vec(3*N); for(int i=0;i < 3*N;i++){ cin >>vec[i]; } int sum =0; for(int i=0;i < 3*N;i++){ for(int j=0;j < 3*N && i != j;j++){ for(int k=0;k < 3*N && k != i && k != j;k++){ if((vec[i] <= vec[j] && ...
a.cc: In function 'int main()': a.cc:17:15: error: 'class std::vector<int>' has no member named 'erace'; did you mean 'erase'? 17 | vec.erace(vec.begin()+j); | ^~~~~ | erase a.cc:21:15: error: 'class std::vector<int>' has no member named 'erace'; did you mean 'erase'...
s649737554
p03767
C++
#include<iostream> #include<algorithm> using namespace std; using ll = long long; int main() { int n, a; cin >> n; vector<int> input(n*3); for (int i=0; i<n*3; ++i) { cin >> a; input[i] = a; } sort(input.begin(), input.end()); ll sum = 0; for (int i=n; i<n*3; i+=2) { ...
a.cc: In function 'int main()': a.cc:11:5: error: 'vector' was not declared in this scope 11 | vector<int> input(n*3); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include<algorithm> +++ |+#include <vector> ...
s160105531
p03767
C++
#include <iostream> # using namespace std; int main(){ int n; cin>>n; int a[3*n]; for(int i=0;i<3*n;i++){ cin>>a[i]; } int sum=0; for(int i=0;i<n;i++){ sort(a+3*i,a+3*i+2); sum+=a[3*i+1]; } cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(a+3*i,a+3*i+2); | ^~~~ | short
s358226221
p03767
C++
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ll N,A; cin >> N; ll sum = 0; vector<ll> array; for(ll i = 0;i < N*3;i++){ cin >> A; array.push_back(A); } sort(array.begin(),array.end()); for(int i = 1; i < 2*n+1; i += 2) sum += a[i]...
a.cc: In function 'int main()': a.cc:15:26: error: 'n' was not declared in this scope 15 | for(int i = 1; i < 2*n+1; i += 2) sum += a[i]; | ^ a.cc:15:46: error: 'a' was not declared in this scope 15 | for(int i = 1; i < 2*n+1; i += 2) sum += a[i]; | ...
s345301329
p03767
C++
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ll N,A; cin >> N; ll sum = 0; vector<ll> array; for(ll i = 0;i < N*3;i++){ cin >> A; array.push_back(A); } sort(array.begin(),array.end()); for(int i = 1; i < 2*n+1; i += 2) ans += a[i]...
a.cc: In function 'int main()': a.cc:15:26: error: 'n' was not declared in this scope 15 | for(int i = 1; i < 2*n+1; i += 2) ans += a[i]; | ^ a.cc:15:39: error: 'ans' was not declared in this scope; did you mean 'abs'? 15 | for(int i = 1; i < 2*n+1; i += 2) ans += a[i]; ...
s163275036
p03767
C++
N=int(input()) A=list(map(int,input().split())) A.sort(reverse=True) sm=[] count=0 for i in range(3*N): if count==N: break if i%2==1: sm.append(A[i]) count+=1 ans=sum(sm) print(ans)
a.cc:1:1: error: 'N' does not name a type 1 | N=int(input()) | ^
s076128067
p03767
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define double long double #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) #define fi first #define se second #define sz size() #define bgn begin() #define en end() #define pb push_b...
a.cc: In function 'int main()': a.cc:384:46: error: expected ')' before ';' token 384 | for(int i=a.size()-2; i>=a.size()-n*2; i-=2;){ | ~ ^ | ) a.cc:384:47: error: expected primary-expression before ')' token 384 ...
s013553833
p03767
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; int i,j=0;k=0; cin>>N; vector<int> vec(3*N); int countA=0; for(i=0;i<3*N;i++ ){ cin>>vec.at(i); } sort(vec.begin(),vec.end()); i=3*N-1; while(k<N){ if(j%2!=0){ countA+=vec.at(i); k++;} i--; j...
a.cc: In function 'int main()': a.cc:5:15: error: 'k' was not declared in this scope 5 | int i,j=0;k=0; | ^
s604932745
p03767
C++
#include <iostream> #include <algorithm> using namespace std; int main () { int N; cin >> N; vector<int> a(3 * N, 0); for (int i=0;i<N*3;++i) { cin >> a[i]; } sort(a.begin(), a.end(), greater<int>()); long sum = 0; for (int i=0;i<N;++i) { sum += a[2 * i + 1]; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:8:3: error: 'vector' was not declared in this scope 8 | vector<int> a(3 * N, 0); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <algorithm> +++ |+#include <vector> 3 ...
s183169369
p03767
C++
#include<iostream> #include <string> #include <vector> #include <algorithm> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define INF 1000000; using ll = long long; using namespace std; int main(){ int n; cin >> n; int tri=3*n ll a[tri]; rep(i, tri) cin >> a[i]; sort(a, a+tri); rep(i, t...
a.cc: In function 'int main()': a.cc:14:5: error: expected ',' or ';' before 'll' 14 | ll a[tri]; | ^~ a.cc:15:24: error: 'a' was not declared in this scope 15 | rep(i, tri) cin >> a[i]; | ^ a.cc:16:10: error: 'a' was not declared in this scope 16 | sort(a, a+...
s533040949
p03767
C++
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> /*using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) v.begin(), v.end() #define allr(v) v.rbegin(), v.rend()*/ int main() { long long int n, ans = 0; scanf("%lld", &n); vector<long long int> a(3 * n); ...
a.cc: In function 'int main()': a.cc:15:3: error: 'vector' was not declared in this scope 15 | vector<long long int> a(3 * n); | ^~~~~~ a.cc:15:3: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, fro...
s388156739
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin>>N; vector<int> p(3N); for (int i = 0; i < 3N; i++) { cin >> p.at(i); } sort(p.begin(), p.end()); int Z=0; for(int i=N;i<2N;i++){ Z+=p.at(i); } cout<<Z<<endl; }
a.cc: In function 'int main()': a.cc:7:17: error: unable to find numeric literal operator 'operator""N' 7 | vector<int> p(3N); | ^~ a.cc:8:21: error: unable to find numeric literal operator 'operator""N' 8 | for (int i = 0; i < 3N; i++) { | ^~ a.cc:13:17: error:...
s099125267
p03767
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int N = 3 * n; vector<int> a(N); for (int i = 0; i < N; i++) cin >> a[i]; sort(a.begin(), a.end(), greater<int>()); int ans = 0; for (int i = 1; i <= n; i++){ int m = 2 * i - 1 ans += a[m]; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:14:5: error: expected ',' or ';' before 'ans' 14 | ans += a[m]; | ^~~
s156069723
p03767
C++
#include<iostream> #include<vector> #include<algorithm> usnig namespace std; int main(){ int N; cin>>N; vector<int>a; for(int i=0;i<3N;i++){ int x; cin>>x; a.push_back(x);} sort(a.begin(),a.end()); int res=0; for(int i=3N-1;i>2N-1;i--){ res+=a[i];} cout>>res; }
a.cc:4:1: error: 'usnig' does not name a type 4 | usnig namespace std; | ^~~~~ a.cc: In function 'int main()': a.cc:7:1: 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/include/c++/14/iostream:62:18: note: 's...
s426165873
p03767
C++
#include <bits/stdc++.h> #define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) #define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++) #define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--) #define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--) #define ALL(v) (v).begin(),(v).end() #define MOD 100000...
a.cc: In function 'int main()': a.cc:54:3: error: 'intm' was not declared in this scope; did you mean 'int'? 54 | intm = n*3 ; | ^~~~ | int a.cc:55:18: error: 'm' was not declared in this scope 55 | vector<ll> vec(m) ; | ^
s819471910
p03767
C++
#include <bits/stdc++.h> #define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) #define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++) #define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--) #define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--) #define ALL(v) (v).begin(),(v).end() #define MOD 100000...
a.cc: In function 'int main()': a.cc:54:3: error: 'intm' was not declared in this scope; did you mean 'int'? 54 | intm = n*3 ; | ^~~~ | int a.cc:55:18: error: 'm' was not declared in this scope 55 | vector<ll> vec(m) ; | ^
s849213061
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, sum; sum = 0; cin >> N; vector<int> player(3*N); for(int i = 0; i < 3*N; i++){ cin >> player.at(i); } sort(player.begin(), player.end()); reverse(player.begin(), player.end()); int j = N; for(int i = 1; i < N, j++){ sum +=...
a.cc: In function 'int main()': a.cc:15:28: error: expected ';' before ')' token 15 | for(int i = 1; i < N, j++){ | ^ | ;
s978409744
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, sum; sum = 0; cin >> N; vector<int> player(3*N); for(int i = 0; i < 3*N; i++){ cin >> player.at(i); } sort(player.begin(), player.end()); reverse(player.begin(), player.end()); int j = N; for(int i = 1; i < N, j++){ sum ...
a.cc: In function 'int main()': a.cc:15:28: error: expected ';' before ')' token 15 | for(int i = 1; i < N, j++){ | ^ | ;
s505589757
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, sum; sum = 0; cin >> N; vector<int> player(3*N); for(int i = 0; i < 3*N; i++){ cin >> player.at(i); } sort(player.begin(), player.end()); reverse(player.begin(), player.end()); int j = N; for(int i = 1; i < N, i){ sum +=...
a.cc: In function 'int main()': a.cc:15:26: error: expected ';' before ')' token 15 | for(int i = 1; i < N, i){ | ^ | ;
s017964261
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, sum; sum = 0; cin >> N; vector<int> player(3*N); for(int i = 0; i < 3*N; i++){ cin >> player.at(i); } sort(player.begin(), player.end()); reverse(player.begin(), player.end()); int j = N; for(int i = 1; i < N){ sum += pl...
a.cc: In function 'int main()': a.cc:15:23: error: expected ';' before ')' token 15 | for(int i = 1; i < N){ | ^ | ;
s414310121
p03767
C++
#include<iostream> #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n ; int a[3*n] ; for(int i=0;i<3*n;i++) cin >> a[i] ; sort(a,a+3*n,greater<int>) ; int ans =0; for(int i=0;i<=2*n;i++){ if(i%2==0)ans+=a[i]; } cout << ans << endl ; return 0; }
a.cc: In function 'int main()': a.cc:14:28: error: expected primary-expression before ')' token 14 | sort(a,a+3*n,greater<int>) ; | ^
s581877229
p03767
C++
include <bits/stdc++.h> #define rep(i,c) for(int i = 0; i < (int)c; ++i) using llint = long long int ; using namespace std; int main(){ int N; cin>>N; vector<int> a(3); rep(i,3*N)cin>>a[i]; sort(a.begin(),a.begin()+3*N,greater<int>()); llint ans=0; for (int i = 1; i < 2*N; ) { ...
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:10:5: error: 'cin' was not declared in this scope 10 | cin>>N; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#in...
s540859650
p03767
C++
#include <bits/stdc++.h> using namespace std; long long ans, res; long long n, m; long long a[3e5 + 21]; int main() { cin >> n; m = n * 3; for (int i = 1; i <= m; i++) cin >> a[i]; for (int i = 2; i <= m; i += 3) ans += a[i]; for (int i = n + 1; i <= 2 * n; i++) res += a[i]; cout <...
a.cc:6:17: error: conversion from 'double' to 'long unsigned int' in a converted constant expression 6 | long long a[3e5 + 21]; | ~~~~^~~~ a.cc:6:17: error: could not convert '(3.0e+5 + (double)21)' from 'double' to 'long unsigned int' 6 | long long a[3e5 + 21]; | ~~~~^~~~ ...
s209224453
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> a(3*N); for (int i= 0; i < 3*N; i++) { cin >> a.at(i); } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); int64 sum = 0; for (int i = 1; i < 2*N; i+=2) { sum += a.at(i); } cout << sum << endl;...
a.cc: In function 'int main()': a.cc:14:3: error: 'int64' was not declared in this scope 14 | int64 sum = 0; | ^~~~~ a.cc:16:5: error: 'sum' was not declared in this scope 16 | sum += a.at(i); | ^~~ a.cc:18:11: error: 'sum' was not declared in this scope 18 | cout << sum << endl; ...
s725546670
p03767
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N;cin>>N;long long int x=0; vector<int>a(3*N); for(int i=0;i<3*N;i++)cin>>A.at(i); sort(A.begin(),A.end()); for(int i=N;i<2*N;i++)x+=A.at(i); cout<<x<<endl; }
a.cc: In function 'int main()': a.cc:6:30: error: 'A' was not declared in this scope 6 | for(int i=0;i<3*N;i++)cin>>A.at(i); | ^ a.cc:7:8: error: 'A' was not declared in this scope 7 | sort(A.begin(),A.end()); | ^
s711768891
p03767
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for(int i=0;i<(int)(n);++i) int main() { ios::sync_with_stdio(false); cin.tie(0); ll n; cin >> n; vector<ll> vec(3 * n); for (ll i = 0; i < 3 * n; ++i) { cin >> vec[i]; } sort(vec.begin(), vec.end()); ll ans = 0...
a.cc: In function 'int main()': a.cc:18:12: error: 'a' was not declared in this scope 18 | ans += a[j]; | ^
s170027360
p03767
C++
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; int main() { int n,ans=0; vector<int> a(100010); for(int i=0;i<3*n;i++)cin >> a[i]; sort(a,a+n,); for(int i=n;i<2*n;i++){ ans+=a[i]; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:13: error: no match for 'operator+' (operand types are 'std::vector<int>' and 'int') 10 | sort(a,a+n,); | ~^~ | | | | | int | std::vector<int> In file included from /usr/include/c++/14/bits/stl_algobase.h:...
s077332169
p03767
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { long long N; cin >> N; long long N3 = N * 3; long a[N3]; for (int i = 0; i < N * 3; i++) { cin >> a[i]; } sort(a, a + N3, greater<long long>()); //vectorにするとa+N3ができない。 long long ans = 0; for (int i =...
a.cc:17:11: error: extended character   is not valid in an identifier 17 | sort(a, a + N3, greater<long long>()); //vectorにするとa+N3ができない。 | ^ a.cc:17:15: error: extended character   is not valid in an identifier 17 | sort(a, a + N3, greater<long long>()); //vectorにするとa+N3ができない。 | ...
s496623350
p03767
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; int a[3*N]; for (int i=0; i < 3*N; i++) cin >> a[i]; sort(a, a+3*N); int sum=0; for(int i=N; i<2*N; i++){ sum += a[i]; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a, a+3*N); | ^~~~ | short
s502280483
p03767
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; int a[3*N]; for (int i=0; i < 3*N; i++) cin >> a[i]; sort(a, a+3*N, greater<int>()); int sum=0; for(int i=N; i<2*N; i++){ sum += a[i]; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a, a+3*N, greater<int>()); | ^~~~ | short
s012892107
p03767
Java
import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long sum = 0; long[] scoreList = new long[N*3 +100]; for(int i =0; i < N*3; i++) scoreList[i] = sc.nextLong(); Arrays...
Main.java:13: error: cannot find symbol for(i = N; i < N*2; i++){ ^ symbol: variable i location: class Main Main.java:13: error: cannot find symbol for(i = N; i < N*2; i++){ ^ symbol: variable i location: class Main Main.java:13: error: cannot find symbol for(i = N; i < N*...
s540422898
p03767
Java
import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long sum = 0; long[] scoreList = new long[N*3 +100]; for(int i =0; i < N*3; i++) long[i] = sc.nextLong(); Arrays.sort...
Main.java:10: error: ']' expected long[i] = sc.nextLong(); ^ Main.java:10: error: ';' expected long[i] = sc.nextLong(); ^ Main.java:13: error: ';' expected for(i = N; i < 2N; i++){ ^ Main.java:13: error: ')' expected for(i = N; i < 2N; i++){ ...
s929368844
p03767
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; long long numTeam = n * 3; vector<long long> a(numTeam); long long ans = 0; for (long long i = 0; i < numTeam; i++) cin >> a.at(i); sort(a.begin(), a.end()); for (long long i = n + 1; i < 2n + 1; i++){ ...
a.cc: In function 'int main()': a.cc:14:35: error: unable to find numeric literal operator 'operator""n' 14 | for (long long i = n + 1; i < 2n + 1; i++){ | ^~
s195562647
p03767
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int numTeam = n * 3; vector<long long> a(numTeam); long long ans = 0; for (int i = 0; i < numTeam; i++) cin >> a.at(i); sort(a.begin(), a.end()); for (int i = n + 1; i < 2n + 1; i++){ ans += a.a...
a.cc: In function 'int main()': a.cc:14:29: error: unable to find numeric literal operator 'operator""n' 14 | for (int i = n + 1; i < 2n + 1; i++){ | ^~
s618984504
p03767
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main(void){ int n; cin >> n; int a[3*n]; for(int i=0;i<n;++i){ cin >> a[i]; } std::sort(a,a+n,greater<int>()); int sum1=0; for(int i=0;i<2*n;++i){ if(i%2==1){ sum1 += a[i]; } cout << sum1 <<endl; ret...
a.cc: In function 'int main()': a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:5:15: note: to match this '{' 5 | int main(void){ | ^
s420356183
p03767
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main(void){ int n; cin >> n; int a[3*n]; for(int i=0;i<n;++i){ cin >> a[i]; } std::sort(v,v+n,greater<int>()); int sum1=0; for(int i=0;i<2*n;++i){ if(i%2==1){ sum1 += a[i]; } cout << sum1 <<endl; ret...
a.cc: In function 'int main()': a.cc:12:14: error: 'v' was not declared in this scope 12 | std::sort(v,v+n,greater<int>()); | ^ a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:5:15: note: to match this '{' 5 | int main(void){ | ^
s386059526
p03767
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main(void){ int n; cin >> n; int v[3*n]; for(int i=0;i<n;++i){ cin >> a[i]; } std::sort(v,v+n,greater<int>()); int sum1=0; for(int i=0;i<2*n;++i){ if(i%2==1){ sum1 += a[i]; } cout << sum1 <<endl; ret...
a.cc: In function 'int main()': a.cc:10:18: error: 'a' was not declared in this scope 10 | cin >> a[i]; | ^ a.cc:16:25: error: 'a' was not declared in this scope 16 | sum1 += a[i]; | ^ a.cc:20:2: error: expected '}' at end of input ...
s054426233
p03767
C++
#include <bits/stdc++.h> #define REP(i, n) for(ll i = 0; i < (ll)n; i++) #define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF (1ll << 60) #define sz(x) int(x.size()) using namespace std; typedef long long ll; using vl = vector<ll>; using vvl = vector<vl>; typedef ...
a.cc: In function 'int main()': a.cc:45:30: error: 'i' was not declared in this scope 45 | REP(N, 2 * N) { ans += A[i]; } | ^
s342976133
p03767
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<long int> a(3 * n); for(int i = 0; i < 3 * n; i++){ cin >> a.at(i); } sort<a.begin(),a.end()>; long int out = 0; for(int i = 0; i < n; i++){ out += a.at(i * 3 + 1); } cout << out; }
a.cc: In function 'int main()': a.cc:11:15: error: call to non-'constexpr' function 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::begin() [with _Tp = long int; _Alloc = std::allocator<long int>; iterator = std::vector<long int>::iterator]' 11 | sort<a.begin(),a.end()>; | ~~~~~~~^~ In f...
s142103641
p03767
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<long int> a(n); for(int i = 0; i < 3 * n; i++){ cin >> a.at(i); } sort<a.begin(),a.end()>; long int out = 0; for(int i = 0; i < n; i++){ out += a.at(i * 3 + 1); } cout << out; }
a.cc: In function 'int main()': a.cc:11:15: error: call to non-'constexpr' function 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::begin() [with _Tp = long int; _Alloc = std::allocator<long int>; iterator = std::vector<long int>::iterator]' 11 | sort<a.begin(),a.end()>; | ~~~~~~~^~ In f...
s847742023
p03767
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int n; cin >> n; vector<int>a(3*n); for (auto&& x : a)cin >> x; sort(a.begin(), a.end()); long long ans = 0; for (int i = 3 * n - 2, cnt = 0; cnt < n; i -= 2, cnt++) { ans += a[i]; } cout << ans << endl; return 0;
a.cc: In function 'int main()': a.cc:16:18: error: expected '}' at end of input 16 | return 0; | ^ a.cc:6:12: note: to match this '{' 6 | int main() { | ^
s540724110
p03767
C++
#include <bits/stdc++.h> #define REP(i, k, n) for(int i=(k); i<(n); i++) using namespace std; int main() { int N; cin >> N; vector<long long> a(3*N); REP(i, 0, 3*N) cin >> a.at(i); sort(a.begin(), a.end(), greater<int>); long long ans = 0; REP(i, 0, N) ans += a.at(N+i+1); cout << ans << endl; return ...
a.cc: In function 'int main()': a.cc:10:40: error: expected primary-expression before ')' token 10 | sort(a.begin(), a.end(), greater<int>); | ^
s330051673
p03767
C++
#include<iostream> #include<vector> #include<algorithm> int main () { int N; std::cin >> N; std::vector<int> data(3*N); for (int i=0; i<3*N; i++) { std::cin >> data.at(i); } std::sort(data.begin(), data.rend()); int sum = 0; for (int i=1; i<2*N+1; i+=2) { sum += data.at(i); } std::cout << s...
a.cc: In function 'int main()': a.cc:12:12: error: no matching function for call to 'sort(std::vector<int>::iterator, std::vector<int>::reverse_iterator)' 12 | std::sort(data.begin(), data.rend()); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, ...
s945181714
p03767
Java
package AGC_A; import java.util.Arrays; import java.util.Scanner; public class AtCoderGroupContest { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); Long[] a = new Long[N*3]; for(int i = 0; i < N*3 ;i++) { a[i] = sc.nextLong(); } Arrays.sort(a)...
Main.java:6: error: class AtCoderGroupContest is public, should be declared in a file named AtCoderGroupContest.java public class AtCoderGroupContest { ^ 1 error
s735592011
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int a[n]; for (int i =0; i < n * 3; ++i) cin >> a[i]; sort(a, a + n, greater<int>()); int cnt = 0; int cur = n * 3 - 2; long long ans = 0; while (cnt < n) { ans += a[cur] cnt++; cur -= 2; } cout << ans...
a.cc: In function 'int main()': a.cc:17:18: error: expected ';' before 'cnt' 17 | ans += a[cur] | ^ | ; 18 | cnt++; | ~~~
s571842568
p03767
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) int int_len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int int_sum(int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10; return m; }...
a.cc: In function 'int main()': a.cc:31:7: error: 'ans' was not declared in this scope; did you mean 'abs'? 31 | ans+=v[i*3+1]; | ^~~ | abs a.cc:33:7: error: 'ans' was not declared in this scope; did you mean 'abs'? 33 | ans+=v[i*3+2]; | ^~~ | abs a.cc:3...
s264183129
p03767
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (int)n; i++) #define rep2(i, m, n) for(int i = (int)m; i < (int)n; i++) typedef unsigned long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<vi> vii; //2次元配列 typedef vector<ll> vll; typedef vector<string> vs; ...
a.cc: In function 'int main()': a.cc:26:21: error: expected ';' before '<' token 26 | for(int i = n, i < (2*n)-1; i += 2) cnt += a[i]; | ^~ | ; a.cc:26:22: error: expected primary-expression before '<' token 26 | for(int i = n, i < (2*n)-1; i += 2) cnt +...
s664874427
p03767
C++
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef unsigned long long ull; #define int ll typedef vector<vector<pair<int, int> > > vvp; typedef vector<pair<int, int> > vp; typedef vector<vector<int> > vvi; typedef vector<int> vi; typedef vector<vector<ll> > vvl; typedef vector<ll> vl; typedef v...
a.cc:5:13: error: '::main' must return 'int' 5 | #define int ll | ^~ a.cc:222:1: note: in expansion of macro 'int' 222 | int main() { | ^~~
s068814687
p03767
C++
#include<bits/stdc++.h> using namespace std; int n,a,cnt=0; vector<int> v; int main(){ scanf("%d",&n); for(int i=1;i<3*n;i++){ scanf("%d",&a); v.push_back(-a); } sort(v.begin(),v.end()); for(int i=0;i<v.size();i++){ v[i]=-v[i]; } for(int i=1;i<=n;i++){ cnt+=[2*i-1]; } printf("%d",cnt); }
a.cc: In function 'int main()': a.cc:16:23: error: expected identifier before numeric constant 16 | cnt+=[2*i-1]; | ^ a.cc: In lambda function: a.cc:16:29: error: expected '{' before ';' token 16 | cnt+=[2*i-1]; | ^ a.cc...
s535496107
p03767
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, j, n) for (ll i = j; i < n; i++) #define all(x) (x).begin(),(x).end() #define INF (1000000000) #define MOD (1000000007) #define MAX (100000) #define pii pair<int, int> ///////////////////////////////////////////////////////// class XY{...
a.cc: In function 'void Main()': a.cc:60:13: error: expected ',' or ';' before ':' token 60 | ll res = 0: | ^ a.cc:61:7: error: 'i' was not declared in this scope 61 | rep(i, 0, N){ | ^ a.cc:4:37: note: in definition of macro 'rep' 4 | #define rep(i, j, n) for (ll i = j; i < ...
s601093958
p03767
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, j, n) for (ll i = j; i < n; i++) #define all(x) (x).begin(),(x).end() #define INF (1000000000) #define MOD (1000000007) #define MAX (100000) #define pii pair<int, int> ///////////////////////////////////////////////////////// class XY{...
a.cc: In function 'void Main()': a.cc:58:27: error: expected primary-expression before ')' token 58 | sort(all(A), greater<ll>); | ^ a.cc:60:13: error: expected ',' or ';' before ':' token 60 | ll res = 0: | ^ a.cc:61:7: error: 'i' was not declared in this sco...
s500705356
p03767
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, j, n) for (ll i = j; i < n; i++) #define all(x) (x).begin(),(x).end() #define INF (1000000000) #define MOD (1000000007) #define MAX (100000) #define pii pair<int, int> ///////////////////////////////////////////////////////// class XY{...
a.cc: In function 'void Main()': a.cc:58:27: error: expected primary-expression before ')' token 58 | sort(all(A), greater<ll>) | ^ a.cc:61:7: error: 'i' was not declared in this scope 61 | rep(i, 0, N){ | ^ a.cc:4:37: note: in definition of macro 'rep' 4 | #def...
s531941906
p03767
C++
#include<iostream> using namespace std ; void Sort(int length[], int N){ int i,j,k,m ; for(i=1;i<N;i++){ k=i ; m=length[i] ; j=i-1 ; while(length[j]<m && j>=0){ length[j+1] = length[j] ; j-- ; } length[j+1] = m ; } } int main(){ int N,i,sum=0; int a[300001] ; cin >> N...
a.cc: In function 'int main()': a.cc:31:15: error: invalid operands of types '__complex__ int' and 'int' to binary 'operator<' 31 | for(i=0;3i+1<3*N;i++){ | ^~~~ | | | int a.cc:32:18: error: invalid types 'int [300001][__complex__ int]' for array subs...
s406025632
p03767
C++
#include<iostream> using namespace std ; void Sort(int length[], int N){ int i,j,k,m ; for(i=1;i<N;i++){ k=i ; m=length[i] ; j=i-1 ; while(length[j]<m && j>=0){ length[j+1] = length[j] ; j-- ; } length[j+1] = m ; } } int main(){ int N,i,sum=0; int a[300001] ; cin >> N...
a.cc: In function 'int main()': a.cc:31:15: error: invalid operands of types '__complex__ int' and 'int' to binary 'operator<' 31 | for(i=0;3i+1<3*N;i++){ | ^~~~ | | | int a.cc:32:18: error: invalid types 'int [300001][__complex__ int]' for array subs...
s241057426
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; int a[3*n];for(int i=0;i<3*n;i++)cin>>a[i]; sort(a,a+(3*n)); int score = 0; for(int i=0;i<=2*n;i++){((i%2==0&&i>0)?score+=a[i]:);} cout<<score<<endl; }
a.cc: In function 'int main()': a.cc:8:54: error: expected primary-expression before ')' token 8 | for(int i=0;i<=2*n;i++){((i%2==0&&i>0)?score+=a[i]:);} | ^
s341319386
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; int a[3*n];for(int i=0;i<3*n;i++)cin>>a[i]; sort(a,a+(3*n)); int score = 0; for(int i=0;i<3*n;i++){((i%2==0&&i>0)?score+=a[i]:);} cout<<score<<endl; }
a.cc: In function 'int main()': a.cc:8:53: error: expected primary-expression before ')' token 8 | for(int i=0;i<3*n;i++){((i%2==0&&i>0)?score+=a[i]:);} | ^
s940967687
p03767
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int N; cin>>N; vector<int> L(3N); for (int i=0;i<3N;++i){ cin>>L[i]; } sort(L.begin(),L.end()); int ans=0; for (int i=N;i<2N;++i){ ans+=L[i]; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:8:17: error: unable to find numeric literal operator 'operator""N' 8 | vector<int> L(3N); | ^~ a.cc:9:18: error: unable to find numeric literal operator 'operator""N' 9 | for (int i=0;i<3N;++i){ | ^~ a.cc:14:18: error: unable ...
s167092440
p03767
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int N; cin>>N; vector<int> L(3N); for (int i=0;i<3N;++i){ cin>>L[i]; } sort(L.begin(),L.end()); int ans=0+ for (int i=N;i<2N;++i){ ans+=L[i]; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:8:17: error: unable to find numeric literal operator 'operator""N' 8 | vector<int> L(3N); | ^~ a.cc:9:18: error: unable to find numeric literal operator 'operator""N' 9 | for (int i=0;i<3N;++i){ | ^~ a.cc:14:3: error: expected...
s404726664
p03767
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; using ll = long long; int main() { ll n; cin >> n; vector<int> a(3 * n); for (int i = 0; i < 3 * n; i++) { cin >> a[i]; } ll ans = 0; sort(a.begin(), a.end()); for (int i = n; i < 3 * n; i+=2) { ans += a[i]; } cout << ans << e...
a.cc: In function 'int main()': a.cc:23:18: error: expected '}' at end of input 23 | return 0; | ^ a.cc:8:12: note: to match this '{' 8 | int main() { | ^
s546079471
p03767
C++
int main() { int n; cin >> n; vector<int> l(3*n); for (auto &c:l) {cin >> c;} sort(l.begin(),l.end()); long long count=0; for (int i=0;i<n;i++) {count += l[3*n-2-2*i];} cout << count << endl; return 0;
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> n; | ^~~ a.cc:4:5: error: 'vector' was not declared in this scope 4 | vector<int> l(3*n); | ^~~~~~ a.cc:4:12: error: expected primary-expression before 'int' 4 | vector<int> l(3*n...
s331759106
p03767
Java
import java.util.*; class AtCoder_Group_Contest { public static void main(String[] args) { Scanner sc = new Scanner("10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...
Main.java:20: error: class, interface, enum, or record expected }import java.util.*; ^ 1 error
s937183549
p03767
C++
#include <bits/stdc++.h> using namespace std; int main(void){ int n; cin >> n; vector<int> v(n * 3); for(int i = 0; i < (n * 3); i++) { cin >> v.at(i); } sort(v.begin(), v.end(), greater<int>()); long ans = 0; for(int i = 0; i < n * 2; i++) { if(i % 2 != 0) { ans += v.at(i); ...
a.cc: In function 'int main()': a.cc:22:23: error: expected '}' at end of input 22 | cout << ans << endl; | ^ a.cc:4:15: note: to match this '{' 4 | int main(void){ | ^
s148472908
p03767
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >> N; vector<int> vec(N*3); for(auto& v : vec){ cin >> v; } sort(vec.begin(), vec.end(), greater<int>()); int ans = 0; int count = N; bool second = false; for(auto& v : vec){ if(second == false){ second ...
a.cc: In function 'int main()': a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(vec.begin(), vec.end(), greater<int>()); | ^~~~ | short
s722889935
p03767
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >> N; vector<int> vec(N); for(auto& v : vec){ cin >> v; } sort(vec.begin(), vec.end(), greater<int>()); int ans = 0; int count = N; bool second = false; for(auto& v : vec){ if(second == false){ second =...
a.cc: In function 'int main()': a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(vec.begin(), vec.end(), greater<int>()); | ^~~~ | short
s357184912
p03767
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) using namespace std; int main() { int n; cin >> n; vector<int> a(3*n); rep(i,3*n) cin >> a[i]; sort(a.begin(),a.end()); reverse(a.begin,a.end()); int sum=0; rep(i,n){ sum+=a[2*i]; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:10:12: error: no matching function for call to 'reverse(<unresolved overloaded function type>, std::vector<int>::iterator)' 10 | reverse(a.begin,a.end()); | ~~~~~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/i...
s381742265
p03767
C++
#include<bits/stdc++.h> using namespace std; typedef long long Int; int main(){ Int n; cin >> n; vector<Int> a(n); for(Int i = 0; i < 3*n; i++) cin >> a[i]; sort(a,a+3*n); Int ans = 0; int cnt = 0; for(Int i = 3*n-2; i >= 0; i -= 2){ if(cnt == n) brea...
a.cc: In function 'int main()': a.cc:11:17: error: no match for 'operator+' (operand types are 'std::vector<long long int>' and 'Int' {aka 'long long int'}) 11 | sort(a,a+3*n); | ~^~~~ | | | | | Int {aka long long int} | st...
s628914613
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n; cin >> n; vector<long long> a(n); for(long long i = 0; i < 3*n; i++) cin >> a[i]; sort(a.begin(),a.end()); Int ans = 0; int cnt = 0; for(long long i = 3*n-2; i >= 0; i -= 2){ ...
a.cc: In function 'int main()': a.cc:11:9: error: 'Int' was not declared in this scope; did you mean 'int'? 11 | Int ans = 0; | ^~~ | int a.cc:15:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 15 | ans += a[i]; | ^~~ ...
s396110561
p03767
C++
int main(){ long long n; cin >> n; vector<long long> a(n); for(long long i = 0; i < 3*n; i++) cin >> a[i]; sort(a.begin(),a.end()); Int ans = 0; int cnt = 0; for(long long i = 3*n-2; i >= 0; i -= 2){ if(cnt == n) break; ans +...
a.cc: In function 'int main()': a.cc:3:9: error: 'cin' was not declared in this scope 3 | cin >> n; | ^~~ a.cc:4:9: error: 'vector' was not declared in this scope 4 | vector<long long> a(n); | ^~~~~~ a.cc:4:16: error: expected primary-expression before 'long' 4 | ...
s863683299
p03767
C++
int main(){ cin >> n; vector<long long> a(n); for(long long i = 0; i < 3*n; i++) cin >> a[i]; sort(a.begin(),a.end()); Int ans = 0; int cnt = 0; for(long long i = 3*n-2; i >= 0; i -= 2){ if(cnt == n) break; ans += a[i]; ...
a.cc: In function 'int main()': a.cc:2:9: error: 'cin' was not declared in this scope 2 | cin >> n; | ^~~ a.cc:2:16: error: 'n' was not declared in this scope 2 | cin >> n; | ^ a.cc:3:9: error: 'vector' was not declared in this scope 3 | vector<long...
s577459344
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<int> a(3*N); int ans = 0; int cnt = 0; for(int i = 0; i < 3*N; i++){ cin >> a[i]; } sort(a.begin(),a.end()); for(int i = 3N -2; i >= 0 ; i -=2){ if(cnt == N){ break; } ans += a[i]; cnt+...
a.cc: In function 'int main()': a.cc:16:15: error: unable to find numeric literal operator 'operator""N' 16 | for(int i = 3N -2; i >= 0 ; i -=2){ | ^~
s260726443
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> 3*N; vector<int> a(3*N); int ans = 0; int cnt = 0; for(int i = 0; i < 3*N; i++){ cin >> a[i]; } sort(a.begin(),a.end(),greater<int>()); for(int i = 0; i < 3*N; i++){ if(i % 2 == 1){ ans += a[i]; cnt++; }...
a.cc: In function 'int main()': a.cc:6:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin >> 3*N; | ~~~ ^~ ~~~ | | | | | int | std::istream {aka std::basic_istream<char>} In file included from /usr/i...
s994663296
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<int> a(N); int ans = 0; int cnt = 0; for(int i = 0; i < N; i++){ cin >> a[i]; } sort(a.begin(),a.end(),greater<int>()); for(int i = 0; i < N; i++){ if(i % 2 = 1){ ans += a[i]; cnt++; } if(c...
a.cc: In function 'int main()': a.cc:17:10: error: lvalue required as left operand of assignment 17 | if(i % 2 = 1){ | ~~^~~
s684271877
p03767
C++
#include <stdio.h> #include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int main(){ int n; cin >> n; int a[3*n]; for (int i=0;i<3*n;++i) cin >> a[i]; sort(a.begin(),a.end()); int sum = 0; for (int i=1;i<n;++i) sum += a[3*i-2]; cout << sum << e...
a.cc: In function 'int main()': a.cc:13:16: error: request for member 'begin' in 'a', which is of non-class type 'int [(n * 3)]' 13 | sort(a.begin(),a.end()); | ^~~~~ a.cc:13:26: error: request for member 'end' in 'a', which is of non-class type 'int [(n * 3)]' 13 | sort(a.beg...
s573849047
p03767
C++
#include <stdio.h> #include <iostream> #include <vector> #include <string> using namespace std; int main(){ int n; cin >> n; vector<int> a(3*n); for (int i=0;i<3*n;++i) cin >> a[i]; sort(a.begin(),a.end()); int sum = 0; for (int i=1;i<n;++i) sum += a[3*i-2]; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a.begin(),a.end()); | ^~~~ | short
s636529477
p03767
C++
#include <stdio.h> #include <iostream> #include <vector> #include <string> using namespace std; int main(){ int n; cin >> n; vector(int) a(3*n); for (int i=0;i<3*n;++i) cin >> a[i]; sort(a.begin(),a.end()); int sum = 0; for (int i=1;i<n;++i) sum += a[3*i-2]; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:10:11: error: missing template arguments before '(' token 10 | vector(int) a(3*n); | ^ a.cc:10:12: error: expected primary-expression before 'int' 10 | vector(int) a(3*n); | ^~~ a.cc:11:36: error: 'a' was not declared in this scope 1...
s332955263
p03767
C++
int main(){ int n; cin >> n; vector(int) a(3*n); for (int i=0;i<3*n;++i) cin >> a[i]; int sum = 0; for (int i=1;i<n;++i) sum += a[3*i-2]; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> n; | ^~~ a.cc:4:12: error: expected primary-expression before 'int' 4 | vector(int) a(3*n); | ^~~ a.cc:4:5: error: 'vector' was not declared in this scope 4 | vector(int) a...
s906502253
p03767
C++
#include <stdio.h> #include <iostream> #include <vector> #include <string> using namespace std; int main(){ int n; cin >> n; int a[1000000000]; for (int i=0;i<3*n;++i) cin >> a[i]; sort(a.begin(),a.end()); int sum = 0; for (int i=1;i<n;++i) sum += a[3*i-2]; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:12:16: error: request for member 'begin' in 'a', which is of non-class type 'int [1000000000]' 12 | sort(a.begin(),a.end()); | ^~~~~ a.cc:12:26: error: request for member 'end' in 'a', which is of non-class type 'int [1000000000]' 12 | sort...
s482775681
p03767
C++
#include <stdio.h> #include <iostream> #include <vector> #include <string> using namespace std; int main(){ int n; cin >> n; int a[1000000000]; for (int i=0;i<3*n;++i) cin >> a[i]; a.sort(a.begin(),a.end()); int sum = 0; for (int i=1;i<n;++i) sum += a[3*i-2]; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:12:11: error: request for member 'sort' in 'a', which is of non-class type 'int [1000000000]' 12 | a.sort(a.begin(),a.end()); | ^~~~ a.cc:12:18: error: request for member 'begin' in 'a', which is of non-class type 'int [1000000000]' 12 | a.sort(...
s565045768
p03767
C++
#include <stdio.h> #include <iostream> #include <vector> #include <string> using namespace std; int main(){ int n; cin >> n; int a[3*n]; for (int i=0;i<3*n;++i) cin >> a[i]; a.sort(a.begin(),a.end()); int sum = 0; for (int i=1;i<n;++i) sum += a[3*i-2]; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:12:11: error: request for member 'sort' in 'a', which is of non-class type 'int [(n * 3)]' 12 | a.sort(a.begin(),a.end()); | ^~~~ a.cc:12:18: error: request for member 'begin' in 'a', which is of non-class type 'int [(n * 3)]' 12 | a.sort(a.begi...
s808679700
p03767
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> tsuyosa(3*n); for (int i=0; i<3*n; i++){ cin >> tsuyosa.at(i); } sort(tsuyosa.begin(), tsuyosa.end(), greater<int>()); int sum = 0; for(int i = 0; i < 2 * n; i++) { if (i % 2 == 1) { sum += ...
a.cc: In function 'int main()': a.cc:19:21: error: no match for call to '(std::vector<int>) (int&)' 19 | sum += tsuyosa(i); | ~~~~~~~^~~
s690034825
p03767
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n; cin >> n; vector<long long> arr(3 * n); for(int i = 0; i < 3 * n; i++){ cin >> arr[i]; } sort(arr.begin(), arr.end()); long long ans = 0; for(int i = 3 * n - 2; i >= n; i -= 2){ ans +...
a.cc: In function 'int main()': a.cc:11:5: error: 'vector' was not declared in this scope 11 | vector<long long> arr(3 * n); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <algorithm> +++ |+#include <vect...
s810148701
p03767
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef string st; typedef double db; typedef vector<long long> vecll; typedef vector<char> vechar; typedef vector<string> vecst; int main(){ ll N; cin >> N; vecll a(3 * N); for(auto& i : a) cin >> i; ...
a.cc: In function 'int main()': a.cc:23:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 23 | cout << ans << end; | ~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/1...
s779689961
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n; cin>>n; long long a[n*3]; for(long long &x:a)cin>>x; long long sum=0; for(int i=0;i<(n*3)-1;i+=3){ sort(a+i,a+(i+3)); sum+=a[i+1]; } cout<<fixed<<setprecision(0)<<sum; return 0;
a.cc: In function 'int main()': a.cc:14:10: error: expected '}' at end of input 14 | return 0; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s264408861
p03767
C++
#include <bits/stdc++.h> using namespace std; int main (){ int N ; cin >> N ; double a,b; cin >> a >> b; vector<double> x (N); vector<double> y (N); for(int i=0;i<N;i++){ cin >> x[i] >> y[i] ; } vector<double> kirokuX(N); vector<double> kirokuY(N); for(int i=0;i<N;i++){ kirokuX[i] = ...
a.cc: In function 'int main()': a.cc:39:12: error: expected primary-expression before '<<' token 39 | cout << << endl; | ^~ a.cc:43:11: error: expected primary-expression before '<<' token 43 | cout << << endl; | ^~
s947457018
p03767
C++
#include <iostream> #include <vector> using namespace std; int main(){ int n;cin>>n; vector<long long>v(3*n); for(auto&& w:v)cin>>w; sort(begin(v),end(v),greater<long long>()); long long ans=0ll; for(int i=0;i<n;i++){ ans+=v[2*i+1]; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'short'? 9 | sort(begin(v),end(v),greater<long long>()); | ^~~~ | short
s118107904
p03767
C++
#include <iostream> using namespace std; int main(){ int n;cin>>n; vector<long long>v(3*n); for(auto&& w:v)cin>>w; sort(begin(v),end(v),greater<long long>()); long long ans=0ll; for(int i=0;i<n;i++){ ans+=v[2*i+1]; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:6:5: error: 'vector' was not declared in this scope 6 | vector<long long>v(3*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> ...
s995785602
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { long n, i, ans = 0; cin >> n; vector<long> a(3 * n); for(i = 0; i < 3n; i++){ cin >> a.at(i); } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); for(i = 0; i < n; i++){ ans += a.at(2 * i + 1); } cout << ans << endl...
a.cc: In function 'int main()': a.cc:9:18: error: unable to find numeric literal operator 'operator""n' 9 | for(i = 0; i < 3n; i++){ | ^~
s593340130
p03767
C++
#include <iostream> #include <algorithm> using namespace std; // AGC 012 A int main() { int N; int a[100000]; cin >> N; for (int i = 0; i < N; i++) cin >> a[i]; sort(a, a + N, greater<int>()); int sum = 0; for (int i = 0; i < N; i++) { if (i % 3 == 1) sum = a[i]; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:17:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 17 | cout << ans << endl; | ^~~ | abs
s986144454
p03767
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int N; int a[3*(10^5)+10]; cin >> N; for(int i = 0; i < (3*N); i++){ cin >> a[i]; } sort(a, a+(3*N), greater<int>); //例で考える 1 2 5 5 5 8 //(125), (558); (128), (555) //1 2 3 4 5 6 90 91 92 // *...
a.cc: In function 'int main()': a.cc:8:16: warning: result of '10^5' is 15; did you mean '1e5'? [-Wxor-used-as-pow] 8 | int a[3*(10^5)+10]; | ^ | --- | 1e a.cc:8:14: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)...
s203882314
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin>>N; vector<int> A(3*N); for(int i=0; i < 3*N; i++){ cin>> A.at(i); } sort(A.begin(),A.end()); int ans =0; for(int i=0; i <2N ; i++){ if(i%2 ==0){ ans += A.at(N+i); } } cout<< ans <<endl; }
a.cc: In function 'int main()': a.cc:13:19: error: unable to find numeric literal operator 'operator""N' 13 | for(int i=0; i <2N ; i++){ | ^~
s501888366
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin>>N; vector<int> A(3*N); for(int i=0; i < 3*N; i++){ cin>> A.at(i); } sort(A.begin(),A.end()); reverse(A.begin(),A.end()); int ans =0; for(int i=0; i < 2*N; i++){ if(i%2 ==1){ ans += A.(i); } } cout<<ans<<endl...
a.cc: In function 'int main()': a.cc:16:16: error: expected unqualified-id before '(' token 16 | ans += A.(i); | ^
s949247852
p03767
C++
n=gets.to_i/3 puts gets.split[n,2*n].map(&:to_i).each_cons(2){|x,y| x}.inject(&:+)
a.cc:1:1: error: 'n' does not name a type 1 | n=gets.to_i/3 | ^ a.cc:2:57: error: expected unqualified-id before '.' token 2 | puts gets.split[n,2*n].map(&:to_i).each_cons(2){|x,y| x}.inject(&:+) | ^
s380090998
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int M; vector<int> A(M); cin >> M; N = M / 3; for (int i = 0; i < M; i++) { cin >> A.at(i); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); int s = 0; for (int i = 0; i < N; i++) { s += A.at(i * 2 + 1); } co...
a.cc: In function 'int main()': a.cc:8:3: error: 'N' was not declared in this scope 8 | N = M / 3; | ^
s313848919
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int M; vector<int> A(M); cin >> M; N = M / 3; for (int i = 0; i < M; i++) { cin >> A.at(M); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); int s = 0; for (int i = 0; i < N; i++) { s += A.at(i * 2 + 1); } co...
a.cc: In function 'int main()': a.cc:8:3: error: 'N' was not declared in this scope 8 | N = M / 3; | ^
s701854788
p03767
C++
#include <bits/stdc++.h> using namespace std; int main() { int M; vector<int> A(M) cin >> M; N = M / 3; for (int i = 0; i < M; i++) { cin >> A.at(M); } sort(A.begin(), A.end()); reverse(A.begin(), A.end()); int s = 0; for (int i = 0; i < N; i++) { s += A.at(i * 2 + 1); } cou...
a.cc: In function 'int main()': a.cc:7:3: error: expected ',' or ';' before 'cin' 7 | cin >> M; | ^~~ a.cc:8:3: error: 'N' was not declared in this scope 8 | N = M / 3; | ^