Submission #24883689


Source Code Expand

/*
 * @Author: your name
 * @Date: 2021-08-08 20:21:53
 * @LastEditTime: 2021-08-08 21:09:00
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Editint 
 * @FilePath: \VScode-c\C_Reorder_Cards.cpp
 */
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <cmath>
#include <algorithm>
#include <set>
#include <stack>
#include <list>
#include <map>
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define MOD (int)(1e9+7)
#define MAX 100005

using namespace std;

int main()
{
    fast;
    int h, w, n;
    cin >> h >> w >> n;
    vector<int> X, Y;
    queue<pair<int, int>> q;
    for (int i = 0; i < n;i++){
        int x, y;
        cin >> x >> y;
        q.push(make_pair(x, y));
        X.push_back(x);
        Y.push_back(y);
    }
    set<int> t(X.begin(),X.end());
    X.assign(t.begin(), t.end());
    set<int> t1(Y.begin(),Y.end());
    Y.assign(t1.begin(), t1.end());
    while(!q.empty()){
        int x = q.front().first-(q.front().first-(lower_bound(X.begin(), X.end(), q.front().first) - X.begin()+1));
        int y = q.front().second-(q.front().second-(lower_bound(Y.begin(), Y.end(), q.front().second) - Y.begin()+1));
        cout << x << " " << y << endl;
        q.pop();
    }
        return 0;
}

Submission Info

Submission Time
Task C - Reorder Cards
User mrlowkey
Language C++ (Clang 10.0.0)
Score 300
Code Size 1393 Byte
Status AC
Exec Time 416 ms
Memory 13716 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 19
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All hand_01.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
hand_01.txt AC 12 ms 3028 KiB
random_01.txt AC 2 ms 3140 KiB
random_02.txt AC 2 ms 3004 KiB
random_03.txt AC 352 ms 12080 KiB
random_04.txt AC 328 ms 11272 KiB
random_05.txt AC 416 ms 13716 KiB
random_06.txt AC 332 ms 8876 KiB
random_07.txt AC 329 ms 8912 KiB
random_08.txt AC 321 ms 8912 KiB
random_09.txt AC 333 ms 8856 KiB
random_10.txt AC 80 ms 3440 KiB
random_11.txt AC 11 ms 3088 KiB
random_12.txt AC 18 ms 3244 KiB
random_13.txt AC 50 ms 3364 KiB
random_14.txt AC 12 ms 3148 KiB
random_15.txt AC 17 ms 3084 KiB
random_16.txt AC 2 ms 3004 KiB
sample_01.txt AC 2 ms 3048 KiB
sample_02.txt AC 2 ms 3028 KiB