結果
問題 |
No.871 かえるのうた
|
ユーザー |
![]() |
提出日時 | 2019-09-05 11:35:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 771 bytes |
コンパイル時間 | 912 ms |
コンパイル使用メモリ | 85,896 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2025-01-03 03:21:21 |
合計ジャッジ時間 | 64,963 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 8 TLE * 19 |
ソースコード
#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<10;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; }