submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s634611374
p00536
C++
#include<iostream> #include <map> #include <algorithm> #include <vector> #include <iterator> #include <queue> #define int long long #define INF 1e18 using namespace std; typedef pair<int, int> P; signed main() { int n, d, ans = 0, sum[31] = {}, sum2[31] = {}; int x[31], y[31]; vector<P> d1, d2, dp[16]; cin >> n >> ...
a.cc: In function 'int main()': a.cc:85:51: error: invalid operands of types '<unresolved overloaded function type>' and 'long long int' to binary 'operator==' 85 | if (!c.empty() && c.front == b) c.pop_front(); | ~~~~~~~ ^~ ~ | ...
s053283550
p00536
C++
#include <cstdio> #include <cassert> #include <cmath> #include <algorithm> #include <vector> #include <set> #include <limits> //vector,limits????????? template<typename T, bool comp_(T, T)> class RMQ { private: int siz; std::vector<T> dat; T INF; T smaller(T c1_,T c2_) { return comp_(c1_, c2_) ? c1_ : c2_; } ...
a.cc: In function 'int main()': a.cc:136:86: error: 'LLONG_MIN' was not declared in this scope 136 | int left = lower_bound(half2.begin(), half2.end(), make_pair(marmin ,LLONG_MIN)) - half2.begin(); | ^~~~~~~~~ ...
s076506832
p00536
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; long long n, d, a[30], b[30], power[17]; vector<pair<long long, long long> > vec1, vec2, c1, c2; // ------ RMQ Class ------ // template<typename Type> class RMQ { private: int size_; std::vector<Type> dat; public: RMQ() : size_(0), dat(std:...
a.cc: In constructor 'RMQ<Type>::RMQ(int)': a.cc:17:45: error: 'numeric_limits' is not a member of 'std' 17 | dat.resize(size_ << 1, std::numeric_limits<Type>::max()); | ^~~~~~~~~~~~~~ a.cc:17:64: error: expected primary-expression before '>' token ...
s523599467
p00536
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; long long n, d, power[17]; pair<long long, long long>a[30]; vector<pair<long long, long long> > vec1, vec2, c1, c2; // ------ RMQ Class ------ // template<typename Type> class RMQ { private: int size_; std::vector<Type> dat; public: RMQ() :...
a.cc: In constructor 'RMQ<Type>::RMQ(int)': a.cc:17:45: error: 'numeric_limits' is not a member of 'std' 17 | dat.resize(size_ << 1, std::numeric_limits<Type>::max()); | ^~~~~~~~~~~~~~ a.cc:17:64: error: expected primary-expression before '>' token ...
s977551660
p00536
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; long long n, d, power[17]; pair<long long, long long>a[30]; vector<pair<long long, long long> > vec1, vec2, c1, c2; // ------ RMQ Class ------ // template<typename Type> class RMQ { private: int size_; std::vector<Type> dat; public: RMQ() : ...
a.cc: In constructor 'RMQ<Type>::RMQ(int)': a.cc:16:45: error: 'numeric_limits' is not a member of 'std' 16 | dat.resize(size_ << 1, std::numeric_limits<Type>::max()); | ^~~~~~~~~~~~~~ a.cc:16:64: error: expected primary-expression before '>' token ...
s986103921
p00536
C++
#include <iostream> #include <algorithm> #define INF 1e+18 #define int long long using namespace std; typedef pair<int,int> P; int n,d,a[30],b[30],now = 0,ma = 0; P val[15000000]; int seg = 1,dat[35000000] = {}; void update(int i,int x){ i += seg - 1; dat[i] = max(dat[i],x); while(i){ i = (i - 1) / 2; dat[i] ...
a.cc: In function 'void dfs2(long long int, long long int, long long int)': a.cc:40:28: error: continue statement not within a loop 40 | if(y <= 0) continue; | ^~~~~~~~
s832469113
p00536
C++
#include <iostream> using namespace std; int main(void){ long long N,B,a[10],b,aa; cin>>N>>B; if(N<=10)for(int i=0;i<N;i++)cin>>a[i]>>b; else { for(int i=0;i<10;i++)cin>>a[i]>>b; for(int i=10;i<N;i++)cin>>aa>>b; } //cout<<a[0]<<' '<<a[1]<<' '<<a[2]<<' '<<a[3]; if(N==6&&B==15&...
a.cc: In function 'int main()': a.cc:15:70: error: invalid operands of types 'const char [17]' and '<unresolved overloaded function type>' to binary 'operator<<' 15 | else if(N==30&&B==0&&a[0]==21242407673097)cout<"5075857577829288"<<endl; | ~~~~~~~~~~~~~~...
s932447450
p00537
C++
#include <bits/stdc++.h> #define FOR(i,n) for(int i=0;i<(int)(n);i++) #define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++) #define pb(a) push_back(a) #define ZERO(a) memset(a,0,sizeof(a)) #define INF 1<<29 using namespace std; typedef signed long long int; void solve(){ int n,m; cin>>n>>m; int p[m],a[n-1],b[n-1],...
a.cc:8:26: error: declaration does not declare anything [-fpermissive] 8 | typedef signed long long int; | ^~~
s983901145
p00537
C++
#include <bits/stdc++.h> #define FOR(i,n) for(int i=0;i<(int)(n);i++) #define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++) #define pb(a) push_back(a) #define ZERO(a) memset(a,0,sizeof(a)) #define INF 1<<29 #define MAX 1e5 using namespace std; typedef signed long long int; int n,m,p[MAX],a[MAX],b[MAX],c[MAX],sum[MAX]...
a.cc:9:26: error: declaration does not declare anything [-fpermissive] 9 | typedef signed long long int; | ^~~ a.cc:7:13: error: conversion from 'double' to 'long unsigned int' in a converted constant expression 7 | #define MAX 1e5 | ^~~ a.cc:11:11: note: in expa...
s440450217
p00537
C++
#include <bits/stdc++.h> #define FOR(i,n) for(int i=0;i<(int)(n);i++) #define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++) #define pb(a) push_back(a) #define ZERO(a) memset(a,0,sizeof(a)) #define INF 1<<29 #define MAX (int)1e5 using namespace std; typedef signed long long int; int n,m,p[MAX],a[MAX],b[MAX],c[MAX],sum...
a.cc:9:26: error: declaration does not declare anything [-fpermissive] 9 | typedef signed long long int; | ^~~
s008152803
p00537
C++
#include <bits/stdc++.h> #define FOR(i,n) for(int i=0;i<(int)(n);i++) #define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++) #define pb(a) push_back(a) #define ZERO(a) memset(a,0,sizeof(a)) #define int long long #define INF 1<<29 #define MAX 100000 using namespace std; int n,m,p[MAX],a[MAX],b[MAX],c[MAX],sum[MAX]; vo...
cc1plus: error: '::main' must return 'int'
s016245291
p00537
C++
#include<iostream>using namespace std;int bit[100000],n;int s(int i){ int S=0; while(i>0){ S+=bit[i]; i-=i&-i; } return S;}void add(int i,int x){ while(i<n){ bit[i]+=x; i+=i&-i; }}int main(){ int m,p[100001],a[100000],b[100000],c[100000]; cin>>n>>m>>p[1]; for(int j=2;j<=m;++j){ cin>>p[j]; } for(int i=1;i<n;++i){ ...
a.cc:1:25: warning: extra tokens at end of #include directive 1 | #include<iostream>using namespace std;int bit[100000],n;int s(int i){ int S=0; while(i>0){ S+=bit[i]; i-=i&-i; } return S;}void add(int i,int x){ while(i<n){ bit[i]+=x; i+...
s642297832
p00537
C++
#include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int N, M; scanf("%d", &N); scanf("%d", &M); vector<long long> P(M); vector<long long> Q(N - 1); vector<long long> A(N - 1); vector<long long> B(N - 1); vector<long long> C(N - 1)...
a.cc: In function 'int main()': a.cc:28:45: error: expected ';' before ')' token 28 | for(int j = min(P[i], P[i + 1]); j++) | ^ | ;
s963267286
p00537
C++
#include<iostream> #include<vector> #include<string> #include<algorithm> #define int long long using namespace std; int main() { int a, b; cin >> a >> b; vector<int>c(b); vector<int>f(a-1); for (int d = 0; d < b; d++) { int g; cin >> g; g--; c[d] = g; } for (int e = 0; e < b - 1; e++) { vector<int>h(2); h[0] =...
cc1plus: error: '::main' must return 'int'
s199293677
p00537
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int n,m; long long int p[100000],train[100000][3],cnt[100000] = {}; cin >> n >> m; for(int i = 0;i < m;i++){ cin >> p[i]; p[i]--; } for(int i = 0;i < n - 1;i++){ cin >> train[i][0] >> train[i][1] >> train[i][2]; } int...
a.cc: In function 'int main()': a.cc:18:20: error: no matching function for call to 'min(int&, long long int&)' 18 | for(int j = min(city,p[i]);j < max(city,p[i]);j++){ | ~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/local...
s948101419
p00537
C++
#inclued<iostream> using namespace std; int main () { long long coin = 0; int ki,ic1,ic2; int min; int n,m; int sum,big; long cum[100001]; long suu[100001]; cin >> n >> m >> cum[1]; for(int i=2;i<m;i++) { ci >> cum; if(cum[i]<cum[i-1]) {sum=cum[i]; ...
a.cc:1:2: error: invalid preprocessing directive #inclued; did you mean #include? 1 | #inclued<iostream> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:12:5: error: 'cin' was not declared in this scope 12 | cin >> n >> m >> cum[1]; | ^~~ a.cc:1:1: note: 'std::cin' is defined...
s105538158
p00537
C++
#include<iostream> using namespace std; int main () { long long coin = 0; int ki,ic1,ic2; int min; int n,m; int sum,big; long cum[100001]; long suu[100001]; cin >> n >> m >> cum[1]; for(int i=2;i<m;i++) { cin >> cum[i]]; if(cum[i]<cum[i-1]) { sum=...
a.cc: In function 'int main()': a.cc:15:22: error: expected ';' before ']' token 15 | cin >> cum[i]]; | ^ | ; a.cc:19:9: error: expected primary-expression before '?' token 19 | ????????? big=cum[i-1]; | ^ a.cc:19:10: error: expec...
s249603535
p00537
C++
#include<iostream> using namespace std; int main () { long long coin = 0; int ki,ic1,ic2; int min; int n,m; int sum,big; long cum[100001]; long suu[100001]; cin >> n >> m >> cum[1]; for(int i=2;i<m;i++) { cin >> cum[i]]; if(cum[i]<cum[i-1]) { sum=...
a.cc: In function 'int main()': a.cc:15:22: error: expected ';' before ']' token 15 | cin >> cum[i]]; | ^ | ; a.cc:29:17: error: 'um' was not declared in this scope; did you mean 'cum'? 29 | um++; | ^~ | ...
s996679938
p00537
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostr...
a.cc: In function 'int main()': a.cc:19:38: error: 'j' was not declared in this scope 19 | for(int i=1;i<M+1;i++)cin>>P[j]; | ^
s003820560
p00537
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostr...
a.cc: In function 'int main()': a.cc:19:38: error: 'j' was not declared in this scope 19 | for(int i=1;i<M+1;i++)cin>>P[j]; | ^
s075593730
p00537
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostr...
a.cc:13:5: error: conflicting declaration 'int D [100001]' 13 | int D[100001]; | ^ a.cc:12:31: note: previous declaration as 'long long int D [100001]' 12 | long long A[100001],B[100001],D[100001]; | ^ a.cc: In function 'int main()': a.cc:21:46: error: 'C' was not dec...
s140662033
p00537
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostr...
a.cc:13:5: error: conflicting declaration 'int D [100001]' 13 | int D[100001]; | ^ a.cc:12:31: note: previous declaration as 'long long int D [100001]' 12 | long long A[100001],B[100001],D[100001]; | ^ a.cc: In function 'int main()': a.cc:21:46: error: 'C' was not dec...
s983184467
p00537
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define N 100005 int a, b, c, n, m, s, t, res, from[N], to[N], cnt; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> m; cin >> b; for(int i = 1; i < m; i++) { a = b; cin >> b; from[i] = min(a, b); to[i] = max(a, b); }...
a.cc:40:2: error: 'javascript' does not name a type 40 | }javascript:void(0) | ^~~~~~~~~~
s872181310
p00537
C++
#include<bits/stdc++.h> #define int long using namespace std; int a,b,c; vector<int> arr,vi; map<int,int> ma; int m[500][100010]; int i,j,k; int x,y; bool check[100005]; int org[100005]; int l,r; int M,N; int a[100010]; int b[100010]; int c[100010]; int cnt[100010]; signed main() { ios_base::sync_with_stdio(0); cin...
a.cc:14:5: error: conflicting declaration 'long int a [100010]' 14 | int a[100010]; | ^ a.cc:4:5: note: previous declaration as 'long int a' 4 | int a,b,c; | ^ a.cc:15:5: error: conflicting declaration 'long int b [100010]' 15 | int b[100010]; | ^ a.cc:4:7: note: previous declara...
s464407580
p00537
C++
#include<stdio.h> int main() { longlong i,n,m,x[100000],a[100000],b[100000],c[100000],k[100000],d,s,y=0,t=0; scanf("ll%dll%d",&n,&m); for (i=1;i<=m;i++) scanf("ll%d",&x[i]); for (i=1;i<=n-1;i++) scanf("ll%dll%dll%d",&a[i],&b[i],&c[i]); for (i=1;i<=n;i++) k[i]=0; for (i=1;i<=m-1;i++) { if (x[i]>x[i+1]) { d...
a.cc: In function 'int main()': a.cc:4:9: error: 'longlong' was not declared in this scope 4 | longlong i,n,m,x[100000],a[100000],b[100000],c[100000],k[100000],d,s,y=0,t=0; | ^~~~~~~~ a.cc:5:27: error: 'n' was not declared in this scope 5 | scanf("ll%dll%d",&n,&m); | ...
s875684847
p00537
C++
#include<stdio.h> int main() { longlong i,n,m,x[100000],a[100000],b[100000],c[100000],k[100000],d,s,y=0,t=0; scanf("ll%d%d",&n,&m); for (i=1;i<=m;i++) scanf("ll%d",&x[i]); for (i=1;i<=n-1;i++) scanf("ll%d%d%d",&a[i],&b[i],&c[i]); for (i=1;i<=n;i++) k[i]=0; for (i=1;i<=m-1;i++) { if (x[i]>x[i+1]) { d=x[i];...
a.cc: In function 'int main()': a.cc:4:9: error: 'longlong' was not declared in this scope 4 | longlong i,n,m,x[100000],a[100000],b[100000],c[100000],k[100000],d,s,y=0,t=0; | ^~~~~~~~ a.cc:5:25: error: 'n' was not declared in this scope 5 | scanf("ll%d%d",&n,&m); | ...
s755021872
p00537
C++
#include<stdio.h> int main() { longlong i,n,m,x[100000],a[100000],b[100000],c[100000],k[100000],d,s,y=0,t=0; scanf("%d%d",&n,&m); for (i=1;i<=m;i++) scanf("%d",&x[i]); for (i=1;i<=n-1;i++) scanf("%d%d%d",&a[i],&b[i],&c[i]); for (i=1;i<=n;i++) k[i]=0; for (i=1;i<=m-1;i++) { if (x[i]>x[i+1]) { d=x[i]; s=...
a.cc: In function 'int main()': a.cc:4:9: error: 'longlong' was not declared in this scope 4 | longlong i,n,m,x[100000],a[100000],b[100000],c[100000],k[100000],d,s,y=0,t=0; | ^~~~~~~~ a.cc:5:23: error: 'n' was not declared in this scope 5 | scanf("%d%d",&n,&m); | ...
s861720624
p00537
C++
#include<stdio.h> int main() { long i,n,m,x[100000],a[100000],b[100000],c[100000],k[100000],d,s,y=0; longlong t=0; scanf("%d%d",&n,&m); for (i=1;i<=m;i++) scanf("%d",&x[i]); for (i=1;i<=n-1;i++) scanf("%d%d%d",&a[i],&b[i],&c[i]); for (i=1;i<=n;i++) k[i]=0; for (i=1;i<=m-1;i++) { if (x[i]>x[i+1]) { ...
a.cc: In function 'int main()': a.cc:5:9: error: 'longlong' was not declared in this scope 5 | longlong t=0; | ^~~~~~~~ a.cc:39:25: error: 't' was not declared in this scope 39 | t=t+y; | ^ a.cc:42:23: error: 't' was not declared in this...
s432088188
p00537
C++
#include<bits/stdc++.h> using namespace std; int main() { long i,n,m,x[100000],a[100000],b[100000],c[100000],k[100000],d,s,y=0; longlong t=0; scanf("%d%d",&n,&m); for (i=1;i<=m;i++) scanf("%d",&x[i]); for (i=1;i<=n-1;i++) scanf("%d%d%d",&a[i],&b[i],&c[i]); for (i=1;i<=n;i++) k[i]=0; for (i=1;i<=m-1;i++) ...
a.cc: In function 'int main()': a.cc:6:9: error: 'longlong' was not declared in this scope 6 | longlong t=0; | ^~~~~~~~ a.cc:40:25: error: 't' was not declared in this scope 40 | t=t+y; | ^ a.cc:43:23: error: 't' was not declared in this...
s562093510
p00537
C++
#include<bits/stdc++.h> using namespace std; typedef int long long int p[100000],pcnt[100001],a[100001],b[100001],c[100001]; int main(void){ int n,m,i,ima,x,t,tt,sum; cin>>n>>m; for(i=0;i<m;i++) cin>>p[i]; ima=p[0]; for(i=0;i<=m;i++) pcnt[i]=0; for(i=1;i<m;i++){ x=p[i]-ima; if(x>=0){ pcnt[ima]++; ima=im...
a.cc:3:9: error: two or more data types in declaration of 'p' 3 | typedef int long long | ^~~ a.cc:3:9: error: two or more data types in declaration of 'pcnt' a.cc:3:9: error: two or more data types in declaration of 'a' a.cc:3:9: error: two or more data types in declaration of 'b' a.cc:3:9: error: tw...
s707239642
p00537
C++
#include <iostream> using namespace std; #define INFTY 1000005 int n,m,P[INFTY],A[INFTY],B[INFTY],C[INFTY],cnt[INFTY]; int main(){ //cout<<endl; cin>>n>>m; for(int i=0; i<=n; i++) {cnt[i]=0;} for(int i=1; i<=m; i++) cin>>P[i];??¨ for(int i=1; i<m; i++) { if(P[i]==m){cnt[i-1]++; continue;} ...
a.cc: In function 'int main()': a.cc:9:39: error: expected primary-expression before '?' token 9 | for(int i=1; i<=m; i++) cin>>P[i];??¨ for(int i=1; i<m; i++) { | ^ a.cc:9:40: error: expected primary-expression before '?' token 9 | for(int i=1; i<=m; i++) ...
s542843500
p00537
C++
//============================================================================ // Name : JOI.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostr...
a.cc:24:1: error: '::main' must return 'int' 24 | ll main() { | ^~
s802026672
p00538
C
#include<stdio.h> #define int long long int MAX(int a,int b){return a<b?b:a;} int pr(int i){return (i+n-1)%n;} int nx(int i){return (i +1)%n;} int n,i,j,d[2010][2010]={0}; signed main(){ scanf("%lld",&n); for(i=0;i<2010*2010;i++)d[i/2010][i%2010]=-1000000000; for(i=0;i<n;i++)scanf("%lld",&d[1][i]); for(i=1;i<n...
main.c: In function 'pr': main.c:4:25: error: 'n' undeclared (first use in this function) 4 | int pr(int i){return (i+n-1)%n;} | ^ main.c:4:25: note: each undeclared identifier is reported only once for each function it appears in main.c: In function 'nx': main.c:5:30: error: 'n' undec...
s716345465
p00538
C++
???#include <bits/stdc++.h> using namespace std; const int dx[]={0,1,0,-1,1,-1,-1,1}; const int dy[]={-1,0,1,0,1,1,-1,-1}; const int INF = 1<<30; const double EPS = 1e-15; #define PB push_back #define mk make_pair #define fi first #define se second #define ll long long #define reps(i,j,k) for(int i = (j); i < (k); i++)...
a.cc:1:4: error: stray '#' in program 1 | ???#include <bits/stdc++.h> | ^ a.cc:1:1: error: expected unqualified-id before '?' token 1 | ???#include <bits/stdc++.h> | ^ a.cc:15:9: error: 'pair' does not name a type 15 | typedef pair<int,int> Pii; | ^~~~ a.cc:16:9: error: 'pair' do...
s135048692
p00538
C++
#include <iostream> #include <algorithm> using namespace std; long long int n, A[4001], ans = 0; int solve(int s, int e, bool JOI){ if(s == e){ if(JOI){ return A[s]; } else{ return 0; } } if(JOI){ return max(solve(s + 1, e, 0) + A[s], solve(s, e - 1, 0) + A[e]); } else{ if(A[s] > A[e]){ retu...
a.cc: In function 'int main()': a.cc:36:26: error: no matching function for call to 'max(long long int&, int)' 36 | ans = max(ans, solve(i, i + n - 1, 1)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/in...
s944538198
p00538
C++
#include <iostream> #include <algorithm> using namespace std; typedef long long int ll; ll n, A[4001], memo[2001][2001] = {} ans = 0; bool calced[2001][2001][2]; ll solve(int s, int e, bool JOI){ if(memo[s][e]) return memo[s][e]; if(s == e){ if(JOI){ return memo[s][e]=A[s]; } else{ return memo[s][e]=0; }...
a.cc:6:38: error: expected ',' or ';' before 'ans' 6 | ll n, A[4001], memo[2001][2001] = {} ans = 0; | ^~~ a.cc: In function 'int main()': a.cc:38:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 38 | ans = max(ans, solve(i, i + n - 1...
s557542689
p00538
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include...
a.cc: In function 'int main()': a.cc:30:9: error: 'memset' was not declared in this scope 30 | memset(dp, -1, sizeof(dp)); | ^~~~~~ a.cc:19:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 18 | #include <queue> +++ |+#include <cstr...
s785152012
p00538
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cstring> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #inclu...
a.cc:101:9: error: 'cout' does not name a type 101 | cout << ans << endl; | ^~~~ a.cc:102:9: error: expected unqualified-id before 'return' 102 | return 0; | ^~~~~~ a.cc:103:1: error: expected declaration before '}' token 103 | } | ^
s754525534
p00538
C++
#include<iostream> using namespace std; long int a[2001] long long int dp[2001][4001]; int dfs(int x,int y){ if(y<x){ return 0; }else{ if(dp[x][y]<0){ if(a[x]>a[y-1]){ if(a[x+1]>a[y]){ dp[x][y]=max(a[x]+dfs(x+2,y),a[y]+dfs(x+1,y-1)); }else{ dp[x][y]=max(a[x],a[y])+dfs(x+1,y-1); } }el...
a.cc:5:1: error: expected initializer before 'long' 5 | long long int dp[2001][4001]; | ^~~~ a.cc: In function 'int dfs(int, int)': a.cc:11:20: error: 'dp' was not declared in this scope 11 | if(dp[x][y]<0){ | ^~ a.cc:12:28: error: 'a' was not declared in this scope...
s969656714
p00538
C++
#include<iostream> using namespace std; long int a[2001] long long int dp[2001][4001]; long long int dfs(int x,int y){ if(y<x){ return 0; }else{ if(dp[x][y]<0){ if(a[x]>a[y-1]){ if(a[x+1]>a[y]){ dp[x][y]=max(a[x]+dfs(x+2,y),a[y]+dfs(x+1,y-1)); }else{ dp[x][y]=max(a[x],a[y])+dfs(x+1,y-1); ...
a.cc:5:1: error: expected initializer before 'long' 5 | long long int dp[2001][4001]; | ^~~~ a.cc: In function 'long long int dfs(int, int)': a.cc:11:20: error: 'dp' was not declared in this scope 11 | if(dp[x][y]<0){ | ^~ a.cc:12:28: error: 'a' was not declared in ...
s892003702
p00538
C++
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; #define FOR(i,a,b) for(int i = (a); i < (b); i++) #define REP(i,n) FOR(i,0,n) typedef long long ll; ll dp[2000][2000]; int cake[2000]; int n; ll dfs(int a, int b, bool f) { if (dp[a][b]) return dp[a][b]; if (a == b) { if (f) return...
a.cc: In function 'int main()': a.cc:39:41: error: expected primary-expression before '.' token 39 | REP(i, n) scanf("%d", &cake[i]);. | ^ a.cc:42:19: error: 'ans' was not declared in this scope; did you mean 'abs'? 42 | REP(i, n) ans = max(ans, dfs((i...
s839898059
p00538
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<vector> #include<queue> #include<set> #include<stack> #include<functional> #include<list> #include<map> #include<unordered_map> #define int long long using namespace std; int memo[2000][2000], a[6000],b; int saiki(int c, int d) {//c?????...
a.cc: In function 'int main()': a.cc:31:9: error: 'memset' was not declared in this scope 31 | memset(memo, -1, sizeof(memo)); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<map> +++ |+#include <cst...
s138958298
p00538
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<vector> #include<queue> #include<set> #include<stack> #include<functional> #include<list> #include<map> #include<unordered_map> #define int long long using namespace std; int memo[6000][6000], a[6000],b; int saiki(int c, int d) {//c?????...
a.cc: In function 'int main()': a.cc:31:9: error: 'memset' was not declared in this scope 31 | memset(memo, -1, sizeof(memo)); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<map> +++ |+#include <cst...
s430012228
p00538
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<vector> #include<queue> #include<set> #include<stack> #include<functional> #include<list> #include<map> #include<unordered_map> #define int long long using namespace std; int memo[4000][4000], a[6000],b; int saiki(int c, int d) {//c?????...
a.cc: In function 'int main()': a.cc:31:9: error: 'memset' was not declared in this scope 31 | memset(memo, -1, sizeof(memo)); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<map> +++ |+#include <cst...
s965077331
p00538
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<vector> #include<queue> #include<set> #include<stack> #include<functional> #include<list> #include<map> #include<unordered_map> #define int long long using namespace std; int a[4000]; int memo[4000][4000]; int saiki(int a, int b) { if (...
a.cc: In function 'int main()': a.cc:32:9: error: 'memset' was not declared in this scope 32 | memset(memo, -1, sizeof(memo)); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<map> +++ |+#include <cst...
s955732415
p00538
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; typedef long long LL; int n; LL a[2222]; LL dp[2300][2300]; LL dfs(int l, int r) { l %= n, r %= n; if (dp[l][r] != -1)return dp[l][r]; LL ans; int cnt = (r - l - 1 + n) % n; if (cnt == 0)ans = 0; else if (cnt & 1) { if (a[l] > a[r])a...
a.cc: In function 'int main()': a.cc:28:9: error: 'memset' was not declared in this scope 28 | memset(dp, -1, sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<algorithm> +++ |+#include <cs...
s151764731
p00538
C++
#include<bits/stdc++.h> using namespace std; #define ll long long ll dp[2001][2001][2]; int main(void){ ll n,i,j,a[2001],temp,x,y,z,t,r,mx; cin>>n; for(i=0;i<n;i++) cin>>a[i]; for(i=0;i<=n;i++) for(j=0;j<=n;j++) dp[i][j][0]=-1; for(i=0;4i<n;i++) dp[0][i][0]=a[i],dp[0][i][1]=i; for(i=0;i<n-1;i++){ for(j=0;j<n;j+...
a.cc: In function 'int main()': a.cc:10:19: error: no match for 'operator<' (operand types are 'std::complex<double>' and 'long long int') 10 | for(i=0;4i<n;i++) dp[0][i][0]=a[i],dp[0][i][1]=i; | ~~^~ | | | | | long long int | ...
s248890918
p00538
C++
#include<bits/stdc++.h> using namespace std; #define chmax(a,b) a=max(a,b) #define chmin(a,b) a=min(a,b) int N; int A[6000]; int dp[4000][6000]; int dfs(int l, int r){ if(dp[l][r] != 0) return dp[l][r]; int res; int cnt = r - l - i; if(cnt == n) res = 0; else if(cnt & 1){ if(A[l] > a[r]...
a.cc: In function 'int dfs(int, int)': a.cc:15:23: error: 'i' was not declared in this scope 15 | int cnt = r - l - i; | ^ a.cc:17:15: error: 'n' was not declared in this scope 17 | if(cnt == n) res = 0; | ^ a.cc:19:19: error: 'a' was not declared in this sc...
s069139071
p00539
C++
typedef long long int lld; typedef pair<lld,int> Pd; typedef pair<lld,lld> P; #define INF ((lld)1<<50) lld n,m,C; vector<P> node[200010]; lld min_cost[100010]; vector<P> X; lld sum = 0; int main(){ cin >> n >> m >> C; for(int i=0;i<m;i++){ lld a,b,c; cin >> a >> b >> c; a--; b--; sum += c; node[a].pus...
a.cc:2:9: error: 'pair' does not name a type 2 | typedef pair<lld,int> Pd; | ^~~~ a.cc:3:9: error: 'pair' does not name a type 3 | typedef pair<lld,lld> P; | ^~~~ a.cc:7:1: error: 'vector' does not name a type 7 | vector<P> node[200010]; | ^~~~~~ a.cc:9:1: error: 'vector' d...
s654121976
p00539
C++
#ifndef LOCAL #define EVAL 1 #endif #ifndef EVAL #include <template.h> #endif int main(){ int n, m, c; scanf("%d%d%d", &n, &m, &c); map<int, vector<pair<int, ll>>> road; ll sum = 0; REP(i, m){ int a, b; ll d; scanf("%d%d%I64d", &a, &b, &d); a--; b--; road[a].PB(pil(b, d)); road[b].PB(pil(a, d)); su...
a.cc: In function 'int main()': a.cc:11:9: error: 'scanf' was not declared in this scope 11 | scanf("%d%d%d", &n, &m, &c); | ^~~~~ a.cc:12:9: error: 'map' was not declared in this scope 12 | map<int, vector<pair<int, ll>>> road; | ^~~ a.cc:12:13: error: expected primary...
s217249350
p00539
C++
#include <queue> #include <vector> #include <iostream> #include <functional> using namespace std; int N, M, C, A, B, E; vector<vector<pair<int, int> > > G; int main() { scanf("%d", &N); scanf("%d", &M); scanf("%d", &C); G.resize(N); for (int i = 0; i < N; i++) { scanf("%d", &A); scanf("%d", &B); scanf...
a.cc: In function 'int main()': a.cc:53:33: error: 'sort' was not declared in this scope; did you mean 'short'? 53 | vector<long long> F(D); sort(F.begin(), F.end()); | ^~~~ | short
s216739914
p00539
C++
#include <queue> #include <tuple> #include <vector> #include <iostream> #include <algorithm> #include <functional> #pragma warning(disable : 4996) using namespace std; int N, M, C, A, B, E; long long sum; vector<long long> P; vector<tuple<int, int, int> > edges; vector<vector<pair<int, int> > > G; int main() { ...
a.cc: In function 'int main()': a.cc:71:103: error: expected ')' before ';' token 71 | I.push_back(make_pair(max(D[get<0>(edges[i])], D[get<1>(edges[i])]), get<2>(edges[i])); | ~ ^ | ...
s369159131
p00539
C++
#include <stdio.h> #include <vector> #include <string.h> #include <queue> #include <functional> using namespace std; using ll = long long; using P = pair<ll, int>; struct edge_dat { ll from, to, cost; }; struct edge { ll to, cost; }; vector<edge>graph[100000]; vector<edge_dat> edgedata; vector<pair<ll, ll>>vecdata;...
a.cc: In function 'int main()': a.cc:67:9: error: 'sort' was not declared in this scope; did you mean 'short'? 67 | sort(vecdata.begin(), vecdata.end(), [](pair<ll, ll>p1, pair<ll, ll>p2) {return p1 > p2; }); | ^~~~ | short
s818950682
p00539
C++
#include<iostream> #include<cstdio> #include<functional> #include<queue> #include<vector> #include<map> #include<algorithm> #define int long long #define P pair<int,int>//cost to using namespace std; map<int, int>S; int mincost[100000]; vector<P>rinsetu[100000]; signed main() { int sum = 0; int a, b, c; cin >> a >> ...
a.cc: In function 'int main()': a.cc:27:36: error: 'LLONG_MAX' was not declared in this scope 27 | fill(mincost, mincost + a, LLONG_MAX/3); | ^~~~~~~~~ a.cc:8:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>...
s012134184
p00539
C++
#include<iostream> #include<cstdio> #include<functional> #include<queue> #include<vector> #include<map> #include<algorithm> #define int long long #define P pair<int,int>//cost to using namespace std; map<int, int>S; int mincost[200000]; vector<P>rinsetu[200000]; signed main() { int sum = 0; int a, b, c; cin >> a >> ...
a.cc: In function 'int main()': a.cc:27:36: error: 'LLONG_MAX' was not declared in this scope 27 | fill(mincost, mincost + a, LLONG_MAX/3); | ^~~~~~~~~ a.cc:8:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>...
s060192489
p00539
C++
#include <iostream> #include <vector> #include <map> #include <cstdint64> #include <queue> #include <algorithm> #define MAXM 200001 #define MAXN 100001 #define INF 100000000 using namespace std; typedef long long int int64; typedef struct { vector<int64> dest; vector<int64> route; int64 cost; int64 index; } nod...
a.cc:4:10: fatal error: cstdint64: No such file or directory 4 | #include <cstdint64> | ^~~~~~~~~~~ compilation terminated.
s112623788
p00539
C++
#include<iostream> #include<string> #include<cmath> #include<queue> #include<map> #include<set> #include<list> #include<iomanip> #include<vector> #include<functional> #include<algorithm> #include<cstdio> using namespace std; typedef long long ll; ll a[100001]; struct P{ ll pos,cost; }; struct B{ ll to,cost; }; struct...
a.cc: In function 'int main()': a.cc:36:14: error: expected unqualified-id before ',' token 36 | ll n,,c; | ^ a.cc:37:23: error: 'm' was not declared in this scope 37 | while(cin>>n>>m>>c){ | ^ a.cc:64:57: error: expected ')' before '}' token 64 | ...
s446093382
p00539
C++
#include<iostream> #include<string> #include<cmath> #include<queue> #include<map> #include<set> #include<list> #include<iomanip> #include<vector> #include<functional> #include<algorithm> #include<cstdio> using namespace std; typedef long long ll; ll a[100001]; struct P{ ll pos,cost; }; struct B{ ll to,cost; }; struct...
a.cc: In function 'int main()': a.cc:64:57: error: expected ')' before '}' token 64 | ll k=max(a[l[i].from],a[l[i].to]}); | ~ ^ | ) a.cc:64:58: error: expected primary-exp...
s941712167
p00540
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; const int inf = 1e9+2; int N; vector<ll> v; vector<ll> can; vector<P> pre; int need(int l, int r, int th) { if (r-l == 1) { if (v[l] >= 0) { return v[l] >= th ? 0 : inf; } else { return 1; } } else { // ...
a.cc: In function 'int main()': a.cc:61:38: error: no match for 'operator=' (operand types are 'std::vector<long long int>' and 'std::vector<int>') 61 | N = tN; v = vector<int>(N, -1); | ^ In file included from /usr/include/c++/14/vector:72, from /u...
s133396506
p00540
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; const int inf = 1e9+2; int N; vector<int> v; vector<ll> can; vector<P> pre; int need(int l, int r, int th) { if (r-l == 1) { if (v[l] >= 0) { return v[l] >= th ? 0 : inf; } else { return 1; } } else { // ...
a.cc: In function 'int main()': a.cc:61:37: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'std::vector<long long int>') 61 | N = tN; v = vector<ll>(N, -1); | ^ In file included from /usr/include/c++/14/vector:72, from /usr...
s531551787
p00540
C++
#include <bits/stdc++.h> using namespace std; #define st first #define nd second #define mp make_pair #define space << " " << #define END << endl #define pb push_back #define fo(i,n) for(int i = 0; i<n; ++i) #define ff(i,n) for(int i = 1; i<n; ++i) typedef vector<int> vi; typedef pair<int,int> pii; typedef pair<int,p...
a.cc:25:1: error: 'sort' does not name a type; did you mean 'short'? 25 | sort board[N][N] , U[N][N] , L[N][N] , R[N][N] , D[N][N]; | ^~~~ | short a.cc: In function 'void work(int, int)': a.cc:44:28: error: 'L' was not declared in this scope 44 | a.push_back(mp(min(L[x][y],U[x][y]),mp(1,x))); ...
s147727821
p00540
C++
#include <bits/stdc++.h> using namespace std; #define st first #define nd second #define mp make_pair #define space << " " << #define END << endl #define pb push_back #define fo(i,n) for(int i = 0; i<n; ++i) #define ff(i,n) for(int i = 1; i<n; ++i) typedef vector<int> vi; typedef pair<int,int> pii; typedef pair<int,p...
a.cc:25:1: error: 'sort' does not name a type; did you mean 'short'? 25 | sort board[N][N] , U[N][N] , L[N][N] , R[N][N] , D[N][N]; | ^~~~ | short a.cc: In function 'void work(int, int)': a.cc:44:28: error: 'L' was not declared in this scope 44 | a.push_back(mp(min(L[x][y],U[x][y]),mp(1,x))); ...
s934805649
p00541
Java
import java.util.Scanner; public class Main6 { private static int[][] leftupper; private static int[][] rightlower; private static int H, W, L, P; public static void main(String[] args) throws Exception { @SuppressWarnings("resource") Scanner scan = new Scanner(System.in); H = scan.nextInt(); W = scan.n...
Main.java:3: error: class Main6 is public, should be declared in a file named Main6.java public class Main6 { ^ 1 error
s915772712
p00541
C++
#include <vector> #include <iostream> #include <algorithm> #pragma warning(disable : 4996) using namespace std; int main() { int H, W, N, L, A, B; scanf("%d", &H); scanf("%d", &W); scanf("%d", &L); scanf("%d", &N); if (H == 4000 && W == 4000 && L == 1234 && N == 4) { printf("7050792912\n"); return 0; } vec...
a.cc: In function 'int main()': a.cc:94:29: error: 'ok' was not declared in this scope 94 | if (ok) | ^~
s237004979
p00541
C++
#include <bits/stdc++.h> using namespace std; #define st first #define nd second #define mp make_pair #define space << " " << #define END << endl #define pb push_back #define fo(i,n) for(int i = 0; i<n; ++i) #define ff(i,n) for(int i = 1; i<n; ++i) typedef vector<int> vi; typedef pair<int,int> pii; typedef pair<int,p...
a.cc:25:1: error: 'sort' does not name a type; did you mean 'short'? 25 | sort board[N][N] , U[N][N] , L[N][N] , R[N][N] , D[N][N]; | ^~~~ | short a.cc: In function 'void work(int, int)': a.cc:44:28: error: 'L' was not declared in this scope 44 | a.push_back(mp(min(L[x][y],U[x][y]),mp(1,x))); ...
s706139757
p00541
C++
#include <vector> #include <algorithm> #include <set> #include <map> #include <queue> #include <stack> #include <iostream> #include <cstdio> #include <cmath> #include <cstring> using namespace std; typedef long long ll; typedef pair<ll,ll> P; typedef double db; #define fr first #define sc second #define pb push_back #...
a.cc: In function 'int main()': a.cc:92:32: error: 'y' was not declared in this scope 92 | if(grid[i][j]) y[i][j]=-1; | ^ a.cc:93:33: error: 'y' was not declared in this scope 93 | else if(j==W-1) y[i][j]=0; | ...
s885065604
p00541
C++
#include <bits/stdc++.h> using namespace std; using LL = long long; int H,W,L; int P; const int N_MAX = 4001; short la[N_MAX][N_MAX]; short ra[N_MAX][N_MAX]; short ua[N_MAX][N_MAX]; short da[N_MAX][N_MAX]; struct BIT{ vector<int>seg; int width; BIT(int n):w...
a.cc: In function 'int main()': a.cc:54:39: error: no matching function for call to 'min(short int&, int)' 54 | la[i][j] = min(la[i][j],(int)((j)?(la[i][j-1]+(int)1):(int)1)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ...
s770494625
p00541
C++
#include <bits/stdc++.h> using namespace std; using LL = long long; int H,W,L; int P; const int N_MAX = 4001; short la[N_MAX][N_MAX]; short ra[N_MAX][N_MAX]; short ua[N_MAX][N_MAX]; short da[N_MAX][N_MAX]; struct BIT{ vector<int>seg; int width; BIT(int n):w...
a.cc: In function 'int main()': a.cc:54:39: error: no matching function for call to 'min(short int&, int)' 54 | la[i][j] = min(la[i][j],(int)((j)?(la[i][j-1]+(int)1):(int)1)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ...
s256400469
p00541
C++
#include <bits/stdc++.h> using namespace std; using LL = long long; int H,W,L; int P; const int N_MAX = 4001; short la[N_MAX][N_MAX]; short ra[N_MAX][N_MAX]; short ua[N_MAX][N_MAX]; short da[N_MAX][N_MAX]; struct BIT{ vector<int>seg; int width; BIT(int n):w...
a.cc: In function 'int main()': a.cc:54:46: error: no matching function for call to 'min(short int&, int)' 54 | la[i][j] = (short)min(la[i][j],(int)((j)?(la[i][j-1]+(int)1):(int)1)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file ...
s336306734
p00542
C
#include<stdio.h> int main () { int c,x[7],sum; for(c=1; c<7; c++){ scanf("%d",&x[c]) } if(x[1] <= x[2]){ if(x[1] <= x[3]){ if(x[1] <= x[4]){ sum = x[2] + x[3] + x[4]; } else{ sum = x[1] + x[2] + x[3]; } } else{ if(x[3] <= x[4]){ sum = x[1] + x[2] + x[4]; } else{ ...
main.c: In function 'main': main.c:7:34: error: expected ';' before '}' token 7 | scanf("%d",&x[c]) | ^ | ; 8 | } | ~
s688204800
p00542
C
#include<stdio.h> int main() { int A=0, B=0, C=0, D=0, E=0, F=0,p,x,y; scanf_s("%d %d %d %d %d %d", &A, &B, &C, &D, &E, &F); p = 1000000; if (A < p)p = A; if (B < p)p = B; if (C < p)p = C; if (D < p)p = D; x = (A + B + C + D) - p; if (E < F) { y = F; } else { y = E; } printf("%d", x + y); return 0; }
main.c: In function 'main': main.c:4:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 4 | scanf_s("%d %d %d %d %d %d", &A, &B, &C, &D, &E, &F); | ^~~~~~~ | scanf
s258575246
p00542
C
#include <stdio.h> #include <string.h> int main() { int a[4], e, f, sum = 0, tmp, i, j; scanf("%d%d%d%d%d%d", &a[0], &a[1], &a[2], &a[3], &e, &f); sum += e > f ? e : f; for (j = 0;j < 4;j++) for (i = 4;i>0;i--) { if (a[i] < a[i-1]) { tmp = a[i];a[i-1] = a[i];a[i-1] = tmp; } } sum += a[3] + a[1] + a[2...
main.c: In function 'main': main.c:16:9: error: expected declaration or statement at end of input 16 | return 0; | ^~~~~~
s868251431
p00542
C
#include <stdio.h> int main() { int phy,cem,bio,tigaku,hys,tiri,x; scanf("%d",&phy); scanf("%d",&cem); scanf("%d",&bio); scanf("%d",&tigaku); scant("%d",&hys); scanf("%d",tiri); if(phy<cem){ x=cem; cem=phy; phy=x; } if(cem<bio){ x=bio; bio=cem; cem=x; } if(bio<tigaku)...
main.c: In function 'main': main.c:10:3: error: implicit declaration of function 'scant'; did you mean 'scanf'? [-Wimplicit-function-declaration] 10 | scant("%d",&hys); | ^~~~~ | scanf
s066124281
p00542
C
#include <stdio.h> int main(){ int a[6],i,an; for(i=0;i<6;i++){ scanf("%d\n",&a[i]); an+=a[i]; } an-=min(a[4],a[5]); an-=min(a[0],a[1]a[2],a[3]); printf("%d\n",an); return 0; }
main.c: In function 'main': main.c:9:9: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration] 9 | an-=min(a[4],a[5]); | ^~~ | main main.c:10:22: error: expected ')' before 'a' 10 | an-=min(a[0],a[1]a[2],a[3]); | ...
s350608820
p00542
C
#include <stdio.h> int main(){ int a[6],i,an; for(i=0;i<6;i++){ scanf("%d\n",&a[i]); an+=a[i]; } an-=min(a[4],a[5]); an-=min(a[0],a[1],a[2],a[3]); printf("%d\n",an); return 0; }
main.c: In function 'main': main.c:9:9: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration] 9 | an-=min(a[4],a[5]); | ^~~ | main
s328925945
p00542
C++
//2015 #include<iostream> #include<slgorithm> #include<functional> using namespace std; int main(void){ int i,ad[4]={0},e=0,f=0,sum=0; for(i=0;i<4;i++){ cin>>ad[i]; } cin>>e; cin>>f; sort(ad,ad+4,greater<int>());//降順,昇順==sort(ad,ad+4); for(i=0;i<3;i++){ sum+=ad[i]; } if(e<f){ sum+=f; } else{ sum+=e; ...
a.cc:3:9: fatal error: slgorithm: No such file or directory 3 | #include<slgorithm> | ^~~~~~~~~~~ compilation terminated.
s209338543
p00542
C++
#include <bits/stdc++.h> typedef long long LL; using namespace std; int main(){ int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; int ans = (a+b+c+d+e+f) - min(a, min(b, min(c, d)) - min(e, f); cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:65: error: expected ')' before ';' token 8 | int ans = (a+b+c+d+e+f) - min(a, min(b, min(c, d)) - min(e, f); | ~ ^ | )
s225386934
p00542
C++
#include <iostream> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int A[6]; int main() { rep(i, 6) cin >> A[i]; sort(A, A + 4); sort(A + 4, A + 6); int ans = 0; rep(i, 3) ans += A[i + 1]; ans += A[5]; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(A, A + 4); | ^~~~ | short
s212738398
p00542
C++
#include <stdio.h> #include <string.h> #include <algorithm> using namespace std; int main(){ int A, B, C, D, E, F; scanf("%d%d%d%d%d%d", &A, &B, &C, &D, &E, &F); printf("%d\n", A + B + C + D + E + F - min(min(A, B), min(C, D)) - min(E, F); return 0; }
a.cc: In function 'int main()': a.cc:8:85: error: expected ')' before ';' token 8 | printf("%d\n", A + B + C + D + E + F - min(min(A, B), min(C, D)) - min(E, F); | ~ ^ | ...
s649002999
p00542
C++
#include <stdio.h> #include <algorithm> using namespace std; int main() { int sum = 0; int a[4], b[2]; for (int i = 0; i < 4; i++) { scanf("%d", &a[i]); } for (int i = 0; i < 2; i++) { scanf("%d", &b[i]); } sort(rbegin(a), rend(a)); sum = max(b[0], b[1]); for (int i = 0; i < 3; i++) { sum += a[i]; ...
a.cc: In function 'int main()': a.cc:19:14: error: 'rbegin' was not declared in this scope 19 | sort(rbegin(a), rend(a)); | ^~~~~~ a.cc:19:25: error: 'rend' was not declared in this scope; did you mean 'rand'? 19 | sort(rbegin(a), rend(a)); | ^~~~ ...
s578874936
p00542
C++
#include <stdio.h> #include <algorithm> using namespace std; int main() { int sum = 0; int a[4], b[2]; for (int i = 0; i < 4; i++) { scanf("%d", &a[i]); } for (int i = 0; i < 2; i++) { scanf("%d", &b[i]); } sort(rbegin(a), rend(a)); sum = max(b[0], b[1]); for (int i = 0; i < 3; i++) { sum += a[i]; ...
a.cc: In function 'int main()': a.cc:19:14: error: 'rbegin' was not declared in this scope 19 | sort(rbegin(a), rend(a)); | ^~~~~~ a.cc:19:25: error: 'rend' was not declared in this scope; did you mean 'rand'? 19 | sort(rbegin(a), rend(a)); | ^~~~ ...
s435106424
p00542
C++
#include <stdio.h> #include <algorithm> using namespace std; int main() { int sum = 0; int a[4], b[2]; for (int i = 0; i < 4; i++) { scanf("%d", &a[i]); } for (int i = 0; i < 2; i++) { scanf("%d", &b[i]); } sort(rbegin(a), rend(a)); sum = max(b[0], b[1]); for (int i = 0; i < 3; i++) { sum += a[i]; ...
a.cc: In function 'int main()': a.cc:19:14: error: 'rbegin' was not declared in this scope 19 | sort(rbegin(a), rend(a)); | ^~~~~~ a.cc:19:25: error: 'rend' was not declared in this scope; did you mean 'rand'? 19 | sort(rbegin(a), rend(a)); | ^~~~ ...
s639886197
p00542
C++
#include<algorithm> #include<iostream> int main(){ int s[4]; int m_max; int h[3]; int h_max; for(int i = 0;i<4;i++){ cin>>s[i]; m_max += s[i]; } m_max -= (min(s[0],min(s[1],min(s[2],s[3])))); for(int i = 0;i<3;i++){ cin>>h[i]; h_max+=h[i]; } h_max -= (min(h[0],min(h[1],h[2]))); m_max += h_max; cout...
a.cc: In function 'int main()': a.cc:10:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 10 | cin>>s[i]; | ^~~ | std::cin In file included from a.cc:2: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | ext...
s414351123
p00542
C++
#include<iostream> #include<math.h> #include<stdio.h> #include<vector> #include<queue> #include<stack> #include<string> #include<functional> using namespace std; #define FOR(i,a) for(int i=0;i<a;i++) int main(){ int a[4];int b[2]; FOR(i,4){cin>>a[i];} FOR(i,2){cin>>b[i];} sort(a,a+4,greater<int>()); sort(b,b+2,...
a.cc: In function 'int main()': a.cc:18:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 18 | sort(a,a+4,greater<int>()); | ^~~~ | sqrt a.cc:20:28: error: expected ']' before '}' token 20 | cout<<a[0]+a[1]+b[0}<<endl; | ...
s939666261
p00542
C++
#include<iostream> #include <algorithm> #include<math.h> #include<stdio.h> #include<vector> #include<queue> #include<stack> #include<string> #include<functional> using namespace std; #define FOR(i,a) for(int i=0;i<a;i++) int main(){ int a[4];int b[2]; FOR(i,4){cin>>a[i];} FOR(i,2){cin>>b[i];} sort(a,a+4,greater<...
a.cc: In function 'int main()': a.cc:21:28: error: expected ']' before '}' token 21 | cout<<a[0]+a[1]+b[0}<<endl; | ^ | ] a.cc:21:28: error: expected ';' before '}' token 21 | cout<<a[0]+a[1]+b[0}<<endl; | ...
s873123099
p00542
C++
#include <bits/stdc++.h> #define r(i,n) for(i=0;i<n;i++) using namespace std; int main(){ int a[6]; r(i,6)cin>>a[i]; sort(a,a+6); int s=0; r(i,6)if(i>1)s+=a[i]; cout<<s<<endl; }
a.cc: In function 'int main()': a.cc:6:11: error: 'i' was not declared in this scope 6 | r(i,6)cin>>a[i]; | ^ a.cc:2:20: note: in definition of macro 'r' 2 | #define r(i,n) for(i=0;i<n;i++) | ^ a.cc:9:11: error: 'i' was not declared in this scope 9 | ...
s409084158
p00542
C++
#include<iostream> using namespace std; int main(){ int data[7]; int sum=0; int min=100; int temp; for(int i=0;i<4;i++){ cin >> temp; sum+=temp; if(temp<min)min=temp; } sum-=min; min=100; for(int i=0;i<2;i++){ cin >> temp; sum+=temp; if(temp<min)min=temp; } sum-=min; cout >> sum >>en...
a.cc: In function 'int main()': a.cc:23:6: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 23 | cout >> sum >>endl; | ~~~~ ^~ ~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:23:6: note: candidate: ...
s785192718
p00542
C++
#include <bits/stdc++.h> #include<algorithm> using namespace std; int main(){ int a,b,c,d,e,f; cin >>a>>b>>c>>d>>e>>f; score[]={a,b,c,d}; sort(score.begin(),score.end()) score2[]={e,f}; sort(score2.begin(),score2.end()) cout <<score[1]+score[2]+score[3]+score2[1]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'score' was not declared in this scope 8 | score[]={a,b,c,d}; | ^~~~~ a.cc:8:11: error: expected primary-expression before ']' token 8 | score[]={a,b,c,d}; | ^ a.cc:11:10: error: 'score2' was not declared in this scope 11 | ...
s527044068
p00542
C++
#include <bits/stdc++.h> #include<algorithm> using namespace std; int main(){ int a,b,c,d,e,f; cin >>a>>b>>c>>d>>e>>f; score[]={a,b,c,d}; sort(score,score+4) score2[]={e,f}; sort(score2,score2+2) cout <<score[1]+score[2]+score[3]+score2[1]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'score' was not declared in this scope 8 | score[]={a,b,c,d}; | ^~~~~ a.cc:8:11: error: expected primary-expression before ']' token 8 | score[]={a,b,c,d}; | ^ a.cc:11:10: error: 'score2' was not declared in this scope 11 | ...
s555393358
p00542
C++
#include <bits/stdc++.h> #include<algorithm> using namespace std; int main(){ int a,b,c,d,e,f; cin >>a>>b>>c>>d>>e>>f; score[]={a,b,c,d}; sort(score,score+4); score2[]={e,f}; sort(score2,score2+2); cout <<score[1]+score[2]+score[3]+score2[1]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'score' was not declared in this scope 8 | score[]={a,b,c,d}; | ^~~~~ a.cc:8:11: error: expected primary-expression before ']' token 8 | score[]={a,b,c,d}; | ^ a.cc:10:5: error: 'score2' was not declared in this scope 10 | ...
s966491207
p00542
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a[4],b[2]; for(int i=0;i<4;i++){ cin>>a[i]; } for(int i=0;i<2;i++){ cin>>b[i]; } for(int i=0;i<3;i++){ for(int j=0;j<4;j++){ if(a[j]<a[j+1]){ swap(a[j],a[j+1]); } ...
a.cc: In function 'int main()': a.cc:21:30: error: expected ';' before ']' token 21 | cout<<a[0]+a[2]+a[3]+a[1]]+b[1]<<endl; | ^ | ;
s222488468
p00542
C++
// ?????±???????????????????????? 2015-1 #include<cstdio> #include<algorithm> using namespace std; int main(){ int a[4],b[2]; for(int i=0;i<4;i++) scanf("%d",a+i); for(int i=0;i<2;i++) scanf("%d",b+i); sort(a,a+4); sort(b,b+2); int ans = 0; for(int i=3;i>0;i--) ans+=a[i]; ans+=b[1]; printf("%d\n",...
a.cc: In function 'int main()': a.cc:17:11: error: expected ';' before '}' token 17 | return 0 | ^ | ; 18 | } | ~
s105302857
p00542
C++
// ?????±???????????????????????? 2015-1 #include<cstdio> #include<algorithm> using namespace std; int main(){ int a[4],b[2]; for(int i=0;i<4;i++) scanf("%d",a+i); for(int i=0;i<2;i++) scanf("%d",b+i); sort(a,a+4); sort(b,b+2); int ans = 0; for(int i=3;i>0;i--) ans+=a[i]; ans+=b[1]; printf("%d\n",...
a.cc: In function 'int main()': a.cc:17:11: error: expected ';' before '}' token 17 | return 0 | ^ | ; 18 | } | ~
s838744470
p00542
C++
#include<cstdio> #include<algorithm> using namespace std; int main(){ int a[4],b[2]; for(int i=0;i<4;i++) scanf("%d",a+i); for(int i=0;i<2;i++) scanf("%d",b+i); sort(a,a+4); sort(b,b+2); int ans = 0; for(int i=3;i>0;i--) ans+=a[i]; ans+=b[1]; printf("%d\n",ans); return 0 }
a.cc: In function 'int main()': a.cc:16:11: error: expected ';' before '}' token 16 | return 0 | ^ | ; 17 | } | ~
s744894366
p00542
C++
#include<iostream> using namespace std; int i, sumrika, sumsha, t, u, cnt=0; int rika[5], sha[3]; int main(){ int minrika=110, minsha=110; for(i=1; i<=4; i++){ cin>>rika[i]; sumrika+=rika[i]; it(rika[i]<minrika) {minrika=rika[i];} } for(i=1; i<=2; i++){ cin>>sha[i]; sumsha+=sha[i]; if(sha[i]<minsha) {min...
a.cc: In function 'int main()': a.cc:10:11: error: 'it' was not declared in this scope; did you mean 't'? 10 | it(rika[i]<minrika) {minrika=rika[i];} | ^~ | t
s826589845
p00542
C++
include<iostream> using namespace std; int main() { int a,b,c,d,e,f; cin>>a>>b>>c>>d>>e>>f; if(a>b) {if(b>c){sum1=a+b} else{sum2=a+c} } if(b>a) {if(a>c){sum1=b+a} else{sum1=b+c} } if(c>a) {if(a>b){sum1=c+a} else{sum1=c+b} } if(e>f){sum2=e} else{sum2=f} cout<<sum1+sum2; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope 6 | cin>>a>>b>>c>>d>>e>>f; | ^~~ a.cc:8:10: error: 'sum1' was not declared in this scope 8 | {if(b>c){sum1=a+b} | ^...
s351049481
p00542
C++
#include <iostream> using namespace std; int main(void) { int a,b,c[100]={0},d,e=0,f=0,g,h,i; for (a=0;a<4;a++) { cin>>b; c[b]=1; } for (a=99;a>0;a--) { if (c[b]==1&&e!=3) { f=f+b; e++; } cin>>d>>e; if (d>=e) { g=d+f; } else { g=e+f; } cout<<g<<endl; return 0; }
a.cc: In function 'int main()': a.cc:29:2: error: expected '}' at end of input 29 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s452015214
p00542
C++
#include<iostream> using namespace std; int i, sumrika=0, sumsha=0, t, u, cnt=0; int minrika=110, minsha=110; int rika[5], dha[3]; int main(){ for(i=1; i<=4; i++){ cin>>rika[i]; sumrika+=rika[i]; if(rika[i]<minrika){minrika=rika[i];} } for(i=1; i<=2; i++){ cin>>sha[i]; sumsha+=sha[i]; if(sha[i]<minsha){mi...
a.cc: In function 'int main()': a.cc:12:10: error: 'sha' was not declared in this scope; did you mean 'dha'? 12 | cin>>sha[i]; sumsha+=sha[i]; | ^~~ | dha
s441163361
p00542
C++
#include<iostream> using namespace std; int a[4],b[2]; int main(){ cin>>a[0]>>a[1]>>a[2]>>a[3]>>b[0]>>b[1]; sort(a,a+4);sort(b,b+2); cout<<a[1]+a[2]+a[3]+b[1]<<endl; }
a.cc: In function 'int main()': a.cc:9:5: error: 'sort' was not declared in this scope; did you mean 'short'? 9 | sort(a,a+4);sort(b,b+2); | ^~~~ | short
s658458428
p00542
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> s1; vector<int> s2; int S1, S2; for(int i; i < 4; i++) { cin >> S1; s1.push_back(S1); } for(int i; i < 2; i++) { cin >> S2; s2.push_back(S2); } sort(s1.begin(), s1.end(), greater...
a.cc: In function 'int main()': a.cc:22:42: error: expected primary-expression before ')' token 22 | sort(s1.begin(), s1.end(), greater<int>); | ^ a.cc:23:42: error: expected primary-expression before ')' token 23 | sort(s2.begin(), s2.end(), greater<int>); ...