摘要:
比赛网址:https://vjudge.net/contest/154804 A题: 思路:水题…… B题: 题意:给你一个a串和b串,问a串中几个连续的与b差值相等的子串。 思路:KMP,由于是连续的串,所以将a和b串处理成相邻元素的差值的串,再进行匹配。 C题: 题意: 给一个3*n的网格,格子 阅读全文
摘要:
拿水题练下java能力,题目链接:http://poj.org/problem?id=2387 这个结果算是写炸了吧……真心感觉Java不好用(应该是我太菜了TAT) 1 import java.math.*; 2 import java.io.*; 3 import java.util.*; 4 阅读全文
摘要:
思路打表模拟,签到题。 1 #include <iostream> 2 #include <cstring> 3 #include <string> 4 #include <cstdio> 5 #include <map> 6 #include <set> 7 #include <vector> 8 阅读全文
摘要:
Get Luffy Out Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 8688 Accepted: 3371 Description Ratish is a young man who always dreams of be 阅读全文
摘要:
Running Median Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1824 Accepted: 889 Description For this problem, you will write a program th 阅读全文
摘要:
Going from u to v or from v to u? Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17479 Accepted: 4694 Description In order to make their s 阅读全文
摘要:
题目链接:https://vjudge.net/contest/153124 由于是中文题题意就不放了…… A题: 思路:每个点与(0,0)连线的中间点的个数是gcd(a,b),直接暴力会超时,所以换种思路:记录f[i]为gcd=i的个数,f[i]=(n/i)*(m/i)-i的倍数,之后就可以计算啦 阅读全文
摘要:
周赛地址:https://vjudge.net/contest/152769#overview A题: 题意:Nikita想选择两门课A和B,使得他想要选的所有学位能被这两门课划分成4个集合,分别是:有AB,有B没A,有A没B,没AB的,并求出这些集合的最大值的最小值。 思路:xjb模拟,才1e6的 阅读全文
摘要:
Slim Span Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 7933 Accepted: 4227 Description Given an undirected weighted graph G, you should 阅读全文
摘要:
Full Tank? Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7427 Accepted: 2399 Description After going through the receipts from your car t 阅读全文