submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s367519909
|
p00036
|
Java
|
import java.util.*;
class Main{
public static void main(String args[]){
Scanner s=new Scanner(System.in);
while(s.hasNext()){
char [][] a=new char[20][20];
for(int i=0;i<20;i++)
for(int j=0;j<20;j++)
a[i][j]='0';
for(int i=0;i<8;i++){
String now=s.next();
for(int j=0;j<8;j++)
a[i][j]=now.charAt(j);
}
char ans=' ';
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
if(a[i][j]=='1'&&a[i][j+1]=='1'&&a[i+1][j]=='1'&&a[i+1][j+1]=='1')ans='A';
if(a[i][j]=='1'&&a[i+1][j]=='1'&&a[i+2][j]=='1'&&a[i+3][j]=='1')ans='B';
if(a[i][j]=='1'&&a[i][j+1]=='1'&&a[i][j+2]=='1'&&a[i][j+3]=='1')ans='C';
if(a[i][j+1]=='1'&&a[i+1][j+1]=='1'&&a[i+1][j]=='1'&&a[i+2][j]=='1')ans='D';
if(a[i][j]=='1'&&a[i][j+1]=='1'&&a[i+1][j+1]=='1'&&a[i+1][j+2]=='1')ans='E';
if(a[i][j]=='1'&&a[i+1][j]=='1'&&a[i+1][j+1]=='1'&&a[i+2][j+1]=='1')ans='F';
if(a[i][j+1]=='1'&&a[i][j+2]=='1'&&a[i+1][j+1]=='1'&&a[i+1][j]=='1')ans='G';
}
}
System.out.println(""+ans);
}
}
}
|
Main.java:2: error: illegal character: '\u00a0'
?
^
Main.java:3: error: class, interface, enum, or record expected
class Main{
^
Main.java:4: error: illegal character: '\u00a0'
????public static void main(String args[]){
^
Main.java:4: error: illegal character: '\u00a0'
????public static void main(String args[]){
^
Main.java:4: error: illegal character: '\u00a0'
????public static void main(String args[]){
^
Main.java:4: error: illegal character: '\u00a0'
????public static void main(String args[]){
^
Main.java:5: error: illegal character: '\u00a0'
????????Scanner s=new Scanner(System.in);
^
Main.java:5: error: illegal character: '\u00a0'
????????Scanner s=new Scanner(System.in);
^
Main.java:5: error: illegal character: '\u00a0'
????????Scanner s=new Scanner(System.in);
^
Main.java:5: error: illegal character: '\u00a0'
????????Scanner s=new Scanner(System.in);
^
Main.java:5: error: illegal character: '\u00a0'
????????Scanner s=new Scanner(System.in);
^
Main.java:5: error: illegal character: '\u00a0'
????????Scanner s=new Scanner(System.in);
^
Main.java:5: error: illegal character: '\u00a0'
????????Scanner s=new Scanner(System.in);
^
Main.java:5: error: illegal character: '\u00a0'
????????Scanner s=new Scanner(System.in);
^
Main.java:6: error: illegal character: '\u00a0'
????????while(s.hasNext()){
^
Main.java:6: error: illegal character: '\u00a0'
????????while(s.hasNext()){
^
Main.java:6: error: illegal character: '\u00a0'
????????while(s.hasNext()){
^
Main.java:6: error: illegal character: '\u00a0'
????????while(s.hasNext()){
^
Main.java:6: error: illegal character: '\u00a0'
????????while(s.hasNext()){
^
Main.java:6: error: illegal character: '\u00a0'
????????while(s.hasNext()){
^
Main.java:6: error: illegal character: '\u00a0'
????????while(s.hasNext()){
^
Main.java:6: error: illegal character: '\u00a0'
????????while(s.hasNext()){
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:7: error: illegal character: '\u00a0'
????????????char [][] a=new char[20][20];
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:8: error: illegal character: '\u00a0'
????????????for(int i=0;i<20;i++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:9: error: illegal character: '\u00a0'
????????????????for(int j=0;j<20;j++)
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:10: error: illegal character: '\u00a0'
????????????????????a[i][j]='0';
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:11: error: illegal character: '\u00a0'
????????????for(int i=0;i<8;i++){
^
Main.java:12: error: illegal character: '\u00a0'
????????????????String now=s.next();
^
Main.java:12: error: illegal character: '\u00a0'
????????????????String now=s.next();
^
Main.java:12: error: illegal character: '\u00a0'
????????????????String now=s.next();
^
Main.java:12: error: illegal character: '\u00a0'
????????????????String now=s.next();
^
Main.java:12: error: illegal character: '\u00a0'
????????????????String now=s.next();
^
Main.java:12: error: illegal character: '\u00a0'
????????????????String now=s.next();
^
100 errors
only showing the first 100 errors, of 405 total; use -Xmaxerrs if you would like to see more
|
s123474484
|
p00036
|
Java
|
import java.util.Scanner;
public class Maih {
static int[][] a;
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
while(cin.hasNext()){
a = new int[30][30];
int x=0, y=0;
boolean flag = false;
for(int i = 5; i < 5+8;i++){
String str = cin.next();
for(int j = 5; j < 5+8;j++){
a[i][j]=str.charAt(j-5)-'0';
if(a[i][j]==1&&!flag){
flag=true;
x=i;y=j;
}
}
}
// A
if(a[x][y]+a[x][y+1]+a[x+1][y]+a[x+1][y+1]==4){
System.out.println("A");
continue;
}
//B
if(a[x][y]+a[x+1][y]+a[x+2][y]+a[x+3][y]==4){
System.out.println("B");
continue;
}
//C
if(a[x][y]+a[x][y+1]+a[x][y+2]+a[x][y+3]==4){
System.out.println("C");
continue;
}
//D
if(a[x][y]+a[x+1][y]+a[x+1][y-1]+a[x+2][y-1]==4){
System.out.println("D");
continue;
}
//E
if(a[x][y]+a[x][y+1]+a[x+1][y+1]+a[x+1][y+2]==4){
System.out.println("E");
continue;
}
//G
if(a[x][y]+a[x][y+1]+a[x+1][y-1]+a[x+1][y]==4){
System.out.println("G");
continue;
}
}
}
}
|
Main.java:3: error: class Maih is public, should be declared in a file named Maih.java
public class Maih {
^
1 error
|
s722771576
|
p00036
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class P0036 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = "";
char[][] plane = new char[8][8];
int i = 0;
while ((line = br.readLine()) != null) {
if (line.length() == 8) {
for (int j = 0; j < 8; j++) {
plane[i][j] = line.charAt(j);
}
i++;
}
if (i == 8) {
int[] top = getTop(plane);
if (isA(plane, top)) {
System.out.println("A");
} else if (isB(plane, top)) {
System.out.println("B");
} else if (isC(plane, top)) {
System.out.println("C");
} else if (isD(plane, top)) {
System.out.println("D");
} else if (isE(plane, top)) {
System.out.println("E");
} else if (isF(plane, top)) {
System.out.println("F");
} else if (isG(plane, top)) {
System.out.println("G");
} else {
System.out.println("What?");
}
i = 0;
}
}
}
public static int[] getTop(char[][] plane) {
int r = -1;// row
int c = -1;// column
outer: for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (plane[i][j] == '1') {
r = i;
c = j;
break outer;
}
}
}
return new int[] { r, c };
}
public static boolean isA(char[][] plane, int[] top) {
int r = top[0];// row
int c = top[1];// column
if (plane[r][c] == '1')
if (plane[r][c + 1] == '1')
if (plane[r + 1][c] == '1')
if (plane[r + 1][c + 1] == '1')
return true;
return false;
}
public static boolean isB(char[][] plane, int[] top) {
int r = top[0];// row
int c = top[1];// column
if (plane[r][c] == '1')
if (plane[r + 1][c] == '1')
if (plane[r + 2][c] == '1')
if (plane[r + 3][c] == '1')
return true;
return false;
}
public static boolean isC(char[][] plane, int[] top) {
int r = top[0];// row
int c = top[1];// column
if (plane[r][c] == '1')
if (plane[r][c + 1] == '1')
if (plane[r][c + 2] == '1')
if (plane[r][c + 3] == '1')
return true;
return false;
}
public static boolean isD(char[][] plane, int[] top) {
int r = top[0];// row
int c = top[1];// column
if (plane[r][c] == '1')
if (plane[r + 1][c - 1] == '1')
if (plane[r + 1][c] == '1')
if (plane[r + 2][c - 1] == '1')
return true;
return false;
}
public static boolean isE(char[][] plane, int[] top) {
int r = top[0];// row
int c = top[1];// column
if (plane[r][c] == '1')
if (plane[r][c + 1] == '1')
if (plane[r + 1][c + 1] == '1')
if (plane[r + 1][c + 2] == '1')
return true;
return false;
}
public static boolean isF(char[][] plane, int[] top) {
int r = top[0];// row
int c = top[1];// column
if (plane[r][c] == '1')
if (plane[r + 1][c] == '1')
if (plane[r + 1][c + 1] == '1')
if (plane[r + 2][c + 1] == '1')
return true;
return false;
}
public static boolean isG(char[][] plane, int[] top) {
int r = top[0];// row
int c = top[1];// column
if (plane[r][c] == '1')
if (plane[r][c + 1] == '1')
if (plane[r + 1][c - 1] == '1')
if (plane[r + 1][c] == '1')
return true;
return false;
}
}
|
Main.java:5: error: class P0036 is public, should be declared in a file named P0036.java
public class P0036 {
^
1 error
|
s186587162
|
p00036
|
Java
|
import java.util.*;
class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
String out = "";
int[][] board = new int[20][20];
int[] hp = new int[8];
int[] vp = new int[8];
int row = 4;
int twoCnt = 0;
while (scanner.hasNext()) {
String line = scanner.nextLine();
if (line.length() != 8) {
for (int ii = 0; ii < 8; ii++) {
if (hp[ii] == 4) {
out += "C\n";
break;
}
if (vp[ii] == 4) {
out += "B\n";
break;
}
if (hp[ii] == 2) {
twoCnt++;
}
if (vp[ii] == 2) {
twoCnt++;
}
}
if (twoCnt == 4) {
out += "A\n";
}
boolean isResolve = false;
for (int ii = 4; ii < 4 + 8; ii++) {
for (int jj = 4; jj < 4 + 8; jj++) {
if (board[ii][jj] == 1 && board[ii + 1][jj + 2] == 1) {
out += "E\n";
isResolve = true;
break;
}
if (board[ii][jj] == 1 && board[ii + 2][jj + 1] == 1) {
out += "F\n";
isResolve = true;
break;
}
if (board[ii][jj] == 1 && board[ii + 1][jj - 2] == 1) {
out += "G\n";
isResolve = true;
break;
}
if (board[ii][jj] == 1 && board[ii + 2][jj - 1] == 1) {
out += "D\n";
isResolve = true;
break;
}
}
if (isResolve) {
break;
}
}
row = 4;
twoCnt = 0;
for (int ii = 4; ii < 4 + 8; ii++) {
hp[ii - 4] = 0;
vp[ii - 4] = 0;
for (int jj = 4; jj < 4 + 8; jj++) {
board[ii][jj] = 0;
}
}
continue;
}
for (int ii = 4; ii < 4 + 8; ii++) {
char p = line.charAt(ii - 4);
if (p == '0') {
board[row][ii] = 0;
} else {
board[row][ii] = 1;
}
hp[row - 4] += board[row][ii];
vp[ii - 4] += board[row][ii];
}
row++;
}
for (int ii = 0; ii < 8; ii++) {
if (hp[ii] == 4) {
out += "C\n";
break;
}
if (vp[ii] == 4) {
out += "B\n";
break;
}
if (hp[ii] == 2) {
twoCnt++;
}
if (vp[ii] == 2) {
twoCnt++;
}
}
if (twoCnt == 4) {
out += "A\n";
}
boolean isResolve = false;
for (int ii = 4; ii < 4 + 8; ii++) {
for (int jj = 4; jj < 4 + 8; jj++) {
if (board[ii][jj] == 1 && board[ii + 1][jj + 2] == 1) {
out += "E\n";
isResolve = true;
break;
}
if (board[ii][jj] == 1 && board[ii + 2][jj + 1] == 1) {
out += "F\n";
isResolve = true;
break;
}
if (board[ii][jj] == 1 && board[ii + 1][jj - 2] == 1) {
out += "G\n";
isResolve = true;
break;
}
if (board[ii][jj] == 1 && board[ii + 2][jj - 1] == 1) {
out += "D\n";
isResolve = true;
break;
}
}
if (isResolve) {
break;
}
}
System.out.print(out);
}
|
Main.java:136: error: reached end of file while parsing
}
^
1 error
|
s195379826
|
p00036
|
Java
|
import java.io.*
public class Main {
public static String solve (String[] str) {
int baseX = 0, baseY = 0;
main : for (int i = 0; i < str.length; i++) {
for (int j = 0; j < str[i].length(); j++) {
if (str[i].charAt(j) == '1') {
baseX = j;
baseY = i;
break main;
}
}
}
if (str[baseY].charAt(baseX + 1) == '1') {
if (str[baseY + 1].charAt(baseX) == '1')
return str[baseY + 1].charAt(baseX + 1) == '1' ? "A" : "G";
else
return str[baseY + 1].charAt(baseX + 1) == '1' ? "E" : "C";
} else {
if (str[baseY + 2].charAt(baseX) == '1')
return "B";
else
return str[baseY + 1].charAt(baseX + 1) == '1' ? "F" : "D";
}
}
public static void main(String[] args) throws IOException {
BufferedReader br =
new BufferedReader(new InputStreamReader(System.in));
String line = "";
while ((line = br.readLine()) != null) {
String[] str = new String[10];
str[0] = line + "00";
for (int i = 1; i < str.length - 2; i++)
str[i] = br.readLine() + "00";
System.out.println(solve(str));
}
}
}
|
Main.java:1: error: ';' expected
import java.io.*
^
1 error
|
s848486410
|
p00036
|
C
|
#include<stdio.h>
int main(void){
int i, j, f, map[8][8];
while(1){
f=0;
for(i = 0; i < 8; i++){
for(j = 0; j < 8; j++){
if(scanf("%1d", &map[i][j])==EOF){
f=1;
break;ac
}
}
}
if(f == 1) break;
for (i = 0; i < 8; i++){
for(j = 0; j < 8; j++){
if(map[i][j] == 1){
if(map[i+3][j] == 1) printf("B\n");
else if(map[i+2][j-1] == 1) printf("D\n");
else if(map[i+2][j+1] == 1) printf("F\n");
else if(map[i][j+1] == 1){
if(map[i+1][j-1] == 1) printf("G\n");
else if(map[i+1][j] == 1 && map[i+1][j+1] == 1) printf("A\n");
else if(map[i+1][j+2] == 1) printf("E\n");
}else if(map[i][j+3] == 1) printf("C\n");
else break;
}
}
}
}
return 0;
}
|
main.c: In function 'main':
main.c:12:27: error: 'ac' undeclared (first use in this function)
12 | break;ac
| ^~
main.c:12:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:29: error: expected ';' before '}' token
12 | break;ac
| ^
| ;
13 | }
| ~
|
s857208711
|
p00036
|
C
|
#include<stdio.h>
int main(void){
int a[8][8];
char v[8][8];
int i,j;
while(1){
for(i = 0;i < 8;i++){
for(j = 0;j < 8;j++){
if(scanf("%c",&v[i][j]) == EOF){
return 0;
}
a[i][j] = v[i][j] - 48;
}
getchar()();
}
for(i = 0;i < 8;i++){
for(j = 0;j < 8;j++){
if(a[i][j] == 1){
if(a[i][j+1] == 1 && a[i+1][j] == 1 && a[i+1][j+1] == 1){
printf("A\n");
break;break;
}
else if(a[i+1][j] == 1 && a[i+2][j] == 1 && a[i+3][j] == 1){
printf("B\n");
break;break;
}
else if(a[i][j+1] == 1 && a[i][j+2] == 1 && a[i][j+3] == 1){
printf("C\n");
break;break;
}
else if(a[i+1][j] == 1 && a[i+1][j-1] == 1 && a[i+2][j-1] == 1){
printf("D\n");
break;break;
}
else if(a[i][j+1] == 1 && a[i+1][j+1] == 1 && a[i+1][j+2] == 1){
printf("E\n");
break;break;
}
else if(a[i+1][j] == 1 && a[i+1][j+1] == 1 && a[i+2][j+1] == 1){
printf("F\n");
break;break;
}
else{
printf("G\n");
break;break;
}
}
}
}
}
return 0;
}
|
main.c: In function 'main':
main.c:14:17: error: called object is not a function or function pointer
14 | getchar()();
| ^~~~~~~
|
s116792712
|
p00036
|
C
|
#include <stdio.h>
#include <string.h>
int main(void){
char b[65];
char p[7][33] = {
"1100000011",
"10000000100000001000000010000001",
"1111",
"1000000110000001",
"11000000011",
"100000001100000001",
"110000011",
};
char *bi;
int t = 0;
while(true){
if(scanf("%s", b) == EOF){ break; }
for(int i=1; i<8; ++i){
scanf("%s", b+i*8);
}
bi = strchr(b, '1');
for(int i=0; i<7; ++i){
if(memcmp(bi, p[i], strlen(p[i])) == 0){
printf("%c\n", 'A' + i);
break;
}
}
}
return 0;
}
|
main.c: In function 'main':
main.c:18:11: error: 'true' undeclared (first use in this function)
18 | while(true){
| ^~~~
main.c:3:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
2 | #include <string.h>
+++ |+#include <stdbool.h>
3 |
main.c:18:11: note: each undeclared identifier is reported only once for each function it appears in
18 | while(true){
| ^~~~
|
s944128105
|
p00036
|
C
|
#include<stdio.h>
main(){
int i,j;
char a[8][8];
while(scanf("%s",a[0])!=EOF){
for(i=1;i<8;i++){
scanf("%s",a[i]);
}
for(i=0;i<8;i++){
for(j=0;j<8;j++){
if(a[i][j]=='1'&&a[i][j+1]=='1'&&a[i+1][j]=='1'&&a[i+1][j+1]=='1'){
printf("A\n");
break;
break;
}
else if(a[i][j]=='1'&&a[i+1][j]=='1'&&a[i+2][j]=='1'&&a[i+3][j]=='1'){
printf("B\n");
break;
break;
}
else if(a[i][j]=='1'&&a[i][j+1]=='1'&&a[i][j+2]=='1'&&a[i][j+3]=='1'){
printf("C\n");
break;
break;
}
else if(a[i][j]=='1'&&a[i+1][j-1]=='1'&&a[i+1][j]=='1'&&a[i+2][j-1]=='1'){
printf("D\n");
break;
break;
}
else if(a[i][j]=='1'&&a[i][j+1]=='1'&&a[i+1][j+1]=='1'&&a[i+1][j+2]=='1'){
printf("E\n");
break;
break;
}
else if(a[i][j]=='1'&&a[i+1][j]=='1'&&a[i+1][j+1]=='1'&&a[i+2][j+1]=='1'){
printf("F\n");
break;
break;
}
else if(a[i][j]=='1'&&a[i][j+1]=='1'&&a[i+1][j]=='1'&&a[i+1][j-1]=='1'){
printf("G\n");
break;
break;
}
}
}
}
|
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:48:3: error: expected declaration or statement at end of input
48 | }
| ^
|
s374027392
|
p00036
|
C
|
#include <stdio.h>
int main(void){
int i, j, k;
int dot;
int point[4][2];
for(k = 0; k < 50; k++){
for(i = 0; i < 8 i++){
scanf("%d", &dot");
for(j = 8; j > 0; j--){
if(dot ^ (1 < j) == 1){
point[k][0] = i;
point[k][1] = j;
k++;
}
}
}
if(point[0][1] + 1 == point[1][1] && point[0][1] + 2 == point[2][1]){
puts("C");
}else if(point[0][0] + 1 == point[1][0] && point[0][0] + 2 == point[2][0]){
puts("B");
}else if(point[0][1] + 1 == point[1][1] && point[1][0] + 1 == point[3][0]){
if(point[3][1] + 1 == point[2][1])
puts("E");
else
puts("A");
}else if(point[0][1] + 1 == point[1][1] && point[0][0] + 1 == point[3][0]){
puts("G");
}else if(point[1][0] + 1 == point[2][0]){
if(point[3][1] == point[1][1])
puts("D");
else
puts("F");
}
return 0;
}
}
|
main.c: In function 'main':
main.c:8:21: error: expected ';' before 'i'
8 | for(i = 0; i < 8 i++){
| ^~
| ;
main.c:9:25: warning: missing terminating " character
9 | scanf("%d", &dot");
| ^
main.c:9:25: error: missing terminating " character
9 | scanf("%d", &dot");
| ^~~
main.c:9:25: error: expected ')' before 'for'
9 | scanf("%d", &dot");
| ~ ^
| )
10 | for(j = 8; j > 0; j--){
| ~~~
main.c:16:10: error: expected ';' before '}' token
16 | }
| ^
| ;
17 | }
| ~
|
s082637980
|
p00036
|
C
|
#include <stdio.h>
int main()
{
int Field[8][8],
y,x,
i;
char progression[9];
while(1)
{
for(y=0;y<8;y++){
if(scanf("%s",progression) != EOF){
for(i=0;progression[i];i++){
Field[y][i] = (progression[i] == '1');
}
} else {
return 0;
}
}
for(i=0;i<64;i++)
{
if(Field[i/8][i%8]){
y = i/8;
x = i%8;
break;
}
}
if(Field[y][x+1] && Field[y+1][x] && Field[y+1][x+1]){
printf("A\n");
} else if(Field[y+1][x] && Field[y+2][x] && Field[y+3][x]){
printf("B\n");
} else if(Field[y][x+1] && Field[y][x+2] && Field[y][x+3]){
printf("C\n");
} else if(Field[y+1][x-1] && Field[y+1][x] && Field[y+2][x-1]){
printf("D\n");
} else if(Field[y][x+1] && Field[y+1][x+1] && Field[y+1][x+2]){
printf("E\n");
} else if(Field[y+1][x] && Field[y+1][x+1] && Field[y+2][x+1]){
printf("F\n");
} else if(Field[y][x+1] && Field[y+1][x-1] && Field[y+1][x]){
printf("G\n");
}
}
printf("\n");
}
}
|
main.c:51:1: error: expected identifier or '(' before '}' token
51 | }
| ^
|
s386848854
|
p00036
|
C
|
#include <stdio.h>
#define A 1
#define B 2
#define C 3
#define D 4
#define E 5
#define F 6
#define G 7
int main(void){
int field[9][9];
int i,j,c;
int type;
int end = 0;
int s_end;
for(i = 0; i < 9; i++){
field[i][8] = 0;
}
for(j = 0; j < 9; j++){
field[8][j] = 0;
}
while(1){
type = 0;
i = 0;
j = 0;
s_end = 0;
while(1){
c = getchar();
if(c == EOF){
end = 1;
break;
}
field[i][j] = c - '0';
if(i == 7){
getchar();
i = 0;
if(j == 7){
getchar();
break;
}else{
j++;
}
}else{
i++;
}
}
if(end){break;}
for(j = 0; j < 8; j++){
for(i = 0; i < 8; i++){
if(field[i][j]){
if(field[i-1][j+1]){
if(field[i+1][j ]){
type = G;
s_end = 1;
break;
}else{
type = D;
s_end = 1;
break;
}
}else{
if(
field[i ][j+1] &&
field[i+1][j ] &&
field[i+1][j+1]
){
type = A;
s_end = 1;
break;
}else if(
field[i ][j+1] &&
field[i ][j+2] &&
field[i ][j+3]
){
type = B;
s_end = 1;
break;
}else if(
field[i+1][j ] &&
field[i+2][j ] &&
field[i+3][j ]
){
type = C;
s_end = 1;
break;
}else if(
field[i+1][j ] &&
field[i+1][j+1] &&
field[i+2][j+1]
){
type = E;
s_end = 1;
break;
}else if(
field[i ][j+1] &&
field[i+1][j+1] &&
field[i+1][j+2]
){
type = F;
s_end = 1;
break;
}
}
}
}
if(s_end){break;}
}
putchar(
type == A ? 'A' :
type == B ? 'B' :
type == C ? 'C' :
type == D ? 'D' :
type == E ? 'E' :
type == F ? 'F' : 'G'
);
|
main.c: In function 'main':
main.c:115:17: error: expected declaration or statement at end of input
115 | );
| ^
main.c:115:17: error: expected declaration or statement at end of input
|
s225421387
|
p00036
|
C
|
#include <stdio.h>
#define A 1
#define B 2
#define C 3
#define D 4
#define E 5
#define F 6
#define G 7
int main(void){
int field[10][10];
int i,j,c;
int type;
int end = 0;
int s_end;
for(i = 0; i < 9; i++){
field[i][0] = 0;
field[i][8] = 0;
}
for(j = 0; j < 9; j++){
field[0][j] = 0;
field[8][j] = 0;
}
while(1){
type = 0;
i = 1;
j = 1;
s_end = 0;
while(1){
c = getchar();
if(c == EOF){
end = 1;
break;
}
field[i][j] = c - '0';
if(i == 8){
getchar();
i = 1;
if(j == 8){
getchar();
break;
}else{
j++;
}
}else{
i++;
}
}
if(end){break;}
for(j = 1; j < 9; j++){
for(i = 1; i < 9; i++){
if(field[i][j]){
if(field[i-1][j+1]){
if(field[i+1][j ]){
type = G;
s_end = 1;
break;
}else{
type = D;
s_end = 1;
break;
}
}else{
if(
field[i ][j+1] &&
field[i+1][j ] &&
field[i+1][j+1]
){
type = A;
s_end = 1;
break;
}else if(
field[i ][j+1] &&
field[i ][j+2] &&
field[i ][j+3]
){
type = B;
s_end = 1;
break;
}else if(
field[i+1][j ] &&
field[i+2][j ] &&
field[i+3][j ]
){
type = C;
s_end = 1;
break;
}else if(
field[i+1][j ] &&
field[i+1][j+1] &&
field[i+2][j+1]
){
type = E;
s_end = 1;
break;
}else if(
field[i ][j+1] &&
field[i+1][j+1] &&
field[i+1][j+2]
){
type = F;
s_end = 1;
break;
}
}
}
}
if(s_end){break;}
}
putchar(
type == A ? 'A' :
type == B ? 'B' :
type == C ? 'C' :
type == D ? 'D' :
type == E ? 'E' :
type == F ? 'F' : 'G'
);
putchar('\n');
}
return 0;
|
main.c: In function 'main':
main.c:121:9: error: expected declaration or statement at end of input
121 | return 0;
| ^~~~~~
|
s904322189
|
p00036
|
C
|
#include <iostream>
#include <string>
using namespace std;
string s[8];
void f(){
char b='A';
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
if(s[i][j]=='1'){
if(i<5)if(s[i+3][j]=='1')b='B';
if(j<5)if(s[i][j+3]=='1')b='C';
if(i<6&&j>0)if(s[i+2][j-1]=='1')b='D';
if(j<6)if(s[i+1][j+2]=='1')b='E';
if(i<6)if(s[i+2][j+1]=='1')b='F';
if(j>0)if(s[i+1][j-1]=='1')b='G';
cout<<b<<endl;
return;
}
}
}
}
int main(){
while(cin>>s[0]){
for(int i=1;i<8;i++)cin>>s[i];
f();
}
return 0;
}
|
main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s343958822
|
p00036
|
C
|
#include <stdio.h>
#include <stdlib.h>
#define SIZE 64
/* prototype declaration */
void getTable(int *a);
char determinant();
int main(int argc, const char *argv[])
{
while(1){
printf("ans:%c\n", determinant());
}
return 0;
}
char determinant()
{
int a[SIZE], i;
getTable(a);
for(i=0; a[i]==0; i++);
if(a[i] && a[i+1] && a[i+2] && a[i+3]) return 'C';
if(a[i] && a[i+1] && a[i+8] && a[i+9]) return 'A';
if(a[i] && a[i+1] && a[i+9] && a[i+10]) return 'E';
if(a[i] && a[i+1] && a[i+7] && a[i+8]) return 'G';
if(a[i] && a[i+7] && a[i+8] && a[i+15]) return 'D';
if(a[i] && a[i+8] && a[i+9] && a[i+17]) return 'F';
if(a[i] && a[i+8] && a[i+16] && a[i+24]) return 'B';
return -1;
}
void getTable(int *a)
{
int i=0, ch;
while(i<SIZE){
ch = getchar();
if(ch==EOF) exit(0);
if(ch=='\n') continue;
a[i] = ch-'0';
i++;
}
showTable(a);
}
|
main.c: In function 'getTable':
main.c:48:9: error: implicit declaration of function 'showTable' [-Wimplicit-function-declaration]
48 | showTable(a);
| ^~~~~~~~~
|
s343430151
|
p00036
|
C
|
int main(){
char a[8][9];
int i,j,flag;
while(scanf("%s",a[0])!=EOF){
for(i=1;i<8;i++)
scanf("%s",a[i]);
flag=1;
for(i=0;i<8&&flag;i++)
for(j=0;j<8&&flag;j++)
if(a[i][j]=='1'){
if(i+1<8&&j+1<8&&a[i+1][j]=='1'&&a[i][j+1]=='1'&&a[i+1][j+1]=='1')
printf("A\n");
else if(i+3<8&&a[i+1][j]=='1'&&a[i+2][j]=='1'&&a[i+3][j]=='1')
printf("B\n");
else if(j+3<8&&a[i][j+1]=='1'&&a[i][j+2]=='1'&&a[i][j+3]=='1')
printf("C\n");
else if(i+2<8&&j-1>=0&&a[i+1][j-1]=='1'&&a[i+1][j]=='1'&&a[i+2][j-1]=='1')
printf("D\n");
else if(i+1<8&&j+2<8&&a[i][j+1]=='1'&&a[i+1][j+1]=='1'&&a[i+1][j+2]=='1')
printf("E\n");
else if(i+2<8&&j+1<8&&a[i+1][j]=='1'&&a[i+1][j+1]=='1'&&a[i+2][j+1]=='1')
printf("F\n");
else
printf("G\n");
flag=0;
}
}
return 0;
}
|
main.c: In function 'main':
main.c:6:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | while(scanf("%s",a[0])!=EOF){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(){
main.c:6:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
6 | while(scanf("%s",a[0])!=EOF){
| ^~~~~
main.c:6:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:33: error: 'EOF' undeclared (first use in this function)
6 | while(scanf("%s",a[0])!=EOF){
| ^~~
main.c:6:33: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:6:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:49: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
15 | printf("A\n");
| ^~~~~~
main.c:15:49: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:49: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:49: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:49: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
17 | printf("B\n");
| ^~~~~~
main.c:17:49: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:49: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
19 | printf("C\n");
| ^~~~~~
main.c:19:49: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:49: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
21 | printf("D\n");
| ^~~~~~
main.c:21:49: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:23:49: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
23 | printf("E\n");
| ^~~~~~
main.c:23:49: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:49: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
25 | printf("F\n");
| ^~~~~~
main.c:25:49: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:27:49: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
27 | printf("G\n");
| ^~~~~~
main.c:27:49: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s236885654
|
p00036
|
C++
|
#include<stdio.h>
int main(){
char a[8][8];
int ans = 0;
while(1){
for(int i = 0; i < 8; i++){
if(scanf("%s",&a[i]) == EOF){
return 0;
}
}
for(int i = 0; i < 8; i++){
for(int j = 0; j < 8; j++){
if(a[i][j] == 1){
if(i < 7 && j < 7){
if(a[i+1][j] == 1 && a[i][j+1] == 1 && a[i+1][j+1] == 1){
printf("A\n");
}
}
if(i < 5){
if(a[i+1][j] == 1 && a[i+2][j] == 1 && a[i+3][j] == 1){
printf("B\n");
}
}
if(j < 5){
if(a[i][j+1] == 1 && a[i][j+2] == 1 && a[i][j+3] == 1){
printf("C\n");
}
}
if(i < 6 && j < 5){
if(a[i][j+1] == 1 && a[i+1][j+1] == 1 && a[i+1][j+2] == 1){
printf("E\n");
}
}
if(i < 5 && j < 6){
if(a[i+1][j] == 1 && a[i+1][j+1] == 1 && a[i+2][j+1] == 1){
printf("F\n");
}
}
if(j > 0 && i < 6){
if(a[i+1][j] == 1 && a[i+1][j-1] == 1 && a[i+2][j-1] == 1){
printf("D\n");
}
}
if(j > 0 && j < 7 && i < 7){
if(a[i+1][j] == 1 && a[i][j+1] == 1 && a[i+1][j-1] == 1){
printf("G\n");
}
}
}
}
}
}
}
return 0;
}
|
a.cc:56:1: error: expected unqualified-id before 'return'
56 | return 0;
| ^~~~~~
a.cc:57:1: error: expected declaration before '}' token
57 | }
| ^
|
s169646814
|
p00036
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int main()
{
while(1){
char ret;
string s;
for(int i=0;i<8;i++){
string s_tmp;
if(scanf("%s", s) == EOF) return;
s += s_tmp;
}
// 2次元配列を1次元的に処理
for(int i=0;i<8*8;i++){
if(s[i]=='1'){
// Aかどうか
if(s[i+1]=='1' && s[i+8]=='1' && s[i+9]=='1'){
ret = 'A';
break;
}else if(s[i+8]=='1' && s[i+16]=='1' && s[i+24]=='1'){
ret = 'B';
break;
}else if(s[i+1]=='1' && s[i+2]=='1' && s[i+3]=='1'){
ret = 'C';
break;
}else if(s[i+7]=='1' && s[i+8]=='1' && s[i+15]=='1'){
ret = 'D';
break;
}else if(s[i+1]=='1' && s[i+9]=='1' && s[i+10]=='1'){
ret = 'E';
break;
}else if(s[i+8]=='1' && s[i+9]=='1' && s[i+17]=='1'){
ret = 'F';
break;
}else if(s[i+1]=='1' && s[i+7]=='1' && s[i+8]=='1'){
ret = 'G';
break;
}
}
}
}
cout<<ret<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:43: error: return-statement with no value, in function returning 'int' [-fpermissive]
16 | if(scanf("%s", s) == EOF) return;
| ^~~~~~
a.cc:48:15: error: 'ret' was not declared in this scope
48 | cout<<ret<<endl;
| ^~~
|
s717606389
|
p00036
|
C++
|
00000000
00000000
01100000
00110000
00000000
00000000
00000000
00000000
00011110
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00110000
00110000
00000000
00000000
00000000
00000000
|
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 00000000
| ^~~~~~~~
|
s298506598
|
p00036
|
C++
|
#include<iostream>
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a ; i ++)
int main(void){
char maze[9][9];
while(true){
rep(i,8)rep(j,8)cin>>maze[i][j];
if(cin.eof())break;
bool used = false;
rep(y,8){
rep(x,8){
if (board[y][x] == '1') {
if (board[y][x+1] == '1' && board[y+1][x] == '1' && board[y+1][x+1] == '1')
cout << "A" << endl;
else if (board[y+1][x] == '1' && board[y+2][x] == '1' && board[y+3][x] == '1')
cout << "B" << endl;
else if (board[y][x+1] == '1' && board[y][x+2] == '1' && board[y][x+3] == '1')
cout << "C" << endl;
else if (board[y+1][x] == '1' && board[y+1][x-1] == '1' && board[y+2][x-1] == '1')
cout << "D" << endl;
else if (board[y][x+1] == '1' && board[y+1][x+1] == '1' && board[y+1][x+2] == '1')
cout << "E" << endl;
else if (board[y+1][x] == '1' && board[y+1][x+1] == '1' && board[y+2][x+1] == '1')
cout << "F" << endl;
else
cout << "G" << endl;
used = true;
}
/*
if(maze[y][x]=='1'){
if(maze[ y ][x+1] == '1' && maze[y+1][ x ] =='1' &&
maze[y+1][x+1] =='1') cout << "A" << endl;
else if(maze[y+1][ x ] == '1' && maze[y+2][ x ] == '1' &&
maze[y+3][ x ] == '1') cout << "B" << endl;
else if(maze[ y ][x+3] == '1' && maze[y][x+2] == '1' &&
maze[ y ][x+1] == '1') cout << "C" << endl;
else if(maze[y+1][ x ] == '1' && maze[y+1][x-1] == '1' &&
maze[y+2][x-1] == '1') cout << "D" << endl;
else if(maze[ y ][x+1] == '1' && maze[y+1][x+1] == '1' &&
maze[y+1][x+2] == '1') cout << "E" << endl;
else if(maze[y+1][ x ] == '1' && maze[y+1][+1] == '1' &&
maze[y+2][x+1] == '1') cout << "F" << endl;
else cout << "G" << endl;
used = true;
}
*/
if(used)break;
}
if(used)break;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:13: error: 'board' was not declared in this scope
12 | if (board[y][x] == '1') {
| ^~~~~
|
s166598585
|
p00036
|
C++
|
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <cstdio>
#include <string.h>
#include <sstream>
#include <iomanip>
#include <map>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, b, e) for(int i = b; i < e; i++)
#define to_bit(i) static_cast< bitset<8> >(i)
#define INF (1<<28)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long long, long long>PLL;
typedef queue<int> QI;
typedef priority_queue<int> maxpq;
typedef priority_queue<int, vector<int>, greater<int> > minpq;
struct edge{int to, cost;};
void begin(){cin.tie(0); ios::sync_with_stdio(false);};
int gcd(int a, int b){if(a%b==0){return(b);}else{return(gcd(b,a%b));}};
int lcm(int m, int n){if((0 == m)||(0 == n)){return 0;} return ((m / gcd(m, n)) * n);};
unsigned long long comb(long n, long m){unsigned long long c = 1; m = (n - m < m ? n - m : m);
for(long ns = n - m + 1, ms = 1; ms <= m; ns ++, ms ++){c *= ns; c /= ms;} return c;};
void cp(int a1[], int a2[], int l){REP(i, l) a2[i] = a1[i];};
void cp(string a1[], string a2[], int l){REP(i, l) a2[i] = a1[i];};
double sq(double d){return d*d;};
int sq(int i){return i*i;};
double sqdist(int x1, int y1, int x2, int y2){
double dx = x1 - x2, dy = y1 - y2; return dx*dx + dy*dy;
};
bool inside(int y, int x, int h, int w){return 0 <= y && y <= (h-1) && 0 <= x && x <= (w-1);};
// 線分の交差判定
bool isCross(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4){
// 並行な場合
int m = (x2-x1)*(y4-y3)-(y2-y1)*(x4-x3);
if(m == 0) return false;
// 媒介変数の値が0より大きく1以下なら交差する、これは問題の状況によって変わるかも。
double r =(double)((y4-y3)*(x3-x1)-(x4-x3)*(y3-y1))/m;
double s =(double)((y2-y1)*(x3-x1)-(x2-x1)*(y3-y1))/m;
return (0 < r && r <= 1 && 0 < s && s <= 1);
};
// 外積の計算 AB CD の内積を求める
int crossProdct(int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy){
int abx = bx - ax; int aby = by - ay;
int cdx = dx - cx; int cdy = dy - cy;
return abx * cdy - cdx * aby;
};
double crossProdct(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy){
double abx = bx - ax; double aby = by - ay;
double cdx = dx - cx; double cdy = dy - cy;
return abx * cdy - cdx * aby;
};
double innerProduct(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy){
double abx = bx - ax; double aby = by - ay;
double cdx = dx - cx; double cdy = dy - cy;
return abx * cdx + aby * cdy;
};
// 三角形の内部判定 ABCの中にPがあるか判定
bool inTriangle(int ax, int ay, int bx, int by, int cx, int cy, int px, int py){
int c1 = crossProdct(ax, ay, bx, by, bx, by, px, py);
int c2 = crossProdct(bx, by, cx, cy, cx, cy, px, py);
int c3 = crossProdct(cx, cy, ax, ay, ax, ay, px, py);
return (c1 > 0 && c2 > 0 && c3 > 0) || (c1 < 0 && c2 < 0 && c3 < 0);
};
bool inTriangle(double ax, double ay, double bx, double by, double cx, double cy, double px, double py){
double c1 = crossProdct(ax, ay, bx, by, bx, by, px, py);
double c2 = crossProdct(bx, by, cx, cy, cx, cy, px, py);
double c3 = crossProdct(cx, cy, ax, ay, ax, ay, px, py);
return (c1 > 0 && c2 > 0 && c3 > 0) || (c1 < 0 && c2 < 0 && c3 < 0);
};
// 三角形の外心
void circumcenter(double ax, double ay, double bx, double by, double cx, double cy, double res[3]){
// AB AC を求める
double abx = bx - ax; double aby = by - ay;
double acx = cx - ax; double acy = cy - ay;
double m = abx * acy - acx * aby; // 分母 m = 0 となるのは3点が一直線になるとき
double s = (abx * acx + aby * acy - sq(acx) - sq(acy)) / m; // 媒介変数s
res[0] = abx / 2 + s * aby / 2; res[1] = aby / 2 - s * abx / 2;
// cout << res[0] << " " << res[1] << endl;
res[2] = sqrt(sqdist(0, 0, res[0], res[1]));
res[0] += ax; res[1] += ay;
};
class BinaryIndexedTree{
public:
int n; vector<int> bit;
BinaryIndexedTree(int _n){
n = _n;
bit.resize(n+1,0);
}
int sum(int i){
int sum = 0;
while(i > 0){
sum += bit[i];
i -= i & -i;
}
return sum;
}
void add(int i, int v){
while(i <= n){
bit[i] += v;
i += i & -i;
}
}
};
class UnionFindTree{
public:
vector<int> parent, rank;
int n;
std::set<int> set;
// 初期化
UnionFindTree(int _n){
n = _n;
for(int i = 0; i < n; i++){
parent.resize(n);
rank.resize(n);
parent[i] = i;
rank[i] = 0;
}
}
// 根を求める
int find(int x){
if(parent[x] == x){
return x;
}else{
return parent[x] = find(parent[x]);
}
}
// xとyの集合を結合
void unite(int x, int y){
x = find(x);
y = find(y);
if(x == y){
set.insert(x);
return;
}
if(rank[x] < rank[y]){
parent[x] = y;
set.erase(x);
set.insert(y);
}else{
parent[y] = x;
set.erase(y);
set.insert(x);
if(rank[x] == rank[y]) rank[x]++;
}
}
// xとyが同じ集合か
bool same(int x, int y){
return find(x) == find(y);
}
// 集合の数を数える
int count(){
return (int)set.size();
}
};
// ワーシャルフロイド法
void warshallFloyd(int graph[100][100], int graph_size){
for(int mid_node = 0; mid_node < graph_size; mid_node++)
for(int s_node = 0; s_node < graph_size; s_node++)
for(int g_node = 0; g_node < graph_size; g_node++)
if(s_node == g_node) graph[s_node][g_node] = 0;
else graph[s_node][g_node] = min(graph[s_node][g_node], graph[s_node][mid_node] + graph[mid_node][g_node]);
};
// d:隣接行列 n:グラフのサイズ s:始点 dist:始点からの距離が入る配列
void dijkstra(int graph[1000][1000], int node_count, int start_node, int distances[1000]){
REP(i, node_count) distances[i] = -1;
distances[start_node] = 0;
priority_queue<PII, vector<PII>, greater<PII> > dijkstra_pq;
dijkstra_pq.push(PII(0, start_node));
while (!dijkstra_pq.empty()) {
PII p = dijkstra_pq.top(); dijkstra_pq.pop();
int i = p.second;
if(distances[i] < p.first) continue;
for(int j = 0; j < node_count; j++){
if(graph[i][j] == -1) continue;
if(distances[j] == -1){
distances[j] = distances[i] + graph[i][j];
dijkstra_pq.push(PII(distances[j], j));
}else if(distances[j] > distances[i] + graph[i][j]){
distances[j] = distances[i] + graph[i][j];
dijkstra_pq.push(PII(distances[j], j));
}
}
}
};
void pma(int a[100][100], int n){
REP(i, n){
REP(j, n){
if(a[i][j] == INF) cout << -1 << " ";
else cout << a[i][j] << " ";
}
cout << endl;
}
cout << endl;
};
/**
* start
* @author yoshikyoto
*/
int n, m, s, g1, g2;
int g[100][100];
void solve(){
warshallFloyd(g, n);
int ans = INF;
REP(i, n){
ans = min(ans, g[s][i] + g[i][g1] + g[i][g2]);
}
cout << ans << endl;
}
string instr[8];
int zu[8][8];
bool inside(int i, int j){
return inside(i, j, 8, 8);
};
bool ch(int i, int j){
return inside(i, j) && zu[i][j];
}
void serch(int i, int j){
if(ch(i,j+1)){
// cout << "ACEG" << endl;
if(ch(i,j+2)){
cout << "C" << endl;
}else if(ch(i+1, j+2)){
cout << "E" << endl;
}else if(ch(i+1, j+1)){
cout << "A" << endl;
}else{
cout << "G" << endl;
}
}else{
// cout << "BDF" << endl;
if(ch(i+2,j)){
cout << "B" << endl;
}else if(ch(i+1, j-1)){
cout << "D" << endl;
}else{
cout << "F" << endl;
}
}
};
int main(int argc, const char * argv[]){
begin();
while(!cin.eof()){
REP(i, 8) if(!(cin >> instr[i])) return 0;
REP(i, 8) REP(j, 8){
zu[i][j] = (int)(instr[i][j] - '0');
}
REP(i, 8) REP(j, 8){
if(zu[i][j]){
serch(i, j);
break;
}
}
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:294:2: error: expected '}' at end of input
294 | }
| ^
a.cc:279:40: note: to match this '{'
279 | int main(int argc, const char * argv[]){
| ^
|
s204055483
|
p00036
|
C++
|
#include <iostream>
#include <cstdio>
using namespace std;
typedef struct _XY {
int x;
int y;
} XY;
XY figure[][4] = {
{{1, 0}, {0, 1}, {1, 1}}, // A
{{0, 1}, {0, 2}, {0, 3}}, // B
{{1, 0}, {2, 0}, {3, 0}}, // C
{{0, 1}, {-1, 1}, {-1, 2}}, // D
{{1, 0}, {1, 1}, {2, 1}}, // E
{{0, 1}, {1, 1}, {1, 2}}, // F
{{1, 0}, {0, 1}, {-1, 1}}, // G
};
string name[7] = {"A", "B", "C", "D", "E", "F", "G"};
int main() {
int math[8][8];
char c;
while (1) {
memset(math, 0, sizeof(math));
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
c = getchar();
math[i][j] = c - '0';
}
c = getchar();
}
// for (int i = 0; i < 8; i++) {
// for (int j = 0; j < 8; j++) {
// cout << math[i][j];
// }
// cout << endl;
// }
XY p;
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (math[i][j] == 1) {
p.x = j;
p.y = i;
goto END;
}
}
}
END:
for (int i = 0; i < 7; i++) {
if (math[p.y + figure[i][0].y][p.x + figure[i][0].x] == 1 &&
math[p.y + figure[i][1].y][p.x + figure[i][1].x] == 1 &&
math[p.y + figure[i][2].y][p.x + figure[i][2].x] == 1 ) {
cout << name[i] << endl;
break;
}
}
c = getchar();
if (c == EOF)
break;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:26:17: error: 'memset' was not declared in this scope
26 | memset(math, 0, sizeof(math));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cstdio>
+++ |+#include <cstring>
3 |
|
s272823750
|
p00036
|
C++
|
#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
char ta[12][12];
bool ok(int y,int x){
if(y<0||x<0||y>7||x>7)return 0;
if(ta[y][x]=='1')return 1;
return 0;
}
int main(){
while(cin>>ta[0][0]){
int y,x;
bool f=1;
for(int i=0;i<8;i++){
for(int j=(i==0);j<8;j++){
char now;
cin>>now;
if(now=='1'){
y=i,x=j;
if( ok(y,x+1)&ok(y+1,x)&&ok(y+1,x+1) ){cout<<"A";f=0;}
else if( ok(y+1,x)&&ok(y+2,x)&&ok(y+3,x) ){cout<<"B";f=0;}
else if( ok(y,x+1)&&ok(y,x+2)&&ok(y,x+3) ){cout<<"C";f=0;}
else if( ok(y+2,x-1)&&ok(y+1,x-1)&&ok(y+1,x)){cout<<"C";f=0;}
else if( ok(y,x+1)&ok(y+1,x+1)&&ok(y+1,x+2) ){cout<<"E";f=0;}
else if( ok(y+1,x)&&ok(y+1,x+1) &&ok(y+2,x+1)){cout<<"F";f=0;}
else if( ok(y,x+1)&&ok(y+1,x)&&ok(y+1,x-1) ){cout<<"G";f=0;}
if(f==0){cout<<endl;goto end:;}
}
ta[i][j]=now;
}
}
end:;
for(int i=0;i<8;i++)for(int j=0;j<8;j++)ta[i][j]='0';
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:49:37: error: expected ';' before ':' token
49 | if(f==0){cout<<endl;goto end:;}
| ^
| ;
a.cc:49:37: error: expected primary-expression before ':' token
|
s840494116
|
p00036
|
C++
|
#include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
int main(){
while(1){
int data[7]={22,60,6,38,24,42,20},a=0,b=0,sum=0;
char x;
rer(i,1,8){
rer(j,1,8){
if(~(cin>>x)) return 0;
//if(cin.eof()) return 0;//!!!!!!!
if(x=='1'){
if(a==0 && b==0){
a=i; b=j;
}else{
sum+=10*(i-a)+j-b;
}
}
//o(sum);
}
}
rep(i,0,7){
if(sum==data[i]){
char c;
c='A'+i;
o(c); break;
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:23:36: error: no match for 'operator~' (operand type is 'std::basic_istream<char>')
23 | if(~(cin>>x)) return 0;
| ^~~~~~~~~
a.cc:23:36: note: candidate: 'operator~(int)' (built-in)
a.cc:23:36: note: no known conversion for argument 1 from 'std::basic_istream<char>' to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:151:3: note: candidate: 'constexpr std::byte std::operator~(byte)'
151 | operator~(byte __b) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:151:18: note: no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::byte'
151 | operator~(byte __b) noexcept
| ~~~~~^~~
In file included from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/ios_base.h:99:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator~(_Ios_Fmtflags)'
99 | operator~(_Ios_Fmtflags __a) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:99:27: note: no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::_Ios_Fmtflags'
99 | operator~(_Ios_Fmtflags __a) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:149:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator~(_Ios_Openmode)'
149 | operator~(_Ios_Openmode __a) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:149:27: note: no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::_Ios_Openmode'
149 | operator~(_Ios_Openmode __a) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:196:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator~(_Ios_Iostate)'
196 | operator~(_Ios_Iostate __a) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:196:26: note: no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::_Ios_Iostate'
196 | operator~(_Ios_Iostate __a) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:176:
/usr/include/c++/14/future:177:20: note: candidate: 'constexpr std::launch std::operator~(launch)'
177 | constexpr launch operator~(launch __x) noexcept
| ^~~~~~~~
/usr/include/c++/14/future:177:37: note: no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::launch'
177 | constexpr launch operator~(launch __x) noexcept
| ~~~~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:198:
/usr/include/c++/14/charconv:642:3: note: candidate: 'constexpr std::chars_format std::operator~(chars_format)'
642 | operator~(chars_format __fmt) noexcept
| ^~~~~~~~
/usr/include/c++/14/charconv:642:26: note: no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::chars_format'
642 | operator~(chars_format __fmt) noexcept
| ~~~~~~~~~~~~~^~~~~
|
s740351896
|
p00036
|
C++
|
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>
using namespace std;
#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))
typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };
int main() {
bool br = false;
while (true){
bool cell[8][8] = { false };
int ans = 0;
REP(i, 8){
string s;
getline(cin, s);
if (s.empty){
br = true;
break;
}
REP(j, 8){
if (s[j] == '1')
cell[i][j] = true;
}
}
if (br)
break;
REP(i, 8){
REP(j, 8){
if (cell[i][j]){
REP(k, 3)
REP(l, 3)
if (i + (k - 1) >= 0 && i + (k - 1) < 8 && j + (l - 1) >= 0 && j + (l - 1) < 8 && cell[i + (k - 1)][j + (l - 1)])
ans += 1 << (8 - (k * 3 + l));
i = 8;
j = 8;
}
}
}
switch (ans){
case 27:
cout << 'A' << endl;
break;
case 18:
cout << 'B' << endl;
break;
case 24:
cout << 'C' << endl;
break;
case 22:
cout << 'D' << endl;
break;
case 25:
cout << 'E' << endl;
break;
case 19:
cout << 'F' << endl;
break;
case 30:
cout << 'G' << endl;
break;
}
}
}
|
a.cc: In function 'int main()':
a.cc:54:36: error: cannot convert 'std::__cxx11::basic_string<char>::empty' from type 'bool (std::__cxx11::basic_string<char>::)() const noexcept' to type 'bool'
54 | if (s.empty){
| ^
|
s264065628
|
p00036
|
C++
|
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <stack>
using namespace std;
#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
bool hasA(int bd[8][8]) {
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 7; j++) {
if (bd[i][j] && bd[i][j+1] && bd[i+1][j] && bd[i+1][j+1]) return true;
}
}
return false;
}
bool hasB(int bd[8][8]) {
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 8; j++) {
if (bd[i][j] && bd[i+1][j] && bd[i+2][j] && bd[i+3][j]) return true;
}
}
return false;
}
bool hasC(int bd[8][8]) {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 5; j++) {
if (bd[i][j] && bd[i][j+1] && bd[i][j+2] && bd[i][j+3]) return true;
}
}
return false;
}
bool hasD(int bd[8][8]) {
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 7; j++) {
if (bd[i][j+1] && bd[i+1][j] && bd[i+1][j+1] && bd[i+2][j]) return true;
}
}
return false;
}
bool hasE(int bd[8][8]) {
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 6; j++) {
if (bd[i][j] && bd[i][j+1] && bd[i+1][j+1] && bd[i+1][j+2]) return true;
}
}
return false;
}
bool hasF(int bd[8][8]) {
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 7; j++) {
if (bd[i][j] && bd[i+1][j] && bd[i+1][j+1] && bd[i+2][j+1]) return true;
}
}
return false;
}
bool hasG(int bd[8][8]) {
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 6; j++) {
if (bd[i][j+1] && bd[i][j+2] && bd[i+1][j] && bd[i+1][j+1]) return true;
}
}
return false;
}
int main36() {
string s;
int bd[8][8];
while(cin >> s) {
REP(i,8) bd[0][i] = s[i] - '0';
REP(j,7) {
cin >> s;
REP(i,8) bd[j+1][i] = s[i] - '0';
}
// input ends
if (hasA(bd)) cout << "A" << endl;
else if (hasB(bd)) cout << "B" << endl;
else if (hasC(bd)) cout << "C" << endl;
else if (hasD(bd)) cout << "D" << endl;
else if (hasE(bd)) cout << "E" << endl;
else if (hasF(bd)) cout << "F" << endl;
else if (hasG(bd)) cout << "G" << endl;
}
return 0;
}
|
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s052844215
|
p00036
|
C++
|
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <stack>
using namespace std;
#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
bool hasA(int bd[8][8]) {
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 7; j++) {
if (bd[i][j] && bd[i][j+1] && bd[i+1][j] && bd[i+1][j+1]) return true;
}
}
return false;
}
bool hasB(int bd[8][8]) {
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 8; j++) {
if (bd[i][j] && bd[i+1][j] && bd[i+2][j] && bd[i+3][j]) return true;
}
}
return false;
}
bool hasC(int bd[8][8]) {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 5; j++) {
if (bd[i][j] && bd[i][j+1] && bd[i][j+2] && bd[i][j+3]) return true;
}
}
return false;
}
bool hasD(int bd[8][8]) {
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 7; j++) {
if (bd[i][j+1] && bd[i+1][j] && bd[i+1][j+1] && bd[i+2][j]) return true;
}
}
return false;
}
bool hasE(int bd[8][8]) {
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 6; j++) {
if (bd[i][j] && bd[i][j+1] && bd[i+1][j+1] && bd[i+1][j+2]) return true;
}
}
return false;
}
bool hasF(int bd[8][8]) {
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 7; j++) {
if (bd[i][j] && bd[i+1][j] && bd[i+1][j+1] && bd[i+2][j+1]) return true;
}
}
return false;
}
bool hasG(int bd[8][8]) {
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 6; j++) {
if (bd[i][j+1] && bd[i][j+2] && bd[i+1][j] && bd[i+1][j+1]) return true;
}
}
return false;
}
int main36() {
string s;
int bd[8][8];
while(cin >> s) {
REP(i,8) bd[0][i] = s[i] - '0';
REP(j,7) {
cin >> s;
REP(i,8) bd[j+1][i] = s[i] - '0';
}
// input ends
if (hasA(bd)) cout << "A" << endl;
else if (hasB(bd)) cout << "B" << endl;
else if (hasC(bd)) cout << "C" << endl;
else if (hasD(bd)) cout << "D" << endl;
else if (hasE(bd)) cout << "E" << endl;
else if (hasF(bd)) cout << "F" << endl;
else if (hasG(bd)) cout << "G" << endl;
}
return 0;
}
|
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s437272304
|
p00036
|
C++
|
#include <bits/stdc++.h>
using namespace std;
typedef complex<int> P;
namespace std{
bool operator < (const P &a,const P &b){
if( a.real() != b.real() ) return a.real() < b.real();
return a.imag() < b.imag();
}
bool operator == (const P &a,const P &b){
if( a.real() != b.real() ) return false;
return a.imag() == b.imag();
}
};
vector<vector<P>> ptn = {
{P(0,0),P(1,1),P(1,0),P(0,1)},
{P(0,0),P(0,2),P(0,1),p(0,3)},
{P(0,0),P(1,0),P(2,0),P(3,0)},
{P(1,0),P(1,1),P(0,1),P(0,2)},
{P(0,0),P(1,0),P(1,1),P(2,1)},
{P(0,0),P(0,1),P(1,1),P(1,2)},
{P(1,0),P(2,0),P(0,1),P(1,1)}
};
string s[8];
int main(){
while(true){
for(int i = 0 ; i < 8 ; i++){
if(!(cin >> s[i]))exit(0);
}
for(int i = 0 ; i < 7 ; i++)
sort(ptn[i].begin(),ptn[i].end());
for(int i = -10 ; i <= 10 ; i++)
for(int j = -10 ; j <= 10 ; j++){
vector<P> tmp;
for(int y = 0 ; y < 8 ; y++)
for(int x = 0 ; x < 8 ; x++){
if( s[y][x] == '1'){
tmp.push_back(P(x-j,y-i));
}
}
sort(tmp.begin(),tmp.end());
for(int k = 0 ; k < 7 ; k++){
if( tmp == ptn[k] ){
cout << (char)(k+'A') << endl;
}
}
}
}
}
|
a.cc:19:31: error: 'p' was not declared in this scope
19 | {P(0,0),P(0,2),P(0,1),p(0,3)},
| ^
a.cc:25:1: error: could not convert '{{std::complex<int>(0, 0), std::complex<int>(1, 1), std::complex<int>(1, 0), std::complex<int>(0, 1)}, {std::complex<int>(0, 0), std::complex<int>(0, 2), std::complex<int>(0, 1), <expression error>}, {std::complex<int>(0, 0), std::complex<int>(1, 0), std::complex<int>(2, 0), std::complex<int>(3, 0)}, {std::complex<int>(1, 0), std::complex<int>(1, 1), std::complex<int>(0, 1), std::complex<int>(0, 2)}, {std::complex<int>(0, 0), std::complex<int>(1, 0), std::complex<int>(1, 1), std::complex<int>(2, 1)}, {std::complex<int>(0, 0), std::complex<int>(0, 1), std::complex<int>(1, 1), std::complex<int>(1, 2)}, {std::complex<int>(1, 0), std::complex<int>(2, 0), std::complex<int>(0, 1), std::complex<int>(1, 1)}}' from '<brace-enclosed initializer list>' to 'std::vector<std::vector<std::complex<int> > >'
25 | };
| ^
| |
| <brace-enclosed initializer list>
|
s294516169
|
p00036
|
C++
|
#include <bits/stdc++.h>
using namespace std;
typedef complex<int> P;
namespace std{
bool operator < (const P &a,const P &b){
if( a.real() != b.real() ) return a.real() < b.real();
return a.imag() < b.imag();
}
bool operator == (const P &a,const P &b){
if( a.real() != b.real() ) return false;
return a.imag() == b.imag();
}
};
vector<vector<P>> ptn = {
{P(0,0),P(1,1),P(1,0),P(0,1)},
{P(0,0),P(0,2),P(0,1),p(0,3)},
{P(0,0),P(1,0),P(2,0),P(3,0)},
{P(1,0),P(1,1),P(0,1),P(0,2)},
{P(0,0),P(1,0),P(1,1),P(2,1)},
{P(0,0),P(0,1),P(1,1),P(1,2)},
{P(1,0),P(2,0),P(0,1),P(1,1)}
};
string s[8];
int main(){
while(true){
for(int i = 0 ; i < 8 ; i++){
if(!(cin >> s[i]))exit(0);
}
for(int i = 0 ; i < 7 ; i++)
sort(ptn[i].begin(),ptn[i].end());
for(int i = -10 ; i <= 10 ; i++)
for(int j = -10 ; j <= 10 ; j++){
vector<P> tmp;
for(int y = 0 ; y < 8 ; y++)
for(int x = 0 ; x < 8 ; x++){
if( s[y][x] == '1'){
tmp.push_back(P(x-j,y-i));
}
}
sort(tmp.begin(),tmp.end());
for(int k = 0 ; k < 7 ; k++){
if( tmp == ptn[k] ){
cout << (char)(k+'A') << endl;
}
}
}
}
}
|
a.cc:19:31: error: 'p' was not declared in this scope
19 | {P(0,0),P(0,2),P(0,1),p(0,3)},
| ^
a.cc:25:1: error: could not convert '{{std::complex<int>(0, 0), std::complex<int>(1, 1), std::complex<int>(1, 0), std::complex<int>(0, 1)}, {std::complex<int>(0, 0), std::complex<int>(0, 2), std::complex<int>(0, 1), <expression error>}, {std::complex<int>(0, 0), std::complex<int>(1, 0), std::complex<int>(2, 0), std::complex<int>(3, 0)}, {std::complex<int>(1, 0), std::complex<int>(1, 1), std::complex<int>(0, 1), std::complex<int>(0, 2)}, {std::complex<int>(0, 0), std::complex<int>(1, 0), std::complex<int>(1, 1), std::complex<int>(2, 1)}, {std::complex<int>(0, 0), std::complex<int>(0, 1), std::complex<int>(1, 1), std::complex<int>(1, 2)}, {std::complex<int>(1, 0), std::complex<int>(2, 0), std::complex<int>(0, 1), std::complex<int>(1, 1)}}' from '<brace-enclosed initializer list>' to 'std::vector<std::vector<std::complex<int> > >'
25 | };
| ^
| |
| <brace-enclosed initializer list>
|
s005495814
|
p00036
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
while (!cin.eof) {
char c[8][8];
for (int i = 0; i < 8; i++)
for (int j = 0; j < 8; j++)
cin >> c[i][j];
int a, b;
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (c[i][j] == '1') {
a = i;
b = j;
goto C;
}
}
}
C:
if (c[a][b + 1] == '1')
if (c[a + 1][b] == '1')
if (c[a + 1][b + 1] == '1')
cout << 'A';
else cout << 'G';
else
if (c[a + 1][b + 1] == '1')
cout << 'E';
else cout << 'C';
else if (c[a + 1][b + 1] == '1')
cout << 'F';
else if (c[a - 1][b + 1] == '1')
cout << 'D';
else cout << 'C';
cout << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:5:21: error: cannot convert 'std::basic_ios<char>::eof' from type 'bool (std::basic_ios<char>::)() const' to type 'bool'
5 | while (!cin.eof) {
| ^~~
a.cc:5:21: error: in argument to unary !
5 | while (!cin.eof) {
| ~~~~^~~
|
s620202010
|
p00036
|
C++
|
import java.util.Scanner;
public class Main {
private Scanner sc;
public static void main(String[] args) {
new Main_format();
}
public Main() {
sc = new Scanner(System.in);
while (sc.hasNext() == true) {
int[][] map = new int[8][8];
for (int i = 0; i < 8; i++) {
String line = sc.nextLine();
for (int j = 0; j < 8; j++) {
map[i][j] = line.charAt(j) - '0';
}
}
int state = 0;
int max = 8;
int k = 0;
boolean end = false;
for (int i = 0; i < max; i++) {
for (int j = k; j < 8; j++) {
if (map[i][j] == 1) {
switch (state) {
case 0:
state = 1;
max = i + 4;
k = j - 1;
break;
case 1:
state = 2;
break;
case 2:
state = 3;
break;
case 3:
System.out.println("C");
end = true;
break;
case 4:
if (j == k) {
System.out.println("D");
end = true;
} else {
state = 6;
}
break;
case 5:
if (j == k) {
System.out.println("G");
end = true;
} else if (j == (k + 1)) {
System.out.println("A");
end = true;
} else {
System.out.println("E");
end = true;
}
case 6:
System.out.println("F");
end = true;
break;
}
}
if (end == true) break;
}
if ((state == 1) || (state == 2)) {
state = state + 3;
} if (state == 6) {
System.out.println("B");
end = true;
}
if (end == true) break;
}
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s588819813
|
p00036
|
C++
|
import java.util.Scanner;
public class Main {
static Scanner sc = new java.util.Scanner(System.in);
// static int[][] num =new int [8][8];
public static void main(String[] args) {
int[][] num = new int[15][15];
String str = "";
while (sc.hasNextLine()) {
// num[][]????????????
syokika(num);
// ???????????¨????????????????´?
for (int i = 0; i < 8; i++) {
str = sc.next();
String[] st = str.split("");
for (int j = 0; j < 8; j++) {
num[i][j] = Integer.parseInt(st[j]);
}
}
// ????????????
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if(num[i][j]==1&&num[i][j+1]==1&&num[i+1][j]==1&&num[i+1][j+1]==1){
System.out.println("A");
}else if(num[i][j]==1&&num[i+1][j]==1&&num[i+2][j]==1&&num[i+3][j]==1){
System.out.println("B");
}else if(num[i][j]==1&&num[i][j+1]==1&&num[i][j+2]==1&&num[i][j+3]==1){
System.out.println("C");
}else if(num[i][j+1]==1&&num[i+1][j]==1&&num[i][j+1]==1&&num[i+2][j]==1){
System.out.println("D");
}else if(num[i][j]==1&&num[i][j+1]==1&&num[i+1][j+1]==1&&num[i+1][j+2]==1){
System.out.println("E");
}else if(num[i][j]==1&&num[i+1][j]==1&&num[i+1][j+1]==1&&num[i+2][j+1]==1){
System.out.println("F");
}else if(num[i][j+1]==1&&num[i][j+2]==1&&num[i+1][j]==1&&num[i+1][j+1]==1){
System.out.println("B");
}
}
}
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s686864478
|
p00036
|
C++
|
import java.util.Scanner;
public class Main {
static Scanner sc = new java.util.Scanner(System.in);
// static int[][] num =new int [8][8];
public static void main(String[] args) {
int[][] num = new int[15][15];
String str = "";
while (sc.hasNextLine()) {
// num[][]????????????
syokika(num);
// ???????????¨????????????????´?
for (int i = 0; i < 8; i++) {
str = sc.next();
String[] st = str.split("");
for (int j = 0; j < 8; j++) {
num[i][j] = Integer.parseInt(st[j]);
}
}
// ????????????
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (num[i][j] == 1 && num[i][j + 1] == 1 && num[i + 1][j] == 1 && num[i + 1][j + 1] == 1) {
System.out.println("A");
} else if (num[i][j] == 1 && num[i + 1][j] == 1 && num[i + 2][j] == 1 && num[i + 3][j] == 1) {
System.out.println("B");
} else if (num[i][j] == 1 && num[i][j + 1] == 1 && num[i][j + 2] == 1 && num[i][j + 3] == 1) {
System.out.println("C");
} else if (num[i][j + 1] == 1 && num[i + 1][j] == 1 && num[i][j + 1] == 1 && num[i + 2][j] == 1) {
System.out.println("D");
} else if (num[i][j] == 1 && num[i][j + 1] == 1 && num[i + 1][j + 1] == 1
&& num[i + 1][j + 2] == 1) {
System.out.println("E");
} else if (num[i][j] == 1 && num[i + 1][j] == 1 && num[i + 1][j + 1] == 1
&& num[i + 2][j + 1] == 1) {
System.out.println("F");
} else if (num[i][j + 1] == 1 && num[i][j + 2] == 1 && num[i + 1][j] == 1
&& num[i + 1][j + 1] == 1) {
System.out.println("B");
}
}
}
}
}
// ???????????¢??°
public static int[][] syokika(int[][] num) {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
num[i][j] = 0;
}
}
return num;
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s104786496
|
p00036
|
C++
|
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<math.h>
#include<bitset>
using namespace std;
int main(){
int a,b;
char map[64];
int movex[4]={1,0,-1,0},movey[4]={0,1,0,-1};
while(cin>>map[0]){
for(int i=1;i<64;i++){
cin>>map[i];
}
int i,j;
for(i=0;i<64;i++){
if(map[i]=='1'){
break;
}
}
if(map[i+1]=='1'){
if(map[i+8]=='1'&&map[i+9]=='1'){
cout<<"A"<<endl;
}
else if(map[i+2]=='1'&&map[i+3]=='1'){
cout<<"C"<<endl;
}
else if(map[i+9]=='1'&&map[i+10]=='1'){
cout<<"E"<<endl;
}
else if(map[i+7]=='1'&&map[i+8]=='1'){
cout<<"G"<<endl;
}
}
else if(map[i+8]=='1'){
if(map[i+16]=='1'&&map[i+24]=='1'){
cout<<"B"<<endl;
}
else if(map[i+7]=='1'&&map[i+15]){
cout<<"D"<<endl;
}
else if(map[i+9]=='1'&&map[i+17]=='1'){
cout<<"F"<<endl;
}
}
memset(map,'0',sizeof(map));
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:47:17: error: 'memset' was not declared in this scope
47 | memset(map,'0',sizeof(map));
| ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
6 | #include<bitset>
+++ |+#include <cstring>
7 | using namespace std;
|
s937483204
|
p00036
|
C++
|
#include<bits/c++std.h>
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<math.h>
#include<bitset>
using namespace std;
int main(){
int a,b;
char map[64];
int movex[4]={1,0,-1,0},movey[4]={0,1,0,-1};
while(cin>>map[0]){
for(int i=1;i<64;i++){
cin>>map[i];
}
int i,j;
for(i=0;i<64;i++){
if(map[i]=='1'){
break;
}
}
if(map[i+1]=='1'){
if(map[i+8]=='1'&&map[i+9]=='1'){
cout<<"A"<<endl;
}
else if(map[i+2]=='1'&&map[i+3]=='1'){
cout<<"C"<<endl;
}
else if(map[i+9]=='1'&&map[i+10]=='1'){
cout<<"E"<<endl;
}
else if(map[i+7]=='1'&&map[i+8]=='1'){
cout<<"G"<<endl;
}
}
else if(map[i+8]=='1'){
if(map[i+16]=='1'&&map[i+24]=='1'){
cout<<"B"<<endl;
}
else if(map[i+7]=='1'&&map[i+15]){
cout<<"D"<<endl;
}
else if(map[i+9]=='1'&&map[i+17]=='1'){
cout<<"F"<<endl;
}
}
memset(map,'0',sizeof(map));
}
return 0;
}
|
a.cc:1:9: fatal error: bits/c++std.h: No such file or directory
1 | #include<bits/c++std.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s309947215
|
p00036
|
C++
|
#include<iostream>
using namespace std;
int main() {
char c[10][10];
while (cin>>c[0][0]){
for (int i = 0; i < 8; i++)
for (int j = 0; j < 8; j++)
if(!i&&!j)continue;
cin >> c[i][j];
int a, b;
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (c[i][j] == '1') {
a = i;
b = j;
goto C;
}
}
}
C:
if (c[a][b + 1] == '1') {
if (c[a + 1][b] == '1') {
if (c[a + 1][b + 1] == '1')
cout << 'A';
else cout << 'G';
}
else {
if (c[a + 1][b + 1] == '1')
cout << 'E';
else cout << 'C';
}
}
else if (c[a + 1][b + 1] == '1')
cout << 'F';
else if (c[a + 1][b - 1] == '1')
cout << 'D';
else cout << 'B';
cout << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:26: error: 'i' was not declared in this scope
9 | cin >> c[i][j];
| ^
a.cc:9:29: error: 'j' was not declared in this scope
9 | cin >> c[i][j];
| ^
|
s876656081
|
p00036
|
C++
|
#include<iostream>
using namespace std;
int main() {
char c[10][10];
while (cin>>c[0][0]){
for (int i = 0; i < 8; i++)
for (int j = 0; j < 8; j++)
if(!i&&!j)continue;
cin >> c[i][j];
int a, b;
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (c[i][j] == '1') {
a = i;
b = j;
goto C;
}
}
}
C:
if (c[a][b + 1] == '1') {
if (c[a + 1][b] == '1') {
if (c[a + 1][b + 1] == '1')
cout << 'A';
else cout << 'G';
}
else {
if (c[a + 1][b + 1] == '1')
cout << 'E';
else cout << 'C';
}
}
else if (c[a + 1][b + 1] == '1')
cout << 'F';
else if (c[a + 1][b - 1] == '1')
cout << 'D';
else cout << 'B';
cout << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:26: error: 'i' was not declared in this scope
9 | cin >> c[i][j];
| ^
a.cc:9:29: error: 'j' was not declared in this scope
9 | cin >> c[i][j];
| ^
|
s583289721
|
p00036
|
C++
|
#include<iostream>
using namespace std;
int main() {
char c[10][10];
while (cin>>c[0][0]){
for (int i = 0; i < 8; i++)
for (int j = 0; j < 8; j++)
if(i==0&&j==0)continue;
cin >> c[i][j];
int a, b;
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (c[i][j] == '1') {
a = i;
b = j;
goto C;
}
}
}
C:
if (c[a][b + 1] == '1') {
if (c[a + 1][b] == '1') {
if (c[a + 1][b + 1] == '1')
cout << 'A';
else cout << 'G';
}
else {
if (c[a + 1][b + 1] == '1')
cout << 'E';
else cout << 'C';
}
}
else if (c[a + 1][b + 1] == '1')
cout << 'F';
else if (c[a + 1][b - 1] == '1')
cout << 'D';
else cout << 'B';
cout << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:26: error: 'i' was not declared in this scope
9 | cin >> c[i][j];
| ^
a.cc:9:29: error: 'j' was not declared in this scope
9 | cin >> c[i][j];
| ^
|
s055003825
|
p00036
|
C++
|
input_lines = int(input())
for i in range(input_lines):
s = i
#for i range 8:
print (s)
|
a.cc:5:2: error: invalid preprocessing directive #for
5 | #for i range 8:
| ^~~
a.cc:1:1: error: 'input_lines' does not name a type
1 | input_lines = int(input())
| ^~~~~~~~~~~
|
s911055700
|
p00036
|
C++
|
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
|
s577055652
|
p00036
|
C++
|
#include <iostream>
#include <string>
using namespace std;int main(){int b[5][4];int sx,sy;int x,y;string line;while(true){for(int i=0;i<20;i++)b[i%5][i/5]=0;sx=sy=-1;for(y=0;y<8;y++){if (!(cin>>line))break;for(x=0;x<8;x++){if (line[x]=='1'){if (sy==-1){sx=x-1;sy=y;}b[x-sx][y-sy] = 1;}}}if (y<8)break;char a;if(b[2][0]&&b[1][1]&&b[2][1])a='A';if(b[1][3])a='B';if(b[4][0])a="C";if(b[0][2])a="D";if(b[3][1])a="E";if(b[2][2])a="F";if(b[0][1]&&b[2][0])a="G";cout<<a<<endl;}}
|
a.cc: In function 'int main()':
a.cc:3:337: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
3 | using namespace std;int main(){int b[5][4];int sx,sy;int x,y;string line;while(true){for(int i=0;i<20;i++)b[i%5][i/5]=0;sx=sy=-1;for(y=0;y<8;y++){if (!(cin>>line))break;for(x=0;x<8;x++){if (line[x]=='1'){if (sy==-1){sx=x-1;sy=y;}b[x-sx][y-sy] = 1;}}}if (y<8)break;char a;if(b[2][0]&&b[1][1]&&b[2][1])a='A';if(b[1][3])a='B';if(b[4][0])a="C";if(b[0][2])a="D";if(b[3][1])a="E";if(b[2][2])a="F";if(b[0][1]&&b[2][0])a="G";cout<<a<<endl;}}
| ^~~
| |
| const char*
a.cc:3:354: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
3 | using namespace std;int main(){int b[5][4];int sx,sy;int x,y;string line;while(true){for(int i=0;i<20;i++)b[i%5][i/5]=0;sx=sy=-1;for(y=0;y<8;y++){if (!(cin>>line))break;for(x=0;x<8;x++){if (line[x]=='1'){if (sy==-1){sx=x-1;sy=y;}b[x-sx][y-sy] = 1;}}}if (y<8)break;char a;if(b[2][0]&&b[1][1]&&b[2][1])a='A';if(b[1][3])a='B';if(b[4][0])a="C";if(b[0][2])a="D";if(b[3][1])a="E";if(b[2][2])a="F";if(b[0][1]&&b[2][0])a="G";cout<<a<<endl;}}
| ^~~
| |
| const char*
a.cc:3:371: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
3 | using namespace std;int main(){int b[5][4];int sx,sy;int x,y;string line;while(true){for(int i=0;i<20;i++)b[i%5][i/5]=0;sx=sy=-1;for(y=0;y<8;y++){if (!(cin>>line))break;for(x=0;x<8;x++){if (line[x]=='1'){if (sy==-1){sx=x-1;sy=y;}b[x-sx][y-sy] = 1;}}}if (y<8)break;char a;if(b[2][0]&&b[1][1]&&b[2][1])a='A';if(b[1][3])a='B';if(b[4][0])a="C";if(b[0][2])a="D";if(b[3][1])a="E";if(b[2][2])a="F";if(b[0][1]&&b[2][0])a="G";cout<<a<<endl;}}
| ^~~
| |
| const char*
a.cc:3:388: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
3 | using namespace std;int main(){int b[5][4];int sx,sy;int x,y;string line;while(true){for(int i=0;i<20;i++)b[i%5][i/5]=0;sx=sy=-1;for(y=0;y<8;y++){if (!(cin>>line))break;for(x=0;x<8;x++){if (line[x]=='1'){if (sy==-1){sx=x-1;sy=y;}b[x-sx][y-sy] = 1;}}}if (y<8)break;char a;if(b[2][0]&&b[1][1]&&b[2][1])a='A';if(b[1][3])a='B';if(b[4][0])a="C";if(b[0][2])a="D";if(b[3][1])a="E";if(b[2][2])a="F";if(b[0][1]&&b[2][0])a="G";cout<<a<<endl;}}
| ^~~
| |
| const char*
a.cc:3:414: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
3 | using namespace std;int main(){int b[5][4];int sx,sy;int x,y;string line;while(true){for(int i=0;i<20;i++)b[i%5][i/5]=0;sx=sy=-1;for(y=0;y<8;y++){if (!(cin>>line))break;for(x=0;x<8;x++){if (line[x]=='1'){if (sy==-1){sx=x-1;sy=y;}b[x-sx][y-sy] = 1;}}}if (y<8)break;char a;if(b[2][0]&&b[1][1]&&b[2][1])a='A';if(b[1][3])a='B';if(b[4][0])a="C";if(b[0][2])a="D";if(b[3][1])a="E";if(b[2][2])a="F";if(b[0][1]&&b[2][0])a="G";cout<<a<<endl;}}
| ^~~
| |
| const char*
|
s759507978
|
p00036
|
C++
|
#include <iostream>
main(){int b[5][4],s,t,x,y;char l[8];for(;;){for(int i=0;i<20;i++)b[i%5][i/5]=0;sx=sy=9;for(y=0;y<8;y++){if(!(std::cin>>l))break;for(x=0;x<8;x++){if(l[x]=='1'){if(t==9){s=x-1;t=y;}b[x-s][y-t]=1;}}}if (y<8)break;char a='A';if(b[1][3])a='B';if(b[4][0])a='C';if(b[0][2])a='D';if(b[3][1])a='E';if(b[2][2])a='F';if(b[0][1]&&b[2][0])a='G';std::cout<<a<<"\n";}}
|
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){int b[5][4],s,t,x,y;char l[8];for(;;){for(int i=0;i<20;i++)b[i%5][i/5]=0;sx=sy=9;for(y=0;y<8;y++){if(!(std::cin>>l))break;for(x=0;x<8;x++){if(l[x]=='1'){if(t==9){s=x-1;t=y;}b[x-s][y-t]=1;}}}if (y<8)break;char a='A';if(b[1][3])a='B';if(b[4][0])a='C';if(b[0][2])a='D';if(b[3][1])a='E';if(b[2][2])a='F';if(b[0][1]&&b[2][0])a='G';std::cout<<a<<"\n";}}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:81: error: 'sx' was not declared in this scope; did you mean 'x'?
2 | main(){int b[5][4],s,t,x,y;char l[8];for(;;){for(int i=0;i<20;i++)b[i%5][i/5]=0;sx=sy=9;for(y=0;y<8;y++){if(!(std::cin>>l))break;for(x=0;x<8;x++){if(l[x]=='1'){if(t==9){s=x-1;t=y;}b[x-s][y-t]=1;}}}if (y<8)break;char a='A';if(b[1][3])a='B';if(b[4][0])a='C';if(b[0][2])a='D';if(b[3][1])a='E';if(b[2][2])a='F';if(b[0][1]&&b[2][0])a='G';std::cout<<a<<"\n";}}
| ^~
| x
a.cc:2:84: error: 'sy' was not declared in this scope; did you mean 'y'?
2 | main(){int b[5][4],s,t,x,y;char l[8];for(;;){for(int i=0;i<20;i++)b[i%5][i/5]=0;sx=sy=9;for(y=0;y<8;y++){if(!(std::cin>>l))break;for(x=0;x<8;x++){if(l[x]=='1'){if(t==9){s=x-1;t=y;}b[x-s][y-t]=1;}}}if (y<8)break;char a='A';if(b[1][3])a='B';if(b[4][0])a='C';if(b[0][2])a='D';if(b[3][1])a='E';if(b[2][2])a='F';if(b[0][1]&&b[2][0])a='G';std::cout<<a<<"\n";}}
| ^~
| y
|
s620286350
|
p00036
|
C++
|
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
public class Main{
Scanner sc;
static final int INF=1<<28;
static final double EPS=1e-9;
class B{
int[][] a;
String name;
B(int[][] a, String name){
this.a=a;
this.name=name;
}
}
int[][] A={{1, 1}, {1, 1}};
int[][] B={{1}, {1}, {1}, {1}};
int[][] C={{1, 1, 1, 1}};
int[][] D={{0, 1}, {1, 1}, {1, 0}};
int[][] E={{1, 1, 0}, {0, 1, 1}};
int[][] F={{1, 0}, {1, 1}, {0, 1}};
int[][] G={{0, 1, 1}, {1, 1, 0}};
int[][] field;
int n=8;
void run(){
LinkedList<B> blocks=new LinkedList<B>();
blocks.add(new B(A, "A"));
blocks.add(new B(B, "B"));
blocks.add(new B(C, "C"));
blocks.add(new B(D, "D"));
blocks.add(new B(E, "E"));
blocks.add(new B(F, "F"));
blocks.add(new B(G, "G"));
sc=new Scanner(System.in);
for(; sc.hasNext();){
field=new int[n][n];
for(int j=0; j<n; j++){
String s=sc.nextLine();
for(int i=0; i<n; i++){
if(s.charAt(i)=='0')
field[j][i]=0;
else
field[j][i]=1;
}
}
boolean f=false;
for(int j=0; j<n; j++){
for(int i=0; i<n; i++){
for(B b : blocks){
if(match(b, i, j)){
println(b.name);
f=true;
break;
}
}
if(f)
break;
}
if(f)
break;
}
sc.nextLine();
}
sc.close();
}
boolean match(B b, int x, int y){
int[][] a=b.a;
for(int j=0; j<a.length; j++){
for(int i=0; i<a[0].length; i++){
int x2=x+i;
int y2=y+j;
if(x2<0||x2>=n||y2<0||y2>=n)
return false;
if(a[j][i]==1&&field[y2][x2]==0)
return false;
}
}
return true;
}
void print(String s){
System.out.print(s);
}
void println(String s){
System.out.println(s);
}
public static void main(String[] args){
new Main().run();
}
}
|
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:2:1: error: 'import' does not name a type
2 | import java.lang.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.math.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.io.*;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
6 | import static java.lang.Math.*;
| ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
7 | import static java.util.Arrays.*;
| ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: expected unqualified-id before 'public'
9 | public class Main{
| ^~~~~~
|
s255658123
|
p00036
|
C++
|
pln[14][14];
main(i,j,c,f){
while(1){
for(i=3;i<11;i++){
for(j=3;j<11;j++) pln[i][j]=getchar();
if(getchar()==-1) exit(0);
}
for(i=3;i<11;i++)for(j=3;j<11;j++)pln[i][j]-='0';
getchar();
f=1;
for(i=3;f&&i<11;i++)for(j=3;f&&j<11;j++)
if(pln[i][j]){
if (pln[i+3][j]) c='B';
else if(pln[i][j+3]) c='C';
else if(pln[i+2][j-1]) c='D';
else if(pln[i+1][j+2]) c='E';
else if(pln[i+2][j+1]) c='F';
else if(!pln[i+1][j+1]) c='G';
else c='A';
f=0;
}
printf("%c\n",c);
}
}
|
a.cc:1:1: error: 'pln' does not name a type
1 | pln[14][14];
| ^~~
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
2 | main(i,j,c,f){
| ^
|
s039693758
|
p00036
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int main()
{
char field[11][11];
string r;
int i,j;
do {
for (i=0; i<8; i++)
{
scanf("%s",field[i]);
}
for (i=0; i<8; i++)
{
for (j=0; j<8; j++)
{
if (field[i][j] == '1')goto b;
}
}
b:
if (field[i][j+1] == '1')
{
if (field[i][j+2] == '1')
r="C";
else if (field[i+1][j] == '1')
r="A";
else
r="E";
} else {
if (field[i+2][j] == '1')
r="B";
else if (field[i+1][j+1] == '1')
r="F";
else
r="D";
}
cout << r << endl;
} while (getline() != NULL);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:40:21: error: no matching function for call to 'getline()'
40 | } while (getline() != NULL);
| ~~~~~~~^~
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:907:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
907 | getline(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:907:5: note: candidate expects 3 arguments, 0 provided
In file included from /usr/include/c++/14/string:54:
/usr/include/c++/14/bits/basic_string.h:4117:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4117 | getline(basic_istream<_CharT, _Traits>& __is,
| ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:4117:5: note: candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
4125 | getline(basic_istream<_CharT, _Traits>&& __is,
| ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/basic_string.h:4132:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4132 | getline(basic_istream<_CharT, _Traits>&& __is,
| ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:4132:5: note: candidate expects 2 arguments, 0 provided
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154:
/usr/include/stdio.h:697:18: note: candidate: '__ssize_t getline(char**, size_t*, FILE*)'
697 | extern __ssize_t getline (char **__restrict __lineptr,
| ^~~~~~~
/usr/include/stdio.h:697:18: note: candidate expects 3 arguments, 0 provided
|
s550752010
|
p00036
|
C++
|
#include<iostream>
#include<string>
#include<cstdio>
using namespace std;
char n[12][12];
char figure[7][4][4] = {
{"1100","1100","0000","0000"},
{"1000","1000","1000","1000"},
{"1111","0000","0000","0000"},
{"0100","1100","1000","0000"},
{"1100","0110","0000","0000"},
{"1000","1100","0100","0000"},
{"0110","1100","0000","0000"}
};
int main(){
for(int i=0; i<12; i++)
for(int j=0; j<12; j++)
n[i][j]='0';
while(~scanf("%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n\n", n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7])){
for(int i=0; i<8; i++)
for(int j=0; j<8; j++)
cin >> n[i][j];
for(int i=0; i<7; i++){
for(int j=0; j<8; j++){
for(int k=0; k<8; k++){
bool flag=true;
for(int x=0; x<4; x++){
for(int y=0; y<4; y++){
if(figure[i][x][y] != n[j+x][k+y]) flag = false;
}
}
if(flag){
cout << (char)('A'+i) << endl;
}
}
}
}
}
return 0;
}
|
a.cc:7:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
7 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:7:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
7 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:7:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
7 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:7:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
7 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:8:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:8:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:8:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:8:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:9:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:9:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:9:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:9:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:10:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:10:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:10:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:10:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:11:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:11:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:11:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:11:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:12:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:12:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:12:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:12:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:13:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:13:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:13:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:13:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"0110","1100","0000","0000"}
| ^~~~~~
|
s057683701
|
p00036
|
C++
|
#include<iostream>
#include<string>
#include<cstdio>
using namespace std;
char n[12][12];
char figure[7][4][4] = {
{"1100","1100","0000","0000"},
{"1000","1000","1000","1000"},
{"1111","0000","0000","0000"},
{"0100","1100","1000","0000"},
{"1100","0110","0000","0000"},
{"1000","1100","0100","0000"},
{"0110","1100","0000","0000"}
};
int main(){
for(int i=0; i<12; i++)
for(int j=0; j<12; j++)
n[i][j]='0';
while(~scanf("%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n\n", n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7])){
for(int i=0; i<8; i++)
for(int j=0; j<8; j++)
cin >> n[i][j];
for(int i=0; i<7; i++){
for(int j=0; j<8; j++){
for(int k=0; k<8; k++){
bool flag=true;
for(int x=0; x<4; x++){
for(int y=0; y<4; y++){
if(figure[i][x][y] != n[j+x][k+y]) flag = false;
}
}
if(flag){
cout << (char)('A'+i) << endl;
}
}
}
}
}
return 0;
}
|
a.cc:7:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
7 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:7:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
7 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:7:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
7 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:7:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
7 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:8:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:8:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:8:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:8:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:9:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:9:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:9:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:9:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:10:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:10:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:10:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:10:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:11:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:11:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:11:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:11:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:12:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:12:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:12:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:12:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:13:10: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:13:17: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:13:24: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:13:31: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"0110","1100","0000","0000"}
| ^~~~~~
|
s767839023
|
p00036
|
C++
|
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
char n[12][12];
char figure[7][4][4] = {
{"1100","1100","0000","0000"},
{"1000","1000","1000","1000"},
{"1111","0000","0000","0000"},
{"0100","1100","1000","0000"},
{"1100","0110","0000","0000"},
{"1000","1100","0100","0000"},
{"0110","1100","0000","0000"}
};
for(int i=0; i<12; i++)
for(int j=0; j<12; j++)
n[i][j]='0';
while(~scanf("%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n\n", n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7])){
for(int i=0; i<8; i++)
for(int j=0; j<8; j++)
cin >> n[i][j];
for(int i=0; i<7; i++){
for(int j=0; j<8; j++){
for(int k=0; k<8; k++){
bool flag=true;
for(int x=0; x<4; x++){
for(int y=0; y<4; y++){
if(figure[i][x][y] != n[j+x][k+y]) flag = false;
}
}
if(flag){
cout << (char)('A'+i) << endl;
}
}
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:8:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:8:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:8:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:9:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:9:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:9:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:9:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:10:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:10:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:10:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:10:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:11:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:11:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:11:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:11:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:12:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:12:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:12:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:12:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:13:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:13:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:13:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:13:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:14:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
14 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:14:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
14 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:14:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
14 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:14:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
14 | {"0110","1100","0000","0000"}
| ^~~~~~
|
s612742843
|
p00036
|
C++
|
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
char n[12][12];
char figure[7][4][4] = {
{"1100","1100","0000","0000"},
{"1000","1000","1000","1000"},
{"1111","0000","0000","0000"},
{"0100","1100","1000","0000"},
{"1100","0110","0000","0000"},
{"1000","1100","0100","0000"},
{"0110","1100","0000","0000"}
};
for(int i=0; i<12; i++)
for(int j=0; j<12; j++)
n[i][j]='0';
while(~scanf("%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n\n", n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7])){
for(int i=0; i<7; i++){
for(int j=0; j<8; j++){
for(int k=0; k<8; k++){
bool flag=true;
for(int x=0; x<4; x++){
for(int y=0; y<4; y++){
if(figure[i][x][y] != n[j+x][k+y]) flag = false;
}
}
if(flag){
cout << (char)('A'+i) << endl;
}
}
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:8:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:8:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:8:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
8 | {"1100","1100","0000","0000"},
| ^~~~~~
a.cc:9:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:9:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:9:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:9:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
9 | {"1000","1000","1000","1000"},
| ^~~~~~
a.cc:10:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:10:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:10:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:10:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
10 | {"1111","0000","0000","0000"},
| ^~~~~~
a.cc:11:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:11:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:11:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:11:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
11 | {"0100","1100","1000","0000"},
| ^~~~~~
a.cc:12:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:12:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:12:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:12:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
12 | {"1100","0110","0000","0000"},
| ^~~~~~
a.cc:13:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:13:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:13:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:13:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
13 | {"1000","1100","0100","0000"},
| ^~~~~~
a.cc:14:18: error: initializer-string for 'char [4]' is too long [-fpermissive]
14 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:14:25: error: initializer-string for 'char [4]' is too long [-fpermissive]
14 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:14:32: error: initializer-string for 'char [4]' is too long [-fpermissive]
14 | {"0110","1100","0000","0000"}
| ^~~~~~
a.cc:14:39: error: initializer-string for 'char [4]' is too long [-fpermissive]
14 | {"0110","1100","0000","0000"}
| ^~~~~~
|
s914504668
|
p00036
|
C++
|
00000000
00000000
01100000
00110000
00000000
00000000
00000000
00000000
00011110
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00110000
00110000
00000000
00000000
00000000
00000000
|
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 00000000
| ^~~~~~~~
|
s506645447
|
p00036
|
C++
|
#include <iostream>
#include <string>
using namespace std;
const double EPS = 1.0e-6;
int main()
{
while(1){
string all[8];
bool endflg = false;
for(int i=0; i<8; i++){
if(!(cin>>all[i])) endflg = true;
if(endflg) break;
}
if(endflg) break;
for(int i=0; i<7; i++){
bool breakflg = false;
for(int j=0; j<7; j++){
// ツ可。ツづ可個ゥツづゥ
if(all[i][j]-'0'==1&&all[i][j+1]-'0'==1){
if(all[i+1][j]-'0'==1&&all[i+1][j+1]-'0'==1){
ans = "A";
} else if(all[i+1][j]-'0'==0&&all[i+1][j+1]-'0'==0){
ans = "C";
} else if(all[i+1][j]-'0'==1&&all[i+1][j+1]-'0'==0){
ans = "G";
} else if(all[i+1][j]-'0'==0&&all[i+1][j+1]-'0'==1){
ans = "E";
}
breakflg = true;
break;
}
// ツ縦ツづ可個ゥツづゥ
if(all[i][j]-'0'==1&&all[i+1][j]-'0'==1){
if(all[i][j+1]-'0'==1&&all[i+1][j+1]-'0'==1){
ans = "A";
} else if(all[i][j+1]-'0'==0&&all[i+1][j+1]-'0'==0){
ans = "B";
} else if(all[i][j+1]-'0'==1&&all[i+1][j+1]-'0'==0){
ans = "D";
} else if(all[i][j+1]-'0'==0&&all[i+1][j+1]-'0'==1){
ans = "F";
}
breakflg = true;
break;
}
}
if(breakflg) break;
}
cout<<ans<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:24:49: error: 'ans' was not declared in this scope; did you mean 'abs'?
24 | ans = "A";
| ^~~
| abs
a.cc:26:49: error: 'ans' was not declared in this scope; did you mean 'abs'?
26 | ans = "C";
| ^~~
| abs
a.cc:28:49: error: 'ans' was not declared in this scope; did you mean 'abs'?
28 | ans = "G";
| ^~~
| abs
a.cc:30:49: error: 'ans' was not declared in this scope; did you mean 'abs'?
30 | ans = "E";
| ^~~
| abs
a.cc:38:49: error: 'ans' was not declared in this scope; did you mean 'abs'?
38 | ans = "A";
| ^~~
| abs
a.cc:40:49: error: 'ans' was not declared in this scope; did you mean 'abs'?
40 | ans = "B";
| ^~~
| abs
a.cc:42:49: error: 'ans' was not declared in this scope; did you mean 'abs'?
42 | ans = "D";
| ^~~
| abs
a.cc:44:49: error: 'ans' was not declared in this scope; did you mean 'abs'?
44 | ans = "F";
| ^~~
| abs
a.cc:52:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
52 | cout<<ans<<endl;
| ^~~
| abs
|
s815788087
|
p00036
|
C++
|
#include <iostream>
#include <string>
using naemsapce std;
int main(){
string s[8];
while(true){
bool end = false;
for(int i=0;i<8;i++){
if(!(cin >> s[i])) end = true;
}
if(end) break;
for(int i=0;i<8&&!end;i++){
for(int j=0;j<8&&!end;j++){
if(s[i][j]=='1'){
if(i+3<8&&s[i+3][j]=='1') cout << "B" << endl;
else if(j+3<8&&s[i][j+3]=='1') cout << "C" << endl;
else if(i+2<8&&0<=j-1&&s[i+2][j-1]=='1') cout << "D" << endl;
else if(i+1<8&&j+2<8&&s[i+1][j+2]=='1') cout << "E" << endl;
else if(i+2<8&&j+1<8&&s[i+2][j+1]=='1') cout << "F" << endl;
else if(i+1<8&&0<=j-1&&s[i+1][j-1]=='1') cout << "G" << endl;
else cout << "A" << endl;
end = true;
}
}
}
}
}
|
a.cc:4:7: error: expected nested-name-specifier before 'naemsapce'
4 | using naemsapce std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'string' was not declared in this scope
7 | string s[8];
| ^~~~~~
a.cc:7:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:11:30: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
11 | if(!(cin >> s[i])) end = true;
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:11:37: error: 's' was not declared in this scope
11 | if(!(cin >> s[i])) end = true;
| ^
a.cc:16:36: error: 's' was not declared in this scope
16 | if(s[i][j]=='1'){
| ^
a.cc:17:67: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
17 | if(i+3<8&&s[i+3][j]=='1') cout << "B" << 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:17:82: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
17 | if(i+3<8&&s[i+3][j]=='1') cout << "B" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:18:72: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
18 | else if(j+3<8&&s[i][j+3]=='1') cout << "C" << 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:18:87: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
18 | else if(j+3<8&&s[i][j+3]=='1') cout << "C" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:19:82: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
19 | else if(i+2<8&&0<=j-1&&s[i+2][j-1]=='1') cout << "D" << 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:19:97: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
19 | else if(i+2<8&&0<=j-1&&s[i+2][j-1]=='1') cout << "D" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:20:81: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
20 | else if(i+1<8&&j+2<8&&s[i+1][j+2]=='1') cout << "E" << 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:20:96: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
20 | else if(i+1<8&&j+2<8&&s[i+1][j+2]=='1') cout << "E" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:21:81: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
21 | else if(i+2<8&&j+1<8&&s[i+2][j+1]=='1') cout << "F" << 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:21:96: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
21 | else if(i+2<8&&j+1<8&&s[i+2][j+1]=='1') cout << "F" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:22:82: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
22 | else if(i+1<8&&0<=j-1&&s[i+1][j-1]=='1') cout << "G" << 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:22:97: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
22 | else if(i+1<8&&0<=j-1&&s[i+1][j-1]=='1') cout << "G" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:23:46: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
23 | else cout << "A" << 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:23:61: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
23 | else cout << "A" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s347119840
|
p00036
|
C++
|
#include<stdio.h>
char mas[20][20]={0};
char check(x,y){
if(mas[y][x+3]=='1'){
//printf("C\n");
return 'C';
}
if(mas[y+2][x+1]=='1'){
//printf("F\n");
return 'F';
}
if(x>0){
if(mas[y+2][x-1]=='1'){
//printf("D\n");
return 'D';
}
}
if(mas[y+3][x]=='1'){
//printf("B\n");
return 'B';
}
if(mas[y][x+1]=='1'){
if(mas[y+1][x+2]=='1'){
//printf("E\n");
return 'E';
}
if(x>0){
if(mas[y+1][x-1]=='1'){
//printf("G\n");
return 'G';
}
}
if(mas[y+1][x]=='1'){
//printf("A\n");
return 'A';
}
}
// printf("NA");
}
main(){
int i,j;
int f,x,y;
char ans;
while(scanf("%s",mas[0])!=EOF){
f=0;
for(j=0;j<8;j++){
if(mas[0][j]=='1' && f==0){
x=j;
y=0;
f=1;
}
}
for(i=1;i<8;i++){
scanf("%s",mas[i]);
for(j=0;j<8;j++){
if(mas[i][j]=='1' && f==0){
x=j;
y=i;
f=1;
}
}
}
printf("%c\n",check(x,y));
}
return 0;
}
|
a.cc:5:12: error: 'x' was not declared in this scope
5 | char check(x,y){
| ^
a.cc:5:14: error: 'y' was not declared in this scope
5 | char check(x,y){
| ^
a.cc:5:15: error: expression list treated as compound expression in initializer [-fpermissive]
5 | char check(x,y){
| ^
a.cc:47:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
47 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:73:24: error: 'check' cannot be used as a function
73 | printf("%c\n",check(x,y));
| ~~~~~^~~~~
|
s496619539
|
p00036
|
C++
|
#include<iostream>
using namespace std;
typedef unsigned __int64 ull;
int main(){
int shape[7]={0x0303,0x01010101,0x0f,
0x010302,0x0603,0x020301,0x0306};
while(!cin.eof()){
int ans=-1;
ull mass=0;
for(int i=0;i<64;i++){
char c;
cin>>c;
if(c=='1')mass |= (ull)1<<i;
}
for(int i=0;i<64;i++){
for(int j=0;j<7;j++){
if((mass>>i&shape[j])==shape[j])ans=j;
}
}
cout<<(char)(ans+'A')<<endl;
}
return 0;
}
|
a.cc:3:26: error: expected initializer before 'ull'
3 | typedef unsigned __int64 ull;
| ^~~
a.cc: In function 'int main()':
a.cc:9:17: error: 'ull' was not declared in this scope
9 | ull mass=0;
| ^~~
a.cc:13:35: error: 'mass' was not declared in this scope
13 | if(c=='1')mass |= (ull)1<<i;
| ^~~~
a.cc:17:37: error: 'mass' was not declared in this scope
17 | if((mass>>i&shape[j])==shape[j])ans=j;
| ^~~~
|
s219499356
|
p00036
|
C++
|
#include <iostream>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
int main() {
char a, c;
int map[10][10];
while(cin >> c) {
if(c == '0' || c== '1') {
rep(i,10)rep(j,10)
map[i][j] = 0;
rep(i,8)rep(j,8) {
if(!(i + j == 0)) ifs >> c;
map[i][j] = (int)(c - '0');
}
rep(i,8)rep(j,8) {
if(map[i][j]) {
if(map[i][j+2]) a = 'C';
if(map[i+2][j]) a = 'B';
if(map[i+1][j+1]) a = 'A';
if(map[i+1][j-1]) a = 'G';
if(map[i+1][j+2]) a = 'E';
if(map[i+2][j+1]) a = 'F';
if(map[i+2][j-1]) a = 'D';
break;
}
}
cout << a << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:51: error: 'ifs' was not declared in this scope
17 | if(!(i + j == 0)) ifs >> c;
| ^~~
|
s409078603
|
p00036
|
C++
|
#include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;
int main() {
char c[11][11];
vector<int> v;
int dat[7][6]={{1,1,1,1,0,0},{1,0,1,0,1,0},{1,1,0,0,0,0},{1,0,1,0,0,0},{1,1,0,1,0,0},
{1,0,1,1,0,1},{1,1,1,0,0,0}};
int i,j,k,x,y,f;
while(true) {
f=0;
for (i=0;i<8;i++) {
if (gets(c[i])==NULL) { i=10; break;}
if (f==0) for (j=0;j<8;j++) if (c[i][j]=='1') { f=1; x=j; y=i; j=9;}
}
if (i==10) break;
cout << endl;
for (k=0;k<7;k++) {
f=0;
for (i=0;i<3;i++) for (j=0;j<2;j++) {
if (x+j>7 || y+i>7) { if (dat[k][j+i*2]==0) f++;} else
if (c[y+i][x+j]==('0'+dat[k][j+i*2])) f++;
}
if (f==6) break;
}
v.push_back(k);
}
for (i=0;i<v.size();i++) cout << (char)('A'+v[i]) << endl;
return 0
|
a.cc: In function 'int main()':
a.cc:14:23: error: 'gets' was not declared in this scope; did you mean 'getw'?
14 | if (gets(c[i])==NULL) { i=10; break;}
| ^~~~
| getw
a.cc:30:11: error: expected ';' at end of input
30 | return 0
| ^
| ;
a.cc:30:11: error: expected '}' at end of input
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s360658761
|
p00036
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main(){
while(1){
string str[8];
for(int i =0;i<8;i++)
cin >> str[i];
bool stop = false;
for(int i=0;i<8;i++){
for(int k=0;k<8;k++){
if(str[i][k] == '1'){
if(str[i][k+1] == '1' && str[i+1][k+1] == '1'&& str[i+1][k] == '1' ){
cout << "A" << endl; stop = true; break;
} else if(str[i+1][k] == '1' && str[i+2][k] == '1'&& str[i+3][k] == '1' ){
cout << "B" << endl; stop = true; break;
} else if(str[i][k+1] == '1' && str[i][k+2] == '1'&& str[i][k+3] == '1' ){
cout << "C" << endl; stop = true; break;
} else if(str[i+1][k] == '1' && str[i+1][k-1] == '1'&& str[i+2][k-1] == '1' ){
cout << "D" << endl; stop = true; break;
} else if(str[i][k+1] == '1' && str[i+1][k+1] == '1'&& str[i+1][k+2] == '1' ){
cout << "E" << endl; stop = true; break;
} else if(str[i+1][k] == '1' && str[i+1][k+1] == '1'&& str[i+2][k+1] == '1' ){
cout << "F" << endl; stop = true; break;
} else if(str[i][k+1] == '1' && str[i+1][k] == '1'&& str[i+1][k-1] == '1' ){
cout << "G" << endl; stop = true; break;
}
}
}
if(stop == true) break;
}
if (!getline(cin, str[0]))
break;
}
|
a.cc: In function 'int main()':
a.cc:40:10: error: expected '}' at end of input
40 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s454179987
|
p00036
|
C++
|
#include <iostream>
#include <stdio.h>
using namespace std;
int main(){
int mass[8][8];
BEGIN:
while(scanf("%d%d%d%d%d%d%d%d",mass[0],mass[0]+1,mass[0]+2,mass[0]+3,mass[0]+4
mass[0]+5,mass[0]+6,mass[0]+7)!=EOF)
{
for(int i=1;i<8;i++){
scanf("%d%d%d%d%d%d%d%d",mass[i],mass[i]+1,mass[i]+2,mass[i]+3,mass[i]+4
mass[i]+5,mass[i]+6,mass[i]+7);
}
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
if(mass[i][j]){
if(j==7){
if(mass[i+1][j]){
cout<<(mass[i+1][j-1]?"D\n":"B\n");
}
}else if(j==0){
if(mass[i][j+1]){
if(mass[i+1][j]) cout<<"A\n";
else if(mass[i][j+2]) cout<<"C\n";
else cout<<"E\n";
}
else cout<(mass[i+1][j+1]?"F\n":"B\n");
}else{
if(mass[i][j+2]) cout<<"C\n";
else if(mass[i][j+1]){
if(mass[i+1][j]){
cout<<(mass[i+1][j+1]?"A\n":"G\n");
}
else cout<<"E\n";
}
else if(mass[i+2][j]) cout<<"B\n";
else cout<<(mass[i+1][j+1]?"F\n":"D\n");
}
goto BEGIN;
}
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:9:87: error: expected ')' before 'mass'
9 | while(scanf("%d%d%d%d%d%d%d%d",mass[0],mass[0]+1,mass[0]+2,mass[0]+3,mass[0]+4
| ~ ^
| )
10 | mass[0]+5,mass[0]+6,mass[0]+7)!=EOF)
| ~~~~
a.cc:13:97: error: expected ')' before 'mass'
13 | scanf("%d%d%d%d%d%d%d%d",mass[i],mass[i]+1,mass[i]+2,mass[i]+3,mass[i]+4
| ~ ^
| )
14 | mass[i]+5,mass[i]+6,mass[i]+7);
| ~~~~
a.cc:29:58: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [3]')
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | const char [3]
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_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:29:86: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ^
/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:29:86: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ^
/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:29:86: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ^
/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:29:86: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string: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:29:86: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>'
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/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:29:86: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ^
/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:29:86: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ^
/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:29:86: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*'
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ^
/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, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:29:86: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ^
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:29:86: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ^
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:29:86: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
29 | else cout<(mass[i+1][j+1]?"F\n":"B\n");
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candida
|
s484450307
|
p00036
|
C++
|
#include <iostream>
#include <stdio.h>
using namespace std;
int main(){
int mass[8][8];
BEGIN:
while(scanf("%d%d%d%d%d%d%d%d",mass[0],mass[0]+1,mass[0]+2,mass[0]+3,mass[0]+4
mass[0]+5,mass[0]+6,mass[0]+7)!=EOF)
{
for(int i=1;i<8;i++){
scanf("%d%d%d%d%d%d%d%d",mass[i],mass[i]+1,mass[i]+2,mass[i]+3,mass[i]+4
mass[i]+5,mass[i]+6,mass[i]+7);
}
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
if(mass[i][j]){
if(j==7){
if(mass[i+1][j]){
cout<<(mass[i+1][j-1]?"D\n":"B\n");
}
}else if(j==0){
if(mass[i][j+1]){
if(mass[i+1][j]) cout<<"A\n";
else if(mass[i][j+2]) cout<<"C\n";
else cout<<"E\n";
}
else cout<<(mass[i+1][j+1]?"F\n":"B\n");
}else{
if(mass[i][j+2]) cout<<"C\n";
else if(mass[i][j+1]){
if(mass[i+1][j]){
cout<<(mass[i+1][j+1]?"A\n":"G\n");
}
else cout<<"E\n";
}
else if(mass[i+2][j]) cout<<"B\n";
else cout<<(mass[i+1][j+1]?"F\n":"D\n");
}
goto BEGIN;
}
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:9:87: error: expected ')' before 'mass'
9 | while(scanf("%d%d%d%d%d%d%d%d",mass[0],mass[0]+1,mass[0]+2,mass[0]+3,mass[0]+4
| ~ ^
| )
10 | mass[0]+5,mass[0]+6,mass[0]+7)!=EOF)
| ~~~~
a.cc:13:97: error: expected ')' before 'mass'
13 | scanf("%d%d%d%d%d%d%d%d",mass[i],mass[i]+1,mass[i]+2,mass[i]+3,mass[i]+4
| ~ ^
| )
14 | mass[i]+5,mass[i]+6,mass[i]+7);
| ~~~~
|
s687398971
|
p00036
|
C++
|
#include <iostream>
#include <stdio.h>
using namespace std;
int main(){
int mass[8][8];
BEGIN:
while(scanf("%d%d%d%d%d%d%d%d",(*mass[0]),(*mass[0])+1,(*mass[0])+2,(*mass[0])+3,(*mass[0])+4
(*mass[0])+5,(*mass[0])+6,(*mass[0])+7)!=EOF)
{
for(int i=1;i<8;i++){
scanf("%d%d%d%d%d%d%d%d",(*mass[i]),(*mass[i]+1),(*mass[i]+2),(*mass[i]+3),(*mass[i]+4)
(*mass[i]+5),(*mass[i]+6),(*mass[i]+7));
}
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
if(mass[i][j]){
if(j==7){
if(mass[i+1][j]){
cout<<(mass[i+1][j-1]?"D\n":"B\n");
}
}else if(j==0){
if(mass[i][j+1]){
if(mass[i+1][j]) cout<<"A\n";
else if(mass[i][j+2]) cout<<"C\n";
else cout<<"E\n";
}
else cout<<(mass[i+1][j+1]?"F\n":"B\n");
}else{
if(mass[i][j+2]) cout<<"C\n";
else if(mass[i][j+1]){
if(mass[i+1][j]){
cout<<(mass[i+1][j+1]?"A\n":"G\n");
}
else cout<<"E\n";
}
else if(mass[i+2][j]) cout<<"B\n";
else cout<<(mass[i+1][j+1]?"F\n":"D\n");
}
goto BEGIN;
}
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:10:17: error: expression cannot be used as a function
9 | while(scanf("%d%d%d%d%d%d%d%d",(*mass[0]),(*mass[0])+1,(*mass[0])+2,(*mass[0])+3,(*mass[0])+4
| ~
10 | (*mass[0])+5,(*mass[0])+6,(*mass[0])+7)!=EOF)
| ^~~~~~~~~~
a.cc:14:33: error: expression cannot be used as a function
13 | scanf("%d%d%d%d%d%d%d%d",(*mass[i]),(*mass[i]+1),(*mass[i]+2),(*mass[i]+3),(*mass[i]+4)
| ~~~~~~~~~~~~
14 | (*mass[i]+5),(*mass[i]+6),(*mass[i]+7));
| ^~~~~~~~~~~~
|
s587517562
|
p00036
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main(){
string line[8];
while(){
int w = 0, h = 0, t=-1;
for(int i=0;i<8;++i)
cin >> line[i];
int right=0,left=7;
for(int i=0;i<8;++i){
bool exist = false;
for(int j=0;j<8;++j){
if((line[i])[j] == '1'){
if(t!=-1)t=i;
if(j>right)right = j;
if(j<left)left = j;
exist = true;
}
}
if(exist)++h;
}
w = right - left + 1;
if( w == 2 && h == 2 )cout<<"A"<<endl;
else if(w == 1)cout<<"B"<<endl;
else if(h == 1)cout<<"C"<<endl;
else if(w==2){
for(int i=0;i<8;++i){
if((line[i])[left] == '1'){
if((line[i])[left+1]=='1')
cout<<"D"<<endl;
else
cout<<"F"<<endl;
break;
}
}
}
else if(h==2){
for(int i=0;i<8;++i){
if((line[t])[i]=='1'){
if((line[t+1])[i]=='1')
cout<<"G"<<endl;
else
cout<<"E"<<endl;
}
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:15: error: expected primary-expression before ')' token
8 | while(){
| ^
|
s535198885
|
p00036
|
C++
|
import java.io.IOException;
public class Main {
public static void main(String[] args) {
try {
final int SIZE = 20 + 10 * 8 * ((8 + 4) * 8);// 8桁+終端 を 8行に+空行を10回
byte[] buf = new byte[SIZE];// 入力データをすべて格納する
int count = 0;// 文字の先頭からの順番
int limit = System.in.read(buf, 0, SIZE);
while (count < limit) {
int box[] = new int[4];
int i = 0;
int head = 0;
int[] x = new int[4];
while (count < limit) {
if (buf[count] == '1') {
box[i] = count;
x[i] = head;
i++;
}
if (buf[count] != '0' && buf[count] != '1')
head = 0;
else
head++;
count++;
if(i > 3) break;
}
if(i != 4 ) break;
if (box[0] == box[1] - 1) {
// ACEG
switch (x[2] - x[0]) {
case -1:
System.out.println("G");
break;
case 0:
System.out.println("A");
break;
case 1:
System.out.println("E");
break;
case 2:
System.out.println("C");
break;
}
} else {
// BDF
switch (x[3] - x[0]) {
case -1:
System.out.println("D");
break;
case 0:
System.out.println("B");
break;
case 1:
System.out.println("F");
break;
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.io.IOException;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s760772410
|
p00036
|
C++
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
void figure(char a[8][8])
{
int i,j;
for(i=0;i<8;i++)
for(j=0;j<8;j++)
if(a[i][j]=='1'){
if(a[i][j+1]=='1'){
if(a[i+1][j]=='1' && a[i+1][j+1]=='1')
printf("A\n");
else if(a[i][j+2]=='1' && a[i][j+3]=='1')
printf("C\n");
else if(a[i+1][j+1]=='1' && a[i+1][j+2]=='1')
printf("E\n");
else if(a[i+1][j]=='1' && a[i+1][j-1]=='1')
printf("G\n");
}
else if(a[i+1][j]=='1'){
if(a[i+2][j]=='1' && a[i+3][j]=='1')
printf("B\n");
else if(a[i+1][j-1]=='1' && a[i+2][j-1]=='1')
printf("D\n");
else if(a[i+1][j+1]=='1' && a[i+2][j+1]=='1')
printf("F\n");
}
goto OUT;
}
OUT:;
}
int main(void)
{
char a[8][8];
char *buf;
int i,j,flag;
while(1){
for(i=0;i<8;i++){
buf=malloc(sizeof(char)*9);
if(fgets(buf,sizeof(char)*9,stdin)==NULL){
goto OUT;
}
if(flag==1)break;
// buf[8]='\0';
for(j=0;j<8;j++)
a[i][j]=buf[j];
free(buf);
//rewind(stdin);//これがないと変になる
}
figure(a);
}
OUT:
return 0;
}
|
a.cc: In function 'int main()':
a.cc:41:17: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
41 | buf=malloc(sizeof(char)*9);
| ~~~~~~^~~~~~~~~~~~~~~~
| |
| void*
|
s328981373
|
p00036
|
C++
|
#include<cstdio>
#define REP(i,a,n) for(int i = a;i < n;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
int in(){int n;scanf("%d",&n); return n;}
int main(void){
int atlas[10][10];
rep(i,8){
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:2: error: expected '}' at end of input
11 | }
| ^
a.cc:6:15: note: to match this '{'
6 | int main(void){
| ^
|
s044498683
|
p00037
|
Java
|
import static color.ImageUtility.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.ArrayList;
import javax.imageio.ImageIO;
public class Main {
static int horW[]=new int[20],verW[]=new int[20];
public static void main(String[] args) {
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
ArrayList<Character>walk=new ArrayList<Character>();
while((line=br.readLine())!=null){
for(int i=0;i<4;i++) horW[i]=Integer.parseInt(line.charAt(i)+"");
for(int i=0;i<4;i++){
line=br.readLine();for(int j=0;j<4;j++)horW[4*(i+1)+j]=Integer.parseInt(line.charAt(j)+"");
line=br.readLine();for(int j=0;j<5;j++)verW[5*i+j]=Integer.parseInt(line.charAt(j)+"");
}
break;
}
walk.add('R');
walkon(walk,1,0);
for(char ch : walk) System.out.print(ch);
System.out.println("");
}catch(Exception e){}
}
static boolean walkon(ArrayList<Character>walk,int x, int y){
char preD=walk.get(walk.size()-1);char nextD='1';int nX=x,nY=y;
int uW = (y==0)? 0:verW[(y-1)*5+x]; int dW = (y==4)? 0: verW[y*5+x];
int rW = (x==4)? 0:horW[x+4*y]; int lW =(x==0)? 0: horW[x-1+4*y];
switch(preD){
case 'R':
if(uW==1){nextD='U';nY--;}
else if(rW==1){nextD='R';nX++;}else if(dW==1){nextD='D';nY++;}
break;
case 'U':
if(lW==1){nextD='L';nX--;}else if(uW==1){nextD='U';nY--;}
else if(rW==1){nextD='R';nX++;}
break;
case 'L':
if(dW==1){nextD='D';nY++;}else if(lW==1){nextD='L';nX--;}
else if(uW==1){nextD='U';nY--;}break;
case 'D':
if(rW==1){nextD='R';nX++;}else if(dW==1){nextD='D';nY++;}
else if(lW==1){nextD='L';nX--;}break;
}
walk.add(nextD);
if(nX==0&&nY==0)return true;
else return walkon(walk,nX,nY);
}
}
|
Main.java:1: error: package color does not exist
import static color.ImageUtility.*;
^
1 error
|
s804575070
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import jav.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine;
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,inty){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&char[2*x][y]=='1'){
return true;
}
else{
return false
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir="L"){
if(y-1>=0&&map[2*x][y-1]=='1';
return true;
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1';){
return true;
}
else{
return false;
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
returm;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}
|
Main.java:24: error: illegal start of expression
static String turnLeft(String dir){
^
Main.java:52: error: <identifier> expected
static void gotoDirection(String dir,int x,inty){
^
Main.java:82: error: ']' expected
if(y+1<=4&&char[2*x][y]=='1'){
^
Main.java:82: error: not a statement
if(y+1<=4&&char[2*x][y]=='1'){
^
Main.java:82: error: ';' expected
if(y+1<=4&&char[2*x][y]=='1'){
^
Main.java:82: error: not a statement
if(y+1<=4&&char[2*x][y]=='1'){
^
Main.java:82: error: ';' expected
if(y+1<=4&&char[2*x][y]=='1'){
^
Main.java:86: error: ';' expected
return false
^
Main.java:85: error: 'else' without 'if'
else{
^
Main.java:98: error: ')' expected
if(y-1>=0&&map[2*x][y-1]=='1';
^
Main.java:100: error: 'else' without 'if'
else{
^
Main.java:105: error: ')' expected
if(x+1<=4&&map[2*x+1][y]=='1';){
^
Main.java:105: error: illegal start of expression
if(x+1<=4&&map[2*x+1][y]=='1';){
^
Main.java:108: error: 'else' without 'if'
else{
^
Main.java:112: error: illegal start of expression
static void gotoPath(int x,int y){
^
Main.java:125: error: not a statement
returm;
^
16 errors
|
s475619615
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import jav.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine;
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,inty){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&char[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
returm;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}
|
Main.java:53: error: <identifier> expected
static void gotoDirection(String dir,int x,inty){
^
Main.java:83: error: ']' expected
if(y+1<=4&&char[2*x][y]=='1'){
^
Main.java:83: error: not a statement
if(y+1<=4&&char[2*x][y]=='1'){
^
Main.java:83: error: ';' expected
if(y+1<=4&&char[2*x][y]=='1'){
^
Main.java:83: error: not a statement
if(y+1<=4&&char[2*x][y]=='1'){
^
Main.java:83: error: ';' expected
if(y+1<=4&&char[2*x][y]=='1'){
^
Main.java:86: error: 'else' without 'if'
else{
^
Main.java:114: error: illegal start of expression
static void gotoPath(int x,int y){
^
Main.java:127: error: not a statement
returm;
^
9 errors
|
s490727940
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import jav.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine;
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,inty){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
returm;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}
|
Main.java:53: error: <identifier> expected
static void gotoDirection(String dir,int x,inty){
^
Main.java:114: error: illegal start of expression
static void gotoPath(int x,int y){
^
Main.java:127: error: not a statement
returm;
^
3 errors
|
s298868073
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import jav.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine;
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,inty){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
return;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}
|
Main.java:53: error: <identifier> expected
static void gotoDirection(String dir,int x,inty){
^
1 error
|
s881958192
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import jav.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine;
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
return;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}
|
Main.java:3: error: package jav.util does not exist
import jav.util.*;
^
Main.java:15: error: cannot find symbol
line=br.readLine;
^
symbol: variable readLine
location: variable br of type BufferedReader
Main.java:32: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:46: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:60: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:74: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:98: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:121: error: cannot find symbol
Deque<Point> que=new ArrayDeque<Point>();
^
symbol: class Deque
location: class Main
Main.java:121: error: cannot find symbol
Deque<Point> que=new ArrayDeque<Point>();
^
symbol: class ArrayDeque
location: class Main
Main.java:122: error: cannot find symbol
d.offerLast(p);
^
symbol: variable d
location: class Main
10 errors
|
s591262950
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import java.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine;
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
return;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}
|
Main.java:15: error: cannot find symbol
line=br.readLine;
^
symbol: variable readLine
location: variable br of type BufferedReader
Main.java:32: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:46: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:60: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:74: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:98: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:122: error: cannot find symbol
d.offerLast(p);
^
symbol: variable d
location: class Main
Main.java:123: error: cannot find symbol
while(que.peekFirst!=null){
^
symbol: variable peekFirst
location: variable que of type Deque<Point>
8 errors
|
s063658301
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import java.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
return;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}
|
Main.java:46: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:60: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:74: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:98: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:122: error: cannot find symbol
d.offerLast(p);
^
symbol: variable d
location: class Main
Main.java:123: error: cannot find symbol
while(que.peekFirst!=null){
^
symbol: variable peekFirst
location: variable que of type Deque<Point>
6 errors
|
s997811715
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import java.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
return;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}
|
Main.java:46: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:60: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
^
Main.java:122: error: cannot find symbol
d.offerLast(p);
^
symbol: variable d
location: class Main
Main.java:123: error: cannot find symbol
while(que.peekFirst!=null){
^
symbol: variable peekFirst
location: variable que of type Deque<Point>
4 errors
|
s059634305
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import java.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
return;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}
|
Main.java:122: error: cannot find symbol
d.offerLast(p);
^
symbol: variable d
location: class Main
Main.java:123: error: cannot find symbol
while(que.peekFirst!=null){
^
symbol: variable peekFirst
location: variable que of type Deque<Point>
2 errors
|
s824112248
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import java.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[25];
static int[][] times=new int[5][5];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
for(int i=0;i<5;i++){
for(int j=0;j<5;i++){
times[i][j]~0;
}
}
gotoPath(0,1);
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=1;
times[0][0]=0;
dp[1]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
que.offerFirst(p);
while(que.peekFirst()!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)==0){
return;
}
int t=times[px][py];
if(t>0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
count++;
Point np=new Point();
np.x=px;
np.y=py;
que.offerFirst(np);
}
}
}
|
Main.java:23: error: not a statement
times[i][j]~0;
^
Main.java:23: error: ';' expected
times[i][j]~0;
^
2 errors
|
s240949270
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import java.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[25];
static int[][] times=new int[5][5];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=1;
times[0][0]=0;
dp[1]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
que.offerFirst(p);
while(que.peekFirst()!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px==0py==0){
return;
}
int t=times[px][py];
if(t>0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
count++;
Point np=new Point();
np.x=px;
np.y=py;
que.offerFirst(np);
}
}
}
|
Main.java:126: error: ')' expected
if((px==0py==0){
^
Main.java:126: error: not a statement
if((px==0py==0){
^
Main.java:126: error: ';' expected
if((px==0py==0){
^
3 errors
|
s113528152
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import java.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[25];
static int[][] times=new int[5][5];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=1;
times[0][0]=0;
dp[1]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
que.offerFirst(p);
while(que.peekFirst()!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px==0&&py==0){
return;
}
int t=times[px][py];
if(t>0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
count++;
Point np=new Point();
np.x=px;
np.y=py;
que.offerFirst(np);
}
}
}
|
Main.java:126: error: ')' expected
if((px==0&&py==0){
^
1 error
|
s995141630
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import java.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[25];
static int[][] times=new int[5][5];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String back(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=1;
times[0][0]=0;
dp[1]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
que.offerFirst(p);
while(que.peekFirst()!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if(px==0&&py==0){
return;
}
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
String dirb=back(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
return;
}
count++;
Point np=new Point();
np.x=px;
np.y=py;
que.offerFirst(np);
}
}
}
|
Main.java:162: error: class, interface, enum, or record expected
}
^
1 error
|
s254825934
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import java.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[25];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
dp[1]="R";
System.out.print("R");
gotoPath(0,1,"R");
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String back(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y,String dir){
int count=1;
if(x==0&&y==0){
return;
}
String dir=this.dir;
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
String dirb=back(dir);
if(cangoNext(dirl,x,y)){
gotoDirection(dirl,x,y);
System.out.print(dirl);
dp[count+1]=dirl;
gotoPath(x,y,dirl);
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
gotoPath(x,y,dir);
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
gotoPath(x,y,dirr);
}
else{
gotoDirection(dirb,px,py);
System.out.print(dirb);
dp[count+1]=dirb;
gotoPath(x,y,dirb);
}
}
}
|
Main.java:120: error: variable dir is already defined in method gotoPath(int,int,String)
String dir=this.dir;
^
Main.java:120: error: non-static variable this cannot be referenced from a static context
String dir=this.dir;
^
Main.java:120: error: cannot find symbol
String dir=this.dir;
^
symbol: variable dir
Main.java:130: error: cannot find symbol
else if(cangoNext(dir,px,py)){
^
symbol: variable px
location: class Main
Main.java:130: error: cannot find symbol
else if(cangoNext(dir,px,py)){
^
symbol: variable py
location: class Main
Main.java:131: error: cannot find symbol
gotoDirection(dir,px,py);
^
symbol: variable px
location: class Main
Main.java:131: error: cannot find symbol
gotoDirection(dir,px,py);
^
symbol: variable py
location: class Main
Main.java:136: error: cannot find symbol
else if(cangoNext(dirr,px,py)){
^
symbol: variable px
location: class Main
Main.java:136: error: cannot find symbol
else if(cangoNext(dirr,px,py)){
^
symbol: variable py
location: class Main
Main.java:137: error: cannot find symbol
gotoDirection(dirr,px,py);
^
symbol: variable px
location: class Main
Main.java:137: error: cannot find symbol
gotoDirection(dirr,px,py);
^
symbol: variable py
location: class Main
Main.java:143: error: cannot find symbol
gotoDirection(dirb,px,py);
^
symbol: variable px
location: class Main
Main.java:143: error: cannot find symbol
gotoDirection(dirb,px,py);
^
symbol: variable py
location: class Main
13 errors
|
s514725082
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import java.util.*;
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[25];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
dp[1]="R";
System.out.print("R");
gotoPath(0,1,"R");
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String back(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y,String d){
if(x==0&&y==0){
return;
}
String dir=d;
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
String dirb=back(d);
if(cangoNext(dirl,x,y)){
gotoDirection(dirl,x,y);
System.out.print(dirl);
gotoPath(x,y,dirl);
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
gotoPath(x,y,dir);
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
gotoPath(x,y,dirr);
}
else{
gotoDirection(dirb,px,py);
System.out.print(dirb);
gotoPath(x,y,dirb);
}
}
}
|
Main.java:128: error: cannot find symbol
else if(cangoNext(dir,px,py)){
^
symbol: variable px
location: class Main
Main.java:128: error: cannot find symbol
else if(cangoNext(dir,px,py)){
^
symbol: variable py
location: class Main
Main.java:129: error: cannot find symbol
gotoDirection(dir,px,py);
^
symbol: variable px
location: class Main
Main.java:129: error: cannot find symbol
gotoDirection(dir,px,py);
^
symbol: variable py
location: class Main
Main.java:133: error: cannot find symbol
else if(cangoNext(dirr,px,py)){
^
symbol: variable px
location: class Main
Main.java:133: error: cannot find symbol
else if(cangoNext(dirr,px,py)){
^
symbol: variable py
location: class Main
Main.java:134: error: cannot find symbol
gotoDirection(dirr,px,py);
^
symbol: variable px
location: class Main
Main.java:134: error: cannot find symbol
gotoDirection(dirr,px,py);
^
symbol: variable py
location: class Main
Main.java:139: error: cannot find symbol
gotoDirection(dirb,px,py);
^
symbol: variable px
location: class Main
Main.java:139: error: cannot find symbol
gotoDirection(dirb,px,py);
^
symbol: variable py
location: class Main
10 errors
|
s165779495
|
p00037
|
Java
|
import java.io.*;
import java.awt.*;
import java.util.*;
class Main{
static char[][] map=new char[9][5];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
System.out.print("R");
gotoPath(0,1,"R");
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static String back(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y,String d){
if(x==0&&y==0){
return;
}
String di;
String dir=d;
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
String dirb=back(d);
if(cangoNext(dirl,x,y)){
System.out.print(dirl);
di=dirl;
}
else if(cangoNext(dir,x,y)){
System.out.print(dir);
di=dir;
}
else if(cangoNext(dirr,x,y)){
System.out.print(dirr);
String di=dirr;
}
else{
System.out.print(dirb);
String di=dirb;
}
if(di=="R"){
y++;
}
if(di=="U"){
x--;
}
if(di=="L"){
y--;
}
if(di=="D");{
x++;
}
gotoPath(x,y,di);
}
}
|
Main.java:118: error: variable di is already defined in method gotoPath(int,int,String)
String di=dirr;
^
Main.java:122: error: variable di is already defined in method gotoPath(int,int,String)
String di=dirb;
^
2 errors
|
s460222818
|
p00037
|
Java
|
import java.util.Scanner;
import java.util.Arrays;
public class Main {
static int[][] grid;
static int MAX_HEIGHT = 9;
static int MAX_WIDTH = 9;
public static void main (String[] args) {
Scanner scan = new Scanner(System.in);
grid = new int[MAX_HEIGHT][MAX_WIDTH];
String line;
int width, n, pos;
for (int i = 0; i < 9; i++) {
line = scan.nextLine();
width = 0;
for (int j = 0; j < line.length(); j++) {
n = Integer.parseInt(line.substring(j, j+1));
if (n == 0) {
continue;
}
if (i % 2 == 0) {
pos = j * 2;
grid[i][pos] = 1;
grid[i][pos+1] = 1;
grid[i][pos+2] = 1;
} else {
pos = j*2;
grid[i-1][pos] = 1;
grid[i][pos] = 1;
grid[i+1][pos] = 1;
}
}
}
solve();
}
static void solve () {
StringBuilder sb = new StringBuilder();
int width = 0, height = 0, direction = 0;
int[] dwidth = {1, 0, -1, 0};
int[] dheight = {0, 1, 0, -1};
String[] textdirection = {"R", "D", "L", "U"};
while (true) {
for (int i = 3; i < 7; i++) {
int nextwidth = width + dwidth[(i + direction) % 4];
int nextheight = height + dheight[(i + direction) % 4];
int nextnextwidth = nextwidth + dwidth[(i + direction) % 4];
int nextnextheight = nextheight + dheight[(i + direction) % 4];
if (!(0 <= nextwidth && nextwidth < MAX_WIDTH && 0 <= nextheight && nextheight < MAX_HEIGHT)) {
continue;
}
if (!(0 <= nextnextwidth && nextnextwidth < MAX_WIDTH && 0 <= nextnextheight && nextnextheight < MAX_HEIGHT)) {
continue;
}
if (grid[nextheight][nextwidth] == 0 || grid[nextnextheight][nextnextwidth] == 0) {
continue;
}
width = nextnextwidth;
height = nextnextheight;
direction = (i + direction) % 4;
sb.append(textdirection[direction]);
break;
}
if (width == 0 && height == 0) {
break;
}
}
System.out.println(sb.toString());
}
|
Main.java:69: error: reached end of file while parsing
}
^
1 error
|
s767840539
|
p00037
|
Java
|
public class Main {
enum Vec {
R,
U,
L,
D;
Vec next() {
return (this == R) ? D : (this == D) ? L
: (this == L) ? U : R;
}
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
boolean isKisu = true;
List<boolean[]> gusu = new ArrayList<boolean[]>();
List<boolean[]> kisu = new ArrayList<boolean[]>();
boolean hasLine = in.hasNextLine();
while (hasLine) {
hasLine = in.hasNextLine();
isKisu = !isKisu;
String nextLine = in.nextLine();
if (nextLine.equals("end")) {
break;
}
char[] str = nextLine.toCharArray();
boolean[] bs = new boolean[str.length];
for (int i = 0; i < bs.length; i++) {
bs[i] = (str[i] == '1');
}
((isKisu) ? kisu : gusu).add(bs);
}
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
int ySize = gusu.size();
int xSize = kisu.get(0).length;
for (int y = 0; y < ySize; y++) {
for (int x = 0; x < xSize; x++) {
map.put(
new Point(x, y),
new EnumMap<Vec, Point>(Vec.class));
}
}
{
int size = gusu.size();
for (int y = 0; y < size; y++) {
int length = gusu.get(y).length;
for (int x = 0; x < length; x++) {
if (gusu.get(y)[x]) {
Point o = new Point(x, y);
Point r = new Point(x + 1, y);
map.get(o).put(Vec.R, r);
map.get(r).put(Vec.L, o);
}
}
}
}
{
int size = kisu.size();
for (int y = 0; y < size; y++) {
int length = kisu.get(y).length;
for (int x = 0; x < length; x++) {
if (kisu.get(y)[x]) {
Point o = new Point(x, y);
Point d = new Point(x, y + 1);
map.get(o).put(Vec.D, d);
map.get(d).put(Vec.U, o);
}
}
}
}
Vec next = Vec.R;
Point posi = new Point(0, 0);
do {
next = next.next().next().next();
Map<Vec, Point> point = map.get(posi);
while (!point.containsKey(next)) {
next = next.next();
}
System.out.print(next);
posi = point.get(next);
} while (posi.x != 0 || posi.y != 0);
}
}
|
Main.java:14: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:14: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:16: error: cannot find symbol
List<boolean[]> gusu = new ArrayList<boolean[]>();
^
symbol: class List
location: class Main
Main.java:16: error: cannot find symbol
List<boolean[]> gusu = new ArrayList<boolean[]>();
^
symbol: class ArrayList
location: class Main
Main.java:17: error: cannot find symbol
List<boolean[]> kisu = new ArrayList<boolean[]>();
^
symbol: class List
location: class Main
Main.java:17: error: cannot find symbol
List<boolean[]> kisu = new ArrayList<boolean[]>();
^
symbol: class ArrayList
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Map
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Point
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Map
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Point
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class HashMap
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Point
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Map
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Point
location: class Main
Main.java:39: error: cannot find symbol
new Point(x, y),
^
symbol: class Point
location: class Main
Main.java:40: error: cannot find symbol
new EnumMap<Vec, Point>(Vec.class));
^
symbol: class EnumMap
location: class Main
Main.java:40: error: cannot find symbol
new EnumMap<Vec, Point>(Vec.class));
^
symbol: class Point
location: class Main
Main.java:49: error: cannot find symbol
Point o = new Point(x, y);
^
symbol: class Point
location: class Main
Main.java:49: error: cannot find symbol
Point o = new Point(x, y);
^
symbol: class Point
location: class Main
Main.java:50: error: cannot find symbol
Point r = new Point(x + 1, y);
^
symbol: class Point
location: class Main
Main.java:50: error: cannot find symbol
Point r = new Point(x + 1, y);
^
symbol: class Point
location: class Main
Main.java:63: error: cannot find symbol
Point o = new Point(x, y);
^
symbol: class Point
location: class Main
Main.java:63: error: cannot find symbol
Point o = new Point(x, y);
^
symbol: class Point
location: class Main
Main.java:64: error: cannot find symbol
Point d = new Point(x, y + 1);
^
symbol: class Point
location: class Main
Main.java:64: error: cannot find symbol
Point d = new Point(x, y + 1);
^
symbol: class Point
location: class Main
Main.java:72: error: cannot find symbol
Point posi = new Point(0, 0);
^
symbol: class Point
location: class Main
Main.java:72: error: cannot find symbol
Point posi = new Point(0, 0);
^
symbol: class Point
location: class Main
Main.java:75: error: cannot find symbol
Map<Vec, Point> point = map.get(posi);
^
symbol: class Map
location: class Main
Main.java:75: error: cannot find symbol
Map<Vec, Point> point = map.get(posi);
^
symbol: class Point
location: class Main
29 errors
|
s705090232
|
p00037
|
Java
|
public class Main {
enum Vec {
R,
U,
L,
D;
Vec next() {
return (this == R) ? D : (this == D) ? L
: (this == L) ? U : R;
}
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
boolean isKisu = true;
List<boolean[]> gusu = new ArrayList<boolean[]>();
List<boolean[]> kisu = new ArrayList<boolean[]>();
boolean hasLine = in.hasNextLine();
while (hasLine) {
hasLine = in.hasNextLine();
isKisu = !isKisu;
String nextLine = in.nextLine();
if (nextLine.equals("end")) {
break;
}
char[] str = nextLine.toCharArray();
boolean[] bs = new boolean[str.length];
for (int i = 0; i < bs.length; i++) {
bs[i] = (str[i] == '1');
}
((isKisu) ? kisu : gusu).add(bs);
}
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
int ySize = gusu.size();
int xSize = kisu.get(0).length;
for (int y = 0; y < ySize; y++) {
for (int x = 0; x < xSize; x++) {
map.put(
new Point(x, y),
new EnumMap<Vec, Point>(Vec.class));
}
}
{
int size = gusu.size();
for (int y = 0; y < size; y++) {
int length = gusu.get(y).length;
for (int x = 0; x < length; x++) {
if (gusu.get(y)[x]) {
Point o = new Point(x, y);
Point r = new Point(x + 1, y);
map.get(o).put(Vec.R, r);
map.get(r).put(Vec.L, o);
}
}
}
}
{
int size = kisu.size();
for (int y = 0; y < size; y++) {
int length = kisu.get(y).length;
for (int x = 0; x < length; x++) {
if (kisu.get(y)[x]) {
Point o = new Point(x, y);
Point d = new Point(x, y + 1);
map.get(o).put(Vec.D, d);
map.get(d).put(Vec.U, o);
}
}
}
}
Vec next = Vec.R;
Point posi = new Point(0, 0);
do {
next = next.next().next().next();
Map<Vec, Point> point = map.get(posi);
while (!point.containsKey(next)) {
next = next.next();
}
System.out.print(next);
posi = point.get(next);
} while (posi.x != 0 || posi.y != 0);
}
}
|
Main.java:14: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:14: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:16: error: cannot find symbol
List<boolean[]> gusu = new ArrayList<boolean[]>();
^
symbol: class List
location: class Main
Main.java:16: error: cannot find symbol
List<boolean[]> gusu = new ArrayList<boolean[]>();
^
symbol: class ArrayList
location: class Main
Main.java:17: error: cannot find symbol
List<boolean[]> kisu = new ArrayList<boolean[]>();
^
symbol: class List
location: class Main
Main.java:17: error: cannot find symbol
List<boolean[]> kisu = new ArrayList<boolean[]>();
^
symbol: class ArrayList
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Map
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Point
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Map
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Point
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class HashMap
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Point
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Map
location: class Main
Main.java:33: error: cannot find symbol
Map<Point, Map<Vec, Point>> map = new HashMap<Point, Map<Vec, Point>>();
^
symbol: class Point
location: class Main
Main.java:39: error: cannot find symbol
new Point(x, y),
^
symbol: class Point
location: class Main
Main.java:40: error: cannot find symbol
new EnumMap<Vec, Point>(Vec.class));
^
symbol: class EnumMap
location: class Main
Main.java:40: error: cannot find symbol
new EnumMap<Vec, Point>(Vec.class));
^
symbol: class Point
location: class Main
Main.java:49: error: cannot find symbol
Point o = new Point(x, y);
^
symbol: class Point
location: class Main
Main.java:49: error: cannot find symbol
Point o = new Point(x, y);
^
symbol: class Point
location: class Main
Main.java:50: error: cannot find symbol
Point r = new Point(x + 1, y);
^
symbol: class Point
location: class Main
Main.java:50: error: cannot find symbol
Point r = new Point(x + 1, y);
^
symbol: class Point
location: class Main
Main.java:63: error: cannot find symbol
Point o = new Point(x, y);
^
symbol: class Point
location: class Main
Main.java:63: error: cannot find symbol
Point o = new Point(x, y);
^
symbol: class Point
location: class Main
Main.java:64: error: cannot find symbol
Point d = new Point(x, y + 1);
^
symbol: class Point
location: class Main
Main.java:64: error: cannot find symbol
Point d = new Point(x, y + 1);
^
symbol: class Point
location: class Main
Main.java:72: error: cannot find symbol
Point posi = new Point(0, 0);
^
symbol: class Point
location: class Main
Main.java:72: error: cannot find symbol
Point posi = new Point(0, 0);
^
symbol: class Point
location: class Main
Main.java:75: error: cannot find symbol
Map<Vec, Point> point = map.get(posi);
^
symbol: class Map
location: class Main
Main.java:75: error: cannot find symbol
Map<Vec, Point> point = map.get(posi);
^
symbol: class Point
location: class Main
29 errors
|
s156836840
|
p00037
|
Java
|
import java.util.*;
public class Main {
int[][] mapA = new int[5][4];
int[][] mapB = new int[4][5];
int x, y, d;
boolean flag;
void U(){
if(flag==true && y>0 && mapB[y-1][x]==1){
d=0;
y--;
flag = false;
System.out.print("U");
}
}
void R(){
if(flag==true && x<4 && mapA[y][x]==1){
d=1;
x++;
flag = false;
System.out.print("R");
}
}
void D(){
if(flag==true && y<4 && mapB[y][x]==1){
d=2;
y++;
flag = false;
System.out.print("D");
}
}
void L(){
if(flag==true && x>0 && mapA[y][x-1]==1){
d=3;
x--;
flag = false;
System.out.print("L");
}
}
void solve(){
Scanner sc = new Scanner(System.in);
for(int i=0;i<9;i++){
String s = sc.next();
if(i%2==0){
for(int j=0;j<4;j++) mapA[i/2][j] = s.codePointAt(j)-48;
}else{
for(int j=0;j<5;j++) mapB[i/2][j] = s.codePointAt(j)-48;
}
}
x = 0;
y = 0;
d = 1;
while(true){
flag = true;
if(d==0){
L();
U();
R();
D();
}else if(d==1){
U();
R();
D();
L();
}else if(d==2){
R();
D();
L();
U();
}else if(d==3){
D();
L();
U();
R();
}
if(x==0 && y==0){
System.out.println();
break;
}
}
}
public static void main(String[] args) {
new AOJ_0037().solve();
}
}
|
Main.java:94: error: cannot find symbol
new AOJ_0037().solve();
^
symbol: class AOJ_0037
location: class Main
1 error
|
s996353251
|
p00037
|
Java
|
import java.util.*;
public class Main {
int[][] mapA = new int[5][4];
int[][] mapB = new int[4][5];
int x, y, d;
boolean flag;
void U(){
if(flag==true && y>0 && mapB[y-1][x]==1){
d=0;
y--;
flag = false;
System.out.print("U");
}
}
void R(){
if(flag==true && x<4 && mapA[y][x]==1){
d=1;
x++;
flag = false;
System.out.print("R");
}
}
void D(){
if(flag==true && y<4 && mapB[y][x]==1){
d=2;
y++;
flag = false;
System.out.print("D");
}
}
void L(){
if(flag==true && x>0 && mapA[y][x-1]==1){
d=3;
x--;
flag = false;
System.out.print("L");
}
}
void solve(){
Scanner sc = new Scanner(System.in);
for(int i=0;i<9;i++){
String s = sc.next();
if(i%2==0){
for(int j=0;j<4;j++) mapA[i/2][j] = s.codePointAt(j)-48;
}else{
for(int j=0;j<5;j++) mapB[i/2][j] = s.codePointAt(j)-48;
}
}
x = 0;
y = 0;
d = 1;
while(true){
flag = true;
if(d==0){
L();
U();
R();
D();
}else if(d==1){
U();
R();
D();
L();
}else if(d==2){
R();
D();
L();
U();
}else if(d==3){
D();
L();
U();
R();
}
if(x==0 && y==0){
System.out.println();
break;
}
}
}
public static void main(String[] args) {
new Main.solve();
}
}
|
Main.java:94: error: cannot find symbol
new Main.solve();
^
symbol: class solve
location: class Main
1 error
|
s798003031
|
p00037
|
Java
|
import java.util.Scanner;
//Path on a Grid
public class Main {
void run(){
int[][] move = {{-1,0},{0,1},{1,0},{0,-1}};
char[] ch = {'U','R','D','L'};
Scanner sc = new Scanner(System.in);
boolean[][] e = new boolean[25][25];
int h = 0, t = 0;
for(int x=0;x<9;x++){
char[] s = sc.next().toCharArray();
for(int j=0;j<s.length;j++){
if(s[j]=='0')continue;
if(t==0)e[h*5+j][h*5+j+1] = e[h*5+j+1][h*5+j] = true;
else e[h*5+j][(h+1)*5+j] = e[(h+1)*5+j][h*5+j] = true;
}
if(t==1)h++;
t=(t+1)%2;
}
int i=0, j=0, d=1;
StringBuilder sb = new StringBuilder();
boolean con = true;
while(con){
for(int k=3;k<=6;k++){
int nd = (d+k)%4;
int ni = i+move[nd][0];
int nj = j+move[nd][1];
if(0<=ni&&ni<5&&0<=nj&&nj<5&&e[i*5+j][ni*5+nj]){
sb.append(ch[nd]);
i = ni; j = nj; d = nd;
if(i==0&&j==0)con = false;
break;
}
}
}
System.out.println(sb);
}
public static void main(String[] args) {
new AOJ0037().run();
}
}
|
Main.java:42: error: cannot find symbol
new AOJ0037().run();
^
symbol: class AOJ0037
location: class Main
1 error
|
s304414074
|
p00037
|
C
|
h#include <stdio.h>
#include <stdbool.h>
#include <string.h>
bool wall[10000][10000][4];
char str[10001];
const int U = 0;
const int R = 1;
const int D = 2;
const int L = 3;
char dirchar[] = "URDL" ;
int righthand(int x) {return (x+1)%4;}
int lefthand(int x) {return (x+3)%4;}
int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
int main() {
bool firsttime = true;
int width, height=0, i;
int dir = R, x = 1, y = 0;
while (true) {
height++;
scanf("%9999s\n", str);
if (firsttime) {
width = strlen(str)+2;
firsttime = false;
}
for (i = 0; i<width-2; i++) {
wall[i+1][height][U] = wall[i+1][height-1][D] = (str[i] == '1');
}
if (scanf("%10000s\n", str) == -1) {
break;
}
for (i=0; i<width-1; i++) {
wall[i][height][R] = wall[i+1][height][L] = (str[i] == '1');
}
}
height++;
firsttime = true;
while (true) {
if (!firsttime &&
((x == 1 && y == 0) ||
(x == 0 && y == 1) ||
(x == 1 && y == 1)) &&
wall[x][y][righthand(dir)]) {
putchar(dirchar[dir]);
break;
}
if (!wall[x][y][righthand(dir)]) {
dir = righthand(dir);
x += dx[dir];
y += dy[dir];
} else if (wall[x][y][dir]) {
putchar(dirchar[dir]);
dir = lefthand(dir);
} else {
x += dx[dir];
y += dy[dir];
putchar(dirchar[dir]);
}
firsttime = false;
}
puts("");
return 0;
}
|
main.c:1:2: error: stray '#' in program
1 | h#include <stdio.h>
| ^
main.c:1:1: error: unknown type name 'h'
1 | h#include <stdio.h>
| ^
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | h#include <stdio.h>
| ^
In file included from main.c:3:
/usr/include/string.h:44:22: error: unknown type name 'size_t'
44 | size_t __n) __THROW __nonnull ((1, 2));
| ^~~~~~
/usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
33 | #include <stddef.h>
+++ |+#include <stddef.h>
34 |
/usr/include/string.h:47:56: error: unknown type name 'size_t'
47 | extern void *memmove (void *__dest, const void *__src, size_t __n)
| ^~~~~~
/usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:55:32: error: unknown type name 'size_t'
55 | int __c, size_t __n)
| ^~~~~~
/usr/include/string.h:55:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:61:42: error: unknown type name 'size_t'
61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:64:56: error: unknown type name 'size_t'
64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n)
| ^~~~~~
/usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:80:60: error: unknown type name 'size_t'
80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
| ^~~~~~
/usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:107:48: error: unknown type name 'size_t'
107 | extern void *memchr (const void *__s, int __c, size_t __n)
| ^~~~~~
/usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:145:53: error: unknown type name 'size_t'
145 | const char *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:153:23: error: unknown type name 'size_t'
153 | size_t __n) __THROW __nonnull ((1, 2));
| ^~~~~~
/usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:159:57: error: unknown type name 'size_t'
159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
| ^~~~~~
/usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:166:8: error: unknown type name 'size_t'
166 | extern size_t strxfrm (char *__restrict __dest,
| ^~~~~~
/usr/include/string.h:166:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:167:54: error: unknown type name 'size_t'
167 | const char *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:179:8: error: unknown type name 'size_t'
179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
| ^~~~~~
/usr/include/string.h:179:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:179:59: error: unknown type name 'size_t'
179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
| ^~~~~~
/usr/include/string.h:179:59: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:195:45: error: unknown type name 'size_t'
195 | extern char *strndup (const char *__string, size_t __n)
| ^~~~~~
/usr/include/string.h:195:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:293:8: error: unknown type name 'size_t'
293 | extern size_t strcspn (const char *__s, const char *__reject)
| ^~~~~~
/usr/include/string.h:293:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:297:8: error: unknown type name 'size_t'
297 | extern size_t strspn (const char *__s, const char *__accept)
| ^~~~~~
/usr/include/string.h:297:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:389:46: error: unknown type name 'size_t'
389 | extern void *memmem (const void *__haystack, size_t __haystacklen,
| ^~~~~~
/usr/include/string.h:389:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:390:44: error: unknown type name 'size_t'
390 | const void *__needle, size_t __needlelen)
| ^~~~~~
/usr/include/string.h:390:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:398:55: error: unknown type name 'size_t'
398 | const void *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:398:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:401:53: error: unknown type name 'size_t'
401 | const void *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:401:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:407:8: error: unknown type name 'size_t'
407 | extern size_t strlen (const char *__s)
| ^~~~~~
/usr/include/string.h:407:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:413:8: error: unknown type name 'size_t'
413 | extern size_t strnlen (const char *__string, size_t __maxlen)
| ^~~~~~
/usr/include/string.h:413:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:413:46: error: unknown type name 'size_t'
413 | extern size_t strnlen (const char *__string, size_t __maxlen)
| ^~~~~~
/usr/include/string.h:413:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/string.h:26:
/usr/include/string.h:432:12: error: unknown type name 'size_t'
432 | extern int __REDIRECT_NTH (strerror_r,
| ^~~~~~~~~~~~~~
/usr/include/string.h:432:12: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
In file included from /usr/include/string.h:462:
/usr/include/strings.h:34:54: error: unknown type name 'size_t'
34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n)
| ^~~~~~
/usr/include/strings.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
23 | #include <stddef.h>
+++ |+#include <stddef.h>
24 |
/usr/include/strings.h:38:53: error: unknown type name 'size_t'
38 | extern void bcopy (const void *__src, void *__dest, size_t __n)
| ^~~~~~
/usr/include/strings.h:38:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/strings.h:42:31: error: unknown type name 'size_t'
42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/strings.h:42:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/strings.h:120:61: error: unknown type name 'size_t'
120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
| ^~~~~~
/usr/include/strings.h:120:61: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/strings.h:134:27: error: unknown type name 'size_t'
134 | size_t __n, locale_t __loc)
| ^~~~~~
/usr/include/strings.h:134:
|
s735184979
|
p00037
|
C
|
#include<stdio.h>
char f[6][6],i,j,a,y,x,p;
int main()
{
for(;i<9;++i){
gets(f[5]);
for(j=0;j<4+i%2;++j){
a=f[5][j]-48;
f[i/2][j]|=a<<(1+i%2);
f[i/2+i%2][j+!(i%2)]|=a<<3-i%2*3;
}
}
do{
while(!((f[y][x]>>(p=(p+1)%4))&1));
putchar("URDL"[p]);
x+=p?2-p:0;
y+=p==3?0:p-1;
p=(p+2)%4;
}while(y||x||f[0][0]==6&&p==3);
return!puts("");
}
|
main.c: In function 'main':
main.c:6:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
6 | gets(f[5]);
| ^~~~
| fgets
|
s958248134
|
p00037
|
C
|
w[25],i;main(d){for(i<9;i++){if(i&1)for(d=0;d<5;d++)getchar()-'0'?w[i/2*5+d]|=2,w[i/2*5+d+5]|=8:0;else for(d=0;d<4;d++)getchar()-'0'?w[i/2*5+d]|=1,w[i/2*5-~d]|=4:0;getchar();}d=!putchar(82);for(i=1;d|i;d&=3)w[i]&1<<d?i+="GKEA"[d]-70,putchar("RDLU"[d]),w[i]&1<<(d+3&3)&&--d:++d;i=!puts("");}
|
main.c:1:1: warning: data definition has no type or storage class
1 | w[25],i;main(d){for(i<9;i++){if(i&1)for(d=0;d<5;d++)getchar()-'0'?w[i/2*5+d]|=2,w[i/2*5+d+5]|=8:0;else for(d=0;d<4;d++)getchar()-'0'?w[i/2*5+d]|=1,w[i/2*5-~d]|=4:0;getchar();}d=!putchar(82);for(i=1;d|i;d&=3)w[i]&1<<d?i+="GKEA"[d]-70,putchar("RDLU"[d]),w[i]&1<<(d+3&3)&&--d:++d;i=!puts("");}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'w' [-Wimplicit-int]
main.c:1:7: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | w[25],i;main(d){for(i<9;i++){if(i&1)for(d=0;d<5;d++)getchar()-'0'?w[i/2*5+d]|=2,w[i/2*5+d+5]|=8:0;else for(d=0;d<4;d++)getchar()-'0'?w[i/2*5+d]|=1,w[i/2*5-~d]|=4:0;getchar();}d=!putchar(82);for(i=1;d|i;d&=3)w[i]&1<<d?i+="GKEA"[d]-70,putchar("RDLU"[d]),w[i]&1<<(d+3&3)&&--d:++d;i=!puts("");}
| ^
main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int]
1 | w[25],i;main(d){for(i<9;i++){if(i&1)for(d=0;d<5;d++)getchar()-'0'?w[i/2*5+d]|=2,w[i/2*5+d+5]|=8:0;else for(d=0;d<4;d++)getchar()-'0'?w[i/2*5+d]|=1,w[i/2*5-~d]|=4:0;getchar();}d=!putchar(82);for(i=1;d|i;d&=3)w[i]&1<<d?i+="GKEA"[d]-70,putchar("RDLU"[d]),w[i]&1<<(d+3&3)&&--d:++d;i=!puts("");}
| ^~~~
main.c: In function 'main':
main.c:1:9: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:1:28: error: expected ';' before ')' token
1 | w[25],i;main(d){for(i<9;i++){if(i&1)for(d=0;d<5;d++)getchar()-'0'?w[i/2*5+d]|=2,w[i/2*5+d+5]|=8:0;else for(d=0;d<4;d++)getchar()-'0'?w[i/2*5+d]|=1,w[i/2*5-~d]|=4:0;getchar();}d=!putchar(82);for(i=1;d|i;d&=3)w[i]&1<<d?i+="GKEA"[d]-70,putchar("RDLU"[d]),w[i]&1<<(d+3&3)&&--d:++d;i=!puts("");}
| ^
| ;
main.c:1:53: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration]
1 | w[25],i;main(d){for(i<9;i++){if(i&1)for(d=0;d<5;d++)getchar()-'0'?w[i/2*5+d]|=2,w[i/2*5+d+5]|=8:0;else for(d=0;d<4;d++)getchar()-'0'?w[i/2*5+d]|=1,w[i/2*5-~d]|=4:0;getchar();}d=!putchar(82);for(i=1;d|i;d&=3)w[i]&1<<d?i+="GKEA"[d]-70,putchar("RDLU"[d]),w[i]&1<<(d+3&3)&&--d:++d;i=!puts("");}
| ^~~~~~~
main.c:1:1: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
+++ |+#include <stdio.h>
1 | w[25],i;main(d){for(i<9;i++){if(i&1)for(d=0;d<5;d++)getchar()-'0'?w[i/2*5+d]|=2,w[i/2*5+d+5]|=8:0;else for(d=0;d<4;d++)getchar()-'0'?w[i/2*5+d]|=1,w[i/2*5-~d]|=4:0;getchar();}d=!putchar(82);for(i=1;d|i;d&=3)w[i]&1<<d?i+="GKEA"[d]-70,putchar("RDLU"[d]),w[i]&1<<(d+3&3)&&--d:++d;i=!puts("");}
main.c:1:179: error: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
1 | w[25],i;main(d){for(i<9;i++){if(i&1)for(d=0;d<5;d++)getchar()-'0'?w[i/2*5+d]|=2,w[i/2*5+d+5]|=8:0;else for(d=0;d<4;d++)getchar()-'0'?w[i/2*5+d]|=1,w[i/2*5-~d]|=4:0;getchar();}d=!putchar(82);for(i=1;d|i;d&=3)w[i]&1<<d?i+="GKEA"[d]-70,putchar("RDLU"[d]),w[i]&1<<(d+3&3)&&--d:++d;i=!puts("");}
| ^~~~~~~
main.c:1:179: note: include '<stdio.h>' or provide a declaration of 'putchar'
main.c:1:281: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
1 | w[25],i;main(d){for(i<9;i++){if(i&1)for(d=0;d<5;d++)getchar()-'0'?w[i/2*5+d]|=2,w[i/2*5+d+5]|=8:0;else for(d=0;d<4;d++)getchar()-'0'?w[i/2*5+d]|=1,w[i/2*5-~d]|=4:0;getchar();}d=!putchar(82);for(i=1;d|i;d&=3)w[i]&1<<d?i+="GKEA"[d]-70,putchar("RDLU"[d]),w[i]&1<<(d+3&3)&&--d:++d;i=!puts("");}
| ^~~~
main.c:1:281: note: include '<stdio.h>' or provide a declaration of 'puts'
|
s929184884
|
p00037
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main(){
char ma[11][11];
memset(ma,'0',sizeof(ma));
for(int i=1;i<10;i++){
if(i%2==1)
for(int j=2;j<9;j+=2)
cin>>ma[i][j];
else
for(int j=1;j<10;j+=2)
cin>>ma[i][j];
}
int x=1,y=1,dir=0;
int mv[4][2]={{2,0},{0,2},{-2,0},{0,-2}};
int ts[4][6]={{1,-1,1,0,0,-1},{1,1,0,1,1,0},{-1,1,-1,0,0,1},{-1,-1,0,-1,-1,0}};
string str[4]={"R","D","L","U"};
string path="";
int ch=0;
for(int k=0;k<40;k++){
int wen=1;
while(ma[y+ts[dir][3]][x+ts[dir][2]]=='1'){
y+=mv[dir][1];
x+=mv[dir][0];
wen=0;
path+=str[dir];
wen++;
}
if(x==1&&y==1)
break;
if(ma[y+ts[dir][5]][x+ts[dir][4]]=='1')ch=1;
do{
if(ch==0)dir=(dir+1)%4;
else dir=(dir+4-1)%4;
}while((y+ts[dir][3]>10||y+ts[dir][3]<0||x+ts[dir][2]>10||x+ts[dir][2]<0)||ma[y+ts[dir][1]][x+ts[dir][0]]=='1');
}
cout<<path<<endl;
}
//RRRRDDDDLLLUUURRDDLURULLDDDRRRUUUULLLL
//RRRRDDDDLLLUUURRDDLURULLDDDRRRUUUULLLL
|
a.cc: In function 'int main()':
a.cc:7:5: error: 'memset' was not declared in this scope
7 | memset(ma,'0',sizeof(ma));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 | #include<string>
|
s604573683
|
p00037
|
C++
|
#include <cstdio>
#include <string>
#include <iostream>
using namespace std;
string str[100];
int len;
int fie[101][101];
int m;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
char s[4]={'R','D','L','U'};
int main(void){
int n=0;
while(cin >> str[n])n++;
if(n>9){
printf("0\n")
return 0;
}
m=str[0].size();
for(int i=0;i<n;i++){
for(int j=0;j<str[i].size();j++){
if(str[i][j]=='1'){
if(i%2==0)fie[j*2+2][i+1]=1;
if(i%2==1)fie[j*2+1][i+1]=1;
}
}
}
int x=2,y=0,dir=0;
while(1){
int nx=x+dx[(dir+1)%4],ny=y+dy[(dir+1)%4];
if(nx>=0 && nx<=m*2+2 && ny>=0 && ny<=n+1){
if(fie[nx][ny]==1)printf("%c",s[dir]);
}
nx=x+dx[dir],ny=y+dy[dir];
if(nx>=0 && nx<=m*2+2 && ny>=0 && ny<=n+1){
if(fie[nx][ny]==0){
x+=dx[dir]*2;
y+=dy[dir]*2;
if(fie[x+dx[(dir+1)%4]][y+dy[(dir+1)%4]]==0){
dir=(dir+1)%4;
}
}else{
if(fie[x+dx[(dir+3)%4]][y+dy[(dir+3)%4]]==0){
dir=(dir+3)%4;
x+=dx[dir]*2;
y+=dy[dir]*2;
printf("%c",s[dir]);
}else{
dir=(dir+2)%4;
x+=dx[dir]*2;
y+=dy[dir]*2;
printf("%c",s[(dir+1)%4]);
printf("%c",s[dir]);
}
}
}else dir=(dir+1)%4;
//printf("%d %d %d %d %d\n",x,y,dir,dx[dir],dy[dir]);
if(x==0 && y==0)break;
}
printf("\n");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:30: error: expected ';' before 'return'
17 | printf("0\n")
| ^
| ;
18 | return 0;
| ~~~~~~
|
s183455482
|
p00037
|
C++
|
#include <bits/stdc++.h>
using namespace std ;
#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init))
#define mp(a,b) make_pair(a,b)
#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;
const int mod = 1000000007;
constexpr int inf = ((1<<30)-1)*2+1 ;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
inline bool value(int x,int y,int w,int h){
return (x >= 0 && x < w && y >= 0 && y < h);
}
const int dy[] = {1,0,0,-1,1,-1,1,-1};
const int dx[] = {0,-1,1,0,1,-1,-1,1};
const int bit[] = {8,4,1,2,1,};
const string = "DLRU";
ll grid[6][6];
// u = 1,r = 2, d = 4, l = 8
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
vary(char,v,5,0);
rep(i,9){
if(i % 2){
rep(j,5){
cin >> v[j];
v[j] -= '0';
grid[j+1][i/2+1] |= 8 *v[j];
grid[j][i/2+1] |= 2 * v[j];
}
}
else{
rep(j,4){
cin >> v[j];
v[j] -= '0';
grid[j+1][i/2+1] |= v[j];
grid[j+1][i/2] |= v[j]* 4;
}
}
}
ll x = 1,y = 0,c=0,dir = 2;
ll u = 1,r = 2, d = 4,l = 8;
cout << "R";
while(1){
if(x == 1 && y == 0 && c) break;
++c;
if(c > 100)break;
if(dir == 0){
if(grid[x][y+1] & l){
++y;
cout << "D";
}
else if(grid[x-1][y+1] & u){
--x;
++y;
dir = 1;
cout << "L";
}
}
else if(dir == 1){
if(grid[x-1][y] & u){
--x;
cout << "L";
}
else if(grid[x-1][y-1] & r){
--x;
--y;
dir = 3;
cout << "U";
}
}
else if(dir == 2){
if(grid[x+1][y] & d){
++x;
cout << "R";
}
else if(grid[x+1][y+1] & l){
++x;
++y;
dir = 0;
cout << "D";
}
}
else if(dir == 3){
if(grid[x][y-1] & r){
--y;
cout << "U";
}
else if(grid[x+1][y-1] & d){
++x;
--y;
dir =2;
cout << "R";
}
}
if(dir == 0){
if(grid[x][y] & d){
dir = 2;
cout << "R";
if(grid[x][y] & r){
dir = 3;
cout << "U";
}
}
}
else if(dir == 1){
if(grid[x][y] & l){
dir = 0;
cout << "D";
if(grid[x][y] & d){
dir = 2;
cout << "R";
}
}
}
else if(dir == 2){
if(grid[x][y] & r){
dir = 3;
cout << "U";
if(grid[x][y] & u){
dir = 1;
cout <<"L";
}
}
}
else if(dir == 3){
if(grid[x][y] & u){
dir = 1;
cout <<"L";
if(grid[x][y] & l){
dir = 0;
cout << "D";
}
}
}
}
cout << endl;
// cout << "u = 1,r = 2, d = 4, l = 8"<<endl;
// rep(i,6){
// rep(j,6){
// scout(3) << grid[j][i];
// }
// cout << endl;
// }
return 0;
}
|
a.cc:40:14: error: expected unqualified-id before '=' token
40 | const string = "DLRU";
| ^
|
s358678179
|
p00037
|
C++
|
#include<stdio.h>///////AOJ0037
int
w[5
][5],i,j;char(b)[ 128
],* p;F (//
int v){ for
(i= scanf("%s" ,b)
-1, p=b ;*p ;++
p){ w[p -b+ 1-v
][j +v]|=((w[p -b]
[j] |=(
p[0 ]==
49)<<3-v)&8>>v)>>2;}j+=v
;}
main
(){ for
(;F (0)
,j- 4;F
(1));for(p=b,
j=( *b=
3)^ 3;i +=-66+"BAB\
C"[ *b] ,j+= "?\
@A" "@" [*b ]-(
1<< 6),*
++p =(*
b)[ "U"
"L" "D"
"R" ],i
+j;)for((++*
b)&=~4;!((1<<*
b)&
w[i
][j
]); (*b
+=3 )&=
~4) ;re\
turn !puts
(b+1);}
|
a.cc:5:24: error: ISO C++ forbids declaration of 'F' with no type [-fpermissive]
5 | ],* p;F (//
| ^
a.cc: In function 'int F(int)':
a.cc:15:7: warning: no return statement in function returning non-void [-Wreturn-type]
15 | ;}
| ^
a.cc: At global scope:
a.cc:16:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
16 | main
| ^~~~
|
s059499492
|
p00037
|
C++
|
#include<stdio.h>///////AOJ0037
int
w[5
][5],i,j;char(b)[ 128
],* p;F (//
int v){ for
(i= scanf("%s" ,b)
-1, p=b ;*p ;++
p){ w[p -b+ 1-v
][j +v]|=((w[p -b]
[j] |=(
p[0 ]==
49)<<3-v)&8>>v)>>2;}j+=v
;}
main
(){ for
(;F (0)
,j- 4;F
(1));for(p=b,
j=( *b=
3)^ 3;i +=-66+"BAB\
C"[ *b] ,j+= "?\
@A" "@" [*b ]-(
1<< 6),*
++p =(*
b)[ "U"
"L" "D"
"R" ],i
+j;)for((++*
b)&=~4;!((1<<*
b)&
w[i
][j
]); (*b
+=3 )&=
~4) ;re\
turn !puts
(b+1);}
|
a.cc:5:24: error: ISO C++ forbids declaration of 'F' with no type [-fpermissive]
5 | ],* p;F (//
| ^
a.cc: In function 'int F(int)':
a.cc:15:7: warning: no return statement in function returning non-void [-Wreturn-type]
15 | ;}
| ^
a.cc: At global scope:
a.cc:16:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
16 | main
| ^~~~
|
s667160200
|
p00037
|
C++
|
#include<stdio.h>
#define r(i,n) for(int i=0;i<n;++i)
int f[5][5];
main(e,f)
{
r(i,9){
char s[6];
scanf("%s",s);
if(i%2){
r(j,5){
int a=s[j]-'0';
f[i/2][j]|=a<<2;
f[i/2+1][j]|=a;
}
}else{
r(j,4){
int a=s[j]-'0';
f[i/2][j]|=a<<1;
f[i/2][j+1]|=a<<3;
}
}
}
printf("R");
int y=0,x=1,p=1;
do{
p=(p+2)%4;
int d=p;
do
d=(d+1)%4;
while(!((f[y][x]>>d)&1));
p=d;
putchar("URDL"[d]);
int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
x+=dx[d];
y+=dy[d];
}while(y!=0||x!=0||f[0][0]==6&&p==3);
puts("");
}
|
a.cc:4:5: error: expected constructor, destructor, or type conversion before '(' token
4 | main(e,f)
| ^
|
s558071541
|
p00037
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int a[12][12];
int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};
char dc[4] = {'R','D','L','U'};
//©ªÌüÍS}XÌÇÌóÔð²×é
void cheakWall(int* wall , const int& px ,const int& py ,const int& d ){
for(int i=0 ; i<4 ; ++i ){
int mx = px + dx[(d+i)%4];
int my = py + dy[(d+i)%4];
wall[i] = a[my][mx];
}
}
//iñ¾ü«ðL^
void record(string& s,int* wall){
if( wall[1] ){
s.push_back( dc[d] );
}
}
//iÞ
void go(int& px, int& py, const int& d,int* wall, string& s){
px += dx[d]*2;
py += dy[d]*2;
record(s,wall);
}
int main(){
string s;
//zñÌú»
for(int y=0 ; y<12 ; ++y )
for(int x=0 ; x<12 ; ++x )
a[y][x] = 0;
//üÍ
for(int i=0 ; i<9 ; ++i ){
cin >> s;
int y = i+1;
int x = (i+1)%2 + 1;
for(int j=0 ; j<(int)s.size() ; ++j , x+=2 ){
a[y][x] = s[j] - '0';
}
}
int px = 2, py = 0, d = 0;
bool flag = false;
s.clear();
while( 1 ){
if( px == 0 && py == 0 ) break;
int wall[4];
//©ªÌüèÌóÔ
cheakWall( wall , px , py , d );
if( !wall[1] ){//EªÇ¶áÈ©Á½ç
//ü«ðEü«Éñé
d = (d+1)%4;
//iÞ
go( px , py , d , wall , s );
flag = false;
}else{
if( !wall[0] ){//OªÇ¶áÈ©Á½ç
//iÞ
go( px , py , d , wall , s );
flag = false;
}else{
if( !wall[3] ){//¶ªÇ¶áÈ©Á½ç
if( flag == false ){
//iñ¾ü«ðL^
record(s,wall);
}
//ü«ð¶ü«Éñé
d = (d+3)%4;
//iÞ
go( px , py , d , wall , s );
flag = false;
}else{//OEEE¶ªÇ¾Á½ç
flag = true;
//iñ¾ü«ðL^
record(s,wall);
//ü«ðEü«Éñé
d = (d+3)%4;
//iñ¾ü«ðL^
s.push_back( dc[d] );
}
}
}
}
cout << s << endl;
}
|
a.cc: In function 'void record(std::string&, int*)':
a.cc:22:33: error: 'd' was not declared in this scope
22 | s.push_back( dc[d] );
| ^
|
s908680907
|
p00037
|
C++
|
hoge
|
a.cc:1:1: error: 'hoge' does not name a type
1 | hoge
| ^~~~
|
s814299072
|
p00037
|
C++
|
hige
|
a.cc:1:1: error: 'hige' does not name a type
1 | hige
| ^~~~
|
s525232007
|
p00037
|
C++
|
«ã¤èÍz
|
a.cc:1:1: error: extended character is not valid in an identifier
1 | «ã¤èÍz
| ^
a.cc:1:1: error: extended character « is not valid in an identifier
a.cc:1:1: error: extended character is not valid in an identifier
a.cc:1:1: error: extended character is not valid in an identifier
a.cc:1:1: error: extended character ¤ is not valid in an identifier
a.cc:1:1: error: extended character is not valid in an identifier
a.cc:1:1: error: extended character is not valid in an identifier
a.cc:1:1: error: extended character is not valid in an identifier
a.cc:1:1: error: extended character is not valid in an identifier
a.cc:1:1: error: extended character is not valid in an identifier
a.cc:1:1: error: '\302\202\302\253\302\202\303\243\302\202\302\244\302\202\303\250\302\202\303\215\302\203z\302\203\302\202' does not name a type
1 | «ã¤èÍz
| ^~~~~~~~~~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.