From 9bf0a52d7abb330c411fad6274ff971a5a945a6e Mon Sep 17 00:00:00 2001 From: oncsr Date: Fri, 21 Mar 2025 10:11:27 +0900 Subject: [PATCH] =?UTF-8?q?[20250321]=20BOJ=20/=20G4=20/=20Jigsaw=20of=20S?= =?UTF-8?q?hadows=20/=20=EA=B6=8C=ED=98=81=EC=A4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../202503/21 BOJ G4 Jigsaw of Shadows.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 khj20006/202503/21 BOJ G4 Jigsaw of Shadows.md diff --git a/khj20006/202503/21 BOJ G4 Jigsaw of Shadows.md b/khj20006/202503/21 BOJ G4 Jigsaw of Shadows.md new file mode 100644 index 00000000..b48377d4 --- /dev/null +++ b/khj20006/202503/21 BOJ G4 Jigsaw of Shadows.md @@ -0,0 +1,31 @@ +```cpp + +#include +using namespace std; + +using ld = long double; + +int main(){ + cin.tie(0)->sync_with_stdio(0); + + int theta, N; + cin>>theta>>N; + vector> A(N); + for(auto &[x,h]:A) cin>>x>>h; + sort(A.begin(), A.end()); + + ld t = tan(M_PI * theta / 180.); + ld ans = 0, last = -1; + for(int i=0;i pos+x) continue; + if(last > x) ans += pos+x-last; + else ans += pos; + last = pos+x; + } + cout<