CF1433A Boring Apartments 题解】的更多相关文章

Content 我们把仅由一个或多个相同的数位组成的数字叫作"无聊的数字".我们把 \(\leqslant 10000\) 的这种数字按照以下规则排列: 首先,将仅由 \(1\) 组成的 \(\leqslant 10000\) 的"无聊的数字"按照升序排列:\(1,11,111,1111,...\). 再将仅由 \(2\) 组成的 \(\leqslant 10000\) 的"无聊的数字"按照升序排列:\(2,22,222,2222,...\).…
题目链接 题目大意 给你一个长度为d(d<=1e5)的字符串,要你求有多少个子串满足这个子串不包含长度大于等于k的回文子串 题目思路 首先可以hash预处理,然后O(1)用前缀hash值和后缀hash值求一个字符串是否是回文串 其实你只要枚举每个点当作左端点,求右端点最远能到那里即可 回文串可能最多达到\(n^2\)个,但你可以思考一下其实你只要考虑长度为k和k+1的字符串即可 具体证明有点麻烦自己可以画图去考虑一下,因为长度更长的回文串必有子串长度为k或k+1 但是长度更短的回文串,影响明显是…
比赛链接:https://codeforces.com/contest/1433 A. Boring Apartments 题解 模拟即可. 代码 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { int n; cin >> n; int ans =…
Codeforces Round #677 (Div. 3) 题解 A. Boring Apartments 题目 题解 简单签到题,直接数,小于这个数的\(+10\). 代码 #include <bits/stdc++.h> using namespace std; #define ll long long #define IOS ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0); const int maxn = 2e5 + 10;…
2013年"浪潮杯"山东省第四届ACM大学生程序设计竞赛排名:http://acm.upc.edu.cn/ranklist/ 一.第J题坑爹大水题,模拟一下就行了 J:Contest Print Server [题解]: 题目大意:输入 n,s,x,y,mod  分别队伍数n,还有一个s生成函数 s=((s*x)+y)%mod,就是打印机根据要求打印纸张,打印到s时,打印机将重置,生成新的s [code]: #include <iostream> #include <…
hihoCoder #1430 : A Boring Problem(一琐繁题) 时间限制:1000ms 单点时限:1000ms 内存限制:256MB Description - 题目描述 As a student of the school of electronics engineering and computer science in Peking University, Kyle took the course named Advanced Algebra in his freshma…
Boring Counting Time Limit: 3000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述     In this problem you are given a number sequence P consisting of N integer and Pi is the ith element in the sequence. Now you task is to answer a list of queries, for each…
A Boring Question Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 156    Accepted Submission(s): 72 Problem Description       Input   The first line of the input contains the only integer T,(1≤T…
Boring count Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 787 Accepted Submission(s): 325 Problem Description You are given a string S consisting of lowercase letters, and your task is counting…
题解:http://bestcoder.hdu.edu.cn/blog/ 多校6 HDU5793 A Boring Question // #pragma comment(linker, "/STACK:102c000000,102c000000") // #include <conio.h> #include <bits/stdc++.h> using namespace std; #define clc(a,b) memset(a,b,sizeof(a))…