제출 #1285355

#제출 시각아이디문제언어결과실행 시간메모리
1285355kerem산악 구조대 (JOI13_mountain)C++20
0 / 100
4 ms348 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; void Rescue(int R, int C, int RS, int CS, int X){ int n=max(RS-1,R-RS),m=max(CS-1,C-CS); int l=0,r=n+m; while(l<r){ int mid=(l+r+1)/2; int x=RS+min(n,mid),y=CS+max(0,mid-n); if(x>R) x=RS-min(n,mid); if(y>C) y=CS-max(0,mid-n); if(Measure(x,y)<X) r=mid-1; else l=mid; } for(int i=1;i<=R;i++){ for(int j=1;j<=C;j++){ if(abs(i-RS)+abs(j-CS)==l || abs(i-RS)+abs(j-CS)==l+1){ if(Measure(i,j)==X){ Pinpoint(i,j); return; } } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...