Submission #61605018


Source Code Expand

#include <bits/stdc++.h>
//#define int long long 
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
#define fr first
#define se second
#define endl '\n'
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

const int N = 5e5 + 10;

int n;
int a[N];

void solve()
{
	cin >> n;
	
	for(int i = 1; i <= n; i++){
		cin >> a[i];
	}
	
	int ans = 0;
	int j = (n + 1) / 2;
	for(int i = 1; i <= n / 2; i ++){
		int k = lower_bound(a + j, a + 1 + n, 2 * a[i]) - a;
		j = k + 1;
		if(k > n) break;
		ans ++;
	}

	cout << ans << endl;
}


signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int T=1; //cin>>T;
	while(T--) solve();
	return 0;
}

Submission Info

Submission Time
Task E - Simultaneous Kagamimochi
User jjjxs
Language C++ 20 (gcc 12.2)
Score 450
Code Size 721 Byte
Status AC
Exec Time 37 ms
Memory 5576 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 450 / 450
Status
AC × 3
AC × 41
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 01_random_28.txt, 01_random_29.txt, 01_random_30.txt, 01_random_31.txt, 01_random_32.txt, 01_random_33.txt, 01_random_34.txt, 01_random_35.txt, 02_handmade_36.txt, 02_handmade_37.txt, 02_handmade_38.txt, 02_handmade_39.txt, 02_handmade_40.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3572 KiB
00_sample_01.txt AC 1 ms 3364 KiB
00_sample_02.txt AC 1 ms 3472 KiB
01_random_03.txt AC 28 ms 5452 KiB
01_random_04.txt AC 28 ms 5452 KiB
01_random_05.txt AC 29 ms 5420 KiB
01_random_06.txt AC 28 ms 5576 KiB
01_random_07.txt AC 28 ms 5516 KiB
01_random_08.txt AC 4 ms 3712 KiB
01_random_09.txt AC 27 ms 5488 KiB
01_random_10.txt AC 14 ms 4492 KiB
01_random_11.txt AC 28 ms 5452 KiB
01_random_12.txt AC 27 ms 5384 KiB
01_random_13.txt AC 25 ms 5420 KiB
01_random_14.txt AC 37 ms 5452 KiB
01_random_15.txt AC 27 ms 5576 KiB
01_random_16.txt AC 27 ms 5452 KiB
01_random_17.txt AC 29 ms 5372 KiB
01_random_18.txt AC 28 ms 5456 KiB
01_random_19.txt AC 28 ms 5576 KiB
01_random_20.txt AC 28 ms 5388 KiB
01_random_21.txt AC 28 ms 5524 KiB
01_random_22.txt AC 28 ms 5576 KiB
01_random_23.txt AC 28 ms 5376 KiB
01_random_24.txt AC 28 ms 5352 KiB
01_random_25.txt AC 27 ms 5448 KiB
01_random_26.txt AC 28 ms 5380 KiB
01_random_27.txt AC 28 ms 5568 KiB
01_random_28.txt AC 31 ms 5416 KiB
01_random_29.txt AC 27 ms 5576 KiB
01_random_30.txt AC 27 ms 5576 KiB
01_random_31.txt AC 27 ms 5380 KiB
01_random_32.txt AC 27 ms 5384 KiB
01_random_33.txt AC 15 ms 4556 KiB
01_random_34.txt AC 21 ms 4972 KiB
01_random_35.txt AC 16 ms 4708 KiB
02_handmade_36.txt AC 1 ms 3500 KiB
02_handmade_37.txt AC 1 ms 3504 KiB
02_handmade_38.txt AC 23 ms 5512 KiB
02_handmade_39.txt AC 26 ms 5520 KiB
02_handmade_40.txt AC 14 ms 5452 KiB