社区讨论
40RP求助
P1781宇宙总统参与者 3已保存回复 2
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 2 条
- 当前快照
- 1 份
- 快照标识符
- @lo3aw50f
- 此快照首次捕获于
- 2023/10/24 03:38 2 年前
- 此快照最后确认于
- 2023/10/24 03:38 2 年前
CPP
//#include<bits/stdc++.h>
///*
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<fstream>
#include<deque>
#include<vector>
#include<queue>
#include<map>
#include<stack>
#include<set>
//*/
using namespace std;
//unsigned long long
struct cosmic_president{
string s;
int id;
}cp[40];
int cmp(cosmic_president a,cosmic_president b){
return a.s<b.s;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// std::ios::sync_with_stdio(false);
// std::cin.tie(0),cout.tie(0);
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>cp[i].s;
cp[i].id=i+1;
}
sort(cp,cp+n,cmp);
cout<<cp[0].id<<'\n'<<cp[0].s<<'\n';
return 0;
}
前2AC,其余WA,样例已过,求助
回复
共 2 条回复,欢迎继续交流。
正在加载回复...