| Task: | Function |
| Sender: | egor.lifar |
| Submission time: | 2019-01-20 16:51:26 +0200 |
| Language: | C++ |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| #2 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.15 s | 1 | details |
| #2 | ACCEPTED | 0.33 s | 1 | details |
| #3 | ACCEPTED | 0.67 s | 1 | details |
| #4 | TIME LIMIT EXCEEDED | -- | 1 | details |
| #5 | ACCEPTED | 0.29 s | 1 | details |
| #6 | WRONG ANSWER | 0.33 s | 1 | details |
| #7 | ACCEPTED | 0.32 s | 1 | details |
| #8 | ACCEPTED | 0.29 s | 1 | details |
| #9 | ACCEPTED | 0.35 s | 1 | details |
| #10 | WRONG ANSWER | 0.20 s | 2 | details |
| #11 | ACCEPTED | 0.31 s | 2 | details |
| #12 | ACCEPTED | 0.76 s | 2 | details |
| #13 | TIME LIMIT EXCEEDED | -- | 2 | details |
| #14 | ACCEPTED | 0.34 s | 2 | details |
| #15 | WRONG ANSWER | 0.26 s | 2 | details |
| #16 | WRONG ANSWER | 0.22 s | 2 | details |
| #17 | WRONG ANSWER | 0.25 s | 2 | details |
| #18 | ACCEPTED | 0.29 s | 2 | details |
| #19 | ACCEPTED | 0.29 s | 2 | details |
| #20 | ACCEPTED | 0.29 s | 2 | details |
| #21 | WRONG ANSWER | 0.20 s | 2 | details |
| #22 | RUNTIME ERROR | 0.02 s | 2 | details |
| #23 | WRONG ANSWER | 0.03 s | 2 | details |
| #24 | RUNTIME ERROR | 0.01 s | 2 | details |
| #25 | RUNTIME ERROR | 0.02 s | 2 | details |
| #26 | RUNTIME ERROR | 0.01 s | 2 | details |
| #27 | RUNTIME ERROR | 0.02 s | 2 | details |
| #28 | RUNTIME ERROR | 0.02 s | 2 | details |
| #29 | RUNTIME ERROR | 0.02 s | 2 | details |
| #30 | ACCEPTED | 0.35 s | 2 | details |
| #31 | ACCEPTED | 0.72 s | 2 | details |
| #32 | TIME LIMIT EXCEEDED | -- | 2 | details |
| #33 | TIME LIMIT EXCEEDED | -- | 2 | details |
| #34 | ACCEPTED | 0.33 s | 2 | details |
| #35 | RUNTIME ERROR | 0.02 s | 2 | details |
Code
/*
ЗАПУСКАЕМ
░ГУСЯ░▄▀▀▀▄░РАБОТЯГУ░░
▄███▀░◐░░░▌░░░░░░░
░░░░▌░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▌░░░░░▐▄▄░░░░░
░░░░▌░░░░▄▀▒▒▀▀▀▀▄
░░░▐░░░░▐▒▒▒▒▒▒▒▒▀▀▄
░░░▐░░░░▐▄▒▒▒▒▒▒▒▒▒▒▀▄
░░░░▀▄░░░░▀▄▒▒▒▒▒▒▒▒▒▒▀▄
░░░░░░▀▄▄▄▄▄█▄▄▄▄▄▄▄▄▄▄▄▀▄
░░░░░░░░░░░▌▌░▌▌░░░░░
░░░░░░░░░░░▌▌░▌▌░░░░░
░░░░░░░░░▄▄▌▌▄▌▌░░░░░
*/
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
#include <array>
using namespace std;
template<typename T1, typename T2>inline void chkmin(T1 &x, T2 y) { if (x > y) x = y; }
template<typename T1, typename T2>inline void chkmax(T1 &x, T2 y) { if (x < y) x = y; }
template<typename T, typename U> inline ostream &operator<< (ostream &_out, const pair<T, U> &_p) { _out << _p.first << ' ' << _p.second; return _out; }
template<typename T, typename U> inline istream &operator>> (istream &_in, pair<T, U> &_p) { _in >> _p.first >> _p.second; return _in; }
template<typename T> inline ostream &operator<< (ostream &_out, const vector<T> &_v) { if (_v.empty()) { return _out; } _out << _v.front(); for (auto _it = ++_v.begin(); _it != _v.end(); ++_it) { _out << ' ' << *_it; } return _out; }
template<typename T> inline istream &operator>> (istream &_in, vector<T> &_v) { for (auto &_i : _v) { _in >> _i; } return _in; }
template<typename T> inline ostream &operator<< (ostream &_out, const set<T> &_s) { if (_s.empty()) { return _out; } _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) { _out << ' ' << *_it; } return _out; }
template<typename T> inline ostream &operator<< (ostream &_out, const multiset<T> &_s) { if (_s.empty()) { return _out; } _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) { _out << ' ' << *_it; } return _out; }
template<typename T> inline ostream &operator<< (ostream &_out, const unordered_set<T> &_s) { if (_s.empty()) { return _out; } _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) { _out << ' ' << *_it; } return _out; }
template<typename T> inline ostream &operator<< (ostream &_out, const unordered_multiset<T> &_s) { if (_s.empty()) { return _out; } _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) { _out << ' ' << *_it; } return _out; }
template<typename T, typename U> inline ostream &operator<< (ostream &_out, const map<T, U> &_m) { if (_m.empty()) { return _out; } _out << '(' << _m.begin()->first << ": " << _m.begin()->second << ')'; for (auto _it = ++_m.begin(); _it != _m.end(); ++_it) { _out << ", (" << _it->first << ": " << _it->second << ')'; } return _out; }
template<typename T, typename U> inline ostream &operator<< (ostream &_out, const unordered_map<T, U> &_m) { if (_m.empty()) { return _out; } _out << '(' << _m.begin()->first << ": " << _m.begin()->second << ')'; for (auto _it = ++_m.begin(); _it != _m.end(); ++_it) { _out << ", (" << _it->first << ": " << _it->second << ')'; } return _out; }
#define sz(c) (int)(c).size()
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define left left228
#define right right228
#define rank rank228
#define y1 y1228
#define read(FILENAME) freopen((FILENAME + ".in").c_str(), "r", stdin)
#define write(FILENAME) freopen((FILENAME + ".out").c_str(), "w", stdout)
#define files(FILENAME) read(FILENAME), write(FILENAME)
#define pb push_back
const string FILENAME = "input";
const int MAXN = 1005;
const double Pi = acos(-1);
struct point
{
double x, y;
point(){}
point(double _x, double _y){
x = _x;
y = _y;
}
};
point operator +(const point &a, const point &b) {
return point(a.x + b.x, a.y + b.y);
}
point operator -(const point &a, const point &b) {
return point(a.x - b.x, a.y - b.y);
}
int n;
point p[MAXN];
point q[MAXN];
bool rotate(double angle) {
for (int i = 1; i < n; i++) {
double x = p[i].x * cos(angle) - p[i].y * sin(angle);
double y = p[i].y * sin(angle) + p[i].y * cos(angle);
q[i] = point(x, y);
}
bool bad = false;
for (int i = 0; i < n - 1; i++) {
if (q[i].x >= q[i + 1].x) {
bad = true;
}
}
if (!bad) {
return true;
}
for (int i = 0; i < n - 1; i++) {
if (q[i].x <= q[i + 1].x) {
bad = true;
}
}
if (!bad) {
return true;
}
return false;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
//read(FILENAME);
int t;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n;
for (int i = 0; i < n; i++) {
cin >> p[i].x >> p[i].y;
}
for (int i = 1; i < n; i++) {
p[i] = p[i] - p[0];
}
p[0] = p[0] - p[0];
double f = 2.0 * Pi;
bool ok = false;
for (int it = 0; it < 1000000 / n; it++) {
if (rotate((f / (1000000 / n)) * it)) {
ok = true;
break;
}
}
if (ok) {
cout << "YES\n";
} else {
cout << "NO\n";
}
}
return 0;
}
Test details
Test 1
Group: 1
Verdict: WRONG ANSWER
| input |
|---|
| 12 2 0 0 1 1 5 ... |
| correct output |
|---|
| YES YES NO YES YES ... |
| user output |
|---|
| YES YES NO YES YES ... |
Test 2
Group: 1
Verdict: ACCEPTED
| input |
|---|
| 100 2 92 30 22 44 2 ... |
| correct output |
|---|
| YES YES YES YES YES ... |
| user output |
|---|
| YES YES YES YES YES ... Truncated |
Test 3
Group: 1
Verdict: ACCEPTED
| input |
|---|
| 100 3 -55 -98 -59 -55 -2 88 ... |
| correct output |
|---|
| YES YES YES YES YES ... |
| user output |
|---|
| YES YES YES YES YES ... Truncated |
Test 4
Group: 1
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 4 87 81 -84 42 18 -46 ... |
| correct output |
|---|
| YES YES YES YES YES ... |
| user output |
|---|
| (empty) |
Test 5
Group: 1
Verdict: ACCEPTED
| input |
|---|
| 100 1000 -81 38 92 -21 -10 -65 ... |
| correct output |
|---|
| NO NO NO NO NO ... |
| user output |
|---|
| NO NO NO NO NO ... Truncated |
Test 6
Group: 1
Verdict: WRONG ANSWER
| input |
|---|
| 100 110 -99 -9 -98 -9 -96 -8 ... |
| correct output |
|---|
| NO NO NO NO NO ... |
| user output |
|---|
| NO NO NO NO NO ... Truncated |
Test 7
Group: 1
Verdict: ACCEPTED
| input |
|---|
| 100 78 -100 95 -99 96 -98 95 ... |
| correct output |
|---|
| NO NO NO NO NO ... |
| user output |
|---|
| NO NO NO NO NO ... Truncated |
Test 8
Group: 1
Verdict: ACCEPTED
| input |
|---|
| 100 201 -100 97 -100 96 -99 99 ... |
| correct output |
|---|
| NO NO NO NO NO ... |
| user output |
|---|
| NO NO NO NO NO ... Truncated |
Test 9
Group: 1
Verdict: ACCEPTED
| input |
|---|
| 100 45 -100 89 -100 90 -97 90 ... |
| correct output |
|---|
| YES NO NO NO NO ... |
| user output |
|---|
| YES NO NO NO NO ... Truncated |
Test 10
Group: 2
Verdict: WRONG ANSWER
| input |
|---|
| 13 2 0 0 1 1 5 ... |
| correct output |
|---|
| YES YES NO YES YES ... |
| user output |
|---|
| YES YES NO YES NO ... |
Test 11
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 2 -517113909 -39540276 -209411537 -831819487 2 ... |
| correct output |
|---|
| YES YES YES YES YES ... |
| user output |
|---|
| YES YES YES YES YES ... Truncated |
Test 12
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 3 -991349544 139282777 646238126 16140762 -4488261 817588303 ... |
| correct output |
|---|
| YES YES YES YES YES ... |
| user output |
|---|
| YES YES YES YES YES ... Truncated |
Test 13
Group: 2
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 4 891187584 -889373775 -453505448 -469134344 -683807769 8725517 ... |
| correct output |
|---|
| YES NO YES NO NO ... |
| user output |
|---|
| (empty) |
Test 14
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 1000 -866614983 -994037153 775605588 -328510132 390868551 927606059 ... |
| correct output |
|---|
| NO NO NO NO NO ... |
| user output |
|---|
| NO NO NO NO NO ... Truncated |
Test 15
Group: 2
Verdict: WRONG ANSWER
| input |
|---|
| 100 1000 -911073332 -1000000000 -905159999 -1000000000 -904949593 -999999999 ... |
| correct output |
|---|
| YES YES YES NO NO ... |
| user output |
|---|
| YES YES NO NO NO ... Truncated |
Test 16
Group: 2
Verdict: WRONG ANSWER
| input |
|---|
| 100 1000 -1000000000 950042028 -946551105 -1000000000 -940508390 -1000000000 ... |
| correct output |
|---|
| NO YES YES YES NO ... |
| user output |
|---|
| NO NO YES YES NO ... Truncated |
Test 17
Group: 2
Verdict: WRONG ANSWER
| input |
|---|
| 100 1000 -949977239 -1000000000 -948279892 -1000000000 -947497811 -999999999 ... |
| correct output |
|---|
| YES YES YES YES YES ... |
| user output |
|---|
| YES NO YES YES YES ... Truncated |
Test 18
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 806 -899 -1000 -898 -1000 -896 -999 ... |
| correct output |
|---|
| NO NO NO NO NO ... |
| user output |
|---|
| NO NO NO NO NO ... Truncated |
Test 19
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 777 -1000 914 -1000 915 -999 916 ... |
| correct output |
|---|
| NO NO NO NO NO ... |
| user output |
|---|
| NO NO NO NO NO ... Truncated |
Test 20
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 775 -999 998 -995 -1000 -994 -1000 ... |
| correct output |
|---|
| NO NO NO NO NO ... |
| user output |
|---|
| NO NO NO NO NO ... Truncated |
Test 21
Group: 2
Verdict: WRONG ANSWER
| input |
|---|
| 13 2 0 0 1 1 5 ... |
| correct output |
|---|
| YES YES NO YES YES ... |
| user output |
|---|
| YES YES NO YES NO ... |
Test 22
Group: 2
Verdict: RUNTIME ERROR
| input |
|---|
| 1 999748 -995394098 -1000000000 -995392159 -1000000000 -995386584 -999999999 ... |
| correct output |
|---|
| NO |
| user output |
|---|
| (empty) |
Test 23
Group: 2
Verdict: WRONG ANSWER
| input |
|---|
| 1 1000000 -954368893 -1000000000 -954366895 -1000000000 -954364896 -999999999 ... |
| correct output |
|---|
| YES |
| user output |
|---|
| NO |
Test 24
Group: 2
Verdict: RUNTIME ERROR
| input |
|---|
| 1 1000000 -1000000000 928772368 -1000000000 928772506 -999999999 928772642 ... |
| correct output |
|---|
| YES |
| user output |
|---|
| (empty) |
Test 25
Group: 2
Verdict: RUNTIME ERROR
| input |
|---|
| 1 999754 -901705699 -1000000000 -901702695 -1000000000 -901702062 -999999999 ... |
| correct output |
|---|
| NO |
| user output |
|---|
| (empty) |
Test 26
Group: 2
Verdict: RUNTIME ERROR
| input |
|---|
| 100 10000 -1000000000 919783772 -918885599 -1000000000 -918825263 -1000000000 ... |
| correct output |
|---|
| NO YES YES NO NO ... |
| user output |
|---|
| (empty) |
Test 27
Group: 2
Verdict: RUNTIME ERROR
| input |
|---|
| 10 99998 -997024120 -77018772 -997011201 -77017738 -996986132 -77015834 ... |
| correct output |
|---|
| YES YES NO YES YES ... |
| user output |
|---|
| (empty) |
Test 28
Group: 2
Verdict: RUNTIME ERROR
| input |
|---|
| 100 7934 -10000 9905 -10000 9906 -9999 9906 ... |
| correct output |
|---|
| NO NO NO NO NO ... |
| user output |
|---|
| (empty) |
Test 29
Group: 2
Verdict: RUNTIME ERROR
| input |
|---|
| 100 9710 -99754 -6983 -99786 -6055 -99751 -6548 ... |
| correct output |
|---|
| YES NO NO NO NO ... |
| user output |
|---|
| (empty) |
Test 30
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 2 802396401 -641287652 30956766 -527704723 2 ... |
| correct output |
|---|
| YES YES YES YES YES ... |
| user output |
|---|
| YES YES YES YES YES ... Truncated |
Test 31
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 3 755025461 -953536159 -402145543 137775005 -700733185 821755784 ... |
| correct output |
|---|
| YES YES YES YES YES ... |
| user output |
|---|
| YES YES YES YES YES ... Truncated |
Test 32
Group: 2
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 4 -673213071 571383249 -963633735 -859013318 -591788323 791136643 ... |
| correct output |
|---|
| NO NO NO NO YES ... |
| user output |
|---|
| (empty) |
Test 33
Group: 2
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 5 -124483012 623794901 233757283 -234519096 -987338502 737259422 ... |
| correct output |
|---|
| NO NO YES NO NO ... |
| user output |
|---|
| (empty) |
Test 34
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100 1000 154383911 872030445 -9594726 190227899 908758769 -9615631 ... |
| correct output |
|---|
| NO NO NO NO NO ... |
| user output |
|---|
| NO NO NO NO NO ... Truncated |
Test 35
Group: 2
Verdict: RUNTIME ERROR
| input |
|---|
| 100 10000 642800667 -694556052 -343795089 -341227394 800920828 676674460 ... |
| correct output |
|---|
| NO NO NO NO NO ... |
| user output |
|---|
| (empty) |
