Submission #66086413
Source Code Expand
const readline = require('readline')
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
})
const lines = []
rl.on('line', (input) => {
lines.push(input);
})
rl.on('close', () => {
// (function() {
// const lines = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')
let l = 0;
let t = 1
// t = +lines[l++]
const output = []
for (let i = 0; i < t; i++) {
const [x, y] = lines[l++].trim().split(' ').map(Number)
output[i] = solve(x, y)
}
console.log(output.join('\n'))
// })()
})
function solve(x, y) {
let c = 0
for (let i = 1; i <= 6; i++) {
for (let j = 1; j <= 6; j++) {
if (i + j >= x || Math.abs(i - j) >= y) {
c++
}
}
}
return c / 36
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - P(X or Y) |
| User | chinesedfan |
| Language | JavaScript (Node.js 18.16.1) |
| Score | 250 |
| Code Size | 852 Byte |
| Status | AC |
| Exec Time | 40 ms |
| Memory | 43272 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 250 / 250 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 40 ms | 42836 KiB |
| 00_sample_01.txt | AC | 38 ms | 42768 KiB |
| 00_sample_02.txt | AC | 38 ms | 43184 KiB |
| 01_random_03.txt | AC | 39 ms | 42912 KiB |
| 01_random_04.txt | AC | 39 ms | 43128 KiB |
| 01_random_05.txt | AC | 39 ms | 43232 KiB |
| 01_random_06.txt | AC | 39 ms | 43228 KiB |
| 01_random_07.txt | AC | 39 ms | 43220 KiB |
| 01_random_08.txt | AC | 38 ms | 42996 KiB |
| 01_random_09.txt | AC | 39 ms | 42900 KiB |
| 01_random_10.txt | AC | 39 ms | 43272 KiB |
| 01_random_11.txt | AC | 38 ms | 42952 KiB |
| 01_random_12.txt | AC | 38 ms | 42876 KiB |
| 01_random_13.txt | AC | 38 ms | 42948 KiB |
| 01_random_14.txt | AC | 38 ms | 42860 KiB |
| 01_random_15.txt | AC | 38 ms | 42988 KiB |
| 01_random_16.txt | AC | 38 ms | 43092 KiB |