比赛-Round 1 (12 Jul, 2018)
1. 抢气球
1 #include <stdio.h> 2 #include <algorithm> 3 #include <queue> 4 5 using namespace std; 6 7 const int _N = 120000; 8 9 struct data { 10 int v, id; 11 bool operator < (const data &tmp) const 12 { 13 return this->v < tmp.v; 14 } 15 } A[_N]; 16 17 int cnt[_N]; 18 priority_queue< int, vector<int>, greater<int> > Q; 19 20 int main() 21 { 22 // freopen("balloon.in", "r", stdin); 23 // freopen("balloon.out", "w", stdout); 24 25 int N, M, i; 26 scanf("%d%d", &N, &M); 27 for (i = 1; i <= N; ++i) 28 scanf("%d", &A[i].v), A[i].id = i; 29 for (i = 1; i <= M; ++i) { 30 int tmp; 31 scanf("%d", &tmp); 32 Q.push(tmp); 33 } 34 sort(A+1, A+1+N); 35 for (i = 1; i <= N; ++i) 36 while (!Q.empty() && Q.top() <= A[i].v) 37 Q.pop(), ++cnt[A[i].id]; 38 for (i = 1; i <= N; ++i) 39 printf("%d\n", cnt[i]); 40 return 0; 41 }
2. 轰炸
3. 玩游戏
25 Jul, Update: 这似乎是 hzwer 的某场训练赛?当时懒没有写完就跑路了,现在我也不知道这是哪场比赛了OrzOrz……