submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s543640554 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
int main(){
int w,a,b,ans1;
cin>>w>>a>>b;
if(((a==b||b==a+w)&&(a<b)||((a==b||a==b+w)&&(a>b)))
cout<<"0";
return 0;
} | a.cc: In function 'int main()':
a.cc:7:60: error: expected ';' before 'cout'
7 | if(((a==b||b==a+w)&&(a<b)||((a==b||a==b+w)&&(a>b)))
| ^
| ;
8 | cout<<"0";
| ~~~~
a.cc:9:9: error: expected primary-expression before 'return'
9 | return 0;
| ^~~~~~
a.cc:8:27: error: expected ')' before 'return'
8 | cout<<"0";
| ^
| )
9 | return 0;
| ~~~~~~
a.cc:7:11: note: to match this '('
7 | if(((a==b||b==a+w)&&(a<b)||((a==b||a==b+w)&&(a>b)))
| ^
|
s247501764 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int w,a,b;cin >> w >> a >> b;
if(a<=b) cout << max(b-(a+w),0) << endl;;
else cout << max(a-(b+w),0) << endl;
} | a.cc: In function 'int main()':
a.cc:14:9: error: 'else' without a previous 'if'
14 | else cout << max(a-(b+w),0) << endl;
| ^~~~
|
s193291126 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int w,a,b;cin >> w >> a >> b;
if(a<=b) cout << max(b-(a+w),0) << endl;;
else cout << max(a-(b+w) << endl;
} | a.cc: In function 'int main()':
a.cc:14:9: error: 'else' without a previous 'if'
14 | else cout << max(a-(b+w) << endl;
| ^~~~
a.cc:14:34: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
14 | else cout << max(a-(b+w) << endl;
| ~~~~~~~~^~~~~~~
|
s625544786 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int W, a, b, cin >> W >> a >> b;
if (b <= a + W)
cout << b - a + W << endl;
else
cout << 0 << endl;
} | a.cc: In function 'int main()':
a.cc:5:20: error: expected initializer before '>>' token
5 | int W, a, b, cin >> W >> a >> b;
| ^~
|
s530668692 | p03778 | C++ | /// Containers Start
#include <iostream>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <cstdlib>
#include <iterator>
#include <algorithm>
#include <functional>
#include <random>
/// C Header Files
#include <stdio.h>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <math.h>
#include <ctime>
#include <cstring>
/// Containers End
using namespace std;
/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End
/// Extra Start
#define nn '\n'
#define pb push_back
#define SS stringstream
#define ull unsigned long long
#define mod 1000000007
#define SIZE 2000001
#define _cin \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define Ignore cin.ignore()
#define StringToInt \
if (!(istringstream(s) >> n)) \
n = 0;
#define SORT(c) sort(All((c)))
#define RSORT(c) sort(rall((c)))
/// Extra End
/// Functions Start
template <class T>
T gcd(T a, T b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
template <class T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
template <class T>
string converter(T n)
{
SS x;
x << n;
return x.str();
}
string itos(int a)
{
string s = to_string(a);
return s;
}
template <class T>
T mod_pow(T x, T n)
{
T res = 1;
while (n > 0)
{
if (n & 1)
res = res * x % mod;
x = x * x % mod;
n >>= 1;
}
return res;
}
std::vector<std::string> split(const std::string &str, char sep)
{
std::vector<std::string> v;
std::stringstream ss(str);
std::string buffer;
while (std::getline(ss, buffer, sep))
{
v.push_back(buffer);
}
return v;
}
#define rep(i, n) for (int i = 0; i < n; i++)
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define for_arr(array) for (auto &i : array)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
#define FORA(arr) for (auto &i : arr)
#define Cin(a) cin >> a;
#define Cin2(a, b) cin >> a >> b;
#define Cin3(a, b, c) cin >> a >> b >> c;
#define Cin4(a, b, c, d) cin >> a >> b >> c >> d;
#define Cini(a) \
int a; \
cin >> a;
#define Cinii(a, b) \
int a, b; \
cin >> a >> b;
#define Ciniii(a, b, c) \
int a, b, c; \
cin >> a >> b >> c;
#define Cins(s) \
string s; \
cin >> s;
#define Cinc(c) \
char c; \
cin >> c;
/// Functions End
/// Array Start
#define SET(a) memset(a, -1, sizeof a)
#define CLR(a) memset(a, 0, sizeof a)
#define MEM(a, val) memset(a, val, sizeof a)
/// Array End
/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl
#define deb3(x, y, z) cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z << end
/// Debug End
/// TypeDef Start
typedef long long int ll;
typedef map<string, int> msi;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef map<char, int> mci;
typedef map<int, string> mis;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef pair<string, string> pss;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<pii> vii;
/// TypeDef End
int dx[] = s{-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/
///topcoder template
bool mysort(pair<int, int> a, pair<int, int> b)
{
return a.second > b.second;
}
int main(void)
{
Ciniii(w, a, b);
if (a<=b and b <= a + w or a <= b + w and b<=a)
{
cout << 0 << nn;
return 0;
}
else
{
cout << min(abs(a + w - b), abs(b + w - a)) << nn;
return 0;
}
}
| a.cc:168:12: error: 's' was not declared in this scope; did you mean 'vs'?
168 | int dx[] = s{-1, 0, 1, 0};
| ^
| vs
|
s793608052 | p03778 | C++ | #include <iostream>
using namespace std;
int W,a,b;
int main(){
cin W >> a >> b;
if(a>b) swap(a,b);
cout << min(b-(a+W),0) << endl;
} | a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'W'
6 | cin W >> a >> b;
| ^~
| ;
|
s175376110 | p03778 | C | include <stdio.h>
#include<math.h>
int main()
{
long long int a=0,b=0,w=0,flag,i,str1=0,str2=0;
scanf("%lld%lld%lld",&w,&a,&b);
if(abs(a-b)<=w)
{
printf("0");
}
else{
printf("%lld",abs(a-b)-w);
}
return 0;
}
| main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
main.c: In function 'main':
main.c:7:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
7 | scanf("%lld%lld%lld",&w,&a,&b);
| ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
2 | #include<math.h>
+++ |+#include <stdio.h>
3 | int main()
main.c:7:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
7 | scanf("%lld%lld%lld",&w,&a,&b);
| ^~~~~
main.c:7:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:4: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
8 | if(abs(a-b)<=w)
| ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
2 | #include<math.h>
+++ |+#include <stdlib.h>
3 | int main()
main.c:8:9: warning: 'abs' argument 1 type is 'long long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
8 | if(abs(a-b)<=w)
| ~^~
<built-in>: note: built-in 'abs' declared here
main.c:10:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
10 | printf("0");
| ^~~~~~
main.c:10:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
13 | printf("%lld",abs(a-b)-w);
| ^~~~~~
main.c:13:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:24: warning: 'abs' argument 1 type is 'long long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
13 | printf("%lld",abs(a-b)-w);
| ~^~
<built-in>: note: built-in 'abs' declared here
|
s434963701 | p03778 | C++ | #include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
// hamko utils
#define rep(i,n) for(long long i = 0; i < (long long)(n); i++)
#define repi(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define mt make_tuple
#define mp make_pair
template<class T1, class T2> bool chmin(T1 &a, T2 b) { return b < a && (a = b, true); }
template<class T1, class T2> bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; using P = pair<ll, ll>;
using ld = long double; using vld = vector<ld>;
using vi = vector<int>; using vvi = vector<vi>; vll conv(vi& v) { vll r(v.size()); rep(i, v.size()) r[i] = v[i]; return r; }
inline void input(int &v){ v=0;char c=0;int p=1; while(c<'0' || c>'9'){if(c=='-')p=-1;c=getchar();} while(c>='0' && c<='9'){v=(v<<3)+(v<<1)+c-'0';c=getchar();} v*=p; } // これを使うならば、tieとかを消して!!
template <typename T, typename U> ostream &operator<<(ostream &o, const pair<T, U> &v) { o << "(" << v.first << ", " << v.second << ")"; return o; }
template<size_t...> struct seq{}; template<size_t N, size_t... Is> struct gen_seq : gen_seq<N-1, N-1, Is...>{}; template<size_t... Is> struct gen_seq<0, Is...> : seq<Is...>{};
template<class Ch, class Tr, class Tuple, size_t... Is>
void print_tuple(basic_ostream<Ch,Tr>& os, Tuple const& t, seq<Is...>){ using s = int[]; (void)s{0, (void(os << (Is == 0? "" : ", ") << get<Is>(t)), 0)...}; }
template<class Ch, class Tr, class... Args>
auto operator<<(basic_ostream<Ch, Tr>& os, tuple<Args...> const& t) -> basic_ostream<Ch, Tr>& { os << "("; print_tuple(os, t, gen_seq<sizeof...(Args)>()); return os << ")"; }
ostream &operator<<(ostream &o, const vvll &v) { rep(i, v.size()) { rep(j, v[i].size()) o << v[i][j] << " "; o << endl; } return o; }
template <typename T> ostream &operator<<(ostream &o, const vector<T> &v) { o << '['; rep(i, v.size()) o << v[i] << (i != v.size()-1 ? ", " : ""); o << "]"; return o; }
template <typename T> ostream &operator<<(ostream &o, const deque<T> &v) { o << '['; rep(i, v.size()) o << v[i] << (i != v.size()-1 ? ", " : ""); o << "]"; return o; }
template <typename T> ostream &operator<<(ostream &o, const set<T> &m) { o << '['; for (auto it = m.begin(); it != m.end(); it++) o << *it << (next(it) != m.end() ? ", " : ""); o << "]"; return o; }
template <typename T> ostream &operator<<(ostream &o, const unordered_set<T> &m) { o << '['; for (auto it = m.begin(); it != m.end(); it++) o << *it << (next(it) != m.end() ? ", " : ""); o << "]"; return o; }
template <typename T, typename U> ostream &operator<<(ostream &o, const map<T, U> &m) { o << '['; for (auto it = m.begin(); it != m.end(); it++) o << *it << (next(it) != m.end() ? ", " : ""); o << "]"; return o; }
template <typename T, typename U, typename V> ostream &operator<<(ostream &o, const unordered_map<T, U, V> &m) { o << '['; for (auto it = m.begin(); it != m.end(); it++) o << *it; o << "]"; return o; }
vector<int> range(const int x, const int y) { vector<int> v(y - x + 1); iota(v.begin(), v.end(), x); return v; }
template <typename T> istream& operator>>(istream& i, vector<T>& o) { rep(j, o.size()) i >> o[j]; return i;}
template <typename T, typename S, typename U> ostream &operator<<(ostream &o, const priority_queue<T, S, U> &v) { auto tmp = v; while (tmp.size()) { auto x = tmp.top(); tmp.pop(); o << x << " ";} return o; }
template <typename T> ostream &operator<<(ostream &o, const queue<T> &v) { auto tmp = v; while (tmp.size()) { auto x = tmp.front(); tmp.pop(); o << x << " ";} return o; }
template <typename T> ostream &operator<<(ostream &o, const stack<T> &v) { auto tmp = v; while (tmp.size()) { auto x = tmp.top(); tmp.pop(); o << x << " ";} return o; }
template <typename T> unordered_map<T, ll> counter(vector<T> vec){unordered_map<T, ll> ret; for (auto&& x : vec) ret[x]++; return ret;};
string substr(string s, P x) {return s.substr(x.fi, x.se - x.fi); }
void vizGraph(vvll& g, int mode = 0, string filename = "out.png") { ofstream ofs("./out.dot"); ofs << "digraph graph_name {" << endl; set<P> memo; rep(i, g.size()) rep(j, g[i].size()) { if (mode && (memo.count(P(i, g[i][j])) || memo.count(P(g[i][j], i)))) continue; memo.insert(P(i, g[i][j])); ofs << " " << i << " -> " << g[i][j] << (mode ? " [arrowhead = none]" : "")<< endl; } ofs << "}" << endl; ofs.close(); system(((string)"dot -T png out.dot >" + filename).c_str()); }
size_t random_seed; namespace std { using argument_type = P; template<> struct hash<argument_type> { size_t operator()(argument_type const& x) const { size_t seed = random_seed; seed ^= hash<ll>{}(x.fi); seed ^= (hash<ll>{}(x.se) << 1); return seed; } }; }; // hash for various class
#define ldout fixed << setprecision(40)
#define EPS (double)1e-14
#define INF (ll)1e18
#define mo (ll)(1e9+7)
// end of hamko utils
int main() {
int w,a,b;
cin >> w >> a >> b;
if(abs(a-b)=<w) cout << "0" << endl;
else if(b>a+w) cout << b-(a+w) << endl;
else cout << a-(b+w) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:54:15: error: expected primary-expression before '<' token
54 | if(abs(a-b)=<w) cout << "0" << endl;
| ^
|
s377749104 | p03778 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
int main(){
int a,b,W;ac
cin >> W >> a >> b;
if( abs(a-b) <= W){
cout << 0 << endl;
return 0;
}
cout << abs(a-b) - W << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:13: error: 'ac' was not declared in this scope; did you mean 'a'?
8 | int a,b,W;ac
| ^~
| a
|
s354388027 | p03778 | C | #include<stdio.h>
#include<stdlib.h>
int main(){
int w,a,b;
scanf("%d%d%d",&w,&a,&b);
if(abs(a+w-b)<=0)puts("0");
else{
printf("%d",abs(a+w-b));
return 0;
} | main.c: In function 'main':
main.c:11:1: error: expected declaration or statement at end of input
11 | }
| ^
|
s003787173 | p03778 | C | #include<stdio.h>
int main(){
int w,a,b;
scanf("%d%d%d",&w,&a,&b);
if(abs(a+w-b)<=0)puts("0");
else{
printf("%d",abs(a+w-b));
return 0;
} | main.c: In function 'main':
main.c:6:4: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
6 | if(abs(a+w-b)<=0)puts("0");
| ^~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
1 | #include<stdio.h>
+++ |+#include <stdlib.h>
2 |
main.c:10:1: error: expected declaration or statement at end of input
10 | }
| ^
|
s050575760 | p03778 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
int w,a,b;
cin>>w>>a>>b;
if(a>b){
if(a-b<w) cout<<0<<endl;
else cout<<a-b-w<<endl;
}
else if(b>a){
if(b-a<w) cout<<0<<endl;
else cout<<b-a-w<<endl;
}
| a.cc: In function 'int main()':
a.cc:15:6: error: expected '}' at end of input
15 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s793303248 | p03778 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
int w,a,b;
cin>>w>>a>>b;
if(abs(a-b)-w<=0) cout<<"0"<<endl;
else cout<<(abs(a-b)-w<<endl;
} | a.cc: In function 'int main()':
a.cc:9:27: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
9 | else cout<<(abs(a-b)-w<<endl;
| ~~~~~~~~~~^~~~~~
a.cc:9:33: error: expected ')' before ';' token
9 | else cout<<(abs(a-b)-w<<endl;
| ~ ^
| )
|
s577042756 | p03778 | C++ | #include <iostream>
#include <cmath>
#include <iomanip>
#include <limits>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int w,a,b;
cin >> w >> a >> b;
if(a+w < b) cout << b-a-W << endl;
else if(b+w < a) cout << a-b-w << endl;
else cout << 0 << endl;
} | a.cc: In function 'int main()':
a.cc:13:29: error: 'W' was not declared in this scope
13 | if(a+w < b) cout << b-a-W << endl;
| ^
|
s506364430 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i,n) for(ll i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
# define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
# define DBG(fmt, ...)
#endif
const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 110
int W, a, b;
signed main()
{
cin >> W >> a >> b;
int a_l = a + W;
int b_l = b + W;
if( (a <= b && b <= a_l) || (a <= b_l && b_l <= a_l)
(b <= a && a <= b_l) || (b <= a_l && a_l <= b_l)
) {
printf("0\n");
return 0;
}
if(a_l < b) {
printf("%lld\n", b - a_l);
}
printf("%lld\n", a - b_l);
return 0;
}
| a.cc: In function 'int main()':
a.cc:31:9: error: expression cannot be used as a function
30 | if( (a <= b && b <= a_l) || (a <= b_l && b_l <= a_l)
| ~~~~~~~~~~~~~~~~~~~~~~~~
31 | (b <= a && a <= b_l) || (b <= a_l && a_l <= b_l)
| ^~~~~~~~~~~~~~~~~~~~
|
s408534235 | p03778 | C | //set many funcs template
//Ver.20180716
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int nHr(int a,int b){return nCr(a+b-1,b);}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}
int sankaku(int x){return ((1+x)*x)/2;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);}
int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);}
void shuffledget(int x[],int n){
srand(time(0));
int i,b[524288],p,c;
for(i=0;i<n;i++){
b[i]=i;
}
for(i=n;i>=1;i--){
p=rand()%i;
c=b[i-1];b[i-1]=b[p];b[p]=c;
}
for(i=0;i<n;i++){
scanf("%d",&x[b[i]]);
}
}
int dx4[4]={1,-1,0,0};
int dy4[4]={0,0,1,-1};
int dx8[8]={-1,-1,-1,0,0,1,1,1};
int dy8[8]={-1,0,1,-1,1,-1,0,1};
int search(int x,int a[],int n){
int st=0,fi=n-1,te;
while(st<=fi){
te=(st+fi)/2;
if(a[te]<x){st=te+1;}else{fi=te-1;}
}
return st;
}
int main(void){
int i,j,n,m,k,a[524288],b,c,h,w,r=0,l,t;
double d;
char s[524288];
scanf("%d%d%d",&w,&a,&b);
//l=strlen(s);
//for(i=0;i<n;i++){scanf("%d",&a[i]);}
//shuffledget(a,n);
//qsort(a,n,sizeof(int),sortfncsj);
if(a+w<b){
printf("%d\n",b-(a+w));
return 0;
}
if(b+w<a){
printf("%d\n",a-(b+w));
return 0;
}
printf("0\n");
return 0;
} | main.c:16:5: warning: conflicting types for built-in function 'round'; expected 'double(double)' [-Wbuiltin-declaration-mismatch]
16 | int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
| ^~~~~
main.c:8:1: note: 'round' is declared in header '<math.h>'
7 | #include<time.h>
+++ |+#include <math.h>
8 | #define inf 1072114514
main.c:17:5: warning: conflicting types for built-in function 'ceil'; expected 'double(double)' [-Wbuiltin-declaration-mismatch]
17 | int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
| ^~~~
main.c:17:5: note: 'ceil' is declared in header '<math.h>'
main.c:23:5: warning: conflicting types for built-in function 'pow'; expected 'double(double, double)' [-Wbuiltin-declaration-mismatch]
23 | int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
| ^~~
main.c:23:5: note: 'pow' is declared in header '<math.h>'
main.c:30:11: warning: conflicting types for built-in function 'llround'; expected 'long long int(double)' [-Wbuiltin-declaration-mismatch]
30 | long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
| ^~~~~~~
main.c:30:11: note: 'llround' is declared in header '<math.h>'
main.c: In function 'main':
main.c:91:11: warning: comparison between pointer and integer
91 | if(a+w<b){
| ^
main.c:92:24: error: invalid operands to binary - (have 'int' and 'int *')
92 | printf("%d\n",b-(a+w));
| ^~~~~~
| |
| int *
main.c:95:11: warning: comparison between pointer and integer
95 | if(b+w<a){
| ^
|
s769776055 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int W,a,b;
cin>>W>>a>>b;
if(a+W<=b&&b+W<=a){
if(a+W<=b){
cout<<abs(b-(a+W))<<endl;
}else{
cout<<abs(a-(b+w))<<endl;
}
}else{
cout<<0<<endl;
}
} | a.cc: In function 'int main()':
a.cc:11:22: error: 'w' was not declared in this scope
11 | cout<<abs(a-(b+w))<<endl;
| ^
|
s978322666 | p03778 | C | #include <stdio.h>
int main() {
int w,a,b;
int table = 0;
int min = 999999, max = 0;
scanf("%d%d%d", &w, &a, &b);
if(a <= b) {
min = a;
max = b;
}
if(a >= b){
min = b;
max = a;
}
table = (min+w);
if(table < max){
printf("%d", max-table);
}
else if(table > max){
printf("0");
}
return 0;
| main.c: In function 'main':
main.c:28:3: error: expected declaration or statement at end of input
28 | return 0;
| ^~~~~~
|
s935803451 | p03778 | C++ | #include <iostream>
using namespace std;
int main() {
int W , a , b , c , x;
cin >> W;
cin >> a;
cin >> b;
if(a > b){
if(a < b + W){
cout <<0<< endl;
return 0;
}
}
if(b > a){
if(b < a + W){
cout <<0<< endl;
return 0;}
if (a < b){
x = b - ( a + W );
cout << x << endl;
return 0;}
else{
x = a - ( b + W );
cout << x << endl;
return 0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:29:2: error: expected '}' at end of input
29 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s005995809 | p03778 | C++ | // G++ MACRO.CPP -STD=C++17
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
#define dump(x) cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE" ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible" ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible" ) << endl
#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j])
#define SCOUT(x) cout<<(x)<<" "
#define ENDL cout<<endl
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i]
#define VECCOUT(x) if(1){for(auto tt=x.begin();tt!=x.end();tt++){if(tt!=x.begin())cout<<" ";cout<<(*tt);}cout<<endl;}
#define ALL(obj) (obj).begin(),(obj).end()
#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())
#define EN(x) if(1){cout<<#x<<endl;return 0;}
#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
cin>>head;
CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
template <class T = ll>
T IN(){T x;cin>>x;return (x);}
template <class Head>
void VT(Head head){}
template <class Head,class Seco,class... Tail>
void VT(Head&& head,Seco&& seco,Tail&&... tail){
seco.resize(head);
VT(head,move(tail)...);
}
void VT2(){}
template <class Head,class... Tail>
void VT2(Head&& head,Tail&&... tail){
VECCIN(head);
VT2(move(tail)...);
}
template <class Head>
void VT3(Head&& head){}
template <class Head,class Seco,class... Tail>
void VT3(Head&& head,Seco&& seco,Tail&&... tail){
seco[head]=IN();
VT3(head,move(tail)...);
}
#define VC1(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);VT2(__VA_ARGS__); //aaabbbccc
#define VC2(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);REP(i,n)VT3(i,__VA_ARGS__); //abcabcabc
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision; // cpp_int
#define P pair<ll,ll>
#define V vector<ll>
#define M map<ll,ll>
#define S set<ll>
#define pb(a) push_back(a)
#define mp make_pair
int main(){
CIN(n,a,b);
if(a>b)swap(a,b);
COUT(max(0,a+y-b));
return 0;
} | a.cc: In function 'int main()':
a.cc:91:16: error: 'y' was not declared in this scope
91 | COUT(max(0,a+y-b));
| ^
a.cc:38:24: note: in definition of macro 'COUT'
38 | #define COUT(x) cout<<(x)<<endl
| ^
|
s401633743 | p03778 | C++ | #include <iostream>
using namespace std;
int main() {
int W , a , b , c , x;
cin >> W;
cin >> a;
cin >> b;
if(a > b){
if(a < b + W){
cout <<0<< endl;
return 0;
}
}
if(b > a){
if(b < a + W}(
cout <<0<< endl;
return 0;
if (a < b){
x = b - ( a + W );
cout << x << endl;
return 0;
else{
x = a - ( b + W );
cout << x << endl;
return 0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:16:19: error: expected ')' before '}' token
16 | if(b < a + W}(
| ~ ^
| )
a.cc:16:19: error: expected primary-expression before '}' token
a.cc:17:24: error: expected ')' before ';' token
17 | cout <<0<< endl;
| ^
| )
a.cc:16:20: note: to match this '('
16 | if(b < a + W}(
| ^
a.cc:23:5: error: expected '}' before 'else'
23 | else{
| ^~~~
a.cc:19:15: note: to match this '{'
19 | if (a < b){
| ^
|
s610671595 | p03778 | C++ | #include <iostream>
using namespace std;
int main() {
int W , a , b , c , x;
cin >> W;
cin >> a;
cin >> b;
if(a < b){
if(b < a + W){
cout <<0<< endl;}}
else{
if(a==b){cout <<0<< endl;}
else{x = b - a + W;
cout << x << endl;}
else{
x = a - b + W;
cout << x << endl;}
return 0;
} | a.cc: In function 'int main()':
a.cc:16:5: error: 'else' without a previous 'if'
16 | else{
| ^~~~
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s817810283 | p03778 | C++ | #include <iostream>
using namespace std;
int main() {
int W , a , b , c , x;
cin >> W;
cin >> a;
cin >> b;
if(a < b){
if(b < a + W){
cout <<0<< endl;}}
else{
if(a==b){cout <<0<< endl;}
else{
x = a - b + W;
cout << x << endl;}
return 0;
} | a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s330582425 | p03778 | C++ | #include <iostream>
using namespace std;
int main() {
int W , a , b , c , x;
cin >> W;
cin >> a;
cin >> b;
if(a < b){
if(b < a + W){
cout <<0<< endl;}}
else{
if(a==b){cout <<0<< ensl;}
else{
x = a - b + W;
cout << x << endl;}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:25: error: 'ensl' was not declared in this scope
13 | if(a==b){cout <<0<< ensl;}
| ^~~~
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s922685209 | p03778 | C++ | #include <iostream>
using namespace std;
int main() {
int W , a , b , c , x;
cin >> W;
cin >> a;
cin >> b;
if(a < b){
if(b < a + W){
cout <<0<< endl;}}
else{
a - b + W = x;
cout << x << endl;}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:11: error: lvalue required as left operand of assignment
13 | a - b + W = x;
| ~~~~~~^~~
|
s526568290 | p03778 | C++ | #include <iostream>
using namespace std;
int main() {
int W , a , b , c , x;
cin >> W;
cin >> a;
cin >> b;
if(a < b){
if(b < a + W){
cout <<0<< endl;}}
else{
a - b + W = x;
cout << x << endl;}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:11: error: lvalue required as left operand of assignment
13 | a - b + W = x;
| ~~~~~~^~~
|
s458070109 | p03778 | C++ | #include <iostream>
using namespace std;
int main() {
int W , a , b , c;
int z = 0;
cin >> W;
cin >> a;
cin >> b;
if(a - b < 0){
c = a;
a = b;
b = c;
}
if(b - W <= a + W){
cout <<0<< endl;
else{
int test;
test = b - a + W;
cout <<test<< endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:17:5: error: expected '}' before 'else'
17 | else{
| ^~~~
a.cc:15:23: note: to match this '{'
15 | if(b - W <= a + W){
| ^
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s699871638 | p03778 | C++ | #include <iostream>
using namespace std;
int main() {
int X , a , b;
cin >> X;
cin >> a;
cin >> b;
int test;
test = b - a;
if(test < 0){
test = test * -1;
}
int awnser;
awnser = test + X;
cout << awncer << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:16:13: error: 'awncer' was not declared in this scope; did you mean 'awnser'?
16 | cout << awncer << endl;
| ^~~~~~
| awnser
|
s619339354 | p03778 | C++ | #include <iostream>
using namespace std;
int main(void) {
// your code goes here
int a,b;
cin >> w >> a >> b;
if(a+w<=b) {
cout << 0 << endl;
}
else {
cout << ( a+w)-b << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:16: error: 'w' was not declared in this scope
9 | cin >> w >> a >> b;
| ^
|
s940322125 | p03778 | Java | import java.util.Scanner;
public class B {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int W =sc.nextInt(),a = sc.nextInt(),b = sc.nextInt(),result=0;
if(a<b) {
result = b-(a+W);
}
else if(b<a) {
result= a-(b+W);
}
if(result <=0) result=0;
System.out.print(result);
}
}
| Main.java:2: error: class B is public, should be declared in a file named B.java
public class B {
^
1 error
|
s662535527 | p03778 | C++ | #include <iostream>
using namespace std;
int main(){
int W, a, b;
cin >> W >> a >> b;
if(abs(a-b)<=W) cout << 0 << endl;
else cout << abs(a-b)-w << endl;
}
| a.cc: In function 'int main()':
a.cc:8:31: error: 'w' was not declared in this scope
8 | else cout << abs(a-b)-w << endl;
| ^
|
s648153121 | p03778 | C | #include <stdio.h>
#include <math.h>
a;b;c;d;e;
main(){
scanf("%d%d%d",&a,&b,&c);
if((a+c>=b&&a<b)||(b+c>=a&&b<a))printf("0\n")
else{d=abs(a+c-b);
e=abs(b+c-a);
printf("%d\n",d>e?d:e);
}} | main.c:4:1: warning: data definition has no type or storage class
4 | a;b;c;d;e;
| ^
main.c:4:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:4:3: warning: data definition has no type or storage class
4 | a;b;c;d;e;
| ^
main.c:4:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
main.c:4:5: warning: data definition has no type or storage class
4 | a;b;c;d;e;
| ^
main.c:4:5: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:4:7: warning: data definition has no type or storage class
4 | a;b;c;d;e;
| ^
main.c:4:7: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
main.c:4:9: warning: data definition has no type or storage class
4 | a;b;c;d;e;
| ^
main.c:4:9: error: type defaults to 'int' in declaration of 'e' [-Wimplicit-int]
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
5 | main(){
| ^~~~
main.c: In function 'main':
main.c:7:48: error: expected ';' before 'else'
7 | if((a+c>=b&&a<b)||(b+c>=a&&b<a))printf("0\n")
| ^
| ;
8 | else{d=abs(a+c-b);
| ~~~~
|
s453184008 | p03778 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <set>
#include <numeric>
#include <map>
#include <math.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <bitset>
#include <math.h>
#define INF 100100100
typedef long long int llint;
using namespace std;
typedef pair<int, int>Pii;
#define pi 3.141592653589793
#define mod 1000000007
int main() {
int w, a, b;
cin >> w >> a >> b;
if ((a <= b && a+w => b) || (b <= a && b+w => a))cout << 0 << endl;
else if(a+w <= b) cout << abs(b-a-w) << endl;
else if (b + w <= a) cout << abs(a - b - w) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:31:29: error: expected primary-expression before '>' token
31 | if ((a <= b && a+w => b) || (b <= a && b+w => a))cout << 0 << endl;
| ^
a.cc:31:53: error: expected primary-expression before '>' token
31 | if ((a <= b && a+w => b) || (b <= a && b+w => a))cout << 0 << endl;
| ^
|
s768207668 | p03778 | C++ | #include <iostream>
int main(){
int w,a,b;
std::cin >> w >> a >> b;
std::cout << (a <= b ? min(0, b - (a + w)) : min(0, a - (b + w))) << std::endl;
} | a.cc: In function 'int main()':
a.cc:5:24: error: 'min' was not declared in this scope; did you mean 'std::min'?
5 | std::cout << (a <= b ? min(0, b - (a + w)) : min(0, a - (b + w))) << std::endl;
| ^~~
| std::min
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
|
s431920042 | p03778 | C++ | #include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
using namespace std;
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return
#define C(i) cin>>i
#define C2(i,j) cin>>i>>j
#define C3(i,j,k) cin>>i>>j>>k
#define C4(i,j,k,m) cin>>i>>j>>k>>m
////////////////////////////////////////////////////////////
int main(){
long w,a,b;
C3(w,a,b);
if( b > w + a)
P(b-w-a);
else if( b > a && b < a+w )
P(0);
else
P(a-b-w);
ret 0;
| a.cc: In function 'int main()':
a.cc:43:9: error: expected '}' at end of input
43 | ret 0;
| ^
a.cc:32:11: note: to match this '{'
32 | int main(){
| ^
|
s546537370 | p03778 | C++ | inp = input().split()
w = int(inp[0])
a = int(inp[1])
b = int(inp[2])
print(max(max(a-b-w,b-a-w),0)) | a.cc:1:1: error: 'inp' does not name a type; did you mean 'int'?
1 | inp = input().split()
| ^~~
| int
|
s459847117 | p03778 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <sstream>
#include <algorithm>
#include <bitset>
#include <limits>
#include <map>
#include <set>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long int ll;
typedef std::numeric_limits<double> dbl;
const long long int LL_INF=1LL<<60;
vector<string> split(const string& input, char delimiter)
{
stringstream stream(input);
string field;
vector<string> result;
while (getline(stream, field, delimiter)) {
result.push_back(field);
}
return result;
}
//#define DEBUG
ll A, B, M, N, D, K, Q, W, H, T, X, Y;
int main()
{
cin >> W >> A >> B;
cout << min(abs(W - b), abs((W+a) - b)) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:38:25: error: 'b' was not declared in this scope
38 | cout << min(abs(W - b), abs((W+a) - b)) << endl;
| ^
a.cc:38:36: error: 'a' was not declared in this scope
38 | cout << min(abs(W - b), abs((W+a) - b)) << endl;
| ^
|
s891697384 | p03778 | C++ | #include <bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<map>
#include<cstring>
#include<string>
#include <math.h>
#include<algorithm>
// #include <boost/multiprecision/cpp_int.hpp>
#include<functional>
// #define int long long
#define inf 1000000007
#define pa pair<int,int>
#define ll long long
#define pal pair<double,pa>
#define ppa pair<pa,int>
#define ppap pair<int,pa>
#define ssa pair<string,int>
#define mp make_pair
#define pb push_back
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b))<EPS)
using namespace std;
//priority_queue<int, vector<int>, greater<int> > que;
class Point{
public:
double x,y;
Point(double x=0,double y=0):x(x),y(y) {}
Point operator + (Point p) {return Point(x+p.x,y+p.y);}
Point operator - (Point p) {return Point(x-p.x,y-p.y);}
Point operator * (double a) {return Point(x*a,y*a);}
Point operator / (double a) {return Point(x/a,y/a);}
double absv() {return sqrt(norm());}
double norm() {return x*x+y*y;}
bool operator < (const Point &p) const{
return x != p.x ? x<p.x: y<p.y;
}
bool operator == (const Point &p) const{
return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
}
};
typedef Point Vector;
struct Segment{
Point p1,p2;
};
double hen(Vector a){
if(fabs(a.x)<EPS && a.y>0) return acos(0);
else if(fabs(a.x)<EPS && a.y<0) return 3*acos(0);
else if(fabs(a.y)<EPS && a.x<0) return 2*acos(0);
else if(fabs(a.y)<EPS && a.x>0) return 0.0;
else if(a.y>0) return acos(a.x/a.absv());
else return 2*acos(0)+acos(-a.x/a.absv());
}
string itos( int i ) {
ostringstream s ;
s << i ;
return s.str() ;
}
int gcd(int v,int b){
if(v>b) return gcd(b,v);
if(v==b) return b;
if(b%v==0) return v;
return gcd(v,b%v);
}
double dot(Vector a,Vector b){
return a.x*b.x+a.y*b.y;
}
double cross(Vector a,Vector b){
return a.x*b.y-a.y*b.x;
}
double distans(double x1,double y1,double x2,double y2){
double rr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
return sqrt(rr);
}
/*}
int pr[100010];
//int inv[100010];
int beki(int wa,int rr){
if(rr==0) return 1ll;
if(rr==1) return wa;
if(rr%2==1) return (beki(wa,rr-1)*wa)%inf;
int zx=beki(wa,rr/2);
return (zx*zx)%inf;
}
void gya(){
pr[0]=1;
for(int i=1;i<100010;i++){
pr[i]=(pr[i-1]*i)%inf;
}
for(int i=0;i<100010;i++) inv[i]=beki(pr[i],inf-2);
}
*/
//----------------kokomade tenpure------------
int a[100];
string s,t;
signed main(){
int n,m,r,w,h,x,y,wa;
cin>>w>>x>>y;
if(a+w<=b) cout<<b-a-w<<endl;
else if(b+w<=a) cout<<a-b-w<<endl;
else cout<<0<<endl;
/*
while(1){
// string s;
// int na,nb;
cin>>s;
if(s==".") return 0;
}
*/
return 0;
}
| a.cc: In function 'int main()':
a.cc:116:17: error: 'b' was not declared in this scope
116 | if(a+w<=b) cout<<b-a-w<<endl;
| ^
|
s530437549 | p03778 | C++ | #include "iostream"
using namespace std;
int main(){
int W,a,b;
cin>>W>>a>>b;
if(abs(a-b)<=W){
cout<<0<<endl;
}
else{
if(a==b){
cout<<0<<endl;
}
else if(a<b){
cout<<b-a-W<<endl;
}
else{
cout<<a-b-W<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s057565643 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int w, a, b;
int main() {
cin >> w >> a >> b;
if(a > b) swap(a, b);
cout << max(b - a - W, 0) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:29: error: 'W' was not declared in this scope
7 | cout << max(b - a - W, 0) << endl;
| ^
|
s276272239 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
long long W,a,b;
int main() {
cin>>W>>a>>b;
cout<<max(0,abs(a-b)-W)<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:18: error: no matching function for call to 'max(int, long long int)'
6 | cout<<max(0,abs(a-b)-W)<<endl;
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:6:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
6 | cout<<max(0,abs(a-b)-W)<<endl;
| ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:6:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
6 | cout<<max(0,abs(a-b)-W)<<endl;
| ~~~^~~~~~~~~~~~~~
|
s745146850 | p03778 | C++ | #include<cstdio>
#include<vector>
#include<iostream>
using namespace std;
int gcd(int a,int b){if(a<b){swap(a,b);}if(b==0){return a;}return gcd(a%b,b);}
int main(void){
int w,a,b;
cin>>w>>a>>b;
if(a>b){swap(a,b);}
if(a+w>b){cout<<0<<endl;}
else{cout<<(b-a-w)<<end;}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:35: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
11 | else{cout<<(b-a-w)<<end;}
| ~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/iostream:41,
from a.cc:3:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::nullptr_t'
306 | |
s557381247 | p03778 | C++ | #include<iostream>
int main() {
int W, a, b;
std::cin >> W >> a >> b;
int bigger = a => b ? a : b;
int smaller = a > b ? b : a;
if(bigger - (smaller + W) =< 0){
std::cout << 0;
}else{
std::cout << bigger - (smaller + W);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:19: error: expected primary-expression before '>' token
6 | int bigger = a => b ? a : b;
| ^
a.cc:9:30: error: expected primary-expression before '<' token
9 | if(bigger - (smaller + W) =< 0){
| ^
|
s378376256 | p03778 | C++ | int main() {
int W, a, b;
std::cin >> W >> a >> b;
int bigger = a => b ?? a : b;
int smaller = a > b ?? b : a;
if(bigger - (smaller + W) =< 0){
std::cout << 0;
}else{
std::cout << bigger - (smaller + W);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:3:8: error: 'cin' is not a member of 'std'
3 | std::cin >> W >> a >> b;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | int main() {
a.cc:5:19: error: expected primary-expression before '>' token
5 | int bigger = a => b ?? a : b;
| ^
a.cc:5:24: error: expected primary-expression before '?' token
5 | int bigger = a => b ?? a : b;
| ^
a.cc:5:31: error: expected ':' before ';' token
5 | int bigger = a => b ?? a : b;
| ^
| :
a.cc:5:31: error: expected primary-expression before ';' token
a.cc:6:24: error: expected primary-expression before '?' token
6 | int smaller = a > b ?? b : a;
| ^
a.cc:6:31: error: expected ':' before ';' token
6 | int smaller = a > b ?? b : a;
| ^
| :
a.cc:6:31: error: expected primary-expression before ';' token
a.cc:8:30: error: expected primary-expression before '<' token
8 | if(bigger - (smaller + W) =< 0){
| ^
a.cc:9:10: error: 'cout' is not a member of 'std'
9 | std::cout << 0;
| ^~~~
a.cc:9:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:10: error: 'cout' is not a member of 'std'
11 | std::cout << bigger - (smaller + W);
| ^~~~
a.cc:11:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s157799829 | p03778 | Java | import java.util.Scanner;
public class Sample {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scan = new Scanner(System.in);
int W = scan.nextInt();
int a =scan.nextInt();
int b = scan.nextInt();
if(a+W<b){
System.out.println((b-a-W));
}else if (b+W<a){
System.out.println((a-b-W));
}else{
System.out.println(0);
}
}
} | Main.java:2: error: class Sample is public, should be declared in a file named Sample.java
public class Sample {
^
1 error
|
s586279964 | p03778 | Java | import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class Main{
public static void main(String[] args) {
InputReader in = new InputReader(System.in);
PrintWriter w = new PrintWriter(System.out);
int w=in.nextInt(),a=in.nextInt(),b=in.nextInt();
if (Math.abs(b-a)<=w)
w.println(0);
else{
if (b<a)
w.println(a-(b+w));
else
w.println(b-(a+w));
}
w.close();
}
static class InputReader {
private final InputStream stream;
private final byte[] buf = new byte[8192];
private int curChar, snumChars;
private SpaceCharFilter filter;
public InputReader(InputStream stream) {
this.stream = stream;
}
public int snext() {
if (snumChars == -1)
throw new InputMismatchException();
if (curChar >= snumChars) {
curChar = 0;
try {
snumChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (snumChars <= 0)
return -1;
}
return buf[curChar++];
}
public int nextInt() {
int c = snext();
while (isSpaceChar(c)) {
c = snext();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = snext();
}
int res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = snext();
} while (!isSpaceChar(c));
return res * sgn;
}
public long nextLong() {
int c = snext();
while (isSpaceChar(c)) {
c = snext();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = snext();
}
long res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = snext();
} while (!isSpaceChar(c));
return res * sgn;
}
public int[] nextIntArray(int n) {
int a[] = new int[n];
for (int i = 0; i < n; i++) {
a[i] = nextInt();
}
return a;
}
public String readString() {
int c = snext();
while (isSpaceChar(c)) {
c = snext();
}
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = snext();
} while (!isSpaceChar(c));
return res.toString();
}
public String nextLine() {
int c = snext();
while (isSpaceChar(c))
c = snext();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = snext();
} while (!isEndOfLine(c));
return res.toString();
}
public boolean isSpaceChar(int c) {
if (filter != null)
return filter.isSpaceChar(c);
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
private boolean isEndOfLine(int c) {
return c == '\n' || c == '\r' || c == -1;
}
public interface SpaceCharFilter {
public boolean isSpaceChar(int ch);
}
}
}
| Main.java:9: error: variable w is already defined in method main(String[])
int w=in.nextInt(),a=in.nextInt(),b=in.nextInt();
^
Main.java:11: error: int cannot be dereferenced
w.println(0);
^
Main.java:14: error: int cannot be dereferenced
w.println(a-(b+w));
^
Main.java:16: error: int cannot be dereferenced
w.println(b-(a+w));
^
Main.java:18: error: int cannot be dereferenced
w.close();
^
5 errors
|
s554311430 | p03778 | Java | import java.util.Scanner;
public class main{
public static void main(String[] args){
int w,a,b,distance;
Scanner scw = new Scanner(System.in);
Scanner sca = new Scanner(System.in);
Scanner scb = new Scanner(System.in);
w = scw.nextInt();
a = sca.nextInt();
b = scb.nextInt();
distance = b - (a+w);
System.out.println(distance);
}
}
| Main.java:2: error: class main is public, should be declared in a file named main.java
public class main{
^
1 error
|
s463280897 | p03778 | C++ | #include<iostream>
#include<cmath>
#include<algorithm>
using namespace std
int main()
{
int a,b,w;
cin>>w>>a>>b;
cout<<min(fabs(b-a),fabs(b-a-w));
return 0;
} | a.cc:4:20: error: expected ';' before 'int'
4 | using namespace std
| ^
| ;
5 | int main()
| ~~~
|
s480360338 | p03778 | C++ | #include<iostream>
#include<cmath>
#include<algorithm>
using namespace std
int main()
{
int a,b,w;
cin>>w>>a>>b;
cout<<max(fabs(b-a),fabs(b-a-w));
return 0;
} | a.cc:4:20: error: expected ';' before 'int'
4 | using namespace std
| ^
| ;
5 | int main()
| ~~~
|
s048809920 | p03778 | C++ | #include<iostream>
using namespace
int main()
{
int a,b,w;
cin>>w>>a>>b;
cout<<max(fabs(b-a),fabs(b-a-w));
return 0;
} | a.cc:3:1: error: expected identifier before 'int'
3 | int main()
| ^~~
a.cc:2:16: error: expected ';' before 'int'
2 | using namespace
| ^
| ;
3 | int main()
| ~~~
a.cc: In function 'int main()':
a.cc:6:4: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>w>>a>>b;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:7:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | cout<<max(fabs(b-a),fabs(b-a-w));
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:7:14: error: 'fabs' was not declared in this scope; did you mean 'labs'?
7 | cout<<max(fabs(b-a),fabs(b-a-w));
| ^~~~
| labs
a.cc:7:10: error: 'max' was not declared in this scope; did you mean 'std::max'?
7 | cout<<max(fabs(b-a),fabs(b-a-w));
| ^~~
| std::max
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
|
s107012115 | p03778 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int w = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
int ans;
if(Math.abs(a - b) < w){
ans = 0;
}else{
ans= Math.abs(a - b - w);
}
System.out.println(ans);
}
| Main.java:16: error: reached end of file while parsing
}
^
1 error
|
s239984891 | p03778 | C | #include <stdio.h>
int main(void)
{
int w,a,b;
scanf("%d %d %d",&w,&a,&b);
if(b+w<=a){
printf("%d\n",a-(b+w));
} else if(b+w<=a+w || b<=a+w){
printf("0\n");
} else if(b>a+w){
printf("%d\n", b-(a+w));
}
return 0;
| main.c: In function 'main':
main.c:15:9: error: expected declaration or statement at end of input
15 | return 0;
| ^~~~~~
|
s854656810 | p03778 | Java | import java.util.*;
public class ABC056_B {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int W=sc.nextInt(),a=sc.nextInt(),b=sc.nextInt();
if(Math.abs(b-a)<W){
System.out.println("0");
}
else{
System.out.println(b-(a+W));
}
}
} | Main.java:2: error: class ABC056_B is public, should be declared in a file named ABC056_B.java
public class ABC056_B {
^
1 error
|
s291155671 | p03778 | C++ | /*************************************************************************
> File Name: test.cpp
> Author: Akira
> Mail: qaq.febr2.qaq@gmail.com
************************************************************************/
#include<bits/stdc++.h>
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
#define MST(a,b) memset(a,b,sizeof(a))
#define CLR(a) MST(a,0)
#define Sqr(a) ((a)*(a))
using namespace std;
#define MaxN 100001
#define MaxM MaxN*10
#define INF 0x3f3f3f3f
#define PI 3.1415926535897932384626
const int mod = 1E9+7;
const double eps = 1e-6;
#define bug cout<<88888888<<endl;
#define debug(x) cout << #x" = " << x << endl;
int W,a,b;
int main()
{
//std::ios::sync_with_stdio(false);
scanf("%d%d%d", &W, &a, &b);
if( b > a+ W);
{
printf("%d\n", b-a-W);
}
else if( b+W<a)
{
printf("%d\n", a-b-W);
}
else puts("0");
//system("pause");
}
| a.cc: In function 'int main()':
a.cc:34:5: error: 'else' without a previous 'if'
34 | else if( b+W<a)
| ^~~~
|
s873775568 | p03778 | Java | package spring21;
public class ABC056_B {
public static void main(String[] args){
int W=3,a=2,b=6;
if(Math.abs(b-a)<W){
System.out.println("0");
}
else{
System.out.println(b-(a+W));
}
}
} | Main.java:3: error: class ABC056_B is public, should be declared in a file named ABC056_B.java
public class ABC056_B {
^
1 error
|
s277076257 | p03778 | Java | package spring21;
public class ABC056_B {
public static void main(String[] args){
int W=3,a=2,b=6;
if(Math.abs(b-a)<W){
System.out.println("0");
}
else{
System.out.println(b-(a+W));
}
}
} | Main.java:3: error: class ABC056_B is public, should be declared in a file named ABC056_B.java
public class ABC056_B {
^
1 error
|
s029950815 | p03778 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-7;
const ll inf=1ll<<60;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<max(max(0,b-a-W),max(0,a-b-W))<<endl;
}
| a.cc: In function 'int main()':
a.cc:41:29: error: 'W' was not declared in this scope
41 | cout<<max(max(0,b-a-W),max(0,a-b-W))<<endl;
| ^
|
s207491092 | p03778 | Java | package spring;
public class NarrowRectanglesEasy {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
int W = Integer.parseInt(args[0]);
int a = Integer.parseInt(args[1]);
int b = Integer.parseInt(args[2]);
if(W == a || W == b || a == b) {
System.out.print(0);
}
else if(a > b) {
System.out.print(a - (W + b));
}
else if(b > a) {
System.out.print(b - (W + a));
}
}
}
| Main.java:3: error: class NarrowRectanglesEasy is public, should be declared in a file named NarrowRectanglesEasy.java
public class NarrowRectanglesEasy {
^
1 error
|
s735530042 | p03778 | Java | public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
int W = Integer.parseInt(args[0]);
int a = Integer.parseInt(args[1]);
int b = Integer.parseInt(args[2]);
if(W == a || W == b || a == b) {
System.out.print(0);
}
else if(a > b) {
System.out.print(a - (W + b));
}
else if(b > a) {
System.out.print(b - (W + a));
}
}
| Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s166775167 | p03778 | Java | public class NarrowRectanglesEasy {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
int W = Integer.parseInt(args[0]);
int a = Integer.parseInt(args[1]);
int b = Integer.parseInt(args[2]);
if(W == a || W == b || a == b) {
System.out.print(0);
}
else if(a > b) {
System.out.print(a - (W + b));
}
else if(b > a) {
System.out.print(b - (W + a));
}
}
}
| Main.java:1: error: class NarrowRectanglesEasy is public, should be declared in a file named NarrowRectanglesEasy.java
public class NarrowRectanglesEasy {
^
1 error
|
s456584069 | p03778 | C++ | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#include <random>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep2(i,a,b) for(int i=(a);i<(b);++i)
#define rrep(i,n) for(int i=(n)-1;i>=0;--i)
#define rrep2(i,a,b) for(int i=(a)-1;i>=b;--i)
#define range(i,a,b,c) for(int i=a;\
c>0?i<b:\
i>b;\
i+=c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x) cerr << #x << " = " << (x) << endl
#define int long long
#ifdef _MSC_VER
const bool test = true;
#else
const bool test = false;
#endif
int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
const int INF = 1 << 28;
const ll INFL = (ll)1 << 58;
ll mod = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real& r) { return (r > eps) - (r < -eps); }
int sgn(const Real& a, const Real &b) { return sgn(a - b); }
//.....................
const int MAX = (int)2e5 + 5;
vector<string> split(const string &str, char sep) {
vector<string> v;
stringstream ss(str);
string buffer;
while (getline(ss, buffer, sep)) {
v.push_back(buffer);
}
return v;
}
template<class InputIterator>
int sum(InputIterator begin, InputIterator end) {
return accumulate(begin, end, 0ll);
}
string reverse_str(string s) {
reverse(all(s));
return s;
}
int W, a, b;
void solve() {
cin >> W >> a >> b;
cout << max(0, abs(a - b) - W) << endl;
}
signed main() {
srand(time(NULL));
int T = (int)1e15;
solve();
cout << fixed << setprecision(15);
rep(i, T) {
char s[MAX];
if (scanf("%s", s) == EOF) break;
int n = strlen(s);
for (int i = n - 1; i > -1; i--) {
ungetc(s[i], stdin);
}
solve();
}
return 0;
} | a.cc: In function 'void solve()':
a.cc:68:20: error: no matching function for call to 'max(int, long long int)'
68 | cout << max(0, abs(a - b) - W) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:4:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:68:20: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
68 | cout << max(0, abs(a - b) - W) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:68:20: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
68 | cout << max(0, abs(a - b) - W) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~
|
s679550651 | p03778 | Java | package Main;
import java.util.*;;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int W=sc.nextInt();
int a=sc.nextInt();
int b=sc.nextInt();
int W=3;
int a=2;
int b=6;
int z=Math.abs(a-b);
if(z<=W) {
z=0;
}else{
z=z-W;
}
System.out.println(z);
}
}
| Main.java:13: error: variable W is already defined in method main(String[])
int W=3;
^
Main.java:14: error: variable a is already defined in method main(String[])
int a=2;
^
Main.java:15: error: variable b is already defined in method main(String[])
int b=6;
^
3 errors
|
s098289017 | p03778 | Java | package AtCoder;
import java.util.*;
public class NarrowRectanglesEasy {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int W=sc.nextInt();
int a=sc.nextInt();
int b=sc.nextInt();
int z=Math.abs(a-b);
if(z<=W) {
z=0;
}else{
z=z-W;
}
System.out.println(z);
}
}
| Main.java:3: error: class NarrowRectanglesEasy is public, should be declared in a file named NarrowRectanglesEasy.java
public class NarrowRectanglesEasy {
^
1 error
|
s469803181 | p03778 | Java | package AtCoder;
public class NarrowRectanglesEasy {
public static void main(String[] args) {
// TODO Auto-generated method stub
int W=3;
int a=2;
int b=6;
int z=Math.abs(a-b);
if(z<=W) {
z=0;
}else{
z=z-W;
}
System.out.println(z);
}
}
| Main.java:3: error: class NarrowRectanglesEasy is public, should be declared in a file named NarrowRectanglesEasy.java
public class NarrowRectanglesEasy {
^
1 error
|
s422119505 | p03778 | Java | package AtCoder;
public class NarrowRectanglesEasy {
public static void main(String[] args) {
// TODO Auto-generated method stub
int W=Integer.parseInt(args[0]);
int a=Integer.parseInt(args[1]);
int b=Integer.parseInt(args[2]);
int z=Math.abs(a-b);
if(z<=W) {
z=0;
}else{
z=z-W;
}
System.out.println(z);
}
}
| Main.java:3: error: class NarrowRectanglesEasy is public, should be declared in a file named NarrowRectanglesEasy.java
public class NarrowRectanglesEasy {
^
1 error
|
s611812581 | p03778 | Java | package AtCoder;
public class NarrowRectanglesEasy {
public static void main(String[] args) {
// TODO Auto-generated method stub
int W=Integer.parseInt(args[0]);
int a=Integer.parseInt(args[1]);
int b=Integer.parseInt(args[2]);
int z=Math.abs(a-b);
if(z<=W) {
z=0;
}else{
z=z-W;
}
System.out.println(z);
}
}
| Main.java:3: error: class NarrowRectanglesEasy is public, should be declared in a file named NarrowRectanglesEasy.java
public class NarrowRectanglesEasy {
^
1 error
|
s211072749 | p03778 | C++ | #include <iostream>
using namespace std;
int main(){
int W , a ,b;
cin >> W >> a >> b;
if (b + W =< a) {
cout << a - (b + W) << endl;
}
else if (b - (a + W) > 0) {
cout << b - (a + W) <<endl;
}
else cout << 0 << endl;
}
| a.cc: In function 'int main()':
a.cc:7:12: error: expected primary-expression before '<' token
7 | if (b + W =< a) {
| ^
|
s962015630 | p03778 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
int w, a, b;
cin >> w >> a >> b;
cout << abs(a - b) - w << endl;
return 0;
}
| a.cc:12:30: error: extended character is not valid in an identifier
12 | cout << abs(a - b) - w << endl;
| ^
a.cc: In function 'int main()':
a.cc:12:30: error: 'w\U00003000' was not declared in this scope
12 | cout << abs(a - b) - w << endl;
| ^~~
|
s066660356 | p03778 | C++ | #include <string.h>
int W, a, b;
void solve() {
int ans;
if (a < b) {
if ((b - (a + W)) < 0) {
ans = 0;
}
else {
ans = b - (a + W);
}
}
else {
if ((a - (b + W)) < 0) {
ans = 0;
}
else {
ans = a - (b + W);
}
}
printf("%d\n", ans);
}
int main()
{
// 標準入力から入力
scanf("%d %d %d", &W, &a, &b);
solve();
return 0;
} | a.cc: In function 'void solve()':
a.cc:21:9: error: 'printf' was not declared in this scope
21 | printf("%d\n", ans);
| ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
1 | #include <string.h>
+++ |+#include <cstdio>
2 | int W, a, b;
a.cc: In function 'int main()':
a.cc:27:9: error: 'scanf' was not declared in this scope
27 | scanf("%d %d %d", &W, &a, &b);
| ^~~~~
|
s589183786 | p03778 | C++ | #include <string.h>
int W, a, b;
void solve() {
int ans;
if (a < b) {
if ((b - (a + W)) < 0) {
ans = 0;
}
else {
ans = b - (a + W);
}
}
else {
if ((a - (b + W)) < 0) {
ans = 0;
}
else {
ans = a - (b + W);
}
}
printf("%d\n", ans);
}
int main()
{
// 標準入力から入力
scanf("%d %d %d", &W, &a, &b);
solve();
return 0;
} | a.cc: In function 'void solve()':
a.cc:21:9: error: 'printf' was not declared in this scope
21 | printf("%d\n", ans);
| ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
1 | #include <string.h>
+++ |+#include <cstdio>
2 | int W, a, b;
a.cc: In function 'int main()':
a.cc:27:9: error: 'scanf' was not declared in this scope
27 | scanf("%d %d %d", &W, &a, &b);
| ^~~~~
|
s113146519 | p03778 | C++ | #include <bits/stdc++.h>
int main ()
{
int w,a,b;
cin>>w>>a>>b;
cout <<b-a-w;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>w>>a>>b;
| ^~~
| 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/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:7:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | cout <<b-a-w;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s360922999 | p03778 | C | #include <stdio.h>
int main(){
int a, b, w, answer;
scanf("%d %d %d", &w, &a, &b);
if((a < b && b < a + w) || (a < b + w && b < a) || (a == b)){
printf("0"\n);
}else if(a < b){
answer = b - a - w;
printf("%d\n", answer);
}else{
answer = a - b - w;
printf("%d\n", answer);
}
return 0;
} | main.c: In function 'main':
main.c:7:19: error: stray '\' in program
7 | printf("0"\n);
| ^
main.c:7:19: error: expected ')' before 'n'
7 | printf("0"\n);
| ~ ^~
| )
|
s800212771 | p03778 | C | #include <stdio.h>
int main(){
int a, b, w, answer;
scanf("%d %d %d", &w, &a, &b);
if((a < b && b < a + w) || (a < b + w && b < a) || (a == b)){
prinf("0"\n);
}else if(a < b){
answer = b - a - w;
printf("%d\n", answer);
}else{
answer = a - b - w;
printf("%d\n", answer);
}
return 0;
} | main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
7 | prinf("0"\n);
| ^~~~~
| printf
main.c:7:18: error: stray '\' in program
7 | prinf("0"\n);
| ^
main.c:7:18: error: expected ')' before 'n'
7 | prinf("0"\n);
| ~ ^~
| )
|
s544622568 | p03778 | Java | import java.util.Scanner;
public class Main2 {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int w = s.nextInt();
int a = s.nextInt();
int b = s.nextInt();
if (a < b) {
if ((b <= a + w) && (a <= b + w)) {
System.out.println(0);
} else {
System.out.println(b - (a + w));
}
} else {
if ((a <= b + w) && (b <= a + w)) {
System.out.println(0);
} else {
System.out.println(a - (b + w));
}
}
}
}
| Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
1 error
|
s223912555 | p03778 | C++ | #include <stdio.h>
using namespace std;
int main()
{
int W,a,b;
scanf("%d %d %d",&W,&a,&b);
if(a>b) swap(a,b);
int foo=a+W;
if(b-foo<=0) puts("0");
else
{
printf("%d\n",b-foo);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:13: error: 'swap' was not declared in this scope
7 | if(a>b) swap(a,b);
| ^~~~
|
s423900743 | p03778 | C++ | #include <iostream>
#include <cstdlib>
int main()
{
int w, a, b;
std::cin >> w;
std::cin >> a;
std::cin >> b;
if(w > abs(a - b){
std::cout << abs(b - a - w) << std::endl;
}
else{
std::cout << 0 << std::endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:23: error: expected ';' before '{' token
11 | if(w > abs(a - b){
| ^
| ;
a.cc:14:6: error: expected primary-expression before 'else'
14 | else{
| ^~~~
a.cc:13:7: error: expected ')' before 'else'
13 | }
| ^
| )
14 | else{
| ~~~~
a.cc:11:8: note: to match this '('
11 | if(w > abs(a - b){
| ^
|
s152796899 | p03778 | C++ | #include <iostream>
#include <algorithm>
#include <cstdint>
using namespace std;
int main()
{
int_least_t w, a, b;
cin >> w >> a >> b;
if(a - b < w || b - a < w) {
cout << 0 << endl;
return 0;
}
int_least_t left{ b - a - w }, right{ a - b - w };
if(left > 0) {
cout << left << endl;
}
else {
cout << right << endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:5: error: 'int_least_t' was not declared in this scope; did you mean 'int_least8_t'?
9 | int_least_t w, a, b;
| ^~~~~~~~~~~
| int_least8_t
a.cc:10:12: error: 'w' was not declared in this scope
10 | cin >> w >> a >> b;
| ^
a.cc:10:17: error: 'a' was not declared in this scope
10 | cin >> w >> a >> b;
| ^
a.cc:10:22: error: 'b' was not declared in this scope
10 | cin >> w >> a >> b;
| ^
a.cc:17:16: error: expected ';' before 'left'
17 | int_least_t left{ b - a - w }, right{ a - b - w };
| ^~~~~
| ;
a.cc:17:34: error: expected primary-expression before ',' token
17 | int_least_t left{ b - a - w }, right{ a - b - w };
| ^
a.cc:18:13: error: ordered comparison of pointer with integer zero ('std::ios_base& (*)(std::ios_base&)' and 'int')
18 | if(left > 0) {
| ~~~~~^~~
|
s161146728 | p03778 | C++ | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int w,a,b;
cin>>w>>a>>b;
int result = abs(b-a)-w;
cout<<(result < 0)?0:result<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:28: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
8 | cout<<(result < 0)?0:result<<endl;
| ~~~~~~^~~~~~
|
s936636704 | p03778 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int W = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
int ans = b - a - w;
if (b > a + w) {
System.out.printf("%d\n", b - a - w);
} else if (b + w < a) {
System.out.printf("%d\n", a - b - w);
} else {
System.out.println("0");
}
}
}
| Main.java:9: error: cannot find symbol
int ans = b - a - w;
^
symbol: variable w
location: class Main
Main.java:10: error: cannot find symbol
if (b > a + w) {
^
symbol: variable w
location: class Main
Main.java:11: error: cannot find symbol
System.out.printf("%d\n", b - a - w);
^
symbol: variable w
location: class Main
Main.java:12: error: cannot find symbol
} else if (b + w < a) {
^
symbol: variable w
location: class Main
Main.java:13: error: cannot find symbol
System.out.printf("%d\n", a - b - w);
^
symbol: variable w
location: class Main
5 errors
|
s348124587 | p03779 | C++ | #include<iostream>
using namespace std;
int main()
{ int x;
cin>>x;
int l=100001;
for(int i=1;i<n;i++)
{ int t=(i*(i+1))/2
if(t<x)
coninue;
else
{ int r=t-x;
if(r<=i)
{ cout<<i;
return 0;
}
}
}
} | a.cc: In function 'int main()':
a.cc:7:16: error: 'n' was not declared in this scope
7 | for(int i=1;i<n;i++)
| ^
a.cc:9:6: error: expected ',' or ';' before 'if'
9 | if(t<x)
| ^~
a.cc:11:5: error: 'else' without a previous 'if'
11 | else
| ^~~~
|
s065424907 | p03779 | C++ | #include <bits/stdc++.h>
#define pi 3.14159
using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;
const int N = 1e5 + 7, M = 1e7, OO = 0x3f3f3f3f;
#define AC ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin.sync_with_stdio(0);
int main()
{
LL n,i=1,maxi=OO;
scanf("%lld",&n);
while(1){
int sum=i*(i+1)/2;
int rem=n-sum;
if(sum==n){
maxi=i;
break;
}
if(rem>i){
maxi=min(maxi,rem);
}
else{
break;
}
i++;
}
maxi=min(maxi,n);
printf("%lld",maxi);
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:17: error: no matching function for call to 'min(LL&, int&)'
20 | maxi=min(maxi,rem);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:20:17: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
20 | maxi=min(maxi,rem);
| ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:20:17: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
20 | maxi=min(maxi,rem);
| ~~~^~~~~~~~~~
|
s849764054 | p03779 | C++ | #include <bits/stdc++.h>
#define pi 3.14159
using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;
const int N = 1e5 + 7, M = 1e7, OO = 0x3f3f3f3f;
#define AC ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin.sync_with_stdio(0);
int main()
{
int n,i=1,maxi=OO,choice=OO;
scanf("%d",&n);
while(1){
int sum=i*(i+1)/2;
int rem=n-sum;
if(sum==n){
choice=i;1
}
if(rem>i){
maxi=min(maxi,rem);
}
else{
break;
}
i++;
}
maxi=min({maxi,n,choice});
printf("%d",maxi);
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:19: error: expected ';' before '}' token
16 | choice=i;1
| ^
| ;
17 | }
| ~
|
s909203915 | p03779 | C++ | #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;
int main(){
ll X;
scanf("%lld",&X);
ll left = 0,rigth = 1000000,mid = (left+right)/2;
ll ans = 1000000;
while(left <= right){
if((mid*(mid+1)/2) >= X){
ans = mid;
right = mid-1;
}else{
left = mid+1;
}
mid = (left+rigth)/2;
}
printf("%lld\n",ans);
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:48: warning: pointer to a function used in arithmetic [-Wpointer-arith]
19 | ll left = 0,rigth = 1000000,mid = (left+right)/2;
| ~~~~^~~~~~
a.cc:19:55: error: invalid operands of types 'std::ios_base& (*)(std::ios_base&)' and 'int' to binary 'operator/'
19 | ll left = 0,rigth = 1000000,mid = (left+right)/2;
| ~~~~~~~~~~~~^~
| | |
| | int
| std::ios_base& (*)(std::ios_base&)
a.cc:22:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
22 | while(left <= right){
| ~~~~~^~~~~~~~
a.cc:27:31: error: assignment of function 'std::ios_base& std::right(ios_base&)'
27 | right = mid-1;
| ~~~~~~^~~~~~~
|
s960443126 | p03779 | C++ | v | a.cc:1:1: error: 'v' does not name a type
1 | v
| ^
|
s237452933 | p03779 | C++ | v | a.cc:1:1: error: 'v' does not name a type
1 | v
| ^
|
s162522071 | p03779 | C++ |
if(n>pos)
t+=(n-pos);
cout<<t;
// if(vfun())
// cout<<"YES\n";
// else
// cout<<"NO\n";
}
}
///before sub
/// check for value of zero and single input in array
///loop vars,1LL in mult, equal, one, bounds, int v ll, endl, finish taking inputs
/// check whether test cases are given or not
| a.cc:2:13: error: expected unqualified-id before 'if'
2 | if(n>pos)
| ^~
a.cc:4:13: error: 'cout' does not name a type
4 | cout<<t;
| ^~~~
a.cc:9:5: error: expected declaration before '}' token
9 | }
| ^
a.cc:10:1: error: expected declaration before '}' token
10 | }
| ^
|
s881820560 | p03779 | C++ | #include <iostream>
using namespace std;
int main() {
long long x;
cin >> x;
long long t;
long long sum = 0;
for (long long i = 0; i < x; i++) {
if ((sum += (t = i)) >= x)
break;
}
}
cout << t << endl;
return 0;
} | a.cc:15:3: error: 'cout' does not name a type
15 | cout << t << endl;
| ^~~~
a.cc:16:3: error: expected unqualified-id before 'return'
16 | return 0;
| ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s258108581 | p03779 | C++ | #include <iostream>
using namespace std;
long long sum(long long n) {
return n * (n + 1) / 2;
}
int main() {
long long x;
cin >> x;
long long sum;
for (long long i = 1; i < x; i++) {
if (sum = sum(i) < x)
continue;
else {
break;
}
}
cout << sum << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:14:18: error: 'sum' cannot be used as a function
14 | if (sum = sum(i) < x)
| ~~~^~~
|
s912970125 | p03779 | C++ | #include<bits/stdc++.h>
#define PI acos(-1.0)
#define eps 1e-67
#define pf printf
#define sf scanf
#define sd(n) scanf("%d",&n)
#define sd2(n1,n2) scanf("%d %d",&n1,&n2)
#define slf(n) scanf("%lf",&n)
#define slf2(n1,n2) scanf("%lf %lf",&n1,&n2)
#define sLf(n1) scanf("%Lf",&n1)
#define sLf2(n1,n2) scanf("%Lf %Lf",&n1,&n2)
#define sl(n) scanf("%lld",&n)
#define sl2(n1,n2) scanf("%lld %lld",&n1,&n2)
#define rep(i,a,b) for(long long int i=a;i<b;i++)
#define repb(i,a,b) for(long long int i=a;i>=b;i--)
#define repa(i,a,b,c) for(long long int i=a;i<b;i=i+c)
#define reps(i,a,b,c) for(long long int i=a;i>b;i=i-c)
#define asort(a) sort(a.begin(),a.end())
#define asortb(a,comp) sort(a.begin(),a.end(),comp)
#define arev(a) reverse(a.begin(),a.end())
#define all(v) (v).begin(),(v).end()
#define allc(v,comp) (v).begin(),(v).end(),comp
#define allrc(v,a,b,comp) (v).begin()+a,(v).end()-b,comp
#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define pbb pop_back
#define mp make_pair
#define mt make_tuple
#define bs(v,x) binary_search(v.begin(),v.end(),x)
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
#define tl(c) towlower(c)
#define root(x) sqrt(x)
#define power(a,n) pow(a,n)
#define tu(c) towupper(c)
#define sq(a) ((a)*(a))
#define cube(a) ((a)*(a)*(a))
#define mx 1000
#define MX 100000
#define mod 1000000007
using namespace std;
typedef string str;
typedef long long int ll;
typedef double lf;
typedef long double llf;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef char ch;
typedef map<ll,ll> mpl;
void Solve()
{
ll x,sum,ans;
cin>>x;
for(ll i=1; ;i++)
{
sum=(i*(i+2))/2;
if(sum>=x)
{
break;
}
}
ans=min(x,i);
cout<<ans<<endl;
}
int main()
{
Solve();
return 0;
}
| a.cc: In function 'void Solve()':
a.cc:68:15: error: 'i' was not declared in this scope
68 | ans=min(x,i);
| ^
|
s084059243 | p03779 | C++ | #include<iostream>
#define ll long long
using namespace std;
int main(){
ll x,ans; cin>>x;
for(ll i=1;i<40000;i++){
if(i*(i+1)>=2*n){
ans=i;
break;
}
}
cout<<ans;
}
| a.cc: In function 'int main()':
a.cc:8:19: error: 'n' was not declared in this scope
8 | if(i*(i+1)>=2*n){
| ^
|
s670169204 | p03779 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
typedef long long ll;
#define MODSIZE 1000000007
int main(){
int x;
ll t;
int i;
int f = 1;
scanf("%d", &x);
for(i = 1;;i*i <= x;i++){
t = i*(i + 1)/2;
if(t >= x){
if(t > x) f = 0;
break;
}
}
printf("%d\n", i);
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:22: error: expected ')' before ';' token
14 | for(i = 1;;i*i <= x;i++){
| ~ ^
| )
a.cc:14:26: error: expected ';' before ')' token
14 | for(i = 1;;i*i <= x;i++){
| ^
| ;
|
s312069024 | p03779 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define pqgreater(x) x, vector<x>, greater<x>
#define abs(x) (x>0?x:-x)
#define decimal(x) cout<<fixed<<setprecision(x)
#define gc getchar//_unlocked
#define pc putchar//_unlocked
const ll mod=998244353;
int solve(); void precomp();
#define multitest 0
#define usecase 0
int main(){ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int t=1;
if(multitest) cin>>t;
precomp();
for(int tc=1; tc<=t; tc++){
if(multitest && usecase)
cout<<"Case #"<<tc<<": ";
solve();
}
}
void precomp(){
return;
}
int solve(){
int x; cin>>x;
int ans=0;
while(ans>0){
x-=ans+1;
ans++;
}
cout<<i<<endl;
return 0;
} | a.cc: In function 'int solve()':
a.cc:37:15: error: 'i' was not declared in this scope
37 | cout<<i<<endl;
| ^
|
s477198174 | p03779 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <numeric>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
#include <utility>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define MOD 1e9 + 7
#define INF 1e9
#define SENTINEL 2e9
#define PIE 3.14159265358979323
template <class T>
inline bool chmin(T &a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T>
inline bool chmax(T &a, T b) {if (a < b) {a = b; return true;} return false;}
template <class T>
T GCD(T a, T b) {if (b == 0) return a; else return GCD(b, a % b);}
template <class T>
inline T LCM(T a, T b) { return (a * b) / GCD(a, b);}
int main(){
int x;
cin >> x;
int sum = 0;
int res;
while(true){
sum += i;
if (sum >= x){
res = i;
break;
}
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:38:16: error: 'i' was not declared in this scope
38 | sum += i;
| ^
|
s674680984 | p03779 | C++ | include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<utility>
#include<cstdio>
#include<set>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include <bitset>
using namespace std;
const int mod=1e9+7;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,x,n) for (int i= x;i<n;i++)
#define all(v) v.begin(), v.end()
#define nepe(v) next_permutation(all(v))
#define F first
#define S second
#define PB push_back
#define MP make_pair
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl=vector<long long>;
using vp =vector<pair<int,int>>;
typedef pair<int,int> P;
string s;
int k;
ll INF = 10000000000000000;
int main(){
ll X;
cin >>X;
set<ll> t,s;
t.insert(0);
s=t;
ll i=1;
while(!t.count(X)){
for(auto value :t){
s.insert(value+i);
s.insert(value-i);
}
t=s;
i++;
}
cout << i-1<<endl;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared
295 | template <typename _Tp, size_t = sizeof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared
984 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope
1451 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
63 | #include <bits/version.h>
+++ |+#include <cstddef>
64 |
/usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid
1451 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared
1453 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope
1454 | struct extent<_Tp[_Size], 0>
| ^~~~~
/usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid
1454 | struct extent<_Tp[_Size], 0>
| ^
/usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~
/usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid
1455 | : public integral_constant<size_t, _Size> { };
| ^
/usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid
/usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared
1457 | template<typename _Tp, unsigned _Uint, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope
1458 | struct extent<_Tp[_Size], _Uint>
| ^~~~~
/usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid
1458 | struct extent<_Tp[_Size], _Uint>
| ^
/usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope
1463 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid
1463 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type
1857 | { static constexpr size_t __size = sizeof(_Tp); };
| ^~~~~~
/usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~~
/usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~
/usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp'
1860 | struct __select;
| ^~~~~~~~
/usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared
1862 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^~~
/usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^
/usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared
1866 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^~~
/usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
|
s672991501 | p03779 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int main(){
ll x;
cin>>x;
while(1){
if(i*(i+1)/2>=x){
cout<<i<<endl;
break;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:12: error: 'i' was not declared in this scope
13 | if(i*(i+1)/2>=x){
| ^
|
s187932582 | p03779 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int main(){
ll x;
cin>>x;
rep(i,n){
if(n*(n+1)/2>=x){
cout<<i<<endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:11: error: 'n' was not declared in this scope
12 | rep(i,n){
| ^
a.cc:3:36: note: in definition of macro 'rep'
3 | #define rep(i,n) for(ll i=0;i<(ll)(n);i++)
| ^
|
s293587575 | p03779 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int X;
cin>>X;
int ans=0;
for(int i=0;(i*(1+i))2<X;i++){
ans=i+1;
}cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:24: error: expected ';' before numeric constant
7 | for(int i=0;(i*(1+i))2<X;i++){
| ^
| ;
a.cc:7:27: error: expected ')' before ';' token
7 | for(int i=0;(i*(1+i))2<X;i++){
| ~ ^
| )
a.cc:7:28: error: 'i' was not declared in this scope
7 | for(int i=0;(i*(1+i))2<X;i++){
| ^
|
s800444686 | p03779 | C++ | #include <bits/stdc++.h>
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
int main () {
ll x ;
cin >> x ;
for(ll i = 0 ; i < x ; i++){
if( i*(i+1)/2 >= n){
cout << i << endl;
return 0;
}
}
}
| a.cc: In function 'int main()':
a.cc:17:26: error: 'n' was not declared in this scope
17 | if( i*(i+1)/2 >= n){
| ^
|
s495707522 | p03779 | C++ | #include <bits/stdc++.h>
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
int main () {
ll x ;
cin >> x ;
for(ll i = 0 ; i < x ; i++){
if( i*(i+1)/2 >= n){
cout << i << endl;
return 0;
}
}
return 0 ;
}
| a.cc: In function 'int main()':
a.cc:17:26: error: 'n' was not declared in this scope
17 | if( i*(i+1)/2 >= n){
| ^
|
s137256734 | p03779 | C++ |
using namespace std;
int main()
{
int n;
cin >> n;
int sum = 0;
int i = 0;
while (sum < n) {
i++;
sum += i;
}
cout << i << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin >> n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 |
a.cc:15:9: error: 'cout' was not declared in this scope
15 | cout << i << endl;
| ^~~~
a.cc:15:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:22: error: 'endl' was not declared in this scope
15 | cout << i << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 |
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.