CodeForces 688B-Lovely Palindromes】的更多相关文章

题意:给一个数n,让你找出长度为偶数,并且是第 n 个回文数. 析:你多写几个就知道了,其实就是 n,然后再加上n的逆序,不过n有点大,直接用string 好了. 代码如下: #include <iostream> #include <cmath> #include <cstdlib> #include <set> #include <cstdio> #include <cstring> #include <algorithm&…
题目链接: B. Lovely Palindromes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pari has a friend who loves palindrome numbers. A palindrome number is a number that reads the same forward or ba…
B. Lovely Palindromes 题目连接: http://www.codeforces.com/contest/688/problem/B Description Pari has a friend who loves palindrome numbers. A palindrome number is a number that reads the same forward or backward. For example 12321, 100001 and 1 are palin…
[CodeForces 1251B --- Binary Palindromes] Description A palindrome is a string t which reads the same backward as forward (formally, t[i]=t[|t|+1−i] for all i∈[1,|t|]). Here |t| denotes the length of a string t. For example, the strings 010, 1001 and…
Description Pari has a friend who loves palindrome numbers. A palindrome number is a number that reads the same forward or backward. For example 12321, 100001 and 1 are palindrome numbers, while 112 and 1021 are not. Pari is trying to love them too,…
Content 输入一个数 \(n\),输出第 \(n\) 个偶数位回文数. 数据范围:\(1\leqslant n\leqslant 10^{10^5}\). Solution 一看这吓人的数据范围,我就明白,这题明显是个结论题. 我们需要先找规律: 第一个:\(11\) 第二个:\(22\) 第三个:\(33\) 第四个:\(44\) \(...\) 第十个:\(1001\) 第十一个:\(1111\) \(...\) 嗯?那么第 \(n\) 个岂不是先输出 \(n\),再倒序输出 \(n\…
http://codeforces.com/problemset/problem/688/B B. Lovely Palindromes time limit per test 1 second memory limit per test 256 megabytes Pari has a friend who loves palindrome numbers. A palindrome number is a number that reads the same forward or backw…
A题:Opponents 直接模拟 #include <bits/stdc++.h> using namespace std; ]; int main() { int n,k; while(~scanf("%d%d",&n,&k)) { ,sta=,first=,ans; ;i<k;i++) { sta=; scanf("%s",ch); ;i<n;i++) sta&=(ch[i]-'); ) p++; ||(i==k…
Problem_A(CodeForces 688A): 题意: 有d天, n个人.如果这n个人同时出现, 那么你就赢不了他们所有的人, 除此之外, 你可以赢他们所有到场的人. 到场人数为0也算赢. 现给出这n个人d天的到勤情况, 求最大连胜天数. 思路: 暴力找下去, 维护最大天数即可. 代码: #include <cmath> #include <cstdio> #include <cstring> #include <cstdlib> #include…
Queries for Number of Palindromes Problem's Link:   http://codeforces.com/problemset/problem/245/H Mean: 给你一个字符串,然后q个询问:从i到j这段字符串中存在多少个回文串. analyse: dp[i][j]表示i~j这段的回文串数. 首先判断i~j是否为回文,是则dp[i][j]=1,否则dp[i][j]=0; 那么dp[i][j]=dp[i][j]+dp[i][j-1]+dp[i+1[j…