Submission #3423272


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define RFOR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

const double EPS = 1e-14;
const double PI  = acos(-1.0);


int main(){
  int n;
  scanf("%d", &n);

  int a;
  int sum = 0;
  REP (i, n) {
    scanf("%d", &a);
    sum += a;
  }

  cout << sum - n << endl;
}

Submission Info

Submission Time
Task C - Modulo Summation
User croonalullaby
Language C++14 (GCC 5.4.1)
Score 300
Code Size 496 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:17:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &n);
                  ^
./Main.cpp:22:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &a);
                    ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 18
Set Name Test Cases
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
Case Name Status Exec Time Memory
1_small_rand_0 AC 1 ms 256 KB
1_small_rand_1 AC 1 ms 256 KB
1_small_rand_2 AC 1 ms 256 KB
2_rand_0 AC 1 ms 256 KB
2_rand_1 AC 1 ms 256 KB
2_rand_2 AC 1 ms 256 KB
3_max_0 AC 1 ms 256 KB
3_max_1 AC 1 ms 256 KB
3_max_2 AC 1 ms 256 KB
4_prime_0 AC 1 ms 256 KB
4_prime_1 AC 1 ms 256 KB
4_prime_2 AC 1 ms 256 KB
5_hand_0 AC 1 ms 256 KB
5_hand_1 AC 1 ms 256 KB
5_hand_2 AC 1 ms 256 KB
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
sample_03 AC 1 ms 256 KB