Submission #2108917


Source Code Expand

Copy
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧  
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     
    /   \     | |     
    /   / ̄ ̄ ̄ ̄/  |  
  __(__ニつ/     _/ .| .|____  
     \/____/ (u ⊃  
---------------------------------------------------------------------------------------------------*/





int C[3][3];
int A[3], B[3];
//---------------------------------------------------------------------------------------------------
void _main() {
    rep(i, 0, 3) rep(j, 0, 3) cin >> C[i][j];

    rep(a1, 0, 101) rep(a2, 0, 101) rep(a3, 0, 101) {
        int b1 = C[0][0] - a1;
        int b2 = C[0][1] - a1;
        int b3 = C[0][2] - a1;

        A[0] = a1;
        A[1] = a2;
        A[2] = a3;
        B[0] = b1;
        B[1] = b2;
        B[2] = b3;

        int ok = 1;
        rep(i, 0, 3) rep(j, 0, 3) if (A[i] + B[j] != C[i][j]) ok = 0;
        if (ok) {
            printf("Yes\n");
            return;
        }
    }

    printf("No\n");
}

Submission Info

Submission Time
Task C - Takahashi's Information
User hamayanhamayan
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1928 Byte
Status AC
Exec Time 2 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 24
Set Name Test Cases
Sample sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt
All in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, in18.txt, in19.txt, in20.txt, sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt
Case Name Status Exec Time Memory
in01.txt AC 1 ms 256 KB
in02.txt AC 1 ms 256 KB
in03.txt AC 1 ms 256 KB
in04.txt AC 1 ms 256 KB
in05.txt AC 1 ms 256 KB
in06.txt AC 1 ms 256 KB
in07.txt AC 1 ms 256 KB
in08.txt AC 1 ms 256 KB
in09.txt AC 1 ms 256 KB
in10.txt AC 1 ms 256 KB
in11.txt AC 2 ms 256 KB
in12.txt AC 1 ms 256 KB
in13.txt AC 2 ms 256 KB
in14.txt AC 2 ms 256 KB
in15.txt AC 2 ms 256 KB
in16.txt AC 2 ms 256 KB
in17.txt AC 2 ms 256 KB
in18.txt AC 2 ms 256 KB
in19.txt AC 2 ms 256 KB
in20.txt AC 2 ms 256 KB
sample_1.txt AC 1 ms 256 KB
sample_2.txt AC 2 ms 256 KB
sample_3.txt AC 1 ms 256 KB
sample_4.txt AC 2 ms 256 KB