1052. Linked List Sorting (25)

题目:https://www.patest.cn/contests/pat-a-practise/1052

#include
#include
using namespace std;
#define maxn 100010
struct Node
{
  int address,next;
  int data;
  int flag;
  Node()
  {
    address = 0;
    next = -1;
    data = 100010;
    flag = 0;
  }
}node[maxn];

bool cmp(Node a, Node b)
{
  if(a.flag == 0 || b.flag == 0) return a.flag>b.flag;
  else return a.data


你可能感兴趣的:(PAT甲级)