水到难以描述 两个写一块了
A题的LINK:http://codeforces.com/contest/734/problem/A
#include<bits/stdc++.h>
using namespace std;
int main()
{
char s[100010];
int n;
int cnt=0;
cin>>n>>s;
for(int i=0;i<n;i++)
{
if(s[i]=='A')cnt++;
}
if(2*cnt>n)cout<<"Anton"<<endl;
else if(2*cnt==n)cout<<"Friendship"<<endl;
else cout<<"Danik"<<endl;
return 0;
}
B:先贪256再32
http://codeforces.com/contest/734/problem/B
#include<bits/stdc++.h>
using namespace std;
int main() {
int a[10];
int ans1 = 0, ans2 = 0;
for(int i = 0; i < 4; i++) {
cin >> a[i];
}
ans1 = min(a[0], min(a[2], a[3]));
a[0] -= ans1;
ans2 = min(a[0], a[1]);
cout << ans1 * 256 + ans2 * 32 << endl;
return 0;
}