Submission #61591951


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
cin.tie(nullptr);
cout.tie(nullptr);
ios::sync_with_stdio(false);
ll N;
cin >> N;
ll ans=0;
deque<ll> M;
for(int i = 0; i < N; i++){
ll a;
cin >> a;
M.push_back(a);
if(i>=N/2&&M.front()*2<=a){
ans++;
M.pop_back();
M.pop_front();
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios::sync_with_stdio(false);

    ll N;
    cin >> N;
    ll ans=0;
    deque<ll> M;
    for(int i = 0; i < N; i++){
        ll a;
        cin >> a;
        M.push_back(a);
        if(i>=N/2&&M.front()*2<=a){
            ans++;
            M.pop_back();
            M.pop_front();
        }
    }
    while(!M.empty()){
        M.pop_back();
    }
    cout << ans;

    return 0;
}

Submission Info

Submission Time
Task E - Simultaneous Kagamimochi
User Ian_TheGreat
Language C++ 20 (gcc 12.2)
Score 450
Code Size 540 Byte
Status AC
Exec Time 28 ms
Memory 7620 KB

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 3608 KB
00_sample_01.txt AC 1 ms 3500 KB
00_sample_02.txt AC 1 ms 3484 KB
01_random_03.txt AC 27 ms 5228 KB
01_random_04.txt AC 27 ms 5148 KB
01_random_05.txt AC 27 ms 5148 KB
01_random_06.txt AC 28 ms 5548 KB
01_random_07.txt AC 27 ms 5536 KB
01_random_08.txt AC 4 ms 3648 KB
01_random_09.txt AC 28 ms 5664 KB
01_random_10.txt AC 16 ms 5828 KB
01_random_11.txt AC 27 ms 5216 KB
01_random_12.txt AC 28 ms 6404 KB
01_random_13.txt AC 27 ms 6276 KB
01_random_14.txt AC 27 ms 5224 KB
01_random_15.txt AC 27 ms 5936 KB
01_random_16.txt AC 26 ms 5220 KB
01_random_17.txt AC 27 ms 5268 KB
01_random_18.txt AC 27 ms 5220 KB
01_random_19.txt AC 27 ms 5204 KB
01_random_20.txt AC 27 ms 5212 KB
01_random_21.txt AC 27 ms 5200 KB
01_random_22.txt AC 27 ms 5200 KB
01_random_23.txt AC 27 ms 5232 KB
01_random_24.txt AC 28 ms 5212 KB
01_random_25.txt AC 27 ms 5260 KB
01_random_26.txt AC 28 ms 5216 KB
01_random_27.txt AC 27 ms 5236 KB
01_random_28.txt AC 27 ms 5216 KB
01_random_29.txt AC 26 ms 5220 KB
01_random_30.txt AC 26 ms 5188 KB
01_random_31.txt AC 26 ms 5236 KB
01_random_32.txt AC 25 ms 5288 KB
01_random_33.txt AC 16 ms 4680 KB
01_random_34.txt AC 23 ms 4756 KB
01_random_35.txt AC 19 ms 5252 KB
02_handmade_36.txt AC 1 ms 3476 KB
02_handmade_37.txt AC 1 ms 3404 KB
02_handmade_38.txt AC 22 ms 5184 KB
02_handmade_39.txt AC 28 ms 7620 KB
02_handmade_40.txt AC 17 ms 7472 KB


2025-03-05 (Wed)
18:12:02 +00:00