首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
carrot_huan
2025年3月12日 13:42
复数集合 题解:大根堆+运算符重载
P1381
回复 0
|
赞 6
|
浏览 446
#include<iostream> #include<queue> #include<string> using namespace std; struct El { int a; int b; }; bool operator <(El e1, El e2) { if ((e1.a * e1.a + e1.b * e1.b) < (e2.a * e2.a + e2.b * e2.b)...
RingoCrystal
2025年2月11日 13:15
复数集合 题解:priority_queue
P1381
回复 0
|
赞 4
|
浏览 515
#include <bits/stdc++.h> using namespace std; struct pl { int a, b; pl(int a, int b): a(a), b(b) {} bool operator < (pl y) const { return a * a + b * b < y.a * y.a + y.b * y.b; } }; int main() { int n; while (cin >> n) { ...
My_opt
2022年5月20日 23:00
优先队列
P1381
回复 0
|
赞 5
|
浏览 5.2k
#include <bits/stdc++.h> using namespace std; struct plural { int mod; string val; bool operator< (const plural &W)const { return mod < W.mod; } }; int get(string s) { int x = atoi(s.c_str()); return x * x; } int main() { ios::sync_with_stdio(...
kas
2022年3月16日 21:09
复数集合
P1381
回复 0
|
赞 3
|
浏览 5.1k
#include<iostream> #include<vector> #include<algorithm> #include<string> using namespace std; int main() { int n; string opt, bd; vector<pair<int, int> > vec; while (cin >&...
JohnWang
2021年3月28日 10:55
复数参考实现
P1381
回复 0
|
赞 7
|
浏览 11.2k
#include <iostream> #include <vector> #include <string.h> #include <algorithm> using namespace std; struct Complex{ double real, imag; }; bool cmp(Complex a, Complex b) { double ma = a.real*a.real+a.imag*a.imag; double mb = b.real*b.real+b.imag*...
iloveacm
2020年2月19日 19:02
1381 输入输出没问题,不知道错在哪了
P1381
回复 0
|
赞 0
|
浏览 7.9k
#include <iostream> #include <stdio.h> #include <algorithm> #include <string.h> using namespace std; struct node{ int a; int b; }buf[100]; bool cmp(node c,node d){ int i=c.a*c.a+c.b*c.b; int j=d.a*d.a...
题目
复数集合
题解数量
6
发布题解
在线答疑
热门题解
1
复数参考实现
2
复数集合 题解:大根堆+运算符重载
3
优先队列
4
复数集合 题解:priority_queue
5
复数集合
6
1381 输入输出没问题,不知道错在哪了