ACM-EXERCISE
文章平均质量分 75
SZTLLDGZ
这个作者很懒,什么都没留下…
展开
-
dp训练1.2-01背包
上篇文章的优化以及启发思维#include <iostream>using namespace std;const int Num = 1e3+20;int dp[Num];int va[Num];int vo[Num];int main(){ int t; int n, v; cin >> t; while (t--...原创 2019-03-12 11:14:40 · 205 阅读 · 0 评论 -
Minimum Inversion Number(线段树)
Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17705 Accepted Submission(s): 10744Problem DescriptionT原创 2016-08-06 09:04:35 · 314 阅读 · 0 评论 -
敌兵布阵
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 76106 Accepted Submission(s): 32005Problem DescriptionC国的死对头A国这段时间正在进行军事演习,原创 2016-08-01 16:08:58 · 291 阅读 · 0 评论 -
Matrix(二维树状数组)
MatrixTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 24623 Accepted: 9116DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] mean原创 2016-08-05 16:01:18 · 449 阅读 · 0 评论 -
The All-purpose Zero(喜欢这道题)
The All-purpose ZeroTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 553 Accepted Submission(s): 267Problem Description?? gets a原创 2016-07-29 17:40:09 · 762 阅读 · 0 评论 -
How Many Tables(并查集)
How Many TablesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23308 Accepted Submission(s): 11604Problem DescriptionToday is I原创 2016-07-08 11:44:17 · 320 阅读 · 0 评论 -
Subsequence(虫子法)
SubsequenceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12187 Accepted: 5096DescriptionA sequence of N positive integers (10 < N < 100 000), each of th原创 2016-07-27 18:13:36 · 401 阅读 · 0 评论 -
L2-009. 抢红包
L2-009. 抢红包时间限制 300 ms内存限制 65536 kB代码长度限制 8000 B判题程序 Standard 作者 陈越没有人没抢过红包吧…… 这里给出N个人之间互相发红包、抢红包的记录,请你统计一下他们抢红包的收获。输入格式:输入第一行给出一个正整数N(4),即参与发红包原创 2016-07-05 18:15:51 · 313 阅读 · 0 评论 -
L2-008. 最长对称子串
L2-008. 最长对称子串时间限制 100 ms内存限制 65536 kB代码长度限制 8000 B判题程序 Standard 作者 陈越对给定的字符串,本题要求你输出最长对称子串的长度。例如,给定"Is PAT&TAP symmetric?",最长对称子串为"s PAT&TAP s",于是你原创 2016-07-05 17:00:45 · 1028 阅读 · 0 评论 -
L2-003. 月饼
L2-003. 月饼时间限制 100 ms内存限制 65536 kB代码长度限制 8000 B判题程序 Standard 作者 陈越月饼是中国人在中秋佳节时吃的一种传统食品,不同地区有许多不同风味的月饼。现给定所有种类月饼的库存量、总售价、以及市场的最大需求量,请你计算可以获得的最大收益是多少。原创 2016-07-05 16:22:16 · 382 阅读 · 0 评论 -
UVA 12718 K - L2
//超时代码1号:#include #include #include #include #include #include #include #include #include using namespace std;int main(){ int t; scanf("%d", &t); int f = 0; while (t--)原创 2016-07-14 21:19:11 · 513 阅读 · 0 评论 -
Anagram(全排列)
AnagramTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 20171 Accepted: 8033DescriptionYou are to write a program that has to generate all possible words f原创 2016-07-25 21:04:19 · 434 阅读 · 0 评论 -
单词统计(哎呦我去!)
单词统计 Time Limit: 1000 MSMemory Limit: 32768 KTotal Submit: 1805(640 users)Total Accepted: 681(599 users)Rating:Special Judge: NoDescription原创 2016-07-13 17:52:57 · 392 阅读 · 0 评论 -
Just a Hook(线段树区间更新)
Just a HookTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 28099 Accepted Submission(s): 13947Problem DescriptionIn the game of原创 2016-08-12 16:08:25 · 310 阅读 · 0 评论 -
递推,不容易系列之(4)——考新郎
点击打开题目链接原创 2017-08-06 22:24:28 · 311 阅读 · 0 评论 -
我的划时代意义的递归题--Sudoku Killer
————————————————————————————————————————————————————点我看题分析:暴力, 一个一个去试————————————————————————————————————————————————————AC代码:#include #include #include using namespace std;in原创 2017-08-12 22:37:43 · 266 阅读 · 0 评论 -
dp训练1-01背包
题目链接#include <iostream>using namespace std;const int Num = 1e3+20;int dp[Num][Num]; //dp[i][j]表示前i个容量为j的最大价值int va[Num];int vo[Num];int main(){ int t; int n, v; cin >&...原创 2019-03-12 10:22:25 · 190 阅读 · 0 评论 -
递归训练1.2-N皇后(被大神作死)
#include <iostream>using namespace std;int con[8] = {-1, -1, -1, 1, 1, -1, 1, 1};const int N = 15;int c[N][N];int ans[N];int n;int row[N][N];int col[N][N];int bev[N][N];int fun(int...原创 2019-03-01 23:32:45 · 133 阅读 · 0 评论 -
递归训练1-N皇后
#include <iostream>using namespace std;int con[8] = {-1, -1, -1, 1, 1, -1, 1, 1};const int N = 15;int c[N][N];int ans[N];int n;int fun(int, int, int);int res;int main(){ for (int...原创 2019-03-01 16:32:01 · 136 阅读 · 0 评论 -
递归训练2-棋盘问题
题目链接#include <iostream>using namespace std;const int N = 10;char c[N][N];int row[N];int col[N];int res;int dfs(int, int, int);int n, k;int main(){ while ((cin >> n >&...原创 2019-03-04 23:29:56 · 190 阅读 · 0 评论 -
递归小白-三维
#include <iostream>using namespace std;const int N = 2;int c[N][N][N];int fun(int, int, int);int res = 0;int main(){ for (int i=0; i<N; i++) { for (int j=0; j<N; j...原创 2019-02-27 22:59:43 · 139 阅读 · 0 评论 -
递归小白-二维
#include <iostream>using namespace std;const int N = 3;int c[N][N];int fun00();int fun01(int);int fun02(int);int fun10(int);int fun11(int);int fun12(int);int fun(int, int);int res ...原创 2019-02-27 22:42:20 · 128 阅读 · 0 评论 -
递归小白
#include <iostream>using namespace std;int c[35];int fun();int fun2(int);int fun3(int);int func(int);int res = 0;int main(){ for (int i=0; i<20; i++) { c[i] = 0; ...原创 2019-02-27 17:21:37 · 183 阅读 · 0 评论 -
(dp)正整数分组
(出处51nod)将一堆正整数分为2组,要求2组的和相差最小。例如:1 2 3 4 5,将1 2 4分为1组,3 5分为1组,两组和相差1,是所有方案中相差最少的。输入第1行:一个数N,N为正整数的数量。第2 - N+1行,N个正整数。(N 输出输出这个最小差输入示例512345输出示例原创 2017-08-24 10:31:50 · 300 阅读 · 0 评论 -
递归-N皇后
点我看题————————————————————————————————————————————AC代码1://2553#include #include #include using namespace std;int q[10][10];int dir[4][2] = {1, 1, 1, -1, -1, 1, -1, -1};int N;int ans;int原创 2017-08-16 01:11:59 · 221 阅读 · 0 评论 -
(dp)子序列的个数
题目出处:51nod子序列的定义:对于一个序列a=a[1],a[2],......a[n]。则非空序列a'=a[p1],a[p2]......a[pm]为a的一个子序列,其中1例如4,14,2,3和14,1,2,3都为4,13,14,1,2,3的子序列。对于给出序列a,有些子序列可能是相同的,这里只算做1个,请输出a的不同子序列的数量。由于答案比较大,输出Mod 10^9 + 7的翻译 2017-08-25 23:59:15 · 491 阅读 · 3 评论 -
用二分做LIS
AC代码:#include #include #include using namespace std;int a[50050];int dp[50050];int main(){ int n; int l, r; int mid; cin >> n; memset(dp, 0, sizeof(dp)); for (int i=0;原创 2017-08-25 22:31:52 · 358 阅读 · 0 评论 -
(二分)cup
点击打开题目链接AC代码:#include #include #includeusing namespace std;const double p = acos(-1.0);int main(){ double r1, r2, h, v; int t; cin >> t; double h1, h2; double mid; w原创 2017-08-25 21:29:06 · 343 阅读 · 0 评论 -
折纸痕游戏(汉诺塔的女朋友~)
#include #include #include #include #include #include #include #include #include using namespace std;void fun(int n, string s){ if (n == 1) { cout << s << endl; re原创 2016-07-13 10:28:53 · 481 阅读 · 0 评论 -
C - L1(大数比较)
C - L1Crawling in process...Crawling failedTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatus Practice HDU 2054 DescriptionGive you原创 2016-07-12 20:47:58 · 341 阅读 · 0 评论 -
兔子与樱花(floyd+打印路径)
00005:兔子与樱花总时间限制: 1000ms内存限制: 65535kB描述很久很久之前,森林里住着一群兔子。有一天,兔子们希望去赏樱花,但当他们到了上野公园门口却忘记了带地图。现在兔子们想求助于你来帮他们找到公园里的最短路。输入输入分为三个部分。第一个部分有P+1行(P第二个部分有Q+1行(Q第三个部分有R+1行(R输出输出有R行,分别表示每个路线最原创 2016-05-23 12:52:58 · 1318 阅读 · 0 评论 -
Raising Modulo Numbers(数论)
D - Raising Modulo NumbersTime Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 1995DescriptionPeople are different. Some secretly read原创 2016-04-09 15:56:33 · 292 阅读 · 0 评论 -
find the nth digit(math)
A - find the nth digitTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 1597Description假设: S1 = 1 S2 = 12 S3 = 123 S4 = 1234原创 2016-03-14 23:43:00 · 405 阅读 · 0 评论 -
Pangram(水题)
F - PangramTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionA word or a sentence in some language is called a pangram if all the char原创 2016-03-14 23:58:09 · 541 阅读 · 0 评论 -
Battle City(bfs)
E - Battle CityTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 2312DescriptionMany of us had played the game "Battle city" in our原创 2016-03-19 08:33:51 · 281 阅读 · 0 评论 -
Oil Deposits(dfs/bfs)
Oil DepositsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21818 Accepted Submission(s): 12582Problem DescriptionThe GeoSurvCo原创 2016-03-19 11:47:09 · 338 阅读 · 0 评论 -
Can you solve this equation?(二分)
E - SubsequenceTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 3061DescriptionA sequence of N positive integers (10 < N < 100 000)原创 2016-03-20 17:43:44 · 327 阅读 · 0 评论 -
Integer Inquiry(大数)
A - Integer InquiryTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmitStatusDescriptionOne of the first users of BIT's new supercomputer was Chip Diller. He exte原创 2016-03-22 08:32:47 · 387 阅读 · 0 评论 -
Beautiful Year(cf)
F - Beautiful YearTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 271ADescriptionIt seems like the year of 2013 came only yest原创 2016-03-26 14:27:14 · 421 阅读 · 0 评论 -
迷宫问题(dfs)
H - 迷宫问题Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 3984Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1,原创 2016-04-07 21:20:39 · 464 阅读 · 0 评论