submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s222778221 | p03679 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class MainA {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine()... | Main.java:6: error: class MainA is public, should be declared in a file named MainA.java
public class MainA {
^
1 error
|
s945235453 | p03679 | C++ | sima0222-MBP:lecture sima0222$ cat expired.cpp
#include <iostream>
int main() {
int x, a, b;
std::cin >> x >> a >> b;
if (a >= b) {
std::cout << "delicious" << std::endl;
} else if (a + x >= b) {
std::cout << "safe" << std::endl;
} else {
std::cout << "dangerous" << std::endl;
}
return 0;
}
| a.cc:1:1: error: 'sima0222' does not name a type
1 | sima0222-MBP:lecture sima0222$ cat expired.cpp
| ^~~~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/... |
s395949901 | p03679 | C++ | sima0222-MBP:lecture sima0222$ cat expired.cpp
#include <iostream>
int main() {
int x, a, b;
std::cin >> x >> a >> b;
if (a >= b) {
std::cout << "delicious" << std::endl;
} else if (a + x >= b) {
std::cout << "safe" << std::endl;
} else {
std::cout << "dangerous" << std::endl;
}
}
| a.cc:1:1: error: 'sima0222' does not name a type
1 | sima0222-MBP:lecture sima0222$ cat expired.cpp
| ^~~~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/... |
s676468567 | 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 ” ) ;
} | main.c: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
main.c:2:1: error: unknown type name 'i'
2 | i n t main ( )
| ^
main.c:2:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 't'
2 | i n t main ( )
| ... |
s742239658 | p03679 | C++ | #i n cl u d e <bits/stdc++.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 <bits/stdc++.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 vali... |
s214908575 | p03679 | C++ | #include<iostream>
using namespace std;
int main()
{
int X,A,B;
cin >> X >> A >> B;
if (X < B - A)
{
cout << "dangerous" << endl;
}
else if (X == B - A)
{
cout << "delicious" << endl;
}
else if (A > B)
{
cout << "delicious" << endl;
}
else if (B - A == 0)
{
cout << "delicious" << endl;
}
els... | a.cc: In function 'int main()':
a.cc:28:12: error: expected '}' at end of input
28 | return 0;
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s743752211 | p03679 | C++ | #include<iostream>
using namespace std;
int main()
{
int X,A,B;
cin >> X >> A >> B;
C = B - A;
if (X < C)
{
cout << "dangerous" << endl;
}
else if (X == B - A)
{
cout << "delicious" << endl;
}
else if (A > B)
{
cout << "delicious" << endl;
}
else (X > B - A)
{
cout << "safe" << endl;
}
... | a.cc: In function 'int main()':
a.cc:7:9: error: 'C' was not declared in this scope
7 | C = B - A;
| ^
a.cc:21:21: error: expected ';' before '{' token
21 | else (X > B - A)
| ^
| ;
22 | {
| ~ ... |
s579471482 | p03679 | C | #include <stdio.h>
int main() {
int a, b, c;
scanf_s("%d%d%d",&a,&b,&c);
if (b -c >= 0) {
printf("delicious");
}else if (c - b <= a) {
printf("safe");
}
else {
printf("dangerous");
}
return 0;
} | main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
4 | scanf_s("%d%d%d",&a,&b,&c);
| ^~~~~~~
| scanf
|
s113050159 | p03679 | C | #include <stdio.h>
int main() {
int a, b, c;
scanf("%d%d%d",&a,&b&c);
if (b -c >= 0) {
printf("delicious");
}else if (c - b <= X) {
printf("safe");
}
else {
printf("dangerous");
}
return 0;
} | main.c: In function 'main':
main.c:4:29: error: invalid operands to binary & (have 'int *' and 'int')
4 | scanf("%d%d%d",&a,&b&c);
| ~~^
| |
| int *
main.c:7:28: error: 'X' undeclared (first use in this function)... |
s077933772 | p03679 | C | #include <stdio.h>
int main() {
int X, A, B;
scanf_s("%d %d %d",&X,&A,&B);
if (B - A >= 0) {
printf("delicious");
}else if (A - B <= X) {
printf("safe");
}
else {
printf("dangerous");
}
scanf_s("%d", &X);
return 0;
}
} | main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
4 | scanf_s("%d %d %d",&X,&A,&B);
| ^~~~~~~
| scanf
main.c: At top level:
main.c:16:1: error: expected identifier or '(' before '}' t... |
s882264760 | p03679 | C | #include <stdio.h>
int main() {
int X, A, B;
scanf_s("%d %d %d",&X,&A,&B);
if (B - A >= 0) {
printf("delicious");
}else if (A - B <= X) {
printf("safe");
}
else {
printf("dangerous");
}
scanf_s("%d", &X);
return 0;
} | main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
4 | scanf_s("%d %d %d",&X,&A,&B);
| ^~~~~~~
| scanf
|
s308461938 | p03679 | C | #include <stdio.h>
int main() {
int X, A, B;
scanf_s("%d %d %d",&X,&A,&B);
if (B - A >= 0) {
printf("delicious");
}else if (A - B <= X) {
printf("safe");
}
else {
printf("dangerous");
}
scanf_s("%d", &X);
return 0;
} | main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
4 | scanf_s("%d %d %d",&X,&A,&B);
| ^~~~~~~
| scanf
|
s316196001 | p03679 | C | #include <stdio.h>
int main() {
int X, A, B;
scanf_s("%d %d %d",&X,&A,&B);
if (B - A >= 0) {
printf("delicious");
}else if (A - B <= X) {
printf("safe");
}
else {
printf("dangerous");
}
return 0;
} | main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
4 | scanf_s("%d %d %d",&X,&A,&B);
| ^~~~~~~
| scanf
|
s133309255 | p03679 | C | #include <stdio.h>
#include <stdlib.h>
int main(void)
{
int x, a, b, ;
int A;
scanf("%d", &x);
scanf("%d", &a);
scanf("%d", &b);
if(a>=b){
printf("delicious\n");
return 0;
}
else{
if(x>=b-a){
printf("safe\n");
return 0;
}
... | main.c: In function 'main':
main.c:5:16: error: expected identifier or '(' before ';' token
5 | int x, a, b, ;
| ^
|
s373144069 | p03679 | Java | import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Scanner;
public class Main {
static Scanner sc;
public static void main(String[] args)throws Exception{
InputStream in = System.in;
sc = new Scanner(in);
while(true){
int a, b, x;
x = sc.nextInt();
a = sc.nextInt();
b = s... | Main.java:28: error: illegal start of statement
}
^
Main.java:27: error: 'else' without 'if'
} else
^
Main.java:30: error: reached end of file while parsing
}
^
3 errors
|
s843704029 | p03679 | Java | import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Scanner;
public class Main {
static Scanner sc;
public static void main(String[] args)throws Exception{
InputStream in = System.in;
sc = new Scanner(in);
while(true){
int a, b, x;
x = sc.nextInt();
a = sc.nextInt();
b = s... | Main.java:30: error: reached end of file while parsing
}
^
1 error
|
s671713529 | p03679 | C | // 170613_test.cpp : メイン プロジェクト ファイルです。
#include "stdafx.h"
#include "stdio.h"
using namespace System;
int main()
{
int x,a,b;
//char s[101];
// 整数の入力
scanf("%d %d %d", &x,&a,&b);
if (b <= a) {
printf("delicious");
} else if (b > a && b <= x) {
printf("safe");
} else {
printf("dangerous");
... | main.c:3:10: fatal error: stdafx.h: No such file or directory
3 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s738438273 | p03679 | C | // 170613_test.cpp : メイン プロジェクト ファイルです。
#include "stdafx.h"
#include "stdio.h"
using namespace System;
int main()
{
int x,a,b;
//char s[101];
// 整数の入力
scanf("%d %d %d", &x,&a,&b);
if (b <= a) {
printf("delicious");
} else if (b > a && b <= x) {
printf("safe");
} else {
printf("dangerous");
... | main.c:3:10: fatal error: stdafx.h: No such file or directory
3 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s402014684 | p03679 | Java | import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Scanner;
public class main {
static Scanner sc;
public static void main(String[] args)throws Exception{
InputStream in = System.in;
//InputStream in = new FileInputStream("/Users/icpc2016/Downloads/input");
//InputStream in = new File... | Main.java:5: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s297734851 | p03679 | C | #include <stdio.h>
int main(){
int X,A,B;
scanf("%d %d %d",&X,&A,&B);
if(B<=A){
printf("delicious\n");
}
if((A<B) && (B<=X+A)){
printf("safe\n");
}
if(B>X+A){
printf("dangerous\n");
}
return0;
}
| main.c: In function 'main':
main.c:15:2: error: 'return0' undeclared (first use in this function)
15 | return0;
| ^~~~~~~
main.c:15:2: note: each undeclared identifier is reported only once for each function it appears in
|
s784009588 | p03679 | Java | import java.util.*;
public class Main{
public static void main{
int x,a,b;
Scanner sc=new Scanner(System.in);
x=sc.nextInt();
a=sc.nextInt();
b=sc.nextInt();
if(b-a>0&&b-a<x)
System.out.println("safe");
else... | Main.java:3: error: '(' expected
public static void main{
^
1 error
|
s791082829 | p03679 | Java | public class Main{
| Main.java:1: error: reached end of file while parsing
public class Main{
^
1 error
|
s679215567 | p03679 | Java | import java.util.Scanner;
public class MainA {
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 < 0) {
System.out.println("delicious");
} else if (B - A <= X ) {
System.out.println("safe");
} el... | Main.java:3: error: class MainA is public, should be declared in a file named MainA.java
public class MainA {
^
1 error
|
s577555128 | p03679 | C++ | import java.util.*;
class Experied{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
int keika = b-a;
if(b<=a){ //x<=b-a
System.out.println("delicious");
}else if(b<=a+x){
System.out.println("safe");
... | 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:15: error: expected ':' before 'static'
3 | public static void main(String[] args) {
| ^~~~~~~
| :
a.cc:3... |
s467113340 | p03679 | C++ | wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww... | a.cc:1:1: error: 'wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww... |
s934767714 | p03679 | C++ | aa
| a.cc:1:1: error: 'aa' does not name a type
1 | aa
| ^~
|
s948128994 | p03679 | C++ | #include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <sstream>
#include <deque>
#define ll long long
using namespace std;
const int maxn=100000;
int a[maxn];
int main(){
memset(a,0,sizeof(a));
int N,
cin... | a.cc: In function 'int main()':
a.cc:20:12: error: expected initializer before '>>' token
20 | cin>>N;
| ^~
|
s687624600 | p03679 | C++ | #include<stdio.h>
int main(){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(b<=a) printf("delicious\n");
else if(b>a+b) prnitf("dangerous\n");
else puts("safe");
return 0;
} | a.cc: In function 'int main()':
a.cc:5:7: error: unable to find string literal operator 'operator""\U0000ff0c' with 'const char [7]', 'long unsigned int' arguments
5 | scanf("%d%d%d",&a,&b,&c);
| ^~~~~~~~~~
a.cc:7:16: error: 'prnitf' was not declared in this scope; did you mean 'printf'?
7 | else if... |
s390727707 | p03679 | C++ | #include<iostream>
using namespace std;
long X,A,B;
int main(){
scanf("%d %d %d",&X,&A,&B);
if(a-b >= 0) printf("delicious\n");
else if(X +a-b>= 0) printf("safe\n");
else printf("dangerous\n");
return 0;
} | a.cc: In function 'int main()':
a.cc:10:12: error: 'a' was not declared in this scope
10 | if(a-b >= 0) printf("delicious\n");
| ^
a.cc:10:14: error: 'b' was not declared in this scope
10 | if(a-b >= 0) printf("delicious\n");
| ^
|
s405176067 | p03679 | C++ | #include<iostream>
using namespace std;
int X,A,B;
int main(){
scanf("%d %d %d",&X,&A,&B);
int c=a-b;
if(c >= 0) printf("delicious\n");
else if(X +c>= 0) printf("safe\n");
else printf("dangerous\n");
return 0;
} | a.cc: In function 'int main()':
a.cc:8:21: error: 'a' was not declared in this scope
8 | int c=a-b;
| ^
a.cc:8:23: error: 'b' was not declared in this scope
8 | int c=a-b;
| ^
|
s026504107 | p03679 | C++ | #include<cstdio>
int X,A,B;
int main(){
scanf("%d %d %d",&X,&A,&B);
if(a-b >= 0) printf("delicious\n");
else if(X + a-b>= 0) printf("safe\n");
else printf("dangerous\n");
return 0;
} | a.cc: In function 'int main()':
a.cc:9:12: error: 'a' was not declared in this scope
9 | if(a-b >= 0) printf("delicious\n");
| ^
a.cc:9:14: error: 'b' was not declared in this scope
9 | if(a-b >= 0) printf("delicious\n");
| ^
|
s314973948 | p03679 | C++ | X A B | a.cc:1:1: error: 'X' does not name a type
1 | X A B
| ^
|
s924818398 | p03679 | Java | import java.util.*;
import java.lang.*;
import java.io.*;
public class Mian{
public static void main (String[] args) throws java.lang.Exception {
InputReader in = new InputReader(System.in);
PrintWriter w = new PrintWriter(System.out);
long x = in.nextLong(), a = in.nextLong(), b = in.next... | Main.java:5: error: class Mian is public, should be declared in a file named Mian.java
public class Mian{
^
1 error
|
s893372606 | p03679 | C | #include <stdio.h>long amari = 1e9 + 7;long long int fact(int in){ long long int out=1, i; for(i=1; i<=in; ++i){ out *= i; out = out%amari; } return out;}int main(void){ int n, m; long long int na, ma; scanf("%d%d", &n, &m); if (n-m > 1 || m-n >1) { printf("%d\n", 0); return 0; } na = fact(n); m... | main.c:1:19: warning: extra tokens at end of #include directive
1 | #include <stdio.h>long amari = 1e9 + 7;long long int fact(int in){ long long int out=1, i; for(i=1; i<=in; ++i){ out *= i; out = out%amari; } return out;}int main(void){ int n, m; long long int na, ma; scanf("%d%d", &n, &m); if (n-m ... |
s699601307 | p03679 | C++ | #include <iostream>
using namespace std;
int main ()
{
long long x,a,b;
scanf("%d%d%d",&x,&a,&b);
if(b-a<1) cout<<"delicious"<<endl;
else if (b>a&&(b-a)<()x+1)) cout<<"safe"<<endl;
else if(b>a&&b-a>=x) cout<<"dangerous"<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:31: error: expected primary-expression before ')' token
8 | else if (b>a&&(b-a)<()x+1)) cout<<"safe"<<endl;
| ^
a.cc:8:32: error: expected ')' before 'x'
8 | else if (b>a&&(b-a)<()x+1)) cout<<"safe"<<endl;
| ... |
s382857594 | p03679 | Java | public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String str = scan.nextLine();
String temp[] = str.split(" ");
int a = new Integer(temp[1]);
int b = new Integer(temp[2]);
int x = new Integer(temp[0]);
if((a - b)< 0){
... | Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:6: warning: [removal] Int... |
s884050712 | p03679 | C++ | #include<iostream>
using namespace std;
int main()
{
int x,a,b;
cin >> x >> a >> b;
if(a-b>=0) { cout << "delicious" << endl; }
else(a-b<0){
if(b-a>x) { cout << "dengerous" << endl; }
else if(b-a<=x) { cout << "safe" << endl; }
else {}
}
else{}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:16: error: expected ';' before '{' token
9 | else(a-b<0){
| ^
| ;
a.cc:14:5: error: 'else' without a previous 'if'
14 | else{}
| ^~~~
|
s706230208 | p03679 | C++ | int main()
{
int x,a,b;
if(b<=a)
cout<<"delicious";
else if(b-a<=x)
cout<<"safe";
else if(b-a>x)
cout<<"dangerous";
return 0;
} | a.cc:2:1: error: expected initializer before '\U0000ff5b'
2 | {
| ^~
a.cc:4:1: error: expected unqualified-id before 'if'
4 | if(b<=a)
| ^~
a.cc:6:1: error: expected unqualified-id before 'else'
6 | else if(b-a<=x)
| ^~~~
a.cc:8:1: error: expected unqualified-id before 'else'
8 | else ... |
s089879454 | p03679 | C | #include<stdio.h>
int main(void){
int X,A,B
scanf("%d", &X);
scanf("%d", &A);
scanf("%d", &B);
if (B < A) {
printf("delicious");
}else if (B < A+X+1){
printf("safe");
}else{
printf("dangerous");
}
} | main.c: In function 'main':
main.c:5:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
5 | scanf("%d", &X);
| ^~~~~
main.c:7:22: error: 'B' undeclared (first use in this function)
7 | scanf("%d", &B);
| ^
main.c:7:22: note: each un... |
s236709847 | 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 (s + a >= b)
cout << "safe" << endl;
else
cout << "dangerous" << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:21: error: 's' was not declared in this scope
12 | if (s + a >= b)
| ^
|
s771486731 | p03679 | Java | import java.util.*;
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();
String [] S = {"delicious","safe","dangerous"}
System.out.println(S[judge(X,A,B)]);... | Main.java:9: error: ';' expected
String [] S = {"delicious","safe","dangerous"}
^
1 error
|
s570300665 | p03679 | C++ | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
int main()
{
long long x,a,b;
while(scanf("%lld%lld%lld",&x,&a,&b)!=EOF){
if((b-a)>x)printf("dangerous\n");
else ((b-a)<x&&(b-a)<=0)printf("delicious\n");
else ((b-a)<x&&(b-a)>0)printf("safe\n");
}
retu... | a.cc: In function 'int main()':
a.cc:11:33: error: expected ';' before 'printf'
11 | else ((b-a)<x&&(b-a)<=0)printf("delicious\n");
| ^~~~~~
| ;
a.cc:12:9: error: 'else' without a previous 'if'
12 | else ((b-a)<x&&(b-a)>0)... |
s824377570 | p03679 | C | #include<stdio.h>
int main()
{
int X,A,B;
scanf("%d %d %d",&X,&A,&B);
if(B<=A) printf("delicious\n");
if(X+A>=B&&B>A) printf("safe\n");
if(X+A<B)prntf("dangerous\n");
}
| main.c: In function 'main':
main.c:8:18: error: implicit declaration of function 'prntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
8 | if(X+A<B)prntf("dangerous\n");
| ^~~~~
| printf
|
s271714126 | p03679 | C | #include<stdio.h>
int main()
{
int X,A,B;
while(scanf("%d%d%d",&X,&A,&B)!=EOF)
{
if(B<=A) printf("delicious\n");
if(X+A)>=B&&B>A) printf("safe\n");
if(X+A<B)prntf("dangerous\n");
}
}
| main.c: In function 'main':
main.c:8:16: error: expected expression before '>=' token
8 | if(X+A)>=B&&B>A) printf("safe\n");
| ^~
main.c:8:24: error: expected statement before ')' token
8 | if(X+A)>=B&&B>A) printf("safe\n");
| ^
main.c:9:18: erro... |
s385149641 | p03679 | C++ | delicious | a.cc:1:1: error: 'delicious' does not name a type
1 | delicious
| ^~~~~~~~~
|
s205650649 | p03679 | Java | public class Main {
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
int x = Integer.parseInt(scan.next());//賞味期限を X 日まで過ぎた食品を食べてもお腹を壊しません
int a = Integer.parseInt(scan.next());//賞味期限の A 日前
int b = Integer.parseInt(scan.next());//買ってから B 日後
if(a <= b){//賞味期限または期限を過ぎている
int ... | Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s362376446 | p03679 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;
int x,a,b;
int main(){
cin >> x>>a>>b;
if((b-a)>x)cout << "dangerous"<<endl;
else if(b=<a) cout << "delicious"<< endl;
else cout << "safe"<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:13: error: expected primary-expression before '<' token
15 | else if(b=<a) cout << "delicious"<< endl;
| ^
|
s367561440 | p03679 | C++ | File Edit Options Buffers Tools C++ Help
#include <iostream>
using namespace std;
int main(){
int x,a,b;
cin >> x >> a >> b;
if( b <= a){
cout << "delicious" << endl;
}else if( x+1 <= b-a ){
cout << "dangerous" << endl;
}else{
cout << "safe" << endl;
}
return 0;
}
| a.cc:1:1: error: 'File' does not name a type
1 | File Edit Options Buffers Tools C++ Help
| ^~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
... |
s871597263 | p03679 | Java | import java.util.*;
public static void Main(String args[]){
Scanner scan = new Scanner(System.in);
int x = Integer.parseInt(scan.next());//賞味期限を X 日まで過ぎた食品を食べてもお腹を壊しません
int a = Integer.parseInt(scan.next());;//賞味期限の A 日前
int b = Integer.parseInt(scan.next());;//買ってから B 日後
if(a <= b){//賞味期限または期限を過ぎている
in... | Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static void Main(String args[]){
^
(use --enable-preview to enable unnamed classes)
1 error
|
s262158625 | p03679 | Java |
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
InputReader s = new InputReader(System.in);
PrintWriter out = new PrintWriter(System.out);
/*My code starts here.*/
int n = s.nextInt();
boolean arr[] = new boolean[n+1];
int inp[] = new int[n+1];
for(in... | Main.java:56: error: cannot find symbol
comb = new long[MAXN][MAXN];
^
symbol: variable comb
location: class Main
Main.java:56: error: cannot find symbol
comb = new long[MAXN][MAXN];
^
symbol: variable MAXN
location: class Main
Main.java:56: error: cannot find symbol
comb = new lon... |
s150545266 | p03679 | C++ | /*
AUTHOR:hruday pabbisetty
NIT ROURKElA(My_College_Sucks)
*/
#include <bits/stdc++.h>
using namespace std;
#define opt ios_base::sync_with_stdio(0)
#define lli long long int
#define ulli unsigned long long int
#define I int
#define S string
#define D double
#define rep(i,a,b) for(i=a;i<b;i++)
#define repr(i,a,... | a.cc:47:9: warning: "nl" redefined
47 | #define nl cout<<"\n"
| ^~
a.cc:23:9: note: this is the location of the previous definition
23 | #define nl printf("\n")
| ^~
a.cc: In function 'int main()':
a.cc:93:2: error: expected '}' at end of input
93 | }
| ^
a.cc:74:1: note: to ... |
s127073621 | p03679 | C++ | //all possible//
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,i;
cin>>a>>b>>c;
if((a-b+c)<=a)
cout<<"delicious";
else
if((a-(a-b+c))<=a)
cout<<"safe";
else
}
| a.cc: In function 'int main()':
a.cc:17:1: error: expected primary-expression before '}' token
17 | }
| ^
|
s581652199 | 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<=c-b)
cout<<"safe"<<endl;
else
cout<<"dangerous"<<endl;
retrun 0;
} | a.cc: In function 'int main()':
a.cc:16:1: error: 'retrun' was not declared in this scope
16 | retrun 0;
| ^~~~~~
|
s808048746 | p03679 | C++ | #include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int x, a, b;
while (cin>>x>>a>>b)
{
if (a >= b) cout << "delicious"<<endl;
else if (a < b)
{
if (b - a < =x) cout << "safe" << endl;
else if (b - a > x) cout << "dangerous" << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:37: error: expected primary-expression before '=' token
12 | if (b - a < =x) cout << "safe" << endl;
| ^
|
s993045226 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
#define forn(i, s, f) for(int i = (s); i <= (f); ++i)
#define for1(i, f, s) for(int i = (f); i >= (s); --i)
#define fora(i, x) for (auto i : x)
#define show(x) cout << #x << " = " << x << " ";
#define skip continue;
#define pb push_back
#define _1 first
#define _2 second
... | a.cc:27:11: error: expected initializer before 'x'
27 | int main()x
| ^
|
s026533434 | p03679 | C++ | #include<stdio.h>
#include<stdlib.h>
int main()
{
int a, b x;
scanf("%d %d %d", &x, &a,&b);
if((x+a)-b>=0){
if(a>b){
printf("delisious");
} else {
printf("safe");
}
} else {
printf("dangerous");
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:18: error: expected initializer before 'x'
6 | int a, b x;
| ^
a.cc:7:28: error: 'x' was not declared in this scope
7 | scanf("%d %d %d", &x, &a,&b);
| ^
a.cc:7:35: error: 'b' was not declared in this ... |
s090651931 | p03679 | C++ | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <climits>
#include <ctime>
const int len = 100010;
int n,x,a,b;
int main() {
//freopen("test.in","r",stdin);
//freopen("test.out","w",stdout);
cin >> x >> a >> b;
n = -a+b;
if ... | a.cc: In function 'int main()':
a.cc:16:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
16 | cin >> x >> a >> b;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; /... |
s790344237 | p03679 | C++ | #include<iostream>
using namespace std
int main()
{
int a[3];
cin>>a[0]>>a[1]>>a[2];
if(a[2]-a[1]>a[0])
cout<<"dangerous"<<endl;
if(a[0]=>a[1])
cout<<"delicious"<<endl;
else cout<<"safe"<<endl;
return 0;
}
| a.cc:3:20: error: expected ';' before 'int'
3 | using namespace std
| ^
| ;
4 |
5 | int main()
| ~~~
a.cc: In function 'int main()':
a.cc:11:12: error: expected primary-expression before '>' token
11 | if(a[0]=>a[1])
| ... |
s668999578 | p03679 | Java | public void main(int X, int A, int B) {
if(A + X >= B) {
if(A >= B)
System.out.println("delicious");
else
System.out.println("safe");
else
System.out.println("dangerous");
}
} | An exception has occurred in the compiler (21.0.9). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compi... |
s977694437 | p03679 | C++ | #include<stdio.h>
#include<stdlib.h>
int main()
{
int a, b x;
scanf("%d %d %d", x, a,b);
if((x+a)-b>=0){
if(a>b){
printf("delisious");
} else {
printf("safe");
}
} else {
printf("dangerous");
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:18: error: expected initializer before 'x'
6 | int a, b x;
| ^
a.cc:7:27: error: 'x' was not declared in this scope
7 | scanf("%d %d %d", x, a,b);
| ^
a.cc:7:32: error: 'b' was not declared in this scop... |
s386636730 | p03679 | C++ | #include <cstdio>
using namespace std::
int main(void)
{
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:5:1: error: expected identifier before 'int'
5 | int main(void)
| ^~~
a.cc:3:22: error: expected ';' before 'int'
3 | using namespace std::
| ^
| ;
4 |
5 | int main(void)
| ~~~
a.cc: In function 'int main()':
a.cc... |
s314388579 | p03679 | Java | import java.util.Scanner;
/**
* Created by dizzyvn on 6/24/17.
*/
public class A {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
int z = b - a;
if (z < 0) {
... | Main.java:6: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s326650028 | p03679 | C++ | #include <stdio.h>
int main(void)
{
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:13:33: error: expected ';' before '}' token
13 | printf("safe\n")
| ^
| ;
14 | }
| ~
|
s928332024 | p03679 | C++ | #include <iostream>
using namespace std;
int main()
{
int x,a,b;
cin >> x >> a >> b;
if(a <= b){
cout <<"delicious\n";
}elif(b-a <= x){
cout <<"safe\n";
}else{
cout << "dangerous\n";
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:4: error: 'elif' was not declared in this scope
10 | }elif(b-a <= x){
| ^~~~
a.cc:12:4: error: 'else' without a previous 'if'
12 | }else{
| ^~~~
|
s627909463 | p03679 | C | #include <stdio.h>
int main(void)
{
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;
} | main.c: In function 'main':
main.c:13:33: error: expected ';' before '}' token
13 | printf("safe\n")
| ^
| ;
14 | }
| ~
|
s412841634 | p03679 | Java | import java.util.Scanner;
/**
* Created by dizzyvn on 6/24/17.
*/
public class A {
public static void Main(String[] args){
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
int z = b - a;
if (z < 0) {
... | Main.java:6: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s334680176 | p03679 | C | #include <stdio.h>
int main(void)
{
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;
} | main.c: In function 'main':
main.c:13:33: error: expected ';' before '}' token
13 | printf("safe\n")
| ^
| ;
14 | }
| ~
|
s556746273 | p03679 | Java | public class Main{
public static void main(String[] args){
new Main().solve();
}
void solve(){
Scanner sc=new Scanner(System.in);
int X=sc.nextInt();
int A=sc.nextInt();
int B=sc.nextInt();
if(A>=B){
System.out.println("delicious");
}else if(B-A<=X){
System.out.println("safe");
}else{
Sys... | Main.java:8: error: cannot find symbol
Scanner sc=new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:8: error: cannot find symbol
Scanner sc=new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s659822912 | p03679 | C++ | def main(argv)
(x, a, b) = STDIN.gets.chomp.split(' ').map(&:to_i)
if b <= a then
STDOUT.puts 'delicious'
elsif b <= x + a then
STDOUT.puts 'safe'
else
STDOUT.puts 'dangerous'
end
end
if self.to_s == 'main' then
main(ARGV)
end | a.cc:4:17: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
4 | STDOUT.puts 'delicious'
| ^~~~~~~~~~~
a.cc:6:17: warning: multi-character character constant [-Wmultichar]
6 | STDOUT.puts 'safe'
| ^~~~~~
a.cc:8:17: warning: multi... |
s018428269 | p03679 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sys/time.h>
#include <cmath>
using namespace std;
void solve(int x, int a, int b) {
if (b =< a) {
std::cout << "delicious" << std::endl;
} else if(b =< a+x){
std::cout <... | a.cc: In function 'void solve(int, int, int)':
a.cc:13:12: error: expected primary-expression before '<' token
13 | if (b =< a) {
| ^
a.cc:15:18: error: expected primary-expression before '<' token
15 | } else if(b =< a+x){
| ^
|
s160698202 | p03679 | C++ | #include <iostream>
using namespace std;
int main(void){
int q,w,e;
cin>>q>>w>.e;
if(q+w<=e){
if(e-w>=0)
cout<<"delicious";
else
cout<<"safe";
}else
cout<<"dangerous";
}
| a.cc: In function 'int main()':
a.cc:5:15: error: expected primary-expression before '.' token
5 | cin>>q>>w>.e;
| ^
|
s221337459 | p03679 | C++ | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vetor>
#include <algorithm>
#include <climits>
#include <ctime>
const int len = 100010;
int n,x,a,b;
int main() {
//freopen("test.in","r",stdin);
//freopen("test.out","w",stdout);
cin >... | a.cc:7:10: fatal error: vetor: No such file or directory
7 | #include <vetor>
| ^~~~~~~
compilation terminated.
|
s009392331 | p03680 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin>>N;
vector<int> a(N);
vector<int> b(N);
for(int i=0;i<N;i++)
cin>>a.at(i);
int c=0;
int k=0;
int s=1;
while(true) {
s=a.at(s-1);
c++;
if(s==2) {
cout<<c<<endl;
break;
}
for(int i=0;i<N;i++) {
... | a.cc: In function 'int main()':
a.cc:27:6: error: expected '}' at end of input
27 | }
| ^
a.cc:14:15: note: to match this '{'
14 | while(true) {
| ^
a.cc:27:6: error: expected '}' at end of input
27 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main(... |
s631560563 | p03680 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
map<int,int> a;
for(int i=1;i<=n;i++) cin >> a[i]
bool flag=false;
int num=0;
int i=1;
int j=1;
while(a[i]>0){
num++;
j=i;
if(a[j]==2){
flag=true;
break;
}
else {
j=a[i];
a[i]=-1;
i=j;
}
... | a.cc: In function 'int main()':
a.cc:8:34: error: expected ';' before 'bool'
8 | for(int i=1;i<=n;i++) cin >> a[i]
| ^
| ;
9 | bool flag=false;
| ~~~~
a.cc:17:13: error: 'flag' was not declared in t... |
s389279971 | p03680 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, a = 1, b = 0;
cin >> N;
vector<int> vec(N + 1);
for (int i = 1; i <= N; i++)
cin >> vec.at(i);
while (true){
if (vec.at(a) == 0){
cout << -1 << endl;
break;
}
if (vec.at(a) == 2){
b++;
cout << b << endl;... | a.cc: In function 'int main()':
a.cc:23:4: error: expected '}' at end of input
23 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s242436063 | p03680 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, a = 1, b = 0;
cin >> N;
vector<int> vec(N + 1);
for (int i = 1; i <= N; i++)
cin >> vec.at(i);
while (true){
if (vec.at(a) == 0){
cout << -1 << endl;
break;
}
if (vec.at(a) == 2){
b++;
cout << b << endl;... | a.cc: In function 'int main()':
a.cc:22:4: error: expected '}' at end of input
22 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s193910555 | p03680 | C++ | #include <bits/stdc++.h>
using namespace std;
int main (){
int N;
cin>>N;
vector<int> train(N);
for(i=0;i<N;i++){
cin>>train.at(i);
}
int s=train.at(0);
int n=0;
for(int i=0;i<N;i++){
s=train.at(s-1);
n++;
if(s==2){
cout<<n<<endl;
break;
}
else if(i==N-1){
cout<... | a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
7 | for(i=0;i<N;i++){
| ^
|
s366777357 | p03680 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n); for(ll i = 0; i < (ll)n; i++)
int main() {
ll n; cin >> n;
vector<int> p(n+1);
for(int i=1; i<=n; i++) cin >> p[i];
int a = 1; int cnt = 0;
vector<bool> v(n+1,false);
rep(i, n){
if(a == 2) ... | a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:7:12: note: to match this '{'
7 | int main() {
| ^
|
s351834087 | p03680 | Java | import java.util.*; import java.io.*; import java.math.*;
public class Main{
//Don't have to see. start------------------------------------------
static class InputIterator{
ArrayList<String> inputLine = new ArrayList<String>(1024);
int index = 0; int max; String read;
InputIterator(){
BufferedReader br = ne... | Main.java:79: error: cannot find symbol
HashSet<Inetger> accessed = new HashSet<Inetger>();
^
symbol: class Inetger
location: class Main
Main.java:79: error: cannot find symbol
HashSet<Inetger> accessed = new HashSet<Inetger>();
^
symbol: class Inetger
... |
s547103229 | p03680 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
int i;
for(i=0;i<n;i++){
cin >> a.at(i);
}
int current = 1;
int count = 0;
vector<int> push(n);
for(i=0;i<n;i++){
current--;
if(a.at(current) == 2){
count++;
break;
}
else if... | a.cc: In function 'int main()':
a.cc:31:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
31 | cout >> count >> endl;
| ~~~~ ^~ ~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:31:8: no... |
s229823691 | p03680 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
int i;
for(i=0;i<n;i++){
cin >> a.at(i);
}
int current = 1;
int count = 0;
vector<int> push(n);
for(i=0;i<n;i++){
current--;
if(a.at(current) == 2){
count++;
break;
}
else if... | a.cc: In function 'int main()':
a.cc:28:30: error: expected ';' before '}' token
28 | current = a.at(current)
| ^
| ;
29 | }
| ~
a.cc:31:8: error: no match for 'operator>>' (operand types are 'std::o... |
s521104005 | p03680 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N);
for (int i; i < N; i++){
cin >> A.at(i) >> endl;
}
int here = 1;
for (int i = 0; i < N + 10; i++){
if (here == 2){
cout << i << endl;
break;
}
else{
here = A.at(i-1);
... | a.cc: In function 'int main()':
a.cc:10:20: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
10 | cin >> A.at(i) >> endl;
| ~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/inclu... |
s456556798 | p03680 | C++ | # 入力
N=int(input())
l=[]
for i in range(N):
l.append(int(input()))
# 押してない:0
# 押した:1
l2=[0]*N
# 1番目は「押した:1」にしておく
l2[0]=1
# 回数カウント
c=0
i=1
while True:
# 回数をインクリメント
c+=1
# 次のボタン番号を取得
i=l[i-1]
# 2番目のライトが光る場合は回数を出力して終了
if i==2:
print(c)
exit()
if l2[i-1]==1:
# 無限ループ確定で終了
print(-1)
... | a.cc:1:3: error: invalid preprocessing directive #\U00005165\U0000529b
1 | # 入力
| ^~~~
a.cc:8:3: error: invalid preprocessing directive #\U000062bc\U00003057\U00003066\U0000306a\U00003044\U0000ff1a0
8 | # 押してない:0
| ^~~~~~~~~~~~~
a.cc:9:3: error: invalid preprocessing directive #\U000062bc\U00003... |
s620725055 | p03680 | Java | import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.nextLine());
ArrayList<Integer> a = new ArrayList<>();
for (int i=0; i<N; i++){
a.add(Integer.parseInt(sc.nextLine()));
}
... | Main.java:14: error: incompatible types: int cannot be converted to boolean
while (1){
^
1 error
|
s633806513 | p03680 | Java | import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.nextLine());
ArrayList<Integer> a = new ArrayList<>();
for (int i=0; i<N; i++){
a.add(Integer.parseInt(sc.nextLine()));
}
... | Main.java:13: error: ';' expected
int push = 1
^
1 error
|
s364822941 | p03680 | C++ | #include "pch.h"
#include <iostream>
#include <vector>
using namespace std;
void end() {
cout << "-1" << endl;
}
int main() {
int n, count = 0, x = 0;
cin >> n;
vector <int> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
for (int i = 0; i < n; i++) {
x = a.at(i);
count++;
if (x == 2) {
cout... | a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s240942073 | p03680 | C++ | #include "pch.h"
#include <iostream>
#include <vector>
using namespace std;
void end() {
cout << "-1" << endl;
}
int main() {
int n, count = 0, x = 0;
cin >> n;
vector <int> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
for (int i = 0; i < n; i++) {
x = a.at(i);
count++;
if (x == 2) {
cout... | a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s821905149 | p03680 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int>a(n);
for(int i = 0; i < n; i++)cin >> a[i];
int count = 0;
int n = 0;
while(1){
count++;
if(a[a[n]] == 1){
cout << -1 << endl;
break;
}else if(a[a[n]] == 2){
cout <<... | a.cc: In function 'int main()':
a.cc:11:8: error: redeclaration of 'int n'
11 | int n = 0;
| ^
a.cc:6:8: note: 'int n' previously declared here
6 | int n;
| ^
|
s138612167 | p03680 | C++ | /*
author : nishi5451
created : 14.08.2020 13:18:13
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;
int main(){
int n;
cin >> n;
vector<int> a(n+1);
vector<bool> dp(n+1,false);
for(int i=1; i<=n; i++) cin >> a[i];
int... | a.cc: In function 'int main()':
a.cc:23:21: error: 'i' was not declared in this scope
23 | cout << i << endl;
| ^
|
s685990233 | p03680 | C++ | using namespace std;
int main() {
int N;
cin >> N;
vector<int> vec(N);
int a = 1;
for (int i = 0; i < N; i++) {
cin >> vec.at(i);
}
for (int i = 0; i < N + 1; i++) {
a = vec.at(a - 1);
if (a == 2) {
a = i + 1;
cout << a << endl;
a = -1;
break;
}
}
if... | a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
5 | cin >> N;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:6:3: error: 'vector... |
s214369845 | p03680 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> vec(N);
int a = 1;
for (int i = 0; i < N; i++) {
cin >> vec.at(i);
}
for (int i = 0; i < N + 1; i++) {
a = vec.at(a - 1);
if (a == 2) {
a = i + 1;
cout << a << endl;
a = -1;
... | a.cc:27:1: error: expected declaration before '}' token
27 | }
| ^
|
s186605061 | p03680 | C++ | #include <bits/stdc++.h>
using namespace std;
int a[100050];
int main()
{
cin.tie(0);
ios::sync_with_stdio(0);
int n;
cin>>n;
for(int i=0;i<n;i++)cin>>a[i];
int c=1;
int cnt=0;
while(int i=0;i<n;i++)
{
if(c==a[c-1])
{
c=1;
bre... | a.cc: In function 'int main()':
a.cc:19:18: error: expected ')' before ';' token
19 | while(int i=0;i<n;i++)
| ~ ^
| )
a.cc:19:19: error: 'i' was not declared in this scope
19 | while(int i=0;i<n;i++)
| ^
|
s129622370 | p03680 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int N;
cin >> N ;
int A[N];
for (int i=0 ; i<N ; i++){
cin >> A[i];
}
int count=0;
for (int c=1 ; c != 2 ;){
c=A[c]
count++;
if (count = N){
cout << -1 << endl;
return 0;
}
}
cout << count << endl ;
}
| a.cc: In function 'int main()':
a.cc:13:10: error: expected ';' before 'count'
13 | c=A[c]
| ^
| ;
14 | count++;
| ~~~~~
|
s012690113 | p03680 | C++ | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
vector<int>a(n);
for(int i=0; i<n; i++){
cin >> a[i];
}
int cnt = 1, p = 1;
while(cnt<n){
p = a[p-1];
if(p==2){
break;
}
cnt++;
}
if(p==2){
cout << cnt <<... | a.cc: In function 'int main()':
a.cc:6:5: error: 'vector' was not declared in this scope
6 | vector<int>a(n);
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include <iostream>
+++ |+#include <vector>
2 | usi... |
s743475066 | p03680 | C++ | include<iostream>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
int n, i = 0,ans=1,m;
cin >> n;
vector <int>a(n),k(n)... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __g... |
s633010876 | p03680 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> buttons(N);
for (int n = 0; n < N; n++) {
int bottunNum;
cin >> bottunNum;
buttons.at(n) = bottunNum;
}
vector<int> pushed;
for (int n = 0; n < N; n++) {
if (n == 0) {
pushed.push_back(but... | a.cc: In function 'int main()':
a.cc:20:7: error: 'now' was not declared in this scope; did you mean 'pow'?
20 | now = pushed.at(n-1);
| ^~~
| pow
|
s669545399 | p03680 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<stack>
#include<queue>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int maxn = 100010;
int n,m,s,u,v;
int dis[maxn],vis[maxn];
priority_queue<P,vector<P>,greater<P> > q;
int h[maxn],size;... | a.cc: In function 'void add(int, int, ll)':
a.cc:25:13: error: reference to 'size' is ambiguous
25 | e[++size].to = v;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bi... |
s624446090 | p03680 | C++ | #include<bits/stdc++.h>
using namespace std;
int button(int n,int a[]){
int ret=0;
int light=a[0];
a[0]=0;
ret++;
while(light!=2&&light!=0){
int k;
k=a[light];
a[light]=0;
light=k;
ret++;
}
if(light==0) return -1;
if(light==2) return ret;
}*/
int... | a.cc:19:3: error: expected unqualified-id before '/' token
19 | }*/
| ^
a.cc: In function 'int button(int, int*)':
a.cc:19:1: warning: control reaches end of non-void function [-Wreturn-type]
19 | }*/
| ^
|
s380056480 | p03680 | C++ | #include<bits/stdc++.h>
using namespace std;
int button(int n,int a[]){
int ret=0;
int light=a[0];
a[0]=0;
ret++;
while(light!=2&&light!=0){
int k;
k=a[light];
a[light]=0;
light=k;
ret++;
}
if(light==0) return -1;
if(light==2) return ret;
}
int m... | a.cc: In function 'int main()':
a.cc:24:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
24 | if(button(n,but!=-1){
| ~~~^~~~
a.cc:24:20: error: cannot convert 'bool' to 'int*'
24 | if(button(n,but!=-1){
| ~~~^~~~
| ... |
s007164174 | p03680 | C++ | #include<bits/stdc++.h>
using namespace std;
int button(int n, vector<int> &a(n)){
int ret=0;
int light=a(n).at(0);
a(n).at(0)=0;
ret++;
while(light!=2&&light!=0){
int k;
k=a(n).at(light);
a(n).at(light)=0;
light=k;
ret++;
}
if(light==0) return -1;
... | a.cc:3:33: error: expected ',' or '...' before '(' token
3 | int button(int n, vector<int> &a(n)){
| ^
a.cc: In function 'int button(int, std::vector<int>&)':
a.cc:5:16: error: no match for call to '(std::vector<int>) (int&)'
5 | int light=a(n).at(0);
| ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.