为什么TLE0分时间6000ms

P1035 [NOIP2002 普及组] 级数求和

juruojjl_ @ 2018-12-22 21:09:10

include<iostream>

using namespace std; int main() { int k,n=1; double s; cin>>k; while(s<k) { s+=1/n; n++; } cout<<n; return 0; }


by BCZSX @ 2018-12-22 21:14:11

1/n要改成1/(double)n


by Ex90r @ 2019-01-18 18:32:54

希望更丰富的展现?使用Markdown


by Ex90r @ 2019-01-18 18:34:43

戳这里


by superB @ 2019-02-02 09:24:22

我的也是,什么问题??


|