BusinessTasks - SRM 236 Div 1:

View Code
#include <iostream>
#include <cstdio>
#include <cstring>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;

//#define DEBUG
class BusinessTasks{
public:
string getTask(vector <string> list, int n){
int s = 0;
while(list.size() > 1){
s = (s+n-1) % list.size();
list.erase(list.begin()+s);
}
return list[0];
}
};









相关文章:

  • 2022-01-04
  • 2022-02-13
  • 2021-12-05
  • 2021-05-17
  • 2022-01-25
  • 2021-09-25
  • 2022-12-23
  • 2021-12-03
猜你喜欢
  • 2022-12-23
  • 2021-11-02
  • 2021-05-31
  • 2022-12-23
  • 2021-07-06
  • 2022-12-23
  • 2021-06-15
相关资源
相似解决方案