Topic Links:
https://vijos.org/p/1582
Main Topic :
Is the O (o<=50) Individual in the N*m (n,m<=2000) on the lattice of the L-shaped things (a bit like the Russian block of L, can be symmetrical rotation), asked the number of people to cover the whole picture or no solution.
Topic Ideas:
Mathematical
N*m%8 if for 0 (n*m/4-1)%o+1 that personal victory.
Otherwise there is no solution.
(At that time, the hand painted about 8 or less of the sample, it feels as if there are rules to follow, slowly push but the feeling may be wrong, so secretly glanced at the other people's problem, is indeed the law. But I'm not going to prove it. )
1 //2 //by Coolxxx3 //4#include <iostream>5#include <algorithm>6#include <string>7#include <iomanip>8#include <memory.h>9#include <time.h>Ten#include <stdio.h> One#include <stdlib.h> A#include <string.h> -#include <stdbool.h> -#include <math.h> the #defineMin (a) < (b) ( A):(B)) - #defineMax (a) (a) > (b)? ( A):(B)) - #defineABS (a) ((a) >0? ( A):(-(a))) - #defineLowbit (a) (a& (a)) + #defineSqr (a) (a) * (a) - #defineSwap (a) (a) ^= (b), (b) ^= (a), (a) ^= (b) + #defineEPS 1e-8 A #defineMAX 0x7f7f7f7f at #defineINF 20000 - #definePI 3.1415926535897 - #defineN 54 - using namespacestd; - intN,m,lll,ans,cas; - CharC[n][n]; in intMain () - { to #ifndef Online_judge + //freopen ("1.txt", "R", stdin); - //freopen ("2.txt", "w", stdout); the #endif * inti,j; $ while(~SCANF ("%d", &cas) &&CAs)Panax Notoginseng { -scanf"%d%d",&n,&m); the for(i=1; i<=cas;i++) +scanf"%s", C[i]); A if(n<2|| m<2|| n*m%8!=0) puts ("Nobody can win!"); the Elseprintf"%s can win!\n", c[(m*n/4+cas-1)%cas+1]); + } - return 0; $ } $ - - /* the // - Wuyi // the */
View Code
"Math" Vijos P1582-Stupid L-array game