結果

問題 No.369 足し間違い
ユーザー naimonon77naimonon77
提出日時 2016-03-27 22:45:40
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 1,513 bytes
コンパイル時間 1,911 ms
コンパイル使用メモリ 160,056 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-10 04:02:22
合計ジャッジ時間 2,418 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 4 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 4 ms
6,940 KB
testcase_07 AC 4 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘void reader(int&)’:
main.cpp:26:26: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   26 | void reader(int &a){scanf("%d",&a);};
      |                     ~~~~~^~~~~~~~~
main.cpp: In function ‘void reader(double&)’:
main.cpp:27:29: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   27 | void reader(double &a){scanf("%lf",&a);};
      |                        ~~~~~^~~~~~~~~~
main.cpp: In function ‘void reader(char*)’:
main.cpp:28:28: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   28 | void reader(char a[]){scanf("%s",a);};
      |                       ~~~~~^~~~~~~~

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <list>
#define REP(i,a,b) for(i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define SQR(X)  ( (X)*(X) )
#define CUBE(X) ( (X)*(X)*(X) )
#define ALL(a) (a).begin(),(a).end()
// #define int ll

#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

bool test = 0;


void reader(int &a){scanf("%d",&a);};
void reader(double &a){scanf("%lf",&a);};
void reader(char a[]){scanf("%s",a);};
// void reader(string& a){cin >> a;};
template<class T,class U>
void reader(T& t,U& u){
  reader(t); reader(u);
}
template<class T,class U,class V>
void reader(T& t,U& u,V& v){
  reader(t); reader(u); reader(v);
}

void writer(int a,char c) {printf("%d",a); putchar(c);}
void writer(double a,char c) {printf("%.20lf",a); putchar(c);}
void writer(char a[]) {printf("%s",a);};
void writer(char a[],char c) {printf("%s",a);putchar(c);};
template<class T>
void writerLn(T t){
  writer(t,'\n');
}
template<class T,class U>
void writerLn(T t,U u){
  writer(t,' ');
  writer(u,'\n');
}
template<class T,class U,class V>
void writerLn(T t,U u,V v){
  writer(t,' '); 
  writer(u,' '); 
  writer(v,'\n'); 
}

signed main(){
  int i,j,k,l;
  int N;
  int A[10005];
  cin >> N;
  rep(i,N) cin >> A[i];
  int sum;
  cin >> sum;
  rep(i,N) {
    sum -= A[i];
  }
  cout << -sum << endl;
  return 0;
}
0