网址YLCZ比赛界面
密码:ylcz0101
A
#include<iostream>
using namespace std;
int n;
int main() {
cin >> n;
cout << 3 * n;
return 0;
}
B
#include<iostream>
using namespace std;
int n;
int main() {
cin >> n;
if(n <= 100){
cout << n * 2;
}
else{
cout << 200 + (n - 100);
}
return 0;
}
C
#include<iostream>
using namespace std;
char f(int x, int y){
if(x + y < 10){
return char(x + y + 'A');
}
else{
cout << "B";
return char(x + y - 10 + 'A');
}
}
int main(){
char a, b;
int x, y;
cin >> a >> b;
x = a - 'A';
y = b - 'A';
cout << f(x, y);
return 0;
}
D
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int a, b;
cin >> a >> b;
if(pow(a, b) == pow(b, a)){
cout << "same";
}
else if(pow(a, b) < pow(b, a)){
cout << "second";
}
else {
cout << "first";
}
return 0;
}
E
#include<iostream>
using namespace std;
string s;
int n, m;
int main(){
cin >> s;
cin >> n >> m;
int cnt = n - 1;
for(int i = 1;i <= m;i++){
if(cnt == s.size() - 1){
cout << s[cnt];
cnt = 0;
}
else{
cout << s[cnt++];
}
}
return 0;
}
F
#include<iostream>
using namespace std;
int n, sum = 0;
char a[33][33];
bool f[33][33];
int main(){
cin >> n;
for(int i = 1;i <= n;i++){
for(int j = 1;j <= n;j++){
cin >> a[i][j];
}
}
for(int i = 1;i <= n;i++){
for(int j = 1;j <= n;j++){
if(a[i][j] == '*'){
f[i][j] = true;
sum += 1;
for(int k = 1;k + i <= n;k++){
if(a[k + i][j] == '.'){
if(!f[k + i][j]){
f[k + i][j] = true;
sum++;
}
}
else{
break;
}
}
for(int k = 1;i - k >= 1;k++){
if(a[i - k][j] == '.'){
if(!f[i - k][j]){
f[i - k][j] = true;
sum++;
}
}
else{
break;
}
}
for(int k = 1;k + j <= n;k++){
if(a[i][j + k] == '.'){
if(!f[i][j + k]){
f[i][j + k] = true;
sum++;
}
}
else{
break;
}
}
for(int k = 1;j - k >= 1;k++){
if(a[i][j - k] == '.'){
if(!f[i][j - k]){
f[i][j - k] = true;
sum++;
}
}
else{
break;
}
}
}
}
}
// for(int i = 1;i <= n;i++){
// for(int j = 1;j <= n;j++){
// cout << a[i][j] << " " << f[i][j] << " ";
// }
// cout << endl;
// }
cout << sum;
return 0;
}