题目链接:https://www.luogu.org/problemnew/show/P1996
以下提供两种思路,一种是纯模拟(题目数据小,只有100),一种是链表(貌似还是模拟哈哈)
1.上代码
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
int n,m;
int a[105]={
0};//标记这