Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
142115 | 梁乃元 | 猴子选大王 | C++ | 解答错误 | 0 | 10 MS | 248 KB | 402 | 2024-04-06 16:43:16 |
# include <bits/stdc++.h> using namespace std ; queue <int> q ; int main ( ) { int n , m ; cin >> m >> n ; for ( int i = 1 ; i <= n ; i ++ ) { q . push ( i ) ; } for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j < m ; j ++ ) { int x = q . front ( ) ; q . pop ( ) ; q . push ( x ) ; } q . pop ( ) ; } cout << q . front ( ) << endl ; return 0 ; }