提出 #47226796


ソースコード 拡げる

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

//template
using ll = long long;
using ull = unsigned long long;
const int inf = INT_MAX/2;
const ll infl = LONG_MAX/2;

#define OVERLOAD(e1, e2, e3, e4, NAME, ...) NAME
#define REP1(i, b) for (ll i = 0, i##_len = ll(b); i < i##_len; i++)
#define REP2(i, a, b) for (ll i = ll(a), i##_len = ll(b); i < i##_len; i++)
#define REP3(i, a, b, c) for (ll i = ll(a), i##_len = ll(b); i < i##_len; i += ll(c))
#define rep(...) OVERLOAD(__VA_ARGS__, REP3, REP2, REP1)(__VA_ARGS__)
#define REPS1(i, b) for (ll i = 0, i##_len = ll(b); i <= i##_len; i++)
#define REPS2(i, a, b) for (ll i = ll(a), i##_len = ll(b); i <= i##_len; i++)
#define REPS3(i, a, b, c) for (ll i = ll(a), i##_len = ll(b); i <= i##_len; i += ll(c))
#define reps(...) OVERLOAD(__VA_ARGS__, REPS3, REPS2, REPS1)(__VA_ARGS__)
#define RREP1(i, a) for (ll i = ll(a); i >= 0; i--)
#define RREP2(i, a, b) for (ll i = ll(a), i##_len = ll(b); i >= i##_len; i--)
#define RREP3(i, a, b, c) for (ll i = ll(a), i##_len = ll(b); i >= i##_len; i -= ll(c))
#define rrep(...) OVERLOAD(__VA_ARGS__, RREP3, RREP2, RREP1)(__VA_ARGS__)

#define vrep(i, vec) for (auto &i: vec)
#define all(x) (x).begin(), (x).end()
#define Yes(bool) if(bool) {println("Yes");} else {println("No");}

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117;
template<class T> double rad(const T theta) { return theta*pi/180; }

ll mpow(ll x, ll n) { ll ret = 1; while (n > 0) { if (n & 1) ret *= x; x *= x; n >>= 1; } return ret; }

void printd() { cout << '\n'; } template<class T, class... Ts> void printd(const T& a, const Ts&... b) { cout << setprecision(20) << a; if (sizeof...(b) != 0) {cout << ' ';}; printd(b...); }
void println() { cout << '\n'; } template<class T, class... Ts> void println(const T& a, const Ts&... b) { cout << a; if (sizeof...(b) != 0) {cout << ' ';}; println(b...); }
void print() {} template<class T, class... Ts> void print(const T& a, const Ts&... b) { cout << a; if (sizeof...(b) != 0) {cout << ' ';}; print(b...); }
template<class T> void printv(const T vec) { int i = 0; int s = vec.size(); vrep(v, vec) { print(v); i++; if (i != s) print(' '); } println(); }
template<class T> void printvv(const T vec) { vrep(v, vec) { printv(v); } }
void in() {} template<class T, class... Ts> void in(T& a, Ts&... b) { cin >> a; in(b...); }



int main() {
    int A[9][9];
    rep(i, 9) rep(j, 9) in(A[i][j]);

    bool f = true;
    rep(i, 9) {
        map<int, int> mp;
        rep(j, 9) {
            mp[A[i][j]]++;
        }

        if (mp.size() != 9) f = false;
    }

    rep(i, 9) {
        map<int, int> mp;
        rep(j, 9) {
            mp[A[j][i]]++;
        }

        if (mp.size() != 9) f = false;
    }

    rep(i, 0, 9, 3) {
        rep(j, 0, 9, 3) {
            map<int, int> mp;
            rep(h, 3) {
                rep(w, 3) {
                    mp[A[h+i][w+j]]++;
                }
            }
            if (mp.size() != 9) f = false;
        }
    }
    
    Yes(f);

    return 0;
}

提出情報

提出日時
問題 C - Number Place
ユーザ kaede2912
言語 C++ 23 (gcc 12.2)
得点 250
コード長 3200 Byte
結果 AC
実行時間 1 ms
メモリ 3720 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 250 / 250
結果
AC × 3
AC × 31
セット名 テストケース
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, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 1 ms 3588 KiB
example_01.txt AC 1 ms 3536 KiB
example_02.txt AC 1 ms 3544 KiB
hand_00.txt AC 1 ms 3676 KiB
hand_01.txt AC 1 ms 3576 KiB
hand_02.txt AC 1 ms 3676 KiB
random_00.txt AC 1 ms 3584 KiB
random_01.txt AC 1 ms 3600 KiB
random_02.txt AC 1 ms 3592 KiB
random_03.txt AC 1 ms 3580 KiB
random_04.txt AC 1 ms 3540 KiB
random_05.txt AC 1 ms 3536 KiB
random_06.txt AC 1 ms 3580 KiB
random_07.txt AC 1 ms 3656 KiB
random_08.txt AC 1 ms 3596 KiB
random_09.txt AC 1 ms 3536 KiB
random_10.txt AC 1 ms 3528 KiB
random_11.txt AC 1 ms 3588 KiB
random_12.txt AC 1 ms 3540 KiB
random_13.txt AC 1 ms 3536 KiB
random_14.txt AC 1 ms 3496 KiB
random_15.txt AC 1 ms 3532 KiB
random_16.txt AC 1 ms 3588 KiB
random_17.txt AC 1 ms 3596 KiB
random_18.txt AC 1 ms 3532 KiB
random_19.txt AC 1 ms 3588 KiB
random_20.txt AC 1 ms 3536 KiB
random_21.txt AC 1 ms 3596 KiB
random_22.txt AC 1 ms 3720 KiB
random_23.txt AC 1 ms 3596 KiB
random_24.txt AC 1 ms 3528 KiB