結果

問題 No.871 かえるのうた
ユーザー d_sei
提出日時 2019-09-05 11:36:40
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 770 bytes
コンパイル時間 1,010 ms
コンパイル使用メモリ 87,572 KB
実行使用メモリ 13,768 KB
最終ジャッジ日時 2025-01-03 04:19:21
合計ジャッジ時間 60,234 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 10 TLE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include <vector>
#include<cmath>
#include<iomanip>
#include<queue>
using namespace std;
typedef long long int lont;
int main() {
	lont N, K;
	cin >> N >> K;
	vector<lont>veca(N);
	vector<lont>vecb(N);
	for (int ia = 0; ia < N; ia++) {
		cin >> veca.at(ia);
	}
	for (int ib = 0; ib < N; ib++) {
		cin >> vecb.at(ib);
	}
	vector<lont>vecc(N);
	vecc.at(K - 1)++;
	for(int ie=0;ie<3;ie++){
		for (int ic = 0; ic < N; ic++) {
			for (int id = 0; id < N; id++) {
				if (vecc.at(ic) &&
					veca.at(ic) - vecb.at(ic) <= veca.at(id) &&
					veca.at(id) <= veca.at(ic) + vecb.at(ic)) {
					vecc.at(id)++;
				}
			}
		}
		}
	int cnt = 0;
	for (int ih = 0; ih < N; ih++) {
		if (vecc.at(ih)) {
			cnt++;
		}
	}
	cout << cnt << endl;
}

	
0