CSES - Leirikisa 5 - Results
Submission details
Task:sume
Sender:eXeP
Submission time:2016-08-02 15:28:34 +0300
Language:C++
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.05 sdetails
#2ACCEPTED0.06 sdetails
#3ACCEPTED0.05 sdetails
#4ACCEPTED0.06 sdetails
#5ACCEPTED0.06 sdetails
#6ACCEPTED0.12 sdetails
#7ACCEPTED0.12 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:31:17: warning: unused variable 'dt' [-Wunused-variable]
   int de[1010], dt[1010];
                 ^

Code

#include <bits/stdc++.h>

#define i64 long long
#define u64 unsigned long long
#define i32 int
#define u32 unsigned int

#define pii pair<int, int>
#define pll pair<long long, long long>

#define ld long double
#define defmod 1000000007

#define mati64(a,b) vector<vector<i64>>(a, vector<i64>(b, 0));
using namespace std;


int main(){
  cin.sync_with_stdio(0);
  cin.tie(0);
  int n; cin >> n;
  int t[1010][1010];
  for(int i = 0; i < n; ++i){
    for(int j = 0; j < n; ++j)
      cin >> t[i][j];
  }
  if(n == 2){
    cout << 1 << " " << 1 << endl;
    return 0;
  }
  int de[1010], dt[1010];
  for(int i = 2; i < n; ++i)
    de[i] = t[0][i]-t[0][i-1];
  
  cout << (t[0][1]+(t[n-1][0]-t[n-1][1]))/2 << " ";
  de[1] = t[n-1][1]-t[n-1][0];
  for(int i = 1; i < n; ++i){
    //cout << (t[i][i+1]) << " " << (de[i]) << endl;
    cout << (t[i][i-1]+de[i])/2 << " ";
  }
  cout << endl;
  return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
2
0 2
2 0

correct output
1 1

user output
1 1

Test 2

Verdict: ACCEPTED

input
4
0 3 6 7
3 0 5 6
6 5 0 9
7 6 9 0

correct output
2 1 4 5

user output
2 1 4 5 

Test 3

Verdict: ACCEPTED

input
3
0 90003 90003
90003 0 6
90003 6 0

correct output
90000 3 3

user output
90000 3 3 

Test 4

Verdict: ACCEPTED

input
8
0 30038 62527 40609 36422 6774...

correct output
17977 12061 44550 22632 18445 ...

user output
17977 12061 44550 22632 18445 ...

Test 5

Verdict: ACCEPTED

input
30
0 54221 21576 54530 22345 5482...

correct output
16412 37809 5164 38118 5933 38...

user output
16412 37809 5164 38118 5933 38...

Test 6

Verdict: ACCEPTED

input
1000
0 35894 61997 41654 61652 2980...

correct output
17429 18465 44568 24225 44223 ...

user output
17429 18465 44568 24225 44223 ...

Test 7

Verdict: ACCEPTED

input
1000
0 70871 52683 64032 77345 5665...

correct output
44202 26669 8481 19830 33143 1...

user output
44202 26669 8481 19830 33143 1...