#include<iostream> using namespace std; int n,Max,C[4][4]; char board[5][5]; bool vis[16]; bool isok(int x,int y) { for (int i = x + 1; i < n && board[i][y] != 'X'; i++) if(board[i][y] == '0') return false; for (int i = x - 1; i >= 0 &…
Problem 1074: Hey Judge Time Limits: 1000 MS Memory Limits: 65536 KB 64-bit interger IO format: %lld Java class name: Main Description Judge Nicole collected 7 ideas for problems of different levels, she wants to create 5 problems for the n…
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C unlimited number of times. Note: All numbers (including target) will…
题目: A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents a zero or one, with the least significant bit on the right. For example, the above binary watch…
POJ 2676 Sudoku Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17627 Accepted: 8538 Special Judge Description Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the…
题目链接:http://poj.org/problem?id=2488 A Knight's Journey Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 36695 Accepted: 12462 Description Background The knight is getting bored of seeing the same black and white squares again and again…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5113 Black And White Time Limit: 2000/2000 MS (Java/Others)Memory Limit: 512000/512000 K (Java/Others) 问题描述 In mathematics, the four color theorem, or the four color map theorem, states that, given any…
Prime Ring Problem Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 42600 Accepted Submission(s): 18885 Problem Description A ring is compose of n circles as shown in diagram. Put natural num…
哈密顿绕行世界问题 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3105 Accepted Submission(s): 1918 Problem Description 一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市. Input 前20行的第i行…
Prime Ring Problem Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 34609 Accepted Submission(s): 15327 Problem Description A ring is compose of n circles as shown in diagram. Put natural numb…
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()(())", "()()()" 思路: 有关P…
The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray code. A gray code sequence must begin with 0. Fo…