結果
問題 |
No.3036 Nauclhlt型文字列
|
ユーザー |
![]() |
提出日時 | 2025-02-28 21:24:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,158 bytes |
コンパイル時間 | 4,324 ms |
コンパイル使用メモリ | 252,284 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-02-28 21:24:29 |
合計ジャッジ時間 | 4,306 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 |
ソースコード
#ifdef LOCAL #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using namespace std; #define ll long long #define rep(i,n) for(ll i=0;i<(ll)n;i++) #define all(v) v.begin(),v.end() const ll INF = (ll)2e18; /* 素数判定(エラトステネス) 下処理O(NloglogN) 実行O(1) pをtureにしp*p以上のpの倍数をfalseに N以下の自然数がprimeかを表す配列を返す関数 */ vector<bool> make_is_prime(int N) { vector<bool> prime(N + 1, true); prime[0] = false; prime[1] = false; for (int i = 2; i * i <= N; i++) { if (!prime[i]) continue; for (int j = i * i; j <= N; j += i) { prime[j] = false; } } return prime; } int main(){ cin.tie(0); ios::sync_with_stdio(false); ll N; string S; cin >> N >> S; if(N%2==1){ cout << "No" << endl; return 0; } string A = ""; string B = ""; rep(i,S.size()){ if(i%2==0){ A += S[i]; } else{ B += S[i]; } } cout << "Yes" << endl; cout << A << ' ' << B << endl; }