Submission #00084


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include<iostream>
#include<queue>
using namespace std;
typedef pair<int,int>P;
int main(){
int n,m;
int direy;
queue<P>que;
priority_queue<P,vector<P>,greater<P> >pq;
cin>>n>>m;
for(int i=0;i<n;i++){
int index;
int times;
cin>>index>>times;
que.push(P(times,index));
}
for(int i=0;i<m;i++){
pq.push(que.front());
que.pop();
}
while(!pq.empty()){
P pos=pq.top();pq.pop();
cout<<pos.second<<endl;
direy=pos.first;
if(!que.empty()){
P next=que.front();que.pop();
next.first+=direy;
pq.push(next);
}
}
return(0);
}

ステータス

項目 データ
問題 0003 - 鍵山食堂
ユーザー名 ei1630
投稿日時 2017-12-22 14:56:34
言語 C++11
状態 Time Limit Exceeded
得点 30
ソースコード長 630 Byte
最大実行時間 1000 ms
最大メモリ使用量 133160 KB

セット

セット 得点 Cases
1 Subtask 30 / 30 Input[0-1]*, Input20
2 Lunch 0 / 120 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 18 ms 480 KB
1
2
Input02 AC 15 ms 440 KB
1
2
Input03 AC 24 ms 532 KB
1
2
Input04 AC 20 ms 508 KB
1
2
Input05 AC 23 ms 596 KB
1
2
Input06 AC 23 ms 544 KB
1
2
Input07 AC 21 ms 500 KB
1
2
Input08 AC 24 ms 596 KB
1
2
Input09 AC 18 ms 572 KB
1
2
Input10 AC 21 ms 536 KB
1
2
Input11 AC 22 ms 364 KB
1
2
Input12 AC 15 ms 584 KB
1
2
Input13 AC 19 ms 548 KB
1
2
Input14 AC 19 ms 512 KB
1
2
Input15 AC 19 ms 612 KB
1
2
Input16 AC 17 ms 584 KB
1
2
Input17 AC 17 ms 676 KB
1
2
Input18 AC 22 ms 760 KB
1
2
Input19 AC 18 ms 588 KB
1
2
Input20 AC 22 ms 424 KB
1
2
Input21 AC 997 ms 13808 KB
2
Input22 TLE 1000 ms 20324 KB
2
Input23 AC 535 ms 18740 KB
2
Input24 AC 439 ms 17920 KB
2
Input25 TLE 1000 ms 25764 KB
2
Input26 AC 793 ms 29728 KB
2
Input27 TLE 1000 ms 37812 KB
2
Input28 AC 65 ms 27956 KB
2
Input29 TLE 1000 ms 41736 KB
2
Input30 TLE 1000 ms 44048 KB
2
Input31 TLE 1000 ms 55360 KB
2
Input32 TLE 1000 ms 55556 KB
2
Input33 TLE 1000 ms 59108 KB
2
Input34 TLE 1000 ms 66884 KB
2
Input35 TLE 1000 ms 69228 KB
2
Input36 TLE 1000 ms 76820 KB
2
Input37 TLE 1000 ms 78820 KB
2
Input38 TLE 1000 ms 86660 KB
2
Input39 TLE 1000 ms 87392 KB
2
Input40 TLE 1000 ms 94312 KB
2
Input41 TLE 1000 ms 98020 KB
2
Input42 TLE 1000 ms 102624 KB
2
Input43 TLE 1000 ms 105400 KB
2
Input44 TLE 1000 ms 105448 KB
2
Input45 TLE 1000 ms 114672 KB
2
Input46 TLE 1000 ms 120416 KB
2
Input47 TLE 1000 ms 121612 KB
2
Input48 TLE 1000 ms 122396 KB
2
Input49 TLE 1000 ms 133160 KB
2
Input50 TLE 1000 ms 131796 KB
2