https://codeforces.com/contest/998/my

A

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 #define lson l,mid,rt<<1
 4 #define rson mid+1,r,rt<<1|1
 5 #define IT set<ll>::iterator
 6 #define sqr(x) ((x)*(x))
 7 #define pb push_back
 8 #define eb emplace_back
 9 #define maxn 100005
10 #define eps 1e-8
11 #define pi acos(-1.0)
12 #define rep(k,i,j) for(int k=i;k<j;k++)
13 typedef long long ll;
14 typedef pair<int,int> pii;
15 typedef pair<ll,ll>pll;
16 typedef pair<ll,int> pli;
17 typedef pair<pair<int,string>,pii> ppp;
18 typedef unsigned long long ull;
19 const long long MOD=1e9+7;
20 const double oula=0.57721566490153286060651209;
21 using namespace std;
22 
23 int n;
24 struct sair{
25     int v,pos;
26 }a[1005];
27 
28 bool cmp(sair a,sair b){
29     return a.v<b.v;
30 }
31 
32 int main(){
33     std::ios::sync_with_stdio(false);
34     cin>>n;
35     for(int i=1;i<=n;i++){
36         cin>>a[i].v;
37         a[i].pos=i;
38     }
39     if(n==1){
40         cout<<-1<<endl;
41         return 0;
42     }
43     sort(a+1,a+n+1,cmp);
44     if(n==2&&a[1].v==a[2].v) cout<<-1<<endl;
45     else{
46         cout<<n-1<<endl;
47         for(int i=2;i<=n;i++) cout<<a[i].pos<<" ";
48     }
49 }
View Code

相关文章:

  • 2022-12-23
  • 2022-01-05
  • 2021-08-12
  • 2021-04-24
  • 2021-12-04
  • 2021-11-19
  • 2021-04-27
猜你喜欢
  • 2022-02-07
  • 2022-12-23
  • 2022-02-13
  • 2021-10-13
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案