[Offer收割]编程练习赛1 register

Ended

Participants:955

Verdict:Accepted
Score:100 / 100
Submitted:2016-03-06 14:23:30

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*************************************************************************
    > File Name: 1.cpp
    > Author: james47
    > Mail: 
    > Created Time: Sun Mar  6 14:06:38 2016
 ************************************************************************/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
int ans;
int a[3][3], b[3][3];
/*
int a[3][3] = {
    { 6,7,2 },
    { 1,5,9 },
    { 8,3,4 }
};
*/
bool used[15];
bool check(){
    for (int i = 0; i < 3; i++){
        int row = a[i][0] + a[i][1] + a[i][2];
        int col = a[0][i] + a[1][i] + a[2][i];
        if (row != 15 || col != 15) return false;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX