提出 #35094912


ソースコード 拡げる

#include <bits/stdc++.h>
#define M_PI 3.14159265358979323846
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
using namespace std;

int main(){
	int A, B;
	cin >> A >> B;
	vector<int> Asol(3), Bsol(3);
	if (A % 2 == 1) {
		Asol[0] = 1;
		A -= 1;
	}
	if (B % 2 == 1) {
		Bsol[0] = 1;
		B -= 1;
	}
	if (A >= 4) {
		Asol[2] = 1;
		A -= 4;
	}
	if (B >= 4) {
		Bsol[2] = 1;
		B -= 4;
	}
	if (A > 0) {
		Asol[1] = 1;
	}
	if (B > 0) {
		Bsol[1] = 1;
	}
	int ans = 0;
	for (int i = 0; i < 3; i++) {
		if (Asol[i] == 1 || Bsol[i] == 1) {
			ans += pow(2, i);
		}
	}
	cout << ans << endl;


}

提出情報

提出日時
問題 A - 1-2-4 Test
ユーザ amaoto
言語 C++ (GCC 9.2.1)
得点 100
コード長 666 Byte
結果 AC
実行時間 6 ms
メモリ 3692 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 3
AC × 10
セット名 テストケース
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 6 ms 3496 KiB
example_01.txt AC 2 ms 3616 KiB
example_02.txt AC 3 ms 3464 KiB
hand_00.txt AC 2 ms 3556 KiB
hand_01.txt AC 2 ms 3500 KiB
hand_02.txt AC 2 ms 3628 KiB
hand_03.txt AC 2 ms 3596 KiB
hand_04.txt AC 2 ms 3560 KiB
hand_05.txt AC 2 ms 3692 KiB
hand_06.txt AC 3 ms 3556 KiB