2019年广东工业大学新生赛
文章目录 A-原初的信纸 B-骑士的对决 C-秘密的议会 D-城市的税金 E-缺席的神官 G-虚数的纸牌 H-绵羊的银币 I-迷途的怪物 J-简单的数学 K-消亡的质数 L-危险的台阶 M-破碎的愿望 A-原初的信纸 这道题用到了快排 # include <iostream> # include <algorithm> using namespace std ; const int maxn = 1e4 + 10 ; int s [ maxn ] ; int t ; int n ; int main ( ) { cin >> t ; while ( t -- ) { cin >> n ; for ( int i = 1 ; i <= n ; i ++ ) cin >> s [ i ] ; sort ( s + 1 , s + 1 + n , greater < int > ( ) ) ; cout << s [ 1 ] << endl ; } return 0 ; } B-骑士的对决 这道题知识点是枚举和暴力 我一开始写的稍微麻烦一点 # include <iostream> # include <algorithm> using namespace std ; char a , b , c ; int main ( ) { cin >> a >> b ; cin >> c ;