欢乐赛#68 T1 题解
2026-03-09 22:41:09
发布于:北京
11阅读
0回复
0点赞
这里提到一个字符串的神秘用法:"字符串1""字符串2"……。
上代码:
#include <bits/stdc++.h>
using namespace std;
int main(){
cout<<" *\n"
" ***\n"
" *****\n"
"*******\n";
return 0;
}
当然,也有普通做法:
#include <bits/stdc++.h>
using namespace std;
int main(){
cout<<" *\n ***\n *****\n*******\n";
return 0;
}
对比一下各自敲代码的时间复杂度的劣势:
- 神秘做法:需要打
114514 个引号; - 普通做法:需要删
114514 个换行。
当然,\n是不可避免的。
全部评论 1
内存更少
15小时前 来自 河北
0













有帮助,赞一个