"Math" Vijos P1582-Stupid L-array game

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.