結果
| 問題 | No.59 鉄道の旅 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-24 03:54:59 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 343 bytes |
| 記録 | |
| コンパイル時間 | 374 ms |
| コンパイル使用メモリ | 56,448 KB |
| 実行使用メモリ | 11,776 KB |
| 最終ジャッジ日時 | 2026-05-30 15:11:43 |
| 合計ジャッジ時間 | 7,228 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | TLE * 1 -- * 11 |
ソースコード
#include <set>
#include <cstdio>
int main(){
std::multiset<int>se;
int N,K;
scanf("%d%d",&N,&K);
for(int i=0;i<N;i++){
int n;
scanf("%d",&n);
if(n>0){
auto it=se.lower_bound(n);
if(std::distance(it,se.end())<K)se.insert(n);
}else{
auto it=se.lower_bound(-n);
if(*it==-n)se.erase(it);
}
}
printf("%d\n",se.size());
}