Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
21334 汪天一 倒数和 C++ Accepted 100 42 MS 252 KB 198 2021-06-27 19:13:59

Tests(10/10):


#include<bits/stdc++.h> using namespace std; int s,n=1; double d1=1.5,d2=1; int main(){ cin>>s; while(!(d1>s&&d2<=s)){ n++; d1+=1.0/(n+1); d2+=1.0/n; } cout<<n+1; return 0; }


Judgement Protocol: