| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 159085 | 王润中 | 【数组】猴子选大王(monkey) | C++ | Wrong Answer | 1 MS | 204 KB | 599 | 2026-08-25 17:04:45 |
#include <stdio.h> int main() { int N; int a[1000]; scanf("%d", &N); int count = 0, number = N; for (int i = 0; i < N; i++) a[i] = i + 1; while (number > 1) { for (int i = 0; i < N; i++) { if (a[i] == 0) continue; count++; if (count == 3) { a[i] = 0; count = 0; number--; } } } for (int i = 0; i < N; i++) if (a[i] != 0) printf("%d", a[i]); return 0; }
------Input------
255
------Answer-----
151
------Your output-----
56