Submission #1953114


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
void wt_L(int x){
  char f[10];
  int m=0, s=0;
  if(x<0){
    m=1,
    x=-x;
  }
  while(x){
    f[s++]=x%10,
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
int D, N, arr[101];
int main(){
  int Lj4PdHRW, res;
  rd(N);
  for(Lj4PdHRW=0;Lj4PdHRW<N;Lj4PdHRW++){
    rd(D);
    arr[D]=1;
  }
  {
    int KL2GvlyY, Q5VJL1cS;
    if(101==0){
      Q5VJL1cS = 0;
    }
    else{
      Q5VJL1cS = arr[0];
      for(KL2GvlyY=1;KL2GvlyY<101;KL2GvlyY++){
        Q5VJL1cS += arr[KL2GvlyY];
      }
    }
    res =Q5VJL1cS;
  }
  wt_L(res);
  putchar_unlocked('\n');
  return 0;
}
// cLay varsion 20180107-1

// --- original code ---
// int N, D, arr[101];
// {
//   int res;
//   
//   rd(N);
//   rep(N){
//     rd(D);
//     arr[D]=1;
//   }
//   res = sum(arr(101));
//   wt(res);
// }

Submission Info

Submission Time
Task B - Kagami Mochi
User LayCurse
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1225 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 13
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
Case Name Status Exec Time Memory
a01 AC 1 ms 256 KB
a02 AC 1 ms 256 KB
a03 AC 1 ms 256 KB
b04 AC 1 ms 256 KB
b05 AC 1 ms 256 KB
b06 AC 1 ms 256 KB
b07 AC 1 ms 256 KB
b08 AC 1 ms 256 KB
b09 AC 1 ms 256 KB
b10 AC 1 ms 256 KB
b11 AC 1 ms 256 KB
b12 AC 1 ms 256 KB
b13 AC 1 ms 256 KB