# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
791411 | 2023-07-24T06:11:07 Z | Amylopectin | Roads (CEOI20_roads) | C++14 | 9 ms | 1108 KB |
#include <stdio.h> #include <iostream> #include <vector> #include <algorithm> using namespace std; const long long mxn = 1e6 + 10; struct we { long long xx,yy; double slo,soo; }; bool cmp(const struct we &l,const struct we &r) { return l.soo < r.soo; } struct we ta[mxn] = {}; int main() { long long i,j,n,m,cn,cm,fn,fm,f,sta = 0; double t,p; scanf("%lld",&n); for(i=0; i<n; i++) { scanf("%lld %lld %lld %lld",&cn,&cm,&fn,&fm); if(cn > fn) { f = cn; cn = fn; fn = f; f = cm; cm = fm; fm = f; } ta[i] = {cn,cm,0,0}; if(fn - cn == 0) { sta = 1; } else { t = fm - cm; p = fn - cn; ta[i].slo = t / p; } } if(sta == 1) { for(i=0; i<n; i++) { ta[i].soo = ta[i].xx; } } else { for(i=0; i<n; i++) { t = ta[i].xx; f = ta[i].yy; ta[i].soo = f - t * ta[i].slo; } } sort(ta,ta+n,cmp); printf("\n"); for(i=0; i<n-1; i++) { printf("%lld %lld %lld %lld\n",ta[i].xx,ta[i].yy,ta[i+1].xx,ta[i+1].yy); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Failed | 1 ms | 212 KB | Condition failed: "pf == Sline.end() || !Cross(S[*pa], S[*pf])" |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Failed | 9 ms | 1108 KB | Condition failed: "!Cross(S[*pi], S[*pa])" |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Failed | 7 ms | 1012 KB | Condition failed: "!Cross(S[*pi], S[*pa])" |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Failed | 7 ms | 980 KB | Condition failed: "!Cross(S[*pi], S[*pa])" |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Failed | 0 ms | 212 KB | Condition failed: "pf == Sline.end() || !Cross(S[*pa], S[*pf])" |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Failed | 1 ms | 308 KB | Condition failed: "pf == Sline.end() || !Cross(S[*pa], S[*pf])" |
2 | Halted | 0 ms | 0 KB | - |