2 solutions

  • 1
    @ 2025-8-18 13:52:01
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n,m=0;
    	cin>>n;
    	for(int i=n;i>=1;i--){
    		for(int j=i;j<=n;j++){
    			if(i*j%2==0){
    				m++;
    			}
    		}
    	}
    	cout<<m;
    	return 0;
    }
    
    
    
    • 0
      @ 2025-8-15 15:06:36
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	int n,m=0;
      	cin>>n;
      	for(int i=1;i<=n;i++){
      		for(int j=i;j<=n;j++){
      			if(i*j%2==0){
      				m++;
      			}
      		}
      	}
      	cout<<m;
      	return 0;
      }
      
      
      
      • 1

      Information

      ID
      2805
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      8
      Tags
      # Submissions
      18
      Accepted
      6
      Uploaded By