#include<bits/stdc++.h>
#define int long long
using namespace std;
int t,cnt;
int x,len1,len2,len;
string s1,s2;
string str1,str2;
signed main()
{
freopen("data","r",stdin);
freopen("out","w",stdout);
cin >> len1 >> len2 >> t;
cin >> s1 >> s2;
len = len1 + len2;
str1 = s1 + s2;
str2 = s2 + s1;
while (t--)
{
cin >> x;
cnt = 0;
for (int i = 54; i >= 0; i--)
{
if (len * (1ll << i) < x)
{
x -= len * (1ll << i);
cnt ++;
}
}
if (cnt & 1)
cout << str2[x - 1] << endl;
else
cout << str1[x - 1] << endl;
}
return 0;
}
在OJ上RE了,但是甩到NOI Linux用gdb调试什么事都没有,返回值是0