結果

問題 No.3036 Nauclhlt型文字列
ユーザー Leal-0
提出日時 2025-02-28 21:32:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 4,908 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 176,412 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-02-28 21:32:35
合計ジャッジ時間 2,678 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#ifndef INCLUDED_MAIN
#define INCLUDED_MAIN
#include __FILE__
vector<ll> dx={-1,0,1};
vector<ll> dy={-1,0,1};
int main(){
ll n;
cin>>n;
if(n%2){cout<<"No"<<endl; return 0;}
vector<char> nauclhlt(n);
rep(i,n) cin>>nauclhlt[i];
string a,b;
rep(i,n) {
if(i%2) b.push_back(nauclhlt[i]);
else a.push_back(nauclhlt[i]);
}
cout<<"Yes"<<endl;
cout<<a<<" "<<b<<endl;
}
#else
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define srep(i,l,r) for(int i=l;i<=r;i++)
using ll = long long;
#define mod 998244353ll
#define vout(v) for(auto i :v) cout<<i<<" ";
#define INF 922330000000000000ll
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define enld endl
#define Rn return
#define vl vector<ll>
bool isin(ll i,ll j,ll hgt,ll width) {
if(i<0 || i>=hgt || j<0 || j>=width) return false;
else return true;
}
ll lensum(ll l,ll r) {
ll len=r-l+1;
return (l-1)*len + (r-l+1)*(r-l+1)/2;
}
vector<ll> Erasieve(ll n) {
vector<bool> is_prime(n+1, true);
is_prime[0] = is_prime[1] = false;
for (int i=2;i*i<=n;++i) {
if (is_prime[i]) {
for (int j=i*i;j<=n;j+=i) is_prime[j] = false;
}
}
vector<ll> primes;
srep(i,2,n) {
if (is_prime[i]) primes.push_back(i);
}
return primes;
}
ll divcount(ll n) {
ll ans=0;
for(int i=1;i*i<=n;i++) {
if(n%i==0) ans+=(i*i==n ? 1:2);
}
return ans;
}
struct UnionFind {
vector<int> par;
vector<int> rank;
UnionFind(int N) : par(N), rank(N, 0) {
for (int i = 0; i < N; i++) {
par[i] = i;
}
}
//
int root(int x) {
if (par[x] == x) return x;
return par[x] = root(par[x]);
}
void unite(int x, int y) {
int rx = root(x);
int ry = root(y);
if (rx == ry) return;
if (rank[rx] < rank[ry]) {
par[rx] = ry;
} else {
par[ry] = rx;
if (rank[rx] == rank[ry]) {
rank[rx]++;
}
}
}
bool same(int x, int y) {
return root(x) == root(y);
}
};
template <class T> void vecpr(T first,T last) {
ll tmp=0;
for(auto it=first;it!=last;++it) {
if(tmp) cout<<" ";
cout<<*it;
tmp++;
}
cout<<endl;
}
template <class T> void vvpr(vector<vector<T>> a) {
for(int i=0;i<(ll)a.size();i++) {
for(int j=0;j<(ll)a[i].size();j++) {
if(j) cout<<" ";
cout<<a[i][j];
}
cout<<endl;
}
}
vector<ll> slmax(vector<ll> a, ll limit, ll breadth) {//slidewindowbreadth,limit=a.size()
deque<ll> deq;
vector<ll> max_numbers(limit, (-1)*INF);
rep(i, limit) {
while (!deq.empty() && deq.front() <= i - breadth) deq.pop_front();
while (!deq.empty() && a[deq.back()] <= a[i]) deq.pop_back();
deq.push_back(i);
max_numbers[i] = a[deq.front()];
}
return max_numbers;
}
vector<ll> slmin(vector<ll> a, ll limit, ll breadth) {//slidewindowbreadth,limit=a.size()
deque<ll> deq;
vector<ll> min_numbers(limit, INF);
rep(i, limit) {
while (!deq.empty() && deq.front() <= i - breadth) deq.pop_front();
while (!deq.empty() && a[deq.back()] >= a[i]) deq.pop_back();
deq.push_back(i);
min_numbers[i] = a[deq.front()];
}
return min_numbers;
}
ll modpow(ll fl,ll po,ll mode) { //mode0=modmode1=
ll ret=1;
rep(i,po) {
ret*=fl;
if(mode) ret=(ret+mod)%mod;
}
return ret;
}
ll gcd(ll a,ll b) { //Euclid
if(a<b) return gcd(b,a);
if(a%b==0) return b;
return gcd(b,a%b);
}
vector<ll> lis_min(vector<ll> &a) { //i
ll n=(ll)a.size();
vector<ll> dp(n,INF);
rep(i,n){
auto itr = lower_bound(dp.begin(),dp.end(), a[i]);
*itr = a[i];
}
return dp;
}//使
void lis_min_update(vector<ll>& dp, ll x) { //↑ (cf.abc393-f);
auto it=lower_bound(dp.begin(), dp.end(), x);
if(it==dp.end())
dp.push_back(x);
else
*it=x;
}
vector<ll> lis_size(vector<ll>& a ,vector<ll>&seqcopy) { // a indexdp[i]
ll n=a.size();
vector<ll> dp(n,1);
vector<ll> seq;
rep(i,n) {
auto it=lower_bound(seq.begin(), seq.end(), a[i]);
if (it==seq.end()) seq.push_back(a[i]);
else *it=a[i];
dp[i]=distance(seq.begin(), lower_bound(seq.begin(), seq.end(), a[i]))+1;
}
srep(i,1,n-1) {
if(dp[i]<dp[i-1]) dp[i]=dp[i-1];
}
seqcopy=seq;
return dp;
}
#endif
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0