submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s695332308
p03864
C++
// https://atcoder.jp/contests/arc064/tasks/arc064_a #include <bits/stdc++.h> using namespace std; #define watch(x) cerr << (#x) << " is " << (x) << endl; #define endl '\n' #define int long long signed main() { ios::sync_with_stdio(0); cin.sync_with_stdio(0); c...
a.cc: In function 'int main()': a.cc:23:23: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)' 23 | ans += max(0, (a[i]+a[i-1])-x); | ~~~^~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c+...
s222695562
p03864
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) #define all(x) (x).begin(),(x).end() #define cyes cout<<"YES"<<endl #define cno cout<<"NO"<<endl #define sp <<" "<< #define cst(x) cout<<fixed<<setprecision(x) #define pi 3.14159265359 #define mod 1000000007 #define int long long using namespace std; using ...
cc1plus: error: '::main' must return 'int'
s381298640
p03864
C++
#include<bits/stdc++.h> using namespace std; int main () { int N; long long x; cin >> N >> x; vector<long long>A(N); for (int i = 0; i < N; i ++) cin >> A[i]; long long ans = 0; for (int i = 1; i < N; i ++) { long long kj = A[i - 1] + A[i] - x; if (kj <= 0) continue; ans += kj; A[i] = max(...
a.cc: In function 'int main()': a.cc:14:15: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)' 14 | A[i] = max(0, A[i] - x); | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s394090948
p03864
C++
#include <bits/stdc++.h> using namespace std; #define int long long int N,X; int A[100001]; int32_t main(){ cin>>N>>X; int ans = 0; for (int i=0;i<N;i++) cin>>A[i]; for (int i=1;i<N;i++){ if (A[i] + A[i-1] > X){ ans += A[i] - max(0,X-A[i-1]); A[i] = max(0,X-A[i-1]); } if (A[i-1]...
a.cc: In function 'int32_t main()': a.cc:13:34: error: no matching function for call to 'max(int, long long int)' 13 | ans += A[i] - max(0,X-A[i-1]); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64...
s937916885
p03864
C++
#include <bits/stdc++.h> using namespace std; #define int ll int N,X; int A[100001]; int32_t main(){ cin>>N>>X; int ans = 0; for (int i=0;i<N;i++) cin>>A[i]; for (int i=1;i<N;i++){ if (A[i] + A[i-1] > X){ ans += A[i] - max(0,X-A[i-1]); A[i] = max(0,X-A[i-1]); } if (A[i-1] > X){ ...
a.cc:3:13: error: 'll' does not name a type 3 | #define int ll | ^~ a.cc:4:1: note: in expansion of macro 'int' 4 | int N,X; | ^~~ a.cc:3:13: error: 'll' does not name a type 3 | #define int ll | ^~ a.cc:5:1: note: in expansion of macro 'int' 5 | int A[100001]; ...
s445741362
p03864
C++
#include <bits/stdc++.h> using namespace std; int N,X; int A[100001] int main(){ cin>>N>>X; int ans = 0; for (int i=0;i<N;i++) cin>>A[i]; for (int i=1;i<N;i++){ if (A[i] + A[i-1] > X){ ans += A[i-1] - max(0,X - A[i]); A[i-1] = max(0,X - A[i]); } if (A[i-1] > X){ ans += ...
a.cc:5:1: error: expected initializer before 'int' 5 | int main(){ | ^~~
s526619154
p03864
C++
#include <bits/stdc++.h> using namespace std; int main() { long long int a,b,c[100010]d=0; cin >> a >> b; long long int ans =0; for(int i=0;i<a;i++) cin >> c[i]; for(int i=0;i<a-1;i++){ if(b < c[i]+c[i+1]){ ans += (c[i+1]+c[i])-b; c[i+1] = max(d,b-c[i]); ...
a.cc: In function 'int main()': a.cc:6:36: error: expected initializer before 'd' 6 | long long int a,b,c[100010]d=0; | ^ a.cc:12:12: error: 'c' was not declared in this scope 12 | cin >> c[i]; | ^ a.cc:19:12: error: 'c' was not declared in th...
s179698150
p03864
C++
#include <bits/stdc++.h> using namespace std; int main() { long long int a,b,c[100010]; cin >> a >> b; long long int ans =0; for(int i=0;i<a;i++) cin >> c[i]; for(int i=0;i<a-1;i++){ if(b < c[i]+c[i+1]){ ans += (c[i+1]+c[i])-b; c[i+1] = max(0,b-c[i]); }...
a.cc: In function 'int main()': a.cc:22:19: error: no matching function for call to 'max(int, long long int)' 22 | c[i+1] = max(0,b-c[i]); | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s988204210
p03864
C++
#include <bits/stdc++.h> #define r(i,n) for(long long i = 0; i<n; i++) typedef long long ll; using namespace std; int main() { ll n,x,count=0; cin >> n >> x; vector<ll> v(n,0); r(i,n)cin >> v[i]; r(i,n-1){ if(v[i]+v[i+1]>x){ count+=v[i]+v[i+1]-x; v[i+1]=max(0,x-v[i]); } } cout<<count<...
a.cc: In function 'int main()': a.cc:14:17: error: no matching function for call to 'max(int, ll)' 14 | v[i+1]=max(0,x-v[i]); | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s909246792
p03864
C++
6 1 1 6 1 2 0 4#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++) #define repl(i,n) REP(i,0,n) const int inf = 1e9+7; const ll longinf = 1LL<<60; const ll mod = 1e9+7...
a.cc:2:12: error: stray '#' in program 2 | 1 6 1 2 0 4#include <bits/stdc++.h> | ^ a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 6 1 | ^ a.cc: In function 'int main()': a.cc:16:3: error: 'cin' was not declared in this scope 16 | cin >> N >> x; | ^~~ a.c...
s536757930
p03864
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 100 * 1000 + 123; int n, x, a[MAXN], ans; int main() { cin >> n >> x; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 1; i < n; i++) while (a[i] + a[i - 1] >...
a.cc: In function 'int main()': a.cc:31:79: error: expected ';' before '}' token 31 | a[i - 1] -= min(a[i - 1], a[i] + a[i - 1] - x) | ^ | ...
s543397954
p03864
C++
#include <bits/stdc++.h> #define int long long using namespace std; main(){ int n,x; scanf("%lld%lld",&n,&x); int a[n]; for (int i = 0; i < n; i++){ scanf("%lld",&a[i]); } int s[n+1]; s[0] = a[0], s[n] = a[n-1]; for (int i = 1; i < n; i++) s[i] = a[i]+a[i-1]; int ans = 0; for...
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:15:20: error: no matching function for call to 'max(int, long long int)' 15 | int k = max(0,s[i]-x); | ~~~^~~~~~~~~~ In file included f...
s972621204
p03864
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; int main(){ int n; ll x,ans=0; vector<ll> a(n); for(int i=0;i<n;i++)cin>>a[i]; for(int i=0;i<n-1;i++){ if(a[i]+a[i+1]<=x)continue; ll b = a[i]+a[i+1]; ans+=b-x; a[i+1]=max(x-a[i],0); if(a[i]>x){ ans+=a[i]-x; }...
a.cc: In function 'int main()': a.cc:15:15: error: no matching function for call to 'max(ll, int)' 15 | a[i+1]=max(x-a[i],0); | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from...
s364116676
p03864
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); ...
a.cc: In function 'int main()': a.cc:71:25: error: expected ';' before 'c' 71 | d+=c[i]+c[i+1]-b | ^ | ; 72 | c[i]=b; | ~ a.cc: At global scope: a.cc:80:1: error: expected declaration before '}' token 80 |...
s767926563
p03864
C++
#include <iostream> #include <vector> #include<list> #include <algorithm> #include <string> #include <math.h> #include<map> #include <utility> #include <cstring> #include <iomanip> #include<queue> using namespace std; #define REP(i,k,n) for(int i=k;i<n;i++) #define INF 1000000000 typedef long long ll; #define SIZE_O...
a.cc:174:2: error: stray '#' in program 174 | }#include <iostream> | ^ a.cc:174:3: error: 'include' does not name a type 174 | }#include <iostream> | ^~~~~~~ a.cc:194:5: error: redefinition of 'template<class T> int vector_finder(std::vector<_Tp>, T)' 194 | int vector_finder(std::vector<T> vec, T n...
s479214693
p03864
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namespace st...
a.cc: In function 'int main()': a.cc:100:17: error: no matching function for call to 'max(long long int, int)' 100 | ans += max(a[i]-x,0); | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s381781931
p03864
C
#include "pch.h" #include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #define ll long long #define fr(i,l,r) for(i=(l);i<(r);i++) #define min(p,q) ((p)<(q)?(p):(q)) #define max(p,q) ((p)>(q)?(p):(q)) #define INF 1000000000000//10^12 int main(void) { //変数の宣言 ll int n,x; ll int a[100010]...
main.c:3:10: fatal error: pch.h: No such file or directory 3 | #include "pch.h" | ^~~~~~~ compilation terminated.
s719805386
p03864
C
#include "pch.h" #include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #define ll long long #define fr(i,l,r) for(i=(l);i<(r);i++) #define min(p,q) ((p)<(q)?(p):(q)) #define max(p,q) ((p)>(q)?(p):(q)) #define INF 1000000000000//10^12 int main(void) { //変数の宣言 ll int n,x; ll int a[100010]...
main.c:3:10: fatal error: pch.h: No such file or directory 3 | #include "pch.h" | ^~~~~~~ compilation terminated.
s733248891
p03864
C++
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N, x; cin >> N >> x; vector<int> a(N); for (int i = 0; i < N; i++) cin >> a[i]; long long ans = 0, his = 0; for (int i = 0; i < N; i++) { his = min(x - his, a[i]); ans += a[i] - his; ...
a.cc: In function 'int main()': a.cc:12:18: error: no matching function for call to 'min(long long int, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 12 | his = min(x - his, a[i]); | ~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s377682275
p03864
C++
#include "bits/stdc++.h" using namespace std; #define fst first #define scd second #define int long long int a[100000]; signed main() { int n, x, total = 0; scanf("%d%d", &n, &x); for(int i = 0; i < n; scanf("%d", &a[i++])){} for(int i = 1; i < n; ++i) { if(a[i - 1] + a[i] > x) { total += max(0, a[i - 1] +...
a.cc: In function 'int main()': a.cc:16:37: error: no matching function for call to 'max(int, long long int)' 16 | total += max(0, a[i - 1] + a[i] - x); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s201131522
p03864
C++
#pragma region _head #include<iostream> #include<string> #include<vector> #include<algorithm> #include<cmath> #include<map> #include<set> #include<iomanip> #include<queue> #include<stack> #include<numeric> #include<utility> #include<regex> #pragma region _define #define f(i,a,b) for(int i=a;i<b;i++) #define f_vI(v,n...
a.cc: In function 'int main()': a.cc:93:14: error: ambiguous overload for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__int128') 93 | cout << ans; | ~~~~ ^~ ~~~ | | | | | __int128 | std::ostream {aka ...
s214192750
p03864
C++
// ConsoleApplication9.cpp : アプリケーションのエントリ ポイントを定義します。 // #include<iostream> #include<string> #include<algorithm> #include<vector> #include<queue> #include<map> #include<math.h> #include<iomanip> #include<set> #include<numeric> #include<cstring> #include<cstdio> #include<functional> #define REP(i, n) for(int i = 0;i...
a.cc: In function 'void Eratosthenes()': a.cc:27:12: error: 'long long long' is too long for GCC 27 | #define ll long long | ^~~~ a.cc:132:18: note: in expansion of macro 'll' 132 | for (int ll i = 2; i < N; i++) { | ^~ a.cc:27:17: error: 'long long long' is too long...
s799095704
p03864
C++
// #include <bits/stdc++.h> #include <map> #include <set> #include <ctime> #include <cstring> #include <queue> #include <iostream> #include <algorithm> using namespace std; #define mod 1000000009 #define INF 1000000000 #define ll long long #define dbl double #define ull unsigned ll #define vi vector<int> #define vll v...
a.cc: In function 'int main()': a.cc:38:11: error: 'i' was not declared in this scope 38 | a[i] = min(a[i], x); | ^
s060250743
p03864
C++
// #include <bits/stdc++.h> #include <map> #include <set> #include <ctime> #include <cstring> #include <queue> #include <iostream> #include <algorithm> using namespace std; #define mod 1000000009 #define INF 1000000000 #define ll long long #define dbl double #define ull unsigned ll #define vi vector<int> #define vll v...
a.cc: In function 'int main()': a.cc:38:11: error: 'i' was not declared in this scope 38 | a[i] = min(a[i], x); | ^
s440790580
p03864
C++
#include <iostream> #include <algorithm> typedef long long ll; using namespace std; int main() { ll n, x, cnt = 0, prev = 0, now; cin >> n >> x; for (ll i = 0; i < n; ++i) { cin >> now; cnt += max(prev + now - x, 0); prev = now - max(prev + now - x, 0); } cout << cnt << en...
a.cc: In function 'int main()': a.cc:13:19: error: no matching function for call to 'max(ll, int)' 13 | cnt += max(prev + now - x, 0); | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s724444677
p03864
C++
include<stdio.h> int main(void){ long N,x; long a[100000]; long i; long eat; long sum,o; scanf("%d %d",&N,&x); for(i=0;i<N;i++){ scanf("%d",&a[i]); } for(i=0;i<N-1;i++){ sum=a[i]+a[i+1]; o=sum-x; if(o>0){ eat+=o; ...
a.cc:1:1: error: 'include' does not name a type 1 | include<stdio.h> | ^~~~~~~
s178649637
p03864
C++
#include <iostream> #include <cmath> #include <string> #include <vector> #include <algorithm> using namespace std; typedef long long ll; int main() { ll n,x,ans=0; cin >> n >> x; ll a[n+2]; for(ll i=1;i<=n;i++) cin >> a[i]; a[0]=0; a[n+1]=0; for(ll i=0;i<=n;i++){ ll cur=max(0,a[i+1]...
a.cc: In function 'int main()': a.cc:17:19: error: no matching function for call to 'max(int, ll)' 17 | ll cur=max(0,a[i+1]+a[i]-x); | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s423048046
p03864
C++
#include<stdio.h> #include<iostream> using namespace std; int N,x; int main(){ cin >> N >> x; long long int pre = 0; long long int ans = 0; cin >> pre; for(int i=1; i<N; i++){ long long int eat=0; long long int y; cin >> y; if ( pre + y > x ) { eat = pre...
a.cc: In function 'int main()': a.cc:20:18: error: no matching function for call to 'max(long long int, int)' 20 | pre = max( y - eat,0); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s595363655
p03864
C++
#include <iostream> #include <algorithm> #include <vector> #include <map> #include <string> #include <cmath> #include <iomanip> #include <numeric> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define SORT(c) sort((c).begin(), (c).end()) #define INF (ll)1e18 ...
a.cc: In function 'int main()': a.cc:39:22: error: no matching function for call to 'max(int, ll)' 39 | a2 -= max(0, (a1 + a2 - x)); | ~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s245875128
p03864
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; long long x; cin>>n>>x; long long a[n],sum=0; for(int i=0;i<n;i++){ cin>>a[i]; } long long qb=a[n-1]+a[n-2]-x; if(qb>0){ sum+=qb; if(qb<=a[n-2]){ a[n-2]-=qb; }else{ qb-=a[n-2]; a[n-2]=0; a[n-1]-=qb; } } ...
a.cc:41:5: error: redefinition of 'int main()' 41 | int main(){ | ^~~~ a.cc:3:5: note: 'int main()' previously defined here 3 | int main(){ | ^~~~
s888010616
p03864
C++
#include<cstdio> #include<queue> #include<utility> #include<cstring> #include<stack> #include<algorithm> #include<cmath> #include<iostream> #include<map> #define MAX_N 100001 #define INF_INT 2147483647 #define INF_LL 9223372036854775807 #define REP(i,n) for(int i=0;i<(int)(n);i++) using namespace std; typedef long long...
a.cc: In function 'int main()': a.cc:41:19: error: no matching function for call to 'max(ll, int)' 41 | a[i+1] = max(x-a[i],0); | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/deque:62, from /usr/include/c++/14/queue:62, from a.cc:2: /usr/include...
s542444688
p03864
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef pair<int,int> P; typedef pair<ll,ll> PL; #define INF 1<<30 #define LINF 1ll<<60ll #define MOD 1000000007 #define pb(a) push_back(a) #defi...
a.cc: In function 'int main()': a.cc:48:8: error: 'ans' was not declared in this scope; did you mean 'abs'? 48 | ans += a[0] - x; | ^~~ | abs
s466445984
p03864
C++
#include "bits/stdc++.h" using namespace std; using ll = long long; int main () { cin.tie(0); cin.sync_with_stdio(0); int n, m; cin >> n >> m; vector<int> a(n); for(int& x : ) cin >> x; ll ans = 0; for(int i = 1; i < n; ++i) { if(a[i-1] + a[i] >= m) { int take = a[i-1] + a[i] - m; int take_i = min(tak...
a.cc: In function 'int main()': a.cc:12:22: error: expected primary-expression before ')' token 12 | for(int& x : ) cin >> x; | ^
s769431867
p03864
C++
#include "bits/stdc++.h" using namespace std; using ll = long long; int main () { cin.tie(0); cin.sync_with_stdio(0); int n, m; cin >> n >> m; vector<int> a(n); for(int& x : ) cin >> x; ll ans = 0; for(int i = 1; i < n; ++i) { if(a[i-1] + a[i] >= m) { int take = a[i-1] + a[i] - m; int take_i = min(tak...
a.cc: In function 'int main()': a.cc:12:22: error: expected primary-expression before ')' token 12 | for(int& x : ) cin >> x; | ^ a.cc:18:25: error: expected ',' or ';' before 'take' 18 | take -= take_i; | ^~~~ a.cc:20:25: er...
s525094331
p03864
C++
#include <algorithm> #include <cassert> // #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <memory> #include <queue> // #include <random> #include <set> #include <stack> #include <string> #include ...
a.cc: In function 'int main()': a.cc:50:24: error: 'x' was not declared in this scope 50 | if(l[i-1] + l[i] > x) { | ^
s135044257
p03864
C++
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int N,X; cin>>N>>X; int ans=0; std::vector<int> v(N); for(int i=0;i<N;i++)cin>>v[i]; for(int i=1;i<N;i++){ if(v[i-1]+v[i]>X){ ans+=v[i-1]+v[i]-X; v[i]=max(0,X-v[i-1]); } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:14:33: error: no matching function for call to 'max(int, long long int)' 14 | v[i]=max(0,X-v[i-1]); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux...
s046782339
p03864
C++
#include<bits/stdc++.h> using namespace std; #define ll long long #define llu unsigned long long #define ld double #define llu unsigned long long #define rep(i,x,y) for(ll i=(ll)(x);i<(ll)(y);++i) #define For(i,x,y) for(ll i=(ll)(x);i<=(ll)(y);++i) #define FOr(i,x,y) for(ll i=(ll)(x);i>=(ll)(y);--i) #define pi acos(...
a.cc: In function 'int main()': a.cc:58:9: error: 'n' was not declared in this scope 58 | n=read(),k=read(); | ^ a.cc:58:18: error: 'k' was not declared in this scope 58 | n=read(),k=read(); | ^
s680645527
p03864
C++
#include <bits/stdc++.h> using namespace std; const int maxn=1e3+10; const double inf=1.0*(2e9+7); const long long double dll; struct node{ int x,y,r; }cir[maxn]; dll calc(node a,node b){ return max(0.0,sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y))-a.r-b.r); } dll mat[maxn][maxn]; dll dis[maxn]; int sx,sy,ex,ey...
a.cc:5:12: error: 'long long' specified with 'double' 5 | const long long double dll; | ^~~~ a.cc:5:24: error: uninitialized 'const dll' [-fpermissive] 5 | const long long double dll; | ^~~ a.cc:9:1: error: 'dll' does not name a type 9 | dll calc(node a,node b){...
s855597360
p03864
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int n, x; cin >> n >> x; int a[n]; for(int i=0; i<n; i++) cin >> a[i]; int ans=0; for(int i=1; i<n; i++){ long sum = a[i-1]+a[i]; if(sum > x){ a[i] -= min(a[i], sum-x); } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:18: error: no matching function for call to 'min(int&, long int)' 13 | a[i] -= min(a[i], sum-x); | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s620552696
p03864
C++
#include<bits/stdc++.h> using namespace std; #define int long long int main(){ int n,x,ans=0; int a[100009]; cin>>n>>x; for(int i=0;i<n;i++)cin>>a[i]; for(int i=0;i<n-1;i++){ if(a[i]+a[i+1]>x){ int temp=a[i]+a[i+1]-x; ans+=temp; a[i+1]-=temp; if(a[i+1]<0)a[i+1]=0; } } cout<...
cc1plus: error: '::main' must return 'int'
s124083785
p03864
C++
#include <iostream> #include <set> #include <vector> #include <algorithm> #include <string> #define REP(i,n) for(int i=0;i<(n);i++) using namespace std; int main(){ long long int n,x; long long int a[100100]; cin>>n>>x; REP(i,n)cin>>a[i]; long long int ans=0; for(int i=1;i<n;i++){ if(a[i]+a[i-1]>x){ ...
a.cc: In function 'int main()': a.cc:17:15: error: no matching function for call to 'max(int, long long int)' 17 | a[i]=max(0,x-a[i-1]); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, f...
s151491570
p03864
C++
#include<iostream> using namespace std; int main(){ int n; cin >> n; long x; cin >> x; long a[n]; for(int i = 0;i < n;i++){ cin >> a[i]; } long y = 0; long ans = 0; for(int i = 0;i < n;i++){ if(x < a[i] + y){ ans += a[i] + y - x; y = x - ...
a.cc: In function 'int main()': a.cc:19:22: error: expected ';' before '}' token 19 | y = x - y | ^ | ; 20 | } | ~
s594920537
p03864
C++
#include <stdio.h> #include <iostream> using namespace std; int main(){ int n,x; int a[100010]; cin>>n>x; for(int i=0;i<n;i++) cin>>a[i]; long long ans=0ll; for(int i=0;i<n-1;i++){ if(a[i]+a[i+1]>x){ if(a[i]>x){ a[i+1]=0; ans+=x; ...
a.cc: In function 'int main()': a.cc:9:11: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 9 | cin>>n>x; | ~~~~~~^~ | | | | | int | std::basic_istream<char>::__istream_t...
s130675424
p03864
C++
#include <stdio.h> #include <iostream> using namespace std; int main(){ int n,x; int a[100010]; cin>>n>x; for(int i=0;i<n;i++) cin>>a[i]; long long ans=0ll; for(int i=0;i<n-1;i++){ if(a[i]+a[i+1]>x){ if(a[i]>x){ a[i+1]=0; ans+=x; ...
a.cc: In function 'int main()': a.cc:9:11: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 9 | cin>>n>x; | ~~~~~~^~ | | | | | int | std::basic_istream<char>::__istream_t...
s512383855
p03864
C++
# include <iostream> # include <algorithm> # include <vector> # include <string> # include <set> # include <map> # include <cmath> # include <iomanip> # include <functional> # include <utility> # include <stack> # include <queue> # include <list> # include <bitset> # include <complex> # include <numeric> # include <tup...
a.cc:37:13: error: '::main' must return 'int' 37 | #define int LL | ^~ a.cc:64:1: note: in expansion of macro 'int' 64 | int main() { | ^~~ a.cc: In function 'int main()': a.cc:76:51: warning: narrowing conversion of 'j' from 'LL' {aka 'long long int'} to 'int' [-Wnarrowing] 76 | ...
s041168746
p03864
C++
#include <iostream> using namespace std; typedef long long ll; int main(){ ll N, x; ll a[100100]; cin >> N >> x; for(int i = 0; i < N; i++){ cin >> a[i]; } ll res = 0; for(int i = 0; i < N-1; i++){ if(a[i] + a[i+1] > x){ int r = a[i] + a[i+1] - x; res += r; a[i+1] = max(0, a[i...
a.cc: In function 'int main()': a.cc:19:19: error: no matching function for call to 'max(int, ll)' 19 | a[i+1] = max(0, a[i+1]-r); | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, fr...
s718277862
p03864
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for( int i = 0; i < n; i++ ) #define dump(x) cerr << #x << " = " << (x) << endl; #define INF 2000000000 #define mod 1000000007 #define INF2 1000000000000000000 #define int long long int signed main(void) { cin.tie(0); ios::sy...
a.cc: In function 'int main()': a.cc:20:17: error: no matching function for call to 'max(int, long long int)' 20 | count += max(0,a[0] - x); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s806805535
p03864
C++
import sequtils,strutils,math var N, x : int A : seq[int] cnt : int (N, x) = stdin.readline.split.map(parseInt) A = stdin.readline.split.map(parseInt) for i in 1..A.high: if A[i] + A[i - 1] > x: var j = A[i] + A[i - 1] - x A[i] -= min(j, A[i]) cnt += j echo cnt
a.cc:8:10: error: too many decimal points in number 8 | for i in 1..A.high: | ^~~~~~~~~ a.cc:1:1: error: 'import' does not name a type 1 | import sequtils,strutils,math | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s385086255
p03864
C++
#include <bits/stdc++.h> using namespace std; #define ll long long struct circle { double x, y, r; }; double x1, y1, x2, y2; double dist(double x, double y) { return ((x1 - x) * (x1 - x)) + ((y1 - y) * (y1 - y)); } double meh(double a1, double b1, double a2, double b2) { return sqrt(((a1 - a2) * (a1 - a2))...
a.cc:8:12: error: 'double y1' redeclared as different kind of entity 8 | double 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, from /usr/include/x86_64-linux-gnu/c++/14/bits/c+...
s511083334
p03864
C++
#include <bits/stdc++.h> using namespace std; #define ll long long struct circle { double x, y, r; }; double x1, y1, x2, y2; double dist(double x, double y) { return ((x1 - x) * (x1 - x)) + ((y1 - y) * (y1 - y)); } double meh(double a1, double b1, double a2, double b2) { return sqrt(((a1 - a2) * (a1 - a2))...
a.cc:8:12: error: 'double y1' redeclared as different kind of entity 8 | double 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, from /usr/include/x86_64-linux-gnu/c++/14/bits/c+...
s511407214
p03864
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<(int)(n);i++) #define ALL(x) (x).begin(),(x).end() #define LL long long using namespace std; int main(){ LL N,x;cin>>N>>x; LL a[N]; REP(i,N)cin>>a[i]; LL sum[N-1]; REP(i,N-1)sum[i]=a[i]+a[i+1]; LL ans=0; REP(i,N-1){ if(sum[i...
a.cc: In function 'int main()': a.cc:22:29: error: no matching function for call to 'max(int, long long int&)' 22 | sum[i+1]=max(0,sum[i+1]); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c+...
s078157861
p03864
Java
import java.io.*; import java.util.*; class Main { private static InputReader in; private static PrintWriter out; public static void main(String args[]) throws IOException { in = new InputReader(); out = new PrintWriter(System.out); //String x = in.next(); //while (!x.equal...
Main.java:28: error: unreachable statement if (a[0] < x) { ^ 1 error
s848745648
p03864
C++
#include <iostream> #include <vector> using namespace std; int main() { int n, x; cin >> n >> x; vector<int> ns(n, 0); for (int i = 0; i < n; i++) { cin >> ns[i]; } long long int ans = 0; for (int i = 0; i < n - 1; i++) { long long int sum = ns[i] + ns[i + 1]; long long int diff = sum - x; if...
a.cc: In function 'int main()': a.cc:18:27: error: no matching function for call to 'min(long long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 18 | long long int m1 = min(diff, ns[i + 1]); | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/s...
s939664884
p03864
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,x; long long int a[100000]; cin >> n >> x; long long int cnt = 0; for(int i = 0; i < n; i++){ cin >> a[i]; if(a[i] > x){ cnt += (a[i] - x); a[i] = x; } } for(int i = 0; i < n-1; i++){ if(a[i] + a[i+1] > x){ cnt += (a[i]+a[i+1]-x); a[i+1] -= (a[i]+a[i+1]-x)...
a.cc: In function 'int main()': a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s808964924
p03864
C
#include<stdio.h> int main(void){ long i,r,n,x,a[100000]; scanf("%ld%ld",&n,&x); for(i = 0;i < n;i++){ scanf("%ld",&a[i]); } for(i = 0;i < n - 1;i++){ r = a[i] + a[i + 1] - x; if(r > 0){ if(a[i + 1] >= r){ a[i + 1] -= r; }else{ ...
main.c: In function 'main': main.c:16:13: error: 'k' undeclared (first use in this function) 16 | k += r; | ^ main.c:16:13: note: each undeclared identifier is reported only once for each function it appears in
s896770261
p03864
C
#include<stdio.h> int main(void){ long i,r,n,x,a[100000]; scanf("%d%d",&n,&x); for(i = 0;i < n;i++){ scanf("%d",&a[i]); } for(i = 0;i < n - 1;i++){ r = a[i] + a[i + 1] - x; if(r > 0){ if(a[i + 1] >= r){ a[i + 1] -= r; }else{ ...
main.c: In function 'main': main.c:16:13: error: 'k' undeclared (first use in this function) 16 | k += r; | ^ main.c:16:13: note: each undeclared identifier is reported only once for each function it appears in
s843164344
p03864
C++
#include <stdio.h> int n,x,c[100001]; long long int cnt; int main() { scanf("%d%d",&n,&x); for(int i=0;i<n;i++) scanf("%d",c+i); for(int i=1;i<n;i++) { int t=c[i-1]+c[i]; int tx=t-x; if(t>x) { if(c[i]>=tx) { c[i]-=tx; cnt+=tx; } else { cnt+=tx; c[i-1]-=(tx-c[i]); c[i]=0; } }...
a.cc: In function 'int main()': a.cc:23:9: error: 'print' was not declared in this scope; did you mean 'printf'? 23 | print("%lld\n",cnt); | ^~~~~ | printf
s109215688
p03864
C++
__message_10823=%7B%22t%22%3A%22error%22%2C%22h%22%3A%22%3Cspan+class%3D%5C%22lang%5C%22%3E%3Cspan+class%3D%5C%22lang-en%5C%22%3EYou+failed+to+sign+in.%3C%5C%2Fspan%3E%3Cspan+class%3D%5C%22lang-ja%5C%22%3E%5Cu30ed%5Cu30b0%5Cu30a4%5Cu30f3%5Cu306b%5Cu5931%5Cu6557%5Cu3057%5Cu307e%5Cu3057%5Cu305f%3C%5C%2Fspan%3E%3C%5C%2Fsp...
a.cc:1:31: error: exponent has no digits 1 | __message_10823=%7B%22t%22%3A%22error%22%2C%22h%22%3A%22%3Cspan+class%3D%5C%22lang%5C%22%3E%3Cspan+class%3D%5C%22lang-en%5C%22%3EYou+failed+to+sign+in.%3C%5C%2Fspan%3E%3Cspan+class%3D%5C%22lang-ja%5C%22%3E%5Cu30ed%5Cu30b0%5Cu30a4%5Cu30f3%5Cu306b%5Cu5931%5Cu6557%5Cu3057%5...
s246749402
p03864
Java
import java.util.Scanner; public class BoxesAndCandies { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // standard input int numBoxes = sc.nextInt(); int numLimit = sc.nextInt(); int[] candyArray = new int[numBoxes]; for (int i = 0; i < numBoxes; i++) { candyArray[i] =...
Main.java:3: error: class BoxesAndCandies is public, should be declared in a file named BoxesAndCandies.java public class BoxesAndCandies { ^ 1 error
s537658107
p03864
C++
5555
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5555 | ^~~~
s667955699
p03864
C++
#include<cstdio> #include<cstring> #include<cstdlib> #include<vector> #include<cmath> #include<queue> using namespace std; int main(void){ long double a[1002][1002]; int n=0; int x[1002]; int y[1002]; int r[1002]; long double d[1002]; int e[1002]; for(int i=0;i<1002;i++){ for(int j=;j<1002;j++){ a[i][j]=0; } x[i...
a.cc: In function 'int main()': a.cc:17:11: error: expected primary-expression before ';' token 17 | for(int j=;j<1002;j++){ | ^
s114177815
p03864
C++
<>=~$";$\+=$-=$%+$_-$',$%=$_-$-for glob<>;print
a.cc:1:6: warning: missing terminating " character 1 | <>=~$";$\+=$-=$%+$_-$',$%=$_-$-for glob<>;print | ^ a.cc:1:6: error: missing terminating " character 1 | <>=~$";$\+=$-=$%+$_-$',$%=$_-$-for glob<>;print | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:1:1: error: expected unqualified...
s595027677
p03864
C++
#include <algorithm> #include <complex> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) using namespace std; typedef long long int lli; lli MOD = 1000000007; struct ...
a.cc: In function 'int main()': a.cc:128:23: error: no matching function for call to 'max(int, double)' 128 | if (cnt >= max(n * n, 1e7)) | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257...
s450172628
p03864
C++
#include <iostream> 2.using namespace std; 3.int a[100010]; 4.int main() { 5. int n,x; 6. cin>>n>>x; 7. for(int i=1;i<=n;i++){ 8. cin>>a[i]; 9. } 10. int ans=0; 11. for(int i=2;i<=n;i++){ 12. if(a[i]+a[i-1]>x){ 13. ans+=a[i]+a[i-1]-x; 14. a[i]-=a[i]+a[i-1]-x; 15. 16. } 17. } 18. cout<<ans; 19....
a.cc:3:1: error: expected unqualified-id before numeric constant 3 | 2.using namespace std; | ^~~~~~~ a.cc:5:1: error: expected unqualified-id before numeric constant 5 | 3.int a[100010]; | ^~~~~ a.cc:7:1: error: expected unqualified-id before numeric constant 7 | 4.int main() { | ^~~~~
s270984936
p03864
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int N, x, cnt=0,sum=0; cin>>N>>x; bool flg=true; vector<int> a(N), b(N-1); for(int i=0;i<N;i++){ cin>>a[i]; if(i){ b[i-1]=a[i-1]+a[i]; if(b[i-1]>x) flg=false; } ...
a.cc: In function 'int main()': a.cc:29:2: error: expected '}' at end of input 29 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s588782057
p03864
C++
/*Code is modified from others*/ #include<cstdio> #include<algorithm> #include<vector> #include <iostream> #define FL(i,j,k) for(int i=j;i<k;++i) const int MAXN = 2e6; using namespace std; typedef long long ll; ll A[100000]; ll construct[100000]={0}; int main(){ ios_base::sync_with_stdio(false);cin.tie(0); int ...
a.cc: In function 'int main()': a.cc:16:21: error: no matching function for call to 'min(ll&, int&)' 16 | construct[0]=min(A[0],x); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:3: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candi...
s302576894
p03864
C
#include<stdio.h> int main(){ long int maxi,mini,sum,n,x,a[100010]; scanf("%ld%ld",&n,&x); for(i=0;i<n;i++){ scanf("%ld",&a[i]); } int count=0,i; for(i=0;i<n-1;i++){ if(a[i]+a[i+1]>x){ sum=a[i]+a[i+1]; maxi=(a[i]>a[i+1])?a[i]:a[i+1]; mini=(a[i]<a[i+1])?a[i]:a[i+1]; if(a[i+1]==a[i]){ maxi=a[i+1]; mini=a[i]; } if(maxi...
main.c: In function 'main': main.c:5:5: error: 'i' undeclared (first use in this function) 5 | for(i=0;i<n;i++){ | ^ main.c:5:5: note: each undeclared identifier is reported only once for each function it appears in
s648426482
p03864
C
#include<stdio.h> int main(){ long int maxi,mini,sum,n,x,a[100010]; scanf("%ld%ld",&n,&x) for(i=0;i<n;i++){ scanf("%ld",&a[i]); } int count=0; for(i=0;i<n-1;i++){ if(a[i]+a[i+1]>x){ sum=a[i]+a[i+1]; maxi=(a[i]>a[i+1])?a[i]:a[i+1]; mini=(a[i]<a[i+1])?a[i]:a[i+1]; if(a[i+1]==a[i]){ maxi=a[i+1]; mini=a[i]; } if(maxi>su...
main.c: In function 'main': main.c:4:22: error: expected ';' before 'for' 4 | scanf("%ld%ld",&n,&x) | ^ | ; 5 | for(i=0;i<n;i++){ | ~~~ main.c:9:5: error: 'i' undeclared (first use in this function) 9 | for(i=0;i<n-1;i++){ ...
s853598476
p03864
C++
#include <iostream> #include <sstream> #include <algorithm> #include <string> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <memory> #include <complex> #include <numeric> #include <cstdio> #include <iomanip> #define REP(i,m,n) for(int i=int(m);i<int(n);i++)...
a.cc: In function 'int main()': a.cc:62:19: error: no matching function for call to 'min(LL&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 62 | prev = min(x, a[0]); | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/includ...
s923849572
p03864
C++
#include <iostream> #include <string> #include <queue> #include <stack> #include <algorithm> #include <list> #include <vector> #include <complex> #include <utility> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <bitset> #include <ctime> #include <map> #include <uno...
In file included from /usr/include/c++/14/algorithm:61, from a.cc:5: /usr/include/c++/14/bits/stl_algo.h: In instantiation of '_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = __gnu_cxx::__normal_iterator<int*, vector<int> >; _Funct = main()::<lambda(LL&)>]': a.cc:70:13: required from here...
s804996464
p03864
C++
#define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" using namespace std; #define int int64_t #define CHOOSE(a) CHOOSE2 a #define CHOOSE2(a0,a1,a2,a3,x,...) x #define REP1(i, s, cond, cal) for (signed i = signed(s); i cond; i cal) #define REP2(i, s, n) REP1(i, s, < signed(n), ++) #define REP3(i, n) REP2(i, 0, n) ...
a.cc: In function 'int main()': a.cc:36:35: error: no matching function for call to 'max(long long int, int64_t)' 36 | ans += max(0ll, sum - x); | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/...
s307341896
p03864
C++
#include "stdio.h" int cand[100004]; int main() { int x,n,i; __int64 sum; while (scanf ("%d%d",&n,&x) != EOF) { sum = 0; for (i=0;i<n;i++) { scanf ("%d",&cand[i]); } if (cand[0] > x) { sum = cand[0]-x; cand[0] = x; ...
a.cc: In function 'int main()': a.cc:7:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 7 | __int64 sum; | ^~~~~~~ | __int64_t a.cc:10:9: error: 'sum' was not declared in this scope 10 | sum = 0; | ^~~
s955177513
p03864
C++
#include <cstdio> #include <climits> #include <cassert> #include <iostream> #include <string> #include <algorithm> #include <numeric> #include <functional> #include <tuple> #include <list> #include <map> #include <queue> #include <stack> #include <set> #include <vector> #define REP(i,s,n) for(int i=(int)(s);i<(int)(n)...
a.cc: In function 'll solve(const VL&, ll)': a.cc:31:11: error: assignment of read-only location '(& as)->std::vector<long long int>::operator[](0)' 31 | as[0] -= x; a.cc:33:11: error: 'N' was not declared in this scope 33 | REP(i,0,N-1) { | ^ a.cc:17:47: note: in definition of macro 'REP' ...
s385665870
p03864
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <iomanip> #include <map> #include <cmath> using namespace std; typedef long long int; int main() { int n, x; cin >> n >> x; int cnt = 0; vector<int>A(n); for (int i = 0; i < n; i++) { int a; cin >> a; if (a > x) { cnt += a...
a.cc:9:19: error: declaration does not declare anything [-fpermissive] 9 | typedef long long int; | ^~~
s935271712
p03864
C++
#include <string> #include <vector> #include <algorithm> #include <iomanip> #include <map> #include <cmath> using namespace std; int main() { int n, x; cin >> n >> x; int cnt = 0; vector<int>A(n); for (int i = 0; i < n; i++) { int a; cin >> a; if (a > x) { cnt += a - x; a = x; } A[i] = a; } vector<...
a.cc: In function 'int main()': a.cc:11:19: error: 'cin' was not declared in this scope 11 | int n, x; cin >> n >> x; | ^~~ a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 6 | #include <cmath> +++ |+#include ...
s032504467
p03864
C++
#include<cstdio> #include<iostream> #include<cmath> #include<vector> #include<string> #include<algorithm> #include<queue> #include<stack> #include<map> #include<set> #include<iomanip> #define rep(i,a,N) for(int i=0+a;i<N;i++) #define lint long long int #define SIZE 100005 #define pb push_back using namespace std; in...
a.cc: In function 'int main()': a.cc:24:29: error: expected ';' before ')' token 24 | for(lint i=0;i<n,i++){ | ^ | ;
s070627233
p03864
Java
/* * Code Author: Akshay Miterani * DA-IICT */ import java.io.*; import java.math.BigInteger; import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.*; public class MainA { static double eps=(double)1e-6; static long mod=(long)1e9+7; static final long INF = Long.MAX_VALUE / 100; public...
Main.java:11: error: class MainA is public, should be declared in a file named MainA.java public class MainA { ^ 1 error
s023254336
p03864
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n; ll a[200005]; ll x; int main() { ios::sync_with_stdio(0); cin >> n >>x; ll ans = 0; for(int i=0; i<n; i++) { cin >> a[i]; if (i) { ll sum = a[i] + a[i-1]; ll now = max(0LL, sum - x); ...
a.cc: In function 'int main()': a.cc:17:23: error: no matching function for call to 'max(ll&, int)' 17 | a[i] = max(a[i],0); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s887911140
p03864
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <iostream> #include <vector> #include <string> #include <sstream> #include <algorithm> #include <utility> #include <set> #include <map> #include <stack> #include <queue> #include <deque> #include <functional> using nam...
cc1plus: error: '::main' must return 'int'
s482718246
p03865
C++
#include<bits/stdc++.h> int main() { using namespace std; string S; cin >> S; puts((s.size() & 1) ^ (S[0] == S.back()) ? "First" : "Second"); return 0; }
a.cc: In function 'int main()': a.cc:7:11: error: 's' was not declared in this scope 7 | puts((s.size() & 1) ^ (S[0] == S.back()) ? "First" : "Second"); | ^
s483106542
p03865
C++
#include<bits/stdc++.h> using namespace std; main(){ string s; cin>>s; cout<<(s.front()==s.back())&(s.size()%2)?"Second":"first"<<endl; }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:5:30: error: no match for 'operator&' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'std::__cxx11::basic_string<cha...
s323222508
p03865
C++
char buf[114514]; main(n){ n=read(0,buf,114514); n--; puts(n+(buf[0]==buf[n])&1?"First":"Second"); }
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token 2 | main(n){ | ^
s344989362
p03865
C++
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #includ...
a.cc: In function 'int main()': a.cc:621:17: error: 'N' was not declared in this scope 621 | if( S[0] == S[N-1] ) | ^
s746420273
p03865
C++
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #includ...
a.cc: In function 'int main()': a.cc:621:17: error: 'N' was not declared in this scope 621 | if( S[0] == S[N-1] ) | ^ a.cc:634:3: error: expected '}' before 'else' 634 | else | ^~~~ a.cc:622:5: note: to match this '{' 622 | { | ^
s453627084
p03865
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; printf("%s",((s[0]==s[s.size()-1])^(n%2==0))?"Second":"First"); }
a.cc: In function 'int main()': a.cc:6:41: error: 'n' was not declared in this scope 6 | printf("%s",((s[0]==s[s.size()-1])^(n%2==0))?"Second":"First"); | ^
s225717335
p03865
C++
#include "bits/stdc++.h" using namespace std; int main() { string s; cin >> s; if (s.size() % 2 == 0 ^ s[0] == s[s.size() - 1])puts("Second"); else puts("First"); }
a.cc:6:5: error: extended character   is not valid in an identifier 6 | else puts("First"); | ^ a.cc: In function 'int main()': a.cc:6:5: error: 'else\U00003000puts' was not declared in this scope 6 | else puts("First"); | ^~~~~~~~~~
s714514709
p03865
C++
#include <iostream> #include <string> #include <utility> #include <stack> #include <vector> #include <queue> #include <algorithm> #include <map> #include <climits> #include <set> using namespace std; int main(){ string S; cin >> S; if(S[0] != S[S.size() - 1]){ if(S.size() % 2 == 0){ co...
a.cc: In function 'int main()': a.cc:24:21: error: lvalue required as left operand of assignment 24 | if(S.size() % 2 = 0){ | ~~~~~~~~~^~~
s948223963
p03865
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namespace st...
a.cc: In function 'int main()': a.cc:94:13: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig...
s298329422
p03865
C++
#include <stdio.h> #include <algorithm> #include <iostream> #include <vector> #include <assert.h> #include <map> #include <set> #include <unordered_set> #include <unordered_map> #include <math.h> #include <string> #include <string.h> #include <queue> #include <complex> #include <iomanip> #include <stack> using namespac...
a.cc: In function 'int main()': a.cc:45:27: error: expected ';' before 'return' 45 | else cout<<"First" | ^ | ; 46 | return 0; | ~~~~~~
s559934131
p03865
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int l = s.length(); bool f = if ((s[0] == s[l-1]) ^ (l % 2 == 1)) { cout << "Second"; } else { cout << "First"; } cout << endl; }
a.cc: In function 'int main()': a.cc:11:3: error: expected primary-expression before 'if' 11 | if ((s[0] == s[l-1]) ^ (l % 2 == 1)) { | ^~
s701052321
p03865
C++
#include<iostream> #include <string> using namespace std; int main(){ string s; cin>>s; cout<<((s.size()%2==0)==(s[0]==s[s.size()-1])?"First":"Second")<<endl }
a.cc: In function 'int main()': a.cc:7:72: error: expected ';' before '}' token 7 | cout<<((s.size()%2==0)==(s[0]==s[s.size()-1])?"First":"Second")<<endl | ^ | ...
s906755153
p03865
C++
/*input */ #include<bits/stdc++.h> using namespace std; #define int long long #define double long double #define f first #define s second #define mp make_pair #define pb push_back #define RE(i,n) for (int i = 1; i <= n; i++) #define RED(i,n) for (int i = n; i > 0; i--) #define REPS(i,n) for(int i = 1; (i*i) <= n; i+...
a.cc: In function 'void solve()': a.cc:57:58: error: return-statement with a value, in function returning 'void' [-fpermissive] 57 | if(a[i] != a[j]){cout << "Second";return 0;} | ^
s326827781
p03865
C++
#include <algorithm> #include <iostream> #include <vector> #include <math.h> #include <set> #include <map> #include <string> #include <stack> #include <queue> #include <iomanip> #include <numeric> #include <tuple> #include <bitset> #include <complex> #include <unistd.h> #include <cassert> #include <cctype> #include <ra...
a.cc: In function 'int main()': a.cc:48:9: error: 'far' was not declared in this scope; did you mean 'fir'? 48 | if (far == las) { | ^~~ | fir
s882336369
p03865
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int n = s.size(); cout << ( ( (s[0] == s[n-1]) ^ (n%2 == 1)) )? "First" : "Second") << endl; }
a.cc: In function 'int main()': a.cc:9:75: error: expected ';' before ')' token 9 | cout << ( ( (s[0] == s[n-1]) ^ (n%2 == 1)) )? "First" : "Second") << endl; | ^ | ...
s417079661
p03865
C++
#include <iostream> #include <climits> #include <stack> #include <queue> #include <string> #include <random> #include <utility> #include <cmath> #include <string.h> #include <iomanip> #include <stdlib.h> #include <algorithm> #include <vector> using namespace std; typedef long long ll; typedef pair<ll,ll> P; long long i...
a.cc: In function 'int main()': a.cc:40:12: error: expected ';' before 'n' 40 | m=0 | ^ | ; 41 | n=strlen(s); | ~
s976722714
p03865
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; char L=s[0], R=s[s.size()-1]; if(L == R && s.size()%2 == 0 || L != R && s.size()%2 == 1){ cout << first << endl; }else{ cout << second << endl; } }
a.cc: In function 'int main()': a.cc:9:17: error: 'first' was not declared in this scope 9 | cout << first << endl; | ^~~~~ a.cc:11:17: error: 'second' was not declared in this scope 11 | cout << second << endl; | ^~~~~~
s729599665
p03865
C++
# include <iostream> # include <algorithm> # include <vector> # include <string> # include <set> # include <map> # include <cmath> # include <iomanip> # include <functional> # include <utility> # include <stack> # include <queue> # include <list> using namespace std; using LL = long long; constexpr long long MOD = 1000...
a.cc:24:2: error: stray '#' in program 24 | }# include <iostream> | ^ a.cc:24:4: error: 'include' does not name a type 24 | }# include <iostream> | ^~~~~~~ a.cc:39:21: error: redefinition of 'constexpr const long long int MOD' 39 | constexpr long long MOD = 1000000000 + 7; | ...
s636319743
p03865
C++
#include <bits/stdc++.h> #include <math.h> #define uint unsigned long long #define ll long long #define db double #define ls rt << 1 #define rs rt << 1 | 1 #define pb push_back #define mp make_pair #define pii pair<int, int> #define X first #define Y second #define pcc pair<char, char> #define vi vector<int> #define vl...
a.cc: In function 'int main()': a.cc:43:14: error: 'uts' was not declared in this scope; did you mean 'puts'? 43 | else uts((ch.size() + (ch[0] == ch[n - 1] ? 1 : 0)) % 2 == 0 ? "Second" : "First"); | ^~~ | puts
s328368663
p03865
C++
#include<string> #include<deque> #include<queue> #include<vector> #include<algorithm> #include<iostream> #include<set> #include<cmath> #include<tuple> #include<chrono> #include<functional> #include<iterator> #include<random> #include<unordered_set> #include<map> using namespace std; typedef long long int llint; #define...
a.cc: In function 'int main()': a.cc:49:23: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 49 | string str;cin>str; | ~~~^~~~ | | | | ...
s467348870
p03865
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <cstring> #include <string> #include <queue> #include <set> #include <map> #include <bitset> #include <cmath> #include <stack> #include <ctime> #include <unordered_map> #include <unordered_set> #include <list> #include <cassert> #incl...
a.cc: In function 'int main()': a.cc:35:26: error: 'sz' was not declared in this scope; did you mean 's'? 35 | if(((s[0]==s.back())+sz(s))%2==0) | ^~ | s