submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s994308472 | p03679 | C++ | #incldue<bits/stdc++.h>
using namespace std;
int main(){
int a,b,x;cin>>x>>a>>b;
string s;
if(a>=b) s="delicious";
if(b>a && b<=x+a) s="safe";
if(b>x+a) s="dangerous";
cout<<s<<endl;
} | a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
1 | #incldue<bits/stdc++.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:4:13: error: 'cin' was not declared in this scope
4 | int a,b,x;cin>>x>>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 | #incldue<bits/stdc++.h>
a.cc:5:3: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
+++ |+#include <string>
1 | #incldue<bits/stdc++.h>
a.cc:6:12: error: 's' was not declared in this scope
6 | if(a>=b) s="delicious";
| ^
a.cc:7:21: error: 's' was not declared in this scope
7 | if(b>a && b<=x+a) s="safe";
| ^
a.cc:8:13: error: 's' was not declared in this scope
8 | if(b>x+a) s="dangerous";
| ^
a.cc:9:3: error: 'cout' was not declared in this scope
9 | cout<<s<<endl;
| ^~~~
a.cc:9:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:9: error: 's' was not declared in this scope
9 | cout<<s<<endl;
| ^
a.cc:9:12: error: 'endl' was not declared in this scope
9 | cout<<s<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #incldue<bits/stdc++.h>
|
s093370874 | p03679 | C++ | #include <iostream>
using namspace std;
int main(void){
int X, A, B;
// implements
if(B <= A){
printf("delicious\n");
}
else if(B > (A+X)){
printf("dangerous\n");
}
else{
printf("safe\n");
}
return 0;
}
| a.cc:2:7: error: expected nested-name-specifier before 'namspace'
2 | using namspace std;
| ^~~~~~~~
|
s060919494 | p03679 | Java | import java.util.Scanner;
import java.util.Vector;
class Main{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
Vector<Integer> v=new Vector<Integer>();
for(int i=0; i<n; i++) {
int z=sc.nextInt();
z--;
v.add(z);
}
int now=0; int c=0;
for(;;) {
if(now==1) {
System.out.println(c);
}
if(c>=n) {
System.out.println(-1);
}
c++;
now=v[now];
}
}
} | Main.java:24: error: array required, but Vector<Integer> found
now=v[now];
^
1 error
|
s681814980 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int x,a,b;
cin>>x>>a>>b;
if(a>=b) cout<<"delicious"<<endl;
else if (b-a=<x) cout<<"safe"<<endl;
else cout<<"dangerous"<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:16: error: expected primary-expression before '<' token
7 | else if (b-a=<x) cout<<"safe"<<endl;
| ^
|
s927180617 | p03679 | C++ | #include <iostream>
using namespace std;
int main(){
int X,A,B;
cin >> X >> A >> B;
if(A >= B){
cout << "delicious" << endl;
}else if(X >= B-A){
cout << "safe" << endl;
}else{
cout << "dangerous" << endl;
} | a.cc: In function 'int main()':
a.cc:12:6: error: expected '}' at end of input
12 | }
| ^
a.cc:3:15: note: to match this '{'
3 | int main(){
| ^
|
s022618433 | p03679 | C++ | #include <iostream>
using namespace std;
int main(){
int X,A,B;
cin >> X >> A >> B;
if(A >= B){
cout << "delicious" << endl;
}else if(X >= B-A){
cout << "safe" << endl;
}else{
cout << "dangerous" << endl;
} | a.cc: In function 'int main()':
a.cc:12:6: error: expected '}' at end of input
12 | }
| ^
a.cc:3:15: note: to match this '{'
3 | int main(){
| ^
|
s038956550 | p03679 | 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 x,a,b;
cin>>x>>a>>b;
if(b-a <= 0) cout<<"delicious"<<endl;
else if(b-a >= x) cout<<"safe"<<endl;
else cout<<"dangerous"
} | a.cc: In function 'int main()':
a.cc:10:27: error: expected ';' before '}' token
10 | else cout<<"dangerous"
| ^
| ;
11 | }
| ~
|
s303154610 | p03679 | 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 x,a,b;
cin>>x>>a>>b;
if(b-a <= 0)cout<<"delicious"<<endl;
else if(b-a >= x)cout<<"safe"<<endl;
else cout<<"dangerous"
} | a.cc: In function 'int main()':
a.cc:10:27: error: expected ';' before '}' token
10 | else cout<<"dangerous"
| ^
| ;
11 | }
| ~
|
s636739335 | p03679 | C++ | #include<stdio.h>
int main ( )
{
int x , a , b ;
s c a n f (”%d%d%d ” , &x , &a , &b ) ;
i f (−a + b <= 0 ) p r i n t f ( ”delicious\n ” ) ;
e l s e i f (−a + b <= x ) p r i n t f ( ”safe\n ” ) ;
e l s e p r i n t f ( ”dangerous\n ” ) ;
return 0;
}
| a.cc:5:12: error: extended character ” is not valid in an identifier
5 | s c a n f (”%d%d%d ” , &x , &a , &b ) ;
| ^
a.cc:5:20: error: extended character ” is not valid in an identifier
5 | s c a n f (”%d%d%d ” , &x , &a , &b ) ;
| ^
a.cc:6:6: error: extended character − is not valid in an identifier
6 | i f (−a + b <= 0 ) p r i n t f ( ”delicious\n ” ) ;
| ^
a.cc:6:34: error: extended character ” is not valid in an identifier
6 | i f (−a + b <= 0 ) p r i n t f ( ”delicious\n ” ) ;
| ^
a.cc:6:44: error: stray '\' in program
6 | i f (−a + b <= 0 ) p r i n t f ( ”delicious\n ” ) ;
| ^
a.cc:6:47: error: extended character ” is not valid in an identifier
6 | i f (−a + b <= 0 ) p r i n t f ( ”delicious\n ” ) ;
| ^
a.cc:7:14: error: extended character − is not valid in an identifier
7 | e l s e i f (−a + b <= x ) p r i n t f ( ”safe\n ” ) ;
| ^
a.cc:7:42: error: extended character ” is not valid in an identifier
7 | e l s e i f (−a + b <= x ) p r i n t f ( ”safe\n ” ) ;
| ^
a.cc:7:47: error: stray '\' in program
7 | e l s e i f (−a + b <= x ) p r i n t f ( ”safe\n ” ) ;
| ^
a.cc:7:50: error: extended character ” is not valid in an identifier
7 | e l s e i f (−a + b <= x ) p r i n t f ( ”safe\n ” ) ;
| ^
a.cc:8:23: error: extended character ” is not valid in an identifier
8 | e l s e p r i n t f ( ”dangerous\n ” ) ;
| ^
a.cc:8:33: error: stray '\' in program
8 | e l s e p r i n t f ( ”dangerous\n ” ) ;
| ^
a.cc:8:36: error: extended character ” is not valid in an identifier
8 | e l s e p r i n t f ( ”dangerous\n ” ) ;
| ^
a.cc: In function 'int main()':
a.cc:5:1: error: 's' was not declared in this scope
5 | s c a n f (”%d%d%d ” , &x , &a , &b ) ;
| ^
a.cc:6:1: error: 'i' was not declared in this scope
6 | i f (−a + b <= 0 ) p r i n t f ( ”delicious\n ” ) ;
| ^
a.cc:7:1: error: 'e' was not declared in this scope
7 | e l s e i f (−a + b <= x ) p r i n t f ( ”safe\n ” ) ;
| ^
a.cc:8:2: error: expected ';' before 'l'
8 | e l s e p r i n t f ( ”dangerous\n ” ) ;
| ^~
| ;
|
s833130186 | p03679 | C++ | #i n cl u d e <s t d i o . h>
i n t main ( )
{
i n t x , a , b ;
s c a n f (”%d%d%d ” , &x , &a , &b ) ;
i f (−a + b <= 0 ) p r i n t f ( ”delicious\n ” ) ;
e l s e i f (−a + b <= x ) p r i n t f ( ”safe\n ” ) ;
e l s e p r i n t f ( ”dangerous\n ” ) ;
return 0;
}
| a.cc:1:2: error: invalid preprocessing directive #i; did you mean #if?
1 | #i n cl u d e <s t d i o . h>
| ^
| if
a.cc:5:12: error: extended character ” is not valid in an identifier
5 | s c a n f (”%d%d%d ” , &x , &a , &b ) ;
| ^
a.cc:5:20: error: extended character ” is not valid in an identifier
5 | s c a n f (”%d%d%d ” , &x , &a , &b ) ;
| ^
a.cc:6:6: error: extended character − is not valid in an identifier
6 | i f (−a + b <= 0 ) p r i n t f ( ”delicious\n ” ) ;
| ^
a.cc:6:34: error: extended character ” is not valid in an identifier
6 | i f (−a + b <= 0 ) p r i n t f ( ”delicious\n ” ) ;
| ^
a.cc:6:44: error: stray '\' in program
6 | i f (−a + b <= 0 ) p r i n t f ( ”delicious\n ” ) ;
| ^
a.cc:6:47: error: extended character ” is not valid in an identifier
6 | i f (−a + b <= 0 ) p r i n t f ( ”delicious\n ” ) ;
| ^
a.cc:7:14: error: extended character − is not valid in an identifier
7 | e l s e i f (−a + b <= x ) p r i n t f ( ”safe\n ” ) ;
| ^
a.cc:7:42: error: extended character ” is not valid in an identifier
7 | e l s e i f (−a + b <= x ) p r i n t f ( ”safe\n ” ) ;
| ^
a.cc:7:47: error: stray '\' in program
7 | e l s e i f (−a + b <= x ) p r i n t f ( ”safe\n ” ) ;
| ^
a.cc:7:50: error: extended character ” is not valid in an identifier
7 | e l s e i f (−a + b <= x ) p r i n t f ( ”safe\n ” ) ;
| ^
a.cc:8:23: error: extended character ” is not valid in an identifier
8 | e l s e p r i n t f ( ”dangerous\n ” ) ;
| ^
a.cc:8:33: error: stray '\' in program
8 | e l s e p r i n t f ( ”dangerous\n ” ) ;
| ^
a.cc:8:36: error: extended character ” is not valid in an identifier
8 | e l s e p r i n t f ( ”dangerous\n ” ) ;
| ^
a.cc:2:1: error: 'i' does not name a type
2 | i n t main ( )
| ^
|
s991275776 | p03679 | C++ | #i n cl u d e <s t d i o . h>
i n t main ( )
{
i n t x , a , b ;
s c a n f (”%d%d%d ” , &x , &a , &b ) ;
i f (−a + b <= 0 ) p r i n t f ( ” d e l i c i o u s \n ” ) ;
e l s e i f (−a + b <= x ) p r i n t f ( ” s a f e \n ” ) ;
e l s e p r i n t f ( ” d an ge r ou s \n ” ) ;
}
| a.cc:1:2: error: invalid preprocessing directive #i; did you mean #if?
1 | #i n cl u d e <s t d i o . h>
| ^
| if
a.cc:5:12: error: extended character ” is not valid in an identifier
5 | s c a n f (”%d%d%d ” , &x , &a , &b ) ;
| ^
a.cc:5:20: error: extended character ” is not valid in an identifier
5 | s c a n f (”%d%d%d ” , &x , &a , &b ) ;
| ^
a.cc:6:6: error: extended character − is not valid in an identifier
6 | i f (−a + b <= 0 ) p r i n t f ( ” d e l i c i o u s \n ” ) ;
| ^
a.cc:6:34: error: extended character ” is not valid in an identifier
6 | i f (−a + b <= 0 ) p r i n t f ( ” d e l i c i o u s \n ” ) ;
| ^
a.cc:6:54: error: stray '\' in program
6 | i f (−a + b <= 0 ) p r i n t f ( ” d e l i c i o u s \n ” ) ;
| ^
a.cc:6:57: error: extended character ” is not valid in an identifier
6 | i f (−a + b <= 0 ) p r i n t f ( ” d e l i c i o u s \n ” ) ;
| ^
a.cc:7:14: error: extended character − is not valid in an identifier
7 | e l s e i f (−a + b <= x ) p r i n t f ( ” s a f e \n ” ) ;
| ^
a.cc:7:42: error: extended character ” is not valid in an identifier
7 | e l s e i f (−a + b <= x ) p r i n t f ( ” s a f e \n ” ) ;
| ^
a.cc:7:52: error: stray '\' in program
7 | e l s e i f (−a + b <= x ) p r i n t f ( ” s a f e \n ” ) ;
| ^
a.cc:7:55: error: extended character ” is not valid in an identifier
7 | e l s e i f (−a + b <= x ) p r i n t f ( ” s a f e \n ” ) ;
| ^
a.cc:8:23: error: extended character ” is not valid in an identifier
8 | e l s e p r i n t f ( ” d an ge r ou s \n ” ) ;
| ^
a.cc:8:40: error: stray '\' in program
8 | e l s e p r i n t f ( ” d an ge r ou s \n ” ) ;
| ^
a.cc:8:43: error: extended character ” is not valid in an identifier
8 | e l s e p r i n t f ( ” d an ge r ou s \n ” ) ;
| ^
a.cc:2:1: error: 'i' does not name a type
2 | i n t main ( )
| ^
|
s386244611 | p03679 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<vector>
#include<string.h>
#include<math.h>
#include<stdio.h>
#include<queue>
#include<utility>
#include<cstdio>
#include<cstring>
#include<new>
#include<new.h>
#include<float.h>
#include<ctype.h>
#include<cfloat>
#include<cmath>
#include<cctype>
#include<errno.h>
#include<cerrno>
#include<memory>
#include<memory.h>
#include<assert.h>
#include<cassert>
#include<deque>
#include<sstream>
#define fo(i,w,n) for(int i=(int) w;i<(int) n;i++)
#define qui queue<int>
#define vit vector<int>
#define ll long long
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define prq priority_queue
#define pii pair<int,int>
#define mp make_pair
#define sz size()
#define em empty()
#define ct continue
#define ms multiset
#define all(a) (a).begin(),(a).end()
#define pf push_front
#define ppf pop_front()
using namespace std;
int main()
{
int a,b,c;cin>>a>>b>>c;
if(b+c<a)cout<<"dangerous";
else if(b+c==a)cout<<"delicious";
else cout<<"safe";
return 0;
} | a.cc:15:9: fatal error: new.h: No such file or directory
15 | #include<new.h>
| ^~~~~~~
compilation terminated.
|
s285157190 | p03679 | C++ | cout<<"dangerous"<<endl;
| a.cc:1:17: error: 'cout' does not name a type
1 | cout<<"dangerous"<<endl;
| ^~~~
|
s904982509 | p03679 | C++ | #include <iostream>
using namespace std;
int main(){
int x,a,b;
cin>>x>>a>>b;
if(a>=b){cout<<"delicious"<<endl;}
else if(a<b&&x>=b-a{cout<<"safe"<<endl;}
else{cout<<"dangerous"<<endl;}
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:22: error: expected ';' before '{' token
7 | else if(a<b&&x>=b-a{cout<<"safe"<<endl;}
| ^
| ;
a.cc:8:3: error: expected primary-expression before 'else'
8 | else{cout<<"dangerous"<<endl;}
| ^~~~
a.cc:7:43: error: expected ')' before 'else'
7 | else if(a<b&&x>=b-a{cout<<"safe"<<endl;}
| ~ ^
| )
8 | else{cout<<"dangerous"<<endl;}
| ~~~~
|
s660550123 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int x,a,b;
cin >> x >> a >> b;
if(a>=b){
cout << "delicious" << endl;
}
else if(a<b && b-a<=x){
cout << "safe" << endl;
}
else if(a<b && b-a>x){
cout << "dangerous" << endl;
}
| a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s449518980 | p03679 | C++ | #include <iostream>
using namespace std;
int main(){
int a, b, c;
cin >> a >> b >> c;
if(b >= c){
cout << "delicious" << endl;
}
else{
if(a+b >= c){
cout << "safe"
}
else{
cout << "dangerous" << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:11:39: error: expected ';' before '}' token
11 | cout << "safe"
| ^
| ;
12 | }
| ~
|
s840714020 | p03679 | C | #include <stdio.h>
int main(){
int a,b,x,y;
scanf("%d %d %d",&x,&a,&b);
y=a+x;
if (a=>b)
{
printf("delicious\n");
}else if (a<b)
{
if (y>=b)
{
printf("safe\n");
}else if (y<b)
{
printf("dengerous\n");
}
}
} | main.c: In function 'main':
main.c:6:15: error: expected expression before '>' token
6 | if (a=>b)
| ^
|
s392114101 | p03679 | C++ | #include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
#include "dbgtoki.hpp"
#define DUMP(i) dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i)
DbgTimer D_t;
#define TSTART() D_t.start()
#define TSTOP() D_t.stop()
#else
#define DUMP(i)
#define TSTART()
#define TSTOP()
#endif
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(s) (s).begin(), (s).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end());
using namespace std;
typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
const int EPS = 1e-9;
int main (){
cin.tie(0);
ios::sync_with_stdio(false);
int r,g,b;
while(cin >> r >> g >> b){
TSTART();
string ans;
if(a >= b)ans = "delicious";
else if(a+x < b)ans = "dangerous";
else ans = "safe";
cout << ans << endl;
TSTOP();
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:37:8: error: 'a' was not declared in this scope
37 | if(a >= b)ans = "delicious";
| ^
a.cc:38:15: error: 'x' was not declared in this scope
38 | else if(a+x < b)ans = "dangerous";
| ^
|
s836342824 | p03679 | C++ | #include <sstream>
#include <iostream>
using namespace std;
int main(){
int x, a, b;
cin >> x >> a >> b;
if (a >=b){
cout << 'delicious' << endl;
} else if(b - a <= x){
cout << 'safe' << endl;
} else{
cout << 'dangerous' << endl;
}
return 0;
] | a.cc:9:13: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
9 | cout << 'delicious' << endl;
| ^~~~~~~~~~~
a.cc:11:13: warning: multi-character character constant [-Wmultichar]
11 | cout << 'safe' << endl;
| ^~~~~~
a.cc:13:13: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
13 | cout << 'dangerous' << endl;
| ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:16:3: error: expected primary-expression before ']' token
16 | ]
| ^
a.cc:16:4: error: expected '}' at end of input
16 | ]
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s286819652 | p03679 | C++ | #include<iostream>
using namespace std;
int main(){
int X, A, B;
cin >> X >> A >> B;
if(B-A>X){
cout << "dangerous";
}else if(B-A>0){
cout << "safe";
}else{
cout << "delicious";
}
}
~
~ | a.cc:20:1: error: expected class-name before '~' token
20 | ~
| ^
|
s996317166 | p03679 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
using namespace std;
typedef long long int lli;
int main(){
int X,A,B;
cin>>X>>A>>B;
if(B-A<=0)cout<<"delicious";
else(B-A<=X)cout<<"safe";
else cout<<"dangerous";
} | a.cc: In function 'int main()':
a.cc:18:21: error: expected ';' before 'cout'
18 | else(B-A<=X)cout<<"safe";
| ^~~~
| ;
a.cc:19:9: error: 'else' without a previous 'if'
19 | else cout<<"dangerous";
| ^~~~
|
s049150260 | p03679 | C++ | #include <stdio.h>
int main()
{
int x,a,b;
scanf("%d%d%d",&x,&a,&b);
if(a>=b){
printf("delicious\n");
}
else if(b-a<=x){
printf("safe\n");
}
else{
printf("dangerous\n"):
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:26: error: expected ';' before ':' token
14 | printf("dangerous\n"):
| ^
| ;
|
s939947638 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
//#define int long long
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;
/* cpp template {{{ */
/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define X real()
#define Y imag()
/* REPmacro */
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define rep(i, n) REPS(i, 0, n)
#define REP0(i,n) for (ll i = 0; i <= (ll)(n); ++i)
#define REP1(i,n) for (ll i = 1; i <= (ll)(n); ++i)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)
/* debug */
#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';
/* alias */
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using D = double;
using P = complex<D>;
using vs = vector<string>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;
/* const */
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;
const D EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; cin >> x; return x;}
inline ll IN() {ll x; cin >> x; return x;}
inline vs split(const string& t, char c) {vs v; stringstream s(t); string b; while(getline(s, b, c)) v.eb(b); return v;}
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template <typename T, typename S> inline void print(const pair<T, S>& p) {cout << p.first << " " << p.second << endl;}
template <typename T> inline void print(const T& x) {cout << x << '\n';}
template <typename T, typename S> inline void print(const vector<pair<T, S>>& v) {for (auto&& p : v) print(p);}
template <typename T> inline void print(const vector<T>& v, string s = " ") {rep(i, v.size()) cout << v[i] << (i != (ll)v.size() - 1 ? s : "\n");}
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
for(T& x: vec) is >> x;
//for(int i=0; i<vec.size(); i++) is >> x[i]; とかでもいいです。
return is;
}
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
for(int i=0; i<vec.size(); i++){
os << vec[i] << ( i+1 == vec.size() ? "" : " " );
}
return os;
}
/* }}} */
signed main()
{
int x,a,b;
cin >> x >> a >> b;
if(b-a<0) print("delicious");
else (b-a<x) print("safe");
else print("dangerous");
return 0;
} | a.cc: In function 'int main()':
a.cc:84:15: error: expected ';' before 'print'
84 | else (b-a<x) print("safe");
| ^~~~~~
| ;
a.cc:85:3: error: 'else' without a previous 'if'
85 | else print("dangerous");
| ^~~~
|
s398456304 | p03679 | C++ | #include <iostream>
using namespace std;
int main(){
int X, A, B;
cin >> X >> A >> B;
if(A>=B) cout << "delicious" << endl;
if(B>A&&(A+X<=B) cout << "safe" << endl;
else cout << "dangerous" <<endl;
} | a.cc: In function 'int main()':
a.cc:8:25: error: expected ';' before 'cout'
8 | if(B>A&&(A+X<=B) cout << "safe" << endl;
| ^~~~~
| ;
a.cc:9:9: error: expected primary-expression before 'else'
9 | else cout << "dangerous" <<endl;
| ^~~~
a.cc:8:49: error: expected ')' before 'else'
8 | if(B>A&&(A+X<=B) cout << "safe" << endl;
| ~ ^
| )
9 | else cout << "dangerous" <<endl;
| ~~~~
|
s455548918 | p03679 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int x, a, b;
cin >> x >> a >> b;
string ans = "dangerous";
if(b<=a) ans = "delicious";
else if(a<b && b<=a+x) ans = "safe";
cout << ans << endl;
return 0;g
}
| a.cc: In function 'int main()':
a.cc:15:12: error: 'g' was not declared in this scope
15 | return 0;g
| ^
|
s153519996 | p03679 | C | #include <stdio.h>
int abs(int n){
if(n<0){
return -1*n;}else
return n;}
int main(void)
{int N,A,M,B,X,C,x,i,a,b,c,l,r,g,b,m,tmp;
scanf("%d%d%d",&X,&A,&B);
if(B<=A){
printf("delicious");}
else if(B<=A+X){
printf("safe");}
else{
printf("dangerous");}
return 0;
}
| main.c: In function 'main':
main.c:7:34: error: redeclaration of 'b' with no linkage
7 | {int N,A,M,B,X,C,x,i,a,b,c,l,r,g,b,m,tmp;
| ^
main.c:7:24: note: previous declaration of 'b' with type 'int'
7 | {int N,A,M,B,X,C,x,i,a,b,c,l,r,g,b,m,tmp;
| ^
|
s404681161 | p03679 | C | #include <stdio.h>
int main(void){
int x,a,b;
scanf("%d %d %d"&x,a,b);
if (b-a<=0){
printf("delicious\n");
}
else if (b-a<x+1){
printf("safe\n");
}
else{
printf("dangerous\n");
}
return 0;
}
| main.c: In function 'main':
main.c:5:19: error: invalid operands to binary & (have 'char *' and 'int')
5 | scanf("%d %d %d"&x,a,b);
| ~~~~~~~~~~^
| |
| char *
|
s386497917 | p03679 | C | #include <stdio.h>
int main(void){
int x,a,b;
scanf("%d %d %d"&x,a,b);
if (b-a<=0){
printf("delicious\n");
else if (b-a<x+1){
printf("safe\n");
}
else{
printf("dangerous\n");
}
return 0;
} | main.c: In function 'main':
main.c:5:19: error: invalid operands to binary & (have 'char *' and 'int')
5 | scanf("%d %d %d"&x,a,b);
| ~~~~~~~~~~^
| |
| char *
main.c:8:3: error: expected '}' before 'else'
8 | else if (b-a<x+1){
| ^~~~
|
s055797694 | p03679 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
if(b <= a){
System.out.println("delisious");
}else if(b-a <= 0 && b-a <= x){
System.out.println("safe");
}else if(b-a <= 0 && b-a >= x){
System.out.println("dangerous");
}
} | Main.java:15: error: reached end of file while parsing
}
^
1 error
|
s493211041 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int x, a, b;
cin >> x >> a >> b;
if(b - a < = x){
cout << "delicious" << endl;
}else if(b - a >= x){
cout << "safe" << endl;
}else{
cout << "dangerous" << endl;
}
} | a.cc: In function 'int main()':
a.cc:7:12: error: expected primary-expression before '=' token
7 | if(b - a < = x){
| ^
|
s191030421 | p03679 | Java | public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
if (b <= a) {
System.out.println("delicious");
return;
}
if (b-a <= x) {
System.out.println("safe");
} else {
System.out.println("dangerous");
}
}
}
| Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s812861474 | p03679 | C++ | #include<bits/stdc++.h>
#define rep(i,a,n) for (int i = a;i < n;i++)
using namespace std;
int main() {
int x, a, b; cin >> x >> a >> b;
if (b - a <= 0) {
cout << "delicious" << endl;
} else if (b - a <= x) {
cout << "safe" << endl;
} else {
cout << "dangerous" << endl;
}
} | a.cc:6:17: error: extended character is not valid in an identifier
6 | int x, a, b; cin >> x >> a >> b;
| ^
a.cc: In function 'int main()':
a.cc:6:17: error: '\U00003000cin' was not declared in this scope
6 | int x, a, b; cin >> x >> a >> b;
| ^~~~~
|
s709474497 | p03679 | C++ | #include<stdio.h>
int main(void)
{
int X,A,B,c;
scanf("%d %d %d",&X,&A,&B);
c=A*-1;
if(B>=c&&B<=0){
printf("delicious\n");
}
if(B>=0&&B=<X){
printf("safe\n");
}
if(B>=X+1){
printf("dangerous\n");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:20: error: expected primary-expression before '<' token
10 | if(B>=0&&B=<X){
| ^
|
s125318354 | p03679 | C++ | #include<stdio.h>
int main(void)
{
int X,A,B,c,d;
scanf("%d %d %d",&X,&A,&B);
c=A*-1;
d=c+B;
if(d=<0){
printf("delicious\n");
}
if(d>=0&&d=<X){
printf("safe\n");
}
if(d>=X+1){
printf("dangerous\n");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:14: error: expected primary-expression before '<' token
8 | if(d=<0){
| ^
a.cc:11:20: error: expected primary-expression before '<' token
11 | if(d>=0&&d=<X){
| ^
|
s317817146 | p03679 | C++ | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define Rep(i, n) for(int i = 0; i < (int)(n); i++)
#define PrintLn(X) cout << X << endl
int main(void)
{
int x, a, b;
cin >> x >> a >> b;
if(b <= a){
PrintLn("delicious")
}else if(b <= a + x){
PrintLn("safe")
}else{
PrintLn("dangerous")
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:9: error: expected ';' before '}' token
14 | }else if(b <= a + x){
| ^
a.cc:16:9: error: expected ';' before '}' token
16 | }else{
| ^
a.cc:18:9: error: expected ';' before '}' token
18 | }
| ^
|
s342602096 | p03679 | Java | mport java.util.Scanner;
public class No3 {
public static void main(String[] args) {
System.out.println("賞味期限の超過許容日数、賞味期限の何日前
に買ってきたか、買ってから何日後に食べたかを入力してください");
System.out.println("例: 5 3 2");
System.out.println("→賞味期限を5日過ぎて食べてもお腹を壊さ
ない");
System.out.println(" 賞味期限の3日前に買ってきた");
System.out.println(" 買ってから2日後に食べた");
System.out.print("input:");
Scanner sc = new Scanner(System.in);
int d = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
sc.close();
if(a >= b){
System.out.println("delicious");
}else if(a >= b - d){
System.out.println("safe");
}else{
System.out.println("dangerous");
}
}
} | Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
Main.java:6: error: unclosed string literal
System.out.println("????????????????????
^
Main.java:7: error: illegal character: '\u3001'
??????????????????????????????");
^
Main.java:7: error: not a statement
??????????????????????????????");
^
Main.java:7: error: unclosed string literal
??????????????????????????????");
^
Main.java:7: error: not a statement
??????????????????????????????");
^
Main.java:9: error: unclosed string literal
System.out.println("??????5?????????????
^
Main.java:10: error: unclosed string literal
??");
^
Main.java:10: error: not a statement
??");
^
9 errors
|
s209149270 | p03679 | C | #include <stdio.h>
int main()
{
int x,a,b;
while (scanf("%d %d %d",&x,&a,&b)!=EOF)
{
if(b-a>x) printf("dangerous\n");
else
{
if(b-a<=x&&b+a!=x)
printf("safe\n");
else
printf("delicious\n")
}
}
} | main.c: In function 'main':
main.c:13:38: error: expected ';' before '}' token
13 | printf("delicious\n")
| ^
| ;
14 | }
| ~
|
s995449558 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
signed main(){
int x,a,b;
scanf("%d%d%d",&x,&a,&b);
if(a-b > x){
puts("dangerous\n");
}
else if(a-b <= x){
puts("delicious\n");
} else {
puts("safe\n");
}
| a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:4:14: note: to match this '{'
4 | signed main(){
| ^
|
s843319335 | p03679 | C++ | # -*- coding: utf-8 -*-
x, a, b = (int(i) for i in input().split())
if a - b >= 0:
print("delicious")
elif a + x - b >= 0:
print("safe")
else:
print("dangerous") | a.cc:1:3: error: invalid preprocessing directive #-
1 | # -*- coding: utf-8 -*-
| ^
a.cc:3:1: error: 'x' does not name a type
3 | x, a, b = (int(i) for i in input().split())
| ^
|
s210980827 | p03679 | C++ | main(N,A){scanf("%d%d",&N,&A);printf("%d",N*N-A);} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(N,A){scanf("%d%d",&N,&A);printf("%d",N*N-A);}
| ^
|
s322563937 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;i++)
#define FORVEC(i, v) for(int i = 0;i < v.size();i++)
#define INF 1000000000
#define pb(a) push_back(a)
#define llong long long
int main(){
int x,a,b;
if(b-a<x){
if(a>b){
cout<<"delicious"<endl;
}else{
cout<<"safe"<<endl;
}
}else{
cout<<"dengerous"<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:18:42: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
18 | cout<<"delicious"<endl;
| ~~~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: couldn't deduce template parameter '_Bi_iter'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: couldn't deduce template parameter '_Bi_iter'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
18 | cout<<"delicious"<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
18 | cout<<"delicious"<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
18 | cout<<"delicious"<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:18:43: note: couldn't deduce template parameter '_CharT'
18 | cout<<"delicious"<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, |
s111290983 | p03679 | C++ | package main
import (
"fmt"
)
func main() {
var x, a, b int
fmt.Scan(&x, &a, &b)
if b-a <= 0 {
fmt.Println("delicious")
} else if b-a <= x {
fmt.Println("safe")
} else {
fmt.Println("dangerous")
}
}
| a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
|
s750187262 | p03679 | C++ | #include<iostream>
using namespace std;
int main(){
#include<iostream>
(ソ^▽^)ナ
(ソ^▽^)ナ🕙 | a.cc:5:4: error: extended character ▽ is not valid in an identifier
5 | (ソ^▽^)ナ
| ^
a.cc:6:4: error: extended character ▽ is not valid in an identifier
6 | (ソ^▽^)ナ🕙
| ^
a.cc: In function 'int main()':
a.cc:5:2: error: '\U0000ff7f' was not declared in this scope
5 | (ソ^▽^)ナ
| ^
a.cc:5:4: error: '\U000025bd' was not declared in this scope
5 | (ソ^▽^)ナ
| ^
a.cc:5:6: error: expected primary-expression before ')' token
5 | (ソ^▽^)ナ
| ^
a.cc:6:10: error: expected '}' at end of input
6 | (ソ^▽^)ナ🕙
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s910604055 | p03679 | C++ | #include <iostream>
using namespace std;
int main()
{
int x,a,b;
cin >> a >> b >> c;
if(a-b<0){
cout << "delicous" << endl;
}else if(a-b>0 || a-b<x){
cout << "safe" << endl;
}else if(a-b>x){
cout << "dangerous" << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:20: error: 'c' was not declared in this scope
8 | cin >> a >> b >> c;
| ^
|
s623069821 | p03679 | C++ | #include <cstdio>
int a, b, x;
int main(){
scanf("%d %d %d", &x, &a, &b);
if(b - a <= x) printf("safe\n")
else if(b - a >= x + 1) printf("dangerous\n");
else printf("delicious\n");
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:36: error: expected ';' before 'else'
8 | if(b - a <= x) printf("safe\n")
| ^
| ;
9 | else if(b - a >= x + 1) printf("dangerous\n");
| ~~~~
|
s754552988 | p03679 | C | #include<stdio.h>
int main(void){
int x,a,b;
scanf("%d %d %d",&x,&a,&b);
if(b-a<=0){
printf("delicious\n");
}
else if(b-a<=X){
printf("safe\n");
}
else
{
printf("dangerous\n");
}
return 0;
}
| main.c: In function 'main':
main.c:11:16: error: 'X' undeclared (first use in this function)
11 | else if(b-a<=X){
| ^
main.c:11:16: note: each undeclared identifier is reported only once for each function it appears in
|
s602292093 | p03679 | C | #include<stdio.h>
int main(void)
{
int x,a,b;
scanf(”%d%d%d”, &x, &a, &b);
if (-a+b <= 0)printf(”delicious\n”);
else if(-a+b <= x)printf(”safe\n”);
else printf (”dangerous\n”);
return 0;
} | main.c: In function 'main':
main.c:5:7: error: stray '\342' in program
5 | scanf(<U+201D>%d%d%d<U+201D>, &x, &a, &b);
| ^~~~~~~~
main.c:5:8: error: expected expression before '%' token
5 | scanf(”%d%d%d”, &x, &a, &b);
| ^
main.c:5:14: error: stray '\342' in program
5 | scanf(<U+201D>%d%d%d<U+201D>, &x, &a, &b);
| ^~~~~~~~
main.c:6:22: error: stray '\342' in program
6 | if (-a+b <= 0)printf(<U+201D>delicious\n<U+201D>);
| ^~~~~~~~
main.c:6:32: error: stray '\' in program
6 | if (-a+b <= 0)printf(”delicious\n”);
| ^
main.c:6:23: error: 'delicious' undeclared (first use in this function)
6 | if (-a+b <= 0)printf(”delicious\n”);
| ^~~~~~~~~
main.c:6:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:32: error: expected ')' before 'n'
6 | if (-a+b <= 0)printf(”delicious\n”);
| ~ ^~
| )
main.c:6:34: error: stray '\342' in program
6 | if (-a+b <= 0)printf(<U+201D>delicious\n<U+201D>);
| ^~~~~~~~
main.c:7:26: error: stray '\342' in program
7 | else if(-a+b <= x)printf(<U+201D>safe\n<U+201D>);
| ^~~~~~~~
main.c:7:31: error: stray '\' in program
7 | else if(-a+b <= x)printf(”safe\n”);
| ^
main.c:7:27: error: 'safe' undeclared (first use in this function)
7 | else if(-a+b <= x)printf(”safe\n”);
| ^~~~
main.c:7:31: error: expected ')' before 'n'
7 | else if(-a+b <= x)printf(”safe\n”);
| ~ ^~
| )
main.c:7:33: error: stray '\342' in program
7 | else if(-a+b <= x)printf(<U+201D>safe\n<U+201D>);
| ^~~~~~~~
main.c:8:14: error: stray '\342' in program
8 | else printf (<U+201D>dangerous\n<U+201D>);
| ^~~~~~~~
main.c:8:24: error: stray '\' in program
8 | else printf (”dangerous\n”);
| ^
main.c:8:15: error: 'dangerous' undeclared (first use in this function)
8 | else printf (”dangerous\n”);
| ^~~~~~~~~
main.c:8:24: error: expected ')' before 'n'
8 | else printf (”dangerous\n”);
| ~ ^~
| )
main.c:8:26: error: stray '\342' in program
8 | else printf (<U+201D>dangerous\n<U+201D>);
| ^~~~~~~~
|
s690405130 | p03679 | C | #include<stdio.h>
int main(void)
{
int x,a,b;
scanf(”%d%d%d”, &x, &a, &b);
if (−a + b <= 0)printf(”delicious\n”);
else if (−a + b <= x)printf(”safe\n”);
else printf (”dangerous\n”);
return 0;
} | main.c: In function 'main':
main.c:5:7: error: stray '\342' in program
5 | scanf(<U+201D>%d%d%d<U+201D>, &x, &a, &b);
| ^~~~~~~~
main.c:5:8: error: expected expression before '%' token
5 | scanf(”%d%d%d”, &x, &a, &b);
| ^
main.c:5:14: error: stray '\342' in program
5 | scanf(<U+201D>%d%d%d<U+201D>, &x, &a, &b);
| ^~~~~~~~
main.c:6:5: error: stray '\342' in program
6 | if (<U+2212>a + b <= 0)printf(<U+201D>delicious\n<U+201D>);
| ^~~~~~~~
main.c:6:24: error: stray '\342' in program
6 | if (<U+2212>a + b <= 0)printf(<U+201D>delicious\n<U+201D>);
| ^~~~~~~~
main.c:6:34: error: stray '\' in program
6 | if (−a + b <= 0)printf(”delicious\n”);
| ^
main.c:6:25: error: 'delicious' undeclared (first use in this function)
6 | if (−a + b <= 0)printf(”delicious\n”);
| ^~~~~~~~~
main.c:6:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:34: error: expected ')' before 'n'
6 | if (−a + b <= 0)printf(”delicious\n”);
| ~ ^~
| )
main.c:6:36: error: stray '\342' in program
6 | if (<U+2212>a + b <= 0)printf(<U+201D>delicious\n<U+201D>);
| ^~~~~~~~
main.c:7:11: error: stray '\342' in program
7 | else if (<U+2212>a + b <= x)printf(<U+201D>safe\n<U+201D>);
| ^~~~~~~~
main.c:7:30: error: stray '\342' in program
7 | else if (<U+2212>a + b <= x)printf(<U+201D>safe\n<U+201D>);
| ^~~~~~~~
main.c:7:35: error: stray '\' in program
7 | else if (−a + b <= x)printf(”safe\n”);
| ^
main.c:7:31: error: 'safe' undeclared (first use in this function)
7 | else if (−a + b <= x)printf(”safe\n”);
| ^~~~
main.c:7:35: error: expected ')' before 'n'
7 | else if (−a + b <= x)printf(”safe\n”);
| ~ ^~
| )
main.c:7:37: error: stray '\342' in program
7 | else if (<U+2212>a + b <= x)printf(<U+201D>safe\n<U+201D>);
| ^~~~~~~~
main.c:8:15: error: stray '\342' in program
8 | else printf (<U+201D>dangerous\n<U+201D>);
| ^~~~~~~~
main.c:8:25: error: stray '\' in program
8 | else printf (”dangerous\n”);
| ^
main.c:8:16: error: 'dangerous' undeclared (first use in this function)
8 | else printf (”dangerous\n”);
| ^~~~~~~~~
main.c:8:25: error: expected ')' before 'n'
8 | else printf (”dangerous\n”);
| ~ ^~
| )
main.c:8:27: error: stray '\342' in program
8 | else printf (<U+201D>dangerous\n<U+201D>);
| ^~~~~~~~
|
s650983891 | p03679 | C | #include<stdio .h>
int main(void)
{
int x,a,b;
scanf(”%d%d%d”, &x, &a, &b);
if (−a + b <= 0)printf(”delicious\n”);
else if (−a + b <= x)printf(”safe\n”);
else printf (”dangerous\n”);
return 0;
} | main.c:1:9: fatal error: stdio .h: No such file or directory
1 | #include<stdio .h>
| ^~~~~~~~~~
compilation terminated.
|
s022394689 | p03679 | C | #include<stdio .h> int main()
{
int x,a,b;
scanf(”%d%d%d”, &x, &a, &b);
if (−a + b <= 0)printf(”delicious\n”); else if (−a + b <= x)printf(”safe\n”); else printf (”dangerous\n”);
} | main.c:1:20: warning: extra tokens at end of #include directive
1 | #include<stdio .h> int main()
| ^~~
main.c:1:9: fatal error: stdio .h: No such file or directory
1 | #include<stdio .h> int main()
| ^~~~~~~~~~
compilation terminated.
|
s482961753 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int x,a,b;
cin >> x >> a >> b;
if(b <= a) cout << "delicious" << endl;;
else if(b <= a+x) cout << "safe" << endl;;
else cout << "dangerous" << endl;;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:3: error: 'else' without a previous 'if'
9 | else if(b <= a+x) cout << "safe" << endl;;
| ^~~~
a.cc:10:3: error: 'else' without a previous 'if'
10 | else cout << "dangerous" << endl;;
| ^~~~
|
s337414119 | p03679 | C++ | #include<iostream>
using namespace std;
int main(){
int x, a, b;
cin >> x >> a >> b;
if (b <= a){
cout << "delicious" << endl;
return 0;
}
else if (b > a){
if (b - a < =x+1){
cout << "safe" << endl;
}
else{
cout << "dangerous" << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:29: error: expected primary-expression before '=' token
11 | if (b - a < =x+1){
| ^
|
s317672497 | p03679 | C++ | #include<iostream>
using namespace std;
int main(){
int x, a, b;
cin >> x >> a >> b;
if (b <= a){
cout << "delicious" << endl;
return 0;
}
else if (b > a){
if (b - a < =x+1){
cout << "safe" << endl;
}
else{
cout << "dangerous" << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:29: error: expected primary-expression before '=' token
11 | if (b - a < =x+1){
| ^
|
s890533734 | p03679 | C++ | #include<iostream>
int main(){
int x,y,z;
cin>>x>>y>>z;
if(z-y>=0){
cout << "delicious" << endl;
}
else if(z-y <= x){
cout << "safe" << endl;
}
else{
cout << "dangerous" << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | cin>>x>>y>>z;
| ^~~
| 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:6:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | cout << "delicious" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:6:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
6 | cout << "delicious" << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | cout << "safe" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:9:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | cout << "safe" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout << "dangerous" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:12:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | cout << "dangerous" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s671637227 | p03679 | C++ | import Data.List
main = putStrLn . solve . map read . words =<< getLine
solve :: [Int] -> String
solve [x, a, b]
| b - a <= 0 = "delicious"
| b - a <= x = "safe"
| otherwise = "dangerous"
| a.cc:1:1: error: 'import' does not name a type
1 | import Data.List
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s837691075 | p03679 | Java | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Mon3 {
public static void main(String[] args) {
int d,A,B;
int min = 1;
Double max = Math.pow(10, 9);
String str;
InputStreamReader inp = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(inp);
try {
str = br.readLine();
d = Integer.parseInt(str);
while(d < min){
System.out.println("1以上の整数を入力してください");
str = br.readLine();
d = Integer.parseInt(str);
}
str = br.readLine();
A = Integer.parseInt(str);
while(max < A){
System.out.println("10^9以下の整数を入力してください");
str = br.readLine();
A = Integer.parseInt(str);
}
str = br.readLine();
B = Integer.parseInt(str);
while(max < A){
System.out.println("10^9以下の整数を入力してください");
str = br.readLine();
B = Integer.parseInt(str);
}
Mon3 mon3 = new Mon3();
mon3.method(d,A,B);
} catch (Exception e) {
System.out.println("数字以外の入力がありました");
e.printStackTrace();
}
}
void method(int d,int A,int B){
int deadLine;
deadLine = -A+B;
if(deadLine <= 0){
System.out.println("delicious");
}
if(0 < deadLine && deadLine <=d ){
System.out.println("Safe");
}
if(d < deadLine ){
System.out.println("dangerous");
}
}
} | Main.java:11: error: class Mon3 is public, should be declared in a file named Mon3.java
public class Mon3 {
^
1 error
|
s334872400 | p03679 | C++ | Ffccv | a.cc:1:1: error: 'Ffccv' does not name a type
1 | Ffccv
| ^~~~~
|
s365760524 | p03679 | C++ | <?php
$stdin = trim(fgets(STDIN));
$pieces = explode(" ", $stdin);
$d = $pieces[0];
$a = $pieces[1];
$b = $pieces[2];
if($a >= $b){
echo "delicious";
}else if($b - $a <= $d){
echo "safe";
}else{
echo "dangerous";
}
?> | a.cc:1:1: error: expected unqualified-id before '<' token
1 | <?php
| ^
a.cc:3:4: error: '$pieces' does not name a type
3 | $pieces = explode(" ", $stdin);
| ^~~~~~~
a.cc:4:4: error: '$d' does not name a type
4 | $d = $pieces[0];
| ^~
a.cc:5:4: error: '$a' does not name a type
5 | $a = $pieces[1];
| ^~
a.cc:6:4: error: '$b' does not name a type
6 | $b = $pieces[2];
| ^~
a.cc:8:4: error: expected unqualified-id before 'if'
8 | if($a >= $b){
| ^~
a.cc:10:5: error: expected unqualified-id before 'else'
10 | }else if($b - $a <= $d){
| ^~~~
a.cc:12:5: error: expected unqualified-id before 'else'
12 | }else{
| ^~~~
a.cc:15:1: error: expected unqualified-id before '?' token
15 | ?>
| ^
|
s887282068 | p03679 | Java | public static void main(String[] args) throws IOException {
// Here your code !
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] lineArray = br.readLine().split(" ", 0);
int d = Integer.parseInt(lineArray[0]);
int a = Integer.parseInt(lineArray[1]);
int b = Integer.parseInt(lineArray[2]);
if (b <= a) {
System.out.println("delicious");
} else if (b <= a + d) {
System.out.println("safe");
} else if (b > a + d) {
System.out.println("dangerous");
}
} | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) throws IOException {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s618788179 | p03679 | Java | public static void main(String[] args) throws IOException {
// Here your code !
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
String[] lineArray = br.readLine().split(" ", 0);
int d = Integer.parseInt(lineArray[0]);
int a = Integer.parseInt(lineArray[1]);
int b = Integer.parseInt(lineArray[2]);
if (b <= a) {
System.out.println("delicious");
} else if (b <= a + d) {
System.out.println("safe");
} else if (b > a + d) {
System.out.println("dangerous");
}
} | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) throws IOException {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s598171527 | p03679 | Java | BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
String[] lineArray = br.readLine().split(" ", 0);
int d = Integer.parseInt(lineArray[0]);
int a = Integer.parseInt(lineArray[1]);
int b = Integer.parseInt(lineArray[2]);
if (b <= a) {
System.out.println("delicious");
} else if (b <= a + d) {
System.out.println("safe");
} else if (b > a + d) {
System.out.println("dangerous");
}
| Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
BufferedReader br = new BufferedReader(new
^
(use --enable-preview to enable unnamed classes)
Main.java:8: error: class, interface, enum, or record expected
if (b <= a) {
^
Main.java:10: error: class, interface, enum, or record expected
} else if (b <= a + d) {
^
Main.java:12: error: class, interface, enum, or record expected
} else if (b > a + d) {
^
Main.java:14: error: class, interface, enum, or record expected
}
^
5 errors
|
s366451999 | p03679 | Java | public static void main(String[] args) throws IOException {
// Here your code !
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
String[] lineArray = br.readLine().split(" ", 0);
int d = Integer.parseInt(lineArray[0]);
int a = Integer.parseInt(lineArray[1]);
int b = Integer.parseInt(lineArray[2]);
if (b <= a) {
System.out.println("delicious");
} else if (b <= a + d) {
System.out.println("safe");
} else if (b > a + d) {
System.out.println("dangerous");
}
} | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) throws IOException {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s837436173 | p03679 | C++ | x,a,b = list(map(int, input().split()))
if b - a <= 0:
print("delicious")
elif b - a <= x:
print("safe")
else:
print("dangerous")
| a.cc:1:1: error: 'x' does not name a type
1 | x,a,b = list(map(int, input().split()))
| ^
|
s672328216 | p03679 | C++ | #include <iostream>
using namespace std;
int main(void){
// Here your code !
int x,a,b,z=0;
cin>>x>>a>>b;
if(x+1+a>b){
if(a-b>0){cout<<"delicious"<<endl;}
if else(a-b==0){cout<<"delicious"<<endl;}
else{cout<<"safe"<<endl;}
}
else{cout<<"dangerous"<<endl;}
}
| a.cc: In function 'int main()':
a.cc:13:12: error: expected '(' before 'else'
13 | if else(a-b==0){cout<<"delicious"<<endl;}
| ^~~~
| (
a.cc:15:13: error: expected '}' before 'else'
15 | else{cout<<"safe"<<endl;}
| ^~~~
a.cc:9:16: note: to match this '{'
9 | if(x+1+a>b){
| ^
a.cc: At global scope:
a.cc:17:5: error: expected unqualified-id before 'else'
17 | else{cout<<"dangerous"<<endl;}
| ^~~~
a.cc:19:5: error: expected declaration before '}' token
19 | }
| ^
|
s982584133 | p03679 | C++ | #include<iostream>
using namespace std;
int main() {
int X , A , B ;
cin >> X >> A >> B ;
if (B<=A) {
cout <<"delicious" ;
}
else if (A<B<=A+X) {
cout <<"safe" ;
}
else {
cout <<"dangerous" ;
}
return 0;
} | a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:5:1: error: extended character is not valid in an identifier
5 |
| ^
a.cc:7:1: error: extended character is not valid in an identifier
7 |
| ^
a.cc:9:1: error: extended character is not valid in an identifier
9 |
| ^
a.cc:13:1: error: extended character is not valid in an identifier
13 |
| ^
a.cc:17:1: error: extended character is not valid in an identifier
17 |
| ^
a.cc:21:1: error: extended character is not valid in an identifier
21 |
| ^
a.cc:3:1: error: '\U000000a0' does not name a type
3 |
| ^
|
s564713992 | p03679 | C++ | #include <iostream>
using namespace std;
int main() {
int X,A,B ;
cin >>X>>A>>B ;
if (B<=A) {
cout <<"delicious"<< endl ;
}
if (A<B<=A+X) {
cout <<"safe"<< endl ;
}
if (B>A+X){
cout <<"dangerous"<< endl ;
}
return 0;
} | a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:5:1: error: extended character is not valid in an identifier
5 |
| ^
a.cc:7:1: error: extended character is not valid in an identifier
7 |
| ^
a.cc:9:1: error: extended character is not valid in an identifier
9 |
| ^
a.cc:13:1: error: extended character is not valid in an identifier
13 |
| ^
a.cc:17:1: error: extended character is not valid in an identifier
17 |
| ^
a.cc:21:1: error: extended character is not valid in an identifier
21 |
| ^
a.cc:3:1: error: '\U000000a0' does not name a type
3 |
| ^
|
s805385387 | p03679 | C++ | #include <iostream>
using namespace std;
int main() {
int X,A,B ;
cin >>X>>A>>B ;
if (B<=A) {
cout <<"delicious"<< endl ;
}
if (A<B<=A+X) {
cout <<"safe"<< endl ;
}
if (B>A+X){
cout >>"dangerous">> endl ;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:6: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [10]')
19 | cout >>"dangerous">> endl ;
| ~~~~ ^~~~~~~~~~~~~
| | |
| | const char [10]
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/string:55,
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/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:19:8: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
19 | cout >>"dangerous">> endl ;
| ^~~~~~~~~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:19:1: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
19 | cout >>"dangerous">> endl ;
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:19:8: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
19 | cout >>"dangerous">> endl ;
| ^~~~~~~~~~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:19:8: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
19 | cout >>"dangerous">> endl ;
| ^~~~~~~~~~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:19:8: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
19 | cout >>"dangerous">> endl ;
| ^~~~~~~~~~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:19:8: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
19 | cout >>"dangerous">> endl ;
| ^~~~~~~~~~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:19:8: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
19 | cout >>"dangerous">> endl ;
| ^~~~~~~~~~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:19:8: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
19 | cout >>"dangerous">> endl ;
| ^~~~~~~~~~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = const char (&)[10]]':
a.cc:19:8: required from here
19 | cout >>"dangerous">> endl ;
| ^~~~~~~~~~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
|
s488570479 | p03679 | C | #include<stdio.h>
int main(){
int X,A,B;
scanf("%d %d %d",X,A,B);
if(A-B>=0){
printf("delicious");
}else if(A-B+X=>0){
printf("safe");
}else{
printf("dangerous");
}
return 0;
} | main.c: In function 'main':
main.c:7:20: error: expected expression before '>' token
7 | }else if(A-B+X=>0){
| ^
|
s329482184 | p03679 | C | #include<stdio.h>
int main(){
long int X,A,B;
scanf("%d %d %d",&X,&A,&B);
if(A-B>=0){
printf("delicious");
}else if(A-B+X=>0){
printf("safe");
}else{
printf("dangerous");
}
return 0;
} | main.c: In function 'main':
main.c:7:20: error: expected expression before '>' token
7 | }else if(A-B+X=>0){
| ^
|
s786880390 | p03679 | C | #include<stdio.h>
int main(){
long int X,A,B;
scanf("%d %d %d",X,A,B);
if(A-B>=0){
printf("delicious");
}else if(A-B+X=>0){
printf("safe");
}else{
printf("dangerous");
}
return 0;
} | main.c: In function 'main':
main.c:7:20: error: expected expression before '>' token
7 | }else if(A-B+X=>0){
| ^
|
s803614662 | p03679 | C++ | #include <stdio.h>
int main(void)
{
int a[3];
char zy[100];
scanf("%d %d %d",&a[0],&a[1],&a[2]);
if(a[2]-a[1]<1){
strcpy(zy,"delicious");
}else if(a[2]-a[1]-a[0]<1){
strcpy(zy,"safe");
}else{
strcpy(zy,"dengerous");
}
printf("%s\n",zy);
} | a.cc: In function 'int main()':
a.cc:9:17: error: 'strcpy' was not declared in this scope
9 | strcpy(zy,"delicious");
| ^~~~~~
a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <stdio.h>
+++ |+#include <cstring>
2 |
a.cc:11:17: error: 'strcpy' was not declared in this scope
11 | strcpy(zy,"safe");
| ^~~~~~
a.cc:11:17: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:13:17: error: 'strcpy' was not declared in this scope
13 | strcpy(zy,"dengerous");
| ^~~~~~
a.cc:13:17: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s776108129 | p03679 | C++ | #include <stdio.h>
int main(void)
{
int a[3];
char zy[100];
scanf("%d %d %d",&a[0],&a[1],&a[2]);
if(a[2]-a[1]<1){
strcpy(zy,"delicious");
}else if(a[2]-[1]-[0]<1){
strcpy(zy,"safe");
}else{
strcpy(zy,"dengerous");
}
printf("%s\n",zy);
} | a.cc: In function 'int main()':
a.cc:9:17: error: 'strcpy' was not declared in this scope
9 | strcpy(zy,"delicious");
| ^~~~~~
a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <stdio.h>
+++ |+#include <cstring>
2 |
a.cc:10:24: error: expected identifier before numeric constant
10 | }else if(a[2]-[1]-[0]<1){
| ^
a.cc: In lambda function:
a.cc:10:26: error: expected '{' before '-' token
10 | }else if(a[2]-[1]-[0]<1){
| ^
a.cc: In function 'int main()':
a.cc:10:22: error: no match for 'operator-' (operand types are 'int' and 'main()::<lambda()>')
10 | }else if(a[2]-[1]-[0]<1){
| ~~~~^~~~
| | |
| | main()::<lambda()>
| int
a.cc:10:28: error: expected identifier before numeric constant
10 | }else if(a[2]-[1]-[0]<1){
| ^
a.cc:10:31: error: expected identifier before numeric constant
10 | }else if(a[2]-[1]-[0]<1){
| ^
a.cc:10:31: error: expected '>' before numeric constant
a.cc: In lambda function:
a.cc:10:32: error: expected '{' before ')' token
10 | }else if(a[2]-[1]-[0]<1){
| ^
a.cc: In function 'int main()':
a.cc:11:17: error: 'strcpy' was not declared in this scope
11 | strcpy(zy,"safe");
| ^~~~~~
a.cc:11:17: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:13:17: error: 'strcpy' was not declared in this scope
13 | strcpy(zy,"dengerous");
| ^~~~~~
a.cc:13:17: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s844734871 | p03679 | C++ | #include <stdio.h>
int main(void)
{
int a[3];
char zy;
scanf("%d %d %d",&a[0],&a[1],&a[2]);
if(a[2]-a[1]<1){
zy =("delicious");
}else if(a[2]-[1]-[0]<1){
zy =("safe");
}else{
zy =("dengerous");
}
printf("%d\n",zy);
} | a.cc: In function 'int main()':
a.cc:9:22: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
9 | zy =("delicious");
| ~^~~~~~~~~~~~
| |
| const char*
a.cc:10:24: error: expected identifier before numeric constant
10 | }else if(a[2]-[1]-[0]<1){
| ^
a.cc: In lambda function:
a.cc:10:26: error: expected '{' before '-' token
10 | }else if(a[2]-[1]-[0]<1){
| ^
a.cc: In function 'int main()':
a.cc:10:22: error: no match for 'operator-' (operand types are 'int' and 'main()::<lambda()>')
10 | }else if(a[2]-[1]-[0]<1){
| ~~~~^~~~
| | |
| | main()::<lambda()>
| int
a.cc:10:28: error: expected identifier before numeric constant
10 | }else if(a[2]-[1]-[0]<1){
| ^
a.cc:10:31: error: expected identifier before numeric constant
10 | }else if(a[2]-[1]-[0]<1){
| ^
a.cc:10:31: error: expected '>' before numeric constant
a.cc: In lambda function:
a.cc:10:32: error: expected '{' before ')' token
10 | }else if(a[2]-[1]-[0]<1){
| ^
a.cc: In function 'int main()':
a.cc:11:22: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
11 | zy =("safe");
| ~^~~~~~~
| |
| const char*
a.cc:13:22: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
13 | zy =("dengerous");
| ~^~~~~~~~~~~~
| |
| const char*
|
s782122652 | p03679 | C | #include<stdio.h>
int main()
{
int x,a,b;
scanf("%d %d %d",&x,&a,&b);
if((a-b)>=0){
printf("delicious\n");
}else if((a+x)<=0){
printf("safe\n");
}else{
printf("dangerous\n");
}
// 出力
printf("%d %s\n",a+b+c,s);
return 0;
} | main.c: In function 'main':
main.c:16:26: error: 'c' undeclared (first use in this function)
16 | printf("%d %s\n",a+b+c,s);
| ^
main.c:16:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:28: error: 's' undeclared (first use in this function)
16 | printf("%d %s\n",a+b+c,s);
| ^
|
s034929764 | p03679 | C | #include<stdio.h>
int main()
{
int x,a,b;
scanf("%d %d %d",&x,&a,&b);
if((a-b)>=0){
printf("delicious\n");
}else if((a+x)=<0){
printf("safe\n");
}else{
printf("dangerous\n");
}
// 出力
printf("%d %s\n",a+b+c,s);
return 0;
} | main.c: In function 'main':
main.c:9:20: error: expected expression before '<' token
9 | }else if((a+x)=<0){
| ^
main.c:16:26: error: 'c' undeclared (first use in this function)
16 | printf("%d %s\n",a+b+c,s);
| ^
main.c:16:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:28: error: 's' undeclared (first use in this function)
16 | printf("%d %s\n",a+b+c,s);
| ^
|
s076906114 | p03679 | C++ | using namespace std;
int32_t main()
{
int32_t x, a, b;
cin >> x >> a >> b;
if (b <= a)
cout << "delicious" << endl;
else if (b <= (a + x))
cout << "dangerous" << endl;
else
cout << "safe" << endl;
return 0;
}
| a.cc:3:1: error: 'int32_t' does not name a type
3 | int32_t main()
| ^~~~~~~
a.cc:1:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
+++ |+#include <cstdint>
1 | using namespace std;
|
s627046539 | p03679 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
for (int i = 0; i<n; i++ ) {
a[i] = sc.nextInt();
}
int b = 1;
int c = 0;
int d = 0; //回数カウンター
//押されたボタンに0を押すような指示を代入 0ボタンを押したら-1を出力
while ( b != 2 ) {
d += 1; //回数カウント
c = b;
b = a[b-1];
if ( b == 0 ) {
System.out.println(-1);
return;
}
a[c-1] = 0;
}
System.out.println(d);
}
} | Main.java:12: error: illegal character: '\u3000'
int d = 0;?//???????
^
Main.java:16: error: illegal character: '\u3000'
d += 1;??//??????
^
Main.java:16: error: illegal character: '\u3000'
d += 1;??//??????
^
3 errors
|
s463587223 | p03679 | C++ | #include <stdio.h>
int main(void){
int a;
int b;
int x;
int c;
scanf("%d%d%d",&x,&a,&b);
c = b-a;
if(x>c){
printf("dangerous");
}else if(c<=0){
printf("delicious);
}else{
printf("safe");
}
} | a.cc:17:11: warning: missing terminating " character
17 | printf("delicious);
| ^
a.cc:17:11: error: missing terminating " character
17 | printf("delicious);
| ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:18:3: error: expected primary-expression before '}' token
18 | }else{
| ^
|
s174959158 | p03679 | C | #include<stdio . h>
int main ()
{
int x , a , b ;
scanf ("%d%d%d" , &x , &a , &b ) ;
i f ( -a+b<= 0)printf("delicious\n");
else if (-a+b<=x)printf("safe\n");
else printf ("dangerous\n");
} | main.c:1:9: fatal error: stdio . h: No such file or directory
1 | #include<stdio . h>
| ^~~~~~~~~~~
compilation terminated.
|
s259052107 | p03679 | C++ | #include <iostream>
using namespace std;
int main()
{
int X,A,B;
cin>>X>>A>>B;
if(X< B-A ){ cout << "dangerous";
else if (B-A>0) cout <<"safe";
else cout << "delicious";
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:8: error: expected '}' before 'else'
10 | else if (B-A>0) cout <<"safe";
| ^~~~
a.cc:9:13: note: to match this '{'
9 | if(X< B-A ){ cout << "dangerous";
| ^
a.cc: At global scope:
a.cc:14:9: error: expected unqualified-id before 'return'
14 | return 0;
| ^~~~~~
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
s174110122 | p03679 | C++ | #include <iostream>
using namespace std;
int main()
{
int X,A,B;
cin>>X>>A>>B;
if(X< B-A ) cout << "dangerous";
elseif(B-A>0) cout <<"safe";
else cout << "delicious";
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:1: error: 'elseif' was not declared in this scope
10 | elseif(B-A>0) cout <<"safe";
| ^~~~~~
a.cc:11:2: error: 'else' without a previous 'if'
11 | else cout << "delicious";
| ^~~~
|
s671168659 | p03679 | C++ | #include <iostream>
using namespace std;
int main()
{
int X,A,B;
cin>>X>>A>>B;
if(X< B-A ) cout << "dangerous";
elseif(B-A>0) cout "safe";
else cout << "delicious";
return 0;
} | a.cc: In function 'int main()':
a.cc:10:1: error: 'elseif' was not declared in this scope
10 | elseif(B-A>0) cout "safe";
| ^~~~~~
a.cc:11:2: error: 'else' without a previous 'if'
11 | else cout << "delicious";
| ^~~~
|
s714903993 | p03679 | C++ | #include <iostream>
using namespace std;
int main()
{
int X,A,B;
cin>>X>>A>>B;
if(X< B-A ) cout << "dangerous";
elseif(B-A>0) cout "safe"
else cout << "delicious";
return 0;
} | a.cc: In function 'int main()':
a.cc:10:1: error: 'elseif' was not declared in this scope
10 | elseif(B-A>0) cout "safe"
| ^~~~~~
|
s058763736 | p03679 | C++ | a,b,c = map(int, input().split())
print('delicious' if c-b<=0 else 'safe' if 0<c-b<=a else 'dangerous')
| a.cc:2:7: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
2 | print('delicious' if c-b<=0 else 'safe' if 0<c-b<=a else 'dangerous')
| ^~~~~~~~~~~
a.cc:2:34: warning: multi-character character constant [-Wmultichar]
2 | print('delicious' if c-b<=0 else 'safe' if 0<c-b<=a else 'dangerous')
| ^~~~~~
a.cc:2:58: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
2 | print('delicious' if c-b<=0 else 'safe' if 0<c-b<=a else 'dangerous')
| ^~~~~~~~~~~
a.cc:1:1: error: 'a' does not name a type
1 | a,b,c = map(int, input().split())
| ^
|
s535215199 | p03679 | C++ | #include<iostream>
using namespace std;
int main(){
int X, A, B;
cin >> X;
cin >> A;
cin >> B;
if(A + B < X) cout << "delicious" << endl;
if(A + B >= X && A + B < X + 1) cout << "safe" << endl;
if(A + B >= X + 1)
} | a.cc: In function 'int main()':
a.cc:15:1: error: expected primary-expression before '}' token
15 | }
| ^
|
s046535289 | p03679 | C | #include <stdio.h>
int main(){
int X, A, B;
scanf("%d", &X);
scanf("%d", &A);
scanf("%d", &B);
int c = X +1 +A;
if(B <= A){
printf("delicious\n");
}else if(B <= c){
printf("safe\n");
}else(c <= B){
printf("dangerous\n");
}
} | main.c: In function 'main':
main.c:12:22: error: expected ';' before '{' token
12 | }else(c <= B){
| ^
| ;
|
s011858568 | p03679 | C | #include<stdio.h>
int main(){
int X,A,B;
scanf("%d %d %d",&X,&A,&B);
if(X>=A && A>=B)printf("delicious\n");
else if(B>=X && X>A)printf("safe\n");
else(B>A && A>=X)printf("dngerous\n");
return 0;
} | main.c: In function 'main':
main.c:11:18: error: expected ';' before 'printf'
11 | else(B>A && A>=X)printf("dngerous\n");
| ^~~~~~
| ;
|
s899619171 | p03679 | C | #include<stdio.h>
int main(){
int X,A,B;
scanf("%d %d %d",&X,&A,&B);
if(X>=A && A>=B)printf("delicious\n");
else if(B>=X && X>A)printf("safe\n");
else(B>A && A>=X)printf("dngerous\n");
return 0;
} | main.c: In function 'main':
main.c:11:18: error: expected ';' before 'printf'
11 | else(B>A && A>=X)printf("dngerous\n");
| ^~~~~~
| ;
|
s705006880 | p03679 | C++ | #include<stdio.h>
int main(){
int X,A,B;
scanf("%d %d %d",&X,&A,&B);
if(X>=A && A>=B)printf("delicious\n");
else if(B>=X && X>A)printf("safe\n");
else(B>A && A>=X)printf("dngerous\n");
return 0;
} | a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before 'printf'
11 | else(B>A && A>=X)printf("dngerous\n");
| ^~~~~~
| ;
|
s224414068 | p03679 | C | /*
高橋君は胃が強いので、賞味期限を X 日まで過ぎた食品を食べてもお腹を壊しません。 賞味期限を X+1 日以上過ぎた食品を食べると、お腹を壊します。
また、賞味期限を過ぎずに食べると、おいしく感じます。そうでない場合、おいしく感じません。
高橋君は、賞味期限の A 日前に食品を買ってきて、買ってから B 日後に食べました。
高橋君が食品をおいしく感じた場合 delicious を、おいしくは感じなかったがお腹は壊さなかった場合 safe を、お腹を壊した場合 dangerous を出力するプログラムを作成してください。
*/
#include<stdio . h>
int main () {
int x , a , b ;
scanf ("%d%d%d" , &x , &a , &b ) ;
if (b-a<=0)
printf("delicious\n");
else if (b-a<=x)
printf("safe\n");
else
printf("dangerous\n");
} | main.c:11:9: fatal error: stdio . h: No such file or directory
11 | #include<stdio . h>
| ^~~~~~~~~~~
compilation terminated.
|
s550105251 | p03679 | Java | public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int x = sc.nextInt(); //賞味期限+x+1日でお腹を壊す
int a = sc.nextInt(); //賞味期限のa日前に買った
int b = sc.nextInt(); //買ってからb日後に食べた
if(b - a > 0){
//賞味期限内に食べた
System.out.println("delicious");
}else if(b - a <= x){
//お腹は壊さない
System.out.println("safe");
}else{
System.out.println("dangerous");
}
}
} | Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s780093257 | p03679 | C++ |
#include<iostream>
#include<Cstring>
using namespace std;
int main() {
int N;
int j = 0;
int b = 1;
int c[100000];
int d = 0;
int a[100000];
cin >> N;
for (int i = 1;i <= N;i++) {
cin >> a[i];
}
while (b != 2 && j<N) {
for (int k = 0;k <= j;k++) {
if (c[k] == b) d = 1;
}
c[j] = b;
if (d == 1) break;
else {
j++;
b = a[b];
}
}
if (d == 0 && j<=N) cout << j << endl;
else cout << "-1" << endl;
} | a.cc:3:9: fatal error: Cstring: No such file or directory
3 | #include<Cstring>
| ^~~~~~~~~
compilation terminated.
|
s719175271 | p03679 | C++ | #include<iostream>
#include<Cstring>
using namespace std;
int main(){
int N;
int j=0;
int b=1;
int c[100000];
int d=0;
int a[100000];
cin>>N;
for(int i=1;i<=N;i++){
cin>>a[i];
}
while(b!=2&&j<N){
c[j]=b;
for(int k=0;k<=j;k++){
if(c[k]==b) d=1;
}
if(d==1) break;
else {
j++;
b=a[b];
}
}
if(d==0&&j<N) cout<<j<<endl;
else cout<<"-1"<<endl;
} | a.cc:2:9: fatal error: Cstring: No such file or directory
2 | #include<Cstring>
| ^~~~~~~~~
compilation terminated.
|
s979900001 | p03679 | C++ | #include <iostream>
#include <vector>
using namespace std;
class Edge {
public:
int from;
int to;
int cost;
Edge(int from, int to, int const): from{from}, to{to}, cost{cost} {}
bool operator<(const Edge& other) {
return this->cost < other.cost;
}
bool operator>(const Edge& other) {
return this->cost > other.cost;
}
};
class UnionFindTree {
public:
vector<int> parent;
UnionFindTree(int size) {
parent.resize((unsigned long) (size + 1));
}
bool isSameSet(int x, int y) {
return findRoot(x) == findRoot(y);
}
void unionSet(int x, int y) {
int xRoot { findRoot(x) };
int yRoot { findRoot(y) };
if (xRoot == yRoot) { return; }
parent[xRoot] = yRoot;
}
int getNumberOfSet() {
int n = 0;
for (int i = 0; parent.size(); ++i) {
if (parent[i] == i) { n++; }
}
return n;
}
private:
int findRoot(int x) {
if (parent[x] == x) {
return x;
}
return parent[x] = findRoot(parent[x]);
}
};
int kruskal(int v, vector<Edge>& edges) {
sort(edges.begin(), edges.end());
UnionFindTree uf(v);
int res { 0 };
for (auto& e : edges) {
if (!uf.isSameSet(e.from, e.to));
res += e.cost;
}
return res;
}
int main() {
int N;
cin >> N;
vector<pair<int, int>> xList((unsigned long) N);
vector<pair<int, int>> yList((unsigned long) N);
for (int i { 0 }; i < N; ++i) {
int x, y;
cin >> x >> y;
xList[i] = { x, i };
yList[i] = { y, i };
}
sort(xList.begin(), xList.end());
sort(yList.begin(), yList.end());
vector<Edge> edges;
for (int i { 1 }; i < N; ++i) {
edges.push_back(Edge(xList[i - 1].second, xList[i].second, abs(xList[i - 1].first - xList[i].first)));
edges.push_back(Edge(xList[i].second, xList[i + 1].second, abs(xList[i].first - xList[i + 1].first)));
edges.push_back(Edge(yList[i - 1].second, yList[i].second, abs(yList[i - 1].first - yList[i].first)));
edges.push_back(Edge(yList[i].second, yList[i + 1].second, abs(yList[i].first - yList[i + 1].first)));
}
cout << kruskal(N, edges) << endl;
return 0;
}
| a.cc: In function 'int kruskal(int, std::vector<Edge>&)':
a.cc:58:5: error: 'sort' was not declared in this scope; did you mean 'short'?
58 | sort(edges.begin(), edges.end());
| ^~~~
| short
a.cc: In function 'int main()':
a.cc:80:5: error: 'sort' was not declared in this scope; did you mean 'short'?
80 | sort(xList.begin(), xList.end());
| ^~~~
| short
|
s537588398 | p03679 | C++ | int main () {
int x, a , b;
scanf("%d%d%d", &x, &a, &b);
if (b - a <= 0) {
printf("delicious\n");
} else if (b - a > x) {
printf("dangerous\n");
} else {
printf("safe\n");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf' was not declared in this scope
5 | scanf("%d%d%d", &x, &a, &b);
| ^~~~~
a.cc:8:17: error: 'printf' was not declared in this scope
8 | printf("delicious\n");
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main () {
a.cc:10:17: error: 'printf' was not declared in this scope
10 | printf("dangerous\n");
| ^~~~~~
a.cc:10:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:12:17: error: 'printf' was not declared in this scope
12 | printf("safe\n");
| ^~~~~~
a.cc:12:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s353835467 | p03679 | C++ | #include <iostream>
using namespace std;
int main(){
int X,A,B;
cin >> X >> A >> b;
if(A > B)
cout << "delicious\n";
else if(A+X < B)
cout << "dangerous\n";
else
cout << "safe\n";
}
| a.cc: In function 'int main()':
a.cc:8:26: error: 'b' was not declared in this scope
8 | cin >> X >> A >> b;
| ^
|
s606554464 | p03679 | Java | import java.io.*;
import java.util.*;
public class Solution{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
int a = scan.nextInt();
int b = scan.nextInt();
scan.close();
if(a>=b){
System.out.println("delicious");
}else if(b-a>=x){
System.out.println("safe");
}else{
System.out.println("dangerous");
}
}
} | Main.java:4: error: class Solution is public, should be declared in a file named Solution.java
public class Solution{
^
1 error
|
s574600163 | p03679 | Java | import java.io.*
import java.util.*
public class Solution{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
int a = scan.nextInt();
int b = scan.nextInt();
scan.close();
if(a>=b){
System.out.println("delicious");
}else if(b-a>=x){
System.out.println("safe");
}else{
System.out.println("dangerous");
}
}
} | Main.java:1: error: ';' expected
import java.io.*
^
Main.java:2: error: ';' expected
import java.util.*
^
2 errors
|
s141310249 | p03679 | Java | public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner scan = new Scanner(System.in);
int X = scan.nextInt();
int A = scan.nextInt();
int B = scan.nextInt();
int delicious = B - A;//(賞味期限を過ぎた日数)
if(X+1 < A){
System.out.println("dangerous");
} else if (delicious < 0) {
System.out.println("delicious");
} else {
System.out.println("safe");
}
}
}
| Main.java:5: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s458218849 | p03679 | Java | public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner scan = new Scanner(System.in);
int X = scan.nextInt();
int A = scan.nextInt();
int B = scan.nextInt();
int delicious = B - A;//(賞味期限を過ぎた日数)
if(X+1 < A){
System.out.println("dangerous");
} else if (delicious < 0) {
System.out.println("delicious");
} else {
System.out.println("safe");
}
}
}
| Main.java:5: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.