http://codeforces.com/contest/1194/problem/B /* */ # include <bits/stdc++.h> using namespace std; ], c[]; ]; int main() { int n, m, q; scanf("%d", &q); while( q-- ) { scanf("%d %d", &n, &m); ; i<n; i++ ) cin>>…
A. Remove a Progression 签到题,易知删去的为奇数,剩下的是正偶数数列. #include<iostream> using namespace std; int T; int n,x; int main(){ cin>>T; while(T--){ cin>>n>>x; cout<<x * 2<<endl; } return 0; } B. Yet Another Crosses Problem n*m存在上界,…
C. From S To T time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You are given three strings s, t and p consisting of lowercase Latin letters. You may perform any number (possibly, zero) operatio…
D. 1-2-K Game time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Alice and Bob play a game. There is a paper strip which is divided into n + 1 cells numbered from left to right starting from 0. T…
#include<bits/stdc++.h>using namespace std;int sg[1007];int main(){ int t; cin>>t; while(t--){ int n,k; cin>>n>>k; if(k%3==0){ n%=(k+1); if(n==k||n%3) cout<<"Alice"<<"\n"; else cout<<"Bob&…
output standard output Alice and Bob play a game. There is a paper strip which is divided into n + 1 cells numbered from left to right starting from 0. There is a chip placed in the n-th cell (the last one). Players take turns, Alice is first. Each p…
You are given three strings ss, tt and pp consisting of lowercase Latin letters. You may perform any number (possibly, zero) operations on these strings. During each operation you choose any character from pp, erase it from pp and insert it into stri…
题目链接:https://codeforces.com/contest/1373/problem/B 题意 给出一个二进制串 $s$,Alica 和 Bob 每次可以选择移去 $s$ 中的一个 $10$ 或 $01$,无法选择者视为输掉游戏,判断最终谁会胜利.($1 \le t \le 1000, 1 \le |s| \le 100$) 题解一 $s$ 范围较小,$O_{(n^2)}$ 模拟. 代码 #include <bits/stdc++.h> using namespace std; v…
题意:博弈题面  给出一个数字序列 (>=11)  有两个人任意删除数字 直到 数字只剩下11位 如果删除后的数字串开头是8那么就是第一个赢 否则就是第二个人赢 第一个人先手  数字序列一定是奇数长度 思路: 首先计算一共走多少步 第二个人想赢只有以下两种方法 想法1:如果第二个人能把8都删掉 那么第二个人肯定赢 想法2: 如果删不掉 那么第二个人肯定从前到后尽可能得删掉8 这样使得第一个人的步数不足删除从前到后 步数+1那个8 的其他字符 否则就是第一人赢,直接模拟即可 (比赛的时候一直WA…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec Problem Description Input Output The only line should contain the minimal number of days required for the ship to reach the point (x2,y2)(x2,y2). If it…