실행 실패 (제출 코드 컴파일 에러)
Main.cpp:2:7: error: expected nested-name-specifier before ‘System’ 2 | using System; | ^~~~~~ Main.cpp:3:7: error: expected nested-name-specifier before ‘System’ 3 | using System.Linq; | ^~~~~~ Main.cpp:4:7: error: expected nested-name-specifier before ‘System’ 4 | using System.Net.Http.Headers; | ^~~~~~ Main.cpp:5:7: error: expected nested-name-specifier before ‘System’ 5 | using System.Reflection.Metadata.Ecma335; | ^~~~~~ Main.cpp:6:7: error: expected nested-name-specifier before ‘System’ 6 | using System.Runtime.InteropServices.Marshalling; | ^~~~~~ Main.cpp:7:7: error: expected nested-name-specifier before ‘System’ 7 | using System.Text; | ^~~~~~ Main.cpp:14:15: error: expected ‘:’ before ‘char’ 14 | public char command_rot; | ^~~~~ | : Main.cpp:15:15: error: expected ‘:’ before ‘int’ 15 | public int sec; | ^~~~ | : Main.cpp:17:15: error: expected ‘:’ before ‘Sequence’ 17 | public Sequence(char command, int sec) | ^~~~~~~~~ | : Main.cpp:22:6: error: expected ‘;’ after class definition 22 | } | ^ | ; Main.cpp:32:12: error: expected unqualified-id before ‘[’ token 32 | int[] right = new int[2] { 0, 1 }; | ^ Main.cpp:33:12: error: expected unqualified-id before ‘[’ token 33 | int[] left = new int[2] { 0, -1 }; | ^ Main.cpp:34:12: error: expected unqualified-id before ‘[’ token 34 | int[] down = new int[2] { 1, 0 }; | ^ Main.cpp:35:12: error: expected unqualified-id before ‘[’ token 35 | int[] up = new int[2] { -1, 0 }; | ^ Main.cpp:37:15: error: expected ‘:’ before ‘int’ 37 | public int[] GetArrowCommand() | ^~~~ | : Main.cpp:37:19: error: expected unqualified-id before ‘[’ token 37 | public int[] GetArrowCommand() | ^ Main.cpp:56:15: error: expected ‘:’ before ‘void’ 56 | public void SetRot(char command) | ^~~~~ | : Main.cpp:77:6: error: expected ‘;’ after class definition 77 | } | ^ | ; Main.cpp:81:15: error: expected ‘:’ before ‘int’ 81 | public int x; | ^~~~ | : Main.cpp:82:15: error: expected ‘:’ before ‘int’ 82 | public int y; | ^~~~ | : Main.cpp:83:6: error: expected ‘;’ after class definition 83 | } | ^ | ; Main.cpp:87:9: error: ‘List’ does not name a type 87 | List<Body> bodyList = new List<Body>(); | ^~~~ Main.cpp:89:15: error: expected ‘:’ before ‘Snake’ 89 | public Snake() | ^~~~~~ | : Main.cpp:99:15: error: expected ‘:’ before ‘void’ 99 | public void SetPosition(int[] arrowCommand) | ^~~~~ | : Main.cpp:99:39: error: expected ‘,’ or ‘...’ before ‘arrowCommand’ 99 | public void SetPosition(int[] arrowCommand) | ^~~~~~~~~~~~ Main.cpp:133:15: error: expected ‘:’ before ‘void’ 133 | public void AddBody(int[] arrowCommand) | ^~~~~ | : Main.cpp:133:35: error: expected ‘,’ or ‘...’ before ‘arrowCommand’ 133 | public void AddBody(int[] arrowCommand) | ^~~~~~~~~~~~ Main.cpp:147:15: error: expected ‘:’ before ‘Body’ 147 | public Body GetHead() | ^~~~~ | : Main.cpp:152:15: error: expected ‘:’ before ‘Body’ 152 | public Body GetTail() | ^~~~~ | : Main.cpp:157:15: error: expected ‘:’ before ‘bool’ 157 | public bool CheckEatApple(int x, int y) | ^~~~~ | : Main.cpp:168:6: error: expected ‘;’ after class definition 168 | } | ^ | ; Main.cpp:172:15: error: expected unqualified-id before ‘[’ token 172 | static int[,] map; | ^ Main.cpp:175:12: error: ‘List’ does not name a type 175 | static List<Sequence> sequenceList = new List<Sequence>(); | ^~~~ Main.cpp:176:36: error: default member initializer for ‘Program::Arrow::rot’ required before the end of its enclosing class 176 | static Arrow arrow = new Arrow(); | ^ Main.cpp:30:17: note: defined here 30 | int rot = 90; | ^~~~~ Main.cpp:176:18: error: ‘constexpr’ needed for in-class initialization of static data member ‘Program::Arrow Program::arrow’ of non-integral type [-fpermissive] 176 | static Arrow arrow = new Arrow(); | ^~~~~ Main.cpp:176:36: error: non-constant in-class initialization invalid for non-inline static member ‘Program::arrow’ 176 | static Arrow arrow = new Arrow(); | ^ Main.cpp:176:36: note: (an out of class initialization is required) Main.cpp:285:48: error: expected ‘,’ or ‘...’ before ‘arrowCommand’ 285 | static bool CheckEatApple(Body head, int[] arrowCommand) | ^~~~~~~~~~~~ Main.cpp:322:2: error: expected ‘;’ after class definition 322 | } | ^ | ; Main.cpp: In constructor ‘Program::Sequence::Sequence(char, int)’: Main.cpp:19:18: error: request for member ‘command_rot’ in ‘(Program::Sequence*)this’, which is of pointer type ‘Program::Sequence*’ (maybe you meant to use ‘->’ ?) 19 | this.command_rot = command; | ^~~~~~~~~~~ Main.cpp:20:18: error: request for member ‘sec’ in ‘(Program::Sequence*)this’, which is of pointer type ‘Program::Sequence*’ (maybe you meant to use ‘->’ ?) 20 | this.sec = sec; | ^~~ Main.cpp: In constructor ‘Program::Snake::Snake()’: Main.cpp:91:25: error: conversion from ‘Program::Body*’ to non-scalar type ‘Program::Body’ requested 91 | Body body = new Body(); | ^~~~~~~~~~ Main.cpp:96:13: error: ‘bodyList’ was not declared in this scope 96 | bodyList.Add(body); | ^~~~~~~~ Main.cpp: In member function ‘void Program::Snake::SetPosition(int*)’: Main.cpp:101:27: error: ‘bodyList’ was not declared in this scope 101 | int bodyNum = bodyList.Count; | ^~~~~~~~ Main.cpp:107:13: error: ‘map’ was not declared in this scope 107 | map[tail.y, tail.x] = 0; | ^~~ Main.cpp:107:23: warning: top-level comma expression in array subscript is deprecated [-Wcomma-subscript] 107 | map[tail.y, tail.x] = 0; | ^ Main.cpp:107:22: warning: left operand of comma operator has no effect [-Wunused-value] 107 | map[tail.y, tail.x] = 0; | ~~~~~^ Main.cpp:116:35: error: ‘arrowCommand’ was not declared in this scope 116 | bodyData.x += arrowCommand[1]; | ^~~~~~~~~~~~ Main.cpp:119:35: warning: top-level comma expression in array subscript is deprecated [-Wcomma-subscript] 119 | map[bodyData.y, bodyData.x] = 1; | ^ Main.cpp:119:34: warning: left operand of comma operator has no effect [-Wunused-value] 119 | map[bodyData.y, bodyData.x] = 1; | ~~~~~~~~~^ Main.cpp: In member function ‘void Program::Snake::AddBody(int*)’: Main.cpp:135:28: error: conversion from ‘Program::Body*’ to non-scalar type ‘Program::Body’ requested 135 | Body newBody = new Body(); | ^~~~~~~~~~ Main.cpp:139:34: error: ‘arrowCommand’ was not declared in this scope 139 | newBody.x = head.x + arrowCommand[1]; | ^~~~~~~~~~~~ Main.cpp:142:13: error: ‘map’ was not declared in this scope 142 | map[newBody.y, newBody.x] = 1; | ^~~ Main.cpp:142:26: warning: top-level comma expression in array subscript is deprecated [-Wcomma-subscript] 142 | map[newBody.y, newBody.x] = 1; | ^ Main.cpp:142:25: warning: left operand of comma operator has no effect [-Wunused-value] 142 | map[newBody.y, newBody.x] = 1; | ~~~~~~~~^ Main.cpp:144:13: error: ‘bodyList’ was not declared in this scope 144 | bodyList.Add(newBody); | ^~~~~~~~ Main.cpp: In member function ‘Program::Body Program::Snake::GetHead()’: Main.cpp:149:20: error: ‘bodyList’ was not declared in this scope 149 | return bodyList[bodyList.Count - 1]; | ^~~~~~~~ Main.cpp: In member function ‘Program::Body Program::Snake::GetTail()’: Main.cpp:154:20: error: ‘bodyList’ was not declared in this scope 154 | return bodyList[0]; | ^~~~~~~~ Main.cpp: In member function ‘bool Program::Snake::CheckEatApple(int, int)’: Main.cpp:159:16: error: ‘map’ was not declared in this scope 159 | if(map[y,x] == 2) | ^~~ Main.cpp:159:21: warning: top-level comma expression in array subscript is deprecated [-Wcomma-subscript] 159 | if(map[y,x] == 2) | ^ Main.cpp:159:20: warning: left operand of comma operator has no effect [-Wunused-value] 159 | if(map[y,x] == 2) | ^ Main.cpp: In static member function ‘static void Program::Main()’: Main.cpp:181:15: error: expected nested-name-specifier before ‘StreamWriter’ 181 | using StreamWriter writer = new StreamWriter(new BufferedStream(Console.OpenStandardOutput())); | ^~~~~~~~~~~~ Main.cpp:183:15: error: expected nested-name-specifier before ‘StreamReader’ 183 | using StreamReader reader = new StreamReader(new BufferedStream(Console.OpenStandardInput())); | ^~~~~~~~~~~~ Main.cpp:185:14: error: expected primary-expression before ‘int’ 185 | N = int.Parse(reader.ReadLine()); | ^~~ Main.cpp:186:14: error: expected primary-expression before ‘int’ 186 | K = int.Parse(reader.ReadLine()); | ^~~ Main.cpp:188:9: error: ‘map’ was not declared in this scope 188 | map = new int[N + 1, N + 1]; | ^~~ Main.cpp:188:25: warning: left operand of comma operator has no effect [-Wunused-value] 188 | map = new int[N + 1, N + 1]; | ~~^~~ Main.cpp:193:13: error: ‘string’ was not declared in this scope 193 | string[] command_X_Y = reader.ReadLine().Split(); | ^~~~~~ Main.cpp:193:20: error: expected primary-expression before ‘]’ token 193 | string[] command_X_Y = reader.ReadLine().Split(); | ^ Main.cpp:195:21: error: expected primary-expression before ‘int’ 195 | int x = int.Parse(command_X_Y[0]); //행 | ^~~ Main.cpp:196:21: error: expected primary-expression before ‘int’ 196 | int y = int.Parse(command_X_Y[1]); //열 | ^~~ Main.cpp:198:18: warning: top-level comma expression in array subscript is deprecated [-Wcomma-subscript] 198 | map[y, x] = 2; | ^ Main.cpp:198:17: warning: left operand of comma operator has no effect [-Wunused-value] 198 | map[y, x] = 2; | ^ Main.cpp:201:17: error: expected primary-expression before ‘int’ 201 | int L = int.Parse(reader.ReadLine()); | ^~~ Main.cpp:205:13: error: ‘string’ was not declared in this scope 205 | string[] command_X_C = reader.ReadLine().Split(); | ^~~~~~ Main.cpp:205:20: error: expected primary-expression before ‘]’ token 205 | string[] command_X_C = reader.ReadLine().Split(); | ^ Main.cpp:207:23: error: expected primary-expression before ‘int’ 207 | int sec = int.Parse(command_X_C[0]); | ^~~ Main.cpp:208:28: error: expected primary-expression before ‘char’ 208 | char command = char.Parse(command_X_C[1]); | ^~~~ Main.cpp:210:33: error: conversion from ‘Program::Sequence*’ to non-scalar type ‘Program::Sequence’ requested 210 | Sequence sequence = new Sequence(command, sec); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Main.cpp:211:13: error: ‘sequenceList’ was not declared in this scope; did you mean ‘sequence’? 211 | sequenceList.Add(sequence); | ^~~~~~~~~~~~ | sequence Main.cpp:214:51: error: expected primary-expression before ‘int’ 214 | Sequence sequence_end = new Sequence('e', int.MaxValue); | ^~~ Main.cpp:215:9: error: ‘sequenceList’ was not declared in this scope; did you mean ‘sequence_end’? 215 | sequenceList.Add(sequence_end); | ^~~~~~~~~~~~ | sequence_end Main.cpp:219:9: error: ‘writer’ was not declared in this scope 219 | writer.WriteLine(sec_count.ToString()); | ^~~~~~ Main.cpp:219:36: error: request for member ‘ToString’ in ‘Program::sec_count’, which is of non-class type ‘int’ 219 | writer.WriteLine(sec_count.ToString()); | ^~~~~~~~ Main.cpp: In static member function ‘static void Program::GameStart()’: Main.cpp:229:23: error: conversion from ‘Program::Snake*’ to non-scalar type ‘Program::Snake’ requested 229 | Snake snake = new Snake(); | ^~~~~~~~~~~ Main.cpp:233:22: error: ‘null’ was not declared in this scope 233 | Sequence s = null; | ^~~~ Main.cpp:239:17: error: ‘sequenceList’ was not declared in this scope; did you mean ‘Sequence’? 239 | s = sequenceList[seq_count]; | ^~~~~~~~~~~~ | Sequence Main.cpp:245:16: error: structured binding declaration cannot have type ‘int’ 245 | int[] arrowCommand = arrow.GetArrowCommand(); | ^~ Main.cpp:245:16: note: type must be cv-qualified ‘auto’ or reference to cv-qualified ‘auto’ Main.cpp:245:16: error: empty structured binding declaration Main.cpp:245:19: error: expected initializer before ‘arrowCommand’ 245 | int[] arrowCommand = arrow.GetArrowCommand(); | ^~~~~~~~~~~~ Main.cpp:254:41: error: ‘arrowCommand’ was not declared in this scope 254 | if (CheckEatApple(head, arrowCommand) == false) | ^~~~~~~~~~~~ Main.cpp:264:17: error: ‘Console’ was not declared in this scope 264 | Console.WriteLine(head.y + " " + head.x + " sec : " + sec_count); | ^~~~~~~ Main.cpp:264:57: error: invalid operands of types ‘const char*’ and ‘const char [8]’ to binary ‘operator+’ 264 | Console.WriteLine(head.y + " " + head.x + " sec : " + sec_count); | ~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~ | | | | | const char [8] | const char* Main.cpp:277:13: error: ‘Console’ was not declared in this scope 277 | Console.WriteLine("Rot :" + command_rot); | ^~~~~~~ Main.cpp:245:16: warning: unused structured binding declaration [-Wunused-variable] 245 | int[] arrowCommand = arrow.GetArrowCommand(); | ^~ Main.cpp: In static member function ‘static bool Program::CheckEatApple(Program::Body, int*)’: Main.cpp:287:30: error: ‘arrowCommand’ was not declared in this scope 287 | int headY = head.x + arrowCommand[1]; | ^~~~~~~~~~~~ Main.cpp:290:12: error: ‘map’ was not declared in this scope 290 | if(map[headY,headX] == 2) | ^~~ Main.cpp:290:21: warning: top-level comma expression in array subscript is deprecated [-Wcomma-subscript] 290 | if(map[headY,headX] == 2) | ^ Main.cpp:290:16: warning: left operand of comma operator has no effect [-Wunused-value] 290 | if(map[headY,headX] == 2) | ^~~~~ Main.cpp:292:13: error: ‘Console’ was not declared in this scope 292 | Console.WriteLine("Apple!"); | ^~~~~~~ Main.cpp: In static member function ‘static bool Program::CheckGameOver(Program::Body)’: Main.cpp:309:13: error: ‘Console’ was not declared in this scope 309 | Console.WriteLine("Wall!!"); | ^~~~~~~ Main.cpp:314:13: error: ‘map’ was not declared in this scope 314 | if (map[headY, headX] == 1) | ^~~ Main.cpp:314:22: warning: top-level comma expression in array subscript is deprecated [-Wcomma-subscript] 314 | if (map[headY, headX] == 1) | ^ Main.cpp:314:17: warning: left operand of comma operator has no effect [-Wunused-value] 314 | if (map[headY, headX] == 1) | ^~~~~ Main.cpp:316:13: error: ‘Console’ was not declared in this scope 316 | Console.WriteLine("Body!!"); | ^~~~~~~
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.