poj 1166 The Clocks
来源:互联网 发布:java引用值 编辑:程序博客网 时间:2024/06/06 03:00
#include<stdlib.h>#include<string.h>#include<stdio.h>#include<ctype.h>#include<math.h>#include<queue>using namespace std;int n, m, sum, count, flag;int num[110];int main(){int i, j, k, t, cas=0;int c[20];int f=0;memset( c,0,sizeof( c ) );flag=0;for( i=0;i<9;i++ ){scanf( "%d",&num[i] );}for( i=0;i<4;i++ ){num[0]++;num[1]++;num[3]++;num[4]++;c[0]++;for( j=0;j<4;j++ ){num[0]++;num[1]++;num[2]++;c[1]++;for( k=0;k<4;k++ ){num[1]++;num[2]++;num[4]++;num[5]++;c[2]++;for( int l=0;l<4;l++ ){num[0]++;num[3]++;num[6]++;c[3]++;for( int m=0;m<4;m++ ){num[1]++;num[3]++;num[4]++;num[5]++;num[7]++;c[4]++;for( int n=0;n<4;n++ ){num[2]++;num[5]++;num[8]++;c[5]++;for( int o=0;o<4;o++ ){num[3]++;num[4]++;num[6]++;num[7]++;c[6]++;for( int p=0;p<4;p++ ){num[6]++;num[7]++;num[8]++;c[7]++;for( int q=0;q<4;q++ ){num[4]++;num[5]++;num[7]++;num[8]++;c[8]++;if( num[0]%4==0&&num[1]%4==0&&num[2]%4==0&&num[3]%4==0&&num[4]%4==0&&num[5]%4==0&&num[6]%4==0&&num[7]%4==0&&num[8]%4==0 ){flag=1;break;}}if( flag )break;}if( flag )break;}if( flag )break;}if( flag )break;}if( flag )break;}if( flag ) break;}if( flag )break;}if( flag )break;}for( i=0;i<9;i++ ){for( j=0;j<c[i]%4;j++ )printf( "%d ",i+1 );}printf( "\n" );return 0;}
0 0
- POJ 1166 The clocks
- POJ 1166 The Clocks
- POJ 1166 The Clocks
- POJ 1166 The Clocks
- poj 1166 The Clocks
- POJ 1166 The Clocks
- poj 1166 The Clocks
- poj 1166 The Clocks
- poj 1166 The Clocks
- poj The Clocks 1166
- POJ 1166 The Clocks
- POJ 1166:The Clocks
- POJ 1166 The Clocks
- POJ The Clocks 1166
- POJ 1166 The Clocks 笔记
- Poj-1166-The Clocks-枚举
- POJ 1166 The Clocks(暴力搜索)
- poj 1166 The Clocks 暴力枚举
- POJ 1852 Ants
- 《Programming in Lua 3》读书笔记(十七)
- 内部类知识介绍及要点提醒-----------黑马程序员
- codeforces 452E Three strings 后缀数组+并查集
- Splay Tree学习过程
- poj 1166 The Clocks
- C++中map容器的说明和使用技巧
- HDU 2546 饭卡 DP+01背包
- hdu 4913 Least common multiple(线段树)
- ios 指示器MBProgressHUD 的使用
- nyoj1038纸牌游戏(模拟题)
- SPOJ GNYR09F
- oracle 卸载
- javascript小白学习指南3