-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3f2592
commit 1fbf5df
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
2021级-航空航天大类-C语言程序设计/Special-五一思维训练暨喜迎北航70周年校庆特别赛/BUAAOJ5736 阶梯Nim.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} |