
结构体+sort
better_space
这个作者很懒,什么都没留下…
展开
-
【杭电1070】Milk
最重要的思想是在输入的时候去掉多余的输入数据。 n–,i–.#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; struct node { char s[120]; double p; int d; } a[120]; bool cmp(node A,node B) {原创 2016-07-21 08:47:03 · 574 阅读 · 0 评论 -
【codeforces】HDD is Outdated Technology
主要是存储数组下标,可以用结构体,也可建立两个数组,一个用于存储下标,形如a[b[x]]即可#include<stdio.h> #include<algorithm> using namespace std; struct note { int x; int id; } s[10000100]; bool judge(note a,note b) { return a.x<b原创 2016-07-21 21:51:31 · 396 阅读 · 0 评论 -
【杭电oj2020】绝对值排序
绝对值排序 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 66684 Accepted Submission(s): 32228 Problem Description 输入n(n In原创 2016-08-12 23:37:33 · 2011 阅读 · 1 评论