AtCoder Regular Contest 070

Submission #1358434

Source codeソースコード

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  long n, k;
  cin >> n >> k;

  vector<int> cs(n);

  for (int& i : cs) {
    cin >> i;
  }

  int maxv = cs[0];
  long sum = 0;
  for (int i : cs) {
    maxv = max(maxv, i);
    sum += i;
  }

  long count = 0;
  for (int i : cs) {
    if (sum - i >= k && sum - maxv - i < k) { count += 1; }
  }

  if (sum < k) {
    count = n;
  }

  cout << count << endl;
  return 0;
}

Submission

Task問題 D - No Need
User nameユーザ名 kocw
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 WA
Score得点 0
Source lengthソースコード長 552 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Sample - 0_000.txt,0_001.txt,0_002.txt
Subtask 0 / 300 0_000.txt,0_001.txt,0_002.txt,1_003.txt,1_004.txt,1_005.txt,1_006.txt,1_007.txt,1_008.txt,1_009.txt,1_010.txt,1_011.txt,1_012.txt,1_013.txt,1_014.txt,1_015.txt,1_016.txt,1_017.txt,1_018.txt,1_019.txt,1_020.txt,1_021.txt,1_022.txt,1_023.txt,1_024.txt,1_025.txt
All 0 / 300 0_000.txt,0_001.txt,0_002.txt,1_003.txt,1_004.txt,1_005.txt,1_006.txt,1_007.txt,1_008.txt,1_009.txt,1_010.txt,1_011.txt,1_012.txt,1_013.txt,1_014.txt,1_015.txt,1_016.txt,1_017.txt,1_018.txt,1_019.txt,1_020.txt,1_021.txt,1_022.txt,1_023.txt,1_024.txt,1_025.txt,2_026.txt,2_027.txt,2_028.txt,2_029.txt,2_030.txt,2_031.txt,2_032.txt,2_033.txt,2_034.txt,2_035.txt,2_036.txt,2_037.txt,2_038.txt,2_039.txt,2_040.txt,2_041.txt,2_042.txt,2_043.txt,2_044.txt,2_045.txt,2_046.txt,2_047.txt,2_048.txt,2_049.txt,2_050.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
0_000.txt AC 1 ms 256 KB
0_001.txt AC 1 ms 256 KB
0_002.txt AC 1 ms 256 KB
1_003.txt AC 1 ms 256 KB
1_004.txt AC 1 ms 256 KB
1_005.txt AC 1 ms 256 KB
1_006.txt AC 1 ms 256 KB
1_007.txt AC 1 ms 256 KB
1_008.txt AC 1 ms 256 KB
1_009.txt AC 1 ms 256 KB
1_010.txt AC 1 ms 256 KB
1_011.txt AC 1 ms 256 KB
1_012.txt AC 1 ms 256 KB
1_013.txt AC 1 ms 256 KB
1_014.txt AC 1 ms 256 KB
1_015.txt AC 1 ms 256 KB
1_016.txt AC 1 ms 256 KB
1_017.txt AC 1 ms 256 KB
1_018.txt AC 1 ms 256 KB
1_019.txt WA
1_020.txt AC 1 ms 256 KB
1_021.txt AC 1 ms 256 KB
1_022.txt AC 1 ms 256 KB
1_023.txt AC 1 ms 256 KB
1_024.txt WA
1_025.txt WA
2_026.txt AC 1 ms 256 KB
2_027.txt AC 1 ms 256 KB
2_028.txt WA
2_029.txt AC 1 ms 256 KB
2_030.txt AC 1 ms 256 KB
2_031.txt AC 2 ms 256 KB
2_032.txt AC 2 ms 256 KB
2_033.txt AC 2 ms 256 KB
2_034.txt AC 2 ms 256 KB
2_035.txt AC 2 ms 256 KB
2_036.txt AC 2 ms 256 KB
2_037.txt AC 1 ms 256 KB
2_038.txt AC 1 ms 256 KB
2_039.txt AC 1 ms 256 KB
2_040.txt WA
2_041.txt AC 2 ms 256 KB
2_042.txt AC 2 ms 256 KB
2_043.txt AC 1 ms 256 KB
2_044.txt AC 2 ms 256 KB
2_045.txt AC 1 ms 256 KB
2_046.txt WA
2_047.txt WA
2_048.txt WA
2_049.txt WA
2_050.txt WA