提出 #47482257


ソースコード 拡げる

/*
Author : Hocky Yudhiono
Sab 11 Nov 2023 07:00:44 
*/

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

typedef long long LL;
typedef vector<int> vi;
typedef vector<LL> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> PII;
typedef pair<int, int> pii;
typedef pair<LL, LL> PLL;
typedef pair<LL, LL> pll;
typedef long double ld;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define popf pop_front
#define pf push_front
#define popb pop_back
#define pb push_back
#define fi first
#define se second

const double EPS = 1e-9;
const int INFMEM = 63;

// Do dir^1 to get reverse direction
const int dx[8] = {0,0,1,-1,1,-1,1,-1};
const int dy[8] = {1,-1,0,0,1,-1,-1,1};
const char dch[4] = {'R','L','D','U'};

// Do (dir + 2)%4 to get reverse direction
// const int dx[8] = {-1,0,1,0,-1,1,1,-1};
// const int dy[8] = {0,1,0,-1,1,1,-1,-1};
// const char dch[4] = {'U','R','D','L'};
const double PI = 3.141592653589793;

inline void fasterios(){
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);
}
#define endl '\n'
const int MOD = 1000000007;
// const int MOD = 998244353;
int main(){
  fasterios();
  LL n, x; cin >> n >> x;
  vector <LL> isi(n);
  LL ans = 0;
  trav(cur, isi) {
    cin >> cur;
    if(cur <= x) ans += cur;
  }
  cout << ans << endl;
}

提出情報

提出日時
問題 A - Not Too Hard
ユーザ hocky
言語 C++ 20 (gcc 12.2)
得点 100
コード長 1451 Byte
結果 AC
実行時間 1 ms
メモリ 3524 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 3
AC × 13
セット名 テストケース
Sample example0.txt, example1.txt, example2.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, example0.txt, example1.txt, example2.txt
ケース名 結果 実行時間 メモリ
000.txt AC 1 ms 3316 KiB
001.txt AC 1 ms 3452 KiB
002.txt AC 1 ms 3464 KiB
003.txt AC 1 ms 3440 KiB
004.txt AC 1 ms 3524 KiB
005.txt AC 1 ms 3464 KiB
006.txt AC 1 ms 3376 KiB
007.txt AC 1 ms 3468 KiB
008.txt AC 1 ms 3376 KiB
009.txt AC 1 ms 3464 KiB
example0.txt AC 1 ms 3464 KiB
example1.txt AC 1 ms 3404 KiB
example2.txt AC 1 ms 3512 KiB