Submission #47482257
Source Code Expand
/*
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;
}
Submission Info
Submission Time |
|
Task |
A - Not Too Hard |
User |
hocky |
Language |
C++ 20 (gcc 12.2) |
Score |
100 |
Code Size |
1451 Byte |
Status |
AC |
Exec Time |
1 ms |
Memory |
3524 KiB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
100 / 100 |
Status |
|
|
Set Name |
Test Cases |
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 |
Case Name |
Status |
Exec Time |
Memory |
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 |