| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1359759 | FZ_Laabidi | Bikeparking (EGOI24_bikeparking) | C++20 | 40 ms | 7004 KiB |
#include <bits/stdc++.h>
using namespace std;
signed main(){
int n; cin >> n;
vector<int> x(n), y(n);
vector<int> peope, avai;
for(int i=0; i<n; i++){
cin >> x[i];
if(x[i]==1)avai.push_back(i);
}
for(int i=0; i<n; i++){
cin >> y[i];
if(y[i]==1)peope.push_back(i);
}
if(n==1)cout << 0 << endl;
else{
int m = peope.size();
int happy = 0;
for(int i=m-1; i>-1; i--){
int k = peope[i];
while (!avai.empty()&& avai.back()>=k){
avai.pop_back();
}
if(!avai.empty())happy++;
}
cout << 2*happy-m << endl;
}
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
