codeforces

https://codeforces.com/contest/1921 Dashboard - Codeforces Round 920 (Div. 3) - Codeforces codeforces.com A. Square 좌표 4개가 주어지고, 해당 좌표가 만드는 사각형의 넓이를 구하는 문제이다. 주어진 문제는 축에 평행하다는 조건이 있었는데, 이를 못보고 CCW 알고리즘을 이용하여 문제를 해결했다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #include #include using namespace std; int main(){ int t, x, y; cin >> t; while(t--){ pairdp[4]; for(int i=0; i> x >> y; dp[i]={x,y}; } cout ..
https://codeforces.com/contest/1920 Dashboard - Codeforces Round 919 (Div. 2) - Codeforces codeforces.com A - Satisfying Constraints 입력으로 a k 가 주어졌을 때, 아래 조건을 만족하는 k의 개수 구하는 문제 1 x: k >= x 2 x: k > n; while(n--){ cin >> a >> x; if(a==1) g=max(g,x); else if(a==2) l=min(l, x); else e.push_back(x); } ans=l-g+1; for(auto p : e) if(p>=g && p> k >> x; for(int i=0; i> dp[i]; res+=dp[i]; } sort(dp, dp+n..
sy46
'codeforces' 태그의 글 목록