結果
| 問題 |
No.3036 Nauclhlt型文字列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-01 19:40:20 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 3,753 bytes |
| コンパイル時間 | 6,041 ms |
| コンパイル使用メモリ | 333,172 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-03-01 19:40:28 |
| 合計ジャッジ時間 | 6,444 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
#ifdef LOCAL
#include "LOCAL.hpp"
#else
#define RUN() solve()
#define dbg(x)
#define say(x)
#endif
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
template <typename T>
using v = vector<T>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
#define mp(x, y) make_pair(x, y)
#define re(i, n) for (int i = 0; i < (int)(n); i++)
#define rep(i, x, n) for (int i = (int)(x); i < (int)(n); i++)
#define rep_s(i, x, n) for (int i = (int)(x); i <= (int)(n); i++)
#define rep_r(i, end, sta) for (int i = (int)((n) - 1); i >= (int)(end); i--)
#define rbfl(elm, ctr) for (auto &elm : ctr)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define lf "\n"
#define ifel(flag, T, F) ((flag) ? (T) : (F))
#define YES cout << "Yes\n"
#define NO cout << "No\n"
#define YN(flag) cout << ((flag) ? "Yes" : "No") << lf
const ll LLMAX = 9223372036854775807LL;
const ld eps = 1e-9;
void INITIALIZE() // 入出力設定
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15) << boolalpha;
}
void pass() { return; }; // ブレークポイント設定用
void solve(); // main関数の代替
#define pos_mod(a, b) ((a % b + b) % b)
template <typename T1, typename T2>
bool chmax(T1 &a, const T2 b) { return (a < b ? (a = b, true) : false); }
template <typename T1, typename T2>
bool chmin(T1 &a, const T2 b) { return (a > b ? (a = b, true) : false); }
bool fequal(ld a, ld b) { return (fabs((a) - (b)) < eps); }
// 入力
template <typename T>
istream &operator>>(istream &is, vector<T> &v)
{
for (T &in : v)
is >> in;
return is;
}
template <typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p)
{
is >> p.first >> p.second;
return is;
}
// 出力
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
for (int i = 0, n = v.size(); i < n; i++)
os << v[i] << (i + 1 != n ? " " : "");
return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p)
{
os << p.first << " " << p.second << endl;
return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const map<T1, T2> &mp)
{
for (auto &[key, val] : mp)
os << key << " " << val << endl;
cout << endl;
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &st)
{
auto itr = st.begin();
for (int i = 0; i < (int)st.size(); i++, itr++)
os << *itr << (i + 1 != (int)st.size() ? " " : "");
return os;
}
template <typename T>
ostream &operator<<(ostream &os, multiset<T> st)
{
auto itr = st.begin();
for (int i = 0; i < (int)st.size(); i++, itr++)
os << *itr << (i + 1 != (int)st.size() ? " " : "");
return os;
}
template <typename T>
ostream &operator<<(ostream &os, deque<T> dq)
{
auto itr = dq.begin();
for (int i = 0, n = dq.size(); i < n; i++, itr++)
os << *itr << (i + 1 != n ? " " : "");
return os;
}
template <class T, class Container, class Compare>
ostream &operator<<(ostream &os, priority_queue<T, Container, Compare> pq)
{
while (pq.size())
{
os << pq.top() << " ";
pq.pop();
}
return os;
}
int main()
{
INITIALIZE();
RUN();
return 0;
}
// ==============================================
void solve()
{
ll n;
cin >> n;
string s;
cin >> s;
if (n % 2 == 1)
NO;
else
{
YES;
for (ll i = 0; i < n; i += 2)
{
cout << s[i];
}
cout << " ";
for (ll i = 1; i < n; i += 2)
{
cout << s[i];
}
cout << lf;
}
}