2 solutions

  • 1
    @ 2024-9-22 11:52:15
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n=1,m;
    	cin>>m;
    	double s=0;
    	while(s+1.0/n<m)
    	{
    		s+=1.0/n;
    		n++;	
    	}
    	cout<<n;
    	return 0;
    }
    
    • -2
      @ 2024-10-20 10:37:55

      • 1

      Information

      ID
      49
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      1
      Tags
      (None)
      # Submissions
      174
      Accepted
      57
      Uploaded By