摘要:
Given a sequence of integers,a1,a2,...,an, we define itssign matrix Ssuch that, for1ijn,Sij= `` + "ifai+...+aj> 0;Sij= `` - "ifai+...+ajf[i-1],f[j]
#include
#include
#include
using namespace std;
const int mm=15;
vector g[mm];
int id[mm],f[mm],ans[mm];
int cas,n;
void get(int n)
{ char 阅读全文
摘要:
Problem B: Fire!Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help Joe escape the maze.Given Joe's location in the maze and which squares of the maze are on fire, you must determine whether Joe can 阅读全文