結果

問題 No.851 テストケース
ユーザー watarimaycry2watarimaycry2
提出日時 2020-04-18 22:39:37
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 82 ms / 3,153 ms
コード長 2,141 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 42,776 KB
最終ジャッジ日時 2023-08-03 03:51:41
合計ジャッジ時間 3,420 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
42,620 KB
testcase_01 AC 81 ms
42,668 KB
testcase_02 AC 75 ms
42,620 KB
testcase_03 AC 79 ms
42,644 KB
testcase_04 AC 75 ms
42,572 KB
testcase_05 AC 76 ms
42,736 KB
testcase_06 AC 79 ms
42,564 KB
testcase_07 AC 77 ms
42,528 KB
testcase_08 AC 75 ms
42,640 KB
testcase_09 AC 82 ms
42,776 KB
testcase_10 AC 75 ms
42,560 KB
testcase_11 AC 74 ms
42,600 KB
testcase_12 AC 77 ms
42,624 KB
testcase_13 AC 76 ms
42,608 KB
testcase_14 AC 77 ms
42,548 KB
testcase_15 AC 78 ms
42,688 KB
testcase_16 AC 77 ms
42,624 KB
testcase_17 AC 79 ms
42,544 KB
testcase_18 AC 81 ms
42,544 KB
testcase_19 AC 76 ms
42,544 KB
testcase_20 AC 78 ms
42,552 KB
testcase_21 AC 77 ms
42,576 KB
testcase_22 AC 76 ms
42,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj = null;
var inputFile = [];
reader.on('line', function(input){inputFile.push(input);});
reader.on('close', function(){
  obj = init(inputFile);
  Main();
});
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    "list" : input, "index" : 0, "max" : input.length,
    "hasNext" : function(){return (this.index < this.max);},
    "next" : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var N = nextInt();
  var first = nextIntArray();
  if(first.length > 1){
    myout("\"assert\"");
  }else{
    first = first[0];
    var second = nextInt();
    var third = nextInt();
    var list = [first + second, first + third, second + third];
    list.sort(function(a,b){
    	return b - a;
    });
    if(list[0] == list[1]){
      myout(list[2]);
    }else{
      myout(list[1]);
    }
    
  }
}
0