結果

問題 No.216 FAC
ユーザー dai11dai11
提出日時 2017-08-07 09:54:49
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 897 bytes
コンパイル時間 1,331 ms
コンパイル使用メモリ 158,668 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-20 03:21:43
合計ジャッジ時間 2,060 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 1 ms
6,944 KB
testcase_12 WA -
testcase_13 AC 2 ms
6,940 KB
testcase_14 WA -
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 WA -
testcase_19 AC 1 ms
6,940 KB
testcase_20 WA -
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 1 ms
6,940 KB
testcase_24 WA -
testcase_25 AC 1 ms
6,940 KB
testcase_26 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:14:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |   scanf("%d",&N);
      |   ~~~~~^~~~~~~~~
main.cpp:19:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   19 |     scanf("%d",&a[i]);
      |     ~~~~~^~~~~~~~~~~~
main.cpp:25:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   25 |     scanf("%d",&b[i]);
      |     ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(int argc, char **argv)
{
  int N;          //問題の個数
  int i;          //ループカウンタ
  int a[100];     //問題のスコア
  int b[100];     //問題が何番の人に解かれた
  int total1 = 0; //始めに解けていない数
  int total2 = 0; //始めに解けていない数

  scanf("%d",&N);
  
  //問題のスコアの入力
  for(i = 0;i < N;i++)
  {
    scanf("%d",&a[i]);
  }
  
  //問題が何番の人に解かれたかの入力
  for(i = 0;i < N;i++)
  {
    scanf("%d",&b[i]);
  }
  
  //始めに解けていない数と始めに解けていない数をカウント
  for(i = 0;i < N;i++)
  {
    if(b[i] == 0)
    {
      total1 += a[i];
    }
    
    else
    {
      total2 += a[i];
    }
  }

  if(total1 < total2)
  {
    printf("NO\n");
  }
  
  else
  {
    printf("YES\n");
  }

  return 0;
}
0