結果

問題 No.597 concat
ユーザー naimonon77
提出日時 2017-12-03 20:34:53
言語 C++14
(gcc 8.3.0)
結果
AC  
実行時間 4 ms
コード長 2,959 Byte
コンパイル時間 1,455 ms
使用メモリ 1,576 KB
最終ジャッジ日時 2019-10-12 17:30:48

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
0_sample_0.txt AC 3 ms
1,564 KB
0_sample_1.txt AC 3 ms
1,572 KB
0_sample_2.txt AC 4 ms
1,568 KB
1_case_0.txt AC 3 ms
1,572 KB
1_case_1.txt AC 3 ms
1,572 KB
1_case_2.txt AC 4 ms
1,576 KB
1_case_3.txt AC 3 ms
1,576 KB
1_case_4.txt AC 3 ms
1,576 KB
1_case_5.txt AC 3 ms
1,576 KB
1_case_6.txt AC 3 ms
1,576 KB
1_case_7.txt AC 3 ms
1,576 KB
1_case_8.txt AC 3 ms
1,576 KB
1_case_9.txt AC 3 ms
1,572 KB
2_case_0.txt AC 3 ms
1,552 KB
テストケース一括ダウンロード

ソースコード

diff #
#define TEST_MODE true

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep2(i, a, b) for (int i = (a)-1; i >= (int)b; --i)
#define range(i, a, b, c) for (int i = a;             \
                                   c > 0 ? i < b : i > b; \
                                   i += c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define ifnot(a) if (not(a))
#define int long long

#ifdef LOCAL_ENV

#if TEST_MODE == true
const bool test = true;
#define dump(x) cerr << #x << " = " << (x) << endl
#else
const bool test = false;
#define dump(x) 
#endif

#else
const bool test = false;
#define dump(x) 
#endif

int dx[] = { 1, 0, -1, 0 };
int dy[] = { 0, 1, 0, -1 };
const int INF = (int)1 << 60;
const ll INFL = (ll)1 << 60;
ll mod_n = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real &r) { return (r > eps) - (r < -eps); }
int sgn(const Real &a, const Real &b) { return sgn(a - b); }

//.....................
const int MAX = (int)2e5 + 5;

vector<string> split(const string &str, char sep)
{
	vector<string> v;
	stringstream ss(str);
	string buffer;
	while (getline(ss, buffer, sep))
	{
		v.push_back(buffer);
	}
	return v;
}

template <class InputIterator>
int sum(InputIterator begin, InputIterator end)
{
	return accumulate(begin, end, 0ll);
}

template<typename T>
T gcd(T a, T b)
{
	T c;
	while (a != 0) {
		c = a; a = b%a;  b = c;
	}
	return b;
}

class Solver {
public:
	int N;
	string s[1000];

	string ans(int i) {
		if (i < 0) return "";
		return ans(i - 1) + s[i];
	}

	void solve() {
		cin >> N;
		rep(i, N) cin >> s[i];
		cout << ans(N - 1) << endl;
	}
};

signed main()
{
	srand((unsigned int)time(NULL));
	cout << fixed << setprecision(20);
	auto ptr = new Solver();
	ptr->solve();
	delete ptr;
	//while (true) {
	//	if (cin.eof() == true) break;
	//	auto ptr = new Solver();
	//	ptr->solve();
	//	delete ptr;
	//}
	return 0;
}

// class Mycin {
// 	bool flag = true;
// public:
// 	Mycin& operator >> (int& a) {flag = scanf("%lld", &a) != EOF; return *this;}
// 	Mycin& operator >> (char& a) {flag = scanf("%c", &a) != EOF; return *this;}
// 	Mycin& operator >> (string& s) {flag = (bool)(cin >> s); return *this;}
// 	operator bool() {return flag;}
// } mycin;

// class Mycout {
// public:
// 	Mycout& operator << (const int& a) {printf("%lld", a); return *this;}
// 	Mycout& operator << (const char c) {printf("%c", c); return *this;}
// 	Mycout& operator << (const string& s) {printf("%s", s.c_str()); return *this;}
// } mycout;

// #define cin mycin
// #define cout mycout
// #define endl '\n'
0