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存在上界,…
链接 直接用数组记录每个字母的个数即可 #include<bits/stdc++.h> using namespace std; int a[26] = {0}; int b[26] = {0}; int judge() { //cout<<"111"<<endl; for (int i = 0; i < 26; ++i) { if (a[i]!=b[i]) { return 0; } } return 1; } int main() { //…
慢慢来. 题目册 题目 A B C D E F G 状态 √ √ √ √ × ∅ ∅ //√,×,∅ 想法 A. Prime Subtraction res tp A 题意:给定\(x,y(x>y)\),问能否将\(x-y\)拆成任意多个质数之和 1.任意大于\(1\)的整数\(k\)都可以用\(2\)与\(3\)的线性表示 证: 若\(k\)是偶数,显然: 若\(k\)是奇数,则\(k\)可以表示成\(k = 3 + 2*k'\),显然: 毕. #include<bits/stdc++.h&…
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>>…
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…
题意: 给你n个关卡,每个关卡有一个怪物,怪物的攻击力为a[i],你有n个英雄,每个英雄有一个攻击力,和疲劳值,只要英雄的攻击力比怪物的高就算打过了,同时疲劳减一,一天只能出战一个英雄,一个英雄可以打好几关(只要在疲劳范围内),打不过的话英雄就结束今天的挑战,转到第二天.问最少需要出战多少英雄才能通过所有关卡. 思路:先用一个数组.跑出相同忍耐值时,攻击力越大.然后·跑出这个数组的后缀pre数组,pre数组的含义是:忍耐值一定,攻击力最大.然后通过O(n)的复杂度跑·怪物的数组.当怪物的a[i]…