Submission #1863079
Source Code Expand
#include<stdio.h> int main() { long int N=0,K=0,i,j=0,k=0,count=0,MAXin=0,set=0,sum=0; scanf("%ld %ld", &N,&K); long A[N]; long MAX[N]; long Serect[N]; for(i=0;i<N;i++){ MAX[i]=0; Serect[i]=0; } for (i=0;i<N;i++){ scanf("%ld", &A[i-count]); k= i-count; for(j=0;j<i-count;j++){ if(A[j] == A[i-count]){ count++; k=j; } } MAX[k]++; } for(j=0;j<K;j++){ // printf("a\n"); MAXin = MAX[N-1]; for(i=0;i<N;i++){ // printf(" %ld %ld",MAX[i],MAXin); if(MAX[i]>MAXin && Serect[i]==0){ MAXin = MAX[i]; set=i; // printf("%ld\n",set); } } Serect[set]++; } for(i=0;i<N;i++){ if(Serect[i]==0){ sum=sum+MAX[i]; } } /* printf("%ld %ld %ld %ld\n",K,i,count,sum); for(i=0;i<N;i++){ printf(" %ld",MAX[i]); printf(" %ld\n",Serect[i]); } */ printf("%ld",sum); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Shopping Street |
User | ikorihis |
Language | C (Clang 3.8.0) |
Score | 0 |
Code Size | 981 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 128 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | WA | 1 ms | 128 KB |
02.txt | WA | 1 ms | 128 KB |
03.txt | WA | 1 ms | 128 KB |
04.txt | WA | 1 ms | 128 KB |
05.txt | WA | 1 ms | 128 KB |
06.txt | WA | 1 ms | 128 KB |
07.txt | WA | 1 ms | 128 KB |
08.txt | WA | 1 ms | 128 KB |
09.txt | WA | 1 ms | 128 KB |
10.txt | WA | 1 ms | 128 KB |
11.txt | WA | 1 ms | 128 KB |
12.txt | WA | 1 ms | 128 KB |
13.txt | WA | 1 ms | 128 KB |
14.txt | WA | 1 ms | 128 KB |
15.txt | WA | 1 ms | 128 KB |
16.txt | WA | 1 ms | 128 KB |
sample_01.txt | WA | 1 ms | 128 KB |
sample_02.txt | WA | 1 ms | 128 KB |
sample_03.txt | WA | 1 ms | 128 KB |