Task: | sume |
Sender: | siirikuoppala |
Submission time: | 2016-08-02 15:47:31 +0300 |
Language: | C++ |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.05 s | details |
#2 | ACCEPTED | 0.06 s | details |
#3 | ACCEPTED | 0.06 s | details |
#4 | ACCEPTED | 0.06 s | details |
#5 | ACCEPTED | 0.06 s | details |
#6 | ACCEPTED | 0.39 s | details |
#7 | ACCEPTED | 0.38 s | details |
Code
#include <iostream> using namespace std; int t[1000][1000], A[1000]; int main(){ int n; cin >> n; for(int i=0; i<n; ++i)for(int j=0; j<n; ++j) cin >> t[i][j]; for(int i=1; i<n; ++i){ A[i]= t[i][(i+1)%n]-t[i-1][(i+1)%n]; } if(n==1){ cout << t[0][0]; return 0; }else if(n==2){ cout << "1 1"; return 0; } A[0] = (t[0][1]-A[1])/2; int s=0; for(int i=0; i<n; ++i){ s+=A[i]; cout << s << " "; } }
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... |