結果
問題 |
No.989 N×Mマス計算(K以上)
|
ユーザー |
![]() |
提出日時 | 2021-11-24 21:47:42 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 455 bytes |
コンパイル時間 | 2,241 ms |
コンパイル使用メモリ | 214,432 KB |
実行使用メモリ | 6,956 KB |
最終ジャッジ日時 | 2024-06-22 13:29:07 |
合計ジャッジ時間 | 3,632 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
import std; void main() { long N, M, K; readf("%d %d %d\n", N, M, K); auto input = readln.chomp.split; string op = input[0]; auto B = input[1..$].to!(long[]).sort; long res; foreach (i; 0 .. N) { long A; readf("%d\n", A); if (op == "+") { res += B.upperBound(K-A-1).length; } else { res += B.upperBound((K+A-1)/A-1).length; } } res.writeln; }