CODE FESTIVAL 2016 Relay (Parallel)

Submission #1005083

Source codeソースコード

#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second
#define all(v) begin(v), end(v)
#define debug(x) cerr<< #x <<": "<<x<<endl
#define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
template<class T> using vv=vector<vector< T > >;

int main() {
  vi a(3);
  rep(i, 3) {
    scanf("%d", &a[i]);
  }
  vvi ans(3, vi(3));
  ans[0][0] = a[0];
  ans[0][1] = a[1];
  ans[1][1] = a[2];
  int sum = a[2] * 3;
  ans[0][2] = sum - ans[0][0] - ans[0][1];
  ans[2][0] = sum - ans[0][2] - ans[1][1];
  ans[2][1] = sum - ans[0][1] - ans[1][1];
  ans[2][2] = sum - ans[2][0] - ans[2][1];
  ans[1][0] = sum - ans[0][0] - ans[2][0];
  ans[1][2] = sum - ans[1][0] - ans[1][1];
  rep (i, 3) {
    rep (j, 3) {
      printf("%d%c", ans[i][j], (j == 2) ? '\n' : ' ');
    }
  }
  return 0;
}

Submission

Task問題 D - 魔方陣2 / Magic Square 2
User nameユーザ名 mu
Created time投稿日時
Language言語 C++14 (Clang 3.8.0)
Status状態 AC
Score得点 100
Source lengthソースコード長 1508 Byte
File nameファイル名
Exec time実行時間 5 ms
Memory usageメモリ使用量 504 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - sample_01.txt,sample_02.txt
All 100 / 100 sample_01.txt,sample_02.txt,subtask1_01.txt,subtask1_02.txt,subtask1_03.txt,subtask1_04.txt,subtask1_05.txt,subtask1_06.txt,subtask1_07.txt,subtask1_08.txt,subtask1_09.txt,subtask1_10.txt,subtask1_11.txt,subtask1_12.txt,subtask1_13.txt,subtask1_14.txt,subtask1_15.txt,subtask1_16.txt,subtask1_17.txt,subtask1_18.txt,subtask1_19.txt,subtask1_20.txt,subtask1_21.txt,subtask1_22.txt,subtask1_23.txt,subtask1_24.txt,subtask1_25.txt,subtask1_26.txt,subtask1_27.txt,subtask1_28.txt,subtask1_29.txt,subtask1_30.txt,subtask1_31.txt,subtask1_32.txt,subtask1_33.txt,subtask1_34.txt,subtask1_35.txt,subtask1_36.txt,subtask1_37.txt,subtask1_38.txt,subtask1_39.txt,subtask1_40.txt,subtask1_41.txt,subtask1_42.txt,subtask1_43.txt,subtask1_44.txt,subtask1_45.txt,subtask1_46.txt,subtask1_47.txt,subtask1_48.txt,subtask1_49.txt,subtask1_50.txt,subtask1_51.txt,subtask1_52.txt,subtask1_53.txt,subtask1_54.txt,subtask1_55.txt,subtask1_56.txt,subtask1_57.txt,subtask1_58.txt,subtask1_59.txt,subtask1_60.txt,subtask1_61.txt,subtask1_62.txt,subtask1_63.txt,subtask1_64.txt,subtask1_65.txt,subtask1_66.txt,subtask1_67.txt,subtask1_68.txt,subtask1_69.txt,subtask1_70.txt,subtask1_71.txt,subtask1_72.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
sample_01.txt AC 5 ms 504 KB
sample_02.txt AC 3 ms 256 KB
subtask1_01.txt AC 3 ms 256 KB
subtask1_02.txt AC 3 ms 256 KB
subtask1_03.txt AC 3 ms 256 KB
subtask1_04.txt AC 3 ms 256 KB
subtask1_05.txt AC 3 ms 256 KB
subtask1_06.txt AC 3 ms 256 KB
subtask1_07.txt AC 3 ms 256 KB
subtask1_08.txt AC 3 ms 256 KB
subtask1_09.txt AC 3 ms 256 KB
subtask1_10.txt AC 3 ms 256 KB
subtask1_11.txt AC 3 ms 256 KB
subtask1_12.txt AC 3 ms 256 KB
subtask1_13.txt AC 3 ms 256 KB
subtask1_14.txt AC 3 ms 256 KB
subtask1_15.txt AC 3 ms 256 KB
subtask1_16.txt AC 3 ms 256 KB
subtask1_17.txt AC 3 ms 256 KB
subtask1_18.txt AC 3 ms 256 KB
subtask1_19.txt AC 3 ms 256 KB
subtask1_20.txt AC 3 ms 256 KB
subtask1_21.txt AC 3 ms 256 KB
subtask1_22.txt AC 3 ms 256 KB
subtask1_23.txt AC 3 ms 256 KB
subtask1_24.txt AC 3 ms 256 KB
subtask1_25.txt AC 3 ms 256 KB
subtask1_26.txt AC 3 ms 256 KB
subtask1_27.txt AC 3 ms 256 KB
subtask1_28.txt AC 3 ms 256 KB
subtask1_29.txt AC 3 ms 256 KB
subtask1_30.txt AC 3 ms 256 KB
subtask1_31.txt AC 3 ms 256 KB
subtask1_32.txt AC 3 ms 256 KB
subtask1_33.txt AC 3 ms 256 KB
subtask1_34.txt AC 3 ms 256 KB
subtask1_35.txt AC 3 ms 256 KB
subtask1_36.txt AC 3 ms 256 KB
subtask1_37.txt AC 3 ms 256 KB
subtask1_38.txt AC 3 ms 256 KB
subtask1_39.txt AC 3 ms 256 KB
subtask1_40.txt AC 3 ms 256 KB
subtask1_41.txt AC 3 ms 256 KB
subtask1_42.txt AC 3 ms 256 KB
subtask1_43.txt AC 3 ms 256 KB
subtask1_44.txt AC 3 ms 256 KB
subtask1_45.txt AC 3 ms 256 KB
subtask1_46.txt AC 3 ms 256 KB
subtask1_47.txt AC 3 ms 256 KB
subtask1_48.txt AC 3 ms 256 KB
subtask1_49.txt AC 3 ms 256 KB
subtask1_50.txt AC 3 ms 256 KB
subtask1_51.txt AC 3 ms 256 KB
subtask1_52.txt AC 3 ms 256 KB
subtask1_53.txt AC 3 ms 256 KB
subtask1_54.txt AC 3 ms 256 KB
subtask1_55.txt AC 3 ms 256 KB
subtask1_56.txt AC 3 ms 256 KB
subtask1_57.txt AC 3 ms 256 KB
subtask1_58.txt AC 3 ms 256 KB
subtask1_59.txt AC 3 ms 256 KB
subtask1_60.txt AC 3 ms 256 KB
subtask1_61.txt AC 3 ms 256 KB
subtask1_62.txt AC 3 ms 256 KB
subtask1_63.txt AC 3 ms 256 KB
subtask1_64.txt AC 3 ms 256 KB
subtask1_65.txt AC 3 ms 256 KB
subtask1_66.txt AC 3 ms 256 KB
subtask1_67.txt AC 3 ms 256 KB
subtask1_68.txt AC 3 ms 256 KB
subtask1_69.txt AC 3 ms 256 KB
subtask1_70.txt AC 3 ms 256 KB
subtask1_71.txt AC 3 ms 256 KB
subtask1_72.txt AC 3 ms 256 KB