QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#227502#2174. Which Planet is This?!TWTP_TCTF#WA 357ms25648kbC++171.1kb2023-10-27 16:51:322023-10-27 16:51:32

Judging History

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

  • [2023-10-27 16:51:32]
  • 评测
  • 测评结果:WA
  • 用时:357ms
  • 内存:25648kb
  • [2023-10-27 16:51:32]
  • 提交

answer

#include <bits/stdc++.h>

#define tle ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define ll long long
#define ld long double
#define sz(a) (int)(a.size())

using namespace std;
const int N = 2e5 + 5, M = 475260;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
ld EPS = 1e-5;


int main() {
    tle
    int n;
    cin >> n;
    vector<pair<ld, ld>> a(n), b(n);
    for (auto &it: a) cin >> it.first >> it.second;
    for (auto &it: b) cin >> it.first >> it.second;
    std::sort(a.begin(), a.end());
    std::sort(b.begin(), b.end());
    ld aa = a[0].second, bb = b[0].second;
    for (int i = 0; i < n; ++i) {
        a[i].second -= aa;
        b[i].second -= bb;

        if (a[i].second > 180)a[i].second -= 360;
        else if (a[i].second <= -180) a[i].second += 360;

        if (b[i].second > 180)b[i].second -= 360;
        else if (b[i].second <= -180) b[i].second += 360;

        if (abs(a[i].first - b[i].first) < EPS && abs(a[i].second - b[i].second) < EPS)
            continue;
        cout << "Different\n";
        return 0;

    }
    cout << "Same\n";
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3728kb

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: 357ms
memory: 25648kb

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'