foo.cc:7:9: error: too many decimal points in number
7 | a:array[0..300001] of node;
| ^~~~~~~~~
foo.cc:8:9: error: too many decimal points in number
8 | b:array[1..100000] of string;
| ^~~~~~~~~
foo.cc:9:30: error: too many decimal points in number
9 | c,num,order,leng,ll,rr:array[0..100001] of longint;
| ^~~~~~~~~
foo.cc:1:1: error: 'type' does not name a type; did you mean 'typedef'?
1 | type
| ^~~~
| typedef
foo.cc:4:1: error: 'end' does not name a type
4 | end;
| ^~~
foo.cc:6:1: error: 'var' does not name a type
6 | var
| ^~~
foo.cc:8:2: error: found ':' in nested-name-specifier, expected '::'
8 | b:array[1..100000] of string;
| ^
| ::
foo.cc:8:1: error: 'b' does not name a type
8 | b:array[1..100000] of string;
| ^
foo.cc:9:1: error: 'c' does not name a type
9 | c,num,order,leng,ll,rr:array[0..100001] of longint;
| ^
foo.cc:10:1: error: 'n' does not name a type
10 | n,i,s,j:longint;
| ^
foo.cc:11:3: error: found ':' in nested-name-specifier, expected '::'
11 | st:string;
| ^
| ::
foo.cc:11:1: error: 'st' does not name a type
11 | st:string;
| ^~
foo.cc:12:5: error: found ':' in nested-name-specifier, expected '::'
12 | code:integer;
| ^
| ::
foo.cc:12:1: error: 'code' does not name a type
12 | code:integer;
| ^~~~
foo.cc:14:1: error: 'procedure' does not name a type
14 | procedure sort(l,r:longint);
| ^~~~~~~~~
foo.cc:15:1: error: 'var' does not name a type
15 | var
| ^~~
foo.cc:17:1: error: 'x' does not name a type
17 | x,yy:string;
| ^
foo.cc:18:1: error: 'begin' does not name a type
18 | begin
| ^~~~~
foo.cc:19:7: error: 'j' does not name a type
19 | i:=l; j:=r; x:=b[(l+r) div 2];
| ^
foo.cc:19:13: error: 'x' does not name a type
19 | i:=l; j:=r; x:=b[(l+r) div 2];
| ^
foo.cc:20:1: error: 'repeat' does not name a type
20 | repeat
| ^~~~~~
foo.cc:22:1: error: expected unqualified-id before 'while'
22 | while x<b[j] do dec(j);
| ^~~~~
foo.cc:23:1: error: expected unqualified-id before 'if'
23 | if not(i>j) then
| ^~
foo.cc:25:12: error: 'num' does not name a type; did you mean 'enum'?
25 | y:=num[i]; num[i]:=num[j]; num[j]:=y;
| ^~~
| enum
foo.cc:25:28: error: 'num' does not name a type; did you mean 'enum'?
25 | y:=num[i]; num[i]:=num[j]; num[j]:=y;
| ^~~
| enum
foo.cc:26:1: error: 'y' does not name a type
26 | y:=order[i]; order[i]:=order[j]; order[j]:=y;
| ^
foo.cc:26:14: error: 'order' does not name a type
26 | y:=order[i]; order[i]:=order[j]; order[j]:=y;
| ^~~~~
foo.cc:26:34: error: 'order' does not name a type
26 | y:=order[i]; order[i]:=order[j]; order[j]:=y;
| ^~~~~
foo.cc:27:1: error: 'y' does not name a type
27 | y:=leng[i]; leng[i]:=leng[j]; leng[j]:=y;
| ^
foo.cc:27:13: error: 'leng' does not name a type; did you mean 'long'?
27 | y:=leng[i]; leng[i]:=leng[j]; leng[j]:=y;
| ^~~~
| long
foo.cc:27:31: error: 'leng' does not name a type; did you mean 'long'?
27 | y:=leng[i]; leng[i]:=leng[j]; leng[j]:=y;
| ^~~~
| long
foo.cc:28:1: error: 'yy' does not name a type
28 | yy:=b[i]; b[i]:=b[j]; b[j]:=yy;
| ^~
foo.cc:28:11: error: 'b' does not name a type
28 | yy:=b[i]; b[i]:=b[j]; b[j]:=yy;
| ^
foo.cc:28:23: error: 'b' does not name a type
28 | yy:=b[i]; b[i]:=b[j]; b[j]:=yy;
| ^
foo.cc:29:4: error: expected constructor, destructor, or type conversion before '(' token
29 | inc(i); dec(j);
| ^
foo.cc:29:12: error: expected constructor, destructor, or type conversion before '(' token
29 | inc(i); dec(j);
| ^
foo.cc:30:1: error: 'end' does not name a type
30 | end;
| ^~~
foo.cc:31:1: error: 'until' does not name a type
31 | until i>j;
| ^~~~~
foo.cc:32:1: error: expected unqualified-id before 'if'
32 | if l<j then
| ^~
foo.cc:34:1: error: expected unqualified-id before 'if'
34 | if i<r then
| ^~
foo.cc:36:1: error: 'end' does not name a type
36 | end;
| ^~~
foo.cc:38:1: error: 'procedure' does not name a type
38 | procedure sort1(l,r:longint);
| ^~~~~~~~~
foo.cc:39:1: error: 'var' does not name a type
39 | var
| ^~~
foo.cc:41:1: error: 'begin' does not name a type
41 | begin
| ^~~~~
foo.cc:42:7: error: 'j' does not name a type
42 | i:=l; j:=r; x:=num[(l+r) div 2];
| ^
foo.cc:42:13: error: 'x' does not name a type
42 | i:=l; j:=r; x:=num[(l+r) div 2];
| ^
foo.cc:43:1: error: 'repeat' does not name a type
43 | repeat
| ^~~~~~
foo.cc:45:1: error: expected unqualified-id before 'while'
45 | while x<num[j] do dec(j);
| ^~~~~
foo.cc:46:1: error: expected unqualified-id before 'if'
46 | if not(i>j) then
| ^~
foo.cc:48:12: error: 'num' does not name a type; did you mean 'enum'?
48 | y:=num[i]; num[i]:=num[j]; num[j]:=y;
| ^~~
| enum
foo.cc:48:28: error: 'num' does not name a type; did you mean 'enum'?
48 | y:=num[i]; num[i]:=num[j]; num[j]:=y;
| ^~~
| enum
foo.cc:49:1: error: 'y' does not name a type
49 | y:=order[i]; order[i]:=order[j]; order[j]:=y;
| ^
foo.cc:49:14: error: 'order' does not name a type
49 | y:=order[i]; order[i]:=order[j]; order[j]:=y;
| ^~~~~
foo.cc:49:34: error: 'order' does not name a type
49 | y:=order[i]; order[i]:=order[j]; order[j]:=y;
| ^~~~~
foo.cc:50:1: error: 'y' does not name a type
50 | y:=leng[i]; leng[i]:=leng[j]; leng[j]:=y;
| ^
foo.cc:50:13: error: 'leng' does not name a type; did you mean 'long'?
50 | y:=leng[i]; leng[i]:=leng[j]; leng[j]:=y;
| ^~~~
| long
foo.cc:50:31: error: 'leng' does not name a type; did you mean 'long'?
50 | y:=leng[i]; leng[i]:=leng[j]; leng[j]:=y;
| ^~~~
| long
foo.cc:51:1: error: 'y' does not name a type
51 | y:=c[i]; c[i]:=c[j]; c[j]:=y;
| ^
foo.cc:51:10: error: 'c' does not name a type
51 | y:=c[i]; c[i]:=c[j]; c[j]:=y;
| ^
foo.cc:51:22: error: 'c' does not name a type
51 | y:=c[i]; c[i]:=c[j]; c[j]:=y;
| ^
foo.cc:52:4: error: expected constructor, destructor, or type conversion before '(' token
52 | inc(i); dec(j);
| ^
foo.cc:52:12: error: expected constructor, destructor, or type conversion before '(' token
52 | inc(i); dec(j);
| ^
foo.cc:53:1: error: 'end' does not name a type
53 | end;
| ^~~
foo.cc:54:1: error: 'until' does not name a type
54 | until i>j;
| ^~~~~
foo.cc:55:1: error: expected unqualified-id before 'if'
55 | if l<j then
| ^~
foo.cc:57:1: error: expected unqualified-id before 'if'
57 | if i<r then
| ^~
foo.cc:59:1: error: 'end' does not name a type
59 | end;
| ^~~
foo.cc:61:1: error: 'procedure' does not name a type
61 | procedure build(k,left,right:longint);
| ^~~~~~~~~
foo.cc:62:1: error: 'begin' does not name a type
62 | begin
| ^~~~~
foo.cc:63:15: error: 'a' does not name a type
63 | a[k].l:=left; a[k].r:=right; a[k].m:=(left+right) div 2;
| ^
foo.cc:63:30: error: 'a' does not name a type
63 | a[k].l:=left; a[k].r:=right; a[k].m:=(left+right) div 2;
| ^
foo.cc:64:1: error: 'a' does not name a type
64 | a[k].llen:=right-left+1; a[k].rlen:=a[k].llen; a[k].maxlen:=a[k].rlen;
| ^
foo.cc:64:26: error: 'a' does not name a type
64 | a[k].llen:=right-left+1; a[k].rlen:=a[k].llen; a[k].maxlen:=a[k].rlen;
| ^
foo.cc:64:48: error: 'a' does not name a type
64 | a[k].llen:=right-left+1; a[k].rlen:=a[k].llen; a[k].maxlen:=a[k].rlen;
| ^
foo.cc:65:1: error: expected unqualified-id before 'if'
65 | if left=right then exit;
| ^~
foo.cc:66:6: error: expected constructor, destructor, or type conversion before '(' token
66 | build(k shl 1,left,a[k].m); build(k shl 1+1,a[k].m+1,right);
| ^
foo.cc:66:34: error: expected constructor, destructor, or type conversion before '(' token
66 | build(k shl 1,left,a[k].m); build(k shl 1+1,a[k].m+1,right);
| ^
foo.cc:67:1: error: 'end' does not name a type
67 | end;
| ^~~
foo.cc:69:1: error: 'function' does not name a type; did you mean 'union'?
69 | function max(t1,t2:longint):longint;
| ^~~~~~~~
| union
foo.cc:70:1: error: 'begin' does not name a type
70 | begin
| ^~~~~
foo.cc:72:1: error: 'end' does not name a type
72 | end;
| ^~~
foo.cc:74:1: error: 'function' does not name a type; did you mean 'union'?
74 | function find(k,len:longint):longint;
| ^~~~~~~~
| union
foo.cc:75:1: error: 'begin' does not name a type
75 | begin
| ^~~~~
foo.cc:77:1: error: expected unqualified-id before 'if'
77 | if a[k shl 1].maxlen>=len then exit(find(k shl 1,len));
| ^~
foo.cc:78:1: error: expected unqualified-id before 'if'
78 | if a[k shl 1].rlen+a[k shl 1+1].llen>=len then exit(a[k shl 1].r-a[k shl 1].rlen+1);
| ^~
foo.cc:79:1: error: expected unqualified-id before 'if'
79 | if a[k shl 1+1].maxlen>=len then exit(find(k shl 1+1,len));
| ^~
foo.cc:80:1: error: 'end' does not name a type
80 | end;
| ^~~
foo.cc:82:1: error: 'procedure' does not name a type
82 | procedure change(k,left,right:longint);
| ^~~~~~~~~
foo.cc:83:1: error: 'begin' does not name a type
83 | begin
| ^~~~~
foo.cc:85:26: error: 'a' does not name a type
85 | then begin a[k].llen:=0; a[k].rlen:=0; a[k].maxlen:=0; exit; end;
| ^
foo.cc:85:40: error: 'a' does not name a type
85 | then begin a[k].llen:=0; a[k].rlen:=0; a[k].maxlen:=0; exit; end;
| ^
foo.cc:85:56: error: 'exit' does not name a type
85 | then begin a[k].llen:=0; a[k].rlen:=0; a[k].maxlen:=0; exit; end;
| ^~~~
foo.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; did you forget to '#include <cstdlib>'?
+++ |+#include <cstdlib>
1 | type
foo.cc:85:62: error: 'end' does not name a type
85 | then begin a[k].llen:=0; a[k].rlen:=0; a[k].maxlen:=0; exit; end;
| ^~~
foo.cc:86:1: error: expected unqualified-id before 'if'
86 | if left>a[k].m then change(k shl 1+1,left,right) else
| ^~
foo.cc:88:42: error: expected constructor, destructor, or type conversion before '(' token
88 | begin change(k shl 1,left,a[k].m); change(k shl 1+1,a[k].m+1,right); end;
| ^
foo.cc:88:70: error: 'end' does not name a type
88 | begin change(k shl 1,left,a[k].m); change(k shl 1+1,a[k].m+1,right); end;
| ^~~
foo.cc:89:1: error: expected unqualified-id before 'if'
89 | if a[k shl 1].llen=a[k].m-a[k].l+1
| ^~
foo.cc:92:1: error: expected unqualified-id before 'if'
92 | if a[k shl 1+1].rlen=a[k].r-a[k].m
| ^~
foo.cc:95:1: error: 'a' does not name a type
95 | a[k].maxlen:=max(max(a[k shl 1].maxlen,a[k shl 1+1].maxlen),a[k shl 1].rlen+a[k shl 1+1].llen);
| ^
foo.cc:96:1: error: 'end' does not name a type
96 | end;
| ^~~
foo.cc:98:1: error: 'procedure' does not name a type
98 | procedure change1(k,left,right:longint);
| ^~~~~~~~~
foo.cc:99:1: error: 'begin' does not name a type
99 | begin
| ^~~~~
foo.cc:101:37: error: 'a' does not name a type
101 | then begin a[k].llen:=right-left+1; a[k].rlen:=a[k].llen; a[k].maxlen:=a[k].llen; exit; end;
| ^
foo.cc:101:59: error: 'a' does not name a type
101 | then begin a[k].llen:=right-left+1; a[k].rlen:=a[k].llen; a[k].maxlen:=a[k].llen; exit; end;
| ^
foo.cc:101:83: error: 'exit' does not name a type
101 | then begin a[k].llen:=right-left+1; a[k].rlen:=a[k].llen; a[k].maxlen:=a[k].llen; exit; end;
| ^~~~
foo.cc:101:83: note: 'exit' is defined in header '<cstdlib>'; did you forget to '#include <cstdlib>'?
foo.cc:101:89: error: 'end' does not name a type
101 | then begin a[k].llen:=right-left+1; a[k].rlen:=a[k].llen; a[k].maxlen:=a[k].llen; exit; end;
| ^~~
foo.cc:102:1: error: expected unqualified-id before 'if'
102 | if left>a[k].m then change1(k shl 1+1,left,right) else
| ^~
foo.cc:104:44: error: expected constructor, destructor, or type conversion before '(' token
104 | begin change1(k shl 1,left,a[k].m); change1(k shl 1+1,a[k].m+1,right); end;
| ^
foo.cc:104:72: error: 'end' does not name a type
104 | begin change1(k shl 1,left,a[k].m); change1(k shl 1+1,a[k].m+1,right); end;
| ^~~
foo.cc:105:1: error: expected unqualified-id before 'if'
105 | if a[k shl 1].llen=a[k].m-a[k].l+1
| ^~
foo.cc:108:1: error: expected unqualified-id before 'if'
108 | if a[k shl 1+1].rlen=a[k].r-a[k].m
| ^~
foo.cc:111:1: error: 'a' does not name a type
111 | a[k].maxlen:=max(max(a[k shl 1].maxlen,a[k shl 1+1].maxlen),a[k shl 1].rlen+a[k shl 1+1].llen);
| ^
foo.cc:112:1: error: 'end' does not name a type
112 | end;
| ^~~
foo.cc:114:1: error: 'begin' does not name a type
114 | begin
| ^~~~~
foo.cc:116:1: error: expected unqualified-id before 'for'
116 | for i:=1 to n do
| ^~~
foo.cc:119:1: error: expected unqualified-id before 'delete'
119 | delete(st,length(st)-1,2);
| ^~~~~~
foo.cc:120:1: error: expected unqualified-id before 'if'
120 | if st[length(st)] in ['0'..'9']
| ^~
foo.cc:123:14: error: 'j' does not name a type
123 | order[i]:=1; j:=length(st);
| ^
foo.cc:124:1: error: expected unqualified-id before 'while'
124 | while st[j-1]<>'(' do dec(j);
| ^~~~~
foo.cc:125:4: error: expected constructor, destructor, or type conversion before '(' token
125 | val(copy(st,j,length(st)-j+1),leng[i],code);
| ^
foo.cc:126:1: error: 'b' does not name a type
126 | b[i]:=copy(st,1,j-9);
| ^
foo.cc:127:1: error: 'end' does not name a type
127 | end
| ^~~
foo.cc:132:14: error: 'b' does not name a type
132 | order[i]:=3; b[i]:=copy(st,7,length(st)-6);
| ^
foo.cc:133:1: error: 'end' does not name a type
133 | end
| ^~~
foo.cc:136:14: error: 'b' does not name a type
136 | order[i]:=2; b[i]:=copy(st,6,length(st)-5);
| ^
foo.cc:137:1: error: 'end' does not name a type
137 | end;
| ^~~
foo.cc:138:1: error: 'num' does not name a type; did you mean 'enum'?
138 | num[i]:=i;
| ^~~
| enum
foo.cc:139:1: error: 'end' does not name a type
139 | end;
| ^~~
foo.cc:141:5: error: expected constructor, destructor, or type conversion before '(' token
141 | sort(1,n);
| ^
foo.cc:142:1: error: 's' does not name a type
142 | s:=1; c[1]:=1;
| ^
foo.cc:142:7: error: 'c' does not name a type
142 | s:=1; c[1]:=1;
| ^
foo.cc:143:1: error: expected unqualified-id before 'for'
143 | for i:=2 to n do
| ^~~
foo.cc:146:20: error: 'c' does not name a type
146 | else begin inc(s); c[i]:=s; end;
| ^
foo.cc:146:29: error: 'end' does not name a type
146 | else begin inc(s); c[i]:=s; end;
| ^~~
foo.cc:147:6: error: expected constructor, destructor, or type conversion before '(' token
147 | sort1(1,n);
| ^
foo.cc:149:6: error: expected constructor, destructor, or type conversion before '(' token
149 | build(1,1,100000);
| ^
foo.cc:150:1: error: expected unqualified-id before 'for'
150 | for i:=1 to s do ll[i]:=0;
| ^~~
foo.cc:151:1: error: expected unqualified-id before 'for'
151 | for i:=1 to n do
| ^~~
foo.cc:154:48: error: expected unqualified-id before 'continue'
154 | if a[1].maxlen<leng[i] then begin ll[c[i]]:=0; continue; end;
| ^~~~~~~~
foo.cc:154:58: error: 'end' does not name a type
154 | if a[1].maxlen<leng[i] then begin ll[c[i]]:=0; continue; end;
| ^~~
foo.cc:155:1: error: 'll' does not name a type
155 | ll[c[i]]:=find(1,leng[i]); rr[c[i]]:=ll[c[i]]+leng[i]-1;
| ^~
foo.cc:155:28: error: 'rr' does not name a type
155 | ll[c[i]]:=find(1,leng[i]); rr[c[i]]:=ll[c[i]]+leng[i]-1;
| ^~
foo.cc:156:7: error: expected constructor, destructor, or type conversion before '(' token
156 | change(1,ll[c[i]],rr[c[i]]);
| ^
foo.cc:157:1: error: 'end' does not name a type
157 | end;
| ^~~
foo.cc:158:1: error: expected unqualified-id before numeric constant
158 | 2:if ll[c[i]]>0
| ^
foo.cc:161:31: error: 'll' does not name a type
161 | change1(1,ll[c[i]],rr[c[i]]); ll[c[i]]:=0;
| ^~
foo.cc:162:1: error: 'end' does not name a type
162 | end;
| ^~~
foo.cc:163:1: error: expected unqualified-id before numeric constant
163 | 3:writeln(ll[c[i]]);
| ^
foo.cc:164:1: error: 'end' does not name a type
164 | end;
| ^~~
foo.cc:165:1: error: 'end' does not name a type
165 | end.
| ^~~
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务