文章

71

粉丝

83

获赞

5

访问

15.6k

头像
1381 只有25%
我要提问
发布于2024年3月27日 21:06
阅读数 152

#include<iostream>
#include<cstring>
#include<string>
#include<queue>
using namespace std;

struct node{
    int real;
    int image;
};
bool operator<(node l,node r){
    int a=l.real*l.real+l.image*l.image;
    int b=r.real*r.real+r.image*r.image;
    if(a==b){
        return l.image>r.image;//小根 
    }else{
        a<b;//大根 
    }
}

int main(){
    int n;
    while(cin>>n){
        priority_queue<node> myq;
        while(n--){
            string str;
            cin>>str;
            if(str=="Pop"){
...

登录查看完整内容


登录后发布评论

2 条评论
snake
2024年3月27日 22:35

return呢

赞(0)

DestinyCares+++ : 回复 snake: 忘了 哈哈哈 谢谢

2024年3月28日 10:46