# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
958791 | gmroh06 | 복사 붙여넣기 2 (JOI15_copypaste2) | C++14 | 185 ms | 11024 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#import <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
inline void fastio() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
}
int main() {
fastio();
ll k, m, n;
string s, ans;
cin >> k >> m >> s >> n;
vector<ll> a(n), b(n), c(n);
for (ll i = 0; i < n; i++) {
cin >> a[i] >> b[i] >> c[i];
}
for (ll i = 0; i < k; i++) {
ll idx = i;
for (ll j = n - 1; j >= 0; j--) {
if (idx < c[j]) continue;
if (idx < b[j] + c[j] - a[j]) {
idx += a[j] - c[j];
} else {
idx += a[j] - b[j];
}
}
ans += s[idx];
}
cout << ans;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |