建议增加HACK,本想骗个分,结果AC了,甚至过不了样例
查看原帖
建议增加HACK,本想骗个分,结果AC了,甚至过不了样例
1074084
asd890123楼主2024/4/15 17:03
#include <bits/stdc++.h>

using namespace std;

class contry{public:int id,power;};

bool cmp(contry a,contry b){return a.power > b.power;}

int main(){
    
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    
    int n;
    contry a[(int)pow(2,7) + 5];
    
    cin >> n;
    for (int i = 1;i <= (int)pow(2,n);i++) cin >> a[i].power,a[i].id = i;
    sort(a + 1,a + 1 + (int)pow(2,n),cmp);
    cout << a[2].id << endl;
    
    return 0;
}
2024/4/15 17:03
加载中...