Problem L. Omar’s Bug【分类讨论】

网友投稿 667 2022-11-02

Problem L. Omar’s Bug【分类讨论】

Problem L. Omar’s Bug【分类讨论】

题意

题解

AC-Code

#include using namespace std;int main() { int T; cin >> T; while (T--) { int n, x, y; cin >> n >> x >> y; if (x <= n && y == 1) { for (int i = 1; i <= x - 1; ++i) cout << i << " "; for (int i = x + 1; i <= n; ++i) cout << i << " "; cout << n + 1; } else if (x > n && y == 1) { for (int i = 1; i <= n - 1; ++i) cout << i << " "; cout << n; } else if (x <= n && y == 2) { for (int i = 1; i <= n - 1; ++i) cout << i << " "; cout << n; } else if (x > n && y == 2) { for (int i = 1; i <= n - 1; ++i) cout << i << " "; cout << x; } cout << endl; } return 0;}

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:一个完整的串行爬虫 抓取3万多个页面 ,程序跑完大概30分钟
下一篇:Pelagia是基于顺序虚拟机概念开发的自动并行化工具(无锁多线程)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~