hiho week 285 register

Ended

Participants:42

Verdict:Wrong Answer
Score:10 / 100
Submitted:2019-12-19 16:20:12

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <bits/stdc++.h>
using namespace std;
const int N = 5000 + 5;
struct Node
{
    int A,P;
}Inf[N];
bool cmp(Node x, Node y)
{
    if( x.A == y.A)
        return x.P < y.P;
    return x.A < y.A;
}
int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        int n,r;
        cin >> n >> r;
        for(int i = 0; i < n; i++)
            cin >> Inf[i].A;
        for(int i = 0; i < n; i++)
            cin >> Inf[i].P;
        sort(Inf,Inf+n,cmp);
        long long ans = 0;
        bool last = 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX