Qiuqiqiu |
|
||
不管道路多么崎岖坎坷,我永远不停下追逐梦想的脚步! |
2011年12月24日
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2616枚举所有情况,STL直接生成排列View Code 1 #include <cstdio> 2 #include <algorithm> 3 using namespace std; 4 int main() 5 { 6 int n,m,a[10],b[10],p[10],ans,i; 7 while (scanf("%d%d",&n,&m)!=EOF) 8 { 9 ans=n+1;10 for (i=1;i<=n;i++) scanf( 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1426DFSView Code 1 #include <stdio.h> 2 #include <string.h> 3 int r[10][10],c[10][10],g[10][10],a[10][10],flag; 4 int f(int x,int y) 5 { 6 return (x-1)/3*3+(y-1)/3+1; 7 } 8 void dfs(int u) 9 {10 if (flag) return;11 while ((u%10==0 || a[u/10][u%1. 阅读全文
|
Copyright © 2024 Qiuqiqiu
Powered by .NET 8.0 on Kubernetes |