提出 #67923137


ソースコード 拡げる

#include<bits/stdc++.h>
//#include <sys/resource.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<ll,ll> pl;
typedef vector<pl> vpl;
 
#define all(x) x.begin(), x.end()
#define nl cout<<"\n"
#define ar  array
#define PRECISION 9
#define fast_IO ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define clock() cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"
#define size(x) (int)x.size()
#define pb push_back
#define fr(i,j,k) for(int i=j;i<k;i++)
#define rf(i,j,k) for(int i=k-1;i>j;i--)

mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
// const ll p = uniform_int_distribution<ll>(0, mod - 1)(rng);

#ifdef LOCAL
#include "../Library/debug.h"
#else 
#define dbg(...) "SMILE"
#endif

//#define STACK_INCREASE

const int mod=998244353;

ll add(ll x,ll y){
    ll val=(x%mod+y%mod)%mod;
    while(val<0) val+=mod;
    return val;
}

ll mul(ll x,ll y){
    return (x%mod*y%mod)%mod;
}

ll binpow(ll a,ll b){
    ll res=1;
    while(b>0){
        if(b&1)res=res*a%mod;
        b>>=1;
        a=a*a%mod;
    }
    return res;
}

void solve(){
    string s;
    cin>>s;
    int n=size(s);
    string ans;
    int p=-1;
    fr(i,0,n){
        if(s[i]=='#') {
            ans.pb(s[i]);
            p=-1;
        }
        else {
            if(p==-1){
                p=i;
                ans.pb('o');
            }
            else {
                ans.pb('.');
            }
        }
    }
    cout<<ans<<"\n";

}   



int main(){
    if (1) cout<<fixed<<setprecision(PRECISION);
    fast_IO;
    #ifdef STACK_INCREASE
    rlimit rlim;
    if (getrlimit(RLIMIT_STACK, &rlim)) return 1;
    rlim.rlim_cur = 1024*1024*1024;
    if (setrlimit(RLIMIT_STACK, &rlim)) return 2;
    #endif

    int T=1;
    // cin>>T;
    while(T--){
        solve();
        clock();
    }
    return 0;
}

提出情報

提出日時
問題 B - 1D Akari
ユーザ Dhongee
言語 C++ 20 (gcc 12.2)
得点 250
コード長 2032 Byte
結果 AC
実行時間 1 ms
メモリ 3936 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 250 / 250
結果
AC × 4
AC × 21
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3856 KiB
00_sample_01.txt AC 1 ms 3812 KiB
00_sample_02.txt AC 1 ms 3828 KiB
00_sample_03.txt AC 1 ms 3692 KiB
01_handmade_00.txt AC 1 ms 3816 KiB
01_handmade_01.txt AC 1 ms 3936 KiB
01_handmade_02.txt AC 1 ms 3876 KiB
01_handmade_03.txt AC 1 ms 3812 KiB
01_handmade_04.txt AC 1 ms 3836 KiB
01_handmade_05.txt AC 1 ms 3936 KiB
01_handmade_06.txt AC 1 ms 3844 KiB
02_random_00.txt AC 1 ms 3816 KiB
02_random_01.txt AC 1 ms 3836 KiB
02_random_02.txt AC 1 ms 3820 KiB
02_random_03.txt AC 1 ms 3696 KiB
02_random_04.txt AC 1 ms 3932 KiB
02_random_05.txt AC 1 ms 3764 KiB
02_random_06.txt AC 1 ms 3812 KiB
02_random_07.txt AC 1 ms 3932 KiB
02_random_08.txt AC 1 ms 3848 KiB
02_random_09.txt AC 1 ms 3928 KiB