| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 781803 | Trunkty | Binary Subsequences (info1cup17_binary) | C++14 | 740 ms | 360 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
int t;
int curr;
vector<int> v;
bool check(int a, int b, bool c){
    if(a>b){
        swap(a,b);
    }
    if(a==b){
        if(a==0){
            return true;
        }
        else{
            return false;
        }
    }
    else{
        int p = b/(a+1);
        if(c){
            v.push_back(p);
        }
        curr += p;
        b -= p*(a+1);
        return check(b,a,c);
    }
}
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> t;
    for(int i=1;i<=t;i++){
        int n;
        cin >> n;
        int ans=0,mini=2e9,pos;
        for(int i=0;i<=n;i++){
            curr = 0;
            if(check(i,n-i,false)){
                ans++;
                if(curr<mini){
                    mini = curr;
                    pos = i;
                }
            }
        }
        cout << ans << "\n";
        v.clear();
        check(pos,n-pos,true);
        reverse(v.begin(),v.end());
        for(int i=0;i<v.size();i++){
            for(int j=1;j<=v[i];j++){
                cout << i%2 << " ";
            }
        }
        cout << "\n";
    }
    return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
