Submission #59868753


Source Code Expand

#if !__INCLUDE_LEVEL__
#include __FILE__



int main(){
    string S; cin>>S;
    ll l = S.length();
    ll Q; cin>>Q;

    rep(i,0,Q){
        ll K;cin>>K;K--;
        ll k = (ll)(K/l)+1;
        bool omote = true;
        ll b = 1;
        while(1){
            b *= 2;
            if(b>K)break;
        }
        while(1){
            if (b==1)break;
            if(k > (ll)(b/2)){
                omote = !omote;
                k-=(ll)(b/2);
            }
            b /= 2;
        }

        ll idx = K%l;
        if(omote){cout<<S[idx]<<spa;}
        else{
            if(isupper(S[idx]))cout<<(char)(S[idx]+32)<<spa;
            else cout<<(char)(S[idx]-32)<<spa;
        }
    }
    cout<<endl;
    
    return 0;
}

#else
#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
struct Init { Init() { ios::sync_with_stdio(0); cin.tie(0); cout << setprecision(13); } }init;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

#define rep(i, x, limit) for (int i = (int)x; i < (int)limit; i++)
#define REP(i, x, limit) for (int i = (int)x; i <= (int)limit; i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define el '\n'
#define spa " "
#define Yes cout << "Yes" << el
#define No cout << "No" << el
#define YES cout << "YES" << el
#define NO cout << "NO" << el
#define eps (1e-10)
#define Equals(a,b) (fabs((a) - (b)) < eps )

const double pi = 3.141592653589793238;
const int inf = 1073741823;
const ll infl = 1LL << 60;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const string abc = "abcdefghijklmnopqrstuvwxyz";

//配列の要素を空白区切りで出力 第二引数をtrueにすると改行区切り
template<class T> inline void print_vec(const vector<T>& v, bool split_line=false) {
    if(v.empty()){
        cout << "This vector is empty." << el;
        return;
    }
    for (int i = 0; i < v.size(); i++) {
        if(v[i]==inf || v[i]==infl) cout << 'x' << " \n"[split_line || i+1==(int)v.size()];
        else cout << v[i] << " \n"[split_line || i+1==(int)v.size()];
    }
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

#endif

Submission Info

Submission Time
Task D - Strange Mirroring
User naok_000
Language C++ 23 (gcc 12.2)
Score 350
Code Size 2533 Byte
Status AC
Exec Time 73 ms
Memory 3808 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 350 / 350
Status
AC × 3
AC × 63
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt, test_41.txt, test_42.txt, test_43.txt, test_44.txt, test_45.txt, test_46.txt, test_47.txt, test_48.txt, test_49.txt, test_50.txt, test_51.txt, test_52.txt, test_53.txt, test_54.txt, test_55.txt, test_56.txt, test_57.txt, test_58.txt, test_59.txt, test_60.txt
Case Name Status Exec Time Memory
sample_01.txt AC 1 ms 3676 KiB
sample_02.txt AC 1 ms 3464 KiB
sample_03.txt AC 1 ms 3492 KiB
test_01.txt AC 5 ms 3544 KiB
test_02.txt AC 12 ms 3532 KiB
test_03.txt AC 3 ms 3584 KiB
test_04.txt AC 7 ms 3692 KiB
test_05.txt AC 7 ms 3664 KiB
test_06.txt AC 46 ms 3416 KiB
test_07.txt AC 36 ms 3544 KiB
test_08.txt AC 38 ms 3568 KiB
test_09.txt AC 4 ms 3608 KiB
test_10.txt AC 9 ms 3480 KiB
test_11.txt AC 2 ms 3612 KiB
test_12.txt AC 56 ms 3476 KiB
test_13.txt AC 8 ms 3616 KiB
test_14.txt AC 52 ms 3488 KiB
test_15.txt AC 28 ms 3564 KiB
test_16.txt AC 38 ms 3684 KiB
test_17.txt AC 50 ms 3692 KiB
test_18.txt AC 62 ms 3484 KiB
test_19.txt AC 54 ms 3552 KiB
test_20.txt AC 20 ms 3484 KiB
test_21.txt AC 21 ms 3532 KiB
test_22.txt AC 50 ms 3604 KiB
test_23.txt AC 28 ms 3692 KiB
test_24.txt AC 64 ms 3480 KiB
test_25.txt AC 56 ms 3548 KiB
test_26.txt AC 57 ms 3540 KiB
test_27.txt AC 3 ms 3808 KiB
test_28.txt AC 43 ms 3596 KiB
test_29.txt AC 20 ms 3804 KiB
test_30.txt AC 7 ms 3552 KiB
test_31.txt AC 29 ms 3548 KiB
test_32.txt AC 24 ms 3552 KiB
test_33.txt AC 21 ms 3756 KiB
test_34.txt AC 21 ms 3680 KiB
test_35.txt AC 20 ms 3672 KiB
test_36.txt AC 49 ms 3484 KiB
test_37.txt AC 47 ms 3484 KiB
test_38.txt AC 42 ms 3424 KiB
test_39.txt AC 40 ms 3536 KiB
test_40.txt AC 39 ms 3572 KiB
test_41.txt AC 39 ms 3748 KiB
test_42.txt AC 58 ms 3476 KiB
test_43.txt AC 58 ms 3492 KiB
test_44.txt AC 56 ms 3552 KiB
test_45.txt AC 53 ms 3620 KiB
test_46.txt AC 53 ms 3532 KiB
test_47.txt AC 53 ms 3748 KiB
test_48.txt AC 73 ms 3480 KiB
test_49.txt AC 71 ms 3556 KiB
test_50.txt AC 67 ms 3488 KiB
test_51.txt AC 64 ms 3724 KiB
test_52.txt AC 65 ms 3560 KiB
test_53.txt AC 63 ms 3756 KiB
test_54.txt AC 73 ms 3476 KiB
test_55.txt AC 71 ms 3532 KiB
test_56.txt AC 67 ms 3560 KiB
test_57.txt AC 65 ms 3556 KiB
test_58.txt AC 63 ms 3680 KiB
test_59.txt AC 63 ms 3608 KiB
test_60.txt AC 31 ms 3624 KiB