Submission #61593500
Source Code Expand
Copy
// Problem: E - Simultaneous Kagamimochi// Contest: AtCoder - HHKB Programming Contest 2025(AtCoder Beginner Contest 388)// URL: https://atcoder.jp/contests/abc388/tasks/abc388_e// Memory Limit: 1024 MB// Time Limit: 2000 ms//// Powered by CP Editor (https://cpeditor.org)#include <bits/stdc++.h>#define int long long#define pb push_back#define rep1(i, a, b) for (int i = (a); i <= (b); i++)#define rep2(i, b, a) for (int i = (b); i >= (a); i--)using ll = long long;using ull = unsigned long long;using namespace std;constexpr double PI = 3.14159265358979323846;constexpr ll llmax = 1e18;
// Problem: E - Simultaneous Kagamimochi // Contest: AtCoder - HHKB Programming Contest 2025(AtCoder Beginner Contest 388) // URL: https://atcoder.jp/contests/abc388/tasks/abc388_e // Memory Limit: 1024 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org) #include <bits/stdc++.h> #define int long long #define pb push_back #define rep1(i, a, b) for (int i = (a); i <= (b); i++) #define rep2(i, b, a) for (int i = (b); i >= (a); i--) using ll = long long; using ull = unsigned long long; using namespace std; constexpr double PI = 3.14159265358979323846; constexpr ll llmax = 1e18; constexpr ll llmin = -1e18; constexpr char nl = '\n'; template <typename T> bool chkmin(T &a, T b) { return (b < a) ? a = b, 1 : 0; } template <typename T> bool chkmax(T &a, T b) { return (b > a) ? a = b, 1 : 0; } void solve_case(); signed main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int Tests = 1; // cin >> Tests; while (Tests--) { solve_case(); } return 0; } void solve_case() { int n; cin>>n; vector<int>a(n+1); rep1(i,1,n)cin>>a[i]; int cnt=0; int j=1; for(int i=1;i<=n;i++){ auto it=lower_bound(a.begin()+j+1, a.end(), 2*a[i]); if(it != a.end()){ j=it-a.begin(); cnt++; } else break; } cout<<cnt; }
Submission Info
Submission Time | |
---|---|
Task | E - Simultaneous Kagamimochi |
User | euygnauhz |
Language | C++ 20 (gcc 12.2) |
Score | 0 |
Code Size | 1340 Byte |
Status | WA |
Exec Time | 31 ms |
Memory | 7164 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 450 | ||||||
Status |
|
|
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 | 3436 KB |
00_sample_01.txt | AC | 1 ms | 3368 KB |
00_sample_02.txt | AC | 1 ms | 3496 KB |
01_random_03.txt | AC | 30 ms | 7040 KB |
01_random_04.txt | WA | 30 ms | 6988 KB |
01_random_05.txt | WA | 30 ms | 6988 KB |
01_random_06.txt | AC | 30 ms | 7164 KB |
01_random_07.txt | AC | 30 ms | 6952 KB |
01_random_08.txt | AC | 4 ms | 3716 KB |
01_random_09.txt | AC | 27 ms | 6984 KB |
01_random_10.txt | AC | 15 ms | 5144 KB |
01_random_11.txt | WA | 30 ms | 6948 KB |
01_random_12.txt | AC | 27 ms | 7064 KB |
01_random_13.txt | AC | 26 ms | 7068 KB |
01_random_14.txt | WA | 30 ms | 6996 KB |
01_random_15.txt | AC | 27 ms | 6964 KB |
01_random_16.txt | WA | 28 ms | 6980 KB |
01_random_17.txt | WA | 30 ms | 7088 KB |
01_random_18.txt | WA | 30 ms | 6984 KB |
01_random_19.txt | WA | 31 ms | 7072 KB |
01_random_20.txt | WA | 31 ms | 7160 KB |
01_random_21.txt | WA | 31 ms | 6984 KB |
01_random_22.txt | WA | 31 ms | 7160 KB |
01_random_23.txt | AC | 30 ms | 6992 KB |
01_random_24.txt | AC | 29 ms | 7092 KB |
01_random_25.txt | AC | 29 ms | 7084 KB |
01_random_26.txt | AC | 30 ms | 7092 KB |
01_random_27.txt | AC | 29 ms | 7084 KB |
01_random_28.txt | WA | 29 ms | 6956 KB |
01_random_29.txt | WA | 29 ms | 7072 KB |
01_random_30.txt | WA | 29 ms | 6996 KB |
01_random_31.txt | WA | 29 ms | 6964 KB |
01_random_32.txt | WA | 30 ms | 7060 KB |
01_random_33.txt | AC | 15 ms | 5240 KB |
01_random_34.txt | AC | 22 ms | 6012 KB |
01_random_35.txt | AC | 17 ms | 5560 KB |
02_handmade_36.txt | AC | 1 ms | 3504 KB |
02_handmade_37.txt | AC | 1 ms | 3500 KB |
02_handmade_38.txt | AC | 25 ms | 6988 KB |
02_handmade_39.txt | AC | 27 ms | 7148 KB |
02_handmade_40.txt | AC | 14 ms | 7016 KB |