比赛 |
4043级2023省选练习赛2 |
评测结果 |
AAATAATATT |
题目名称 |
排序 |
最终得分 |
60 |
用户昵称 |
遥时_彼方 |
运行时间 |
31.793 s |
代码语言 |
C++ |
内存使用 |
4.28 MiB |
提交时间 |
2023-03-06 19:43:10 |
显示代码纯文本
- #include<bits/stdc++.h>
- #define rep(x,y,z) for(int x=y;x<=z;x++)
- #define drep(x,y,z) for(int x=y;x>=z;x--)
- #define ull unsigned long long
- #define ll long long
- using namespace std;
- inline int read()
- {
- int x=0;bool flag=1;char ch=getchar();
- while(ch<'0'||ch>'9') {if(ch=='-')flag=0;ch=getchar();}
- while(ch>='0'&&ch<='9') {x=(x<<1)+(x<<3)+ch-'0';ch=getchar();}
- if(flag) return x;
- return ~(x-1);
- }
- inline void write(int x)
- {
- if(x<0) {x=~(x-1);putchar('-');}
- if(x>9) write(x/10);
- putchar(x%10+'0');
- }
- ////////////////////////
- int n,m;
- int a[100050];
- bool cmp(int x,int y){return x>y;}
- int main()
- {
- freopen("heoi2016_sort.in","r",stdin);
- freopen("heoi2016_sort.out","w",stdout);
- cin>>n>>m;
- rep(i,1,n) a[i]=read();
- int s1,s2,s3;
- rep(i,1,m)
- {
- s1=read(),s2=read(),s3=read();
- if(s1) sort(a+s2,a+s3+1,cmp);
- else sort(a+s2,a+s3+1);
- }
- s1=read();
- write(a[s1]),putchar(10);
- return 0;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-