2 条题解

  • 1
    @ 2025-2-22 20:43:40
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	double m,s=0;
    	int i=1;
    	cin>>m;
    	while(s<m)
    	{
    		s+=1.0/i;
    		i++;
    	}
    	cout<<i-1;
    	return 0;
    }
    
    • 0
      @ 2025-8-20 9:40:23
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	double m,s=0;
      	int i=1;
      	cin>>m;
      	while(s<m)
      	{
      		s+=1.0/i;
      		i++;
      	}
      	cout<<i-1;
      	return 0;
      }
      
      
      
      • 1

      信息

      ID
      71
      时间
      1000ms
      内存
      64MiB
      难度
      4
      标签
      递交数
      38
      已通过
      20
      上传者