submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s618391054 | p03777 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
string a,b,ans;
cin>>a>>b;
if(a=="H" && b=="D")
ans="D";
else if(a=="D" && b=="H")
ans="D";
else if(s=="H" && b=="H")
ans="H";
else
ans="H";
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 's' was not declared in this scope
11 | else if(s=="H" && b=="H")
| ^
|
s599833777 | p03777 | C++ | #import<iostream>
main(){char a,b;std::cin>>a>>b;std::cout<<(a-b?"D":'H');} | a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<iostream>
| ^~~~~~
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){char a,b;std::cin>>a>>b;std::cout<<(a-b?"D":'H');}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:47... |
s730461137 | p03777 | C++ | #import<iostream.h>
main(){char a,b;cin>>a>>b;cout<<(a-b?"D":'H');} | a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<iostream.h>
| ^~~~~~
a.cc:1:8: fatal error: iostream.h: No such file or directory
1 | #import<iostream.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s164683267 | p03777 | C++ | #pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lim 200005
#define pb push_back
#define S second
#define pb push_back
#define mp make_pair
#define INF 1e18
#define fr(i,j,k) for(ll i=j;i<=k;i++)
#define frd(i,j,k) for(ll i=j;i>=k;i--)
#define F first
#define sd(n) sc... | a.cc: In function 'int main()':
a.cc:39:14: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]')
39 | else cout<"H";
| ~~~~^~~~
| | |
| | const char [2]
| std::ostream {aka std::b... |
s509882078 | p03777 | C++ | #pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lim 200005
#define pb push_back
#define S second
#define pb push_back
#define mp make_pair
#define INF 1e18
#define fr(i,j,k) for(ll i=j;i<=k;i++)
#define frd(i,j,k) for(ll i=j;i>=k;i--)
#define F first
#define sd(n) sc... | a.cc: In function 'int main()':
a.cc:38:11: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]')
38 | cout<"D";
| ~~~~^~~~
| | |
| | const char [2]
| std::ostream {aka std::basic_ostream<ch... |
s954390947 | p03777 | C++ | #pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lim 200005
#define pb push_back
#define S second
#define pb push_back
#define mp make_pair
#define INF 1e18
#define fr(i,j,k) for(ll i=j;i<=k;i++)
#define frd(i,j,k) for(ll i=j;i>=k;i--)
#define F first
#define sd(n) sc... | a.cc: In function 'int main()':
a.cc:38:11: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]')
38 | cout<"D";
| ~~~~^~~~
| | |
| | const char [2]
| std::ostream {aka std::basic_ostream<ch... |
s042255861 | p03777 | C++ | #include <stdio.h>
int main(int argc, char const *argv[])
{
int W, a, b;
scanf("%d%d%d", &W, &a, &b);
if(a+W<b) {
printf("%d\n", b-W-a);
} else if (a+W==b || a==b+w) {
printf("1\n");
} else if ((a < b && b < a+W) || (a < b+W < a+W)) {
printf("0\n");
} else {
printf("%d\n", a-b-W);
}
ret... | a.cc: In function 'int main(int, const char**)':
a.cc:9:29: error: 'w' was not declared in this scope
9 | } else if (a+W==b || a==b+w) {
| ^
|
s089383352 | p03777 | C++ | #include<iostream>
using namespace std;
int main(){
string s1,s2;
cin>>s1>>s2;
if(s1[0]=='H'){
if(s2[0]=='H')cout<<'H'<<endl;
else cout<<'D'<<endl;
)
else{
if(s2[0]=='D')cout<<'H'<<endl;
else cout<<'D'<<endl;
}
} | a.cc: In function 'int main()':
a.cc:9:1: error: expected primary-expression before ')' token
9 | )
| ^
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s251752830 | p03777 | C++ | #include<iostream>
using namespace std;
int main(){
string s1,s2;
cin>>s1>>s2;
if(s1[0]=='H'{
if(s2[0]=='H')cout<<'H'<<endl;
else cout<<'D'<<endl;
)
else{
if(s2[0]=='D')cout<<'H'<<endl;
else cout<<'D'<<endl;
}
} | a.cc: In function 'int main()':
a.cc:6:14: error: expected ')' before '{' token
6 | if(s1[0]=='H'{
| ~ ^
| )
a.cc:14:2: error: expected statement at end of input
14 | }
| ^
a.cc:14:2: error: expected '}' at end of input
a.cc:3:11: note: to match this '{'
3 | int mai... |
s924601278 | p03777 | C | #include<stdio.h>
int main(void)
{
char a,b;
scanf("%c",&a);
scanf("%c",&b);
if(a=='H'){
if(b=='H')printf("H");
else if(b=='D')printf("D");
}else if(a=='D'){
if(b=='H')printf("D");
else if(b==''D')printf("H");
}
return 0;
} | main.c: In function 'main':
main.c:12:20: error: empty character constant
12 | else if(b==''D')printf("H");
| ^~
main.c:12:22: error: expected ')' before 'D'
12 | else if(b==''D')printf("H");
| ~ ^
| )
main.c:12:23: warni... |
s715397945 | p03777 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
#define ll long long
#define PI acos(-1.0)
#defi... | a.cc: In function 'int main()':
a.cc:26:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
26 | cout << (a=='H'?b:(b=='H'?'D':'H')) << endl;
| ~^~~~~
| | |
| | char
| ... |
s771916416 | p03777 | C | #include <stdio.h>
#define HONEST 'H'
#define DISHONEST 'D'
#decine LIER(x) ((x==HONEST) ? (DISHONEST) : (HONEST))
int main(void) {
char a, b;
scanf("%c %c", &a, &b);
if (a == HONEST) {
printf("%c¥n", b);
} else {
printf("%c¥n", LIER(b));
}
return 0;
} | main.c:5:2: error: invalid preprocessing directive #decine; did you mean #define?
5 | #decine LIER(x) ((x==HONEST) ? (DISHONEST) : (HONEST))
| ^~~~~~
| define
main.c: In function 'main':
main.c:13:20: error: implicit declaration of function 'LIER' [-Wimplicit-function-declaration]
13 | printf("... |
s713151300 | p03777 | C++ | #include<iostream>
using namespace std;
int main(){
char a,b;
std::cin>>a>>b;
if(a==b){
std::cout<<'H';
}else{
std::cout>>'D';
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:17: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'char')
9 | std::cout>>'D';
| ~~~~~~~~~^~~~~
| | |
| | char
| std::ostream {aka std::ba... |
s505797810 | p03777 | C++ | #include <bits/stdc++.h>
#define MAX_N 1000100
using namespace std;
#define ll long long
#define ull unsigned long long
#define ii pair<int,int>
#define iii pair<ii, int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ep emplace_back
#define sz(a) (int) a.size()
#define cl(a) a.... | a.cc: In function 'int main()':
a.cc:43:45: error: expected ';' before 'if'
43 | if (a[0]=='H'&&b[0]=='H') cout<<'H'
| ^
| ;
44 | if (a[0]=='H'&&b[0]=='D') cout<<'D'
| ~~ ... |
s126840065 | p03777 | C++ | #include<iostream>
using namespace std;
void main()
{
char a,b;
cin>>a;
cin>>b;
if(a=='H'&&b=='H')
cout<<"H";
if(a=='D'&&b=='H')
cout<<"D";
if(a=='D'&&b=='D')
cout<<"H";
return 0;
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main()
| ^~~~
|
s411742265 | p03777 | C++ | #include<iostream>
using namespace std;
void main()
{
char a,b;
cin>>a;
cin>>b;
if(a=='H'&&b=='H')
cout<<"H";
if(a=='D'&&b=='H')
cout<<"D";
if(a=='D'&&b=='D')
cout<<"H";
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main()
| ^~~~
|
s909816741 | p03777 | C++ | #include<iostream>
using namespace std;
void main()
{
char a,b;
cin>>a;
cin>>b;
if(a=='H'&&b=='H')
cout<<"H";
if(a=='D'&&b=='H')
cout<<"D";
if(a=='D&&b=='D')
cout<<"H";
} | a.cc:12:7: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
12 | if(a=='D&&b=='D')
| ^~~~~~~~~
a.cc:12:16: warning: missing terminating ' character
12 | if(a=='D&&b=='D')
| ^
a.cc:12:16: error: missing terminating ' character
12 | if(a=='D&&b=='D... |
s193277392 | p03777 | C++ | #include<iostream>
using namespace std;
void main()
{
char a,b;
cin>>a;
cin>>b;
if(a=='H'&b=='H')
cout<<"H";
if(a=='D'&b=='H')
cout<<"D";
if(a=='D&b=='D')
cout<<"H";
} | a.cc:12:7: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
12 | if(a=='D&b=='D')
| ^~~~~~~~
a.cc:12:15: warning: missing terminating ' character
12 | if(a=='D&b=='D')
| ^
a.cc:12:15: error: missing terminating ' character
12 | if(a=='D&b=='D')
... |
s480163015 | p03777 | C++ | #include <stdio.h>
#include <stdlib.h>
int main()
{
char a,b;
scanf("%c%c",&a,&b);
{
if(a==H&&b==H)
printf("H\n");
if(a==H&&b==D)
printf("D\n");
if(a==D&&b==H)
printf("D\n");
if(a==D&&b==D)
printf("H\n");
}
return 0;
... | a.cc: In function 'int main()':
a.cc:9:15: error: 'H' was not declared in this scope
9 | if(a==H&&b==H)
| ^
a.cc:11:15: error: 'H' was not declared in this scope
11 | if(a==H&&b==D)
| ^
a.cc:11:21: error: 'D' was not declared in this scope
11 | i... |
s800100129 | p03777 | C++ | #include <bits/stdc++.h>
using std;
int main()
{
char a, b;
cin >> a >> b;
cout << a == b ? 'H' : 'D' << endl;
} | a.cc:2:7: error: expected nested-name-specifier before 'std'
2 | using std;
| ^~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> a >> b;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linu... |
s816082123 | p03777 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<int> nums(N, 0);
for (int i = 0; i < N; i++)
cin >> nums[i];
sort(nums.begin(), nums.end());
int res = 0;
int case_num = pow(2, N);
for (int i = 0; i < N; i++){
int add = pow(2, i);
... | a.cc: In function 'int main()':
a.cc:14:24: error: 'pow' was not declared in this scope
14 | int case_num = pow(2, N);
| ^~~
|
s504585587 | p03777 | C++ | #include<iostream>
using namespace std;
#define loop(i,a,b) for(int i=a;i<(int)b;i++)
int main()
{
char ch1,ch3,ch4.ch2;
ch3='H';
ch4='D';
cin>>ch1>>ch2;
if(ch1=='H' && ch2=='H')
cout<<ch3;
else
{
if(ch1=='H' && ch2=='D')
cout<<ch4;
else
{
if(c... | a.cc: In function 'int main()':
a.cc:6:21: error: expected initializer before '.' token
6 | char ch1,ch3,ch4.ch2;
| ^
a.cc:8:5: error: 'ch4' was not declared in this scope; did you mean 'ch3'?
8 | ch4='D';
| ^~~
| ch3
a.cc:9:15: error: 'ch2' was not declared... |
s352221766 | p03777 | C++ | #include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
// #define int long long
#define pb push_back
#define INF 100000000
using namespace std;
typedef long long ll;
typedef ... | a.cc: In function 'int main()':
a.cc:44:2: error: expected '}' at end of input
44 | }
| ^
a.cc:22:14: note: to match this '{'
22 | signed main(){
| ^
|
s408233548 | p03777 | C++ | #include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
// #define int long long
#define pb push_back
#define INF 100000000
using namespace std;
typedef long long ll;
typedef ... | a.cc: In function 'int main()':
a.cc:43:2: error: expected '}' at end of input
43 | }
| ^
a.cc:22:14: note: to match this '{'
22 | signed main(){
| ^
|
s407066405 | p03777 | C | #include<stdio.h>
int main()
{
char act[1],top[1];
scanf("%1s %1s",act,top);
if (strcmp(act,top)==0){
printf("H\n");}else{
printf("D\n");}
return 0;
} | main.c:2:1: error: stray '\302' in program
2 | <U+00A0>
| ^~~~~~~~
main.c: In function 'main':
main.c:7:13: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
7 | if (strcmp(act,top)==0){
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a... |
s125098833 | p03777 | C++ | #include<stdio.h>
int main()
{
char act[1],top[1];
scanf("%1s %1s",act,top);
if (strcmp(act,top)==0){
printf("H\n");}else{
printf("D\n");}
return 0;
} | a.cc:2:1: error: extended character is not valid in an identifier
2 |
| ^
a.cc:2:1: error: '\U000000a0' does not name a type
2 |
| ^
|
s460680842 | p03777 | C++ |
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double a,b,H,D;
cin >> a >> b >> ;
if(a == H && b == H)
{
cout << "H" << endl;
}
else if(a == H && b == D)
{
... | a.cc: In function 'int main()':
a.cc:8:31: error: expected primary-expression before ';' token
8 | cin >> a >> b >> ;
| ^
|
s995576945 | p03777 | C | #include<stdio.h>
int main(void)
{
char a,b;
scanf("%c",&a);
scanf("%c",&b)
if(a='H'){
if(b='H')printf("H");
else printf("D");}
else{
if(b='H')printf("D");
else printf("H");}
return 0;
} | main.c: In function 'main':
main.c:6:15: error: expected ';' before 'if'
6 | scanf("%c",&b)
| ^
| ;
7 | if(a='H'){
| ~~
|
s717999523 | p03777 | 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>
... |
s227876318 | p03777 | 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_s("%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>
... |
s063133059 | p03777 | C++ | #include <iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
if (a==H)
if(b==H) {
cout << "H" << endl;
}
else {
cout << "D" << endl;
}
else if (b==H) {
... | a.cc: In function 'int main()':
a.cc:7:8: error: 'H' was not declared in this scope
7 | if (a==H)
| ^
|
s156156457 | p03777 | C++ | #include <iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
if (a==H)
if(b==H) {
cout "H" << endl;
}
else {
cout "D" << endl;
}
else if (b==H) {
... | a.cc: In function 'int main()':
a.cc:7:8: error: 'H' was not declared in this scope
7 | if (a==H)
| ^
a.cc:9:33: error: expected ';' before string constant
9 | cout "H" << endl;
| ^ ~~~
| ;
a.cc... |
s120074998 | p03777 | C | #include <stdio.h>
int main(void)
{
int a.b;
printf ("A.Bは正直者?嘘つき?");
scanf ("%d",&a,&b);
if (a=H,b=H)
printf ("H");
else if (a=D,b=H)
printf ("D");
else if (a=H,b=D)
printf ("D");
else if (a=D,b=D)
printf ("H");
return... | main.c: In function 'main':
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
5 | int a.b;
| ^
main.c:5:13: error: expected expression before '.' token
main.c:7:21: error: 'a' undeclared (first use in this function)
7 | scanf ("%d",&a,&b);
... |
s106079388 | p03777 | C++ | #include<stdio.h>
int main()
{
char act[1],top[1];
scanf("%1s %1s",act,top);
if(strcmp(act,top)==0){
printf("H¥n");}else{
printf("D¥n");};
return0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'strcmp' was not declared in this scope
7 | if(strcmp(act,top)==0){
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<stdio.h>
+++ |+#include <cstring>
2 |
a.... |
s392906660 | p03777 | C++ |
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
if (a = H)
if(b=H) {
cout "H" << endl;
}
else {
cout "D" << endl;
}
else if (b=H) {
... | a.cc: In function 'int main()':
a.cc:8:9: error: 'H' was not declared in this scope
8 | if (a = H)
| ^
a.cc:10:33: error: expected ';' before string constant
10 | cout "H" << endl;
| ^ ~~~
| ;
a... |
s301964663 | p03777 | C++ | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
char a = sc.next().charAt(0);
char b = sc.next().charAt(0);
if( (a=='H'&&b=='H')||(a=='D'&&b=='D') ){
System.out.println("H");
}else{
System.out.println("D");
}
return;
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s098411433 | p03777 | C | #include <stdio.h>
int main(void)
{
int a.b;
printf ("A.Bは正直者?嘘つき?");
scanf ("%d",&a,&b);
if (a=H,b=H)
printf ("H");
else if (a=D,b=H)
printf ("D");
else if (a=H,b=D)
printf ("D");
else if (a=D,b=D)
printf ("H")
return 0;
... | main.c: In function 'main':
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
5 | int a.b;
| ^
main.c:5:13: error: expected expression before '.' token
main.c:7:21: error: 'a' undeclared (first use in this function)
7 | scanf ("%d",&a,&b);
... |
s944014649 | p03777 | C | #include "stdafx.h"
void solve(char a, char b) {
char ans;
if (a == 'H') {
ans = b;
}
else if (b == 'H'){
ans = 'D';
}
else {
ans = 'H';
}
printf("%c", ans);
}
int main()
{
char a, b;
scanf("%c %c", &a, &b);
solve(a, b);
return 0;
}
| main.c:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s457876687 | p03777 | C++ | #include "stdafx.h"
void solve(char a, char b) {
char ans;
if (a == 'H') {
ans = b;
}
else if (b == 'H'){
ans = 'D';
}
else {
ans = 'H';
}
printf("%c", ans);
}
int main()
{
char a, b;
scanf("%c %c", &a, &b);
solve(a, b);
return 0;
}
| a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s645594048 | p03777 | C++ | #pragma once
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
string S[2],H,D;
int main() {
H = "H";
D = "D";
cin >> S[0];
cin >> S[1];
if (S[0]==H) {
if (S[1] == H) {
cout << H.c_str << endl;
}
else {
cout << D.c_str << endl;
... | a.cc:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
a.cc: In function 'int main()':
a.cc:23:30: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Al... |
s836917432 | p03777 | C++ | #include <stdio.h>
int main()
{
int a,b,H,D;
scanf("a,b",&no);
if (a = H)
if(b=H)
puts("H");
else
puts("D");
else if (b=H)
puts("D");
else
puts("H");
} | a.cc: In function 'int main()':
a.cc:6:14: error: 'no' was not declared in this scope
6 | scanf("a,b",&no);
| ^~
|
s322366532 | p03777 | C++ | a, b = input().split()
if a == "H":
print(b)
if a == "D":
if b == "H":
print("D")
else:
print("H")
| a.cc:1:1: error: 'a' does not name a type
1 | a, b = input().split()
| ^
|
s247777156 | p03777 | Java | import java.util.Scanner;
public class HonestOrDishonest {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.next().equals("H") ? 0 : 1;
int b = s.next().equals("H") ? 0 : 1;
if (a + b == 1) {
System.out.println("D");
} else ... | Main.java:3: error: class HonestOrDishonest is public, should be declared in a file named HonestOrDishonest.java
public class HonestOrDishonest {
^
1 error
|
s050823490 | p03777 | C++ | nclude <iostream>
#include <string.h>
using namespace std;
int main(){
char a,b;
scanf("%c %c",&a,&b);
//cout << a << b << endl;
if (a == b){
cout << "H" << endl;
}
else{
cout << "D" << endl;
}
return 0;
}
| a.cc:1:1: error: 'nclude' does not name a type
1 | nclude <iostream>
| ^~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'scanf' was not declared in this scope
8 | scanf("%c %c",&a,&b);
| ^~~~~
a.cc:12:5: error: 'cout' was not declared in this scope
12 | cout << "H" << endl;
|... |
s834262519 | p03777 | C++ | using System;
namespace A_HonestOrDishonest {
class Program {
static void Main(string[] args) {
// スペース区切りの整数の入力
string[] input = Console.ReadLine().Split(' ');
string a = input[0];
string b = input[1];
string ans = (a == "H" && b == "H") || (a ==... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:5:26: error: 'string' has not been declared
5 | static void Main(string[] args) {
| ^~~~~~
a.cc:5:35: error: expected ',' or '...' before 'args'
5 | stat... |
s647348625 | p03777 | C++ | #include<iostream>
using namespace std;
int main(){
char a,b;
std::cin>>a>>b;
if(a==b){
std::cout<<H;
}else{
std::cout<<D;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:20: error: 'H' was not declared in this scope
7 | std::cout<<H;
| ^
a.cc:9:15: error: 'D' was not declared in this scope
9 | std::cout<<D;
| ^
|
s301174968 | p03777 | C++ | if (a = H)
if(b=H)
puts("H");
else
puts("D");
else if (b=H)
puts("D");
else
puts("H"); | a.cc:1:1: error: expected unqualified-id before 'if'
1 | if (a = H)
| ^~
a.cc:4:9: error: expected unqualified-id before 'else'
4 | else
| ^~~~
a.cc:6:1: error: expected unqualified-id before 'else'
6 | else if (b=H)
| ^~~~
a.cc:8:9: error: expected unqualified-id before 'e... |
s298818234 | p03777 | 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'
... |
s015575968 | p03777 | C++ | #include <iostream>
#include <string>
using namespace std;
void main() {
string a, b;
cin >> a >> b;
if ((a == "H"&&b == "H") || (a == "D"&&b == "D")) {
cout << "H" << endl;
}
else {
cout << "D" << endl;
}
} | a.cc:7:1: error: '::main' must return 'int'
7 | void main() {
| ^~~~
|
s799072369 | p03777 | C++ | #include <iostream>
#include <cmath>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
char str[5],r;
while(gets(str)!=NULL)
{
if(str[0]=='H')
{
if(str[2]=='H')
r='H';
else
r='D';
}
else
{
... | a.cc: In function 'int main()':
a.cc:10:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | while(gets(str)!=NULL)
| ^~~~
| getw
|
s310282471 | p03777 | C++ | #include <iostream>
using namespace std;
int main()
{
char a,b;
cin >> a >>b;
bool boola = a == 'H';
bool boolb = b == 'H';
bool result = false;
if(a && b) result = true;
else if (a || b) result = false;
else result = true;
if(result)
{
return 'H';
}
else
{... | a.cc:27:5: error: expected unqualified-id before 'if'
27 | if(result)
| ^~
a.cc:31:5: error: expected unqualified-id before 'else'
31 | else
| ^~~~
a.cc:35:1: error: expected declaration before '}' token
35 | }
| ^
|
s976697587 | p03777 | C++ | #include <iostream>
#include <cstdio>
#include <stdio.h>
using namespace std;
int main()
{
char a[3];
gets(a);
if(a[0]=='H')
{
if(a[2]=='H') cout<<'H'<<endl;
else cout<<'D'<<endl;
}
else if(a[0]=='D')
{
if(a[2]=='H') cout<<'D'<<endl;
else cout<<'H'<<endl;
... | a.cc: In function 'int main()':
a.cc:10:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | gets(a);
| ^~~~
| getw
|
s012936600 | p03777 | C++ | #include <iostream>
#include <string>
using namespace std;
string han(string A){
if(A == "H"){
return D;
}
else return H;
}
int main(){
string A, B;
cin >> A >> B;
if (A == "H") cout << B << endl;
else cout << han(B) << endl;
return 0;
} | a.cc: In function 'std::string han(std::string)':
a.cc:7:24: error: 'D' was not declared in this scope
7 | return D;
| ^
a.cc:9:21: error: 'H' was not declared in this scope
9 | else return H;
| ^
|
s785544464 | p03777 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
char a[3];
gets(a);
if(a[0]=='H')
{
if(a[2]=='H') cout<<'H'<<endl;
else cout<<'D'<<endl;
}
else if(a[0]=='D')
{
if(a[2]=='H') cout<<'D'<<endl;
else cout<<'H'<<endl;
}
return 0;
... | a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(a);
| ^~~~
| getw
|
s127697617 | p03777 | C++ | #include <bits/stdc++.h> ... | a.cc:1:3781: warning: extra tokens at end of #include directive
1 | #include <bits/stdc++.h> ... |
s506241511 | p03777 | C++ |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
char a,b;
cin>>a>>b;
int ans = 1;
if (!strcmp(&b, "H")) ans = 1; else ans = -1;
if (!strcmp(&a, "H")) ans *= 1; else ans *= -1;
if (ans > 0) cout<<"H"<<endl; else cout<<"D"<<endl;
}
| a.cc: In function 'int main()':
a.cc:13:10: error: 'strcmp' was not declared in this scope
13 | if (!strcmp(&b, "H")) ans = 1; else ans = -1;
| ^~~~~~
a.cc:6:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <algorithm>
+... |
s619715886 | p03777 | C++ | #include<stdio.h>
int main()
{
char a[2];
while(gets(a)!=NULL)
{
if(a[0]=='H')
printf("%c\n",a[1]);
else {
if(a[1]=='H')
printf("D\n");
else printf("H\n");
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
5 | while(gets(a)!=NULL)
| ^~~~
| getw
|
s019254163 | p03777 | C++ | #include <iostream>
int main() {
char a,b;
scanf("%c%c",&a,&b);
if((a=='H' && b=='H') || (a=='D' && b=='D'){
printf("H");
}
else{
printf("D");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:48: error: expected ';' before '{' token
7 | if((a=='H' && b=='H') || (a=='D' && b=='D'){
| ^
| ;
a.cc:10:5: error: expected primary-expression before 'else'
10 | ... |
s133483230 | p03777 | C++ |
if a =="H":
if b=="H":
return "H"
else:
return "D"
else:
if b=="H":
return "D"
else:
return "H" | a.cc:2:9: error: expected unqualified-id before 'if'
2 | if a =="H":
| ^~
|
s750799326 | p03777 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char a = sc.next();
char b = sc.next();
if (a == 'H') {
if (b == 'H') {
System.out.println("H");
} else {
System.out.println("D");
}
} else {
if (b == 'H') {
System.... | Main.java:7: error: incompatible types: String cannot be converted to char
char a = sc.next();
^
Main.java:8: error: incompatible types: String cannot be converted to char
char b = sc.next();
^
2 errors
|
s505548124 | p03777 | C++ | a, b = map(str, raw_input().split())
result = ''
if a == ‘H’:
if b== ‘H’:
result = ‘H’
else:
result = ‘D’
else:
if b==‘H’
result=‘D’
else:
result=‘H'
print result | a.cc:2:10: error: empty character constant
2 | result = ''
| ^~
a.cc:3:9: error: extended character ‘ is not valid in an identifier
3 | if a == ‘H’:
| ^
a.cc:3:9: error: extended character ’ is not valid in an identifier
a.cc:4:16: error: extended character ‘ is not valid in an iden... |
s279245619 | p03777 | C++ | #include <cstdio>
using namespace std;
int main(){
char a=getchar(),b=getchar(),getchar();
putchar(a==b?'H’:'D');
} | a.cc:5:20: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
5 | putchar(a==b?'H’:'D');
| ^~~~~~
a.cc:5:26: warning: missing terminating ' character
5 | putchar(a==b?'H’:'D');
| ^
a.cc:5:26: error: missing termina... |
s978723839 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll one = 1;
const ll INF = 9223372036854775807; //10^18
const int inINF = 2147483647; //10^9
const ll MO... | 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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int... |
s506136958 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int W; int A; int B;
cin>>W>>A>>B;
int L=max(A,B)
int R=min(A+W,B+W);
if(R-L>=0)
cout<<R-L<<endl;
else cout<<0<<endl;
} | a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'int'
7 | int R=min(A+W,B+W);
| ^~~
a.cc:8:6: error: 'R' was not declared in this scope
8 | if(R-L>=0)
| ^
|
s740468197 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} //最大公約数
int lcm(int ... | a.cc: In function 'int main()':
a.cc:59:12: error: 'ads' was not declared in this scope; did you mean 'abs'?
59 | int c = ads(b-a) - w
| ^~~
| abs
|
s575285016 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} // 最大公約数
int lcm(int ... | a.cc:16:66: error: extended character is not valid in an identifier
16 | int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
| ^
a.cc:17:61: error: extended character is not valid in an identifier
17 | int dsum(in... |
s634602918 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} // 最大公約数
int lcm(int ... | a.cc:14:43: error: extended character is not valid in an identifier
14 | int nHr(int a,int b){return nCr(a+b-1,b);} // 重複組み合わせ
| ^
a.cc:14:43: error: extended character is not valid in an identifier
a.cc:14:43: error: extended character is not valid in an iden... |
s483943676 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#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;} // max関数
int min(int a,int b){if(a<b){return a;}return b;} // min
int zt(int a,int b){return max(a,b)-min(a... | a.cc:13:62: error: extended character is not valid in an identifier
13 | int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} // 商の繰り上げ
| ^
a.cc:13:62: error: extended character is not valid in an identifier
a.cc:13:62: error: extended... |
s107706838 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int a, b, w, x, y, hasil;
int main () {
cin >> w >> a >> b;
if(a>b){
y=b+w;
if (y>b){
cout << 0 << endl;
}else{
hasil=a-y;
cout << hasil << endl;
}else if (b>a)
x=a+w;
if (x>a){
cout << 0 << endl;
}else{
hasil=b-x;
... | a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' before 'else'
15 | }else if (b>a)
| ^~~~
a.cc:8:8: note: to match this '{'
8 | if(a>b){
| ^
|
s067338262 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int a, b, w, x, y, hasil;
int main () {
cin >> a >> b >> w;
a+w=x;
hasil=b-x;
cout << hasil << endl;
}
| a.cc: In function 'int main()':
a.cc:8:2: error: lvalue required as left operand of assignment
8 | a+w=x;
| ~^~
|
s770558935 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
int a, b, w;
int main () {
cin >> a >> w >> b;
if (w +a>=b) {
cout<< (b+w<=a) <<endl;
}
else {
cout<< 0 <<endl;
}
else {
cout<< b-a-w <<endl;
}
} | a.cc: In function 'int main()':
a.cc:14:41: error: 'else' without a previous 'if'
14 | else {
| ^~~~
|
s674420151 | p03778 | C++ | using namespace std;
int W,a,b,FV,SV,zero;
int main() {
cin>>W>>a>>b;
zero=0;
FV=b-(W+a);
SV=a-(W+b);
{if(FV>zero)
cout<<FV<<endl;
else if(SV>zero)
cout<<SV<<endl;
else
cout<<zero<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | 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 | using namespace std;
a.cc:11:6: error... |
s076050413 | p03778 | C++ | using namespace std;
int W,a,b,FV,SV,zero;
int main() {
zero=0;
FV=b-(W+a);
SV=a-(W+b);
{if(FV>SV)
cout<<FV<<endl;
else if(FV<SV)
cout<<SV<<endl;
else
cout<<zero<<endl;
}
} | a.cc: In function 'int main()':
a.cc:10:6: error: 'cout' was not declared in this scope
10 | cout<<FV<<endl;
| ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:10:... |
s492666727 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int w, a, b;
cin>>W>>a>>b;
if(b<a)
swap(a,b);
if(b<=a+W)
cout<<0<<endl;
else
cout<<(b-a-W)<<endl;
}
| a.cc: In function 'int main()':
a.cc:6:14: error: 'W' was not declared in this scope
6 | cin>>W>>a>>b;
| ^
|
s390308091 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define check cin >>
#define say cout <<
#define nicely << endl
#define initialize_playboy_mode ios_base::sync_with_stdio(0);
#define breakup_with_gf cin.tie(0);
#define messed_up cout << -1 << endl;
#define wife first
#define spare... | a.cc: In function 'void flirt()':
a.cc:63:1: error: expected primary-expression before '}' token
63 | }
| ^
a.cc:62:11: error: expected ';' before '}' token
62 | return
| ^
| ;
63 | }
| ~
|
s688351839 | 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();
if(a + w <= b)System.out.println(b - (a + w));
else if(b + w <= a) System.out.... | Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s243545165 | p03778 | C++ | #include<bits/stdc++.h>
#define int long long
#define vi vector<int>
#define pb push_back
#define log(x,b) (log(b)/log(x))
#define rep(i,x,y) for(int i=(x);i<(y);i++)
using namespace std;
const int mod=1e9+7;
int32_t main()
{
int w,a,b;
cin>>w>>a>>b;
if(b<a)swap(a,b);
if(a<=b && b<=a+w)cout<<0<<endl;
... | a.cc: In function 'int32_t main()':
a.cc:17:13: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::ostream' {aka 'std::basic_ostream<char>'})
17 | cout<<cout<<b-(a+w)<<endl;
| ~~~~^~~~~~
| | |
| | bas... |
s303589109 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>;
cout<<c-a*b<<endl;
} | a.cc: In function 'int main()':
a.cc:5:14: error: expected primary-expression before ';' token
5 | cin>>a>>b>>;
| ^
|
s187825002 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using st=string;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i... | a.cc: In function 'int main()':
a.cc:28:48: error: expected ';' before '}' token
28 | cout << max(b-a,max(abs(a+w-b),abs(b+w^a))+1)
| ^
| ;
29 | }
| ~
|
s038440848 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
ll w, a, b;
cin >> w >> a >> b;
chmin(a, b);
if (b <= a+w) cout << 0 << endl;
else cout << abs(a+w-b) << endl;
} | a.cc: In function 'int main()':
a.cc:11:3: error: 'chmin' was not declared in this scope
11 | chmin(a, b);
| ^~~~~
|
s773323486 | p03778 | C++ | def main():
w,a,b = list(map(int,input().split()))
if (a+w)<=b or b+w<=a:
if abs(a+w-b)<=abs(b+w-a):
print(abs(a+w-b))
else:
print(abs(b+w-a))
else:
print(0)
main() | a.cc:1:1: error: 'def' does not name a type
1 | def main():
| ^~~
|
s741292255 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int W,A,B;
cin>>W>>A>>B;
cout<<max(max(A,B)-(min(A,B)+w),0)<<endl;
} | a.cc: In function 'int main()':
a.cc:7:32: error: 'w' was not declared in this scope
7 | cout<<max(max(A,B)-(min(A,B)+w),0)<<endl;
| ^
|
s707445598 | p03778 | C++ | #include <bits/stdc++.h>
#define pii pair<int, int>
using namespace std;
int W, A, B;
int main() {
ios_base::sync_with_stdio(0);
cin >> W >> A >> B;
if(A > B) swap(A, B);
cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
} | a.cc: In function 'int main()':
a.cc:11:25: error: no match for 'operator>' (operand types are 'std::basic_ostream<char>' and 'int')
11 | cout << (B - (A + W)) > 0 ? (B - (A + W)) : 0 << "\n";
| ~~~~~~~~~~~~~~~~~~~~~ ^ ~
| | |
| | int
| ... |
s357577423 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int W,a,b;
cin >> W >> a >> b;
if (a<=B && b<=a+W) cout << 0 << endl;
else if (a<=b+W && b+W<=a+W) cout << 0 << endl;
else cout << max(b-a-W,a-b-W) << endl;
} | a.cc: In function 'int main()':
a.cc:7:10: error: 'B' was not declared in this scope
7 | if (a<=B && b<=a+W) cout << 0 << endl;
| ^
|
s909040684 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
using vi = vector<int>;
const int MOD = 1e9+7;
bool IsPrime(int num){
if (num < 2) return false;
else if (num == 2) return true;
else if (num % ... | a.cc:25:21: error: extended character is not valid in an identifier
25 | else if(b >= a+W) cout << b-a-W+1 <<endl;
| ^
a.cc: In function 'int main()':
a.cc:23:36: error: expected primary-expression before ')' token
23 | else if(b+W <a+W && b+W >a;) cout << 0 << endl;
... |
s435803177 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPr... | a.cc: In function 'int main()':
a.cc:24:14: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
24 | cout < 0 << endl;
| ~~^~~~~~~
|
s219951402 | p03778 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <utility>
#include <map>
#include <climits>
#include <vector>
#include <set>
#include <string>
#include <numeric>
#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define int long long
using namespa... | a.cc: In function 'int32_t main()':
a.cc:27:16: error: no matching function for call to 'max(long long int, int)'
27 | cout << max(abs(a-b)-W, 0);
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s874528962 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,c;
cin >> a>>b >>c;
if(-min(b,c)-w+max(b,c) < 0){
cout << 0 <<endl;
}
else{
cout << -min(b,c)-w+max(b,c) <<endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:14: error: 'w' was not declared in this scope
9 | if(-min(b,c)-w+max(b,c) < 0){
| ^
|
s935129006 | p03778 | C++ | #Include<iostream>
using namespace std;
int main(){
int w,a,b,ans;
cin >> w >> a >> b;
if(a>b){
ans=a-b-w;
}
else{
ans=b-a-w;
}
if(ans>0){
cout << ans << endl;
}
else{
cout << "0" << endl;
}
}
| a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
1 | #Include<iostream>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> w >> a >> b;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header... |
s478679601 | p03778 | C++ | include<iostream>
using namespace std;
int main(){
int w,a,b;
cin >> w >> a >> b;
int ans;
if(b > (a + w)){
ans = b - (a + w);
}
else if(a > (b + w)){
ans = a - (b + w);
}
else{
ans = 0;
}
cout << ans << endl;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> w >> a >> b;
| ^~~
a.cc:18:3: error: 'cout' was not declared in this scope
18 | cout << ans << endl;
| ^~~... |
s515809686 | p03778 | C++ | include<iostream>
using namespace std;
int main(){
int w,a,b;
cin >> w >> a >> b;
int ans;
if(b > (a + w)){
ans = b - (a + w);
}
else if(a > (b + w)){
ans = a - (b + w);
}
else{
ans = 0;
}
cout << ans << endl;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> w >> a >> b;
| ^~~
a.cc:18:3: error: 'cout' was not declared in this scope
18 | cout << ans << endl;
| ^~~... |
s708053025 | p03778 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
#define rall(a) (a).rbegin(),(a).rend()
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;
int main(){
in... | a.cc: In function 'int main()':
a.cc:15:41: error: expected '}' at end of input
15 | cout << max(abs(a-b) - w,0) << endl;
| ^
a.cc:12:11: note: to match this '{'
12 | int main(){
| ^
|
s100414825 | p03778 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
// Your code here!
Scanner sc = new Scanner(System.in);
int W = sc.nextInt(),a = sc.nextInt(),b = sc.nextInt();
int bigger = Math.max(a,b);
int smaller = Math.min(a,b);
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s294607866 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define pi 3.1415926535897932384626433832795028841971693993751058209749445923078164062
const int INF = 1e9;
#define ll long long
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define ub upper_bound
#define lb l... | a.cc: In function 'void unite(int, int)':
a.cc:58:53: error: reference to 'size' is ambiguous
58 | void unite(int a, int b){a = find(a);b = find(b);if(size[a]<size[b])swap(a,b);size[a] += size[b];root[b] = a;}
| ^~~~
In file included from /usr/include/c++/14/... |
s852123796 | p03778 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int w,a,b;
cin >> w >> a >> b;
if((b>=a&&b<=a+w)||(b+w>=a&&b+w<=a+w))cout << 0 << endl;
else cout << min(abs(b-a-w),abs(a-b-w) << endl;
} | a.cc: In function 'int main()':
a.cc:8:44: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
8 | else cout << min(abs(b-a-w),abs(a-b-w) << endl;
| ~~~~~~~~~~~^~~~~~~
|
s851212069 | p03778 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int w,a,b;
cin >> w >> a >> b;
if(a < b && a+w<b)
cout << b-a-w << endl;
if else(b < a && b+w<a)
cout << a-b-w << endl;
else
cout << 0 << endl;
}
| a.cc: In function 'int main()':
a.cc:8:6: error: expected '(' before 'else'
8 | if else(b < a && b+w<a)
| ^~~~
| (
a.cc:10:3: error: 'else' without a previous 'if'
10 | else
| ^~~~
|
s641092076 | 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 ){
cout << 0 << endl:
return 0;
}
else cout << min(abs(b-a-W),abs(a-b-W)) << endl;
}
| a.cc: In function 'int main()':
a.cc:9:22: error: expected ';' before ':' token
9 | cout << 0 << endl:
| ^
| ;
|
s201833399 | p03778 | C++ | #include <iostream>
using namespace std;
int main (){
int a,b,w;
cin >> w >> a >> b;
if (b >= a && b <= a+w) {cout<<0; return 0;}
if (b >= a + w)) cout<<b - (a + w);
else cout<<a - (b + w);
}
| a.cc: In function 'int main()':
a.cc:9:18: error: expected primary-expression before ')' token
9 | if (b >= a + w)) cout<<b - (a + w);
| ^
|
s993663278 | p03778 | C++ | #include <iostream>
using namespace std;
int main (){
int a,b,w;
cin >> w >> a >> b;
if (b >= a && b <= a+w) {cout<<0; return o;}
if (b >= a + w)) cout<<b - (a + w);
else cout<<a - (b + w);
}
| a.cc: In function 'int main()':
a.cc:7:44: error: 'o' was not declared in this scope
7 | if (b >= a && b <= a+w) {cout<<0; return o;}
| ^
a.cc:9:18: error: expected primary-expression before ')' token
9 | if (b >= a + w)) cout<<b - (a + w);
| ... |
s403145039 | p03778 | C++ | #include <iostream>
using namespace std;
int main (){
int a,b,w;
cin >> w >> a >> b;
if (b >= a + w)) cout<<b - (a + w);
else cout<<a - (b + w);
}
| a.cc: In function 'int main()':
a.cc:7:18: error: expected primary-expression before ')' token
7 | if (b >= a + w)) cout<<b - (a + w);
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.