#include<iostream>usingnamespace std;intmain(){int n, m;scanf("%d%d",&n,&m);for(int i =1; i <= n; i ++){for(int j =1; j <= i; j ++)
cout <<'*';
cout << endl;}for(int i =1; i <= m; i ++){for(int j =1; j <= n -1; j ++)
cout <<' ';
cout <<'*'<< endl;}for(int i =1; i <= n; i ++){for(int j =1; i + j <= n +1; j ++)
cout <<'*';
cout << endl;}}
神之罚
#include<iostream>usingnamespace std;constint N =3010;typedeflonglong ll;
ll row[N], col[N];
ll w[N][N];intmain(){int n, m;scanf("%d%d",&n,&m);for(int i =0; i < n; i ++)for(int j =0; j < m; j ++){scanf("%lld",&w[i][j]);
row[i]+= w[i][j];
col[j]+= w[i][j];}
ll mx =0;for(int i =0; i < n; i ++)for(int j =0; j < m; j ++)
mx =max(mx, row[i]+ col[j]- w[i][j]);
cout << mx;}
隐藏的南通
#include<iostream>#include<algorithm>usingnamespace std;constint N =1e5+10;typedef pair<int,int> PII;
PII a[N];intmain(){int n;scanf("%d",&n);for(int i =0; i < n &&scanf("%d",&a[i].first); i ++);for(int i =0; i < n &&scanf("%d",&a[i].second); i ++){if(a[i].first < a[i].second)swap(a[i].first, a[i].second);}sort(a, a + n, greater<PII>());int ans =1e9;int mx = a[0].second, mi = a[n -1].first;for(int i =0; i < n; i ++){
ans =min(ans,max(mx, a[i].first)- mi);
mx =max(mx, a[i].second);
mi =min(mi, a[i].second);}
cout << ans;}
一决01(again)
#include<iostream>usingnamespace std;constint N =1010;bool st[N];intmain(){for(int i =1; i <=1000; i ++){for(int j :{1,2,9,20,24}){if(i >= j && st[i - j]==false)
st[i]=true;}}int _;scanf("%d",&_);while(_ --){int x;scanf("%d",&x);if(x >1000) x = x %500+500;if(st[x])puts("GuaGua shi 1!CeCe shi 0!");elseputs("CeCe shi 1!GuaGua shi 0!");}}
策策学长的排位日志
#include<iostream>usingnamespace std;intmain(){int n, p, q; cin >> n >> p >> q;int cnt =0;for(int _ =0; _ < n; _ ++){int kk, dd, aa; cin >> kk >> dd >> aa;int k, d, a;int cntk =0, cntd =0;bool ok =true;double kda =0;if(dd !=0) kda =(kk + aa)*1.0/ dd;
cntk += kk, cntd += dd;for(int i =0; i <4; i ++){
cin >> k >> d >> a;
cntk += k, cntd += d;if((k + a)*1.0/ d > kda) ok =false;}if(dd ==0) ok =true;if(cntk >= cntd){if(ok) cnt +=2* p;else cnt += p;}else{if(!ok){if(cnt <100) cnt -= q;
cnt =max(cnt,0);}}// cout << cntk << ' ' << cntd << endl;}if(cnt >=100) cout <<"YES";else cout <<"NO";}
zby 大小姐想让 zyx 学姐告白
#include<iostream>usingnamespace std;intmain(){int n;scanf("%d",&n);int cnt5 =0, cnt2 =0, cnt0 =0;for(int i =0, x; i < n &&scanf("%d",&x); i ++){if(x ==5) cnt5 ++;elseif(x ==2) cnt2 ++;elseif(x ==0) cnt0 ++;}
cout <<min(cnt5,min(cnt2, cnt0));}
zby 大小姐想让 zyx 学姐告白之大反派 ycy
#include<iostream>usingnamespace std;intmain(){int n;scanf("%d",&n);int cnt5 =0, cnt2 =0, res =0;for(int i =0, x; i < n &&scanf("%d",&x); i ++){if(x ==5) cnt5 ++;elseif(x ==2&& cnt5) cnt5 --, cnt2 ++;elseif(x ==0&& cnt2) cnt2 --, res ++;}
cout << res;}
至高无上的教皇
#include<iostream>usingnamespace std;constint N =3e3+10;int h[N], cnt[N];intmain(){int n;scanf("%d",&n);for(int i =0; i < n &&scanf("%d",&h[i]); i ++);for(int i =0; i < n; i ++){double mx;for(int j = i +1; j < n; j ++){double t =(h[j]- h[i])*1.0/(j - i);if(j == i +1) cnt[i]++, cnt[j]++, mx = t;elseif(t > mx){
mx = t;
cnt[i]++, cnt[j]++;}}}for(int i =0; i < n; i ++)printf("%d ", cnt[i]);}
教皇的达拉崩巴
#include<iostream>#include<cmath>usingnamespace std;typedeflonglong ll;intmain(){int _;scanf("%d",&_);while(_ --){
ll x, y;scanf("%lld%lld",&x,&y);
ll res =sqrt(x * y);if(res * res == x * y)puts("zhl he zwc tie tie");elseputs("zyx he zby tie tie");}}