MSBOP 2015 Round3 register

Ended

Participants:978

Verdict:AC | WA
Submitted:2015-05-09 16:57:04

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 <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <string.h>
using namespace std;
int a[200001];
int cnt[17];
int ans[6];
int main()
{
    int T,cas=1;
    int n,k;
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d %d",&n,&k);
        for(int i=0;i<n;i++)
            scanf("%d",&a[i]);
        memset(cnt,0,sizeof(cnt));
        memset(ans,0,sizeof(ans));
        for(int i=0;i<n;i++)
        {
            if(a[i]==1)
            {
                ans[0] += cnt[2]+cnt[3];
                ans[1] += cnt[2]+cnt[3];
                ans[2] += cnt[3];
                ans[4] += cnt[2];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX