这是一道简单的签到题
http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1001&cid=838
/*
*@Author: STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,q,ans;
int a[N];
char str;
int main()
{
#ifdef DEBUG
freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);
#endif
while(~scanf("%d",&n)){
t=0;
for(int i=1;i<=n;i++){
cin>>a[i];
t+=a[i];
}
cout << t << endl;
}
//cout << "Hello world!" << endl;
return 0;
}
这是一道简单的判断题
http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1002&cid=838
/*
*@Author: STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,q,ans;
int a[N];
char str;
int main()
{
#ifdef DEBUG
freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);
#endif
while(~scanf("%d+%d=%d",&n,&m,&k)){
if(n==1&m==1&&k==3)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
//cout << "Hello world!" << endl;
return 0;
}
这是一道简单的递推题
http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1003&cid=838
/*
*@Author: STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,q,ans;
ll a[N];
char str;
int main()
{
#ifdef DEBUG
freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);
#endif
a[1]=1;
a[2]=1;
a[3]=1;
for(int i=4;i<=70;i++){
a[i]=a[i-1]+a[i-2]+a[i-3];
}
while(~scanf("%d",&n)){
cout << a[n] << endl;
}
//cout << "Hello world!" << endl;
return 0;
}
这是一道简单的数学题
http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1004&cid=838
/*
*@Author: STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
using namespace std;
typedef long long ll;
const int N=20000000;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
ll t,n,m;
ll nine[300];
ll total_nine;
void init(){
nine[0] = 9;
total_nine = 1;
for(int i = 1; nine[i-1]*9ll<1e18; i ++) {
nine[i] = nine[i-1]*9;
total_nine ++;
}
}
ll get_suff_count(ll m){
ll ret = 0;
for(int i = 0; i < total_nine; i ++){
ret += m/nine[i];
}
return ret;
}
int main()
{
#ifdef DEBUG
freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);
#endif
init();
while(~scanf("%lld",&n)){
cout << get_suff_count(n*n*n) << endl;
}
//cout << "Hello world!" << endl;
return 0;
}
#include<stdio.h>
int main()
{
long long int n;
while(scanf("%lld",&n)!=EOF)
{
n=n*n*n;
long long int sum=0;
while(n!=0)
{
n=n/9;
sum+=n;
}
printf("%lld\n",sum);
}
return 0;
}
这是一道简单的字符题
http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1005&cid=838
/*
*@Author: STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,q,ans;
int a;
char str[100];
string s;
int main()
{
#ifdef DEBUG
freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);
#endif
while(~scanf("%d",&n)){
ans=1000;
string a="i love you",b="i hate you";
getchar();
for(int i=1;i<=n;i++){
getline(cin,s);
if(s==a)
ans+=100;
if(s==b)
ans-=500;
}
if(ans>=0){
cout << "good man!" << endl;
}else{
cout << "xiaoming=zhanan" << endl;
}
}
//cout << "Hello world!" << endl;
return 0;
}
这是一道简单的计算题
http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1006&cid=838
#include<bits/stdc++.h>
using namespace std;
int n,T;
int x[4],y[4],A,B,C,M,W;
vector<int> v;
bool cmp(const int &a,const int &b) {
return a>b;
}
int main()
{
scanf("%d",&T);
while(T--) {
scanf("%d%d%d",&x[1],&y[1],&A);
scanf("%d%d",&x[2],&B);
scanf("%d%d%d",&x[3],&y[3],&C);
scanf("%d%d",&M,&W);
int ans=0;
for(int i=0;i<=A;i++) {
for(int j=0;j<=C;j++) {
v.clear();
for(int k=1;k<=i;k++) v.push_back(x[1]);
for(int k=1;k<=j;k++) v.push_back(x[3]);
sort(v.begin(),v.end(),cmp);
int tmp=0;
for(int k=0;k<v.size();k++) tmp+=v[k];
for(int k=0;k<min((int)v.size(),B);k++)
tmp-=min(x[2],v[k]);
if(tmp<=W)
ans=max(ans,(y[1]+j*y[3])*i);
}
}
if(ans>=M)
puts("Win");
else
printf("%d\n",M-ans);
}
return 0;
}
这是一道简单的游戏题
http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1007&cid=838
/*
*@Author: STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,q,ans;
int a;
char str[4][6];
int main()
{
#ifdef DEBUG
freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);
#endif
scanf("%d",&t);
while(t--){
scanf("%s",str[1]+1);
scanf("%s",str[2]+1);
scanf("%s",str[3]+1);
if(str[1][1]==str[1][2]&&str[1][2]==str[1][3]&&str[1][1]!='.'){
cout << str[1][1] << endl;
continue;
}
if(str[2][1]==str[2][2]&&str[2][2]==str[2][3]&&str[2][1]!='.'){
cout << str[2][1] << endl;
continue;
}
if(str[3][1]==str[3][2]&&str[3][2]==str[3][3]&&str[3][1]!='.'){
cout << str[3][1] << endl;
continue;
}
if(str[1][1]==str[2][1]&&str[2][1]==str[3][1]&&str[1][1]!='.'){
cout << str[1][1] << endl;
continue;
}
if(str[1][2]==str[2][2]&&str[2][2]==str[3][2]&&str[1][2]!='.'){
cout << str[1][2] << endl;
continue;
}
if(str[1][3]==str[2][3]&&str[2][3]==str[3][3]&&str[1][3]!='.'){
cout << str[1][3] << endl;
continue;
}
if(str[1][3]==str[2][2]&&str[2][2]==str[3][1]&&str[1][3]!='.'){
cout << str[1][3] << endl;
continue;
}
if(str[1][1]==str[2][2]&&str[2][2]==str[3][3]&&str[1][1]!='.'){
cout << str[1][1] << endl;
continue;
}
cout << "Waiting..." << endl;
}
//cout << "Hello world!" << endl;
return 0;
}
这是一个简单的纸牌题
http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1008&cid=838
/*
*@Author: STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,q,ans;
int a;
char str;
int p(int a,int b,int c){
if(a==b&&b==c){
return 3;
}
if(a==b||b==c||a==c){
return 2;
}
return 1;
}
int main()
{
#ifdef DEBUG
freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);
#endif
scanf("%d",&t);
int a,b,c;
int x,y,z;
while(t--){
scanf("%d%d%d",&a,&b,&c);
n=p(a,b,c);
scanf("%d%d%d",&x,&y,&z);
m=p(x,y,z);
if(n>m){
cout << "A" << endl;
}else if(n<m){
cout << "B" << endl;
}else{
if(n==3){
if(a>x){
cout << "A" << endl;
}else if(a<x){
cout << "B" << endl;
}else{
cout << "Tie" << endl;
}
}else if(n==2){
if(a==b)
k=c;
else if(a==c)
k=b;
else
k=a;
if(x==y)
q=z;
else if(x==z)
q=y;
else
q=x;
if(k>q){
cout << "A" << endl;
}else if(k<q){
cout << "B" << endl;
}else{
cout << "Tie0" << endl;
}
}else{
int tmp1[4],tmp2[4];
tmp1[1]=a,tmp1[2]=b,tmp1[3]=c;
tmp2[1]=x,tmp2[2]=y,tmp2[3]=z;
sort(tmp1+1,tmp1+4);
sort(tmp2+1,tmp2+4);
if(tmp1[3]>tmp2[3]){
cout << "A" << endl;
}else if(tmp1[3]<tmp2[3]){
cout << "B" << endl;
}else{
if(tmp1[2]>tmp2[2]){
cout << "A" << endl;
}else if(tmp1[2]<tmp2[2]){
cout << "B" << endl;
}else{
if(tmp1[1]>tmp2[1]){
cout << "A" << endl;
}else if(tmp1[1]<tmp2[1]){
cout << "B" << endl;
}else{
cout << "Tie" << endl;
}
}
}
}
}
}
//cout << "Hello world!" << endl;
return 0;
}