Arvingers: Infinity War

Example Game

2 Approches

  • Comprehensive Method
  • Logical Method

Comprehensive Method

  • For those Marvel fans familiar with the movie.
  • Or for those that patiently reads the whole story.
  • Doctor Strange said that he saw 14000605 possible futures, only in one Thanos loses.
  • From the sample input we know that Thanos loses when n = 1.
  • So Thanos must win in the other 14000604 situations!
  • AC!

Comprehensive Method

  • For those Marvel fans familiar with the movie.
  • Or for those that patiently reads the whole story.
  • Doctor Strange said that he saw 14000605 possible futures, only in one Thanos loses.
  • From the sample input we know that Thanos loses when n = 1.
  • So Thanos must win in the other 14000604 situations!
  • AC!

Logical Method

if n is even

The chessboard is split into two symmetrical segments now. From now on Thanos can just mirror Arvin's moves.

if n is odd

Solution

#include<stdio.h>
int main(){
    int n;
    scanf("%d", &n);
    printf((n == 1) ? "Arvin" : "Thanos");
    return 0;
}

Tutorial

By Howard Yang

Tutorial

  • 54