Submission #71778

#TimeUsernameProblemLanguageResultExecution timeMemory
71778내일_개학이다_ㅠㅠ (#119)The Ant Doing Hard Work (FXCUP3_ant)C++98
100 / 100
3 ms360 KiB
/* #include<bits/stdc++.h> int x; int cnt = 0; int DeliverCount(int y){ cnt++; return y / x; } int FindK(); int main(){ scanf("%d", &x); if(FindK() == x){ printf("%d\n", cnt); } } */ #include "ant.h" int FindK(){ int rett = DeliverCount(66666666); int ss = 1, ee = 99999999, ans = 99999999; if(rett > 0){ ss = 66666666 / (rett+1) + 1; ee = 66666666 / rett; ans = ee; ee--; }else{ ss = 66666667; ee = 99999998; } while(ss <= ee){ int mid = (ss+ee)/2; int ret = DeliverCount(mid); if(ret > 0){ ans = mid; ee = mid - 1; }else{ ss = mid + 1; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...