QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#252955#5470. Hasty Santa Claussurenjamts#WA 1ms3480kbC++14779b2023-11-16 15:46:492023-11-16 15:46:50

Judging History

你现在查看的是最新测评结果

  • [2023-11-16 15:46:50]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3480kb
  • [2023-11-16 15:46:49]
  • 提交

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)