4 条题解
-
1
202607gj16张子瑞 (张子瑞) LV 9 @ 2026-07-14 12:48:24
fuck
#include<bits/stdc++.h> using namespace std; long long p,q,n; struct pc { int num,xh; }a[300005]; bool cp(pc x,pc y) { if(x.num==y.num)return x.xh<y.xh; return x.num>y.num; } int main() { cin>>n>>p>>q; for(int i=1;i<=n;i++) { cin>>a[i].num; a[i].xh=i; } sort(a+1,a+n+1,cp); for(int i=p;i<=q;i++) cout<<a[i].xh<<' '; return 0; } -
1@ 2023-07-13 20:42:59
那个题解的b数组其实可以去掉,后面没用到,发得太匆忙,忘记改了(´・ω・`)
-
1@ 2023-07-13 20:39:18
//终于啊终于 #include<bits/stdc++.h> using namespace std; int n,p,q,js; struct hw { int bh,nd; bool operator<(hw x)const { return nd>x.nd||nd==x.nd&&bh<x.bh; } }; vector<hw>a; vector<int>b; int main() { cin>>n>>p>>q;a.resize(n),b.resize(q-p+1); for(int i=0;i<n;i++) cin>>a[i].nd,a[i].bh=i+1; sort(a.begin(),a.end()); for(int i=p-1;i<q;i++) cout<<a[i].bh<<' '; cout<<endl; return 0; cout<<"代码仅供参考"<<endl; cout<<"抄题解的死全家"<<endl; } -
-2@ 2023-07-13 15:37:16
//终于啊终于 #include<bits/stdc++.h> using namespace std; int n,p,q,ans[300005],t=0; struct st { int bh; int nd; }a[300005]; bool cp(st a,st b) { if(a.nd==b.nd)return a.bh<b.bh; return a.nd>b.nd; } int main() { cin>>n>>p>>q; for(int i=1;i<=n;i++) { cin>>a[i].nd; a[i].bh=i; } sort(a+1,a+n+1,cp); for(int i=p;i<=q;i++) cout<<a[i].bh<<' '; return 0; cout<<"代码仅供参考"<<endl; cout<<"抄题解的死全家"<<endl; }
- 1
信息
- ID
- 1900
- 难度
- 7
- 分类
- (无)
- 标签
- 递交数
- 356
- 已通过
- 56
- 通过率
- 16%
- 被复制
- 7
- 上传者