Submission #30633052


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)

std::vector<std::string> split(const std::string& text, const char delim);

using ll = long long int;
using llu = unsigned long long int;

struct Point{
    int x;
    int y;
};

int main(){
    string buffer;
    // getline(cin, buffer);

    vector<Point> point_vec;
    point_vec.reserve(4);
    for(int i = 0; i < 3; ++i){
        getline(cin, buffer);
        auto item_list = split(buffer, ' ');
        point_vec.emplace_back();
        point_vec.back().x = stoi(item_list[0]);
        point_vec.back().y = stoi(item_list[1]);
    }
    map<int, int> x_map, y_map;
    for(const auto& point : point_vec){
        x_map[point.x] += 1;
        y_map[point.y] += 1;
    }

    int x = 0;
    for(const auto& pair : x_map){
        if(pair.second == 1){
            x = pair.first;
            break;
        }
    }
    int y = 0;
    for(const auto& pair : y_map){
        if(pair.second == 1){
            y = pair.first;
            break;
        }
    }
    cout << x << " " << y << endl;

    return 0;
}

std::vector<std::string> split(const std::string& text, const char delim) {
    std::vector<std::string> item_list;
    std::stringstream ss(text);
    std::string buffer;

    const size_t NUM_ITEM = std::count(text.begin(), text.end(), delim);
    item_list.reserve(NUM_ITEM + 1);

    while ( std::getline(ss, buffer, delim) ) {
        if (!buffer.empty()) {
                item_list.emplace_back(buffer);
        }
    }

    return item_list;
}

Submission Info

Submission Time
Task A - Four Points
User low10603
Language C++ (GCC 9.2.1)
Score 100
Code Size 1630 Byte
Status AC
Exec Time 6 ms
Memory 3608 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 18
Set Name Test Cases
Sample example0.txt, example1.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, example0.txt, example1.txt
Case Name Status Exec Time Memory
000.txt AC 6 ms 3488 KiB
001.txt AC 2 ms 3576 KiB
002.txt AC 2 ms 3504 KiB
003.txt AC 2 ms 3580 KiB
004.txt AC 2 ms 3516 KiB
005.txt AC 2 ms 3560 KiB
006.txt AC 2 ms 3584 KiB
007.txt AC 2 ms 3552 KiB
008.txt AC 2 ms 3608 KiB
009.txt AC 2 ms 3464 KiB
010.txt AC 2 ms 3596 KiB
011.txt AC 2 ms 3576 KiB
012.txt AC 2 ms 3516 KiB
013.txt AC 1 ms 3552 KiB
014.txt AC 2 ms 3404 KiB
015.txt AC 2 ms 3556 KiB
example0.txt AC 2 ms 3576 KiB
example1.txt AC 2 ms 3468 KiB