zqy1018的博客


  • 首页

  • 关于

  • 标签

  • 分类

  • 归档

  • 搜索

模板 数学(2)

发表于 2018-08-26 | 分类于 模板 |
字数统计: 2,234 字

一些简单的数学相关算法模板。
本文主要集中于模相关的问题。

阅读全文 »

NOI1997-2002 题解

发表于 2018-08-25 | 分类于 NOI题解 |
字数统计: 4,032 字

包含了NOI1997-2002六年部分题目的题解。

阅读全文 »

BZOJ2440 完全平方数

发表于 2018-08-25 | 分类于 BZOJ |
字数统计: 471 字

题目链接

阅读全文 »

poj3614

发表于 2018-08-25 |
字数统计: 0 字

Codeforces Round 506 (Div. 3) 题解

发表于 2018-08-25 | 分类于 Codeforces |
字数统计: 258 字

A

题目链接

观察样例可以发现,只要找到最长的和后缀相同的前缀,然后重复该前缀$k$次,再输出剩下的即可。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <cctype>
#define INF 2000000000
using namespace std;
typedef long long ll;
int read(){
int f = 1, x = 0;
char c = getchar();
while(c < '0' || c > '9'){if(c == '-') f = -f; c = getchar(); }
while(c >= '0' && c <= '9')x = x * 10 + c - '0', c = getchar();
return f * x;
}
int n, k;
char s[105];
void init(){
n = read(), k = read();
scanf("%s", s);
}
void solve(){
int st;
for(st = 1; st < n; st++){
int flag = 1;
for(int j = 0; j < n - st; ++j)
if(s[st + j] != s[j]){
flag = 0;
break;
}
if(flag) break;
}
if(st == n){
for(int i = 0; i < k; ++i)
printf("%s", s);

}else{
for(int i = 0; i < k; ++i)
for(int j = 0; j < st; ++j)
putchar(s[j]);
for(int i = st; i < n; ++i)
putchar(s[i]);
}
printf("\n");
}
int main(){
init();
solve();
return 0;
}


B

题目链接


C

题目链接

luogu4317

发表于 2018-08-24 |
字数统计: 0 字

Codeforces 670C Cinema

发表于 2018-08-24 | 分类于 Codeforces |
字数统计: 275 字

题目链接

阅读全文 »

Codeforces 438D The Child and Sequence

发表于 2018-08-24 | 分类于 Codeforces |
字数统计: 772 字

题目链接

阅读全文 »

Codeforces 405C Unusual Product

发表于 2018-08-24 | 分类于 Codeforces |
字数统计: 413 字

题目链接

阅读全文 »

Codeforces 813C The Tag Game

发表于 2018-08-24 | 分类于 Codeforces |
字数统计: 344 字

题目链接

阅读全文 »
1…111213…27

zqy

264 日志
26 分类
88 标签
Links
  • big_yellow_doge
© 2019 zqy | Site words total count: 206.9k
由 Hexo 强力驱动
|
主题 — NexT.Mist v5.1.4