MSBOP 2015 Round3 register

Ended

Participants:978

Verdict:AC | WA
Submitted:2015-05-09 15:42:36

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<stdio.h>
#include<algorithm>
#include<queue>
#include<vector>
#include<string.h>
#include<math.h>
using namespace std;
typedef long long Int;
const int Maxn=100202;
int a[Maxn];
int Ref[5],cnt[5];
int n,k;
Int solve()
{
    memset(cnt,0,sizeof(cnt));
    Int ret=0;
    for(int i=1;i<=n;i++)
    {
        int t=Ref[a[i]];
        if(t==1)ret+=cnt[2]+cnt[3];
        else if(t==2)ret+=cnt[3];
        cnt[t]++;
    }return ret;
}
int main()
{
    int _,cs=1;scanf("%d",&_);
    while(_--)
    {
        scanf("%d%d",&n,&k);
        Int ans=1LL<<60;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX