这名用户暂未设置签名。
追踪最近的用户名外显变动记录。
最近的文章、讨论、云剪贴板与社区记录
```cpp #include using namespace std; int a[100010]; void qsort(int a[], int l, int r) { int i = l, j = r, flag = (l + r) / 2, tmp; do { while (a[i] flag) j--; i…
请问为什么小数反转、分数反转、百分数反转什么也没有输出???是整个字符串都被删了吗? 代码: ```cpp #include #include #include using namespace std; int main() { string s; cin >> s; if ((int)s.find('.') != -…
在讨论《你谷评测机炸了吗》回复:
确实是炸了 [](https://www.luogu.com.cn/record/list?pid=P3741&user=lht20090314&page=1)
在讨论《萌新求助,我这样写有什么问题?为什么每次find函数返回值都是-1???》回复:
我大概知道了,应该是因为find函数只能找string类型,不能找char类型,并且我这个表打的也不对,忽略了可以整除的情况
萌新求助,请问我这样写有什么问题?为什么每次find函数返回值都是-1??? 代码: ```cpp #include #include using namespace std; int main() { string three = "abcdefghijklmnotuv", four = "pqrswxyz"; ch…
在讨论《为什么枚举判断一个数是否是质数只需要枚举到根号这个数?》回复:
@[UnyieldingTrilobite](/user/250637) 原来如此,终于明白了,谢谢啊!
在讨论《为什么枚举判断一个数是否是质数只需要枚举到根号这个数?》回复:
@[Lemon_BartonBatton](/user/594203) emm...能否讲详细一点,没太看明白
为什么枚举判断一个数是否是质数只需要枚举到根号这个数? 比如判断i是否是质数,只要枚举到根号i即可,不需要枚举到i - 1 请问这是为什么?
在讨论《萌新求解,for循环条件里的s[i]是什么意思?》回复:
@[Krystallos](/user/124683) @[Dazlin7](/user/1025854) @[ud2_](/user/206953) @[songjiahao_](/user/761125) 哦哦好的,谢谢!
萌新求解,for循环条件里的s[i]是什么意思? 代码: ```cpp #include #include using namespace std; int main() { int n; char s[51]; scanf("%d\n%s", &n, s); for (int i = 0; s[i]; i++) //…
代码: ```cpp #include using namespace std; int main() { int picture[202][202] = {0}, num[100], n, x = 1, y = 1, cnt = 0, cnt2 = 1; // picture是点阵图,n是点阵图大小,x、y是数组的坐…
在讨论《各位大佬们能帮蒟蒻看看吗?》回复:
@[LiJoQiao](/user/945364) 我本地甚至连样例都过不去,所以我想知道到底哪里有问题?
在讨论《各位大佬们能帮蒟蒻看看吗?》回复:
@[jacy1949](/user/891662) 我的想法是用循环一个一个的把数字填上去,最后输出,但不知道为什么有问题
代码: ```cpp #include using namespace std; int main() { int n, x = 1, y = 1; // 行为 x ,列为 y scanf("%d", &n); int a[n + 2][n + 2] = {0}; a[1][1] = 1; for (int i = 2…
10分,有没有人能帮忙看看 ```cpp #include using namespace std; int main() { int n, x = 1, y = 1; // 行为 x ,列为 y scanf("%d", &n); int a[n + 2][n + 2] = {0}; a[1][1] = 1; for…
在讨论《请问洛谷的评测机是文件输入输出还是标准输入输出?》回复:
@[codeLJH](/user/528472) 谢谢
请问洛谷的评测机是文件输入输出还是标准输入输出?我想知道像 _while(cin >> n)_ 或者一边读入一遍输出这样的写法可不可以?
自己写了一遍暴力过了,然后看题解里大佬的思路由写了一遍,但是没过,不知道哪里写错了,请大佬们帮忙看看 代码: ```cpp #include #include using namespace std; int n, m, k, a[102][102], cnt; int cb(int x, int y) { if (x…
在讨论《20分求助,求求了,怎么改都不对》回复:
可以了,已经解决了,是我没审好题,这一行 ```cpp light[int(floor(a) * i)] = !light[int(floor(a) * i)]; ``` 应该改为 ```cpp light[int(a * i)] = !light[int(a * i)]; ```
代码: ```cpp #include #include using namespace std; int main() { int n; bool light[2000002] = {0}; cin >> n; while (n--) { int t; double a; cin >> a >> t; for (in…
在讨论《C++ 40分,求助!》回复:
@[yanghanchen](/user/605874) 明白了,谢谢,是我把数据范围理解错了
40分,请大佬们帮忙看看到底哪里有问题? 代码: ```cpp #include using namespace std; int main() { int n, m, a[3001], min = 301; cin >> n >> m; for (int i = 0; i > a[i]; for (int i = 0…
在讨论《为什么会TLE?》回复:
@[s_cenxinyang](/user/432126) 好的,谢谢
全TLE,我的思路明明跟[这篇题解](https://www.luogu.com.cn/blog/stonejuice/solution-p1554)的思路是一样的,可是为什么会TLE呢?请问该怎么改? 代码: ```cpp #include using namespace std; int main() { int…
在讨论《全RE,本地输出乱码,请问各位大佬哪里有问题》回复:
@[Jerrlee✅](/user/367652) 啊,打太快打错了,谢谢啦
照着书本的代码写的,检查了好多遍,但是没有发现问题,请大佬们帮忙看看到底哪里有问题? 代码: ```cpp #include using namespace std; int main() { int tubes[10][8] = { // 数码 i 的第 j个显示管,tubes[i][0] 表示数码 i 要显示几根显…
在讨论《为什么这题开O2会WA?》回复:
@[thomas_zjl](/user/162084) 我突然想到,那为什么不开O2就能过