# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
119499 | tmwilliamlin168 | Printed Circuit Board (CEOI12_circuit) | C++14 | 41 ms | 5880 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mxN=2e5;
int n, l, r;
ll x[mxN+1], y[mxN+1];
vector<int> v, s;
ll cp(int a, int b, int c) {
return (y[c]-y[a])*(x[b]-x[a])-(y[b]-y[a])*(x[c]-x[a]);
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
while(n<3);
for(int i=0; i<n; ++i) {
cin >> x[i] >> y[i];
if(!i||cp(n, l, i)>0||!cp(n, l, i)&&x[i]<x[l])
l=i;
if(!i||cp(n, r, i)<0||!cp(n, r, i)&&x[i]<x[r])
r=i;
}
cout << s.size() << "\n";
sort(s.begin(), s.end());
for(int a : s)
cout << a+1 << " ";
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |