Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
53
Task/ABC-problem/Draco/abc-problem.draco
Normal file
53
Task/ABC-problem/Draco/abc-problem.draco
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
\util.g
|
||||
|
||||
proc nonrec ucase(char c) char:
|
||||
byte b;
|
||||
b := pretend(c, byte);
|
||||
b := b & ~32;
|
||||
pretend(b, char)
|
||||
corp
|
||||
|
||||
proc nonrec can_make_word(*char w) bool:
|
||||
[41] char blocks;
|
||||
word i;
|
||||
char ch;
|
||||
bool found, ok;
|
||||
|
||||
CharsCopy(&blocks[0], "BOXKDQCPNAGTRETGQDFSJWHUVIANOBERFSLYPCZM");
|
||||
|
||||
ok := true;
|
||||
while
|
||||
ch := ucase(w*);
|
||||
w := w + 1;
|
||||
ok and ch ~= '\e'
|
||||
do
|
||||
found := false;
|
||||
i := 0;
|
||||
while not found and i < 40 do
|
||||
if blocks[i] = ch then found := true fi;
|
||||
i := i + 1;
|
||||
od;
|
||||
if found then
|
||||
i := i - 1;
|
||||
blocks[i] := '\e';
|
||||
blocks[i >< 1] := '\e'
|
||||
else
|
||||
ok := false
|
||||
fi
|
||||
od;
|
||||
ok
|
||||
corp
|
||||
|
||||
proc nonrec test(*char w) void:
|
||||
writeln(w, ": ", if can_make_word(w) then "yes" else "no" fi)
|
||||
corp
|
||||
|
||||
proc nonrec main() void:
|
||||
test("A");
|
||||
test("BARK");
|
||||
test("book");
|
||||
test("treat");
|
||||
test("CoMmOn");
|
||||
test("sQuAd");
|
||||
test("CONFUSE")
|
||||
corp
|
||||
Loading…
Add table
Add a link
Reference in a new issue