Hello World社团冬季招新暨杭电Umis项目人才招募程序设计竞赛
這是一道簡單的簽到題
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 DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout); #endifwhile(~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 DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout); #endifwhile(~scanf("%d+%d=%d",&n,&m,&k)){if(n==1&m==1&&k==3)cout << "YES" << endl;elsecout << "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 DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout); #endifa[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; }這是一道簡單的數(shù)學(xué)題
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 DEBUGusing 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 DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout); #endifinit();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 DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout); #endifwhile(~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 DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout); #endifscanf("%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 DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout); #endifscanf("%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;elsek=a;if(x==y)q=z;else if(x==z)q=y;elseq=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; }?
總結(jié)
以上是生活随笔為你收集整理的Hello World社团冬季招新暨杭电Umis项目人才招募程序设计竞赛的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: HJ浇花
- 下一篇: New Year and the Chr