博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CCFCSP 201709-1 打酱油
阅读量:745 次
发布时间:2019-03-22

本文共 308 字,大约阅读时间需要 1 分钟。

思路:排序一下,维护相邻两项差的最小值

#include
using namespace std;typedef long long ll;const int N=1e6+5;const ll mod=1e9+7;int main(){
int n;cin>>n; vector
a; for(int i=1;i<=n;i++){
int x;cin>>x; a.push_back(x); } sort(a.begin(),a.end()); int mi=1e9; for(int i=1;i

转载地址:http://huhwk.baihongyu.com/

你可能感兴趣的文章