Submission #3603422
Source Code Expand
// inputに入力データ全体が入る function Main(str) { const num = str.split(' '); const N = parseInt(num[0]); const K = parseInt(num[1]); var arr = []; for (var i = 1; i <= N; i++) { var arr2 = []; arr2[0] = i; for (var j = 1; j <= N; j++) { arr2[1] = j; for (var k = 1; k <= N; k++) { arr2[2] = k; //console.log(arr2[0] + arr2[1]); if ((arr2[0] + arr2[1]) % K === 0 && (arr2[1] + arr2[2]) % K === 0 && (arr2[2] + arr2[0]) % K === 0) { arr.push(arr2); } } } } console.log(arr.length); } //*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します) Main(require("fs").readFileSync("/dev/stdin", "utf8"));
Submission Info
Submission Time | |
---|---|
Task | C - Triangular Relationship |
User | helloworld0840 |
Language | JavaScript (node.js v5.12) |
Score | 0 |
Code Size | 830 Byte |
Status | TLE |
Exec Time | 2122 ms |
Memory | 1184268 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt, s4.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, s1.txt, s2.txt, s3.txt, s4.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | TLE | 2115 ms | 1184204 KB |
02.txt | TLE | 2122 ms | 1184268 KB |
03.txt | TLE | 2108 ms | 7244 KB |
04.txt | TLE | 2108 ms | 7244 KB |
05.txt | TLE | 2108 ms | 7244 KB |
06.txt | TLE | 2108 ms | 7244 KB |
07.txt | TLE | 2108 ms | 7244 KB |
08.txt | AC | 61 ms | 7756 KB |
09.txt | AC | 55 ms | 7372 KB |
10.txt | TLE | 2108 ms | 7244 KB |
11.txt | TLE | 2110 ms | 54604 KB |
12.txt | TLE | 2108 ms | 7244 KB |
13.txt | TLE | 2108 ms | 7244 KB |
14.txt | TLE | 2108 ms | 7244 KB |
s1.txt | AC | 54 ms | 7372 KB |
s2.txt | AC | 54 ms | 7372 KB |
s3.txt | TLE | 2108 ms | 7244 KB |
s4.txt | TLE | 2108 ms | 7244 KB |