QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#186358#2174. Which Planet is This?!So_Stuffy#WA 1060ms88256kbC++201.9kb2023-09-23 18:12:272023-09-23 18:12:27

Judging History

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

  • [2023-09-23 18:12:27]
  • 评测
  • 测评结果:WA
  • 用时:1060ms
  • 内存:88256kb
  • [2023-09-23 18:12:27]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

map < long long, long long > mp;
map < long long, set < long long > > mp1, mp2;

long double x, y;

long long n, a, b, prv, i, px;

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 = x;
        b = y;
        mp1[a].insert(b);
    }

    for (i = 1; i <= n; i++){
        cin >> x >> y;
        y += 180;
        x *= 1e4;
        y *= 1e4;
        a = x;
        b = y;
        mp2[a].insert(b);
    }

    px = -1e10;
    for (auto r : mp1){
        if (mp2[r.first].size() != r.second.size()){
            cout << "Different\n";
            return 0;
        }
        prv = -1e10;
        for (auto x : r.second){
            if (prv != -1e10){
                mp[md(x - prv)]++;
            }
            prv = x;
        }

        prv = -1e10;
        for (auto x : mp2[r.first]){
            if (prv != -1e10){
                mp[md(x - prv)]--;
                if (mp[md(x - prv)] < 0){
                    cout << "Different\n";
                    return 0;
                }
                prv = x;
            }
        }

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

    cout << "Same\n";
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3680kb

input:

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

output:

Different

result:

ok single line: 'Different'

Test #2:

score: 0
Accepted
time: 971ms
memory: 54396kb

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:

Same

result:

ok single line: 'Same'

Test #3:

score: 0
Accepted
time: 683ms
memory: 45888kb

input:

299998
-0.0045 -42.0335
-0.0045 -106.8631
-0.0045 176.8211
-0.0045 100.6703
-0.0045 168.0453
-0.0045 -100.7977
-0.0045 -31.7881
-0.0045 -43.3799
-0.0045 -87.3392
-0.0045 30.4474
-0.0045 -7.4550
-0.0045 106.5476
-0.0045 -3.9185
-0.0045 -56.8153
-0.0045 -146.7755
-0.0045 -76.6043
-0.0045 57.1774
-0.00...

output:

Same

result:

ok single line: 'Same'

Test #4:

score: -100
Wrong Answer
time: 1060ms
memory: 88256kb

input:

400000
-57.6217 51.8207
-66.4301 79.8153
68.6538 169.5723
-48.0781 -6.6298
-6.7822 -17.1276
-39.4009 179.3474
63.3867 -77.7996
61.0296 23.9060
-45.3758 41.1641
70.4582 129.4273
-29.7325 -35.5175
-15.3621 31.2737
-23.1798 102.5020
80.7571 -132.1432
-48.3888 -6.5756
18.4703 135.7623
-0.8199 -65.5536
-...

output:

Different

result:

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