Submission #235939

#TimeUsernameProblemLanguageResultExecution timeMemory
235939laricasotaCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
unit combo; interface function guess_sequence(N: longint): ansistring; implementation uses combo_lib; function guess_sequence(N: longint): ansistring; var p, S: ansistring; coins, i: longint; begin p := ''; for i := 1 to 4 * N do begin p += 'A'; end; coins := press(p); S := ''; for i := 1 to N do begin S += 'A'; end; exit(S); end; end.

Compilation message (stderr)

combo.cpp:16:8: error: empty character constant
   16 |   p := '';
      |        ^~
combo.cpp:21:8: error: empty character constant
   21 |   S := '';
      |        ^~
combo.cpp:1:1: error: 'unit' does not name a type
    1 | unit combo;
      | ^~~~
combo.cpp:3:1: error: 'interface' does not name a type
    3 | interface
      | ^~~~~~~~~
combo.cpp:7:1: error: 'implementation' does not name a type
    7 | implementation
      | ^~~~~~~~~~~~~~
combo.cpp:11:1: error: 'function' does not name a type; did you mean 'union'?
   11 | function guess_sequence(N: longint): ansistring;
      | ^~~~~~~~
      | union
combo.cpp:12:1: error: 'var' does not name a type
   12 | var
      | ^~~
combo.cpp:14:3: error: 'coins' does not name a type
   14 |   coins, i: longint;
      |   ^~~~~
combo.cpp:15:1: error: 'begin' does not name a type
   15 | begin
      | ^~~~~
combo.cpp:17:3: error: expected unqualified-id before 'for'
   17 |   for i := 1 to 4 * N do begin
      |   ^~~
combo.cpp:19:3: error: 'end' does not name a type
   19 |   end;
      |   ^~~
combo.cpp:20:3: error: 'coins' does not name a type
   20 |   coins := press(p);
      |   ^~~~~
combo.cpp:21:3: error: 'S' does not name a type
   21 |   S := '';
      |   ^
combo.cpp:22:3: error: expected unqualified-id before 'for'
   22 |   for i := 1 to N do begin
      |   ^~~
combo.cpp:24:3: error: 'end' does not name a type
   24 |   end;
      |   ^~~
combo.cpp:25:7: error: expected constructor, destructor, or type conversion before '(' token
   25 |   exit(S);
      |       ^
combo.cpp:26:1: error: 'end' does not name a type
   26 | end;
      | ^~~
combo.cpp:28:1: error: 'end' does not name a type
   28 | end.
      | ^~~