| Task: | Lehmät |
| Sender: | discape |
| Submission time: | 2022-11-06 20:58:11 +0200 |
| Language: | Node.js |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| #2 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.11 s | 1, 2 | details |
| #2 | WRONG ANSWER | 0.11 s | 1, 2 | details |
| #3 | WRONG ANSWER | 0.11 s | 1, 2 | details |
| #4 | WRONG ANSWER | 0.11 s | 1, 2 | details |
| #5 | WRONG ANSWER | 0.11 s | 1, 2 | details |
| #6 | WRONG ANSWER | 0.11 s | 2 | details |
| #7 | WRONG ANSWER | 0.11 s | 2 | details |
| #8 | WRONG ANSWER | 0.11 s | 2 | details |
| #9 | WRONG ANSWER | 0.11 s | 2 | details |
Code
const { exit } = require("process");
const readline = require("readline");
const r = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false,
});
function read() {
return new Promise((res) => {
r.on("line", (line) => {
res(line);
});
});
}
(async () => {
let [h, w] = (await read()).split(" ");
let x1,
y1,
n = 0,
x2;
yloop: for (let y = 0; y < h; y++) {
line = await read();
for (let x = 0; x < w; x++) {
const c = line[x];
if (x1 === undefined) {
if (c === "*") {
x1 = x;
y1 = y;
x2 = line.lastIndexOf("*");
continue yloop;
}
} else {
if (c === "*" && x === x1 + 1) {
console.log(n);
exit();
} else if (c === "@" && x > x1 && x < x2) {
n++;
}
}
}
}
})();
Test details
Test 1
Group: 1, 2
Verdict: WRONG ANSWER
| input |
|---|
| 3 3 *** *.* *** |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Test 2
Group: 1, 2
Verdict: WRONG ANSWER
| input |
|---|
| 3 3 *** *@* *** |
| correct output |
|---|
| 1 |
| user output |
|---|
| (empty) |
Test 3
Group: 1, 2
Verdict: WRONG ANSWER
| input |
|---|
| 5 10 ...@...... ..******.. @.*@@@@*.@ ..******.. ... |
| correct output |
|---|
| 4 |
| user output |
|---|
| (empty) |
Test 4
Group: 1, 2
Verdict: WRONG ANSWER
| input |
|---|
| 10 10 @@...@.@@@ ..@@.@@..@ @.*******@ ..*@....*. ... |
| correct output |
|---|
| 11 |
| user output |
|---|
| (empty) |
Test 5
Group: 1, 2
Verdict: WRONG ANSWER
| input |
|---|
| 10 10 ********** *@@@@@@@@* *@@@@@@@@* *@@@@@@@@* ... |
| correct output |
|---|
| 64 |
| user output |
|---|
| (empty) |
Test 6
Group: 2
Verdict: WRONG ANSWER
| input |
|---|
| 100 100 .........................@....... |
| correct output |
|---|
| 60 |
| user output |
|---|
| (empty) |
Test 7
Group: 2
Verdict: WRONG ANSWER
| input |
|---|
| 100 100 ..@@..........@......@....@@..... |
| correct output |
|---|
| 1507 |
| user output |
|---|
| (empty) |
Test 8
Group: 2
Verdict: WRONG ANSWER
| input |
|---|
| 100 100 .@..@@..@@.@..@..@..@@..@..@..... |
| correct output |
|---|
| 3348 |
| user output |
|---|
| (empty) |
Test 9
Group: 2
Verdict: WRONG ANSWER
| input |
|---|
| 100 100 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@... |
| correct output |
|---|
| 7225 |
| user output |
|---|
| (empty) |
