摘要:题目 刚开始定义node 变量,之后删除时出现run error ,之后问了别人, 知道 delete 只能删除堆的内存,所以定义了node *root=new node ,AC了。 注:new 和delete 只能用堆里的内存 即new 的内存 再就是注意建完一次树之后就删了建的树。要不内存超出。
阅读全文
摘要:1 #include <cstdio> 2 #include <cstring> 3 using namespace std; 4 5 char s[1000010]; 6 int vis[300]; 7 int main() 8 { 9 int tt,k,ss,t; //ss 表示低的指针 t代表
阅读全文
摘要:1 #include <cstdio> 2 #include <cstring> 3 using namespace std; 4 5 int s[1001][1001]; 6 7 int main() 8 { 9 int t,m,n,q,a,x,y; 10 scanf("%d",&t); 11 w
阅读全文
摘要:1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 using namespace std; 5 6 char s[31]; 7 char arr[3]={'R','G','B'}; 8 long long ans[31]
阅读全文
摘要:1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #include <iostream> 5 using namespace std; 6 7 const int kind=26; 8 9 struct node {
阅读全文
摘要:1 #include <cstdio> 2 #include <algorithm> 3 using namespace std; 4 5 int main() 6 { 7 int t,temp,n,ans,j,x,z,sum,cc=0; //sum存放最大数值 x代表下表最小 z代表最大下表 cc
阅读全文
摘要:1 #include <iostream> 2 #include <cstdio> 3 #include <cmath> 4 5 using namespace std; 6 7 int main() 8 { 9 int n,m,t,flag; 10 double a,b; 11 scanf("%d
阅读全文