QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#186389#2174. Which Planet is This?!So_StuffyCompile Error//C++142.8kb2023-09-23 19:05:192023-09-23 19:05:20

Judging History

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

  • [2023-09-23 19:05:20]
  • 评测
  • [2023-09-23 19:05:19]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

map < long long, long long > mp_N;
map < long long, set < long long > > mp1_N, mp2_N;

long double x, y;

long long n, a_N, b_N, prv_N, i, px_N;

long long md(long long a){
    return a < 0 ? a + 360 * 1e4 : a;
}

int main(){
    cin >> n;

    for (i = 1; i <= n; i++){
        cin >> x >> y;
        y += 180;
        x *= 1e4;
        y *= 1e4;
        a_N = x;
        b_N = y;
        mp1_N[a_N].insert(b_N);
    }

    for (i = 1; i <= n; i++){
        cin >> x >> y;
        y += 180;
        x *= 1e4;
        y *= 1e4;
        a_N = x;
        b_N = y;
        mp2_N[a_N].insert(b_N);
    }

    px_N = -1e10;
    for (auto r : mp1_N){
        if (mp2_N[r.first].size() != r.second.size()){
            cout << "Different\n";
            return 0;
        }
        prv_N = -1e10;
        for (auto x : r.second){
            if (prv_N != -1e10){
                mp_N[md(x - prv_N)]++;
            }
            prv_N = x;
        }
        mp[md(*r.second.rbegin() - *r.second().begin())]++;

        prv_N = -1e10;
        for (auto x : mp2_N[r.first]){
            if (prv_N != -1e10){
                mp_N[md(x - prv_N)]--;
                if (mp_N[md(x - prv_N)] < 0){
                    cout << "Different\n";
                    return 0;
                }
                prv_N = x;
            }
        }
        if (mp[md(*mp2_N[r.first].rbegin() - *mp2_N[r.first].begin())] == 0){
cout << "Different\n";
return 0;
}
        

        if (px_N != -1e10){
            for (auto x : mp1_N[r.first]){
                auto it = mp1_N[px_N].lower_bound(x);
                if (it == mp1_N[px_N].end()) it = mp1_N[px_N].begin();
                mp_N[md(x - *it)]++;
            }
            for (auto x : mp2_N[r.first]){
                auto it = mp2_N[px_N].lower_bound(x);
                if (it == mp2_N[px_N].end()) it = mp2_N[px_N].begin();
                mp_N[md(x - *it)]--;
                if (mp_N[md(x - *it)] < 0){
                    cout << "Different\n";
                    return 0;
                }
            }

            for (auto x : mp1_N[px_N]){
                auto it = mp1_N[r.first].lower_bound(x);
                if (it == mp1_N[r.first].end()) it = mp1_N[r.first].begin();
                mp_N[md(x - *it)]++;
            }
            for (auto x : mp2_N[px_N]){
                auto it = mp2_N[r.first].lower_bound(x);
                if (it == mp2_N[r.first].end()) it = mp2_N[r.first].begin();
                mp_N[md(x - *it)]--;
                if (mp_N[md(x - *it)] < 0){
                    cout << "Different\n";
                    return 0;
                }
            }
        }
        px_N = r.first;
    }

    cout << "Same\n";
}

详细

answer.code: In function ‘int main()’:
answer.code:52:9: error: ‘mp’ was not declared in this scope; did you mean ‘md’?
   52 |         mp[md(*r.second.rbegin() - *r.second().begin())]++;
      |         ^~
      |         md
answer.code:52:45: error: no match for call to ‘(std::set<long long int>) ()’
   52 |         mp[md(*r.second.rbegin() - *r.second().begin())]++;
      |                                     ~~~~~~~~^~