Submission #3609494


Source Code Expand

#include<iostream>

#include <vector>
#include <list>
#include<stack>
#include<queue>
#include<array>

#include <set>
#include<map>

#include<string>
#include<stdlib.h>
#include<memory>

#include<algorithm>
#include <functional>
#include<math.h>

#include<fstream>
#include<iomanip>

using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<<str<<endl

constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;// 10^9+7


//変数
ll N, M;
vector<pair<ll, ll>> py;
map<ll, vector<pair<ll, ll>>> info;




//サブ関数
//入力
void input()
{
	cin >> N >> M;
	REP(i, M)
	{
		ll a, b;
		cin >> a >> b;
		py.push_back({a,b});
		info[a].push_back({b,i});
	}
}


//計算
void calc()
{
	for(auto& row : info)sort(row.second.begin(), row.second.end());
	for(const auto& row : info)REP(i, row.second.size())py[row.second[i].second].second = i + 1;
	for(auto p : py)cout << setfill('0') << right << setw(6) << p.first
		<< setfill('0') << right << setw(6) << p.second << endl;
}


//出力
void output()
{

}


//デバッグ
void debug()
{
	int N;
	cin >> N;
}


//メイン関数
int main()
{
	input();
	calc();
	output();
	debug();

	return 0;
}

Submission Info

Submission Time
Task C - ID
User toma25
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1493 Byte
Status AC
Exec Time 291 ms
Memory 13936 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 21
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01.txt AC 289 ms 10736 KB
02.txt AC 232 ms 4836 KB
03.txt AC 1 ms 256 KB
04.txt AC 1 ms 256 KB
05.txt AC 244 ms 4836 KB
06.txt AC 289 ms 13936 KB
07.txt AC 4 ms 384 KB
08.txt AC 257 ms 6640 KB
09.txt AC 283 ms 10608 KB
10.txt AC 245 ms 5872 KB
11.txt AC 226 ms 4976 KB
12.txt AC 163 ms 3828 KB
13.txt AC 242 ms 5232 KB
14.txt AC 284 ms 10736 KB
15.txt AC 291 ms 10736 KB
16.txt AC 291 ms 10736 KB
17.txt AC 286 ms 10608 KB
18.txt AC 282 ms 10736 KB
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 1 ms 256 KB