QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#93920#2174. Which Planet is This?!_skb_WA 309ms7664kbC++171.8kb2023-04-04 01:27:502023-04-04 01:27:51

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-04 01:27:51]
  • 评测
  • 测评结果:WA
  • 用时:309ms
  • 内存:7664kb
  • [2023-04-04 01:27:50]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

using i64 = long long;
using u64 = unsigned long long;

struct debug {
#define contPrint { *this << "["; \
        int f = 0; for(auto it : x) { *this << (f?", ":""); *this << it; f = 1;} \
        *this << "]"; return *this;}
 
    ~debug(){cerr << endl;}
    template<class c> debug& operator<<(c x) {cerr << x; return *this;}
    template<class c, class d>
    debug& operator<<(pair<c, d> x) {*this << "(" << x.first << ", " << x.second << ")"; 
        return *this;}
    template<class c> debug& operator<<(vector<c> x) contPrint;
#undef contPrint
};

#define dbg(x) "[" << #x << ": " << x << "]  "
#define Wa() cerr << "[LINE: " << __LINE__ << "] -> "; debug() << 
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL);

int main() 
{
    int n;
    scanf("%d", &n);

    int mn1 = 1e9;

    map<int, vector<int>> first;
    for(int i = 0; i < n; i++) {
        double x, y;
        scanf("%lf %lf", &x, &y);
        first[int(x * 10000)].push_back(int(y * 10000));
        mn1 = min(mn1, int(y * 10000));
    }

    int mn2 = 1e9;
    map<int, vector<int>> second;
    for(int i = 0; i < n; i++) {
        double x, y;
        scanf("%lf %lf", &x, &y);
        second[int(x * 10000)].push_back(int(y * 10000));
        mn2 = min(mn2, int(y * 10000));
    }

    for(auto& it : first) {
        for(int& i : it.second) {
            i -= mn1;
        }
        sort(it.second.begin(), it.second.end());
    }

    for(auto& it : second) {
        for(int& i : it.second) {
            i -= mn2;
        }
        sort(it.second.begin(), it.second.end());
    }

    for(auto it : first) {
        if(it.second != second[it.first]) {
            puts("Different");
            return 0;
        }
    }
    puts("Same");
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3536kb

input:

3
10 0
20 40
30 -15
40 -15
20 0
30 40

output:

Different

result:

ok single line: 'Different'

Test #2:

score: -100
Wrong Answer
time: 309ms
memory: 7664kb

input:

359998
-0.0045 96.8638
-0.0045 -79.2284
-0.0045 -50.4113
-0.0045 -79.0394
-0.0045 -24.9710
-0.0045 -142.9880
-0.0045 50.6344
-0.0045 125.9464
-0.0045 -17.3039
-0.0045 42.3454
-0.0045 130.6138
-0.0045 -106.4363
-0.0045 -95.9378
-0.0045 90.7312
-0.0045 75.7615
-0.0045 -66.9785
-0.0045 -81.0752
-0.0045...

output:

Different

result:

wrong answer 1st lines differ - expected: 'Same', found: 'Different'