百度搜索网站下方描述,大数据时代的智能营销,企业网站建设要多少钱,wordpress手机导航思路#xff1a;贪心 提交#xff1a;1次#xff08;看了题解$QwQ$#xff09; 题解#xff1a; 若我方最弱可以干掉对方最弱#xff0c;则干#xff1b; 否则若我方最强可以干掉对方最强#xff0c;则干#xff1b; 否则若我方最弱与对方最强平手#xff0c;则平贪心 提交1次看了题解$QwQ$ 题解 若我方最弱可以干掉对方最弱则干 否则若我方最强可以干掉对方最强则干 否则若我方最弱与对方最强平手则平 其实貌似一二条是可以互换的主要说明最后一条相当于用最垃圾的去换掉对方最强的。 #includecstdio
#includeiostream
#includealgorithm
#define ull unsigned long long
#define ll long long
#define R register int
using namespace std;
#define pause (for(R i1;i10000000000;i))
#define In freopen(NOIPAK.in,r,stdin)
#define Out freopen(out.out,w,stdout)
namespace Fread {
static char B[115],*SB,*DB;
#ifndef JACK
#define getchar() (SD(D(SB)fread(B,1,115,stdin),SD)?EOF:*S)
#endif
inline int g() {R ret0,fix1; register char ch; while(!isdigit(chgetchar())) fixch-?-1:fix;if(chEOF) return EOF; do retret*10(ch^48); while(isdigit(chgetchar())); return ret*fix;
} inline bool isempty(const char ch) {return (ch36||ch127);}
inline void gs(char* s) {register char ch; while(isempty(chgetchar()));do *sch; while(!isempty(chgetchar()));
}
} using Fread::g; using Fread::gs;namespace Luitaryi {
const int N100010;
int n,a[N],b[N];
inline int solve(int* a,int* b) {R h1,tn,l1,rn,ret0;while(htlr) {if(a[h]b[l]) ret2,h,l;else if(a[t]b[r]) ret2,--t,--r;else reta[h]b[r],h,--r;} return ret;
}
inline void main() {ng(); for(R i1;in;i) a[i]g();for(R i1;in;i) b[i]g();sort(a1,an1); sort(b1,bn1);printf(%d ,solve(a,b));printf(%d\n,2*n-solve(b,a));
}
}
signed main() {Luitaryi::main();
} 2019.07.21转载于:https://www.cnblogs.com/Jackpei/p/11223223.html