Submission #373974


Source Code Expand

#include<vector>
#include<map>
#include<climits>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<bitset>
#include<cstring>
#include<list>
#include<ctime>
#include<iterator>
using namespace std;
typedef vector<string>vs;
typedef vector<int>vi;
typedef vector<vi>vvi;
typedef vector<double>vd;
typedef pair<int,int>pii;
typedef long long ll;
typedef pair<ll,ll>pll;
typedef vector<ll>vl;
#define rrep(i,x,n) for(int i=(x);i<(n);++i)
#define rep(i,x) rrep(i,0,(x))
#define fi first
#define se second
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define maxs(a,b) (a)=max(a,b)
#define mins(a,b) (a)=min(a,b)

bool used[1000001];
int main(){
    int a,b,x;cin>>a>>b>>x;
    rep(i,1000010){
        if(used[a]){
            cout<<-1<<endl;
            return 0;
        }
        used[a]=true;
        if(a==x){
            cout<<i<<endl;
            return 0;
        }
        a=(a/2)^((a%2)*b);
    }
}

Submission Info

Submission Time
Task K - 乱数調整
User zerosun
Language C++ (GCC 4.9.2)
Score 30
Code Size 1312 Byte
Status RE
Exec Time 291 ms
Memory 1048 KiB

Judge Result

Set Name Subtask All
Score / Max Score 30 / 30 0 / 270
Status
AC × 20
AC × 29
RE × 34
Set Name Test Cases
Subtask subtask_00.txt, subtask_01.txt, subtask_02.txt, subtask_03.txt, subtask_04.txt, subtask_05.txt, subtask_06.txt, subtask_07.txt, subtask_08.txt, subtask_09.txt, subtask_10.txt, subtask_11.txt, subtask_12.txt, subtask_13.txt, subtask_14.txt, subtask_15.txt, subtask_16.txt, subtask_17.txt, subtask_18.txt, subtask_19.txt
All scrambled_00.txt, scrambled_01.txt, scrambled_02.txt, scrambled_03.txt, scrambled_04.txt, scrambled_05.txt, scrambled_06.txt, scrambled_07.txt, scrambled_08.txt, scrambled_09.txt, scrambled_10.txt, scrambled_11.txt, scrambled_12.txt, scrambled_13.txt, scrambled_14.txt, scrambled_15.txt, scrambled_16.txt, scrambled_17.txt, scrambled_18.txt, scrambled_19.txt, scrambled_20.txt, scrambled_21.txt, scrambled_22.txt, scrambled_23.txt, scrambled_24.txt, scrambled_25.txt, scrambled_26.txt, scrambled_27.txt, scrambled_28.txt, scrambled_29.txt, scrambled_30.txt, scrambled_31.txt, scrambled_32.txt, scrambled_33.txt, scrambled_34.txt, scrambled_35.txt, scrambled_36.txt, scrambled_37.txt, scrambled_38.txt, scrambled_39.txt, scrambled_40.txt, scrambled_41.txt, scrambled_42.txt, subtask_00.txt, subtask_01.txt, subtask_02.txt, subtask_03.txt, subtask_04.txt, subtask_05.txt, subtask_06.txt, subtask_07.txt, subtask_08.txt, subtask_09.txt, subtask_10.txt, subtask_11.txt, subtask_12.txt, subtask_13.txt, subtask_14.txt, subtask_15.txt, subtask_16.txt, subtask_17.txt, subtask_18.txt, subtask_19.txt
Case Name Status Exec Time Memory
scrambled_00.txt AC 25 ms 792 KiB
scrambled_01.txt AC 25 ms 800 KiB
scrambled_02.txt AC 26 ms 732 KiB
scrambled_03.txt AC 25 ms 668 KiB
scrambled_04.txt RE 279 ms 728 KiB
scrambled_05.txt RE 284 ms 800 KiB
scrambled_06.txt RE 273 ms 804 KiB
scrambled_07.txt RE 291 ms 672 KiB
scrambled_08.txt RE 276 ms 800 KiB
scrambled_09.txt RE 277 ms 796 KiB
scrambled_10.txt RE 278 ms 780 KiB
scrambled_11.txt RE 277 ms 920 KiB
scrambled_12.txt RE 281 ms 800 KiB
scrambled_13.txt RE 279 ms 796 KiB
scrambled_14.txt RE 278 ms 800 KiB
scrambled_15.txt RE 276 ms 672 KiB
scrambled_16.txt RE 280 ms 792 KiB
scrambled_17.txt RE 283 ms 920 KiB
scrambled_18.txt RE 272 ms 800 KiB
scrambled_19.txt RE 286 ms 672 KiB
scrambled_20.txt RE 273 ms 796 KiB
scrambled_21.txt RE 278 ms 672 KiB
scrambled_22.txt RE 283 ms 800 KiB
scrambled_23.txt RE 290 ms 804 KiB
scrambled_24.txt RE 284 ms 796 KiB
scrambled_25.txt RE 289 ms 796 KiB
scrambled_26.txt RE 281 ms 792 KiB
scrambled_27.txt RE 282 ms 792 KiB
scrambled_28.txt RE 286 ms 792 KiB
scrambled_29.txt RE 281 ms 800 KiB
scrambled_30.txt AC 26 ms 796 KiB
scrambled_31.txt AC 26 ms 792 KiB
scrambled_32.txt RE 285 ms 920 KiB
scrambled_33.txt AC 25 ms 920 KiB
scrambled_34.txt AC 25 ms 920 KiB
scrambled_35.txt AC 26 ms 1048 KiB
scrambled_36.txt RE 278 ms 792 KiB
scrambled_37.txt RE 281 ms 796 KiB
scrambled_38.txt RE 279 ms 800 KiB
scrambled_39.txt RE 290 ms 916 KiB
scrambled_40.txt RE 278 ms 800 KiB
scrambled_41.txt RE 283 ms 792 KiB
scrambled_42.txt RE 276 ms 788 KiB
subtask_00.txt AC 26 ms 728 KiB
subtask_01.txt AC 26 ms 916 KiB
subtask_02.txt AC 25 ms 796 KiB
subtask_03.txt AC 26 ms 732 KiB
subtask_04.txt AC 25 ms 916 KiB
subtask_05.txt AC 24 ms 924 KiB
subtask_06.txt AC 25 ms 800 KiB
subtask_07.txt AC 24 ms 796 KiB
subtask_08.txt AC 24 ms 928 KiB
subtask_09.txt AC 22 ms 924 KiB
subtask_10.txt AC 24 ms 672 KiB
subtask_11.txt AC 25 ms 800 KiB
subtask_12.txt AC 25 ms 928 KiB
subtask_13.txt AC 24 ms 736 KiB
subtask_14.txt AC 24 ms 800 KiB
subtask_15.txt AC 24 ms 676 KiB
subtask_16.txt AC 25 ms 796 KiB
subtask_17.txt AC 25 ms 916 KiB
subtask_18.txt AC 24 ms 796 KiB
subtask_19.txt AC 24 ms 732 KiB