摘要:
K Best Time Limit: 8000MS Memory Limit: 65536K Total Submissions: 17073 Accepted: 4286 Case Time Limit: 2000MS Special Judge Description Demy has n je 阅读全文
摘要:
K Best Time Limit: 8000MS Memory Limit: 65536K Total Submissions: 17073 Accepted: 4286 Case Time Limit: 2000MS Special Judge Description Demy has n je 阅读全文
摘要:
最高的牛 有 N 头牛站成一行,被编队为1、2、3…N,每头牛的身高都为整数。 当且仅当两头牛中间的牛身高都比它们矮时,两头牛方可看到对方。 现在,我们只知道其中最高的牛是第 P 头,它的身高是 H ,剩余牛的身高未知。 但是,我们还知道这群牛之中存在着 M 对关系,每对关系都指明了某两头牛 A 和 阅读全文
摘要:
次方快速幂 #include<iostream> using namespace std; int main() { int a, b, c, ans = 1; cin >> a >> b >> c; while(b) { if(b & 1) ans = (ans * a) % c; a = (a 阅读全文
摘要:
//http://poj.org/problem?id=1611 #include<bits/stdc++.h> using namespace std; const int maxn = 30010; int f[maxn],num[maxn],n,m; int find(int x) { ret 阅读全文
摘要:
朴素版本 #include<bits/stdc++.h> using namespace std; const int maxn = 10010; const int inf = 0x3f3f3f3f; int a[maxn][maxn],dis[maxn],visit[maxn],n,m,s,t; 阅读全文
摘要:
这一算法的核心思想是通过两边之和大于第三边不断逼近两个点的距离,最后得到最短距离。再通过不断的入列出列,最后使距离不能再小,得到最小距离。 邻接矩阵 #include<bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; co 阅读全文