# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
466360 | Namnamseo | 복사 붙여넣기 2 (JOI15_copypaste2) | C++17 | 194 ms | 8532 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
void read(int& x){ scanf("%d",&x); }
template<typename T,typename... Args>
void read(T&a,Args&...b){ read(a); read(b...); }
int k;
int pos[210];
char S[200010];
int n;
int qs[200010];
int qe[200010];
int qp[200010];
inline int app_pos(int bp,int S,int E,int P){
int nl=P, nr=P+E-S;
if(nl <= bp && bp <= nr){
return S+bp-nl;
} else if(bp < nl){
return bp;
} else {
return bp-(E-S+1);
}
}
int main(){
scanf("%d%*d%s%d", &k, S, &n);
for(int i=1; i<=n; ++i) read(qs[i], qe[i], qp[i]), --qe[i];
for(int i=0; i<k; ++i) pos[i]=i;
for(int i=n; 1<=i; --i){
for(int j=0; j<k; ++j){
pos[j] = app_pos(pos[j], qs[i], qe[i], qp[i]);
}
}
for(int j=0; j<k; ++j) putchar(S[pos[j]]);
putchar(10);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |