B. GCD Compression【思维】

```void solve(){
cin >> n;
vector<int> odd, even;
for(int i = 1; i <= 2 * n; ++ i){
cin >> mp[i];
if(mp[i] & 1)    odd.push_back(i);
else    even.push_back(i);
}
int cnt = 0;
if(odd.size() & 1)    odd.pop_back();
for(int i = 0; i < odd.size(); i += 2){
printf("%d %d\n", odd[i], odd[i + 1]);
cnt ++;
if(cnt == n - 1)    break;
}
for(int i = 0; i < even.size() && cnt < n - 1; i += 2){
printf("%d %d\n", even[i], even[i + 1]);
cnt ++;
if(cnt == n - 1)    break;
}
}```

C. Number Game 【思维 数学 博弈】

1、n除以一个奇数因子【可以是自己】
2、n（n>1）减去1

1. 这个数是奇数或者是2；
2. 这个数中只含有一个2， 且有多于一个其他质因子【奇数的积一定是奇数，一下除到只剩一个2和一个奇数因子，对手只能除这个奇数因子，给自己留下2，必胜】；
3. 这个数中含有多个2， 且有至少一个其他质因子【直接把其他的除掉，留下一个质因子只剩2的偶数，只能选择-1而留下一个奇数】
```void Awin(){ puts("Ashishgup");}
void Fwin(){ puts("FastestFinger");}

void solve(){
cin >> n;
if(n == 1)    Fwin();
else if(n & 1 || (n == 2))    Awin();
else{
ll even = 1, odd = 0;
int rec = n;
for(int i = 2; i <= rec / i; ++ i){
if(rec % i == 0){
while(rec % i == 0){
rec /= i;
if(i & 1)    odd ++;
else    even *= i;
}
}
}
if(rec > 1){
if(rec & 1)    odd ++;
else    even *= rec;
}
//printf("odd = %d even = %d\n", odd, even);
if((odd && even > 2) || (even == 2 && odd > 1))    Awin();
else    Fwin();
}
}```

D - Odd-Even Subsequence【思维 二分 贪心】

```bool check(int mid, bool save){
int cnt = 0, idx = 1;
bool f = save;
for(; idx <= n; ++ idx){
if(!f)    cnt ++, f = !f;
else{
if(a[idx] <= mid)    cnt ++, f = !f;
}
}
return cnt >= k;
}

void solve(){
cin >> n >> k;
int maxx = 0;
for(int i = 1; i <= n; ++ i)    scanf("%d", &a[i]), maxx = max(maxx, a[i]);
int l = 0, r = maxx;
while(l < r){
int mid = l + r >> 1;
if(check(mid, 0) || check(mid, 1))    r = mid;
else    l = mid + 1;
}
cout << r;
}```

E - Binary Subsequence Rotation【思维】

```void solve(){
cin >> n >> s1 + 1 >> s2 + 1;
for(int i = 1; i <= n; ++ i)    if(s1[i] == '1')    a1 ++;
for(int i = 1; i <= n; ++ i)    if(s2[i] == '1')    a2 ++;
if(a1 != a2)    puts("-1");
else{
int ans1 = 0, ans2 = 0, one = 0, zero = 0;
for(int i = 1; i <= n; ++ i) {
if(s1[i] == s2[i])    continue ;
tmp[++ idx] = s1[i];
}
for(int i = 1; i <= idx; ++ i){
if(tmp[i] == '1'){
if(zero > 0)    zero --;
else    one ++;
}else{
if(one > 0)    one --;
else    zero ++;
}
ans1 = max(ans1, one);
ans2 = max(ans2, zero);
}
cout << ans1 + ans2;
}
}```