Submission #389467

# Submission time Handle Problem Language Result Execution time Memory
389467 2021-04-14T06:27:50 Z balbit Binary Subsequences (info1cup17_binary) C++14
12.9 / 100
707 ms 312 KB
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
//#ifndef BALBIT
//#include "grader.h"
//#endif

using namespace std;

#define ll long long
#define pii pair<int, int>
#define f first
#define s second

#define REP(i,n) for (int i = 0; i<n; ++i)
#define REP1(i,n) for (int i = 1; i<=n; ++i)
#define SZ(x) (int)((x).size())
#define ALL(x) (x).begin(), (x).end()
#define pb push_back

#ifdef BALBIT
#define bug(...) cerr<<"#"<<__LINE__<<": "<<#__VA_ARGS__<<"- ", _do(__VA_ARGS__)
template<typename T> void _do(T && x) {cerr<<x<<endl;}
template<typename T, typename ...S> void _do(T && x, S && ...y) {cerr<<x<<", "; _do(y...);}
#else
#define bug(...)
#define endl '\n'
#endif // BALBITs

bool yes(int a, int b) {
    if (a==b) return a==0;
    if (a < b) swap(a,b);
    a %= (b+1);
    return yes(a,b);
}

signed main(){
    ios::sync_with_stdio(0), cin.tie(0);
    int t; cin>>t;
    while (t--) {
        int n; cin>>n;
        int re = 0;
        for (int i = 0; i<=n; ++i) {
            if (yes(i, n-i)) ++re;
        }
        cout<<re<<endl;
        cout<<-1<<endl;
    }
}

# Verdict Execution time Memory Grader output
1 Partially correct 75 ms 312 KB Output is partially correct
# Verdict Execution time Memory Grader output
1 Incorrect 31 ms 308 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 707 ms 296 KB Output isn't correct
2 Halted 0 ms 0 KB -