提出 #66754378


ソースコード 拡げる

 #include <bits/stdc++.h>

using namespace std;

const char nl = '\n';
const char sp = ' ';
using u64 = unsigned long long;
using ll = long long;
using vb = vector<bool>;
using vi = vector<int>;
using vl = vector<ll>;
using vvb = vector<vb>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using si = unordered_set<int>;
using sl = unordered_set<ll>;
using tsi = set<int>;
using tsl = set<ll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vpii = vector<pii>;
using vpll = vector<pll>;
using tmii = map<int, int>;
using tmll = map<ll, ll>;
using mii = unordered_map<int, int>;
using mll = unordered_map<ll, ll>;
using pqi = priority_queue<int>;
using pqig = priority_queue<int, vi, greater<int>>;
using pql = priority_queue<ll>;
using pqlg = priority_queue<ll, vl, greater<ll>>;
using pqpii = priority_queue<pii>;
using pqpll = priority_queue<pll>;

#define tp3(T) tuple<T,T,T>
#define tp4(T) tuple<T,T,T,T>

#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define sort_and_unique(a) sort(all(a));(a).resize(unique(all(a))-(a).begin())
#define outrange(x,min,max) ((x)<(min) || (x)>(max))

ll _start_time;
#define nano (chrono::system_clock::now().time_since_epoch().count())
#define reset_timer _start_time=nano
#define chime cout<<((nano-_start_time)/1e9)<<endl
#define init_rng mt19937_64 rng(nano ^ 19980731)
#define randint(a,b) ((a)+rng()%((b)-(a)+1))

#ifndef ONLINE_JUDGE
#define debug(x) (cout<<(#x)<<':'<<(x)<<'\n')
#else
#define debug(x)
#endif

void yesno(bool a) {
	cout << (a ? "Yes\n" : "No\n");
}

template<typename L, typename R>
ostream& operator<<(ostream& out, const pair<L, R>& p) {
	out << '(' << p.first << ',' << p.second << ')';
	return out;
}

template<typename T1, typename T2, typename T3>
ostream& operator<<(ostream& out, const tuple<T1, T2, T3>& tp) {
	auto &[t1, t2, t3] = tp;
	out << '(' << t1 << ',' << t2 << ',' << t3 << ')';
	return out;
}

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
	for (auto &i : v) out << i << ' ';
	out << nl;
	return out;
}

template<typename T>
ostream& operator<<(ostream& out, const set<T>& v) {
	for (auto &i : v) out << i << ' ';
	out << nl;
	return out;
}

template<typename T>
ostream& operator<<(ostream& out, const unordered_set<T>& v) {
	for (auto &i : v) out << i << ' ';
	out << nl;
	return out;
}

template<typename K, typename V>
ostream& operator<<(ostream& out, const map<K, V>& m) {
	out << '[';
	for (auto &[k, v] : m) {
		out << k << ':' << v << sp;
	}
	out << "]\n";
	return out;
}

template<typename K, typename V>
ostream& operator<<(ostream& out, const unordered_map<K, V>& m) {
	out << '[';
	for (auto &[k, v] : m) {
		out << k << ':' << v << sp;
	}
	out << "]\n";
	return out;
}

void set_min(auto& x1,auto x2){
	x1=min(x1,x2);
}

void set_max(auto& x1,auto x2){
	x1=max(x1,x2);
}

const int MAX=200005;
int a[MAX];

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	int k;
	cin>>k;
	int ans=0;
	for(int i=0;i<n;i++){
		ans+=a[i]>=k;
	}
	cout<<ans<<nl;
}

提出情報

提出日時
問題 A - G1
ユーザ YocyCraft
言語 C++ 20 (gcc 12.2)
得点 100
コード長 3230 Byte
結果 AC
実行時間 1 ms
メモリ 3568 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 3
AC × 27
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt
ケース名 結果 実行時間 メモリ
sample_01.txt AC 1 ms 3504 KiB
sample_02.txt AC 1 ms 3428 KiB
sample_03.txt AC 1 ms 3508 KiB
test_01.txt AC 1 ms 3544 KiB
test_02.txt AC 1 ms 3424 KiB
test_03.txt AC 1 ms 3500 KiB
test_04.txt AC 1 ms 3500 KiB
test_05.txt AC 1 ms 3468 KiB
test_06.txt AC 1 ms 3568 KiB
test_07.txt AC 1 ms 3432 KiB
test_08.txt AC 1 ms 3484 KiB
test_09.txt AC 1 ms 3508 KiB
test_10.txt AC 1 ms 3524 KiB
test_11.txt AC 1 ms 3500 KiB
test_12.txt AC 1 ms 3428 KiB
test_13.txt AC 1 ms 3508 KiB
test_14.txt AC 1 ms 3420 KiB
test_15.txt AC 1 ms 3356 KiB
test_16.txt AC 1 ms 3368 KiB
test_17.txt AC 1 ms 3420 KiB
test_18.txt AC 1 ms 3504 KiB
test_19.txt AC 1 ms 3420 KiB
test_20.txt AC 1 ms 3504 KiB
test_21.txt AC 1 ms 3364 KiB
test_22.txt AC 1 ms 3508 KiB
test_23.txt AC 1 ms 3436 KiB
test_24.txt AC 1 ms 3440 KiB