传送门
nc题,一直sort就过了
代码
#include <cstdio> #include <iostream> #include <algorithm> #define N 2001 #define min(x, y) ((x) < (y) ? (x) : (y)) int n, m, k, l, d; struct node p1[N], p2[N]; inline int read() inline bool cmp(node x, node y) inline bool cmp1(node x, node y) int main() std::sort(p1 + 1, p1 + n, cmp); std::sort(p1 + 1, p1 + k + 1, cmp1); for(i = 1; i <= k; i++) printf("%d ", p1[i].id); puts(""); std::sort(p2 + 1, p2 + m, cmp); std::sort(p2 + 1, p2 + l + 1, cmp1); for(i = 1; i <= l; i++) printf("%d ", p2[i].id); puts(""); return 0; }
上一篇:[luoguP1033] 自由落体(模拟?)
下一篇:[luoguP1076] 寻宝(模拟)
stl 模拟









