摘要: 3757一个模拟题,简单,但容易错;3758 大素数判定就行;#include#include#include#define maxn 100009using namespace std;int ans[3];int hit[maxn];int in[maxn];int ball[maxn];bool vis[maxn];int main(){ int n,m; int p,q; while(scanf("%d%d",&n,&m)!=EOF) { ans[0]=0; ans[1]=0; memset(vis,0,sizeof v... 阅读全文
posted @ 2014-03-02 23:11 Yours1103 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 很简单但很虐心的一道题;我感觉自己的算法没错,但是老是过不了;= =但是还是把代码贴出来;我的方法,用并查集的方式做一课树,然后对树进行遍历;有多少棵树就有多少个点剩余;#include#include#include#define inf 1000000000#define maxn 2009using namespace std;struct node{ int x; int y; int p; int sum; int son[5]; bool operator =4)flag=0; return flag;}void dfs(int root)... 阅读全文
posted @ 2014-03-02 23:07 Yours1103 阅读(267) 评论(0) 推荐(0) 编辑