题目链接:http://hihocoder.com/problemset/problem/1196 #include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; ; int equ, var; int a[maxn][maxn]; int x[maxn]; int free_x[maxn]; int free_num; int ret; int gauss() { int max_r, col,
Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8481 Accepted: 5479 Description In an extended version of the game Lights Out, is a puzzle with 5 rows of 6 buttons each (the actual puzzle has 5 rows of 5 buttons each). Each button has
题目链接:http://poj.org/problem?id=3185 题意:20盏灯排成一排.操作第i盏灯的时候,i-1和i+1盏灯的状态均会改变.给定初始状态,问最少操作多少盏灯使得所有灯的状态最后均为0. 思路:高斯消元,记录变元个数,枚举变元. int a[N][N],ans[N]; vector<int> b; int Gauss() { b.clear(); int i,j=1,k,t; for(i=1;i<=20;i++) { for(k=j;k<=20;k++) i
题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=200 200. Cracking RSA time limit per test: 0.25 sec.memory limit per test: 65536 KB input: standardoutput: standard The following problem is somehow related to the final stage of many famous intege
给你一个未知的d次多项式在0,1,...,d+2处的取值,其中有且只有一个是错的,问你哪个是错的. 枚举哪个是错的,再在剩下的d+2个中取d+1个高斯消元,解出多项式系数,然后代一下最后剩下的那个数看看是否合法,如果合法再看看那个错的是否真的错了. #include<cstdio> #include<cmath> #include<algorithm> #include<cstring> using namespace std; #define N 11 d
任意门:http://poj.org/problem?id=1681 Painter's Problem Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 7667 Accepted: 3624 Description There is a square wall which is made of n*n small square bricks. Some bricks are white while some bric
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 45691 Accepted: 19590 Description Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the