3 solutions

  • 6
    @ 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;
    }
    
    • 1
      @ 2025-11-26 21:17:25

      • -6
        @ 2024-10-20 10:37:55

        • 1

        Information

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