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