[提交答案题] UOJ #109 【APIO2013】TASKSAUTHOR
来源:互联网 发布:女性 音乐家 知乎 编辑:程序博客网 时间:2024/06/05 00:50
数据结构学傻 做做提答换换口味
- 最短路
- case1 case3 卡掉floyd 101个点 没有边
- case2 case5 卡掉bellman 可以有重边
O(nm) 随便卡 - case4 case6 卡掉dij 这个dij没毛病? 负边 可以卡成指数级
- 盗图自 fjzzq2002 orz
- 图染色
- case7 卡掉搜索? xjb随机就行了吧
- case8 放搜索过去? 二分图
case1 case3
#include<cstdio>#include<cstdlib>#include<algorithm>using namespace std;int main(){ freopen("t.in","w",stdout); int n=101; printf("%d\n",n); for (int i=1;i<=n;i++){ printf("0\n"); } int Q=0; printf("%d\n",Q);}
case2 case5
#include<cstdio>#include<cstdlib>#include<algorithm>#include<ctime>using namespace std;int a[1000];int main(){ srand(time(0)); freopen("t.in","w",stdout); int n=100; printf("%d\n",n); int m=1011; for (int i=1;i<n;i++) a[i]++,m--; while (m--){ a[rand()%(n-1)+1]++; } int sum=0; for (int i=0;i<n;i++){ printf("%d",a[i]); sum+=a[i]; while (a[i]--){ printf(" %d %d",i-1,1); }printf("\n"); } int Q=10; printf("%d\n",Q); for (int i=1;i<=Q;i++) printf("%d %d\n",n-1,0); return 0;}
case4 case6
#include<cstdio>#include<cstdlib>#include<algorithm>using namespace std;int main(){ freopen("t.in","w",stdout); int n=33,a=1<<17; int cnt=0; printf("%d\n",n); cnt++; for (int i=0;i<n;i++){ if (i>=n-1){ printf("%d\n",0); cnt++; continue; } if (i%2==0) printf("2 %d -1 %d -2\n",i+1,i+2),cnt+=5; else printf("1 %d -%d\n",i+1,a>>=1),cnt+=3; } int Q=6; printf("%d\n",Q); cnt++; while (Q--) printf("%d %d\n",0,n-1),cnt+=2; fprintf(stderr,"%d\n",cnt); getchar(); return 0;}
case7
#include<cstdio>#include<cstdlib>#include<algorithm>#include<ctime>using namespace std;int vst[77][77];int main(){ srand(time(0)); freopen("t.in","w",stdout); int n=71,m=1501; printf("%d %d\n",n,m); for (int i=1;i<=m;i++){ int u,v; do u=rand()%n+1,v=rand()%n+1; while (vst[u][v] || u==v); vst[u][v]=vst[v][u]=1; printf("%d %d\n",u-1,v-1); } return 0;}
case8
#include<cstdio>#include<cstdlib>#include<algorithm>using namespace std;int main(){ //freopen("t.in","r",stdin); freopen("t.in","w",stdout); int n=100,m=1501; printf("%d %d\n",n,m); int ncnt=0; for (int i=1;i<=50;i++) for (int j=51;j<=100;j++){ ++ncnt; printf("%d %d\n",i-1,j-1); if (ncnt==m) return 0; }}
阅读全文
0 0
- [提交答案题] UOJ #109 【APIO2013】TASKSAUTHOR
- UOJ 109 [APIO2013]TASKSAUTHOR
- UOJ#109. 【APIO2013】TASKSAUTHOR
- BZOJ 3205 & UOJ 107 [APIO2013]ROBOTS
- UOJ#34 FFT模板题
- bzoj3205: [Apio2013]机器人
- 3206: [Apio2013]道路费用
- 3205: [Apio2013]机器人
- BZOJ3206: [Apio2013]道路费用
- BZOJ3205: [Apio2013]机器人
- 【UOJ#26.】【IOI2014】Game 交互题,构造
- [UOJ 26][IOI 2014]Game(构造题)
- [UOJ 82]水题生成器(乱搞)
- UOJ #82. 【UR #7】水题生成器
- UOJ 82 [UR #7]水题生成器
- [单纯形 模板题] UOJ #179 线性规划
- [FFT 模板题] UOJ #34 多项式乘法
- UOJ #82 [UR #7] 水题生成器
- maven之clean、install命令
- 爬虫中使用的数据结构
- ArcGIS Earth数据小析
- #leetcode#500 Keyboard Row
- shader
- [提交答案题] UOJ #109 【APIO2013】TASKSAUTHOR
- shader2
- PAT 1001
- 一个神奇的???whatever~~
- PAT 1002
- Build VIM&GVIM Executables on Windows
- leetcode-11. Container With Most Water
- 设计模式之工厂方法模式
- iOS 笔试题02~[有答案]