Problem:
問題 4
IOI 不動産ではマンションの賃貸を行なっている．
この会社が取り扱うマンションの部屋は 1LDK で，
下図のように面積が 2xy+x+y になっている．
ただし， x, y は正整数である．
IOI 不動産のカタログにはマンションの面積が昇順に（狭いものから順番に）書かれているが，この中にいくつか間違い（ありえない面積のもの）が混じっていることがわかった．
カタログ（入力ファイル）は N+1 行で，最初の行に部屋数が書かれていて，
続く N 行に，１行に１部屋ずつ面積が昇順に書かれている．
ただし，
部屋数は 100,000 以下，
面積は (2の31乗)-1 = 2,147,483,647 以下である．
５つの入力データのうち３つまでは，
部屋数 1000 以下，面積 30000 以下である．
間違っている行数（ありえない部屋の数）を出力しなさい．
出力ファイルにおいては，
出力の最後の行にも改行コードを入れること．
入出力例
入力例
10
4
7
9
10
12
13
16
17
19
20
出力例
2
問題文と自動審判に使われるデータは、
情報オリンピック日本委員会
が作成し公開している問題文と採点用テストデータです。

Submitted solutions:

code_snippet: #include <bits/stdc++.h>

using namespace std;

void Freopen () {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

int main() {
    long long n;
    cin >> n;
    long long cnt = 0;
    for (int i = 1; i <= n; i++) {
        long long a;
        cin >> a;
        long long x = 1;
        while (2 * x * x + 2 * x <= a) {
            if ((a - x) % (2 * x + 1) == 0) {
                cnt++;
                break;
            }
            x++;
        }
    }
    cout << n - cnt << "\n";
    return 0;
}
accuracy: 1
time_ms: 130
memory_kb: 3436
final_rank: 10

code_snippet: #include<bits/stdc++.h> 
using namespace std;

using ll=long long;

int main(){
	
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int cnt=0;
	int N;
	cin>>N;
	for(int i=0;i<N;i++){
		ll C;
		cin>>C;
		C*=2;
		C++;
		bool EG=0;
		for(ll x=1;(2*x+1)*(2*x+1)<=C;x++){
			if(C%(2*x+1)==0){
				ll y2=C/(2*x+1);
				if(y2%2==1&&y2>1){
					EG=1;
					break;
				}
			}
		}
		if(!EG){
			cnt++;
		}
	}
	cout<<cnt<<endl;

}
accuracy: 1
time_ms: 40
memory_kb: 3584
final_rank: 17

code_snippet: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,l,r) for(ll i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(A) A.begin(),A.end()
int main(){
    int N;cin>>N;
    int ans=0;
    while(N--){
        ll x;cin>>x;
        x+=x+1;
        {
            ans++;
            ll d=2;
            while(d*d<=x){
                if(x%d==0){ans--;break;}
                d++;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}
accuracy: 1
time_ms: 240
memory_kb: 3432
final_rank: 13

code_snippet: #include <bits/stdc++.h>

using namespace std;

void Freopen () {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

int main() {
    long long n;
    cin >> n;
    long long cnt = 0;
    for (int i = 1; i <= n; i++) {
        long long a;
        cin >> a;
        long long x = 1;
        while (2 * x * x + 2 * x <= a) {
            if ((a - x) % (2 * x + 1) == 0) {
                cnt++;
                break;
            }
            x++;
        }
    }
    cout << n - cnt << "\n";
    return 0;
}
accuracy: 1
time_ms: 130
memory_kb: 3484
final_rank: 16

code_snippet: #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}
inline double time() {
    return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}

namespace factrize {
    using u64 = uint64_t;
    using u128 = __uint128_t;

    u128 pow (u128 a, u64 n, u128 mod) {
        u128 res = 1;
        if (a >= mod) a %= mod;
        while (n > 0) {
            if (n & 1) {
                res *= a;
                res %= mod;
            }
            a *= a;
            a %= mod;
            n >>= 1;
        }
        return res;
    }

    bool miller_rabin (u64 n, vector<u64> v) {
        u64 d = n-1;
        while (~d & 1) d >>= 1;
        for (u64 a : v) {
            if (n <= a) break;
            u64 t = d;
            u128 y = pow(a, t, n);
            while (t != n-1 and y != 1 and y != n-1) {
                y *= y; if (y >= n) y %= n;
                t *= 2;
            }
            if (y != n-1 and t%2 == 0) return false;
        }
        return true;
    }

    bool is_prime (u64 n) {
        if (n <= 1) return false;
        if (~n & 1) return n == 2;
        if (n < (1LL << 30)) {
            return miller_rabin(n, {2, 7, 61});
        }
        else {
            return miller_rabin(n, {2, 325, 9375, 28178, 450775, 9780504, 1795265022});
        }
    }
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    // 2xy + x + y = n
    int q; cin >> q;
    int res = 0;
    while (q--) {
        ll n; cin >> n;
        if (factrize::is_prime(2*n+1)) res++;
    }
    cout << res << endl;
}
accuracy: 1
time_ms: 20
memory_kb: 3452
final_rank: 12

code_snippet: #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}
inline double time() {
    return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}


int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    // 2xy + x + y = n
    int q; cin >> q;
    int res = 0;
    while (q--) {
        ll n; cin >> n;
        res++;
        for (ll x = 1; 2*x*x <= n; x++) {
            // (2x+1) * y = (n-x)
            if ((n-x) % (2*x+1) == 0) {
                res--; break;
            }
        }
    }
    cout << res << endl;
}
accuracy: 1
time_ms: 120
memory_kb: 3380
final_rank: 7

code_snippet: #include <iostream> 
#include <cmath>
#include <utility>

using namespace std;

bool f(long area){
    long num=2*area+1;
    long sq=ceil(sqrt(num));
    for (int i=3; i<=sq; i+=2){
        if(num%i==0)return true;
    }
    return false;
}

int main(){
    int n;
    cin>>n;
    int res=0;
    int num;
    for(int i=0; i<n; i++){
        cin>>num;
        if(!f(num))res++;
    }cout<<res<<endl;
}
accuracy: 1
time_ms: 150
memory_kb: 3112
final_rank: 2

code_snippet: #include <bits/stdc++.h>
using namespace std;

#ifdef _RUTHEN
#include "debug.hpp"
#else
#define show(...) true
#endif

using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
template <class T> using V = vector<T>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    const ll M = 46000;
    int N;
    cin >> N;
    int ans = 0;
    rep(i, N) {
        ll v;
        cin >> v;
        ll ub = min(M, v);
        int ok = 1;
        for (ll x = 1; x <= M; x++) {
            if (2 * x + 1 + x > v) break;
            if (x == v % (2 * x + 1)) {
                ok = 0;
                break;
            }
        }
        ans += ok;
    }
    cout << ans << '\n';
    return 0;
}
accuracy: 1
time_ms: 120
memory_kb: 3372
final_rank: 6

code_snippet: #include "bits/stdc++.h"

#define REP(i,num) for(ll i=0;i<(num);++i)
#define FOR(i,c,num) for(ll (i)=(c);(i)<(num);++(i))
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=ll>
T in(){ T x; cin >> x; return (x); }
template<typename T=ll,typename C=vector<T>>
C vecin(int N){ C x(N);REP(i,N){ x[i]=in<T>(); }return x; }
template<typename T=ll,size_t N>
array<T,N> arrin(){array<T,N> x;REP(i,N){ x[i]=in<T>(); }return x;}

void vout(){ cout << endl; }
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){ cout << ' ' << h;vout(forward<Tail>(t)...); }
void out(){ cout << endl; }
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){ cout << h;vout(forward<Tail>(t)...); }

template<typename T>
bool chmax(T& a,T b){ if(a<b){ a=b;return true; }return false; }
template<typename T>
bool chmin(T& a,T b){ if(a>b){ a=b;return true; }return false; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	ll N=in();
	ll S=0;
	LOOP(N){
		ll A=in();
		bool exist=false;
		REP(i,65536){
			ll B=2*(i+1)*(i+2);
			ll C=A-B;
			if(C<0){
				break;
			}
			ll M=2*(i+1)+1;
			if(!(C%M)){
				exist=true;
				break;
			}
		}
		if(!exist) S++;
	}
	out(S);
	return 0;
}
accuracy: 1
time_ms: 130
memory_kb: 3448
final_rank: 14

code_snippet: #include "bits/stdc++.h"

#define REP(i,num) for(ll i=0;i<(num);++i)
#define FOR(i,c,num) for(ll (i)=(c);(i)<(num);++(i))
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=ll>
T in(){ T x; cin >> x; return (x); }
template<typename T=ll,typename C=vector<T>>
C vecin(int N){ C x(N);REP(i,N){ x[i]=in<T>(); }return x; }
template<typename T=ll,size_t N>
array<T,N> arrin(){array<T,N> x;REP(i,N){ x[i]=in<T>(); }return x;}

void vout(){ cout << endl; }
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){ cout << ' ' << h;vout(forward<Tail>(t)...); }
void out(){ cout << endl; }
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){ cout << h;vout(forward<Tail>(t)...); }

template<typename T>
bool chmax(T& a,T b){ if(a<b){ a=b;return true; }return false; }
template<typename T>
bool chmin(T& a,T b){ if(a>b){ a=b;return true; }return false; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	ll N=in();
	ll S=0;
	REP(i,N){
		ll A=in();
		bool exist=false;
		REP(i,65536){
			ll B=2*(i+1)*(i+2);
			ll C=A-B;
			if(C<0){
				break;
			}
			ll M=2*(i+1)+1;
			if(!(C%M)){
				exist=true;
				break;
			}
		}
		if(!exist) S++;
	}
	out(S);
	return 0;
}
accuracy: 1
time_ms: 130
memory_kb: 3304
final_rank: 5

code_snippet: #include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define drep(i,j,n) for(int i=0;i<(int)(n-1);i++)for(int j=i+1;j<(int)(n);j++)
#define trep(i,j,k,n) for(int i=0;i<(int)(n-2);i++)for(int j=i+1;j<(int)(n-1);j++)for(int k=j+1;k<(int)(n);k++)
#define codefor int test;scanf("%d",&test);while(test--)
#define INT(...) int __VA_ARGS__;in(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;in(__VA_ARGS__)
#define yes(ans) if(ans)printf("yes\n");else printf("no\n")
#define Yes(ans) if(ans)printf("Yes\n");else printf("No\n")
#define YES(ans) if(ans)printf("YES\n");else printf("NO\n")
#define popcount(v) __builtin_popcount(v)
#define vector2d(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define vector3d(type,name,h,w,...) vector<vector<vector<type>>>name(h,vector<vector<type>>(w,vector<type>(__VA_ARGS__)))
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
template<class T> using rpriority_queue = priority_queue<T, vector<T>, greater<T>>;
const int MOD=1000000007;
const int MOD2=998244353;
const int INF=1<<30;
const ll INF2=(ll)1<<60;
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T,class L>void scan(pair<T, L>& p){scan(p.first);scan(p.second);}
template<class T,class U,class V>void scan(tuple<T,U,V>& p){scan(get<0>(p));scan(get<1>(p));scan(get<2>(p));}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
void print(const int& a){printf("%d",a);}
void print(const long long& a){printf("%lld",a);}
void print(const double& a){printf("%.15lf",a);}
template<class T,class L>void print(const pair<T, L>& p){print(p.first);putchar(' ');print(p.second);}
template<class T> void print(const T& a){cout<<a;}
template<class T> void print(const vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(const T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(const Head& head,const Tail&... tail){print(head);putchar(' ');out(tail...);}
template<class T> void dprint(const T& a){cerr<<a;}
template<class T> void dprint(const vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(const T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(const Head& head, const Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}
ll intpow(ll a, ll b){ ll ans = 1; while(b){ if(b & 1) ans *= a; a *= a; b /= 2; } return ans; }
ll modpow(ll a, ll b, ll p){ ll ans = 1; while(b){ if(b & 1) (ans *= a) %= p; (a *= a) %= p; b /= 2; } return ans; }
ll modinv(ll a, ll m) {ll b = m, u = 1, v = 0;while (b) {ll t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}
ll updivide(ll a,ll b){if(a%b==0) return a/b;else return (a/b)+1;}
template<class T> void chmax(T &a,const T b){if(b>a)a=b;}
template<class T> void chmin(T &a,const T b){if(b<a)a=b;}

int main(){
    int ans=0;
    codefor{
        LL(n);
        bool h=false;
        for(ll i=1;i*i<=n;i++){
            if((n-i)%(2*i+1)==0){
                h=true;
                break;
            }
        }
        if(!h)ans++;
    }
    out(ans);
}
accuracy: 1
time_ms: 120
memory_kb: 3608
final_rank: 19

code_snippet: #include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(), (x).end()

using ll = long long;
using i128 = __int128;

ll mul(ll x, ll y, ll m) { return (i128)x * y % m; }
ll modpow(ll x, ll y, ll m) {
	ll ret = 1, t = x % m;
	while (y) {
		if (y & 1) ret = mul(ret, t, m);
		t = mul(t, t, m);
		y >>= 1;
	}
	return ret;
}

bool miller_rabin(ll x, ll a) {
	if (x % a == 0) return false;
	ll d = x - 1; int cnt = -1;
	while (!(d & 1)) {
		d >>= 1;
		cnt++;
	}
	ll p = modpow(a, d, x);
	if (p == 1 || p == x - 1) return false;
	while (cnt--) {
		p = mul(p, p, x);
		if (p == x - 1) return false;
	}
	return true;
}

bool is_prime(ll x) {
	for (auto& i : { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37 }) {
		if (x == i) return true;
		if (x > 40 && miller_rabin(x, i)) return false;
	}
	return x > 40;
}

int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(0);

	int n; cin >> n;
	int cnt = 0;
	while (n--) {
		ll a; cin >> a;
		if (is_prime(2 * a + 1)) cnt++;
	}
	cout << cnt << '\n';
	return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3448
final_rank: 11

code_snippet: #include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(), (x).end()

using ull = unsigned long long;
using i128 = __int128;

ull mul(ull x, ull y, ull m) { return (i128)x * y % m; }
ull modpow(ull x, ull y, ull m) {
	ull ret = 1, t = x % m;
	while (y) {
		if (y & 1) ret = mul(ret, t, m);
		t = mul(t, t, m);
		y >>= 1;
	}
	return ret;
}

bool miller_rabin(ull x, ull a) {
	if (x % a == 0) return false;
	ull d = x - 1;
	while (true) {
		ull t = modpow(a, d, x);
		if (d & 1) return t != 1 && t != x - 1;
		else if (t == x - 1) return false;
		d >>= 1;
	}
}

bool is_prime(ull x) {
	for (auto& i : { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37 }) {
		if (x == i) return true;
		if (x > 40 && miller_rabin(x, i)) return false;
	}
	return x > 40;
}

int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(0);

	int n; cin >> n;
	int cnt = 0;
	while (n--) {
		ull a; cin >> a;
		if (is_prime(2 * a + 1)) cnt++;
	}
	cout << cnt << '\n';
	return 0;
}
accuracy: 1
time_ms: 50
memory_kb: 3408
final_rank: 8

code_snippet: #include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(), (x).end()

using ll = long long;
using i128 = __int128;

ll mul(ll x, ll y, ll m) { return (i128)x * y % m; }
ll modpow(ll x, ll y, ll m) {
	ll ret = 1, t = x % m;
	while (y) {
		if (y & 1) ret = mul(ret, t, m);
		t = mul(t, t, m);
		y >>= 1;
	}
	return ret;
}

bool miller_rabin(ll x, ll a) {
	if (x % a == 0) return false;
	ll d = x - 1;
	while (true) {
		ll t = modpow(a, d, x);
		if (d & 1) return t != 1 && t != x - 1;
		else if (t == x - 1) return false;
		d >>= 1;
	}
}

bool is_prime(ll x) {
	for (auto& i : { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37 }) {
		if (x == i) return true;
		if (x > 40 && miller_rabin(x, i)) return false;
	}
	return x > 40;
}

int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(0);

	int n; cin >> n;
	int cnt = 0;
	while (n--) {
		ll a; cin >> a;
		if (is_prime(2 * a + 1)) cnt++;
	}
	cout << cnt << '\n';
	return 0;
}
accuracy: 1
time_ms: 50
memory_kb: 3444
final_rank: 9

code_snippet: //2xy+x+y=S
//(2x+1)(y+1/2)=S+1/2
//(2x+1)(2y+1)=2S+1

#include <iostream>
#include <cmath>
using namespace std;

int main(void){
  long retval = 0;
  long N;
  cin>>N;
  for(long i=0;i<N;i++){
    long long area;
    cin>>area;
    area = 2*area+1;
    bool able = false;
    for(long long i=3;i<min((long long)65570,area);i+=2){
      if(area%i==0){
        able = true;
        break;
      }
    }
    if(able==false){
      retval++;
    }
  }
  cout<<retval<<endl;

  return 0;
}
accuracy: 1
time_ms: 150
memory_kb: 3116
final_rank: 3

code_snippet: #include<iostream>
#include<cmath>

using namespace std;

#define Long long long

int main()
{
	int N;
	cin >> N;
	int s;
	int ans = N;
	for (int i = 0; i < N; i++)
	{
		cin >> s;
		int bound = sqrt(s);
		for (int x = 1; x <= bound; x++)
		{
			if ((s - x) % (1 + 2 * x) == 0)
			{
				ans--;
				break;
			}
		}
	}
	cout << ans << endl;
	cin >> N;
}
accuracy: 1
time_ms: 60
memory_kb: 3096
final_rank: 1

code_snippet: #include<iostream>

using namespace std;

#define Long long long

int main()
{
	int N;
	cin >> N;
	int s;
	int ans = N;
	for (int i = 0; i < N; i++)
	{
		cin >> s;
		int MAX = (s - 1) / 3;
		int bound = MAX / 2 + 1;
		for (int x = 1; x <= bound; x++)
		{
			if ((s - x) % (1 + 2 * x) == 0)
			{
				ans--;
				break;
			}
		}
	}
	cout << ans << endl;
}
accuracy: 1
time_ms: 5380
memory_kb: 3068
final_rank: 18

code_snippet: #include<bits/stdc++.h>
using namespace std;
typedef long long llong;

signed main() {
    int n; cin >> n;
    int errors = 0;
    for(int i=0; i<n; i++) {
        llong area; cin >> area;
        if(area < 4) {
            errors++;
            continue;
        }
        if(area % 3 == 1) continue;
        bool flg = false;
        for(llong x=2; x*x<=area; x++) {
            llong left = 1LL;
            llong right = area;
            while(left <= right) {
                llong y = (left + right) / 2;
                llong act = 2*x*y+x+y;
                if(act == area) {
                    flg = true;
                    break;
                } else if(act < area) {
                    left = y+1;
                } else {
                    right = y-1;
                }
            }
            if(flg) break;
        }
        if(!flg) errors++;
    }
    cout << errors << endl;
}
accuracy: 1
time_ms: 1400
memory_kb: 3332
final_rank: 15

code_snippet: #include<iostream>
using namespace std;
int n;
main(){
	cin>>n;int cnt=0;
	for(;n--;){
		long long a;cin>>a;bool ok=0;
		for(long long x=1;x*(x+1)*2<=a;x++){
			if((a-x)%(2*x+1)<1){
				ok=1;break;
			}
		}if(!ok)cnt++;
	}cout<<cnt<<endl;
}
accuracy: 1
time_ms: 160
memory_kb: 3120
final_rank: 4

code_snippet: #include <iostream>

using lint = long long;

void solve() {
    int cnt = 0;

    int n;
    std::cin >> n;
    while (n--) {
        lint s;
        std::cin >> s;
        s = s * 2 + 1;

        bool judge = false;
        for (lint p = 3; p * p <= s; p += 2) {
            if (s % p == 0) judge = true;
        }

        if (!judge) ++cnt;
    }

    std::cout << cnt << "\n";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}
accuracy: 1
time_ms: 5060
memory_kb: 3176
final_rank: 20