7 CyuuniChin

尚未进行身份认证

我要认证

暂无相关简介

等级
TA的排名 11w+

[NOIP 模拟]P老师的旅行 Spfa+树状数组

描述P老师要去旅行,旅行的途中会经过n个城市(城市按1~n编号),从i城市到j城市距离为d,p老师想要走最短的路,但是p老师远没有这么简单,p老师不仅想要走最短的路,还想要带女朋友一路走,可是女朋友方向感很差,如果不是按城市编号顺序前进,每经过一个城市p老师的女朋友的不快乐值会增加比当前城市编号高的城市个数(即行进路线符合升序),求p老师的走过的最短路和他女朋友的不快乐值,如果不快乐值为0输出

2015-11-06 12:09:45

[NOIP 2005PJ]采药 随机化贪心

代码#include <cstdio>#include <cstring>#include <iostream>#include <cstdlib>#include <algorithm>#include <ctime>using namespace std;struct Holder{ int t,v;}a[100000];int cmp(Holder a,Holder b)

2015-11-05 22:44:03

[POJ 1251]Jungle Roads Kruskal

代码#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;#define MAXN 10000namespace Union_Find_Set{ int fa[MAXN]; void Initialize(){ for(int i=

2015-11-05 22:43:01

[NOIP 2012PJ]文化之旅 Flyod

代码#include <cstdio>#include <iostream>#include <cstring>using namespace std;int n,k,m,s,t,c[10000],ma[1000][1000],d[1000][1000];int main(){ memset(d,60,sizeof d); cin>>n>>k>>m>>s>>t; for

2015-11-05 19:39:37

[NOIP 2011]聪明的质检员 二分+前缀和

代码#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;typedef long long ll;//o(klogn)ll n,m,s,w[200010],v[200010],maxn=0,l,r,mid,prew[200010],pren[200010

2015-11-05 16:41:41

[OpenJudge-NOI]List stl

代码#include <cstdio>#include <iostream>#include <cstring>#include <list>#include <map>using namespace std;map<int,list<int> > m;int n,x,y;char op[10000];int main(){ scanf("%d",&n); while(

2015-11-05 13:50:59

[OpenJudge-NOI]Set stl

代码#include <cstdio>#include <cstring>#include <iostream>#include <set>#include <algorithm>using namespace std;multiset<int> s;int n,x,f[100005];char op[1000];int main(){ cin>>n; memset(f

2015-11-05 11:12:46

[OpenJudge-NOI]词典 stl

代码#include <cstdio>#include <iostream>#include <cstring>#include <map>#include <string>using namespace std;char str[100005],a[100005],b[100005];map<string,string> m;int main(){ while(gets(str

2015-11-05 11:11:51

[OpenJudge-NOI]2011 快速幂

题目大意求2011的n次方,n为高精度数题目大意枚举可以发现n=500时为1;所以取末三位对500取模代码#include <cstdio>#include <iostream>#include <cstring>using namespace std;typedef long long ll;ll Quick_Pow(ll a,ll b){ ll re=1; while(b

2015-11-05 10:36:01

[OpenJudge-NOI]走出迷宫 Bfs

代码#include <cstdio>#include <cstring>#include <iostream>#include <queue>using namespace std;int n,m,ans,vis[1000][1000];char mat[1000][1000],dir[4][2]={{0,1},{0,-1},{1,0},{-1,0}}; ;struct Point{

2015-11-05 10:04:04

[OpenJudge-NOI]走迷宫 Bfs

代码#include <cstdio>#include <iostream>#include <cstring>#include <algorithm>#include <queue>using namespace std;int r,c,vis[1000][10000],dir[4][2]={{1,0},{-1,0},{0,1},{0,-1}},ans;char mat[1000][1

2015-11-05 10:02:19

[POJ 1101]The Game Bfs

题目大意求bfs的线段拐点数只有细节!!!代码#include <cstdio>#include <iostream>#include <cstring>#include <algorithm>#include <queue>#include <cstdlib>using namespace std;int w,h,mat[500][500],x1,y1,x2,y2,dir[4][2]=

2015-11-05 08:20:29

[OpenJudge-NOI]算24 Dfs

代码#include <cstdio>#include <iostream>#include <cstring>#include <cmath>using namespace std;double a[5];int Dfs(int k){ if(k==1){ if(fabs(a[0]-24)<1e-6){ return 1; }

2015-11-04 16:29:47

[OpenJudge-NOI]取石子游戏

代码#include <cstdio>#include <iostream>#include <cstring>#include <algorithm>using namespace std;int ans;int Check(int a,int b) { ans++; if(a==b){ if(ans%2==1) return 1;else return

2015-11-04 14:34:39

[OpenJudge-NOI]走出迷宫 Bfs

代码#include <cstdio>#include <cstring>#include <iostream>#include <queue>using namespace std;int n,m,ans,vis[1000][1000];char mat[1000][1000],dir[4][2]={{0,1},{0,-1},{1,0},{-1,0}}; ;struct Point{

2015-11-04 14:33:27

[OpenJudge-NOI]棋盘问题 回溯

代码#include <cstdio>#include <iostream>#include <cstring>using namespace std;char a[100][100];int vis[100],ans,n,k;int Backtrack(int cur,int num) { if(num>k){ ans++; return 1;

2015-11-04 14:31:46

[OpenJudge-NOI]滑雪 记忆化搜索+Dp

代码#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;int r,c,mat[105][105],cnt[105][105],dir[4][2]={{1,0},{-1,0},{0,-1},{0,1}},ans(0);int dp(int i,int j){

2015-11-04 14:30:22

[OpenJudge-NOI]最低通行费 Dp

代码#include <cstdio>#include <cstring>#include <iostream>using namespace std;int n,mat[105][105],dp[105][105];int main() { cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){

2015-11-04 14:28:30

[OpenJudge-NOI]最大子矩阵 贪心

代码#include <cstdio>#include <cstring>#include <iostream>using namespace std;int g[200][200],cur[200][200][100];int n;void Pretreatment() { for(int k=0;k<n;k++) for(int i=0;i<n;i++){

2015-11-04 14:26:26

[OpenJudge-NOI]求小数的某一位

代码#include <cstdio>#include <iostream>using namespace std;long long Quick_Power(long long a,long long b){ long long re=1; while(b){ if(b&1){ re*=a; re%=1000;

2015-11-04 14:21:49

查看更多

勋章 我的勋章
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!