#include<bits/stdc++.h> using ll = longlong; usingnamespace std; #define endl '\n' const ll N = 1e6 + 5; int a[5]; intmain(){ string s = "aeiou"; int t; cin >> t; while (t--) { int x; cin >> x; int temp = x / 5; int temp1 = x % 5; string ans; for (int i = 0; i < 5; i++) { a[i] = temp; } for (int i = 0; temp1 > 0; temp1--, i++) { a[i]++; } for (int i = 0; i < 5; i++) { while(a[i]--) { ans += s[i]; } } cout << ans << endl; } return0; }
#include<bits/stdc++.h> usingnamespace std; using ll = longlong; #define endl '\n' intmain(){ int t; cin >> t; while (t--) { int n, m, q, x, y, a; cin >> n >> m >> q >> x >> y >> a; ll ans = 0; if (a < x && a < y) { ans = min(x, y) - 1; } elseif(a > y && a > x) { ans = n - max(x, y); } if (x > y) { swap(x, y); } if (a > x && a < y) { ans = (y - x) >> 1; } cout << ans << endl; } return0; }
B2 - The Strict Teacher (Hard Version) 此题思想与B1相同,可用lower_bound找到学生在哪两个老师之间,代码如下: