Submission #53829274


Source Code Expand

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#define _GLIBCXX_DEBUG
// kyopuro2.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cassert>
#include <bitset>
#include <sstream>
#include <stdlib.h>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define eb emplace_back

const long long INF = 1LL << 60;
const long long MOD = 998244353;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

using ll = long long;
using ch = char;
using st = string;
using vi = vector<int>;
using vll = vector<ll>;
using vb = vector<bool>;
using vc = vector<ch>;
using vs = vector<st>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vvb = vector<vb>;
using vvc = vector<vc>;
using vvs = vector<vs>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using vP = vector <P>;
using vPll = vector<Pll>;
using p_qi = priority_queue<int>;

// 深さ優先探索
vector<bool> seen(300009, false);
void dfs(const vvll& G, ll v, ll& c, ll& e) {
    c++;
    seen[v] = true; // v を訪問済にする
    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) {
        e++;
        if (seen[next_v]) continue;

        dfs(G, next_v, c, e); // 再帰的に探索
    }
}
///
ll powpow(ll x, ll n) {
    if (n == 0) return 1;
    ll val = powpow(x, n / 2);
    val *= val;
    if (n % 2 == 1) val *= x;
    return val;
}
int dx[] = { -1,0,1,0 }; int dy[] = { 0,1,0,-1 };
char ldru[] = { 'L','D','R','U' };

int main() {
    int A, B;
    cin >> A >> B;
    if (A == B) {
        cout << -1;
    }
    else {
        
        rep(i, 3) {
            if (i + 1 != A && i + 1 != B) {
                cout << i + 1;
            }
        }
    }
}


// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


Submission Info

Submission Time
Task A - Who Ate the Cake?
User michael_80
Language C++ 17 (gcc 12.2)
Score 100
Code Size 3500 Byte
Status AC
Exec Time 1 ms
Memory 3688 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 12
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3516 KiB
00_sample_01.txt AC 1 ms 3472 KiB
00_sample_02.txt AC 1 ms 3532 KiB
01_random_00.txt AC 1 ms 3512 KiB
01_random_01.txt AC 1 ms 3516 KiB
01_random_02.txt AC 1 ms 3688 KiB
01_random_03.txt AC 1 ms 3572 KiB
01_random_04.txt AC 1 ms 3504 KiB
01_random_05.txt AC 1 ms 3472 KiB
01_random_06.txt AC 1 ms 3504 KiB
01_random_07.txt AC 1 ms 3540 KiB
01_random_08.txt AC 1 ms 3504 KiB