Skip to content

Commit

Permalink
Create BUAAOJ5736 阶梯Nim.c
Browse files Browse the repository at this point in the history
  • Loading branch information
GoatGirl98 authored Aug 5, 2024
1 parent a3f2592 commit 1fbf5df
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <stdio.h>
#define N 1010
int T;
int n;
int a[N], b[N];
int main()
{
T = 1;
while (T--)
{
n = 3;
for (int i = 1; i <= n; ++i)
scanf("%d", &a[i]);
int ans = 0;
for (int i = 1; i <= n; ++i)
b[n - i + 1] = a[i] - a[i - 1] - 1;
for (int i = 1; i <= n; i += 2)
ans ^= b[i];
long long step = (ans ? 1 : 0) + ((1ll * n * (n + 1)) >> 1);

puts((step & 1) ? "W1N" : "L0SE");
}
}

0 comments on commit 1fbf5df

Please sign in to comment.