submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s633450467
p03764
C
#include<stdio.h> /*int sa(int a,int b){ if(a < b) return(b - a); return(a - b); }*/ int main(){ int n,m,i,j,k,ans = 0; int N; int x[100000],y[100000],s[99999]; N = 1000000000 + 7; scanf("%d %d",&n,&m); for(i = 0;i < n;i++) scanf("%d",&x[i]); for(i= 0;i < m;i++) scanf("%d",&y[i])...
main.c: In function 'main': main.c:26:29: error: expected expression before ')' token 26 | for(k = 0;k < n - 1;k+) | ^
s583149490
p03764
C++
//http://arc071.contest.atcoder.jp/tasks/arc071_b #include <iostream> using namespace std; int n,m; int x[100000] = {}; int y[100000] = {}; const int mod = 1000000007; void read_input(){ int i; cin >> n >> m; for(i=0; i<n; i++){ cin >> x[i]; } for(i=0; i<m; i++){ cin >> y[i]; }...
a.cc: In function 'int main()': a.cc:37:6: error: expected '}' at end of input 37 | } | ^ a.cc:21:15: note: to match this '{' 21 | int main(void){ | ^
s236289848
p03764
C++
#include <iostream> #include<algorithm> #include<math.h> using namespace std; int main(void){ long long int i,j,n,m; long long int tate=0,yoko=0; cin>>n>>m; long long int x[n],y[m]; for(i=0;i<n;i++){ cin>>x[i]; } for(i=0;i<m;i++){ cin>>y[i]; } sort(x,x+n); ...
a.cc: In function 'int main()': a.cc:28:34: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 28 | long long int ans=(tate*yoko)%(1E9+7); | ~~~~~~~~~~~^~~~~~~~ | | | | | ...
s905409934
p03764
C++
#include <iostream> #include<algorithm> #include<math.h> using namespace std; int main(void){ long long int i,j,n,m; long long int tate=0,yoko=0; cin>>n>>m; long long int x[n],y[m]; for(i=0;i<n;i++){ cin>>x[i]; } for(i=0;i<m;i++){ cin>>y[i]; } sort(x,x+n); ...
a.cc: In function 'int main()': a.cc:28:22: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 28 | cout<<(tate*yoko)%(1E9+7); | ~~~~~~~~~~~^~~~~~~~ | | | | | double | long long int
s065408579
p03764
C++
#include <iostream> #include<algorithm> #include<math.h> using namespace std; int main(void){ long long int i,j,n,m; long long int tate=0,yoko=0; cin>>n>>m; long long int x[n],y[m]; for(i=0;i<n;i++){ cin>>x[i]; } for(i=0;i<m;i++){ cin>>y[i]; } sort(x,x+n); ...
a.cc: In function 'int main()': a.cc:28:22: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 28 | cout<<(tate*yoko)%(1E+9); | ~~~~~~~~~~~^~~~~~~ | | | | | double | long long int
s067263314
p03764
C++
#include <iostream> #include<alghorithm> #include<math.h> using namespace std; int main(void){ int i,j,n,m; int tate=0,yoko=0; cin>>n>>m; int x[n],y[m]; for(i=0;i<n;i++){ cin>>x[i]; } for(i=0;i<m;i++){ cin>>y[i]; } sort(x,x+n); sort(y,y+m); for(...
a.cc:2:9: fatal error: alghorithm: No such file or directory 2 | #include<alghorithm> | ^~~~~~~~~~~~ compilation terminated.
s591589746
p03764
C++
#include <iostream> #include<alghorithm> #include<math.h> using namespace std; int main(void){ int i,j,n,m; int tate=0,yoko=0; cin>>n>>m; int x[n],y[m]; for(i=0;i<n;i++){ cin>>x[i]; } for(i=0;i<m;i++){ cin>>y[i]; } sort(x,x+n); sort(y,y+m); for(...
a.cc:2:9: fatal error: alghorithm: No such file or directory 2 | #include<alghorithm> | ^~~~~~~~~~~~ compilation terminated.
s844869056
p03764
C++
#include<iostream> #include<vector> #include<utility> #include<math.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef vector<vi> vvi; typedef vector<pair<int, int> > vp; #define pb push_back #define mod 1000000007 #define inf 999999999 #define rep(i, n) for(int i = 0; i < n; i++) #define F...
a.cc: In function 'int main()': a.cc:46:28: error: expected primary-expression before '<<' token 46 | cout << xan * yan % mod; << endl; | ^~
s060940606
p03764
C++
#include <iostream> #include <vector> #include <algorithm> #include <cstdint> using namespace std; int main() { int_least32_t n, m; cin >> n >> m; vector<int_least32_t> x(n); for(auto& e : x) { cin >> x; } vector<int_least32_t> y(m); for(auto& e : y) { cin >> y; } int_fast64_t sum_x{ 0 }; for(auto i ...
a.cc: In function 'int main()': a.cc:15:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 15 | cin >> x; | ~~~ ^~ ~ | | | | | std::vector<int> ...
s419184316
p03764
C++
using System; class Program { static void Main(string[] args) { //入力 //string[] xInputMax = "3 3".Split(' '); //string[] xInputMax = "6 5".Split(' '); string[] xInputMax = Console.ReadLine().Split(' '); int xMaxX = int.Parse(xInputMax[0...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:4:26: error: 'string' has not been declared 4 | static void Main(string[] args) | ^~~~~~ a.cc:4:35: error: expected ',' or '...' before 'args' 4 | static...
s157290203
p03764
C++
#include <cstdio> #include <algorithm> using namespace std; int n, m; long long int x[100000]; long long int y[100000]; long long int a, b; long long int mod = 1e9+7; long long int ans; int main(){ scanf("%d %d", &n, &m); for(int i=0; i<n; ++i){ scanf("%lld", &x[i]); x[i] -= x[0]; } for(int i=0; i<m; ++i){ ...
a.cc: In function 'int main()': a.cc:25:32: error: no matching function for call to 'min(int)' 25 | a += x[i] * min((((n-i-1)*n-(n-i-1)+n-1-(n-i-1)*(n-i-1)-(n-i-1)), (i-1)*n-(i-1)+n-1-(i-1)*(i-1)-(i-1))); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
s469303718
p03764
C++
#include<bits/stdc++.h> using namespace std; using ll=long long; const ll mod=1000000007; ll mod_pow(ll x,ll n){ ll res=1; while(n>0){ if(n&1)res=res*x%mod; x=x*x%mod; n>>=1; } return res; } int main(){ ll n,m; cin>>n>>m; for(ll i=0;i<n;++i){ ll x;cin>>x;...
a.cc: In function 'int main()': a.cc:24:17: error: 'mix' was not declared in this scope 24 | if(i==0)mix=x; | ^~~ a.cc:25:19: error: 'ma_x' was not declared in this scope 25 | if(i==n-1)ma_x=x; | ^~~~ a.cc:29:17: error: 'miy' was not declared in this s...
s063538678
p03764
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <unordered_map> using namespace std; int main() { int n; int m; int line; string str; //vector<string> str_vec; int count = 0; vector<int> X; vector<int> Y; long long res=0; cin >> n >> m; while (cin >> line) { ...
a.cc: In function 'int main()': a.cc:66:19: error: expected primary-expression before 'long' 66 | res = res%long long (10e9 + 7); | ^~~~
s704924209
p03764
C++
#pragma comment(linker, "/STACK:1024000000,1024000000") #include<algorithm> #include<iostream> #include<cstring> #include<fstream> #include<bitset> #include<cstdio> #include<string> #include<vector> #include<cmath> #include<queue> #include<stack> #include<map> #include<set> #define INF 0X3F3F3F3F #define N 100505 #defi...
a.cc:45:12: error: 'int yn' redeclared as different kind of entity 45 | int n, xn, yn; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:...
s884191259
p03764
C++
#include <iostream> #include <string.h> using namespace std; typedef long long ll; const int N = 1e5+5,mod=1e9+7; ll X[N],Y[N]; int main() { int n,m;scanf("%d %d",&n,&m); for (int i=1; i<=n; i++) { scanf("%lld",X+i); } for (int i=1; i<=m; i++) { scanf("%lld",Y+i); } sort(X+1,X+...
a.cc: In function 'int main()': a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(X+1,X+1+n); | ^~~~ | short
s013474139
p03765
C++
#include <stdio.h> #include <cstring> #include <array> constexpr int N = 1e5; char S[N+10], T[N+10]; std::array<short, N+1> vS, vT; constexpr short K = 'A' - 1; int main(void){ // A -> BB -> AAAA ; ABBAA -> ABBB // A -> AAAA -> AAABB -> BB // つまり, A = BB = AAAA // B = AA = BBBB : 3文字 === 空文...
a.cc: In function 'int main()': a.cc:20:20: error: 'i' was not declared in this scope 20 | vS[0] = 0; REP(i, n) vS[i+1] = (vS[i] + S[i] - K) % 3; | ^ a.cc:20:16: error: 'REP' was not declared in this scope 20 | vS[0] = 0; REP(i, n) vS[i+1] = (vS[i] + S[i] - K) % 3; | ...
s060139891
p03765
C++
import math inp=lambda:(int,input().split()) s=input() t=input() q=int(input()) for _ in range(q): a,b,c,d=inp() if abs((s[a:b].count('A')-s[a:b].count('B')))==abs((t[a:b].count('A')-t[a:b].count('B'))): print('YES') else: print('NO')
a.cc:9:23: warning: multi-character character constant [-Wmultichar] 9 | print('YES') | ^~~~~ a.cc:11:23: warning: multi-character character constant [-Wmultichar] 11 | print('NO') | ^~~~ a.cc:1:1: error: 'import' does not na...
s959658282
p03765
C++
#include<bits/stdc++.h> using namespace std; // #include</home/edison/Coding/cpp/template/debug.cpp> int spre[100005],tpre[100005]; int main(){ string s,t; cin>>s>>t; for(int i=1;i<=s.size();++i)spre[i]=spre[i-1]+(s[i-1]=='A'); for(int i=1;i<=t.size();++i)tpre[i]=tpre[i-1]+(t[i-1]=='A'); auto csa=[&]...
a.cc: In function 'int main()': a.cc:18:9: error: 'PDE' was not declared in this scope 18 | PDE(csa(a,b),csb(a,b),cta(c,d),ctb(c,d)); | ^~~
s170171270
p03765
C++
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fbo find_by_order #define ook order_of_key #define f first #define s second #define pb push_back #define reset(a,b) memset(a,b,sizeof a); #define MOD 998244353 ...
a.cc: In function 'int main()': a.cc:34:14: error: 'q' was not declared in this scope 34 | cin>>q; | ^ a.cc:37:24: error: 'pref' was not declared in this scope; did you mean 'pref2'? 37 | int sa=pref[b]-pref[a-1]; | ^~~~ | ...
s717188190
p03765
C++
#include <iostream> #include <climits> #include <stack> #include <queue> #include <iomanip> #include <limits> #include <string> #include <cmath> #include <set> #include <map> #include <math.h> #include <algorithm> #include <vector> using namespace std; typedef long long ll; typedef pair<ll,ll> P; long long int INF =...
a.cc: In function 'int main()': a.cc:45:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string [100005]' {aka 'std::__cxx11::basic_string<char> [100005]'}) 45 | cin>>s>>t; | ~~~^~~ | | | | | std::string [100005] ...
s478302971
p03765
C++
#include <iostream> #include <climits> #include <stack> #include <queue> #include <iomanip> #include <limits> #include <string> #include <cmath> #include <set> #include <map> #include <math.h> #include <algorithm> #include <vector> using namespace std; typedef long long ll; typedef pair<ll,ll> P; long long int INF =...
a.cc: In function 'int main()': a.cc:46:7: error: 'strlen' was not declared in this scope 46 | n=strlen(s); | ^~~~~~ a.cc:13:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 12 | #include <algorithm> +++ |+#include <cstring> 13 | #inc...
s165197053
p03765
C++
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <queue> #include <algorithm> #include <utility> #include <cmath> #include <map> #include <set> #include <stack> #include <cstdio> #include <cstdlib> #include <cstring> #include <random> #include <deque> #define INF_LL 1e18 #define INF ...
a.cc: In function 'int main()': a.cc:137:2: error: expected '}' at end of input 137 | } | ^ a.cc:123:15: note: to match this '{' 123 | int main(void){ | ^
s523954673
p03765
C++
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <queue> #include <algorithm> #include <utility> #include <cmath> #include <map> #include <set> #include <stack> #include <cstdio> #include <cstdlib> #include <cstring> #include <random> #include <deque> #define INF_LL 1e18 #define INF ...
a.cc:123:1: error: expected ',' or ';' before 'int' 123 | int main(void){ | ^~~
s505434222
p03765
C++
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> #include<stack> #include<queue> #include<vector> #include<algorithm> #include<string> #include<iostream> using namespace std; int main() { char s[100005],t[100005]; int q; scanf("%s\n%s\n",s,t); scanf("%d",&q); int ss[100...
a.cc: In function 'int main()': a.cc:41:6: error: expected '}' at end of input 41 | } | ^ a.cc:18:12: note: to match this '{' 18 | int main() { | ^
s558031125
p03765
Java
#include <bits/stdc++.h> using namespace std; #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;i++) #define EPS (1e-7) #define INF 1e9 typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; int vx[]={0,1,0,-1}; int vy[]={1,0,-1,0}; in...
Main.java:1: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <bits/stdc++.h> ^ Main.java:4: error: illegal character: '#' #define REP(i,n) for(int i=0;i<n;i++) ^ Main.java:4: error: class, interface, enum, or record expected #defi...
s068674073
p03765
C++
import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().solve(); } void solve() { Scanner sc=new Scanner(System.in); String s=sc.next(); String t=sc.next(); int q=sc.nextInt(); int[]a=new int[q]; int[]b=new...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.ArrayList; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Arrays; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules...
s787810573
p03765
C++
#include "IntMod.h" typedef IntMod<1000000007> MInt; //#include "Union_Find.h" #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <vector> #include <utility> #include <algorithm> #include <functional> #include <cmath> #include <stack> #include <queue> #include <set>...
a.cc:1:10: fatal error: IntMod.h: No such file or directory 1 | #include "IntMod.h" | ^~~~~~~~~~ compilation terminated.
s843757124
p03765
C++
#include<bits/stdc++.h> using namespace std; const int maxn = 100009; char s[maxn], t[maxn]; int S[maxn], T[maxn]; int n, m, Q, a, b, c, d; int main(){ gets(s+1); gets(t+1); n = strlen(s+1); for (int i=1; i<=n; i++) S[i] = (S[i-1] + (s[i] == 'A' ? 1 : 2)) % 3; m = strlen(t+1); for (int i=1; i<=m; i++) T[i] ...
a.cc: In function 'int main()': a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(s+1); gets(t+1); | ^~~~ | getw
s788845805
p03765
C++
#include<stdio.h> #include<vector> #include<algorithm> #include<set> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; const int MX = 500005; const int MM = 1000000007; char A[MX], B[MX]; int X[MX], Y[MX]; int N, M; int main() { scanf("%s%s", A+1, B+1); N = strlen(A+1), M = strlen(B+1); for(i...
a.cc: In function 'int main()': a.cc:21:13: error: 'strlen' was not declared in this scope 21 | N = strlen(A+1), M = strlen(B+1); | ^~~~~~ a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<set> +++ |+#includ...
s117263272
p03765
C++
#include <iostream> #include <algorithm> #include <bits/stdc++.h> using namespace std; int main(void){ string S; string T; int N; cin >> S >> T; cin >> N; int s_s, s_e, t_s, t_e; int S_asum[100005]; S_asum[0] = 0; for(int j=1;j<=S.length();j++){ S_asum[j] = (S_asum[...
a.cc: In function 'int main()': a.cc:45:9: error: 'els' was not declared in this scope 45 | els{printf("NO\n");} | ^~~
s312742805
p03765
C++
#include <iostream> #include <algorithm> #include <bits/stdc++.h> using namespace std; int main(void){ /* string S; string T; */ char S[100005], T[100005]; int N; cin >> S >> T; cin >> N; int s_s, s_e, t_s, t_e; int S_asum[100005]; S_asum[0] = 0; for(int j=1;j<=S.len...
a.cc: In function 'int main()': a.cc:22:22: error: request for member 'length' in 'S', which is of non-class type 'char [100005]' 22 | for(int j=1;j<=S.length();j++){ | ^~~~~~ a.cc:27:22: error: request for member 'length' in 'T', which is of non-class type 'char [100005]' 27 | ...
s209079275
p03765
C++
#include <iostream> #include <algorithm> using namespace std; int main(void){ string S; string T; int N; cin >> S >> T; cin >> N; int s_s, s_e, t_s, t_e; for(int i=0;i<N;i++){ cin >> s_s >> s_e >> t_s >> t_e; int s_a = 0; int t_a = 0; for(int j=s_s-1;j<s_...
a.cc: In function 'int main()': a.cc:25:43: error: expected ';' before 'for' 25 | s_a = s_a + (S.length() - s_a) * 2 | ^ | ; 26 | for(int j=t_s-1;j<t_e;j++){ | ~~~ ...
s674277089
p03765
C++
#include <iostream> #include <string> using namespace std; string deal(string s) { //cout<<s.c_str()<<endl; string s1; int i=0,j=0; char *pS; bool has=false; while (true){ pS = (char*)s.c_str(); char *p = pS; while(*p!='\0'){ if (!memcmp(p,"AB",2) || !memcmp(p,"BA",2)){ memset(p,' ',2); p=p+2; ...
a.cc: In function 'std::string deal(std::string)': a.cc:15:30: error: 'memcmp' was not declared in this scope 15 | if (!memcmp(p,"AB",2) || !memcmp(p,"BA",2)){ | ^~~~~~ a.cc:2:1: note: 'memcmp' is defined in header '<cstring>'; this is probably fixable by ad...
s893761760
p03765
C++
#include<cstdio> #include<algorithm> #include<cstring> #include<cmath> typedef long long ll; char an[100100]; char bn[100100]; int da[100100]; int db[100100]; int main(){ gets(an); gets(bn); for(int i=0;i<strlen(an);i++){ if(an[i]=='A'){ da[i+1]=(da[i]+1); } else da[i+1]=...
a.cc: In function 'int main()': a.cc:11:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(an); | ^~~~ | getw
s969551131
p03765
C++
#include<cstdio> #include<algorithm> #include<cstring> #include<cmath> typedef long long ll; char an[100100]; char bn[100100]; int da[100100]; int db[100100]; int main(){ scanf("%s%s",an,bn) for(int i=0;i<strlen(an);i++){ if(an[i]=='A'){ da[i+1]=(da[i]+1); } else da[i+1]=(da[...
a.cc: In function 'int main()': a.cc:11:24: error: expected ';' before 'for' 11 | scanf("%s%s",an,bn) | ^ | ; 12 | for(int i=0;i<strlen(an);i++){ | ~~~ a.cc:12:17: error: 'i' was not declared in this scope 12 | for...
s140695502
p03765
C++
#include <iostream> #include <vector> #include <algorithm> #include <cstdint> using namespace std; int main() { string s, t; cin >> s >> t; vector<int_least32_t> cumuSam_s{ s.size() }}; for(auto i = 0, sum = 0; i < cumuSam_s.size(); ++i) { if(s[i] == 'A') { sum += 1; } else { sum += 2; } cumuSam_...
a.cc: In function 'int main()': a.cc:13:48: warning: narrowing conversion of 's.std::__cxx11::basic_string<char>::size()' from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing] 13 | vector<int_least32_t> cumuSam_s{ s.size() }}; | ...
s705304185
p03765
C++
#include<iostream> #include<vector> #include<array> #include<string> #include<map> #include<numeric> #include<limits> struct mod { std::uint64_t val; void operator+=(std::uint64_t v) { val += v; val %= 1000000007; } void operator+=(mod v) { val += v.val; val %= 1000000007; } void operator*=(std::uint64...
a.cc:11:14: error: 'uint64_t' in namespace 'std' does not name a type; did you mean 'wint_t'? 11 | std::uint64_t val; | ^~~~~~~~ | wint_t a.cc:12:25: error: 'std::uint64_t' has not been declared 12 | void operator+=(std::uint64_t v) | ...
s780463794
p03765
C++
#include<iostream> #include<vector> #include<array> #include<string> #include<map> #include<numeric> struct mod { std::uint64_t val; void operator+=(std::uint64_t v) { val += v; val %= 1000000007; } void operator+=(mod v) { val += v.val; val %= 1000000007; } void operator*=(std::uint64_t v) { val *=...
a.cc:10:14: error: 'uint64_t' in namespace 'std' does not name a type; did you mean 'wint_t'? 10 | std::uint64_t val; | ^~~~~~~~ | wint_t a.cc:11:25: error: 'std::uint64_t' has not been declared 11 | void operator+=(std::uint64_t v) | ...
s683232246
p03765
C++
#include<iostream> #include<vector> #include<array> #include<string> #include<map> struct mod { std::uint64_t val; void operator+=(std::uint64_t v) { val += v; val %= 1000000007; } void operator+=(mod v) { val += v.val; val %= 1000000007; } void operator*=(std::uint64_t v) { val *= v; val %= 10000...
a.cc:9:14: error: 'uint64_t' in namespace 'std' does not name a type; did you mean 'wint_t'? 9 | std::uint64_t val; | ^~~~~~~~ | wint_t a.cc:10:25: error: 'std::uint64_t' has not been declared 10 | void operator+=(std::uint64_t v) | ...
s600897113
p03765
C++
#pragma comment(linker, "/STACK:1024000000,1024000000") #include<algorithm> #include<iostream> #include<cstring> #include<fstream> #include<bitset> #include<cstdio> #include<string> #include<vector> #include<cmath> #include<queue> #include<stack> #include<map> #include<set> #define INF 0X3F3F3F3F #define N 100505 #defi...
a.cc:46:40: error: 'int y1' redeclared as different kind of entity 46 | int a1[N], b1[N], a2[N], b2[N], q, x1, y1, x2, y2; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, ...
s770553317
p03765
C++
# include <iostream> using namespace std; int main() { int cnt1[100010]; int cnt2[100010]; string s , t; cin >> s >> t; int i , length = s.length(); for (i = 0;i < length;i ++) { char ch = s[i]; if (ch == 'A') { if (i == 0) { cnt1[i] = 1; } else { cnt1[i] =...
a.cc: In function 'int main()': a.cc:69:36: error: 'Math' was not declared in this scope 69 | int diff = Math.abs(result1 - result2); | ^~~~
s282442665
p03766
Java
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 int n; ll dp[1000001]; ll exp(int r){ ll prod = 1; for(int i=1;i<=r;i++){ prod*=2; prod%=MOD; } return prod; } int main(){ cin >> n; // dp[n] = n; if(n==1){ cout << 1; } ...
Main.java:1: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <bits/stdc++.h> ^ Main.java:3: error: illegal character: '#' #define ll long long ^ Main.java:3: error: class, interface, enum, or record expected #define ll long long ...
s753827814
p03766
C++
//#pragma GCC optimize("Ofast,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") #pragma GCC optimize("unroll-loops") /*#pragma GCC optimize("section-anchors") #pragma GCC optimize("profile-values,profile-reorder-functions,tracer") #pragma GCC optimize("vpt") #pragma...
a.cc: In function 'int main()': a.cc:146:9: error: 'coyt' was not declared in this scope 146 | coyt << ans; | ^~~~
s450933676
p03766
C++
// you can use includes, for example: #include <iostream> #include <vector> #include <algorithm> #include <memory> #include <unordered_map> #include <algorithm> #include <unordered_map> #include <string> #include <sstream> #include <set> #include <cassert> #include <map> using namespace std; constexpr int64_t kMod = ...
a.cc: In lambda function: a.cc:97:12: error: inconsistent types 'long long int' and 'long int' deduced for lambda return type 97 | return sum; | ^~~
s407901544
p03766
C++
# <bits/stdc++.h> #define ll long long #define rep2(i,a,b) for(ll i=a;i<=b;++i) #define rep(i,n) for(ll i=0;i<n;i++) #define rep3(i,a,b) for(ll i=a;i>=b;i--) #define pii pair<int,int> #define pll pair<ll,ll> #define pq priority_queue #define pb push_back #define eb emplace_back #define vec vector<int> #define vecll vec...
a.cc:1:3: error: invalid preprocessing directive #< 1 | # <bits/stdc++.h> | ^ a.cc: In function 'int in()': a.cc:27:17: error: 'cin' was not declared in this scope 27 | int in() {int x;cin>>x;return x;} | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is prob...
s862023832
p03766
C++
# <bits/stdc++.h> #define ll long long #define rep2(i,a,b) for(ll i=a;i<=b;++i) #define rep(i,n) for(ll i=0;i<n;i++) #define rep3(i,a,b) for(ll i=a;i>=b;i--) #define pii pair<int,int> #define pll pair<ll,ll> #define pq priority_queue #define pb push_back #define eb emplace_back #define vec vector<int> #define vecll vec...
a.cc:1:3: error: invalid preprocessing directive #< 1 | # <bits/stdc++.h> | ^ a.cc: In function 'int in()': a.cc:27:17: error: 'cin' was not declared in this scope 27 | int in() {int x;cin>>x;return x;} | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is prob...
s718869137
p03766
C++
#include <bits/stdc++.h> using namespace std; #define MAX 1000010 #define mod 1000000007 typedef long long ll; int n,f[MAX],ad; int main() { scanf("%d",&n); f[n]=n; f[n-1]=(ll)n*n%mod; for(int i=n-2;i>=1;--i) { ad=(ad+f[i+3])%mod; f[i]=f[i+1]; f[i]=(f[i]+(ll)(n-1)*(n-1)%mod)...
a.cc: In function 'int main()': a.cc:18:20: error: 'add' was not declared in this scope; did you mean 'std::filesystem::perm_options::add'? 18 | f[i]=(f[i]+add)%mod; | ^~~ | std::filesystem::perm_options::add In file included from /usr/include/c++/14/filesyst...
s395304403
p03766
C++
#include <bits/stdc++.h> using namespace std; int n, dp[1000005], cnt; int main() { cin >> n; dp[n] = n; dp[n-1]=(long long)n * n % 1000000007; for(int i = n - 2; i >= 1; --i) { cnt = (cnt + dp[i+3]) % 1000000007; dp[i] = dp[i+1]; dp[i] = (dp[i] + (long long)(n-1) * (n-1) % 1...
a.cc: In function 'int main()': a.cc:14:26: error: 'add' was not declared in this scope; did you mean 'std::filesystem::perm_options::add'? 14 | dp[i] = (dp[i] + add) % 1000000007; | ^~~ | std::filesystem::perm_options::add In file included from /...
s969824862
p03766
C++
#include <bits/stdc++.h> using namespace std; int n, dp[1000005], cnt; int main() { cin >> n; dp[n] = n; dp[n-1]=(long long)n * n % mod; for(int i=n-2;i>=1;--i) { cnt = (cnt + dp[i+3]) % 1000000007; dp[i] = dp[i+1]; dp[i] = (dp[i] + (long long)(n-1) * (n-1) % mod) % mod; ...
a.cc: In function 'int main()': a.cc:8:32: error: 'mod' was not declared in this scope; did you mean 'modf'? 8 | dp[n-1]=(long long)n * n % mod; | ^~~ | modf a.cc:14:26: error: 'add' was not declared in this scope; did you mean 'std::file...
s102919944
p03766
C++
#include<iostream> int main(){ long long n,i,mod=1000000007; con>>n; long long ans=1; for(i=0;i<n;i++) ans=ans*2%mod; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:4:3: error: 'con' was not declared in this scope 4 | con>>n; | ^~~ a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | cout<<ans<<endl; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream...
s116474532
p03766
C++
#include<stdio.h> #define LL long long const int N=1e6+10,mod=1e9+7; int n,m,f[N],ans; il LL rd() { LL x=0,w=1;char ch=0; while(ch<'0'||ch>'9') {if(ch=='-') w=-1;ch=getchar();} while(ch>='0'&&ch<='9') {x=(x<<3)+(x<<1)+(ch^48);ch=getchar();} return x*w; } int main() { m=(1ll*(n-1)*(n-1))%mod; ans...
a.cc:5:1: error: 'il' does not name a type 5 | il LL rd() | ^~ a.cc: In function 'int main()': a.cc:22:41: error: 'min' was not declared in this scope; did you mean 'main'? 22 | if(i!=n-1) ans=(ans+1ll*f[i]*(m+min(i+2,n-1))%mod)%mod; | ^~~ | ...
s252723592
p03766
C++
#include<stdio.h> #define LL long long const int N=1e6+10,mod=1e9+7; int n,m,f[N],ans; il LL rd() { LL x=0,w=1;char ch=0; while(ch<'0'||ch>'9') {if(ch=='-') w=-1;ch=getchar();} while(ch>='0'&&ch<='9') {x=(x<<3)+(x<<1)+(ch^48);ch=getchar();} return x*w; } int main() { m=(1ll*(n-1)*(n-1))%mod; ans=m+1+(...
a.cc:5:1: error: 'il' does not name a type 5 | il LL rd() | ^~ a.cc: In function 'int main()': a.cc:22:41: error: 'min' was not declared in this scope; did you mean 'main'? 22 | if(i!=n-1) ans=(ans+1ll*f[i]*(m+min(i+2,n-1))%mod)%mod; //乘的东西代表的分别是xyyyy和x1111 | ...
s490193422
p03766
C++
#include<stdio.h> #define LL long long const int N=1e6+10,mod=1e9+7; int n,m,f[N],ans; int main() { m=(1ll*(n-1)*(n-1))%mod; ans=m+1+(n>2); int sm=f[0]=1; for(int i=1;i<n;++i) { f[i]=sm; if(i-2>=0) f[i]=(f[i]-f[i-2]+mod)%mod; sm=(sm+f[i])%mod; if(i!=n-1) ans=(ans+1ll*f[i]*(m+min(...
a.cc: In function 'int main()': a.cc:15:41: error: 'min' was not declared in this scope; did you mean 'main'? 15 | if(i!=n-1) ans=(ans+1ll*f[i]*(m+min(i+2,n-1))%mod)%mod; //乘的东西代表的分别是xyyyy和x1111 | ^~~ | main
s693168366
p03766
C++
#include <bits/stdc++.h> using namespace std; long long n,f[1000010],add,i; int main() { scanf("%d",&n); f[n]=n; f[n-1]=pow(n,2)%1000000007; for(i=n-2;i>2;--i) add=(add+f[i+3])%1000000007,f[i]=f[i+1],f[i]=(f[i]+pow((n-1),2)%1000000007)%1000000007,f[i]=(f[i]+add)%mod,f[i]=(f[i]+i+1)%1000000007; ...
a.cc: In function 'int main()': a.cc:8:20: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%' 8 | f[n-1]=pow(n,2)%1000000007; | ~~~~~~~~^~~~~~~~~~~ | | | | | int | ...
s138853117
p03766
C++
#include <bits/stdc++.h> int n,f[1000001],add; int main(){ scanf("%d",&n);f[n]=n;f[n-1]=(long long)n*n%mod; for(register int i=n-2;i>=1;--i){ add=(add+f[i+3])%1000000007; f[i]=f[i+1]; f[i]=(f[i]+(long long)(n-1)*(n-1)%1000000007)%1000000007; f[i]=(f[i]+add)%1000000007; f[...
a.cc: In function 'int main()': a.cc:4:49: error: 'mod' was not declared in this scope; did you mean 'modf'? 4 | scanf("%d",&n);f[n]=n;f[n-1]=(long long)n*n%mod; | ^~~ | modf a.cc:5:22: warning: ISO C++17...
s625402180
p03766
C++
654321
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 654321 | ^~~~~~
s887899864
p03766
C++
#include<cstdio> #include<cstring> #include<algorithm> #define MN 1000005 #define mod 1000000007 using namespace std; inline int in(){ int x=0;bool f=0; char c; for (;(c=getchar())<'0'||c>'9';f=c=='-'); for (x=c-'0';(c=getchar())>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0'); return f?-x:x; } int f[MN],sum[MN<<1+...
/tmp/ccemiObS.o: in function `main': a.cc:(.text+0xf): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccemiObS.o a.cc:(.text+0x15): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccemiObS.o a.cc:(.text+0x36): relocation trunca...
s966350203
p03766
C++
#include<bits/stdc++.h> using namespace std; #define For(i , j , k) for (register int i = (j) , i##_end_ = (k) ; i <= i##_end_ ; ++ i) #define Mod (1000000007) typedef long long LL; int _ , __; char c_; inline int read() { for (_ = 0 , __ = 1 , c_ = getchar() ; !isdigit(c_) ; c_ = getchar()) if (c_ == '-') __ = -1; for...
a.cc:2:22: error: stray '#' in program 2 | using namespace std; #define For(i , j , k) for (register int i = (j) , i##_end_ = (k) ; i <= i##_end_ ; ++ i) #define Mod (1000000007) typedef long long LL; int _ , __; char c_; inline int read() { for (_ = 0 , __ = 1 , c_ = getchar() ; !isdigit(c_) ; c_ = getchar()) if (...
s770933248
p03766
C++
#pragma GCC optimize(3) #include<bits/stdc++.h> using namespace std; typedef long long ll; bool Finish_read; template<class T>inline void read(T &x){Finish_read=0;x=0;int f=1;char ch=getchar();while(!isdigit(ch)){if(ch=='-')f=-1;if(ch==EOF)return;ch=getchar();}while(isdigit(ch))x=x*10+ch-'0',ch=getchar();x*=f;Finish_re...
a.cc: In function 'int main()': a.cc:24:28: error: expected ';' before 'return' 24 | writeln(f[n]%mod);2 | ^ | ; 25 | return 0; | ~~~~~~
s958759846
p03766
C++
int main() { puts("12"); return 0; }
a.cc: In function 'int main()': a.cc:3:1: error: 'puts' was not declared in this scope 3 | puts("12"); | ^~~~
s953253526
p03766
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <vector> #include <string> #include <algorithm> #include <stack> #include <queue> #include <set> #include <map> using namespace std; typedef __int64 LL; typedef vector<int> ivec; typedef vector<string> svec; int a[100010]; int dp2[100...
a.cc:13:9: error: '__int64' does not name a type; did you mean '__int64_t'? 13 | typedef __int64 LL; | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:23:9: error: 'LL' was not declared in this scope 23 | LL a=1,b; | ^~ a.cc:26:30: error: invalid operands...
s427511301
p03766
C++
n = int(raw_input()) d = [n] * n t = n for i in xrange(1, n): d[i] = t t += d[i] print t % 1000000007
a.cc:1:1: error: 'n' does not name a type 1 | n = int(raw_input()) | ^
s926960033
p03766
C++
陈涵 2017-4-8 21:37:31 #include <bits/stdc++.h> #define LL long long #define INF 0x3f3f3f3f using namespace std; template<class T> inline void read(T& x) { int f = 1; x = 0; char ch = getchar(); while (ch < '0' || ch > '9') {if (ch == '-') f = -1; ch = getchar();} while (ch >= '0' && ch <= '9') {x = x * 10 + ch -...
a.cc:2:1: error: '\U00009648\U00006db5' does not name a type 2 | 陈涵 2017-4-8 21:37:31 | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, f...
s824654515
p03766
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <vector> #include <string> #include <algorithm> #include <stack> #include <queue> #include <set> #include <map> using namespace std; //typedef __int64 LL; typedef vector<int> ivec; typedef vector<string> svec; int a[100010]; int dp2[1...
a.cc: In function 'int main()': a.cc:25:9: error: 'dp' was not declared in this scope; did you mean 'dp2'? 25 | dp[1]=1,dp[1]=0; | ^~ | dp2
s328004965
p03766
C++
typedef long long int64; static const int MAXN = 1e6 + 4; static const int MODULUS = 1e9 + 7; #define _ % MODULUS #define __ %= MODULUS int n; int64 f[MAXN] = { 0 }; int main() { scanf("%d", &n); f[0] = 1; f[1] = n; f[2] = (int64)n * n _; int64 sum = (f[0] + f[1] + f[2])_; for (int i = 3; i...
a.cc: In function 'int main()': a.cc:12:5: error: 'scanf' was not declared in this scope 12 | scanf("%d", &n); | ^~~~~ a.cc:25:5: error: 'printf' was not declared in this scope 25 | printf("%lld\n", f[n]); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is proba...
s389650933
p03766
C++
#define _USE_MATH_DEFINES #include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include...
/usr/bin/ld: /tmp/ccXOeuSj.o: warning: relocation against `_ZN11SegmentTree9INIT_DATAE' in read-only section `.text._ZN11SegmentTreeC2Ei[_ZN11SegmentTreeC5Ei]' /usr/bin/ld: /tmp/ccXOeuSj.o: in function `SegmentTree::SegmentTree(int)': a.cc:(.text._ZN11SegmentTreeC2Ei[_ZN11SegmentTreeC5Ei]+0x6e): undefined reference to ...
s317765161
p03767
C++
#include <bits/stdc++.h> #include <iostream> #include <algorithm> using namespace std; int main (){ int N; //データの数 cin >> N; int data=0; vector <int> a(3*N); for(int i=0;i<3*N;i++) cin >>a.at(i);//データの収納 sort(a,a+10,greater<int>()); for (int i=0;i < N-1 ;i++) data += a.at(i); co...
a.cc: In function 'int main()': a.cc:15:11: error: no match for 'operator+' (operand types are 'std::vector<int>' and 'int') 15 | sort(a,a+10,greater<int>()); | ~^~~ | | | | | int | std::vector<int> In file included from /usr/include/c++/14/bits/stl_algob...
s404545555
p03767
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; int a[N]; for(int i=0;i<N;i++){ cin >> a[i]; } sort(a,a+N); int sum=0; for(int i=N/3;i<N;i++++){ sum+=a[i]; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:13:22: error: lvalue required as increment operand 13 | for(int i=N/3;i<N;i++++){ | ~^~
s903261368
p03767
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; int a[N]; for(int i=0;i<N;i++){ cin >> a[i]; } sort(a,a+N); int sum=0; for(int i=N/3;i<N;i++++){ sum+=a[i]; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:13:22: error: lvalue required as increment operand 13 | for(int i=N/3;i<N;i++++){ | ~^~
s832056583
p03767
C++
#include<iostream> #include<algorithm> #include<string> #include<cmath> using namespace std; int main() { int N; int a[100010]; long int max = 0; for(int i = 0; i < 3*N; i++) cin >> a[i]; sort(a, a+3N,greater<int>()); for(int i = 0; i < N; i++) max = a[2*i + 1]; cout << max ...
a.cc: In function 'int main()': a.cc:12:15: error: unable to find numeric literal operator 'operator""N' 12 | sort(a, a+3N,greater<int>()); | ^~
s722151715
p03767
C++
#include <bits/stdc++.h> using namespace std; #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数 int lcm(int ...
a.cc: In function 'int main()': a.cc:88:13: error: no match for call to '(std::vector<int>) (int&)' 88 | cin >> a(n); | ~^~~
s942317178
p03767
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; /*using P = pair<ll,ll>; //マクロ //forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか //Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++) //xにはvectorな...
a.cc: In function 'int main()': a.cc:73:10: error: 'ALL' was not declared in this scope 73 | sort(ALL(a)); | ^~~
s768755102
p03767
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int N; cin >> N; vector<int> a; for(int i=0;i<3*N;i++) cin >> a[i]; sort(a.begin(), a.end(), grater<int>()); int sum = 0; for(int i=0;i<2*N;i++){ if(i%2 == 1) sum += a[i]; } cout << a[i] << e...
a.cc: In function 'int main()': a.cc:12:34: error: 'grater' was not declared in this scope 12 | sort(a.begin(), a.end(), grater<int>()); | ^~~~~~ a.cc:12:41: error: expected primary-expression before 'int' 12 | sort(a.begin(), a.end(), grater<int>()); |...
s466160274
p03767
C++
#include<btis/stdc++.h> using namespace std; #define int int64_t signed main(){ int n; cin>>n; vector<int> x(n*3); arep(i,x) cin>>i; sort(all(x),greater<int>()); int ans = 0; for(int i=n;i<n+n;++i) ans += x[i]; cout<<ans<<'\n'; return 0; }
a.cc:1:9: fatal error: btis/stdc++.h: No such file or directory 1 | #include<btis/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s889294480
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); long long ans = 0; for(int i=(3*n-2); i>=n; i-=2){ ans += a[i]; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:20: error: expected ')' before ';' token 14 | sort(a, a+(3*n); | ~ ^ | )
s652978608
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> arr(3*N); for(int i=0;i<3*n;i++){ cin >>arr.at(i); } sort(arr.begin(),arr.end()); reverse(arr.begin(),arr.end()); int64_t sum=0; for(int i=1;i<2*n;i+=2){ sum+=arr.at(i); } cout<<sum; return 0; }
a.cc: In function 'int main()': a.cc:6:21: error: 'N' was not declared in this scope 6 | vector<int> arr(3*N); | ^
s915616588
p03767
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(void){ int N; cin >> N; vector<int> a(3*N); for (int i=0; i<3*N; i++) cin >> a[i]; sort((a).begin(), (a).rend()); long long sum =0; for (int i=0; i<N; i++){ sum += a[ i*2 + 1 ]; } cout << sum << "\n";...
a.cc: In function 'int main()': a.cc:13:7: error: no matching function for call to 'sort(std::vector<int>::iterator, std::vector<int>::reverse_iterator)' 13 | sort((a).begin(), (a).rend()); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:3:...
s584667404
p03767
C++
#include <iostream> #include <vector> #include <algorithm> #include <thread> #include <sstream> #include <unordered_set> #include <future> using namespace std; int main() { std::ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; std::vector<int> v(3 * n); for (auto& el : v) { cin >> el; }...
a.cc: In function 'int main()': a.cc:27:5: error: 'assert' was not declared in this scope 27 | assert(i > 0); | ^~~~~~ a.cc:8:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>' 7 | #include <future> +++ |+#include <cassert> 8 | using na...
s593963040
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin >> a ; int m=3*a; int k[m+2]={0}; for(int i=0;i<m;i++){ cin >> k[i]; } sort(k,k+m,greater<int>()); int sum=0; for(int i=1,j=0;i<2*a,j<n;i+=2,j++){ sum+=k[i]; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:15:27: error: 'n' was not declared in this scope 15 | for(int i=1,j=0;i<2*a,j<n;i+=2,j++){ | ^
s828146945
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin >> a ; int m=3*a; int k[m+2]={0}; for(int i=0;i<m;i++){ cin >> k[i]; } sort(k,k+m,greater<int>()); int sum=0; for(int i=1,j=0;i<2*a,j<n;i+2,j++){ sum+=k[i]; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:15:27: error: 'n' was not declared in this scope 15 | for(int i=1,j=0;i<2*a,j<n;i+2,j++){ | ^
s999388720
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin >> a ; int m=3*a; int k[m+2]={0}; for(int i=0;i<m;i++){ cin >> k[i]; } sort(k,k+m,greater<int>()); int sum=0; for(int i=1,j=0;;i<2*a,j<n;i+2,j++){ sum+=k[i]; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:15:28: error: 'n' was not declared in this scope 15 | for(int i=1,j=0;;i<2*a,j<n;i+2,j++){ | ^ a.cc:15:29: error: expected ')' before ';' token 15 | for(int i=1,j=0;;i<2*a,j<n;i+2,j++){ | ~ ^ | ...
s389289657
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin >> a ; int k[n]={}; int m=3*a; for(int i=0;i<m;i++){ cin >> k[i]; } sort(k,k+m,greater<int>()); cout << k[1] << endl; }
a.cc: In function 'int main()': a.cc:6:9: error: 'n' was not declared in this scope 6 | int k[n]={}; | ^ a.cc:9:12: error: 'k' was not declared in this scope 9 | cin >> k[i]; | ^ a.cc:11:8: error: 'k' was not declared in this scope 11 | sort(k,k+m,greater<int>()); ...
s848953765
p03767
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int N; cin >> N; vector<ll> A(3*N); for (int i = 0; i < 3*N; i++) cin >> A[i]; sort(A.begin(), A.end()); reverse(A.begin(), A>end()); ll ans = 0; for (int i = 1; i <= 2*N; i++) { if (i % 2 == 1) ans += A[i]; } cout...
a.cc: In function 'int main()': a.cc:11:27: error: no matching function for call to 'end()' 11 | reverse(A.begin(), A>end()); | ~~~^~ In file included from /usr/include/c++/14/bits/algorithmfwd.h:39, from /usr/include/c++/14/bits/stl_algo.h:59, from /u...
s144534501
p03767
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int N; cin >> N; vector<ll> A(3*N); for (int i = 0; i < 3*N; i++) cin >> A[i]; sort(A.begin(), A.end()); reverse(A.begin(), A>end()); ll ans = 0; for (int i = 1; i <= 2*N; i += 2) ans += A[i]; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:11:27: error: no matching function for call to 'end()' 11 | reverse(A.begin(), A>end()); | ~~~^~ In file included from /usr/include/c++/14/bits/algorithmfwd.h:39, from /usr/include/c++/14/bits/stl_algo.h:59, from /u...
s226631925
p03767
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int i long long int n; cin >> n; vector<long long int> a(n * 3); //cout << a.size(); for(i=0; i<a.size(); i++) cin >> a[i]; for(i=0; i<a.size(); i++){ if(i + 1 == 3) sort(a.begin(), a.begin() + i); if((i + 1)...
a.cc: In function 'int main()': a.cc:10:9: error: expected initializer before 'long' 10 | long long int n; | ^~~~ a.cc:11:16: error: 'n' was not declared in this scope 11 | cin >> n; | ^ a.cc:15:13: error: 'i' was not declared in this scope 15 | for(i=...
s772935091
p03767
C++
#include iostream using namespace std int main() { int n; cin>>n; ll a[3*n]; for(int i=0;i<3*n;i++) cin>>a[i]; sort(a,a+3*n); ll ans=0; for(int i=n;i<3*n;i=i+2) ans+=a[i]; cout<<ans; return 0; }
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME> 1 | #include iostream | ^~~~~~~~ a.cc:2:20: error: expected ';' before 'int' 2 | using namespace std | ^ | ; 3 | int main() | ~~~ a.cc: In function 'int main()'...
s648740017
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; int num = 3 * N; int a[num]; rep(i, num){ cin >> a[i]; } sort(a, a+num, greater<int>); int ans = 0; rep(i,N * 2){ if(i % 2 == 1){ ans += a[i]; } } c...
a.cc: In function 'int main()': a.cc:18:30: error: expected primary-expression before ')' token 18 | sort(a, a+num, greater<int>); | ^
s715368511
p03767
C++
#include <iostream> #include <algorithm> #define rep(i, n) for(int i = 0; i <(int)(n); i++) using namespace std; int main(){ int N; cin >> N; int a[3N]; rep(i, N){ cin >> a[i]; } sort(a, a+N); int ans = 0; rep(i,N){ ans += a[N+i]; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:9: error: unable to find numeric literal operator 'operator""N' 12 | int a[3N]; | ^~ a.cc:14:12: error: 'a' was not declared in this scope 14 | cin >> a[i]; | ^ a.cc:17:8: error: 'a' was not declared in this scope 17 | sort(a, a+N);...
s517713001
p03767
C++
#include <iostream> #include <algorithm> #difine rep(i, n) for(int i = 0; i <(int)(n); i++) using namespace std; int main(){ int N; cin >> N; int a[3N]; rep(i, N){ cin >> a[i]; } sort(a, a+N); int ans = 0; rep(i,N){ ans += a[N+i]; } cout << ans << endl; }
a.cc:4:2: error: invalid preprocessing directive #difine; did you mean #define? 4 | #difine rep(i, n) for(int i = 0; i <(int)(n); i++) | ^~~~~~ | define a.cc: In function 'int main()': a.cc:12:9: error: unable to find numeric literal operator 'operator""N' 12 | int a[3N]; | ^~ a.cc:...
s873313690
p03767
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; int a[1000000]; int ans = 0; for(int i = 0; i < 3N; i++){ cin >> a[i]; } sort(a,a + 3N, greater<int>()); for(int i = 0; i < N ; i++){ ans += a[1 + 2*i]; } cout << ans << endl; return ...
a.cc: In function 'int main()': a.cc:9:24: error: unable to find numeric literal operator 'operator""N' 9 | for(int i = 0; i < 3N; i++){ | ^~ a.cc:13:16: error: unable to find numeric literal operator 'operator""N' 13 | sort(a,a + 3N, greater<int>()); | ^...
s338210042
p03767
C++
#define rrep(i,cc,n) for(long i=cc;i>n;--i) using ll = long long; int main() { int N; cin >> N; vector<ll> p(3*N); rep(i, 0, 3*N) cin >> p[i]; sort(p.begin(),p.end()); rep(i, 0, N) p.erase(p.begin()); ll ans = 0; rep(i, 0, N){ ans += p[0]; p.erase(p.begin()); } ...
a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin >> N; | ^~~ a.cc:7:5: error: 'vector' was not declared in this scope 7 | vector<ll> p(3*N); | ^~~~~~ a.cc:7:14: error: expected primary-expression before '>' token 7 | vector<ll> p(3...
s299903312
p03767
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> int main(void) { int n, i, j, tmp, sum=0; long long int a[300005]; scanf("%d", &n); for (i = 0; i < 3*n; i++) { scanf("%d", &a[i]); } qsort(a, 3*n, sizeof(long long), cmp); for (i = 1; i < 2*n; i += 2) { sum += a[i]; } printf("%d"...
main.c: In function 'main': main.c:16:42: error: 'cmp' undeclared (first use in this function); did you mean 'tmp'? 16 | qsort(a, 3*n, sizeof(long long), cmp); | ^~~ | tmp main.c:16:42: note: each undeclared identif...
s120467745
p03767
C++
# Problem: https://atcoder.jp/contests/agc012/tasks/agc012_a # Python 1st Try import sys # from collections import defaultdict # import heapq,copy # from collections import deque def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys....
a.cc:1:3: error: invalid preprocessing directive #Problem 1 | # Problem: https://atcoder.jp/contests/agc012/tasks/agc012_a | ^~~~~~~ a.cc:2:3: error: invalid preprocessing directive #Python 2 | # Python 1st Try | ^~~~~~ a.cc:5:3: error: invalid preprocessing directive #from 5 | # from collec...
s849680212
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[i]; sort(p.begin(), p.end()); int sum=0; for (int i=1; i<3N; i+=2) sum += p[i]; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:6:17: error: unable to find numeric literal operator 'operator""N' 6 | vector<int> p(3N); | ^~ a.cc:7:19: error: unable to find numeric literal operator 'operator""N' 7 | for (int i=0; i<3N; i++) cin >> p[i]; | ^~ a.cc:10:19:...
s864708116
p03767
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (ll (i) = 0 ; (i) < (ll)(n) ; ++(i)) #define REPN(i, m, n) for (ll (i) = m ; (i) < (ll)(n) ; ++(i)) #define REP_REV(i, n) for (ll (i) = (ll)(n) - 1 ; (i) >= 0 ; --(i)) #define REPN_REV(i, m, n) for (ll (i) = (ll)(n) - 1 ; (i) >= m ; --(i)) #define I...
a.cc:26:14: error: macro "REPN" requires 3 arguments, but only 2 given 26 | REPN(i, n) { | ^ a.cc:6:9: note: macro "REPN" defined here 6 | #define REPN(i, m, n) for (ll (i) = m ; (i) < (ll)(n) ; ++(i)) | ^~~~ a.cc: In function 'int main()': a.cc:26:5: error: 'REPN' was not de...
s865612228
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<intf>()); intf sum = 0; for(int i = 0; i < N; i ++){ sum += v.at(2 * N + ...
a.cc: In function 'int main()': a.cc:11:38: error: 'intf' was not declared in this scope; did you mean 'rintf'? 11 | sort(v.begin(), v.end(), greater<intf>()); | ^~~~ | rintf a.cc:11:42: error: template argument 1 is invalid ...
s335588826
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<longlong>()); longlong sum = 0; for(int i = 0; i < N; i ++){ sum += v.at(...
a.cc: In function 'int main()': a.cc:11:38: error: 'longlong' was not declared in this scope 11 | sort(v.begin(), v.end(), greater<longlong>()); | ^~~~~~~~ a.cc:11:46: error: template argument 1 is invalid 11 | sort(v.begin(), v.end(), greater<longlong>()); ...
s018382579
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, NN, NNN; cin >> N; NN = 2 * N; NNN = 3 * N; vector<int> v(NNN); rep(i, N) cin >> v.at(i); sort(v.begin(), v.end(), greater<int>()); rep (i, N){ int sum += v.at(...
a.cc: In function 'int main()': a.cc:15:17: error: expected initializer before '+=' token 15 | int sum += v.at(NN); | ^~ a.cc:17:13: error: 'sum' was not declared in this scope 17 | cout << sum << endl; | ^~~
s000906415
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, 2N, 3N; cin >> N; 2N = 2 * N; 3N = 3 * N; vector<int> v(3N); rep(i, N) cin >> v.at(i); sort(v.begin(), v.end(), greater<int>()); rep (i, N){ int sum += v.at(2N)...
a.cc: In function 'int main()': a.cc:6:16: error: expected unqualified-id before numeric constant 6 | int N, 2N, 3N; | ^~ a.cc:8:5: error: unable to find numeric literal operator 'operator""N' 8 | 2N = 2 * N; | ^~ a.cc:9:5: error: unable to find numeric literal operato...
s120572634
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, 2N, 3N; cin >> N; 2N = 2 * N; 3N = 3 * N; vector<int> v(3N); rep(i, N) cin >> v.at(i); sort(v.begin(), v.end(), greater<int>()); rep (i, N){ int sum += v.at(2N); ...
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, 2N, 3N; | ^~~ a.cc:6:9: error: expected '}' before 'int' a.cc:5:9: note: to match this '{' 5 | int main{ | ...