昨天在群里看到一段话,讲的是每次打比赛都只能爆零或签到,,
(当然我觉得难度上…)
反正走是不可能的,
再菜我也要有个名次,赖在这里
北京师范大学第十七届程序设计竞赛决赛
A- 足球
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 131072K,其他语言262144K
64bit IO Format: %lld
题目描述
足球是世界第一大运动。
有人曾以这样的方式来评价一直球队的能力:
球队能力等于球队球员的总身价乘以该球队身价最低一人的身价。
现在已知每支球队都有 23 人,且球员的身价不超过 1000,不低于 1,
你需要求出每支球队的能力值。
输入描述:
第一行是一个正整数T (T <= 20),表示有T只队伍。
接下来T行,每行包含 23 个范围均不超过1000的正整数 ,表示一支球队所有队员的身价。
输出描述:
对每支球队输出一行,表示这支的能力值。
示例1
输入
1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
输出
23
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctype.h>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<iomanip>
#include<list>
#include<fstream>
using namespace std;
typedef long long ll;
int main(){
int t;
scanf("%d",&t);
while(t--){
int a[25] = {0};
int sum = 0;
for(int i=0;i<23;i++){
scanf("%d",&a[i]);
sum+=a[i];
}
sort(a,a+23);
int ans = sum * a[0];
printf("%d\n",ans);
}
return 0;
}
B- 进制
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 131072K,其他语言262144K
64bit IO Format: %lld
题目描述
给一个长度不超过 18 的 01 串,你需要输出这个串在 2, 3, 4, 5, 6, 7, 8, 9, 10 进制表示下的数值在 10 进制下的和。
输入描述:
第一行是一个正整数 T (T<=100000),表示测试数据的组数,
接下来 T 行,每行包含一个长度不超过 18 的 01 串,保证没有前导零。
输出描述:
对于每组测试数据,输出一个整数。
示例1
输入
2
10
101
输出
54
393
大声BB
做这道题的时候我,,,,
我以为2-10进制的和时和2+3+…+9+10进制这个数相等的,
头脑简单,四肢还不发达
绝了
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctype.h>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<iomanip>
#include<list>
#include<fstream>
using namespace std;
typedef long long ll;
ll a;
ll s(int k){
ll ans=0,m=1;
ll t = a;
while(t != 0){
ans = ans + (t % 10) * m;
m = m * k;
t = t / 10;
}
return ans;
}
int main(){
int t;
scanf("%d",&t);
while(t--){
ll sum = 0;
scanf("%lld",&a);
for(int i=2;i<=10;i++){
sum = sum + s(i);
}
printf("%lld\n",sum);
}
return 0;
}
这里放一下选数字的思路
2019年05月12日 18:35:26 阿茶家的庸医 阅读数:90更多
个人分类: ACM
链接:https://blog.csdn.net/baidu_41671472/article/details/90143457