正在卷的杰克很好奇 level
获赞
2
粉丝
0
关注
0
看过 TA
1
肇庆学院
2020
Java
IP属地:上海
暂未填写个人简介
私信
关注
2018-07-26 21:22
肇庆学院 Java
链接:https://www.nowcoder.com/acm/contest/141/C 来源:牛客网   Shuffle Cards   时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K Special Judge, 64bit IO Format: %lld   题目描述   Eddy likes to play cards game since there are always lots of randomness in the game. For most of the cards game, the very first ste...
乔佛里:兄弟你这一行代码也是真的秀。 #include <bits/stdc++.h> #include <ext/rope>//函数头文件 using namespace __gnu_cxx; using namespace std; const int maxn=1e5+10; rope<int> T; int n,m; int main() {     scanf("%d%d",&n,&m);     for (int i=1; i<=n; i++) T.push_back(i);     while (m--) {         int p,s;         scanf("%d%d",&p,&s);         p--;         T=T.substr(p,s) + T.substr(0,p) + T.substr(p+s,n-p-s); //洗牌后的顺序 中间 +前部 +后面     }     for (int i=0; i<n; i++) printf("%d ",T[i]);     return 0; }
0 点赞 评论 收藏
分享

创作者周榜

更多
关注他的用户也关注了:
牛客网
牛客网在线编程
牛客网题解
牛客企业服务