提出 #7080129


ソースコード 拡げる

#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline 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;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline 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 N;
int A[3000];
int main(){
  int res;
  rd(N);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=0;Lj4PdHRW<(N);Lj4PdHRW++){
      rd(A[Lj4PdHRW]);
    }
  }
  {
    int KL2GvlyY, Q5VJL1cS;
    if(N==0){
      Q5VJL1cS = 0;
    }
    else{
      Q5VJL1cS = A[0];
      for(KL2GvlyY=(1);KL2GvlyY<(N);KL2GvlyY++){
        Q5VJL1cS += A[KL2GvlyY];
      }
    }
    res =Q5VJL1cS- N;
  }
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190822-2

// --- original code ---
// int N, A[3000];
// {
//   int res;
//   rd(N,A(N));
//   res = sum(A(N)) - N;
//   wt(res);
// }

提出情報

提出日時
問題 C - Modulo Summation
ユーザ LayCurse
言語 C++14 (GCC 5.4.1)
得点 300
コード長 1362 Byte
結果 AC
実行時間 1 ms
メモリ 256 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 18
セット名 テストケース
Sample sample_01, sample_02, sample_03
All 1_small_rand_0, 1_small_rand_1, 1_small_rand_2, 2_rand_0, 2_rand_1, 2_rand_2, 3_max_0, 3_max_1, 3_max_2, 4_prime_0, 4_prime_1, 4_prime_2, 5_hand_0, 5_hand_1, 5_hand_2, sample_01, sample_02, sample_03
ケース名 結果 実行時間 メモリ
1_small_rand_0 AC 1 ms 256 KiB
1_small_rand_1 AC 1 ms 256 KiB
1_small_rand_2 AC 1 ms 256 KiB
2_rand_0 AC 1 ms 256 KiB
2_rand_1 AC 1 ms 256 KiB
2_rand_2 AC 1 ms 256 KiB
3_max_0 AC 1 ms 256 KiB
3_max_1 AC 1 ms 256 KiB
3_max_2 AC 1 ms 256 KiB
4_prime_0 AC 1 ms 256 KiB
4_prime_1 AC 1 ms 256 KiB
4_prime_2 AC 1 ms 256 KiB
5_hand_0 AC 1 ms 256 KiB
5_hand_1 AC 1 ms 256 KiB
5_hand_2 AC 1 ms 256 KiB
sample_01 AC 1 ms 256 KiB
sample_02 AC 1 ms 256 KiB
sample_03 AC 1 ms 256 KiB