ZOJ Problem Set - 2397 Tian Ji -- The Horse Racing
set -- The Problem zoj
2023-09-14 08:58:48 时间
#include<iostream> #include<cmath> #include<algorithm> #define REP(i,n) for(int i=0;i<(n);i++) using namespace std; int a[2000],b[2000],n; int main(){ while (cin>>n,n){ REP(i,n)cin>>a[i]; REP(i,n)cin>>b[i]; sort(a,a+n); sort(b,b+n); int ha=0,ta=n-1,hb=0,tb=n-1,ans=0; REP(i,n){ if (a[ha]>b[hb])ans++,ha++,hb++; else if (a[ta]>b[tb])ans++,ta--,tb--; else ans-=(a[ha]!=b[tb]),ha++,tb--; } cout<<ans*200<<endl; } return 0; }
#define 用起来
相关文章
- springmvc接收前台(可以是ajax)传来的数组list,map,set等集合,复杂对象集合等图文详解
- oracle:与mysql相似得find_set_in函数用法
- python的dict,set,list,tuple应用详解
- [Javascript] Broadcaster + Operator + Listener pattern -- 10. Define a Function to Set Common Behaviors in Operators
- DISPLAY environment variable not set!
- python 使用set对列表去重,并保持列表原来顺序
- [Javascript] Broadcaster + Operator + Listener pattern -- 10. Define a Function to Set Common Behaviors in Operators
- [WASM] Set up wasm-bindgen for easy Rust/JavaScript Interoperability
- [ES6] 17. Set
- helm --set的使用示例及基本使用命令整理
- 使用jMeter的csv data set config避免用户密码的硬编码
- C. Glass Carving (CF Round #296 (Div. 2) STL--set的运用 && 并查集方法)
- es6 语法 (map、set和array 的对比)
- bash中的set, env, export unset的区别