首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
曾不会
2026年3月22日 16:54
组队刷题 题解:
P1307
回复 0
|
赞 1
|
浏览 63
while(1): try: m,n=map(int,input().split()) if(m==-1 and n==-1): break s=[] for ii in range(n): a,b=map(int,input().split()) k=a/b s.append((a,b,k)) t=sorted(s,key=lambda x:-x[2]) # pr...
HKX9XAS
2026年3月19日 14:46
组队刷题 题解:喝饮料那题的代码原封不动抄过来
P1307
回复 0
|
赞 3
|
浏览 87
#include #include #include #include #include using namespace std; struct soft_drink{ double mi; double wi; double per; }drink[1000]; bool cmp(soft_drink a, soft_drink b){ return a.per > b.per; } i...
yauqq
2026年3月15日 09:05
组队刷题 题解:
P1307
回复 0
|
赞 3
|
浏览 138
#include<bits/stdc++.h> using namespace std; struct node{ double w,m; }; bool cmp(node a,node b){ return a.m*b.w < b.m*a.w; } int main(){ int m,n; while(cin >> m >> n){ if(m == -1 && n == -1) break; vector<node> g; for(int i=0;i...
Jinx_K
2026年3月10日 16:33
组队刷题 题解:
P1307
回复 0
|
赞 1
|
浏览 143
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <vector> using namespace std; typedef struct{ float volume; float price;//price per mL for each beverage; float totalprice; }beverage; bool cmp(const beverage &...
yourgaba233
2026年3月9日 18:11
组队刷题 题解:C语言解法,按性价比刷题
P1307
回复 0
|
赞 4
|
浏览 118
#include <stdio.h> #include <stdlib.h> void mySort(int w[],int m[],float f[],int n){//冒泡排序 int i,j,temp; float ft; for(i=0;i<n-1;i++){ for(j=1;j<n-i;j++){ if(...
uly
2026年3月4日 19:33
组队刷题 题解:
P1307
回复 0
|
赞 8
|
浏览 136
#include <bits/stdc++.h> using namespace std; typedef struct question { double w;//题数 double m;//体力 }q; bool cmp(question a, question b) { return a.m/a.w<b.m/b.w; } int main() { int total,n; while(cin>>total>>n) { if(total==-1||n=...
litery
2026年2月12日 21:35
组队刷题 题解:
P1307
回复 0
|
赞 3
|
浏览 238
#include <bits/stdc++.h> using namespace std; struct timu{ int w; int m; double xiaolv; bool operator <(const timu& b)const{ return xiaolv>b.xiaolv; } }; int main(){ int mt,n; while(cin>>mt>>n&&mt!=-1&...
08193003
2024年3月22日 13:49
组队刷题 题解:为什么不对 我这个struct就多定义了一个 就只能a
P1307
回复 6
|
赞 17
|
浏览 1.8k
#include<bits/stdc++.h> using namespace std; struct bankuai{ double a; double b; double c=b/a; }aa[1005]; bool cmp(bankuai a1,bankuai a2){ return a1.c<a2.c; } int main(){ int m,n; while(cin>>m>>n){ if(n==-1&&m==-1) break; for(int i=0;i&...
牧濑
2026年2月10日 18:47
组队刷题 题解:按照每个专题的效率排序,一个一个刷过去就行
P1307
回复 0
|
赞 7
|
浏览 213
#include <iostream> #include <vector> #include <algorithm> #include <iomanip> using namespace std; struct node{ int m; int w; double r;//每题所需精力 }; int main(){ int zjl;//总精力 int zt;//专题数 while(cin>>zjl>>zt){ if(zjl==-1&&...
cczz
2025年8月7日 15:47
组队刷题 题解:
P1307
回复 0
|
赞 8
|
浏览 777
#include<bits/stdc++.h> using namespace std; struct Node { int cnt; int cost; } node[1005]; int main() { int m, n; while (cin >> m >> n) { if (m == -1 && n == -1) break; for (int i = 0; i < n; i++) { cin &...
1
2
3
题目
组队刷题
题解数量
23
发布题解
在线答疑
热门题解
1
一模一样
2
组队刷题 题解:为什么不对 我这个struct就多定义了一个 就只能ac20%
3
组队刷题 题解:
4
组队刷题 题解:
5
组队刷题 题解:
6
组队刷题 题解:
7
组队刷题 题解:
8
组队刷题 题解:
9
组队刷题 题解:按照每个专题的效率排序,一个一个刷过去就行
10
组队刷题 题解:和1478好像,也是按那个思路写的,但是通过率只有60%,求解答一下