Submission #61570583


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
/*
any k seq
how would it look?
[...........................]
*/
using i64 = long long;
void solve() {
int n;
cin >> n;
vector <int> a (n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
int lo = 0, hi = n;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
using namespace std;

/*
  any k seq
    how would it look?

    [...........................]
*/

using i64 = long long;
void solve() {
  int n;
  cin >> n;

  vector <int> a (n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }

  int lo = 0, hi = n;

  while (hi - lo > 1) {
    int mid = (lo + hi) >> 1;
    bool f = 1;
    for (int i = 0, j = mid; i < mid; ++i) {
      while (j < n and a[i] > a[j] / 2) { j += 1; }
      if (j >= n) { f = 0; break; }
      j += 1;
    }
    if (f) { lo = mid; }
    else hi = mid;
  }

  cout << lo << '\n';
}

int main() {
  ios_base::sync_with_stdio(0);cin.tie(NULL);
  int tests = 1;
  // cin >> tests;
  for (int i = 0; i < tests; ++i) {
    solve();
  }
}

Submission Info

Submission Time
Task E - Simultaneous Kagamimochi
User coleworld223
Language C++ 20 (gcc 12.2)
Score 450
Code Size 773 Byte
Status AC
Exec Time 50 ms
Memory 5240 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 3500 KB
00_sample_01.txt AC 1 ms 3428 KB
00_sample_02.txt AC 1 ms 3424 KB
01_random_03.txt AC 31 ms 5184 KB
01_random_04.txt AC 31 ms 4956 KB
01_random_05.txt AC 32 ms 5188 KB
01_random_06.txt AC 32 ms 4960 KB
01_random_07.txt AC 34 ms 5184 KB
01_random_08.txt AC 6 ms 3504 KB
01_random_09.txt AC 42 ms 4864 KB
01_random_10.txt AC 18 ms 4144 KB
01_random_11.txt AC 31 ms 4812 KB
01_random_12.txt AC 50 ms 4880 KB
01_random_13.txt AC 32 ms 5044 KB
01_random_14.txt AC 31 ms 4888 KB
01_random_15.txt AC 33 ms 5188 KB
01_random_16.txt AC 32 ms 4956 KB
01_random_17.txt AC 32 ms 4888 KB
01_random_18.txt AC 32 ms 4840 KB
01_random_19.txt AC 31 ms 5136 KB
01_random_20.txt AC 31 ms 5052 KB
01_random_21.txt AC 31 ms 5236 KB
01_random_22.txt AC 31 ms 4904 KB
01_random_23.txt AC 45 ms 5140 KB
01_random_24.txt AC 45 ms 4956 KB
01_random_25.txt AC 45 ms 4956 KB
01_random_26.txt AC 44 ms 5188 KB
01_random_27.txt AC 44 ms 4852 KB
01_random_28.txt AC 31 ms 5188 KB
01_random_29.txt AC 30 ms 5056 KB
01_random_30.txt AC 30 ms 4880 KB
01_random_31.txt AC 32 ms 5048 KB
01_random_32.txt AC 31 ms 5136 KB
01_random_33.txt AC 23 ms 4132 KB
01_random_34.txt AC 37 ms 4620 KB
01_random_35.txt AC 23 ms 4396 KB
02_handmade_36.txt AC 1 ms 3440 KB
02_handmade_37.txt AC 1 ms 3580 KB
02_handmade_38.txt AC 27 ms 5240 KB
02_handmade_39.txt AC 31 ms 5240 KB
02_handmade_40.txt AC 19 ms 5132 KB


2025-03-05 (Wed)
20:46:25 +00:00