#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; }
#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; }
Using your lizikid universal account