
oj-----ZCMU
oj
PX-C
以学好IT技术为目的。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
彩票
第一次没有AC,输出超限#include<bits/stdc++.h>using namespace std;int main(){ int n; cin>>n; int s[7]; for(int i=0;i<7;i++) cin>>s[i]; int x; int f...原创 2018-04-12 20:16:59 · 300 阅读 · 0 评论 -
2193: Newspaper Headline
A newspaper is published in Walrusland. Its heading is s1, it consists of lowercase Latin letters. Fangy the little walrus wants to buy several such newspapers, cut out their headings, glue them one t...原创 2018-10-04 18:54:30 · 591 阅读 · 0 评论 -
ZCMU 1934: ly的二叉树
Description某一天,ly正在上数据结构课。老师在讲台上面讲着二叉树,ly在下面发着呆。突然ly想到一个问题:对于一棵n个无编号节点的有根二叉树,有多少种形态呐?你能告诉她吗? Input多组输入,处理到文件结束每一组输入一行,一个正整数n(1≤n≤1000000),意义如题目所述。 Output每组数据输出一行,包含一个正整数表示答案,由于数字可能非常大,...原创 2018-10-09 11:53:15 · 282 阅读 · 0 评论 -
一生之敌
原本可以一次AC的结果算了半天都是时间超限,把cin和cout换成scanf()和就好printf(),错误改成的代码:#include<bits/stdc++.h>using namespace std;vector<unsigned long long>a;int main(){ for(unsigned long long i=0;;i++) ...原创 2018-04-13 17:58:11 · 499 阅读 · 0 评论 -
1679: 查找2
这题常规做很简单,但提交会时间超限,超限代码#include<bits/stdc++.h>using namespace std;int main(){ int n,m; while(cin>>n>>m) { int s1[n],s2[m]; for(int i=0;i<n;i++) ...原创 2018-04-13 20:29:17 · 221 阅读 · 0 评论 -
1672: 憋说话,好好算
Description今天是热闹的双11节日,注定今天是无眠之日,你心里想着,我要快点刷完这几道题,去看一看我那价值连城的购物车,然而,刷题的时间总是过的飞快。一转眼就是夜晚了,你也刷完了题目, 这个时候,你决定出去呼吸一下新鲜的空气,也许是想去看看月亮,来个“但愿人长久,千里共婵娟”.....,突然,你陷入深思,似乎是你发现了什么,抑或是突然领悟到了什么,从你那炯炯有神,目光冰冷,眼带笑意,星目...原创 2018-05-17 12:15:07 · 346 阅读 · 0 评论 -
1776: Press the switch
挺有意思的一题:明白一个数学知识就是从1~n能有几个是a的倍数就是n/a,这题m=0||1||2m==2时麻烦一点因为重复减了,这时就要求最小公倍数了#include<bits/stdc++.h>using namespace std;int gcd(int a,int b){ if(b==0) return a; else ret...原创 2018-05-31 14:07:39 · 284 阅读 · 0 评论 -
1779: 无法言表
开始用三个循环做,是能做出来,但是一想肯定超限,结果就是超限哈哈超限代码#include<bits/stdc++.h>using namespace std;int s[50005];int main(){ int T; scanf("%d",&T); while(T--) { int n,c=1; sca...原创 2018-05-31 15:04:31 · 221 阅读 · 0 评论 -
2177: Lucky Numbers (easy)
题目链接DescriptionB. Lucky Numbers (easy)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya loves lucky numbers. Everybody knows that positive int...原创 2018-07-10 16:44:53 · 378 阅读 · 0 评论 -
ZCMU--1711: 背包
题目链接 Description你有一个神奇的背包,他的容积是m(0<m<=80),只有你装满他,你才能拿走他,现在给你n(1<=n<=20)个物品Xi(Xi<=m),那么一共有几种方式,可以让你拿走背包?Input第一行 n,m第二行 n个数字Output输出方案数Sample Input3 40 20 20 20Samp...原创 2018-07-24 17:34:21 · 370 阅读 · 0 评论 -
ZCMU--1880: wjw的火车站
Descriptionwjw最近新开了一座火车站...没错就是火车站,因为寒假过完同学们都该返校了,所以他准备大干一场,但是这里有一个问题,因为wjw的资金不足,所以这座火车站只有一条铁路,所有的火车从一侧进入,从另一侧出来,但是为了方便调度火车,所以wjw机智的修改了一下铁路。如下图,如果火车A首先进入铁路,然后火车B在火车A离开之前进入铁路,则火车A只有在火车B离开后才能离开。那么现在问题...原创 2018-07-28 16:51:16 · 233 阅读 · 0 评论 -
ZCMU--1400 给报销吗
在输入A:23.50不能用字符串输入,即使是分开输入,程序也会识别不出来这题是用01背包做,要有发散的思维 #include<bits/stdc++.h>using namespace std;const int maxn=3000000+5;int f[maxn];int dp[maxn];int main(){ dou...原创 2018-07-25 20:01:55 · 241 阅读 · 0 评论