码迷,mamicode.com
首页 >  
搜索关键字:palindromes    ( 345个结果
P1217 [USACO1.5]回文质数 Prime Palindromes
题解: 第一次: 算法复杂度过高,导致编译超时,需要优化 #include<stdio.h>#include<math.h>int a[100000001] = { 0 };int p(int n) { int t = n, ret = 0; while (t > 0) { t /= 10; ret ...
分类:其他好文   时间:2020-01-29 14:06:40    阅读次数:56
P1217 [USACO1.5]回文质数 Prime Palindromes(stringstream,sizeof(num)/sizeof(num[0]),打表)
题目描述 因为 151 既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以 151 是回文质数。 写一个程序来找出范围 [a,b](5≤a<b≤100,000,000)( 一亿)间的所有回文质数。 输入格式 第 1 行: 二个整数 a 和 b . 输出格式 输出一个回文质数的列表,一行 ...
分类:其他好文   时间:2020-01-16 00:35:53    阅读次数:87
CodeChef Tree Palindromes
Tree Palindromes Problem Statement Given a tree rooted at node 1 with N nodes, each is assigned a lower case latin character. Print the sum of length ...
分类:其他好文   时间:2019-11-28 21:36:25    阅读次数:114
Educational Codeforces Round 75 (Rated for Div. 2) B. Binary Palindromes
链接: https://codeforces.com/contest/1251/problem/B 题意: A palindrome is a string t which reads the same backward as forward (formally, t[i]=t[|t|+1?i] f ...
分类:其他好文   时间:2019-11-01 20:42:06    阅读次数:126
Leetcode_409_Longest Palindrome
"Longest Palindrome" Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built wit ...
分类:其他好文   时间:2019-10-27 20:41:43    阅读次数:92
【SDOI2018】反回文串(【ARC064 F】Rotated Palindromes 加强版)
题意 给你一个正整数 $n$,求有多少字符集为 $1$ 到 $k$ 之间整数的字符串,使得该字符串可以由一个长度为 $n$ 的回文串循环移位得到。 ARC原题 $100\%$ 的数据是 $n,k\le 10^9$ SDOI改编后,$30\%$ 的数据是 $n,k\le 10^{10}$,$60\%$ ...
分类:其他好文   时间:2019-09-14 19:03:48    阅读次数:73
回文自动机入门题
URAL-1960.Palindromes and Super Abilities 传送门 ?题意 给你一个长度为 n 的字符串 s,下标从 1 开始; 输出 n 个数,第 i 个数表示 1~i 内有多少个本质不同的回文串; ?题解 回文自动机入门题; 定义 ans[ i ] 表示 1~i 共有 $ ...
分类:其他好文   时间:2019-07-30 21:54:04    阅读次数:108
求回文串个数
先整理各路大神的题解 Orz,以后再埋坑 SP7586 NUMOFPAL - Number of Palindromes Description 求一个串中包含几个回文串。 Input 输入一个字符串S Output 包含的回文串的个数. 思路一: 用马拉车求出预处理后以每个字母处的回文半径P[i] ...
分类:其他好文   时间:2019-07-27 09:43:53    阅读次数:105
letecode [409] - Longest Palindrome
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This ...
分类:其他好文   时间:2019-06-21 21:02:04    阅读次数:116
409. Longest Palindrome(计算一组字符集合可以组成的回文字符串的最大长度)
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This ...
分类:其他好文   时间:2019-05-10 23:59:33    阅读次数:228
345条   上一页 1 2 3 4 ... 35 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!