monkukui No title
C++
50 150
42 43 2
37 49 8
41 26 10
10 13 1
9 33 6
19 4 6
43 23 8
49 3 10
8 38 4
16 10 7
34 24 4
43 18 5
28 6 8
23 32 9
30 15 6
22 38 10
49 9 3
33 40 1
18 25 2
11 39 7
17 15 10
25 16 2
16 19 1
38 24 9
1 31 9
16 15 5
9 7 1
28 39 2
10 36 7
10 40 9
48 46 10
9 32 4
7 17 1
46 24 8
43 2 10
28 38 5
4 24 4
34 20 3
26 30 2
13 47 8
50 7 2
20 24 3
16 49 5
33 14 7
3 2 6
14 44 8
38 41 10
35 46 3
47 23 3
48 31 6
37 2 9
46 9 5
9 28 4
40 38 8
47 3 3
36 42 6
14 8 8
20 3 5
13 41 2
12 15 8
26 13 3
10 32 5
26 49 6
18 10 7
29 39 1
29 48 8
12 28 5
5 24 2
15 46 1
50 38 7
40 20 4
13 25 5
47 2 9
34 21 8
8 43 4
3 1 4
16 39 4
48 1 6
8 12 6
46 42 7
44 25 4
43 12 3
45 19 3
26 22 1
32 14 9
45 16 10
47 30 7
11 12 7
31 13 4
49 29 2
6 25 2
32 48 10
3 44 4
11 25 7
26 33 8
9 27 10
21 23 1
27 41 6
15 35 10
12 1 5
26 39 4
17 33 10
20 8 4
9 20 8
40 41 6
6 26 10
42 9 4
11 19 7
16 31 4
16 43 2
29 43 2
42 3 5
18 38 1
50 33 4
33 28 1
45 30 7
13 49 9
32 16 2
7 36 10
28 48 9
37 31 7
10 23 9
5 23 3
4 16 6
22 27 10
48 39 5
24 11 10
27 19 3
46 33 2
49 7 6
37 46 8
17 2 3
19 12 9
8 32 3
35 12 5
46 29 3
37 24 7
15 27 10
21 27 2
34 19 10
18 23 9
34 31 2
3 37 5
34 46 10
32 3 4
18 42 9
36 24 8
6 30 1
49 38 7
5 37 6
monkukui No title
C++
50 96
23 3 10
39 38 1
49 24 10
27 18 10
20 16 1
46 5 1
10 7 3a
33 4 1
10 40 10
17 26 3
11 29 4
37 39 4
8 36 1
12 26 8
37 25 10
9 45 1
12 26 8
22 33 7
36 44 5
22 47 4
28 48 10
31 29 3
32 39 4
42 13 6
1 40 10
38 28 5
9 22 5
48 18 1
18 48 1
26 17 3
8 6 10
11 29 4
33 9 4
28 48 10
3 32 4
9 22 5
5 46 1
25 31 2
42 5 10
31 24 1
9 15 10
46 44 5
39 28 7
31 25 2
40 1 10
25 29 1
41 21 10
25 38 10
48 30 10
38 37 7
3 12 10
21 14 10
32 14 10
4 44 7
4 44 7
28 38 5
40 10 10
4 9 9
24 49 10
45 22 6
29 24 7
50 16 10
33 45 1
35 16 1
35 20 1
45 33 1
47 22 4
6 27 2
34 27 10
3 32 4
46 44 5
24 31 1
1 43 2
1 2 10
25 11 7
43 1 2
32 37 8
19 1 10
10 17 6
17 7 2
33 4 1
23 28 2
38 39 1
32 39 4
37 25 10
32 38 8
37 39 4
35 19 10
25 24 5
6 27 2
7 26 3
28 23 2
4 45 4
20 35 1
45 9 1
14 32 10
monkukui No title
C++
50 96
23 3 10
39 38 1
49 24 10
27 18 10
20 16 1
46 5 1
10 7 3
33 4 1
10 40 10
17 26 3
11 29 4
37 39 4
8 36 1
12 26 8
37 25 10
9 45 1
12 26 8
22 33 7
36 44 5
22 47 4
28 48 10
31 29 3
32 39 4
42 13 6
1 40 10
38 28 5
9 22 5
48 18 1
18 48 1
26 17 3
8 6 10
11 29 4
33 9 4
28 48 10
3 32 4
9 22 5
5 46 1
25 31 2
42 5 10
31 24 1
9 15 10
46 44 5
39 28 7
31 25 2
40 1 10
25 29 1
41 21 10
25 38 10
48 30 10
38 37 7
3 12 10
21 14 10
32 14 10
4 44 7
4 44 7
28 38 5
40 10 10
4 9 9
24 49 10
45 22 6
29 24 7
50 16 10
33 45 1
35 16 1
35 20 1
45 33 1
47 22 4
6 27 2
34 27 10
3 32 4
46 44 5
24 31 1
1 43 2
1 2 10
25 11 7
43 1 2
32 37 8
19 1 10
10 17 6
17 7 2
33 4 1
23 28 2
38 39 1
32 39 4
37 25 10
32 38 8
37 39 4
35 19 10
25 24 5
6 27 2
7 26 3
28 23 2
4 45 4
20 35 1
45 9 1
14 32 10
monkukui No title
C++
10 47
4 2 6
2 7 2
10 9 3
2 10 1
8 9 2
8 3 4
4 8 1
2 9 4
5 10 9
7 10 1
8 6 1
4 9 1
6 4 2
10 7 1
10 1 1
5 7 9
6 9 4
2 10 1
3 4 4
8 5 1
6 7 10
7 3 1
5 3 9
7 9 3
4 1 10
2 1 1
8 4 1
5 4 1
9 7 3
3 1 8
10 3 2
8 6 1
6 5 3
4 5 1
2 3 7
4 10 5
3 6 6
9 3 4
7 3 1
8 10 8
9 4 1
4 7 4
9 5 1
8 7 6
1 9 6
5 2 9
7 1 2
monkukui No title
C++
20 73
10 2 5
16 10 4
15 13 9
13 9 8
20 7 4
17 3 6
5 4 3
2 19 6
6 8 1
9 15 4
6 8 1
8 4 2
8 4 2
7 12 2
20 19 3
5 8 7
10 7 1
20 10 3
16 20 1
19 10 6
20 17 2
14 3 3
3 11 10
12 7 2
10 1 6
2 1 1
13 4 10
12 9 9
15 9 4
18 8 2
9 4 1
7 17 1
5 13 4
4 5 3
2 7 8
4 18 7
3 12 1
20 19 3
3 14 3
12 18 9
4 15 10
4 9 1
5 13 4
17 20 2
19 1 2
17 19 8
17 10 1
1 19 2
14 12 9
4 6 8
15 2 5
7 17 1
19 7 10
7 3 7
2 17 10
16 1 10
5 9 6
3 12 1
16 20 1
11 18 5
16 17 3
18 8 2
17 12 3
8 9 8
15 10 9
12 10 5
18 11 5
18 3 8
6 18 4
15 2 5
7 16 5
19 16 3
20 1 8
anonymous No title
C++
#include <iostream>
#include <map>
using std::map;
using std::ostream;

typedef map<char, int> Plate;

ostream& operator << (ostream& os, Plate& p) {
	for (auto m_itr : p) {
		os << m_itr.first << " " << m_itr.second << std::endl;
	}
	return os;
}

/* // pointer ver.
class Dog {
	public:
	Dog(Plate& _plate, char _c) {
		plate = &_plate;
		c = _c;
		std::cout << "debug hoge" << *plate << std::endl; // debug
	}

	void bite() {
		std::cout << "debug fuga" << *plate << std::endl; // debug
		plate->at(c)--;
	}

	private:
	Plate* plate;
	char c;
};
// */

//* // ref. ver. // if you misstake something, then error message is very long and unreadable
class Dog {
	public:
	Dog(Plate& plate, char _c) : plate(plate) {
		c = _c;
		std::cout << "debug hoge" << plate << std::endl; // debug
	}

	void bite() {
		std::cout << "debug fuga" << plate << std::endl; // debug
		plate[c]--;
	}

	private:
	Plate& plate;
	char c;
};
// */

int main() {

	Plate shared_plate;
	shared_plate['p'] = 10;
	shared_plate['r'] = 10;

	Dog pochi = Dog(shared_plate, 'p');
	Dog ryo = Dog(shared_plate, 'r');

	pochi.bite();
	ryo.bite();

	std::cout << "debug " << std::endl << shared_plate << std::endl; // debug


	std::cout << "\e[38;5;0m\e[48;5;40m --- end ---  \e[m" << std::endl; // debug
	return 0;
}

anonymous No title
C++
#include <iostream>
#include <map>
using std::map;
using std::ostream;

typedef map<char, int> Plate;

//*
ostream& operator << (ostream& os, Plate& p) {
	for (auto m_itr : p) {
		os << m_itr.first << " " << m_itr.second << std::endl;
	}
	return os;
}
//*/

class Dog {
	public:
	Dog(Plate& _plate, char _c) {
		plate = &_plate;
		c = _c;
		std::cout << "debug hoge" << *plate << std::endl; // debug
	}

	void bite() {
		std::cout << "debug fuga" << *plate << std::endl; // debug
		plate->at(c)--;
	}

	private:
	Plate* plate;
	char c;
};

int main() {

	Plate shared_plate;
	shared_plate['p'] = 10;
	shared_plate['r'] = 10;

	Dog pochi = Dog(shared_plate, 'p');
	Dog ryo = Dog(shared_plate, 'r');

	pochi.bite();
	ryo.bite();

	std::cout << "debug " << std::endl << shared_plate << std::endl; // debug


	std::cout << "\e[38;5;0m\e[48;5;40m --- end ---  \e[m" << std::endl; // debug
	return 0;
}

anonymous No title
C++
💩
anonymous No title
C++
#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
#define rep(i, n) for(int i=0; i<(n); ++i)

int main(){ 
    lint N;
    cin >> N;
    vector<lint> A(N);
    rep( i, N ) cin >> A[i];

    vector<lint> ans(N);
    rep( i, N ) ans[0] = A[i] - ans[0];

    for( int i=1; i<N; ++i ) {
        ans[i] = 2 * A[i-1] - ans[i-1];
    }

    rep( i, N ) cout << ans[i] << endl;
}
anonymous No title
C++
#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(v)    begin(v), end(v)
#define in        []{lint n; cin>>n; return n;}()

int main(){ cin.tie(0); ios::sync_with_stdio(false);
    lint N = in; // < 10^5
    vector<lint> A(N);
    rep( i, N ) A[i] = in;


    vector<lint> ans(N);
    rep( i, N ) ans[0] = A[i] - ans[0];

    for( int i=1; i<N; ++i ) {
        ans[i] = 2 * A[i-1] - ans[i-1];
    }

    rep( i, N-1 ) cout << ans[i] << " ";
    cout << ans[N-1] << "\n";
}
Don't you submit code?
Submit