提出 #53374105
ソースコード 拡げる
// Problem: B - AtCoder Amusement Park
// Contest: AtCoder - AtCoder Beginner Contest 353
// URL: https://atcoder.jp/contests/abc353/tasks/abc353_b
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include<iostream>
#include<string>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<cstdlib>
#include<set>
#include<algorithm>
#include<cstdio>
const int N = 1e3;
using namespace std;
using ll = long long;
void vol()
{
int n,k;cin>>n>>k;
queue<int>v;
for(int i=1;i<=n;i++){
int x;cin>>x;
v.push(x);
}
int cnt=0;
while(!v.empty()){
int y=v.front();
v.pop();
cnt++;
if(v.empty()){break;}
if(!v.empty() && k-y>=v.front()){
v.pop();
}
}
cout << cnt<<'\n';
}
int main()
{
std::ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int t;
//cin >> t;
t=1;
while (t--) {
vol();
}
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - AtCoder Amusement Park |
| ユーザ | mellowsky |
| 言語 | C++ 20 (gcc 12.2) |
| 得点 | 0 |
| コード長 | 945 Byte |
| 結果 | WA |
| 実行時間 | 1 ms |
| メモリ | 3608 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 200 | ||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 3324 KiB |
| 00_sample_01.txt | AC | 1 ms | 3608 KiB |
| 00_sample_02.txt | AC | 1 ms | 3380 KiB |
| 01_random_03.txt | WA | 1 ms | 3400 KiB |
| 01_random_04.txt | WA | 1 ms | 3436 KiB |
| 01_random_05.txt | WA | 1 ms | 3520 KiB |
| 01_random_06.txt | WA | 1 ms | 3396 KiB |
| 01_random_07.txt | WA | 1 ms | 3480 KiB |
| 01_random_08.txt | WA | 1 ms | 3472 KiB |
| 01_random_09.txt | AC | 1 ms | 3420 KiB |
| 01_random_10.txt | AC | 1 ms | 3412 KiB |
| 01_random_11.txt | WA | 1 ms | 3436 KiB |
| 01_random_12.txt | AC | 1 ms | 3532 KiB |
| 01_random_13.txt | AC | 1 ms | 3396 KiB |
| 01_random_14.txt | AC | 1 ms | 3400 KiB |