# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
227474 | 2020-04-27T14:09:38 Z | cgiosy | 곡선 자르기 (KOI17_cut) | C++17 | 5 ms | 384 KB |
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); int N, sx, sy, px, py, qx; cin>>N>>sx>>sy; px=qx=sx, py=sy; set<int> A; for(int i=N; i--;) { int x, y; if(i) cin>>x>>y; else x=sx, y=sy; if((y>0)!=(py>0) || !i && py>0) { if((i ? y<0 : y>0) && qx!=x) { A.insert(min(qx, x)*2); A.insert(max(qx, x)*2+1); } qx=x; } px=x, py=y; } int a=0, b=0, c=0, p=0; for(int x:A) { if(x%2) a+=!--c, b+=!p, p=1; else c++, p=0; } cout<<a<<' '<<b; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 5 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Incorrect | 5 ms | 384 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 5 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Incorrect | 5 ms | 384 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 5 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Incorrect | 5 ms | 384 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |