| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 20968 | 梅煦洋 | 倒数和 | C++ | Time Limit Exceeded | 60 | 1000 MS | 252 KB | 294 | 2021-06-24 20:01:56 |
#include<bits/stdc++.h> using namespace std; double n,f=0.0,f2=0.0,x; int main(){ cin>>n; for(double i=2.0;;i+=1.0){ for(double j=1.0;j<=i;j+=1.0){ x=1.0/j; f2+=x; } f=f2-1.0/i; if(f<=n&&f2>n){ cout<<i<<endl; return 0; } f=0; f2=0; } return 0; }