結果

問題 No.3036 Nauclhlt型文字列
ユーザー Fajar Ramadhani Putra Armadi
提出日時 2025-07-09 16:56:25
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 599 bytes
コンパイル時間 3,821 ms
コンパイル使用メモリ 275,756 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-07-09 16:56:31
合計ジャッジ時間 4,042 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define fastio                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL)

#define endl "\n"

using namespace std;

int main()
{
    fastio;
    int n; cin >> n;
    string s; cin >> s;
    if (n % 2 != 0) {
        cout << "No" << endl;
        return 0;
    } else {
        string sA, sB;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                sB += s[i];
            } else {
                sA += s[i];
            }
        }
        cout << "Yes" << endl << sB << " " << sA << endl;
    }
    return 0;
}
0