• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
tmeteorj
Nothing is so big that it is impossible to get over, and hurt only serves to make us stronger. 没有什么事是大到无法战胜的,痛苦也只会让我们变得更加坚强。
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

随笔分类 -  ACM 模拟&枚举

上一页 1 2 3

 
POJ 3138
摘要:题意:算ACM出线名额,3种情况得名额:1、学校有队伍解题大于等于m。2、世界总决赛前20名学校。3、举办过比赛的学校。题解:后两个条件题目直接给,然后注意第一个条件只能算一次就OK了。View Code 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 int tot[105]; 6 bool mark[105]; 7 int main() 8 { 9 int n,m,num,ca=0;10 while(scanf("%d%d 阅读全文
posted @ 2012-09-21 18:03 tmeteorj 阅读(213) 评论(0) 推荐(0)
POJ 3505
摘要:题意:一个类似于硬磁盘的停车场,要从哪取车就让磁头转到哪然后让盘面旋转使得要取的车到磁头处,然后读取到信息回到出口处。。。然后给你取车顺序,问总花费时间。题解:模拟吧。View Code 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 int pos[55]; 6 struct data 7 { 8 int h,p; 9 }po[55*55];10 int main()11 {12 int T;13 for(scanf("%d 阅读全文
posted @ 2012-09-21 16:47 tmeteorj 阅读(370) 评论(0) 推荐(0)
POJ 1365
摘要:题意:给出某数的质因数分解结果,求它减一后分解的质因数结果。题解:模拟。View Code 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 const int mr=40000; 6 bool notp[mr]; 7 int pr[mr]; 8 int pn; 9 void getpri()//筛素数10 {11 pn=0;12 memset(notp,0,sizeof(notp));13 for(int i=2; i<mr; i 阅读全文
posted @ 2012-09-19 22:20 tmeteorj 阅读(234) 评论(0) 推荐(0)
POJ 1675
摘要:题意:给一个蛋糕,然后三个草莓,要求将蛋糕均分为三份(120度的扇形),不切割草莓并且保证每份蛋糕均有一个草莓,是否可行。题解:三种情况不可行:1、草莓在蛋糕圆心(被这坑了)。 2、存在两草莓与圆心三点共线。 3、三个草莓张角小于120度。View Code 1 #include<cstdio> 2 #include<cstring> 3 #include<cmath> 4 #include<algorithm> 5 using namespace std; 6 const double PI=acos(-1.0),eps=1e-8; 7 inl 阅读全文
posted @ 2012-09-18 19:56 tmeteorj 阅读(232) 评论(0) 推荐(0)
POJ 3226
摘要:题意:给定长度,然后从26个字母中选择n个来组成一个长为n的字符串,按照字典序标号为0,1,2.......,然后题目会给你字符串,求这个字符串的标号题解:从m个字母中选择k个组成序列的放法数位P(m,k),从左往右依次填充,进行到第i个字母时,字典序小于该字母的元素还有cnt个,则说明它前面还有cnt个P(m,k),然后扫一遍出答案,由于n<=26,所以要高精度。View Code 1 import java.util.*; 2 import java.math.*; 3 class Main 4 { 5 public static void main(String arg[]) .. 阅读全文
posted @ 2012-09-14 20:34 tmeteorj 阅读(387) 评论(0) 推荐(0)
POJ 1563
摘要:题意:蜗牛掉进高位H的井里,向外爬,初始高度为0,白天爬U*G,G为体力值(>=0),晚上掉下来D,初始体力值为100%,以后每爬一天减小P,其中,告诉H,U,D,P,求最后多少天爬出去或者再次掉下去。题解:这题坑爹之处在于让人产生它很高端的误解,题目叙述说连续的爬行会减体力值,开始我还误以为休息一天又恢复了,然后可以安排什么时候休息使得爬出去时间最少= =!后来有以为蜗牛体力变成0后那天不爬,下一天又满状态复活了,于是WA就出现了。不过,题目貌似也没说体力将为0后蜗牛就放弃了啊~~~View Code 1 #include<cstdio> 2 #include<cst 阅读全文
posted @ 2012-09-13 21:04 tmeteorj 阅读(176) 评论(0) 推荐(0)
POJ 2565
摘要:模拟,照着说的做就行了。#include<cstdio>#include<cstring>#include<algorithm>using namespace std;const double eps=1e-8;struct data{ int h,m,s; double tot,speed; data(int _h,int _m,int _s) { h=_h;m=_m;s=_s; tot=_h*60+_m+_s/60.0; speed=0; } data(){} void print() { ... 阅读全文
posted @ 2012-09-06 20:32 tmeteorj 阅读(194) 评论(0) 推荐(0)
POJ 1690
摘要:好坑爹的一道字符串类型的模拟题,看来我就不适合做这种题,无论怎样简单,总会错几次才能对。#include<cstdio>#include<cstring>using namespace std;int main(){ int T; for(scanf("%d ",&T); T; T--) { char s[1000]; char ans[1000]; int st[1000]; gets(s); int len,i,j,num=0; for(i=j=0; s[i]; i++) {... 阅读全文
posted @ 2012-09-06 19:45 tmeteorj 阅读(233) 评论(0) 推荐(0)
POJ 2042
摘要:打表解之View Code 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #include<cmath> 5 using namespace std; 6 const int N=(1<<15)+1; 7 int po[200],ans[N+2]; 8 int main() 9 {10 for(int i=1;i<200;po[i]=i*i,i++);11 memset(ans,0,sizeof(ans));12 for(int i1=1,tp1;p 阅读全文
posted @ 2012-08-30 18:54 tmeteorj 阅读(166) 评论(0) 推荐(0)
POJ 2273
摘要:算是进制转换吧#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int main(){ char s[30]; while(gets(s)&&strcmp(s,"R0C0")!=0) { int m=0,i; for(i=1;s[i]!='C';i++); s[i]='\0'; for(++i;s[i]!='\0';i++) m=m*10+s[i]-'0'; char 阅读全文
posted @ 2012-08-29 12:46 tmeteorj 阅读(174) 评论(0) 推荐(0)
POJ 2038
摘要:暴力+模拟=水#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int tot[50];int main(){ int n; while(scanf("%d",&n)&&n) { memset(tot,0,sizeof(tot)); char s[10]; for(int i=0;i<n;i++) { scanf("%s",s); for(int j=0;j<5;j++) ... 阅读全文
posted @ 2012-08-29 11:32 tmeteorj 阅读(268) 评论(0) 推荐(0)
 

上一页 1 2 3

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3