提出 #47454329
ソースコード 拡げる
#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;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - Not Too Hard |
| ユーザ | yhx0322 |
| 言語 | C++ 20 (gcc 12.2) |
| 得点 | 100 |
| コード長 | 1095 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 3660 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 | 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 |