結果

問題 No.864 四方演算
ユーザー bar_HelloWorldbar_HelloWorld
提出日時 2019-08-16 23:53:36
言語 JavaScript
(node v21.7.1)
結果
WA  
実行時間 -
コード長 815 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 6,944 KB
実行使用メモリ 48,668 KB
最終ジャッジ日時 2024-04-21 03:00:12
合計ジャッジ時間 2,532 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
    // inputにはすべての入力の文字列が与えられるので必要に応じて input.split("\n") などで分割する。

    var data = input.split("\n");
    var n = parseInt(data[0], 10);
    var k = parseInt(data[1], 10);
    
    var returner = 0;

    for(var sita=2; sita <= k; sita++){
        if( k % sita === 0 ){
            var ue = k/sita - 1;
            var ue_threshold = (ue-n)*2;
            if(ue_threshold<0){ue_threshold=0;}

            returner += ue - ue_threshold;

            var sita_threshold = (sita-n)*2;
            if(sita_threshold<0){sita_threshold=0;}

            returner += sita - sita_threshold;
        }
    }
    
    
    
    console.log( returner );
}

// Don't edit this line!
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0