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";
... |
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 <<... | 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 <<... | 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>
... | 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: not... |
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
... | 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: ... |
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<<en... | 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
# ... | 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){i... | 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>
+++ |+#in... |
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){
print... | 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... | 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" ) << ... | 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 ... | 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;
| ... |
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 +... | 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... | 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... |
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 <=... | 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 de... |
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 ... | 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 => ... |
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/st... |
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>=(... | 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<<6... | 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... | 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... |
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,... |
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: ... |
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... | 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.prin... | 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: err... |
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);
S... | 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 th... |
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... | 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... | 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) {
Sy... | 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) {
... | 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 ... | 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... | 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-g... |
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;
... | 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;... | 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.p... | 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.p... | 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,... | 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>
... |
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,... | 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>
... |
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::c... |
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\... | 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... | 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);
| ^
m... |
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.ou... | 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'
... |
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) {
cou... | 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... |
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.pri... | 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", ... |
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... | 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,
... |
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 s... | 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 an... | 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&)... |
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 input... | 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 dec... |
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,&... | 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;
}
... | 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... | 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++)... | 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... | 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 __g... |
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){
c... | 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){
c... | 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++){
| ~ ^
... |
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++){
... | 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++){
... | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.