submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s612228570
p03838
C++
#include <bits/stdc++.h> #define REP(i, x, n) for (int i = x; i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (int)(x.size()) #define popcount(x) __builtin_popcount(x) #define popcountll(x) __builtin_popcountll(x) #define un...
a.cc: In function 'int main()': a.cc:39:50: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 39 | cout << x - y + (x == 0 || y == 0) ? 1 : 2 << endl; | ~~^~~~~~~
s478007248
p03838
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s723227728
p03838
C++
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; long long ans = abs( abs( y - abs( x ) ); if( x * y < 0 || x < 0 && y < 0 && abs( Y ) < abs( x ) ) ans++; else if( x < 0 && y < 0 && abs( Y ) >= abs( x ) || x > 0 && y > 0 && abs( Y ) < abs( x ) ) ans += 2; cout << ans << endl;...
a.cc: In function 'int main()': a.cc:9:49: error: expected ')' before ';' token 9 | long long ans = abs( abs( y - abs( x ) ); | ~ ^ | ) a.cc:10:49: error: 'Y' was not declared in this scope 10 | ...
s509118282
p03838
C
#include <stdio.h> #include <stdlib.h> int main() { int x,y; scanf("%d %d",&x,&y); int ans = abs(abs(x) - abs(y)); if(y > x) { if(x < 0 && y > 0) { ans += 1; } } else { if(x < 0 && y > 0) { ans += 2; } els...
main.c: In function 'main': main.c:26:20: error: expected expression before ';' token 26 | ans += ; | ^
s731749982
p03838
C++
#include <bits/stdc++.h> using namespace std; int main(){ long int x, y; cin >> x >> y; if(x * y = 0){ if(x > 0){ cout << x + 1; }else if(x < 0){ cout << x; }else if(y < 0){ cout << y + 1; }else{ cout << y; } }else if(x * y < 0){ cout << x + y + 1; }else if(x >...
a.cc: In function 'int main()': a.cc:7:8: error: lvalue required as left operand of assignment 7 | if(x * y = 0){ | ~~^~~
s975740585
p03838
C++
//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> #in...
a.cc: In function 'int main()': a.cc:104:57: error: expected ')' before ';' token 104 | result += (y * (-1) - (x * (-1)); | ~ ^ | )
s093797928
p03838
C++
#include <bits/stdc++.h> #define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) #define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++) #define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--) #define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--) #define ALL(v) (v).begin(),(v).end() #define MOD 100000...
a.cc: In function 'int main()': a.cc:56:5: error: 'cnt' was not declared in this scope; did you mean 'int'? 56 | cnt += (abs(y)-abs(x)) ; | ^~~ | int
s161595965
p03838
C++
asdf
a.cc:1:1: error: 'asdf' does not name a type 1 | asdf | ^~~~
s075261500
p03838
C++
#include <bits/stdc++.h> using namespace std; int main(){ int x,y; cin>>x>>y; if(x<y){ if(abs(x)<abs(y)){ cout<<min(y-x,1+abs(y+x))<<endl; }else if(-x==y){ cout<<1<<endl; }else{ cout<<min(y-x,abs(x)-abs(y)+1)<<endl; } }else{ if(abs(x)<abs(y)){ cout<<min(abs(y)-x+1,2+ab...
a.cc: In function 'int main()': a.cc:23:26: error: expected ';' before '}' token 23 | cout<<2+x-y<<endl | ^ | ; 24 | } | ~
s401281994
p03838
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for(int i=0; i<N; i++) typedef long long ll; int main() { ll x, y; cin >> x >> y; if(x==y){ cout << 0 << endl; return 0; } if(x==0){ if(y<0) {cout << -y+1LL << endl; return 0;} else {cout << y << endl;...
a.cc: In function 'int main()': a.cc:49:25: error: unable to find numeric literal operator 'operator""Ll' 49 | cout << x + y + 1Ll << endl; | ^~~
s446681288
p03838
C++
#include <bits/stdc++.h> #define rep(i,n)for(long long i=0;i<(n);i++) using namespace std; typedef long long ll; typedef pair<int,int> P; const int MOD=1000000007; const int INF=0x3f3f3f3f; const ll INFL=0x3f3f3f3f3f3f3f3f; ll gcd(ll x, ll y){ if(y==0) return x; else return gcd(y, x%y); } ll lcm(ll x,ll y){ ll ...
a.cc: In function 'int main()': a.cc:27:3: error: expected '}' before 'else' 27 | else{ | ^~~~ a.cc:22:10: note: to match this '{' 22 | if(x<y){ | ^
s503823500
p03838
C++
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast") #define rep(i,n) for(int i=0;i<n;i++) const long long MOD = 1000000007; typedef pair<int,int> P; typedef long long ll; ll n,m,k,ans; string s; int main(){ long long x,y; cin >> x >> y; if( x < y ) { if( x*y > 0 ) cout << y-x << "\n"; ...
a.cc: In function 'int main()': a.cc:18:16: error: expected ';' before '{' token 18 | }else (x > y){ | ^ | ; a.cc:23:4: error: 'else' without a previous 'if' 23 | }else { | ^~~~
s410163081
p03838
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, N) for (int i = 0; i < (int)N; i++) const ll MOD = pow(10,9)+7; const ll LLINF = pow(2,61)-1; const int INF = pow(2,30)-1; int main() { ll x, y; cin >> x >> y; ll result = 0; if (x<0) { if (y<0) { if (x>y) result = x-...
a.cc: In function 'int main()': a.cc:34:5: error: 'reuslt' was not declared in this scope; did you mean 'result'? 34 | reuslt = (y>0) ? y : y+1; | ^~~~~~ | result
s785420187
p03838
Java
// x < y // x < 0 && y < 0 || x > 0 && y > 0 : y-x // x < 0 && y > 0 // |x| < |y| : y+x+1 // |y| < |x| : -y-x+1 // y < x // y < 0 && x < 0 : +2 // y > 0 && x > 0 : +2 // y < 0 && x > 0 // |x| < |y| : +1 // |y| < |x| : +1 import java.util.*; public class Main { public static void main(S...
Main.java:29: error: package Systrm does not exist Systrm.out.println(A+B); ^ 1 error
s480644410
p03838
Java
// x < y // x < 0 && y < 0 || x > 0 && y > 0 : y-x // x < 0 && y > 0 // |x| < |y| : y+x+1 // |y| < |x| : -y-x+1 // y < x // y < 0 && x < 0 : +2 // y > 0 && x > 0 : +2 // y < 0 && x > 0 // |x| < |y| : +1 // |y| < |x| : +1 import java.util.*; public class Main { public static void main(S...
Main.java:27: error: ';' expected B = (long)x*y > 0 : 2 : 1; ^ 1 error
s753236084
p03838
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long int a,b; cin >> a >> b; if (a>=0 && a<b) { cout << b-a <<endl; }else if (a>=0 && b>0){ cout <<2+a-b<< endl; }else if (b<=0 && a<b){ cout << b-a <<endl; }else if (a<0 && b<a) cout << 2+a-b <<endl; } else{ cout << 1+abs(...
a.cc:12:3: error: expected unqualified-id before 'else' 12 | } else{ cout << 1+abs(abs(a)-abs(b)) <<endl; | ^~~~ a.cc:14:1: error: expected declaration before '}' token 14 | } | ^
s085225710
p03838
C++
#include <bits/stdc++.h> #define ll long long #define rep(i, n) for(ll i=0; i<n; i++) #define repr(i, s, e) for(ll i=s; i>=e; i--) #define reps(i, s, e) for(ll i=s; i<=e; i++) #define inf 1e18 #define all(v) v.begin(),v.end() #define vsort(v) sort(v.begin(), v.end()) #define vsortr(v) sort(v.begin(), v.end(), greater<l...
a.cc: In function 'int main()': a.cc:50:34: error: expected ';' before '}' token 50 | res = abs(x)-abs(y)+1 | ^ | ; 51 | }else if(abs(x) < abs(y)){ | ~
s837437190
p03838
C++
#include <iostream> using namespace std; int main() { long long int x, y; cin >> x >> y; long long int ans = 1LL << 60; if (x <= y) ans = min(res, y-x); if (-x <= y) ans = min(ans, y+x+1); if (x <= -y) ans = min(ans, -y-x+1); if (-x <= -y) ans = min(ans, -y + x + 2); cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:25: error: 'res' was not declared in this scope 8 | if (x <= y) ans = min(res, y-x); | ^~~
s077431765
p03838
C++
#include <bits/stdc++.h> using namespace std; const int MOD = 1000000007; const double PI = acos(-1); //long long using ll = long long; //出力系 #define print(x) cout << x << endl #define yes cout << "Yes" << endl #define YES cout << "YES" << endl #define no cout << "No" << endl #define NO cout...
a.cc: In function 'int main()': a.cc:67:12: warning: overflow in conversion from 'double' to 'll' {aka 'long long int'} changes value from '1.0e+19' to '9223372036854775807' [-Woverflow] 67 | ll ans = 10e18; | ^~~~~ a.cc:68:23: error: no matching function for call to 'min(ll&, int)' 68 | if(x...
s592618532
p03838
C++
#include <bits/stdc++.h> using namespace std; //↓0-originか1-originでn回繰り返し #define rep(i,n) for(int i = 0; i < ((int)(n)); i++) //0-origin昇順 #define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) //1-origin昇順 #define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--) //0-origin降順 #define rrep1(i,n) for(int i = ((int)(...
a.cc: In function 'int main()': a.cc:32:29: error: no matching function for call to 'min(ll&, int)' 32 | if(x <= y) ans = min(ans, y - x); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/s...
s079235653
p03838
C++
#include <bits/stdc++.h> //press B 0 or 1 time, then press A 0 or more times, then press B 0 or 1 time int main(){ int x, y; cin >> x >> y; ll ans = 1e16; //0...0 if(x <= y) ans = min(ans, y - x); //0...1 if(x <= -y) ans = min(ans, -y - x + 1); //1...0 if(-x <= y) ans = min(ans, y + x + 1); //1...1 if(-x <...
a.cc: In function 'int main()': a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin >> x >> y; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iost...
s578305190
p03838
C++
#include <bits/stdc++.h> #define INF INT_MAX #define ll long long #define ull unsigned long long #define rep(i,n) for(ll i=0; i<n; ++i) #define FOR(i, s, e) for(ll i=s; i<e; ++i) #define MOD 1000000007 using namespace std; template<class T> inline bool chmin(T& a, T b) { if(a>b) {a=b; return true;} return false;} temp...
a.cc: In function 'int main()': a.cc:16:15: error: 'ans' was not declared in this scope; did you mean 'abs'? 16 | if(X<0&&Y<X)ans+=2; | ^~~ | abs a.cc:17:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 17 | else if(X>0&&Y>0&&X>Y)ans+=2; | ...
s370837573
p03838
C++
#include <iostream> #include <fstream> #include <vector> #include <cstring> #include <string> #include <cmath> #include <algorithm> // sort #include <iomanip> #include <queue> #include <map> #include <bits/stdc++.h> using namespace std; #define DEBUG 0 #define REP(i, n) for (long long i = 0; i < (n); i++) typedef l...
a.cc: In function 'int main()': a.cc:44:12: error: expected primary-expression before '=' token 44 | if(x > = 0 && x <= y) | ^
s248008744
p03838
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int cnt1 = 1; int cnt2 = 1; int cnt3 = 2; if(x<=y){ if(x>=0||y<=0){ System.out.println(y-x); return; }...
Main.java:26: error: integer number too large cnt1+=3000000000; ^ Main.java:28: error: integer number too large cnt3+=3000000000; ^ Main.java:31: error: integer number too large cnt1+=3000000000; ^ Main.java:37: error: integer number too large cnt2+=3000000000...
s566234666
p03838
C++
/* @ by batr (T) */ #include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define all(X) (X).begin(), (X).end() #define cmp_all(X) (X).begin(), (X).end(), cmp #define B begin() #define E end() #define sz size() #define skip continue #define ppi pair<pair<int, int>, int> #define...
a.cc: In function 'int main()': a.cc:48:29: error: 'x' was not declared in this scope 48 | cout << m - x; | ^
s652401838
p03838
C++
/* @ by batr (T) */ #include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define all(X) (X).begin(), (X).end() #define cmp_all(X) (X).begin(), (X).end(), cmp #define B begin() #define E end() #define sz size() #define skip continue #define ppi pair<pair<int, int>, int> #define...
a.cc: In function 'int main()': a.cc:84:22: error: expected ';' before 'else' 84 | -5 -2 | ^ | ; 85 | else { | ~~~~
s962885760
p03838
C++
/* @ by batr (T) */ #include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define all(X) (X).begin(), (X).end() #define cmp_all(X) (X).begin(), (X).end(), cmp #define B begin() #define E end() #define sz size() #define skip continue #define ppi pair<pair<int, int>, int> #define...
a.cc: In function 'int main()': a.cc:88:22: error: expected ';' before 'else' 88 | -5 -2 | ^ | ; 89 | else { | ~~~~
s603111513
p03838
C
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define ll long long #define rep(i,n) for(ll i=0;i<(n);i++) #define max(p,q) ((p)>(q)?(p):(q)) #define min(p,q) ((p)<(q)?(p):(q)) #define chmax(a,b) ((a)=(a)>(b)?(a):(b)) #define chmin(a,b) ((a)=(a)<(b)?(a):(b)) #define abs(p) ((p)>=(0)?(p):(-...
main.c: In function 'main': main.c:32:41: error: macro "put" passed 2 arguments, but takes just 1 32 | else if(x<y) put(min(++ans), y-x); | ^ main.c:22:9: note: macro "put" defined here 22 | #define put(a) printf("%lld\n", (a)) | ^~~ main.c:32:22...
s502632046
p03838
C++
#include <iostream> using namespace std; long long ll; int main() { ll x, y; cin >> x >> y; int ans = 0; if(x * y < 0) ans++; else if(x > y) ans += 2; cout << ans + abs(abs(x) - abs(y)) << endl; }
a.cc: In function 'int main()': a.cc:8:7: error: expected ';' before 'x' 8 | ll x, y; | ^~ | ; a.cc:9:12: error: 'x' was not declared in this scope 9 | cin >> x >> y; | ^ a.cc:9:17: error: 'y' was not declared in this scope 9 | cin >> x >> y; | ...
s520523153
p03838
C++
#include <iostream> #include <fstream> #include <set> #include <map> #include <stack> #include <queue> #include <vector> #include <algorithm> #include <cmath> #include <chrono> using namespace std; int main(int argc, const char * argv[]) { ios::sync_with_stdio(false); cin.tie(0); int x, y; cin >> x >> y...
a.cc:53:5: error: redefinition of 'int main(int, const char**)' 53 | int main(int argc, const char * argv[]) { | ^~~~ a.cc:14:5: note: 'int main(int, const char**)' previously defined here 14 | int main(int argc, const char * argv[]) { | ^~~~
s096997015
p03838
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 rall(x) (x).rbegin(),(x).rend() #define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ); using namespace std; using ll = long long; int main(){ int a, b; cin >> a >> b; int an...
a.cc: In function 'int main()': a.cc:14:5: error: expected initializer before 'if' 14 | if(a == -b) cout << 1 << endl; | ^~ a.cc:15:5: error: 'else' without a previous 'if' 15 | else if(a >= 0 && b < 0) ans = abs(a-b)+1; | ^~~~ a.cc:15:30: error: 'ans' was not declared in this scope; d...
s271501892
p03838
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int x,y,c = 0; cin >> x >> y; if (abs(x)==abs(y)){ c = 1; } else { if (x<y) { if (0<x) {c = y-x;} else if (0>x and 0<y) { if (abs(x)<y) { ++c; ...
a.cc: In function 'int main()': a.cc:49:14: error: expected '}' at end of input 49 | return 0; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s804858485
p03838
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } #define all(x) (x).begin(),(x).end() #define pll pai...
a.cc: In function 'int main()': a.cc:19:34: error: expected primary-expression before ';' token 19 | if(x*y>=0 && y>x)cout << y-x,; | ^
s180914528
p03838
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } #define all(x) (x).begin(),(x).end() #define pll pai...
a.cc: In function 'int main()': a.cc:19:34: error: expected primary-expression before ';' token 19 | if(x*y>=0 && y>x)cout << y-x,; | ^
s649275960
p03838
C++
#include <bits/stdc++.h> using namespace std; int main(){ int64_t x,y; cin>>x>>y; if(x<y&&x*y>=0){ cout<<max(x,y)-min(x,y); } if(x<y&&x*y>0){ cout<<2+max(x,y)-min(x,y); } if(x<y&&x*y=0){ cout<<1+max(x,y)-min(x,y); } else { int a=max(x,y); int b=min(x,y); int B=abs(b); i...
a.cc: In function 'int main()': a.cc:12:12: error: lvalue required as left operand of assignment 12 | if(x<y&&x*y=0){ | ~~~^~~~~
s907561196
p03838
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:86:14: error: no match for 'operator+' (operand types are 'int' and 'std::ostream' {aka 'std::basic_ostream<char>'}) 86 | cout<<1+cout<<1+abs(abs(b)-a)<<endl; | ~^~~~~ | | | | | std::ostream {aka std::basic_ostream<char>...
s320437765
p03838
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long u,v,x,y,op=0; cin>>x>>y; u=abs(x); v=abs(y); op+=abs(v-u); if(x==y){ cout<<0<<endl; return 0; } if(y>0&&x==0) cout<<op<<endl; else if(y==0&&x>0) cout<op+1;<<endl; else if(x==0&&y<0) cout<<op+1<<endl; else if(y==0&&x<0) cout<<op<<endl; el...
a.cc: In function 'int main()': a.cc:14:32: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'long long int') 14 | else if(y==0&&x>0) cout<op+1;<<endl; | ~~~~^~~~~ | | | | ...
s313557471
p03838
C++
#include<bits/stdc++.h> using namespace std; #define all(a) (a).begin(),(a).end() typedef long long ll; ll mod=1000000007; int main() { ll x,y; cin >>x>>y; ll out; if(x>=0&&y>=0){ out = abs(y-x); if(x>y) out += 2; } else if(x<0&&y<0)){ out = abs(y-x); if(x>y)out += 2; } else { if(x==0||y...
a.cc: In function 'int main()': a.cc:13:22: error: expected primary-expression before ')' token 13 | } else if(x<0&&y<0)){ | ^
s087172644
p03838
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; #define a first #define b second #define sz size() #define pb(x) push_back(x) #define bg begin() #define ed end() #define rep(i,n) for(ll i=0;i<n;i++) #define rep1(i,n) for(ll i=1;i<=n;i++) #define mp(x,y) make_pair(x,y) const l...
a.cc: In function 'int main()': a.cc:33:22: error: expected primary-expression before '>' token 33 | ll x,y; cin>>>x>>y; | ^
s819815457
p03838
C++
#include<bits/stdc++.h> #include<algorithm> #include<math.h> #include<string> #include<iostream> #include<vector> #include<cstdlib> using namespace std; template <class T> using V = vector<T>; template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return fals...
a.cc:124:9: error: unterminated argument list invoking macro "co" 124 | } | ^ a.cc: In function 'int main()': a.cc:122:5: error: 'co' was not declared in this scope 122 | co(rM(abs(x-y)+1,abs(x+y)+2) | ^~ a.cc:122:7: error: expected '}' at end of input 122 | co(rM(abs(x-y)+1...
s860534733
p03838
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<iomanip> #include<math.h> #include<complex> #include<queue> #include<deque> #include<stack> #include<map> #include<set> #include<bitset> using namespace std; #define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i ) #define rep(i,n) REP(i...
a.cc: In function 'int main()': a.cc:30:6: error: expected primary-expression before ')' token 30 | if() | ^
s097616908
p03838
C++
#include <bits/stdc++.h> using namespace std; int main() { int x,y; cin>>x>>y; if(x==(-1*y){ cout<<'1'<<endl;} else { if(x<y)){int t;t=y-x; cout<<t<<endl;} else if(x>y){ if (x>0 && y>0){int t;t=x+y+1; cout<<t<<endl;} else if (x>0 && y<0){int t;t=(-y)-x+1; cout<<t<<endl;} ...
a.cc: In function 'int main()': a.cc:7:15: error: expected ';' before '{' token 7 | if(x==(-1*y){ | ^ | ; a.cc:9:6: error: expected primary-expression before 'else' 9 | else { | ^~~~ a.cc:8:20: error: expected ')' before 'else' 8 | cout<<'1'<<endl;...
s940393730
p03838
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int x = Integer.parseInt(in.nextLine().split(" ")[0]); int y = Integer.parseInt(in.nextLine().split(" ")[1]); String xb = Integer.toBinaryString(x); St...
Main.java:9: error: cannot find symbol String yb = integer.toBinaryString(y); ^ symbol: variable integer location: class Main 1 error
s376664668
p03838
C++
#include <iostream> #include <cstdlib> #include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; if (x > y) { if (x<0) cout << (abs(y) - abs(x)) + 2 << endl; else if (x==0) cout << abs(y) + 1 << endl; else if (x>0&&y<0) cout << abs(x+y) + 1 << endl; els...
a.cc: In function 'int main()': a.cc:25:15: error: 'abx' was not declared in this scope; did you mean 'abs'? 25 | cout << abx(x) - abs(y) << endl; | ^~~ | abs
s174680358
p03838
C++
#include <algorithm> #include <iostream> #include <iomanip> #include <map> #include <numeric> #include <set> #include <sstream> #include <string> #include <vector> #include <cmath> #include <unordered_map> using namespace std; #define REPI(i,a,b) for (ll i=(a);i<(b);i++) #define REP(i,n) REPI(i,0,n) typedef long long...
a.cc: In function 'int main()': a.cc:45:18: error: 'LLONG_MAX' was not declared in this scope 45 | ll ret = LLONG_MAX; | ^~~~~~~~~ a.cc:12:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 11 | #include <unordered_map> +...
s342816597
p03838
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define endl "\n" #define REP(i,a,n) for(int i=a;i<n;++i) #define RUP(a,b) ((a+b-1)/(b)) #define SORTG(v) sort(v.begin(),v.end(),greater<>()) #define SORT(v) sort(v.begin(),v.end()) #define ALL(v) (v).begin(),(v).end() #define pb push_back #define mp m...
a.cc: In function 'int main()': a.cc:52:9: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 52 | cout<<abs<<endl; | ~~~~^~~~~ In file included from /usr/include/c++/14/istream:41, from /usr/...
s582045817
p03838
C++
#include<iostream> #include<string> #include<algorithm> #include<bits/stdc++.h> #include<vector> using namespace std; int MOD=1000000007; int main(){ int x,y,ans=0; cin >> x >> y; if(x>=0 && y>=0 && y>=x) cout << y-x << endl; else if(x>=0 && y>=0 && x>y) cout << abs(y-x)*2+2 << endl; else if(x>=0 && y<0) cout <<...
a.cc: In function 'int main()': a.cc:15:28: error: lvalue required as left operand of assignment 15 | else if(x<0 && y<0 && x=y) cout << abs(y)-abs(x)+2 << endl; | ~~~~~~~~~~~^~~~
s043143528
p03838
C++
#include<algorithm> #include<climits> #include<cmath> #include<cstdlib> #include<iomanip> #include<iostream> #include<numeric> #include<string> using namespace std; long gcd(long x, long y) { if (x > y) { return gcd(y, x); } long r; while (y != 0) { r = x % y; x = y; y = r; }return x; } long lcm(long x, long y) { retu...
a.cc: In function 'int main()': a.cc:20:30: error: no matching function for call to 'min(long long int&, long int)' 20 | if (x <= y) res = min(res, y - x); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:1: /usr/include/c++/...
s171247628
p03838
C++
#include <bits/stdc++.h> using namespace std; int main(void) { int x, y; cin >> x >> y; int count = 0; if(abs(x) < abs(y)){ count = abs(y) - abs(x); if(x<0&&y=>0 || x=>0 &&y<0) count++; else if(x<0 && y<0) count+=2; } else{ count = abs(x)- abs(y); if(x>0 && ...
a.cc: In function 'int main()': a.cc:13:17: error: expected primary-expression before '>' token 13 | if(x<0&&y=>0 || x=>0 &&y<0) | ^ a.cc:13:25: error: expected primary-expression before '>' token 13 | if(x<0&&y=>0 || x=>0 &&y<0) | ^
s106161958
p03838
C++
x,y=gets.split.map(&:to_i) puts [y-x, 1+(-y)-x, 1+y-(-x), 2+(-y)-(-x)].select(&:positive?).min
a.cc:1:1: error: 'x' does not name a type 1 | x,y=gets.split.map(&:to_i) | ^
s595073581
p03838
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <time.h> #define _CRT_SECURE_NO_WARNINGS #define TLong long long int main(int argc, char const *argv[]) { int x,y,cnt; scanf("%d%d",&x,&y); cnt = abs(abs(x) - abs(y)); if(x > y){ if(x * y < 0) ++cnt; else cnt += 2; } prin...
main.c: In function 'main': main.c:20:17: error: expected ';' before '}' token 20 | return 0 | ^ | ; 21 | } | ~
s596313529
p03838
C++
#include<iostream> using namespace std; int main(){ long long x,y; cin>>x>>y; if(x*y>0){ if(x>y)ans+=2; } else if(x*y<0){ ans++; } else{ if(x>y)ans++; } return 0; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:7:12: error: 'ans' was not declared in this scope; did you mean 'abs'? 7 | if(x>y)ans+=2; | ^~~ | abs a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 10 | ans++; | ^~~ | abs a.cc:13:12: ...
s249285379
p03838
C++
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; inline int read(){ int f=1,ans=0;char c=getchar(); while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();} while(c>='0'&&c<='9'){ans=ans*10+c-'0';c=getchar();} return f*ans; }int x,y; int dis(int x,int y){return y-x;} int main()...
a.cc: In function 'int main()': a.cc:14:18: error: 'INT_MAX' was not declared in this scope 14 | int minn=INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include<algorithm> +++ |+#include ...
s246075670
p03838
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) using namespace std; #define sz(x) ((int)(x).size()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) #define MEMSET(v, h) memset((v), h, sizeof(v))...
a.cc:25:31: error: extended character   is not valid in an identifier 25 | if(x >= 0 && y >= 0 || x < 0 && y < 0){ | ^ a.cc: In function 'int main()': a.cc:25:31: error: '\U00003000x' was not declared in this scope 25 | if(x >= 0 && y >= 0 || x < 0 && y < 0){ ...
s667995985
p03838
C
#include <bits/stdc++.h> using namespace std; int main() { long x, y; cin >> x >> y; long ans; if (x >= 0) { if (y >= 0) { ans = (x <= y) ? (y - x) : (x - y + 2); } else { ans = abs(y + x) + 1; } } else { if (y >= 0) { ans = abs(x ...
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s058486930
p03838
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i)) #define REP(i, n) FOR(i, n, 0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll)1e15; int main() { ll x, y; cin >> x >> y...
a.cc:28:2: error: stray '#' in program 28 | }#include <bits/stdc++.h> | ^ a.cc:28:3: error: 'include' does not name a type 28 | }#include <bits/stdc++.h> | ^~~~~~~ a.cc:38:10: error: redefinition of 'const ll MOD' 38 | const ll MOD = 1000000007; | ^~~ a.cc:11:10: note: 'const ll M...
s699596992
p03838
C++
//#include <bits/stdc++.h> #include <iostream> #include <complex> #include <sstream> #include <string> #include <algorithm> #include <deque> #include <list> #include <map> #include <numeric> #include <queue> #include <vector> #include <set> #include <limits> #include <cstdio> #include <cctype> #include <cmath> #include...
a.cc: In function 'int main()': a.cc:57:26: error: 'ans' cannot be used as a function 57 | ans += abs(abs(y)-ans(x)); | ~~~^~~
s518899008
p03838
C++
#include <iostream> using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; #include <string> #include <cstdio> #include <algorithm> #include <vector> #include <cmath> #include <climits> #include <bitset> #include <array> #include <deque> #include <queue> #include <map> #i...
a.cc: In function 'int main()': a.cc:30:9: error: scalar object 'dx' requires one element in initializer 30 | int dx = {1,1,-1,-1}; | ^~ a.cc:31:9: error: scalar object 'dy' requires one element in initializer 31 | int dy = {1,-1,1,-1}; | ^~
s330868652
p03838
C++
//program luogu.AT2263 #include <iostream> #include <cstdio> using namespace std; #define LL long long LL x,y; int main(){ scanf("%lld %lld",&x,&y); if( x==y ) printf("0\n"); else if( !x || !y) { if( y>x ) printf("%lld\n",y-x); else printf("%lld\n",x-y+1); } else if( x>0 &&...
a.cc: In function 'int main()': a.cc:26:41: error: 'a' was not declared in this scope 26 | printf("%lld\n",abs(abs(a)-abs(b))+1); | ^ a.cc:26:48: error: 'b' was not declared in this scope 26 | printf("%lld\n",abs(abs(a)-abs(b))+1); ...
s596320497
p03838
C++
#include <iostream> #include <cstdio> using namespace std; inline long long abs(long long x) { return x > 0 ? x : -x; } long long x, y; int main() { scanf ("%lld%lld", &x, &y); long long a = abs(x), b = abs(y); if (a > b) { if (x > 0 && y > 0) { printf ("%lld", -y + x + 2); return 0; } else if (x > 0 && y...
a.cc: In function 'int main()': a.cc:10:26: error: call of overloaded 'abs(long long int&)' is ambiguous 10 | long long a = abs(x), b = abs(y); | ~~~^~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, ...
s373183796
p03838
C++
#include <iostream> #include <cstdio> using namespace std; inline long long abs(long long x) { return x > 0 ? x : -x; } long long x, y; int main() { scanf ("%lld%lld", &x, &y); long long a = abs(x), b = abs(y); if (a > b) { if (x > 0 && y > 0) { printf ("%lld", -y + x + 2); return 0; } else if (x > 0 && y...
a.cc: In function 'int main()': a.cc:10:26: error: call of overloaded 'abs(long long int&)' is ambiguous 10 | long long a = abs(x), b = abs(y); | ~~~^~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, ...
s708592753
p03838
C++
#include <iostream> using namespace std; int main() { int x, y; cin >> x >> y; int ans = numeric_limits<int>::max(); for (int bit = 0; bit < 1 << 3; ++bit) { int cnt = 0, tx = x, ty = y; if (bit & (1 << 1)) { tx *= -1; ++cnt; } if (bit & (1)) { ...
a.cc: In function 'int main()': a.cc:9:15: error: 'numeric_limits' was not declared in this scope 9 | int ans = numeric_limits<int>::max(); | ^~~~~~~~~~~~~~ a.cc:9:30: error: expected primary-expression before 'int' 9 | int ans = numeric_limits<int>::max(); | ...
s963594513
p03838
C++
#include "bits/stdc++.h" using namespace std; int main() { int A, B, A-, B-; cin >> A >> B; A- = A * (-1); B- = B * (-1); int ans = pow(10, 9); if (A <= B) { ans = min(ans, B - A); } if (A <= B-) { ans = min(ans, B- - A); } if (A- <= B) { ans = min(ans, ...
a.cc: In function 'int main()': a.cc:5:16: error: expected initializer before '-' token 5 | int A, B, A-, B-; | ^ a.cc:7:8: error: expected primary-expression before '=' token 7 | A- = A * (-1); | ^ a.cc:8:8: error: expected primary-expression before '=' token 8 | ...
s535818838
p03838
C
#include <iostream> using namespace std; int main(){ long long int n,m; cin>>n>>m; if(m>=n) { cout<<min(m-n,m+n+1); }else if(n*m>=0){ cout<<n-m+2; }else { cout<<n+m+1; } }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s940420900
p03838
C++
#include <bits/stdc++.h> using namespace std; int main(){ int x,y; cin >> x >> y; if(x==0){ if(y>0){ cout << y <<endl; }else{ cout << -y+1 << endl; } return 0; } if(y==0){ if(x>0){ cout << 1+x << endl; }else{ cout << -x << endl; } retrun 0; } if(x>=0...
a.cc: In function 'int main()': a.cc:20:5: error: 'retrun' was not declared in this scope 20 | retrun 0; | ^~~~~~
s451337963
p03838
C++
#include<iostream> #include<vector> #include<algorithm> #include<string> using namespace std; #define ll long long; #define MM = 1000000000; #define mod = MM + 7; #define INF (ll)1e18 #define pi acos(-1.0) #define MAX 100005 #define NIL -1 int main(){ ll x, y; cin >> x >> y; ll ans = 0; if(x <= y){ ...
a.cc: In function 'int main()': a.cc:6:17: error: declaration does not declare anything [-fpermissive] 6 | #define ll long long; | ^~~~ a.cc:14:5: note: in expansion of macro 'll' 14 | ll x, y; cin >> x >> y; | ^~ a.cc:14:8: error: 'x' was not declared in this scope 14 | ...
s590645233
p03838
C++
#include<bits/stdc++.h> #define lli long long int #define MOD 1000000007 #define FOR(i,n) for(int i=0;i<(int)n;i++) #define ALL(x) (x).begin(),(x).end() using namespace std; inline lli getint(){ lli n; scanf("%lld",&n); return n; } inline vector<lli> getints(int n){ vector<lli> a(n); for(int i=0;i...
a.cc:62:4: error: expected unqualified-id before 'else' 62 | }else{ | ^~~~ a.cc:69:3: error: 'cout' does not name a type 69 | cout<<ans<<endl; | ^~~~ a.cc:70:3: error: expected unqualified-id before 'return' 70 | return 0; | ^~~~~~ a.cc:71:1: error: expected declaration before '}...
s422423865
p03838
C++
#include <iostream> #include <string> #include <vector> #include <map> #include <algorithm> #include <deque> #include <cctype> #include <cstdio> #include <math.h> using namespace std; int main(){ long long x,y; cin >> x >> y; long long ans=0; if(abs(x)<abs(y)){ ans+=abs((abs(y)-abs(x)); ...
a.cc: In function 'int main()': a.cc:16:33: error: expected ')' before ';' token 16 | ans+=abs((abs(y)-abs(x)); | ~ ^ | )
s465903486
p03838
C++
#include <stdio.h> int solve(int x, int y) { int ay = y > 0 ? y : -y; int ax = x > 0 ? x : -x; if(ax == ay) return x != y; if(ay < ax) return (x > 0) + ax - ay + (y > 0)); return (x < 0) + ay - ax + (y < 0); } int main(){ int x, y; scanf("%d %d", &x, &y); printf("%d\n", solve(x, y)); return 0; }
a.cc: In function 'int solve(int, int)': a.cc:7:49: error: expected ';' before ')' token 7 | if(ay < ax) return (x > 0) + ax - ay + (y > 0)); | ^ | ; a.cc:7:49: error: expected primary-expression before ')'...
s792162157
p03838
C++
#define dbg(x) do { std::cerr << #x << ": " << x << std::endl; } while (0) using namespace std; int main() { // freopen("a.inp", "r", stdin); long long x, y; cin >> x >> y; int xx = abs(x), yy = abs(y); // dbg(xx); // dbg(yy); if (xx > yy) xx = -xx, yy = -yy; int ans = 0; if (xx != x)...
a.cc: In function 'int main()': a.cc:8:5: error: 'cin' was not declared in this scope 8 | cin >> x >> y; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #define dbg(x) do { std::cerr << #x ...
s627919082
p03838
C++
#include<cstdio> using namespace std; int main(){ int x,y,ans=2000000003; scanf("%d %d",&x,&y); if(x<=y) ans=y-x; if(-1*x<=y) ans=min(ans,y+x+1); if(x<=-1*y) ans=min(ans,-1*y-x+1); if(-1*x<=-1*y) ans=min(ans,-1*y+x+2); printf("%d\n",ans); }
a.cc: In function 'int main()': a.cc:9:9: error: 'min' was not declared in this scope; did you mean 'main'? 9 | ans=min(ans,y+x+1); | ^~~ | main a.cc:11:9: error: 'min' was not declared in this scope; did you mean 'main'? 11 | ans=min(ans,-1*y-x+1); | ^~~ |...
s445688150
p03838
C++
x,y=gets.split.map(&:to_i) if x<=y puts y-x else puts x-y+2 end
a.cc:1:1: error: 'x' does not name a type 1 | x,y=gets.split.map(&:to_i) | ^
s006545315
p03838
C++
#include<iostream> #include<cmath> #include<algorithm> using namespace std; int main() { int x, y; cin >> x >> y; int b = max(abs(x), abs(y)), s = min(abs(x), abs(y)); if(y - x >= 0){ if(x * y >= 0){ cout << y - x << endl; return 0; } } if(x * y =...
a.cc: In function 'int main()': a.cc:18:15: error: expected primary-expression before '<' token 18 | if(x * y =< 0){ | ^
s461516137
p03838
C++
#include<bits/stdc++.h> using namespace std;int a,b;main(){cin>>a>>b;cout<<(a<b)?min(b-a,abs(b+a)+1):min(1+a-b,abs(a+b))+1;
a.cc:2:29: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | using namespace std;int a,b;main(){cin>>a>>b;cout<<(a<b)?min(b-a,abs(b+a)+1):min(1+a-b,abs(a+b))+1; | ^~~~ a.cc: In function 'int main()': a.cc:2:100: error: expected '}' at end of input ...
s971307279
p03838
C++
#include<bits/stdc++.h> using namespace std;int a,b;main(){cin>>a>>b;cout<<a<b?min(b-a,abs(b+a)+1):min(1+a-b,abs(a+b))+1;
a.cc:2:29: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | using namespace std;int a,b;main(){cin>>a>>b;cout<<a<b?min(b-a,abs(b+a)+1):min(1+a-b,abs(a+b))+1; | ^~~~ a.cc: In function 'int main()': a.cc:2:53: error: no match for 'operator<' (operand ty...
s093638442
p03838
C++
#include<bits/stdc++.h> using namespace std; #define rp(i,n) for(int i=0;i<n;i++) #define rep(i,m,n) for(int i=m;i<=n;i++) #define llrp(i,n) for(long long i=0;i<n;i++) #define llrep(i,m,n) for(long long i=m;i<=n;i++) #define sort(a) sort(a.begin(),a.end()) #define reverse(a) reverse(a.begin(),a.end()) #define pb push_...
a.cc: In function 'int main()': a.cc:56:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 56 | cout << min(ans,m+n+1) << endl; | ^~~ | abs
s265586332
p03838
C++
#include<algorithm> #include<iostream> #include<vector> #include<string> #include<cstring> #include<utility> #include<queue> using namespace std; #define REP(i, a,b) for(i=a;i<b;i++) #define REP1(i,b,a) for(i=b-1;i>=a;i--) #define output(x) cout<<x<<endl; #define pb(x) push_back(x); typedef long long int ll; const int...
a.cc: In function 'int main()': a.cc:66:21: error: 'fmax' was not declared in this scope 66 | k = fmax(ans, ans1); | ^~~~
s924160068
p03838
C++
#include<cstdio> #include<iostream> using namespace std; int x,y,ans=0; inline int abs(int x) {return x<0 ? -x:x;} int main() { cin>>x>>y if(x==-y) ans=1; else if(abs(x)<abs(y)) ans=abs(y)-abs(x)+(x<0)+(y<0); else ans=abs(x)-abs(y)+(x>0)+(y>0); printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:7:14: error: expected ';' before 'if' 7 | cin>>x>>y | ^ | ; 8 | if(x==-y) ans=1; | ~~ a.cc:9:5: error: 'else' without a previous 'if' 9 | else if(abs(x)<abs(y)) ans=abs(y)-abs(x)+(x<0)+(y<0); | ...
s976960970
p03838
C++
#include<iostream> using namespace std; int main(){ int X=0; int Y=0; cin>>X; cin>>Y; int ans=abs(abs(X)-abs(Y)); if(Y>X&&X>0||0>=&&Y>X){ }else if(Y>=0&&X>Y||0>=X&&X<Y){ ans+=2; }else{ ans+=1; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:14:19: error: ordered comparison of pointer with integer zero ('int' and 'void*') 14 | if(Y>X&&X>0||0>=&&Y>X){ | ~^~~~~ a.cc:14:23: error: label 'Y' used but not defined 14 | if(Y>X&&X>0||0>=&&Y>X){ | ^
s337858981
p03838
C++
#include <iostream> using namespace std; int f(int x, int y) { if (x > y) return 2e9+50; return y - x; } int main() { int x, y; cin >> x >> y; cout << min({f(x,y),1+f(x,-y),1+f(-x,y),2+f(-x,-y)}) << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:14: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 13 | cout << min({f(x,y),1+f(x,-y),1+f(-x,y),2+f(-x,-y)}) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, ...
s067052400
p03838
C++
#include<iostream> using namespace std; typedef long long ll; int main(){ ll a, b, ans = LLONG_MAX; cin >> a >> b; for(int i = 0; i < 4; i++){ ll tmp = 0; if(1&i){ a = -a; tmp++; } if(i&2){ b = -b; tmp++; } if(a <= b){ tmp += b - a; ans = min(ans...
a.cc: In function 'int main()': a.cc:7:18: error: 'LLONG_MAX' was not declared in this scope 7 | ll a, b, ans = LLONG_MAX; | ^~~~~~~~~ a.cc:2:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include<iostream> +++ |+#in...
s757800888
p03838
C
#include <stdio.h> #include <stdlib.h> int main(void){ int x,y; scanf("%d%d",&x,&y); if (x*y>0){ if(x<y){ printf("%d\n",y-x); } else { printf("%d\n",x-y+2)); } } else { printf("%d\n",abs(abs(x)-abs(y))+1); } return 0 ; }
main.c: In function 'main': main.c:11:33: error: expected ';' before ')' token 11 | printf("%d\n",x-y+2)); | ^ | ; main.c:11:33: error: expected statement before ')' token
s770905239
p03838
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int x, y; cin >> x >> y; if(x*y==0){ cout << abs(x)+abs(y) + x>y?1:0; } else if(x*y<0){ cout << abs(abs(y)-abs(x))+1; } else{ if(x<y) cout << y-x; else cout << 2+y-x; } }
a.cc: In function 'int main()': a.cc:8:30: error: no match for 'operator>' (operand types are 'std::basic_ostream<char>' and 'int') 8 | cout << abs(x)+abs(y) + x>y?1:0; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~ | | | | | int | std:...
s032856560
p03838
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int x, y; cin >> x >> y; if(x*y==0){ cout << abs(x)+abs(y) + x>y?1:0; } else (x*y<0){ cout << abs(abs(y)-abs(x))+1; } else{ if(x<y) cout << y-x; else cout << 2+y-x; } }
a.cc: In function 'int main()': a.cc:8:30: error: no match for 'operator>' (operand types are 'std::basic_ostream<char>' and 'int') 8 | cout << abs(x)+abs(y) + x>y?1:0; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~ | | | | | int | std:...
s277019682
p03838
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int x, y; cin >> x >> y; if(x*y==0){ if(x>0) cout << abs(x)+1; else cout << abs(x); } else (x*y<0){ cout << abs(abs(y)-abs(x))+1; } else{ if(x<y) cout << y-x; else cout << 2+y-x; } }
a.cc: In function 'int main()': a.cc:11:15: error: expected ';' before '{' token 11 | else (x*y<0){ | ^ | ; a.cc:14:3: error: 'else' without a previous 'if' 14 | else{ | ^~~~
s288495966
p03838
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int x, y; cin >> x >> y; if(x*y==0){ if(x) cout << x+1; else cout << y; } else (x*y<0){ cout << abs(y)-abs(x)+1; } else{ if(x<y) cout << y-x; else cout << 2+y-x; } }
a.cc: In function 'int main()': a.cc:11:15: error: expected ';' before '{' token 11 | else (x*y<0){ | ^ | ; a.cc:14:3: error: 'else' without a previous 'if' 14 | else{ | ^~~~
s186424179
p03838
C++
#include <bits/stdc++.h> #define int long long using namespace std; signed main(){ int x,y; cin>>x>>y; if(x>0){ if(y>0){ if(x<y)cout<<max(x-y,y-x)<<endl; else cout<<max(x-y,y-x)+2<<endl; else cout<<max(x+y,-x-y)+1<<endl; } if(x==0){ if(y>=0)cout<<y<<endl; else cout<<1-y<<endl; }...
a.cc: In function 'int main()': a.cc:12:5: error: expected '}' before 'else' 12 | else cout<<max(x+y,-x-y)+1<<endl; | ^~~~ a.cc:9:12: note: to match this '{' 9 | if(y>0){ | ^
s175255941
p03838
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <cmath> #include <queue> using namespace std; #define FOR(i,a,b) for(int (i)=(a);(i)<=(b);(i)++) #define rep(i,n) FOR(i,0,n-1) #define ll long long #define MOD 998244353 #define MAXN 100005 #define P pair<int,int> vec...
a.cc: In function 'int main()': a.cc:22:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 22 | ans = abs(abs(x) - abs(y)); | ^~~ | abs
s603807602
p03838
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <cmath> #include <queue> using namespace std; #define FOR(i,a,b) for(int (i)=(a);(i)<=(b);(i)++) #define rep(i,n) FOR(i,0,n-1) #define ll long long #define MOD 998244353 #define MAXN 100005 #define P pair<int,int> vec...
a.cc: In function 'int main()': a.cc:22:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 22 | ans = abs(abs(x) - abs(y)); | ^~~ | abs
s755675893
p03838
C++
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <queue> #include <limits> #define REP(i,n) for(long (i)=0;(i)<(n);(i)++) #define REPI(i,a,b) for(long (i)=(a);(i)<(b);(i)++) #define INF numeric_limits<double>::infinity() constexpr long MOD = 998244353; using namespace std; using P = ...
a.cc: In function 'int main()': a.cc:33:9: error: 'assert' was not declared in this scope 33 | assert(x <= 0 && -x >= y); | ^~~~~~ a.cc:6:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>' 5 | #include <queue> +++ |+#include <casser...
s603275795
p03838
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include <cstdio> #include <bits/stdc++.h> #include <set> #include <map> #include <stdio.h> using namespace std; using ll = long long; map <int ,int> mpa,mpb; int main(){ ll x,y; cin >>x >>y; ll ans=0; if(x=0 ||y=0){ ...
a.cc: In function 'int main()': a.cc:19:10: error: lvalue required as left operand of assignment 19 | if(x=0 ||y=0){ | ~~^~~
s266007945
p03838
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include <cstdio> #include <bits/stdc++.h> #include <set> #include <map> #include <stdio.h> using namespace std; using ll = long long; map <int ,int> mpa,mpb; int main(){ ll x,y; cin >>x >>y; ll ans=0; if(x*y=0){ ...
a.cc: In function 'int main()': a.cc:19:7: error: lvalue required as left operand of assignment 19 | if(x*y=0){ | ~^~
s203924731
p03838
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <map> #include <set> #include <vector> #include <stack> #include <queue> #include <bitset> #include <algorithm> #include <numeric> #include <functional> using namespace std; #define Rep(b, e, i) for(int i = b; i <= e;...
a.cc: In function 'void solve()': a.cc:54:9: error: 'else' without a previous 'if' 54 | else cout << min(abs(M - N), abs(M+N)+1) << endl; | ^~~~
s984269648
p03838
C++
#include <iostream> #include <algorithm> #include <set> #include <cstring> using namespace std; typedef long long ll; int x,y; int main(void){ scanf("%d%d",&x,&y); if((x>=0&&y>0)||(x<=0&&y<0)){ if(x<=y)printf("%d\n",y-x); else printf("%d\n",x-y+2); }else{ else printf("%d\n",abs(abs(x)-abs(...
a.cc: In function 'int main()': a.cc:14:8: error: 'else' without a previous 'if' 14 | else printf("%d\n",abs(abs(x)-abs(y))+1); | ^~~~
s809160503
p03838
C++
#include<bits/stdc++.h> const int INF = 1e9; const int MOD = 1e9+7; #define LL long long const LL LINF = 1e18; using namespace std; #define COUT(v) cout<<(v)<<endl #define CIN(n) int(n);cin >> (n) #define YES(n) cout<<((n)? "YES" : "NO")<<endl #define Yes(n) cout<<((n)? "Yes" : "No")<<endl #define POSSIBLE(n) cout <<...
a.cc: In function 'int main()': a.cc:26:11: error: declaration does not declare anything [-fpermissive] 26 | #define V vector | ^ a.cc:34:5: note: in expansion of macro 'V' 34 | V<LL>; | ^ a.cc:39:5: error: 'v' was not declared in this scope 39 | v.pb(ans1); | ^
s197793478
p03838
C++
#include <cstdio> #include <cstdlib> #include <iostream> #include <fstream> #include <sstream> #include <set> #include <map> #include <vector> #include <list> #include <algorithm> #include <cstring> #include <cmath> #include <string> #include <queue> #include <bitset> //UWAGA - w czasie kompilacji musi byc znany ro...
a.cc: In function 'int main()': a.cc:54:22: error: no matching function for call to 'min(long long int&, int&)' 54 | c=min(c,t); | ~~~^~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s639009167
p03838
Java
import java.util.Scanner; public class AGC08a{ static int calc(int init, int goal){ if(goal * init < 0){ return Math.abs(goal + init) + 1; } else if(init > 0 && goal > 0){ int ret; if(init > goal){ ret = init - goal + 2; }else{...
Main.java:3: error: class AGC08a is public, should be declared in a file named AGC08a.java public class AGC08a{ ^ 1 error
s703408963
p03838
Java
import java.util.*; public class AGC08a{ static int init; static int goal; static int calc(int init, int goal){ int ret = 0; if(goal * init < 0){ ret = Math.abs(goal + init) + 1; } else if(init > 0 && goal > 0){ if(init > goal){ ret = i...
Main.java:2: error: class AGC08a is public, should be declared in a file named AGC08a.java public class AGC08a{ ^ 1 error
s549462173
p03838
C++
#include<bits/stdc++.h> #define REP(i,s,n) for(int i=s;i<n;++i) #define rep(i,n) REP(i,0,n) #define ALL(x) x.begin(),x.end() #define EPS (1e-8) #define equals(a,b) (fabs((a)-(b))<EPS) using namespace std; typedef long long ll; inline bool LT(double a,double b) { return !equals(a,b) && b < b; } inline bool LTE(doubl...
a.cc: In function 'int main()': a.cc:31:11: error: expected statement at end of input 31 | } else | ^ a.cc:31:11: error: expected '}' at end of input a.cc:28:10: note: to match this '{' 28 | } else { | ^ a.cc:31:11: error: expected '}' at end of input 31 | } else ...
s108851057
p03838
C++
#include<bits/stdc++.h> #define REP(i,s,n) for(int i=s;i<n;++i) #define rep(i,n) REP(i,0,n) #define ALL(x) x.begin(),x.end() #define EPS (1e-8) #define equals(a,b) (fabs((a)-(b))<EPS) using namespace std; typedef long long ll; inline bool LT(double a,double b) { return !equals(a,b) && b < b; } inline bool LTE(doubl...
a.cc: In function 'int main()': a.cc:31:11: error: expected statement at end of input 31 | } else | ^ a.cc:31:11: error: expected '}' at end of input a.cc:28:10: note: to match this '{' 28 | } else { | ^ a.cc:31:11: error: expected '}' at end of input 31 | } else ...