Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
20680 王循 倒数和 C++ Wrong Answer 0 0 MS 252 KB 277 2021-06-19 19:44:59

Tests(0/10):


#include <bits/stdc++.h> using namespace std; int main() { int s; cin>>s; int i=0; while(++i) { double sum=0; for(int j=1;j<i;j++) { sum+=1.0/j; } // cout<<i-1<<' '<<sum<<endl; if(sum<s&&sum+1.0/i>s) { cout<<i-1<<endl; exit(0); } } }


Judgement Protocol: