The 2020 ICPC Asia Yinchuan Regional Programming Contest
A. Best Player
关于投影到坐标轴上,投影到x轴上,确实如果两个点的y值一样,会导致重影,但不能只看只看y轴的影响,还有要注意输出。
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=998244353;
ll x[110],y[110],z[110];
int main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);ll n;cin>>n;ll cntx=0;ll cnty=0;ll cntz=0;map<pair<ll,ll>,ll> nx,ny,nz;for(ll i=1;i<=n;i++){cin>>x[i]>>y[i]>>z[i];nx[{y[i],z[i]}]=1;ny[{x[i],z[i]}]=1;nz[{x[i],y[i]}]=1;}cntx=nx.size();cnty=ny.size();cntz=nz.size();if(cntx>=cnty&&cntx>=cntz)cout<<"X";else if(cnty>=cntx&&cnty>=cntz)cout<<"Y";else if(cntz>=cntx&&cntz>=cnty)cout<<"Z";return 0;
}
E.Isomerism
题目不难,但是翻译了很久。
#include<bits/stdc++.h>
using namespace std;
map<string , int>mp;
string s[5];
int t;signed main(){mp["-F"] = 8;mp["-Cl"] = 7;mp["-Br"] = 6;mp["-I"] = 5;mp["-CH3"] = 4;mp["-CH2CH3"] = 3;mp["-CH2CH2CH3"] = 2;mp["-H"] = 1;cin >> t;while(t --) {for(int i = 1 ; i <= 4; i ++ ){cin >> s[i];}if(s[1] == s[3] || s[2] == s[4]) {cout << "None"<<endl;} else if(s[1] == s[2] || s[3] == s[4]) {cout << "Cis"<<endl;} else if(s[1] == s[4] || s[2] == s[3]) {cout << "Trans"<<endl;} else {int tag1 = 0 , tag2 = 0;if(mp[s[1]]>mp[s[3]]) tag1 = 1;else tag1 = 2;if(mp[s[2]]>mp[s[4]]) tag2 = 1;else tag2 = 2;if(tag1 == tag2) {cout << "Zasamman"<<endl;} else {cout << "Entgegen"<<endl;}} }return 0;
}
J.Let's Play Jigsaw Puzzles!
。。。。