結果

問題 No.2590 100000 Days of Christmas
ユーザー Yoichiro NishimuraYoichiro Nishimura
提出日時 2023-12-19 17:39:12
言語 PHP
(8.3.4)
結果
AC  
実行時間 613 ms / 2,000 ms
コード長 244 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 32,540 KB
実行使用メモリ 41,468 KB
最終ジャッジ日時 2023-12-19 17:39:20
合計ジャッジ時間 6,303 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
32,668 KB
testcase_01 AC 45 ms
32,668 KB
testcase_02 AC 44 ms
32,668 KB
testcase_03 AC 43 ms
32,668 KB
testcase_04 AC 43 ms
32,668 KB
testcase_05 AC 44 ms
32,668 KB
testcase_06 AC 613 ms
41,468 KB
testcase_07 AC 60 ms
32,668 KB
testcase_08 AC 553 ms
41,468 KB
testcase_09 AC 61 ms
32,668 KB
testcase_10 AC 42 ms
32,668 KB
testcase_11 AC 43 ms
32,668 KB
testcase_12 AC 43 ms
32,668 KB
testcase_13 AC 43 ms
32,668 KB
testcase_14 AC 42 ms
32,668 KB
testcase_15 AC 43 ms
32,668 KB
testcase_16 AC 43 ms
32,668 KB
testcase_17 AC 43 ms
32,668 KB
testcase_18 AC 43 ms
32,668 KB
testcase_19 AC 43 ms
32,668 KB
testcase_20 AC 561 ms
41,468 KB
testcase_21 AC 569 ms
41,468 KB
testcase_22 AC 532 ms
41,468 KB
testcase_23 AC 574 ms
41,468 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$N = intval(fgets(STDIN));
for($i = 0; $i < $N; $i++){
    $s = substr(fgets(STDIN), 0, -1);
    $map[$s] = ($map[$s]??0)+($N-$i)*($i+1);
}
ksort($map, SORT_STRING);
foreach($map as $key => $cnt){
    echo $cnt," ",substr($key,0),"\n";
}
0