摘要:
http://blog.chinaunix.net/uid-26833883-id-3158234.html 阅读全文
摘要:
#include#include//进位问题如3.985 应该进位3.99int main() { int n,k,i;double w,s;char str[30];while(scanf("%d%lf%d",&n,&w,&k)!=EOF) { i=(n+2)/k; n=n+2-i; s=... 阅读全文
摘要:
第i个元素a未出现过:dp[i] = (2 * dp[i-1] + 1) % mod;visit[a]代表a最后出现的位置第i个元素a出现过:dp[i] = (2 * dp[i-1] - dp[visit[a]-1]) % mod;(注意判负)例abb第一个b : a b ab第二个b :a b... 阅读全文
摘要:
#include#include#include#include#include#includeusing namespace std;#define N 30char map[N][N];struct node {double t;int x,y,f;friend bool operatorb.t... 阅读全文
摘要:
第一组实例aaaa2aaaa第二组a1c第三组abcdef2abcdbcd第四组abcdef2abcdbcde第五组aaaa2aaa第六组lgcstraightlalongahisnstreet5strlongtreebigintegerellipse#include#include//考虑了很多实... 阅读全文
摘要:
#include#includeint total(int x,int m) {int sum=0;while(x>0) {sum+=x%m;x/=m;}return sum;}int main() { __int64 n,suma,i; int m,t,ans,j,h;scanf("%d",&t)... 阅读全文
摘要:
#include#include#define N 51000char s1[200],s2[200],s[N];int main() { int n,m,len,i,j,f;char ch,chr;while(scanf("%s",s1)!=EOF) {getchar();gets(s2);ge... 阅读全文
摘要:
最短路的优先队列做法:#include#include#include#define N 100010#define inf 0x3fffffffusing namespace std;int first[N],next[N],u[N],v[N],w[N],d[N];int main(){int t... 阅读全文