Submission #47454329


Source Code Expand

#include <bits/stdc++.h>
#define const constexpr
#define pb(x) push_back(x)
#define Y "Yes"
#define F "No"
#define mem(a, val) memset(a, val, sizeof(a))
#define rep(i, s, t) for (int i = (s); i <= (t); i++)
#define repp(i, t, s) for (int i = (t); i >= (s); i--)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int INF = 0x3f3f3f3f, MOD = 1e9 + 7;
const int N = 20;

template<typename T> inline void read(T &x) {
	x = 0; int f = 1; char c = getchar();
	while (!isdigit(c)) { if (c == '-') f = -1; c = getchar(); }
	while (isdigit(c)) { x = x * 10 + c - '0'; c = getchar(); }
	x *= f;
}

ll qpow(int x, int y) {
	ll ret = 1;
	while (y > 0) {
		if (y & 1) ret = (ret * x) % MOD;
		x = (x * x) % MOD;
		y >>= 1;
	}
	return ret;
}

int n, t, a[N], x;

inline void solve() {
	read(n);
	read(x);
	int cnt = 0;
	rep(i, 1, n) {
		read(a[i]);
		if (a[i] <= x) cnt += a[i];
	}
	cout << cnt;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	t = 1;
//	read(t);
	while (t--) solve();
	return 0;
}

Submission Info

Submission Time
Task A - Not Too Hard
User yhx0322
Language C++ 20 (gcc 12.2)
Score 100
Code Size 1095 Byte
Status AC
Exec Time 1 ms
Memory 3660 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 13
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 3388 KiB
001.txt AC 1 ms 3500 KiB
002.txt AC 1 ms 3572 KiB
003.txt AC 1 ms 3528 KiB
004.txt AC 1 ms 3460 KiB
005.txt AC 1 ms 3576 KiB
006.txt AC 1 ms 3460 KiB
007.txt AC 1 ms 3476 KiB
008.txt AC 1 ms 3660 KiB
009.txt AC 1 ms 3552 KiB
example0.txt AC 1 ms 3468 KiB
example1.txt AC 1 ms 3452 KiB
example2.txt AC 1 ms 3448 KiB