Submission #2109390


Source Code Expand

Copy
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>

auto& in = std::cin;
auto& out = std::cout;
#define all(C) std::begin(C), std::end(C)

int32_t C[3][3];
int32_t c_[3][3];

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	for (size_t i = 0; i < 3; i++)
		for (size_t j = 0; j < 3; j++)
	{
			in >> C[i][j];
			c_[j][i] = C[i][j];
	}

	bool ok =
		(C[0][1] - C[0][0] == C[1][1] - C[1][0] && C[0][1] - C[0][0] == C[2][1] - C[2][0])//b1-b0
		&& (C[0][2] - C[0][0] == C[1][2] - C[1][0] && C[0][2] - C[0][0] == C[2][2] - C[2][0])//b2-b0
		&& (C[0][2] - C[0][1] == C[1][2] - C[1][1] && C[0][2] - C[0][1] == C[2][2] - C[2][1])//b2-b1

		&& (c_[0][1] - c_[0][0] == c_[1][1] - c_[1][0] && c_[0][1] - c_[0][0] == c_[2][1] - c_[2][0])//b1-b0
		&& (c_[0][2] - c_[0][0] == c_[1][2] - c_[1][0] && c_[0][2] - c_[0][0] == c_[2][2] - c_[2][0])//b2-b0
		&& (c_[0][2] - c_[0][1] == c_[1][2] - c_[1][1] && c_[0][2] - c_[0][1] == c_[2][2] - c_[2][1])//b2-b1
		;
	if (ok) {
		out << "Yes\n";
	}
	else {
		out << "No\n";
	}

	return 0;
}
#endif

Submission Info

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

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_1.txt, sample_2.txt, sample_3.txt, sample_4.txt
All 300 / 300 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 1 ms 256 KB
in02.txt 1 ms 256 KB
in03.txt 1 ms 256 KB
in04.txt 1 ms 256 KB
in05.txt 1 ms 256 KB
in06.txt 1 ms 256 KB
in07.txt 1 ms 256 KB
in08.txt 1 ms 256 KB
in09.txt 1 ms 256 KB
in10.txt 1 ms 256 KB
in11.txt 1 ms 256 KB
in12.txt 1 ms 256 KB
in13.txt 1 ms 256 KB
in14.txt 1 ms 256 KB
in15.txt 1 ms 256 KB
in16.txt 1 ms 256 KB
in17.txt 1 ms 256 KB
in18.txt 1 ms 256 KB
in19.txt 1 ms 256 KB
in20.txt 1 ms 256 KB
sample_1.txt 1 ms 256 KB
sample_2.txt 1 ms 256 KB
sample_3.txt 1 ms 256 KB
sample_4.txt 1 ms 256 KB