2 solutions

  • 1
    @ 2025-11-1 15:59:56
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n;
    	cin>>n;
    	int c=0;
    	for(int i=1;i<=n;i++){
    		int s;
    		cin>>s;
    		bool st=false;
    		for(int a=1;a<=s;a++){
    			for(int b=1;b<=s;b++){
    				if(4*a*b+3*a+3*b==s){
    					st=true;
    				}
    			}
    		}
    		if(!st){
    			c++;
    		}
    	}
    	cout<<c; 
    	return 0;
    }
    
    
    • -5
      @ 2025-9-20 14:47:36
      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	int n;
      	cin>>n;
      	int c=0;
      	for(int i=1;i<=n;i++){
      		int s;
      		cin>>s;
      		bool st=false;
      		for(int a=1;a<=s;a++){
      			for(int b=1;b<=s;b++){
      				if(4*a*b+3*a+3*b==s){
      					st=true;
      				}
      			}
      		}
      		if(!st){
      			c++;
      		}
      	}
      	cout<<c; 
      	return 0;
      }
      
      • 1

      Information

      ID
      2636
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      1
      Tags
      # Submissions
      38
      Accepted
      17
      Uploaded By