Submission #74959008
Source Code Expand
import * as fs from "fs";
const input: string[] = fs.readFileSync(process.stdin.fd, "utf8").split(/\s+/);
/**
* Triple Four
*/
function solve(){
let ans = false
const [N, ...S] = input
for (let i = 0; i < Number(N); i++) {
if (i === Number(N)) {
break
}
if (Number(S[i]) === Number(S[i+1]) && Number(S[i+1]) === Number(S[i + 2])) {
ans = true
break
}
}
return ans
}
const res = solve()
console.log(res ? 'Yes' : 'No')
Submission Info
| Submission Time | |
|---|---|
| Task | B - Triple Four |
| User | koichihayakawa |
| Language | TypeScript 5.9 (tsc 5.9.2 (Node.js 22.19.0)) |
| Score | 100 |
| Code Size | 535 Byte |
| Status | AC |
| Exec Time | 35 ms |
| Memory | 43024 KiB |
Compile Error
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 35 ms | 43004 KiB |
| 00_sample_01.txt | AC | 26 ms | 43024 KiB |
| 00_sample_02.txt | AC | 25 ms | 43004 KiB |
| 00_sample_03.txt | AC | 25 ms | 42812 KiB |
| 00_sample_04.txt | AC | 25 ms | 42844 KiB |
| 01_handmade_00.txt | AC | 25 ms | 42860 KiB |
| 01_handmade_01.txt | AC | 25 ms | 42824 KiB |
| 01_handmade_02.txt | AC | 25 ms | 42824 KiB |
| 01_handmade_03.txt | AC | 25 ms | 42908 KiB |
| 01_handmade_04.txt | AC | 24 ms | 42888 KiB |
| 02_random_00.txt | AC | 26 ms | 42908 KiB |
| 02_random_01.txt | AC | 25 ms | 42920 KiB |
| 02_random_02.txt | AC | 25 ms | 42920 KiB |
| 02_random_03.txt | AC | 25 ms | 42920 KiB |
| 02_random_04.txt | AC | 25 ms | 42860 KiB |
| 02_random_05.txt | AC | 25 ms | 43004 KiB |
| 02_random_06.txt | AC | 25 ms | 42912 KiB |
| 02_random_07.txt | AC | 25 ms | 42860 KiB |
| 02_random_08.txt | AC | 24 ms | 42868 KiB |
| 02_random_09.txt | AC | 25 ms | 42824 KiB |