| Task: | Forest |
| Sender: | Paul Saikko |
| Submission time: | 2015-09-16 17:32:39 +0300 |
| Language: | C++ |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | RUNTIME ERROR | 0.13 s | details |
| #2 | RUNTIME ERROR | 0.13 s | details |
| #3 | RUNTIME ERROR | 0.13 s | details |
| #4 | RUNTIME ERROR | 0.14 s | details |
| #5 | RUNTIME ERROR | 0.14 s | details |
| #6 | RUNTIME ERROR | 0.16 s | details |
| #7 | RUNTIME ERROR | 0.13 s | details |
| #8 | RUNTIME ERROR | 0.14 s | details |
| #9 | RUNTIME ERROR | 0.14 s | details |
| #10 | RUNTIME ERROR | 0.14 s | details |
| #11 | RUNTIME ERROR | 0.13 s | details |
| #12 | RUNTIME ERROR | 0.14 s | details |
| #13 | RUNTIME ERROR | 0.14 s | details |
| #14 | RUNTIME ERROR | 0.14 s | details |
| #15 | RUNTIME ERROR | 0.16 s | details |
| #16 | WRONG ANSWER | 0.06 s | details |
| #17 | RUNTIME ERROR | 0.16 s | details |
| #18 | WRONG ANSWER | 0.07 s | details |
| #19 | WRONG ANSWER | 0.07 s | details |
| #20 | WRONG ANSWER | 0.06 s | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:9:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
^
input/code.cpp:12:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &ux, &uy);
^
input/code.cpp:18:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &x, &y);
^Code
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
scanf("%d", &n);
int ux, uy;
scanf("%d %d", &ux, &uy);
vector<pair<int,int>> trees;
for (int i = 0; i < n; ++i) {
int x, y;
scanf("%d %d", &x, &y);
trees.emplace_back(x-ux, y-uy);
}
int v = 0;
for (auto t1 : trees) {
bool s = true;
for (auto t2 : trees) {
int x1 = t1.first, y1 = t1.second, x2 = t2.first, y2 = t2.second;
if (x1 != x2 || y1 != y2) {
if (((x1 == x2) && (abs(y1) < abs(y2))) || ((y1 == y2) && (abs(x1) < abs(x2)))) {
s = false;
break;
}
if (((x1 < 0) == (x2 < 0)) && ((y1 < 0) == (y2 < 0))) {
if (((x1 - x2) < 0) == ((y1 - y2) < 0)) {
if (abs(x1) <= abs(x2)) {
if (((abs(x2) % abs(x1)) == 0) && ((abs(y2) % abs(y1)) == 0)) {
s = false;
break;
}
}
}
}
}
}
if (s) ++v;
}
printf("%d\n", v);
return 0;
}Test details
Test 1
Verdict: RUNTIME ERROR
| input |
|---|
| 152
391446 44026 391450 44026 391448 44028 391450 44028 ... |
| correct output |
|---|
| 117 |
| user output |
|---|
| (empty) |
Test 2
Verdict: RUNTIME ERROR
| input |
|---|
| 167
-395738 -130738 -395745 -130742 -395739 -130735 -395746 -130731 ... |
| correct output |
|---|
| 124 |
| user output |
|---|
| (empty) |
Test 3
Verdict: RUNTIME ERROR
| input |
|---|
| 183
200778 460834 200784 460841 200769 460836 200773 460830 ... |
| correct output |
|---|
| 132 |
| user output |
|---|
| (empty) |
Test 4
Verdict: RUNTIME ERROR
| input |
|---|
| 130
223758 419977 223753 419974 223762 419974 223759 419983 ... |
| correct output |
|---|
| 97 |
| user output |
|---|
| (empty) |
Test 5
Verdict: RUNTIME ERROR
| input |
|---|
| 168
375864 397759 375855 397764 375855 397757 375866 397758 ... |
| correct output |
|---|
| 124 |
| user output |
|---|
| (empty) |
Test 6
Verdict: RUNTIME ERROR
| input |
|---|
| 187
-23941 284266 -113941 -30734 -113941 689266 -203941 329266 ... |
| correct output |
|---|
| 134 |
| user output |
|---|
| (empty) |
Test 7
Verdict: RUNTIME ERROR
| input |
|---|
| 127
260079 -413943 440079 -53943 575079 36057 530079 -773943 ... |
| correct output |
|---|
| 98 |
| user output |
|---|
| (empty) |
Test 8
Verdict: RUNTIME ERROR
| input |
|---|
| 144
411083 460318 366083 145318 771083 865318 411083 685318 ... |
| correct output |
|---|
| 109 |
| user output |
|---|
| (empty) |
Test 9
Verdict: RUNTIME ERROR
| input |
|---|
| 135
-460235 328576 -145235 553576 -910235 688576 -280235 58576 ... |
| correct output |
|---|
| 98 |
| user output |
|---|
| (empty) |
Test 10
Verdict: RUNTIME ERROR
| input |
|---|
| 113
390086 -474936 -59914 -609936 480086 -879936 345086 -204936 ... |
| correct output |
|---|
| 86 |
| user output |
|---|
| (empty) |
Test 11
Verdict: RUNTIME ERROR
| input |
|---|
| 1921
221773 -175524 -75227 -72024 -75227 -72023 527773 -22524 ... |
| correct output |
|---|
| 1866 |
| user output |
|---|
| (empty) |
Test 12
Verdict: RUNTIME ERROR
| input |
|---|
| 1960
-166870 -301876 4130 -45376 4129 -45376 4130 -45377 ... |
| correct output |
|---|
| 1891 |
| user output |
|---|
| (empty) |
Test 13
Verdict: RUNTIME ERROR
| input |
|---|
| 1983
490468 217759 85468 357259 791968 631759 76468 150259 ... |
| correct output |
|---|
| 1917 |
| user output |
|---|
| (empty) |
Test 14
Verdict: RUNTIME ERROR
| input |
|---|
| 1910
75208 56523 340708 452523 340708 452522 -356792 430023 ... |
| correct output |
|---|
| 1863 |
| user output |
|---|
| (empty) |
Test 15
Verdict: RUNTIME ERROR
| input |
|---|
| 1984
-178901 -113059 -381401 12941 -381400 12941 -381401 12940 ... |
| correct output |
|---|
| 1932 |
| user output |
|---|
| (empty) |
Test 16
Verdict: WRONG ANSWER
| input |
|---|
| 2000
-318296 48998 -322618 47556 -335584 43230 -300516 32354 ... |
| correct output |
|---|
| 1794 |
| user output |
|---|
| 1148 |
Test 17
Verdict: RUNTIME ERROR
| input |
|---|
| 2000
-376251 158360 -373641 158980 -386177 169482 -387909 155698 ... |
| correct output |
|---|
| 1796 |
| user output |
|---|
| (empty) |
Test 18
Verdict: WRONG ANSWER
| input |
|---|
| 2000
4141 -447930 22987 -450556 22988 -450556 8931 -452688 ... |
| correct output |
|---|
| 1797 |
| user output |
|---|
| 1147 |
Test 19
Verdict: WRONG ANSWER
| input |
|---|
| 2000
-83018 -8575 -84778 -5615 -84778 -5616 -84778 -5614 ... |
| correct output |
|---|
| 1819 |
| user output |
|---|
| 1107 |
Test 20
Verdict: WRONG ANSWER
| input |
|---|
| 2000
-199417 -261684 -204449 -244760 -219545 -193988 -183653 -255010 ... |
| correct output |
|---|
| 1803 |
| user output |
|---|
| 1137 |
