| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 82246 | tjdgus4384 | 공룡 발자국 (KOI18_footprint) | C++14 | 4 ms | 576 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
vector<pair<int, int> > v;
int x[3000], y[3000];
bool cmp(pair<int, int> a, pair<int, int> b)
{
if(a.second == 0) return true;
if(b.second == 0) return false;
return a.first * b.second - a.second * b.first > 0;
}
int main()
{
int n, j, m = 1000000000;
scanf("%d", &n);
for(int i = 0;i < n;i++)
{
scanf("%d %d", &x[i], &y[i]);
if(y[i] < m) {m = y[i];j = i;}
}
for(int i = 0;i < n;i++)
{
v.push_back({x[i] - x[j], y[i] - y[j]});
}
sort(v.begin(), v.end(), cmp);
for(int i = 0;i < n;i++)
{
printf("%d %d\n", v[i].first + x[j], v[i].second + y[j]);
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
