# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
890508 | Iwantbemaster | Parking Problem (innopolis2021_final_A) | C++17 | 19 ms | 2160 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
const int ForSpeed = [](){
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
return 0;
}();
main(){
long long test; cin >> test;
while(test--){
string str; cin >> str;
long long m = (long long)str.size();
string strw; cin >> strw;
long long n = (long long)strw.size();
vector<long long> e, o;
long long cur = 0;
for(long long i = 0; i < m;){
if(str[i] == 'X'){
i++; continue;
} long long j = i;
while(j < m && str[j] == '.') j++;
long long l = j - i;
if(l >= 2){
if(l == 2) l++;
if(l & 1){
if(l > 5) o.emplace_back(l);
cur += (l - 1) / 2;
} else {
e.emplace_back(l); cur += l / 2;
}
} i = j;
} long long cnt = 0;
if(cnt >= cur) cout << "N";
else cout << "Y";
for(long long i = 0; i < n; i++){ cnt++;
if(strw[i] == 'C'){
if(!e.empty()){
long long x = e.back() - 1;
cur--; e.pop_back();
if(x > 5) o.emplace_back(x);
} else if(!o.empty()){
long long x = o.back() - 1;
o.pop_back(); e.emplace_back(x);
}
} if(cnt >= cur) cout << "N";
else cout << "Y";
} cout << "\n";
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |