4 solutions

  • 4
    @ 2024-7-9 20:32:12
    include <bits/stdc++.h>
    
    using namespace std;
    
    int main(){
    	int a = 1, n;
    	cin >> n;
    	for(int i = 0; i < n; i++){
    		a *= 2;
    	}	
    	cout << a;
    	return 0;
    } 
    
    • 2
      @ 2024-1-26 9:57:23
      #include<bits/stdc++.h>
      using namespace std;
      int n,x,y;
      int main(){
      	cin>>n>>x>>y;
      	int s=n;
      	s-=(y/x);
      	if(y%x) s--;
      	cout<<s<<endl;
      	return 0;
      }
      
      • 2
        @ 2023-10-29 14:23:52
        #include<iostream>
        #include<cmath>
        using namespace std;
        int main()
        {
         int n,x,y;
         cin>>n>>x>>y;//输入
         int s=floor(y/x);//向下取整
         cout<<n-s-1;//输出
         return 0;//完结散花
        }
        
        • 0
          @ 2023-9-17 10:41:22
          #include <iostream>
          using namespace std;
          int n,x,y;
          int main(){
          	cin>>n>>x>>y;
          	if(!y%x){
          		cout<<n-y/x<<endl;
          		return 0;
          	}
          	if(y%x){
          		double ans=(double)y/x*1.00;
          		ans=(int)ans;
          		cout<<n-ans-1<<endl;
          		return 0;
          	}
          } 
          
        • 1

        Information

        ID
        525
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        2
        Tags
        # Submissions
        76
        Accepted
        46
        Uploaded By