3 solutions

  • 0
    @ 2026-8-6 19:59:56
    #include<bits/stdc++.h>
    using namespace std;
    int n,s,cnt;
    bool st[1010];
    int main()
    {
    	cin>>n;
    	for(int i=1;i<=1000;i++)
    	{
    		for(int j=1;4*i*j+3*i+3*j<=1000;j++)
    		{
    			st[4*i*j+3*i+3*j]=true;
    		}
    	}
    	while(n--)
    	{
    		cin>>s;
    		if(!st[s])
    		{
    			cnt++;
    		}
    	}
    	cout<<cnt;
    	return 0;
    }
    

    Information

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