QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#252955 | #5470. Hasty Santa Claus | surenjamts# | WA | 1ms | 3480kb | C++14 | 779b | 2023-11-16 15:46:49 | 2023-11-16 15:46:50 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
#define S second
#define F first
int main(){
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
ll n, k;
map < ll, ll > mp;
ll ans[1045];
pair < pair< ll, ll >, ll > p[1045];
cin >> n >> k;
for(int i = 1; i <= n; i ++ ){
cin >> p[i].F.F >> p[i].F.S;
p[i].S = i;
swap( p[i].F.F, p[i].F.S );
}
sort( p + 1, p + n + 1 );
for(int i = 1; i <= n; i ++ ){
swap( p[i].F.F, p[i].F.S );
}
for(int i = 1; i <= n; i ++ ){
for(int j = p[i].F.F; j <= p[i].F.S; j ++ ){
if( mp[ j ] < k ){
mp[ j ] ++;
ans[ p[i].S ] = j;
break;
}
}
}
for(int i = 1; i <= n; i ++ )
cout << ans[i] << " ";
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3480kb
input:
5 1 23 25 23 27 24 25 25 25 25 26
output:
23 27 24 25 26
result:
wrong answer output line is not a valid date.(line = 23 27 24 25 26)