提出 #373331


ソースコード 拡げる

// K.

#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
#include <cstring>

using namespace std;

typedef long long LL;

LL check(LL A, LL B, LL X) {
	if (A >= 1024 || B >= 1024 || X >= 1024) {
		return -1;
	}
	const LL m = 500000000;
	LL t;
	for (t = 0; A != X && t < m; ++t) {
		A = (A >> 1) ^ ((A & 1) ? B : 0);
	}
	return t < m ? t : -1;
}

int main(int argc, char *argv[]) {
	string s;
	getline(cin, s);
	stringstream ss(s);
	LL A, B, X;
	ss >> A >> B >> X;
	cout << check(A, B, X) << endl;
	return 0;
}

提出情報

提出日時
問題 K - 乱数調整
ユーザ greentea
言語 C++ (GCC 4.9.2)
得点 30
コード長 571 Byte
結果 WA
実行時間 1506 ms
メモリ 928 KiB

ジャッジ結果

セット名 Subtask All
得点 / 配点 30 / 30 0 / 270
結果
AC × 20
AC × 31
WA × 32
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
scrambled_00.txt AC 26 ms 916 KiB
scrambled_01.txt AC 26 ms 796 KiB
scrambled_02.txt AC 25 ms 920 KiB
scrambled_03.txt AC 1490 ms 732 KiB
scrambled_04.txt WA 26 ms 924 KiB
scrambled_05.txt WA 25 ms 796 KiB
scrambled_06.txt WA 26 ms 804 KiB
scrambled_07.txt WA 26 ms 796 KiB
scrambled_08.txt WA 27 ms 796 KiB
scrambled_09.txt WA 26 ms 804 KiB
scrambled_10.txt WA 26 ms 924 KiB
scrambled_11.txt WA 25 ms 916 KiB
scrambled_12.txt WA 26 ms 796 KiB
scrambled_13.txt WA 26 ms 800 KiB
scrambled_14.txt AC 25 ms 792 KiB
scrambled_15.txt AC 26 ms 800 KiB
scrambled_16.txt AC 26 ms 804 KiB
scrambled_17.txt AC 26 ms 732 KiB
scrambled_18.txt WA 25 ms 800 KiB
scrambled_19.txt WA 24 ms 924 KiB
scrambled_20.txt WA 24 ms 920 KiB
scrambled_21.txt WA 26 ms 804 KiB
scrambled_22.txt WA 27 ms 856 KiB
scrambled_23.txt WA 25 ms 792 KiB
scrambled_24.txt WA 24 ms 920 KiB
scrambled_25.txt WA 25 ms 796 KiB
scrambled_26.txt WA 25 ms 924 KiB
scrambled_27.txt WA 24 ms 924 KiB
scrambled_28.txt WA 26 ms 792 KiB
scrambled_29.txt AC 27 ms 800 KiB
scrambled_30.txt WA 26 ms 796 KiB
scrambled_31.txt AC 25 ms 800 KiB
scrambled_32.txt WA 25 ms 928 KiB
scrambled_33.txt AC 23 ms 924 KiB
scrambled_34.txt WA 24 ms 928 KiB
scrambled_35.txt WA 26 ms 928 KiB
scrambled_36.txt WA 26 ms 924 KiB
scrambled_37.txt WA 25 ms 796 KiB
scrambled_38.txt WA 26 ms 800 KiB
scrambled_39.txt WA 26 ms 912 KiB
scrambled_40.txt WA 25 ms 804 KiB
scrambled_41.txt WA 25 ms 804 KiB
scrambled_42.txt WA 25 ms 800 KiB
subtask_00.txt AC 1490 ms 804 KiB
subtask_01.txt AC 1489 ms 804 KiB
subtask_02.txt AC 1506 ms 812 KiB
subtask_03.txt AC 1495 ms 928 KiB
subtask_04.txt AC 23 ms 800 KiB
subtask_05.txt AC 25 ms 804 KiB
subtask_06.txt AC 25 ms 796 KiB
subtask_07.txt AC 27 ms 916 KiB
subtask_08.txt AC 23 ms 796 KiB
subtask_09.txt AC 24 ms 928 KiB
subtask_10.txt AC 25 ms 804 KiB
subtask_11.txt AC 25 ms 924 KiB
subtask_12.txt AC 24 ms 720 KiB
subtask_13.txt AC 26 ms 720 KiB
subtask_14.txt AC 25 ms 800 KiB
subtask_15.txt AC 1486 ms 796 KiB
subtask_16.txt AC 23 ms 800 KiB
subtask_17.txt AC 1487 ms 808 KiB
subtask_18.txt AC 27 ms 916 KiB
subtask_19.txt AC 24 ms 800 KiB