Logo Andy0815的博客

博客

不懂就问——#12839的第一个测试数据是不是有问题?

2023-07-30 09:42:11 By Andy0815

样例 #1

样例输入 #1

6

样例输出 #1

2

输出格式 第一行是1或2,1表示金角大王能胜利,2表示银角大王能胜利。 若金角大王能胜利,则在第二行输出第一次写出的可以制胜的最小数字。 若是第一次就无法写出数字,则认为第一次写出的可以制胜的最小数字为0。

为什么输出的是一个数???

不容易,我终于突破1000Rating了(倒数第一的我,Rating991!)

2023-07-27 16:11:54 By Andy0815

2023-07-27 16:10:29 By Andy0815

include

include

using namespace std; struct node{ int num; string type; int p; int cnt; int kid[100]; int depth; }; int n,rootnum; node t[105]; int f[105]={0}; bool cmp(node a,node b){ return a.num>n; int k; for(int i=0;i>t[i].num>>t[i].cnt; if(t[i].cnt==0){ t[i].type="leaf"; } else{ for(int j=0;j>k; t[i].kid[j]=k; f[k]=1; t[k].p=i; } } } sort(t,t+n,cmp); for(int i=0;i<n;i++){ if(f[i]==1&&t[i].type!="leaf"){ t[i].type="internal node"; } if(f[i]==0){ t[i].type="root"; rootnum=i; t[i].p=-1; } } getDeep(0,rootnum); for(int i=0;i<n;i++){ cout<<"node "<<i<<":"<<"parent="<<t[i].p<<",depth="<<t[i].depth<<","<<t[i].type<<",["; if(t[i].cnt==0){ cout<<"]"<<endl; } else{ for(int j=0;j<t[i].cnt;j++){ cout<<t[i].kid[j]; if(j==t[i].cnt-1){ continue; } cout<<","; } cout<<"]"<<endl; }

}

}

史上最不靠谱的#15答案(100分) 2

2023-07-04 22:23:48 By Andy0815
#include <bits/stdc++.h>
using namespace std;
long long int n;
string s="hi";
void bfs(int tail,int head){
    if(head==n||head==-1){
        s="";
    }
    else{
        s="hi";
    }
}
void dfs(int deep){
    if(deep>n){
        bfs(n-1,-1);
    }
    else if(deep==n+1){
        s="ih";
    }
    else if(deep==n+2){
        s="hii";
    } 
    else{
        s="hi!";
    }
}
bool check(int n){
    if(n%2==0){
        return false;
    }
    else {
        dfs(n*n);
        bfs(n*n,n);
        return true;
    }
}
int main(){
    n=123456543210;
    do{
        n--;
        dfs(n+1);
        dfs(n-1);
        dfs(n+2);
        dfs(n-2);
        bfs(n,1);
        bfs(n,1);
        bfs(n*2,1);
        bfs(n/2,1);
    }while(check(n)==false);
    cout << s;
    return 0;
}

新博客

2023-06-18 18:09:23 By Andy0815

include

using namespace std; int main(){ //vector:

//头文件:#include <vector>
//定义:vector <int> a
//定义长度(10):vector <int> a(10) 
//插入:insert()
//清空:clear() 
//判断是否为空:empty() 

//deque <T> 删除首尾 
return 0;

}

大无语事件

2023-05-28 09:09:09 By Andy0815

1038超时了!!!

Test #10: score: 0 Time Limit Exceeded

满级博客

2023-05-11 19:50:06 By Andy0815

\begin{equation} \frac{-b + \sqrt{b^2 - 4ac}}{2a} \end{equation}

#include <iostream>
#include <stdio.h>
begin
print '少儿编程

一级标题:1+1=3

二级标题:1*2=3

三级标题:3+1=5

四级标题:3-1=3

关于我2023.5.11号AC过得题目竟然是那天的打卡题!!!

2023-05-11 19:44:57 By Andy0815

我好lucky呀!

五月月赛可笑死我了!!!

2023-05-06 22:19:49 By Andy0815
我第二题没有AC,因为我定义的字符串数组太小了,笑死,之后把string s[10] 改成 string s[15] 就AC了

我真的会谢!!!!!!!

   #include <bits/stdc++.h>
using namespace std;
int sum=0;
**string s[15];**
int main(){
    int m;
    cin >> m;
    for(int i=1;i<=m;i++){
        cin >> s[i];
        if(s[i]=="Poblano"){
            sum+=1500;
        }
        else if(s[i]=="Mirasol"){
            sum+=6000;
        }
        else if(s[i]=="Serrano"){
            sum+=15500;
        }
        else if(s[i]=="Cayenne"){
            sum+=40000;
        }
        else if(s[i]=="Thai"){
            sum+=75000;
        }
        else if(s[i]=="Habanero"){
            sum+=125000;
        }
    }
//    6
//    Habanero 
//    Thai 
//    Cayenne 
//    Serrano 
//    Mirasol 
//    Poblano

    //263000
    cout << sum;
    return 0;
}

不懂就问——一个数要求它是几位数怎么办?

2023-04-28 15:11:16 By Andy0815

怎么办呀???

共 34 篇博客