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";
}
anonymous No title
C++
#include <algorithm> // std::transform
#include <iostream>
#include <string>
#include <vector>

// 適当な文字列処理(とりあえず大文字にして返す)
std::string something(const std::string& s)
{
  std::string result;

  for (std::string::const_iterator iter {s.begin()}; iter != s.end(); ++iter)
  {
    result.push_back(std::toupper(*iter));
  }

  return result;
}

int main(void)
{
  std::vector<std::string> VNames = {"hoge", "fuga", "piyo"};

  struct SStore
  {
    std::string name;
    int something;
  };

  SStore stores[3];

  int i = 0;
  for (std::vector<std::string>::iterator iter = VNames.begin(); iter != VNames.end(); iter++)
  {
    // stores[i].name = *iter; //ここで文字コードの問題が発生したため、データを触りたくなった
    stores[i].name = something(*iter);
    ++i;
  }

  // std::cout << stores[2].name << std::endl;

  for (int i = 0; i < 3; ++i)
  {
    std::cout << "stores[" << i << "].name == " << stores[i].name << std::endl;
  }

  return 0;
}

anonymous No title
C++
#include <iostream>
#include <vector>
#include <string>

int main (void){
  std::vector<std::string> VNames = {"hoge", "fuga", "piyo"};

  struct SStore  {
    std::string name;
    int something;
  };

  SStore stores[3];
  int i = 0;
  for (std::vector<std::string>::iterator iter = VNames.begin(); iter != VNames.end(); iter++  ){
    stores[i].name = *iter;//ここで文字コードの問題が発生したため、データを触りたくなった
  }

  std::cout << stores[2].name << std::endl;
  
  return 0;
}
Don't you submit code?
Submit