repo.or.cz
/
srcbox.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
xiaozqh
[srcbox.git]
/
rqnoj
/
rqnoj68.pas
blob
11421debf0761f568ec62e0401cc883d9395e7e5
1
var
2
n
:
string
;
3
k
,
i
,
j
:
longint
;
4
a
:
array
[
0
.
.33
]
of
longint
;
5
ans
:
qword
;
6
7
begin
8
readln
(
n
);
9
p
:=
pos
(
' '
,
n
);
10
val
(
copy
(
n
,
p
+
1
,
length
(
n
)),
k
);
11
delete
(
n
,
p
,
length
(
n
));
12
for
i
:=
1
to
k
do
13
begin
14
readln
(
x
,
y
);
15
for
j
:=
1
to
length
(
n
)
do
16
if
ord
(
n
[
j
])-
ord
(
'0'
)=
x
then
inc
(
a
[
j
]);
17
end
;
18
for
i
:=
1
to
length
(
n
)
do
19
ans
:=
ans
*(
a
[
i
]+
1
);
20
writeln
(
ans
);
21
end
.