QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#186624 | #2174. Which Planet is This?! | So_Stuffy | WA | 794ms | 54312kb | C++20 | 2.9kb | 2023-09-24 07:22:30 | 2023-09-24 07:22:31 |
Judging History
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_N[md(*r.second.begin() - *r.second.rbegin())]++;
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;
}
}
mp_N[md(*mp2_N[r.first].begin() - *mp2_N[r.first].rbegin())]--;
if (mp_N[md(*mp2_N[r.first].begin() - *mp2_N[r.first].rbegin())] < 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";
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3740kb
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: 794ms
memory: 54312kb
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: -100
Wrong Answer
time: 633ms
memory: 45932kb
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:
Different
result:
wrong answer 1st lines differ - expected: 'Same', found: 'Different'