Submission #782022

# Submission time Handle Problem Language Result Execution time Memory
782022 2023-07-13T14:48:15 Z Andrey Binary Subsequences (info1cup17_binary) C++14
12.9 / 100
900 ms 312 KB
#include <bits/stdc++.h>
using namespace std;

void solve() {
    int k,ans = 0,a = 0,b = 0;
    cin >> k;
    for(int i = 0; i <= k; i++) {
        a = i;
        b = k-i;
        while(a != b) {
            if(a < b) {
                swap(a,b);
            }
            a-=b+1;
        }
        if(a == 0 && b == 0) {
            ans++;
        }
    }
    cout << ans << "\n" << -1 << "\n";
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Partially correct 122 ms 312 KB Output is partially correct
# Verdict Execution time Memory Grader output
1 Incorrect 53 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1080 ms 212 KB Time limit exceeded
2 Halted 0 ms 0 KB -