# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
82250 | 2018-10-29T15:42:53 Z | tjdgus4384 | None (KOI18_footprint) | C++14 | 5 ms | 1460 KB |
#include<cstdio> #include<vector> #include<algorithm> using namespace std; typedef long long ll; vector<pair<ll, ll> > v; ll x[3000], y[3000]; bool cmp(pair<ll, ll> a, pair<ll, ll> b) { return a.first * b.second - a.second * b.first > 0; } int main() { int n, j; ll m = 1000000000; scanf("%d", &n); for(int i = 0;i < n;i++) { scanf("%lld %lld", &x[i], &y[i]); if(y[i] < m) {m = y[i];j = i;} } for(int i = 0;i < n;i++) { if(i == j) continue; v.push_back({x[i] - x[j], y[i] - y[j]}); } sort(v.begin(), v.end(), cmp); printf("%d\n", n); printf("%lld %lld\n", x[j], y[j]); for(int i = 0;i < v.size();i++) { printf("%lld %lld\n", v[i].first + x[j], v[i].second + y[j]); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 504 KB | Output is correct |
2 | Correct | 4 ms | 768 KB | Output is correct |
3 | Correct | 4 ms | 768 KB | Output is correct |
4 | Correct | 4 ms | 768 KB | Output is correct |
5 | Correct | 4 ms | 768 KB | Output is correct |
6 | Correct | 4 ms | 1068 KB | Output is correct |
7 | Correct | 4 ms | 1068 KB | Output is correct |
8 | Correct | 4 ms | 1132 KB | Output is correct |
9 | Correct | 5 ms | 1148 KB | Output is correct |
10 | Correct | 4 ms | 1200 KB | Output is correct |
11 | Correct | 5 ms | 1252 KB | Output is correct |
12 | Correct | 4 ms | 1304 KB | Output is correct |
13 | Correct | 5 ms | 1360 KB | Output is correct |
14 | Correct | 4 ms | 1408 KB | Output is correct |
15 | Correct | 4 ms | 1460 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1460 KB | Output is correct |
2 | Correct | 2 ms | 1460 KB | Output is correct |
3 | Correct | 2 ms | 1460 KB | Output is correct |
4 | Incorrect | 2 ms | 1460 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1460 KB | Output is correct |
2 | Correct | 2 ms | 1460 KB | Output is correct |
3 | Correct | 2 ms | 1460 KB | Output is correct |
4 | Incorrect | 2 ms | 1460 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 504 KB | Output is correct |
2 | Correct | 4 ms | 768 KB | Output is correct |
3 | Correct | 4 ms | 768 KB | Output is correct |
4 | Correct | 4 ms | 768 KB | Output is correct |
5 | Correct | 4 ms | 768 KB | Output is correct |
6 | Correct | 4 ms | 1068 KB | Output is correct |
7 | Correct | 4 ms | 1068 KB | Output is correct |
8 | Correct | 4 ms | 1132 KB | Output is correct |
9 | Correct | 5 ms | 1148 KB | Output is correct |
10 | Correct | 4 ms | 1200 KB | Output is correct |
11 | Correct | 5 ms | 1252 KB | Output is correct |
12 | Correct | 4 ms | 1304 KB | Output is correct |
13 | Correct | 5 ms | 1360 KB | Output is correct |
14 | Correct | 4 ms | 1408 KB | Output is correct |
15 | Correct | 4 ms | 1460 KB | Output is correct |
16 | Correct | 3 ms | 1460 KB | Output is correct |
17 | Correct | 2 ms | 1460 KB | Output is correct |
18 | Correct | 2 ms | 1460 KB | Output is correct |
19 | Incorrect | 2 ms | 1460 KB | Output isn't correct |
20 | Halted | 0 ms | 0 KB | - |