记录编号 | 200259 | 评测结果 | AAAAAAAAEEEEETEEEETEEETEET | ||
---|---|---|---|---|---|
题目名称 | 复制&粘贴 | 最终得分 | 30 | ||
用户昵称 | 是否通过 | 未通过 | |||
代码语言 | C++ | 运行时间 | 14.499 s | ||
提交时间 | 2015-10-28 16:07:24 | 内存使用 | 0.29 MiB | ||
#include <fstream> #include <algorithm> #include <cstdio> #include <cstring> #define ifs ifstream #define ofs ofstream using namespace std; /*++++++++++++++XPK STUDIO++++++++++++++ Date:2015-10-28 Editor:ReaperLee Lang:c++ ++++++++++++++XPK STUDIO++++++++++++++*/ ifs fin("copypaste.in"); ofs fout("copypaste.out"); int main() { string str; int k,m; fin>>k>>m; int n; fin>>str; fin>>n; for(int i=1;i<=n;i++) { int a,b,c; fin>>a>>b>>c; //int loc=str.length(); string cpy,c1,c2; cpy=str.substr(a,b-a); c1=str.substr(0,c); c2=str.substr(c,str.length()); string pop; str=c1+cpy+c2; if(str.length()>m) { str.erase(m,str.length()); } } string ans; ans=str.substr(0,k); fout<<ans<<endl; return 0; }