keys office_redistemplate.keys(keys) - CSDN
• DP
dp[i][j] 第一维表示people，第二维表示key

当i==j的时候，刚好每个人对应一把钥匙
当i!=j的时候，分两种情况,i去拿j，和i不用拿j

所以代码如下

#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <map>

#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=a;i>=b;i--)
#define mem(i,a) memset(i,a,sizeof(i))
#define rson mid+1,r,rt<<1|1
#define lson l,mid,rt<<1
#define ll long long
#define LL long long
using namespace std;
template <typename T>inline void read(T &_x_){
_x_=0;bool f=false;char ch=getchar();
while (ch<'0'||ch>'9') {if (ch=='-') f=!f;ch=getchar();}
while ('0'<=ch&&ch<='9') {_x_=_x_*10+ch-'0';ch=getchar();}
if(f) _x_=-_x_;
}
const double eps = 0.0000001;
const int maxn = 2e3+7;
const int mod = 1e9+7;

int n,k,p;
int a[maxn],b[maxn];
int dp[maxn][maxn];

int main(){
FOR(i,1,n) scanf("%d",&a[i]);
sort(a+1,a+1+n);
FOR(i,1,k) scanf("%d",&b[i]);
sort(b+1,b+1+k);
FOR(i,1,n){
FOR(j,i,k){
if(i==j){
dp[i][j]=max(dp[i-1][j-1],abs(a[i]-b[j])+abs(b[j]-p));
continue;
}
dp[i][j]=min(dp[i][j-1], max(dp[i-1][j-1],abs(a[i]-b[j])+abs(b[j]-p)));
}
}
int ans=0x7fffffff;
FOR(i,n,k) ans=min(ans,dp[n][i]);
printf("%d\n",ans);
return 0;
}

展开全文


# Windows 操作系统的KMS激活

# 设置用于激活的软件序列号
slmgr.vbs -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
# 设置KMS服务器地址（域名或IP地址）
slmgr.vbs -skms $hostname # 尝试连接到KMS服务器进行激活 slmgr.vbs -ato # Office 软件的KMS激活 # 定位到Office软件安装目录中（替换为自己的） cd %ProgramFiles%\Microsoft Office\Office16 # 设置软件序列号 cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX # 设置KMS服务器地址（域名或IP地址） cscript ospp.vbs /sethst:$hostname
# 尝试连接到KMS服务器进行激活
cscript ospp.vbs /act

In the tables that follow, "LTSC" stands for "Long-Term Servicing Channel," while "LTSB" refers to the "Long-Term Servicing Branch." Word "GVLKs" means "Generic Volume Licensing Key," and "GIKs" means "Generic Installation Key."

Windows Server Semi-Annual Channel versions

Operating System Edition
KMS Client Setup Key
Supported Version
Windows Server Datacenter
6NMRW-2C8FM-D24W7-TQWMY-CWH2D
version 1903, version 1809
Windows Server Standard
N2KJX-J94YW-TQVFB-DG9YT-724CC
version 1903, version 1809
Windows Server Datacenter
2HXDN-KRXHB-GPYC7-YCKFJ-7FVDG
version 1803
Windows Server Standard
PTXN8-JFHJM-4WC78-MPCBR-9W4KR
version 1803
Windows Server Datacenter
6Y6KB-N82V8-D8CQV-23MJW-BWTG6
version 1709
Windows Server Standard
DPCNP-XQFKJ-BJF7R-FRC8D-GF6G4
version 1709
Windows Server LTSC/LTSB versions

Operating System Edition
Client Setup Key
Key Type
Windows Server 2019 Datacenter
WMDGN-G9PQG-XVVXX-R3X43-63DFG
GVLKs
Windows Server 2019 Standard
N69G4-B89J2-4G8F4-WWYCC-J464C
GVLKs
Windows Server 2019 Essentials
WVDHN-86M7X-466P6-VHXV7-YY726
GVLKs
Windows Server 2016 Datacenter
CB7KF-BWN84-R7R2Y-793K2-8XDDG
GVLKs
Windows Server 2016 Standard
WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY
GVLKs
Windows Server 2016 Essentials
JCKRF-N37P4-C2D82-9YXRT-4M63B
GVLKs
Windows 10, all supported Semi-Annual Channel versions

Operating System Edition
Client Setup Key
Key Type
Windows 10 Home
TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
GVLKs
Windows 10 Home
YTMG3-N6DKC-DKB77-7M9GH-8HVX7
GIKs
Windows 10 Home N
3KHY7-WNT83-DGQKR-F7HPR-844BM
GVLKs
Windows 10 Home N
4CPRK-NM3K3-X6XXQ-RXX86-WXCHW
GIKs
Windows 10 Home Country Specific
PVMJN-6DFY6-9CCP6-7BKTT-D3WVR
GVLKs
Windows 10 Home Country Specific
N2434-X9D7W-8PF6X-8DV9T-8TYMD
GIKs
Windows 10 Home Single Language
7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
GVLKs
Windows 10 Home Single Language
BT79Q-G7N6G-PGBYW-4YWX6-6F4BT
GIKs
Windows 10 Pro
W269N-WFGWX-YVC9B-4J6C9-T83GX
GVLKs
Windows 10 Pro
VK7JG-NPHTM-C97JM-9MPGT-3V66T
GIKs
Windows 10 Pro N
MH37W-N47XK-V7XM9-C7227-GCQG9
GVLKs
Windows 10 Pro N
2B87N-8KFHP-DKV6R-Y2C8J-PKCKT
GIKs
Windows 10 Pro Workstations
NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J
GVLKs
Windows 10 Pro Workstations
DXG7C-N36C4-C4HTG-X4T3X-2YV77
GIKs
Windows 10 Pro Workstations N
9FNHH-K3HBT-3W4TD-6383H-6XYWF
GVLKs
Windows 10 Pro Workstations N
WYPNQ-8C467-V2W6J-TX4WX-WT2RQ
GIKs
Windows 10 Pro Education
6TP4R-GNPTD-KYYHQ-7B7DP-J447Y
GVLKs
Windows 10 Pro Education
8PTT6-RNW4C-6V7J2-C2D3X-MHBPB
GIKs
Windows 10 Pro Education N
YVWGF-BXNMC-HTQYQ-CPQ99-66QFC
GVLKs
Windows 10 Pro Education N
GJTYN-HDMQY-FRR76-HVGC7-QPF8P
GIKs
Windows 10 Education
NW6C2-QMPVW-D7KKK-3GKT6-VCFB2
GVLKs
Windows 10 Education
YNMGQ-8RYV3-4PGQ3-C8XTP-7CFBY
GIKs
Windows 10 Education N
2WH4N-8QGBV-H22JP-CT43Q-MDWWJ
GVLKs
Windows 10 Education N
84NGF-MHBT6-FXBX8-QWJK7-DRR8H
GIKs
Windows 10 Enterprise
NPPR9-FWDCX-D2C8J-H872K-2YT43
GVLKs
Windows 10 Enterprise
XGVPP-NMH47-7TTHJ-W3FW7-8HV2C
GIKs
Windows 10 Enterprise N
DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4
GVLKs
Windows 10 Enterprise N
WGGHN-J84D6-QYCPR-T7PJ7-X766F
GIKs
Windows 10 Enterprise G
YYVX9-NTFWV-6MDM3-9PT4T-4M68B
GVLKs
Windows 10 Enterprise G N
44RPN-FTY23-9VTTB-MP9BX-T84FV
GVLKs
Windows 10 LTSC/LTSB versions

Operating System Edition
Client Setup Key
Key Type
Windows 10 Enterprise LTSC 2019
M7XTQ-FN8P6-TTKYV-9D4CC-J462D
GVLKs
Windows 10 Enterprise LTSC 2019
43TBQ-NH92J-XKTM7-KT3KK-P39PB
GIKs
Windows 10 Enterprise LTSC 2019 N
92NFX-8DJQP-P6BBQ-THF9C-7CG2H
GVLKs
Windows 10 Enterprise LTSC 2019 N
2D7NQ-3MDXF-9WTDT-X9CCP-CKD8V
GIKs
Windows 10 Enterprise LTSB 2016
DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ
GVLKs
Windows 10 Enterprise LTSB 2016
NK96Y-D9CD8-W44CQ-R8YTK-DYJWX
GIKs
Windows 10 Enterprise LTSB 2016 N
QFFDN-GRT3P-VKWWX-X7T3R-8B639
GVLKs
Windows 10 Enterprise LTSB 2016 N
RW7WN-FMT44-KRGBK-G44WK-QV7YK
GIKs
Windows 10 Enterprise LTSB 2015
WNMTR-4C88C-JK8YV-HQ7T2-76DF9
GVLKs
Windows 10 Enterprise LTSB 2015
FWN7H-PF93Q-4GGP8-M8RF3-MDWWW
GIKs
Windows 10 Enterprise LTSB 2015 N
2F77B-TNFGY-69QQF-B8YKP-D69TJ
GVLKs
Earlier versions of Windows Server

Operating System Edition
Client Setup Key
Key Type
Windows Server 2012 R2 Server Standard
D2N9P-3P6X9-2R39C-7RTCD-MDVJX
GVLKs
Windows Server 2012 R2 Datacenter
W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9
GVLKs
Windows Server 2012 R2 Essentials
KNC87-3J2TX-XB4WP-VCPJV-M4FWM
GVLKs
Windows Server 2012
BN3D2-R7TKB-3YPBD-8DRP2-27GG4
GVLKs
Windows Server 2012 N
8N2M2-HWPGY-7PGT9-HGDD8-GVGGY
GVLKs
Windows Server 2012 Single Language
2WN2H-YGCQR-KFX6K-CD6TF-84YXQ
GVLKs
Windows Server 2012 Country Specific
4K36P-JN4VD-GDC6V-KDT89-DYFKP
GVLKs
Windows Server 2012 Server Standard
XC9B7-NBPP2-83J2H-RHMBY-92BT4
GVLKs
Windows Server 2012 MultiPoint Standard
HM7DN-YVMH3-46JC3-XYTG7-CYQJJ
GVLKs
XNH6W-2V9GX-RGJ4K-Y8X6F-QGJ2G
GVLKs
Windows Server 2012 Datacenter
48HP8-DN98B-MYWDG-T2DCC-8W83P
GVLKs
Windows Server 2008 R2 Web
6TPJF-RBVHG-WBW2R-86QPH-6RTM4
GVLKs
Windows Server 2008 R2 HPC edition
TT8MH-CG224-D3D7Q-498W2-9QCTX
GVLKs
Windows Server 2008 R2 Standard
YC6KT-GKW9T-YTKYR-T4X34-R7VHC
GVLKs
Windows Server 2008 R2 Enterprise
489J6-VHDMP-X63PK-3K798-CPX3Y
GVLKs
Windows Server 2008 R2 Datacenter
74YFP-3QFB3-KQT8W-PMXWJ-7M648
GVLKs
Windows Server 2008 R2 for Itanium-based Systems
GT63C-RJFQ3-4GMB6-BRFB9-CB83V
GVLKs
Windows Server 2008 Web
WYR28-R7TFJ-3X2YQ-YCY4H-M249D
GVLKs
Windows Server 2008 Compute Cluster
RCTX3-KWVHP-BR6TB-RB6DM-6X7HP
GVLKs
Windows Server 2008 Standard
TM24T-X9RMF-VWXK6-X8JC9-BFGM2
GVLKs
Windows Server 2008 Standard without Hyper-V
W7VD6-7JFBR-RX26B-YKQ3Y-6FFFJ
GVLKs
Windows Server 2008 Enterprise
YQGMW-MPWTJ-34KDK-48M3W-X4Q6V
GVLKs
Windows Server 2008 Enterprise without Hyper-V
39BXF-X8Q23-P2WWT-38T2F-G3FPG
GVLKs
Windows Server 2008 HPC
RCTX3-KWVHP-BR6TB-RB6DM-6X7HP
GVLKs
Windows Server 2008 Datacenter
7M67G-PC374-GR742-YH8V4-TCBY3
GVLKs
Windows Server 2008 Datacenter without Hyper-V
22XQ2-VRXRG-P8D42-K34TD-G3QQC
GVLKs
Windows Server 2008 for Itanium-Based Systems
4DWFP-JF3DJ-B7DTH-78FJB-PDRHK
GVLKs
Windows Server 2003 R2 Standard Edition x86
PWBJC-22697-D4CVH-FCJWW-DTF9J
GVLKs
Windows Server 2003 R2 Standard Edition x64
XCP6P-7WVXP-F8FQ4-JV6CD-6XV28
GVLKs
Windows Server 2003 R2 Enterprise Edition x86
XHPV3-PTCWJ-7Y94F-Q6BVH-J849J
GVLKs
Windows Server 2003 R2 Enterprise Edition x64
WQ3GW-Y8GQW-8VJYB-JYM43-D24C8
GVLKs
Windows Server 2003 R2 Datacenter Edition x86
FXYF6-VTXGX-3JPX9-HJ9K4-6TKTW
GVLKs
Windows Server 2003 R2 Datacenter Edition x64
KDX8X-FYW4T-C6D9J-BKM6M-M89TW
GVLKs
Windows Server 2003 R2 Web Edition x86
GM8KD-GB7JY-QGQYP-XRV74-RT728
GVLKs
Earlier versions of Windows

Operating System Edition
KMS Client Setup Key
Key Type
Windows 8.1
334NH-RXG76-64THK-C7CKG-D3VPT
GIKs
Windows 8.1 N
6NPQ8-PK64X-W4WMM-MF84V-RGB89
GIKs
Windows 8.1 ARM
NK2V7-9DWXG-KMTWQ-K9H9M-6VHPJ
GIKs
Windows 8.1 Country Specific
TNH8J-KG84C-TRMG4-FFD7J-VH4WX
GIKs
Windows 8.1 Single Language
Y9NXP-XT8MV-PT9TG-97CT3-9D6TC
GIKs
Windows 8.1 Pro
GCRJD-8NW9H-F2CDX-CCM8D-9D6T9
GVLKs
Windows 8.1 Pro
XHQ8N-C3MCJ-RQXB6-WCHYG-C9WKB
GIKs
Windows 8.1 Pro N
HMCNV-VVBFX-7HMBH-CTY9B-B4FXY
GVLKs
Windows 8.1 Pro N
JRBBN-4Q997-H4RM2-H3B7W-Q68KC
GIKs
Windows 8.1 Pro With WMC
GBFNG-2X3TC-8R27F-RMKYB-JK7QT
GIKs
Windows 8.1 Enterprise
MHF9N-XY6XB-WVXMC-BTDCT-MKKG7
GVLKs
Windows 8.1 Enterprise
FHQNR-XYXYC-8PMHT-TV4PH-DRQ3H
GIKs
Windows 8.1 Enterprise N
TT4HM-HN7YT-62K67-RGRQJ-JFFXW
GVLKs
Windows 8.1 Enterprise N
NDRDJ-3YBP2-8WTKD-CK7VB-HT8KW
GIKs
Windows 8
FB4WR-32NVD-4RW79-XQFWH-CYQG3
GIKs
Windows 8 N
VDKYM-JNKJ7-DC4X9-BT3QR-JHRDC
GIKs
Windows 8 ARM
6D4CN-WMGRW-DG8M6-XX8W9-3RPT8
GIKs
Windows 8 Country Specific
XYNVP-TW798-F8893-7B89K-8QHDK
GIKs
Windows 8 Single Language
XBRND-QDJTG-CQJDB-7DRBW-RX6HB
GIKs
Windows 8 Pro
NG4HW-VH26C-733KW-K6F98-J8CK4
GVLKs
Windows 8 Pro
XKY4K-2NRWR-8F6P2-448RF-CRYQH
GIKs
Windows 8 Pro N
XCVCF-2NXM9-723PB-MHCB7-2RYQQ
GVLKs
Windows 8 Pro N
BHHD4-FKNK8-89X83-HTGM4-3C73G
GIKs
Windows 8 Pro With WMC
RR3BN-3YY9P-9D7FC-7J4YF-QGJXW
GIKs
Windows 8 Enterprise
32JNW-9KQ84-P47T8-D8GGY-CWCK7
GVLKs
Windows 8 Enterprise
8M9BN-YB7W9-YV3­VJ-7WMGG-MKH3V
GIKs
Windows 8 Enterprise N
JMNMF-RHW7P-DMY6X-RF3DR-X2BQT
GVLKs
Windows 8 Enterprise N
NCVKH-RB9D4-R86X8-GB8WG-4M2K6
GIKs
Windows 7 Starter
7Q28W-FT9PC-CMMYT-WHMY2-89M6G
GIKs
Windows 7 Starter N
D4C3G-38HGY-HGQCV-QCWR8-97FFR
GIKs
Windows 7 Starter E
BRQCV-K7HGQ-CKXP6-2XP7K-F233B
GIKs
Windows 7 Home Basic
YGFVB-QTFXQ-3H233-PTWTJ-YRYRV
GIKs
Windows 7 Home Basic N
MD83G-H98CG-DXPYQ-Q8GCR-HM8X2
GIKs
Windows 7 Home Basic E
VTKM9-74GQY-K3W94-47DHV-FTXJY
GIKs
RHPQ2-RMFJH-74XYM-BH4JX-XM76F
GIKs
D3PVQ-V7M4J-9Q9K3-GG4K3-F99JM
GIKs
76BRM-9Q4K3-QDJ48-FH4F3-9WT2R
GIKs
Windows 7 Professional
FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4
GVLKs
Windows 7 Professional
HYF8J-CVRMY-CM74G-RPHKF-PW487
GIKs
Windows 7 Professional N
MRPKT-YTG23-K7D7T-X2JMM-QY7MG
GVLKs
Windows 7 Professional N
BKFRB-RTCT3-9HW44-FX3X8-M48M6
GIKs
Windows 7 Professional E
W82YF-2Q76Y-63HXB-FGJG9-GF7QX
GVLKs
Windows 7 Professional E
3YHKG-DVQ27-RYRBX-JMPVM-WG38T
GIKs
Windows 7 Ultimate
D4F6K-QK3RD-TMVMJ-BBMRX-3MBMV
GIKs
Windows 7 Ultimate N
HTJK6-DXX8T-TVCR6-KDG67-97J8Q
GIKs
Windows 7 Ultimate E
TWMF7-M387V-XKW4Y-PVQQD-RK7C8
GIKs
Windows 7 Enterprise
33PXH-7Y6KF-2VJC9-XBBR8-HVTHH
GVLKs
Windows 7 Enterprise
H7X92-3VPBB-Q799D-Y6JJ3-86WC6
GIKs
Windows 7 Enterprise N
YDRBP-3D83W-TY26F-D46B2-XCKRJ
GVLKs
Windows 7 Enterprise N
BQ4TH-BWRRY-424Y9-7PQX2-B4WBD
GIKs
Windows 7 Enterprise E
C29WB-22CC8-VJ326-GHFJW-H9DH4
GVLKs
Windows 7 Enterprise E
H3V6Q-JKQJG-GKVK3-FDDRF-TCKVR
GIKs
Windows Vista Starter
X9PYV-YBQRV-9BXWV-TQDMK-QDWK4
GIKs
Windows Vista Home Basic
RCG7P-TX42D-HM8FM-TCFCW-3V4VD
GIKs
Windows Vista Home Basic N
HY2VV-XC6FF-MD6WV-FPYBQ-GFJBT
GIKs
X9HTF-MKJQQ-XK376-TJ7T4-76PKF
GIKs
YFKBB-PQJJV-G996G-VWGXY-2V3X8
GVLKs
4D2XH-PRBMM-8Q22B-K8BM3-MRW4W
GIKs
HMBQG-8H2RH-C77VX-27R82-VMQBT
GVLKs
76884-QXFY2-6Q2WX-2QTQ8-QXX44
GIKs
Windows Vista Ultimate
VMCB9-FDRV6-6CDQM-RV23K-RP8F7
GIKs
Windows Vista Enterprise
VKK3X-68KWM-X2YGT-QR4M6-4BWMV
GVLKs
Windows Vista Enterprise N
VTC42-BM838-43QHV-84HX6-XJXKV
GVLKs
GVLKs for Microsoft Office 2019

Product Name
GVLKs
Office Pro Plus 2019
NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP
Office Standard 2019
6NWWJ-YQWMR-QKGCB-6TMB3-9D9HK
Project Pro 2019
B4NPR-3FKK7-T2MBV-FRQ4W-PKD2B
Project Standard 2019
C4F7P-NCP8C-6CQPT-MQHV9-JXD2M
Visio Pro 2019
9BGNQ-K37YR-RQHF2-38RQ3-7VCBB
Visio Standard 2019
7TQNQ-K3YQQ-3PFH7-CCPPM-X4VQ2
Access 2019
9N9PT-27V4Y-VJ2PD-YXFMF-YTFQT
Excel 2019
TMJWT-YYNMB-3BKTF-644FC-RVXBD
OneNote 2019
* 移除，归入Windows 10，名为 OneNote For Windows
Outlook 2019
7HD7K-N4PVK-BHBCQ-YWQRW-XW4VK
PowerPoint 2019
RRNCX-C64HY-W2MM7-MCH9G-TJHMQ
Publisher 2019
G2KWX-3NW6P-PY93R-JXK2T-C9Y9V
Word 2019
PBX3G-NWMT6-Q7XBW-PYJGG-WXD33
NCJ33-JHBBY-HTK98-MYCV8-HMKHJ
GVLKs for Microsoft Office 2016

Product Name
GVLKs
Office Pro Plus 2016
XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99
Office Standard 2016
JNRGM-WHDWX-FJJG3-K47QV-DRTFM
Project Pro 2016
YG9NW-3K39V-2T3HJ-93F3Q-G83KT
Project Standard 2016
GNFHQ-F6YQM-KQDGJ-327XX-KQBVC
Visio Pro 2016
PD3PC-RHNGV-FXJ29-8JK7D-RJRJK
Visio Standard 2016
7WHWN-4T7MP-G96JF-G33KR-W8GF4
Access 2016
GNH9Y-D2J4T-FJHGG-QRVH7-QPFDW
Excel 2016
9C2PK-NWTVB-JMPW8-BFT28-7FTBF
Mondo 2016
HFTND-W9MK4-8B7MJ-B6C4G-XQBR2
OneNote 2016
DR92N-9HTF2-97XKM-XW2WJ-XW3J6
Outlook 2016
R69KK-NTPKF-7M3Q4-QYBHW-6MT9B
PowerPoint 2016
J7MQP-HNJ4Y-WJ7YM-PFYGF-BY6C6
Publisher 2016
F47MM-N3XJP-TQXJ9-BP99D-8K837
Word 2016
WXY84-JN2Q9-RBCCQ-3Q3J3-3PFJ6
869NQ-FJ69K-466HW-QYCP2-DDBV6
GVLKs for Microsoft Office 2013

Product Name
GVLKs
Office Pro Plus 2013
YC7DK-G2NP3-2QQC3-J6H88-GVGXT
Office Standard 2013
KBKQT-2NMXY-JJWGP-M62JB-92CD4
Project Pro 2013
FN8TT-7WMH6-2D4X9-M337T-2342K
Project Standard 2013
6NTH3-CW976-3G3Y2-JK3TX-8QHTT
Visio 2013 Pro
C2FG9-N6J68-H8BTJ-BW3QX-RM3B3
Visio 2013 Standard
J484Y-4NKBF-W2HMG-DBMJC-PGWR7
Access 2013
NG2JY-H4JBT-HQXYP-78QH9-4JM2D
Excel 2013
VGPNG-Y7HQW-9RHP7-TKPV3-BG7GB
InfoPath 2013
DKT8B-N7VXH-D963P-Q4PHY-F8894
Lync 2013
2MG3G-3BNTT-3MFW9-KDQW3-TCK7R
Mondo 2013
42QTK-RN8M7-J3C4G-BBGYM-88CYV
OneNote 2013
TGN6P-8MMBC-37P2F-XHXXK-P34VW
Outlook 2013
QPN8Q-BJBTJ-334K3-93TGY-2PMBT
PowerPoint 2013
4NT99-8RJFH-Q2VDH-KYG2C-4RD4F
Publisher 2013
PN2WF-29XG2-T9HJ7-JQPJR-FCXK4
Word 2013
6Q7VD-NX8JD-WJ2VH-88V73-4GBJ7
GVLKs for Microsoft Office 2010

Product Name
GVLKs
Office Professional Plus 2010
VYBBJ-TRJPB-QFQRF-QFT4D-H3GVB
Office Standard 2010
V7QKV-4XVVR-XYV4D-F7DFM-8R6BM
D6QFG-VBYP2-XQHM7-J97RH-VVRCK
Project Professional 2010
YGX6F-PGV49-PGW3J-9BTGG-VHKC6
Project Standard 2010
4HP3K-88W3F-W2K3D-6677X-F9PGB
D9DWC-HPYVV-JGF4P-BTWQB-WX8BJ
Visio Professional 2010
7MCW8-VRQVK-G677T-PDJCM-Q8TCP
Visio Standard 2010
767HD-QGMWX-8QTDB-9G3R2-KHFGJ
Access 2010
V7Y44-9T38C-R2VJK-666HK-T7DDX
Excel 2010
H62QG-HXVKF-PP4HP-66KMR-CW9BM
Groove 2010
QYYW6-QP4CB-MBV6G-HYMCJ-4T3J4
SharePoint Workspace 2010
QYYW6-QP4CB-MBV6G-HYMCJ-4T3J4
InfoPath 2010
K96W8-67RPQ-62T9Y-J8FQJ-BT37T
Mondo 1 2010
YBJTT-JG6MD-V9Q7P-DBKXJ-38W9R
Mondo 2 2010
7TC2V-WXF6P-TD7RT-BQRXR-B8K32
OneNote 2010
Q4Y4M-RHWJM-PY37F-MTKWH-D3XHX
Outlook 2010
7YDC2-CWM8M-RRTJC-8MDVC-X3DWQ
PowerPoint 2010
RC8FX-88JRY-3PF7C-X8P67-P4VTT
Publisher 2010
BFK7F-9MYHM-V68C7-DRQ66-83YTP
Word 2010
HVHB3-C6FV7-KQX9W-YQG79-CRY7T
Last Update Date：2019/06/06

展开全文
• Office Keys time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n people and k keys on a straight line. Ev


D. Office Keys

time limit per test
2 seconds

memory limit per test
256 megabytes

input
standard input

output
standard output

There are n people and
k keys on a straight line. Every person wants to get to the office which is located on the line as well. To do that, he needs to reach some point with a key, take the key and then go to the office. Once a key is taken by somebody, it couldn't
be taken by anybody else.
You are to determine the minimum time needed for all n people to get to the office with keys. Assume that people move a unit distance per1 second. If two people reach a key at the same
time, only one of them can take the key. A person can pass through a point with a key without taking it.

Input
The first line contains three integers n,k andp (1 ≤ n ≤ 1 000,n ≤ k ≤ 2 000,1 ≤ p ≤ 109)
— the number of people, the number of keys and the office location.
The second line contains n distinct integersa1, a2, ..., an
(1 ≤ ai ≤ 109) — positions in which people are located initially. The positions are given in arbitrary order.
The third line contains k distinct integersb1, b2, ..., bk
(1 ≤ bj ≤ 109) — positions of the keys. The positions are given in arbitrary order.
Note that there can't be more than one person or more than one key in the same point. A person and a key can be located in the same point.

Output
Print the minimum time (in seconds) needed for all n to reach the office with keys.

Examples

Input
2 4 50
20 100
60 10 40 80

Output
50

Input
1 2 10
11
15 7

Output
7

Note
In the first example the person located at point 20 should take the key located at point40 and go with it to the office located at point50. He spends
30 seconds. The person located at point100 can take the key located at point80 and go to the office with it. He spends
50 seconds. Thus, after50 seconds everybody is in office with keys.

题目大意：

给你N个人，有K把钥匙，终点为P.

每个人要求拿一把钥匙到终点，问多长时间，能够使得所有人都做到。

思路：

设定Dp【i】【j】表示前i个人，在前j把钥匙中都拿到了钥匙，并且到终点的最优最长需求时间。

那么有：

if（i==j）Dp【i】【j】=max（Dp【i-1】【j-1】，第i个人走到钥匙j并且到终点的花费）；
else Dp【i】【j】=min（Dp【i】【j-1】，max（Dp【i-1】【j-1】，第i个人走到钥匙j并且到终点的花费））；

Ac代码：

#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<climits>
using namespace std;
int a[150000];
int b[150000];
int dp[1005][1005];
int main()
{
int n,k,p;
while(~scanf("%d%d%d",&n,&k,&p))
{
memset(dp,0,sizeof(dp));
for(int i=1;i<=n;i++)scanf("%d",&a[i]);
for(int i=1;i<=k;i++)scanf("%d",&b[i]);
sort(a+1,a+1+n);
sort(b+1,b+1+k);
for(int i=1;i<=n;i++)
{
for(int j=i;j<=k;j++)
{
if(i==j)
{
dp[i][j]=max(dp[i-1][j-1],abs(p-b[j])+abs(a[i]-b[j]));
continue;
}
dp[i][j]=min(dp[i][j-1],max(dp[i-1][j-1],abs(p-b[j])+abs(a[i]-b[j])));
}
}
int output=INT_MAX;
for(int i=n;i<=k;i++)
{
output=min(output,dp[n][i]);
}
printf("%d\n",output);
}
}
二分思路：

二分时间，贪心check.
每个人，尽量拿左边的钥匙即可。

Ac代码：

#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<climits>
using namespace std;
#define ll __int64
ll a[150000];
ll b[150000];
ll n,k,p;
ll Slove(ll mid)
{
ll output=0;
ll now=1;
for(ll i=1;i<=n;i++)
{
while(now<=k&&abs(b[now]-a[i])+abs(b[now]-p)>mid)
{
now++;
}
if(now<=k)
{
now++;
output++;
}
else break;
}
if(output>=n)return 1;
else return 0;
}
int main()
{
while(~scanf("%I64d%I64d%I64d",&n,&k,&p))
{
for(ll i=1;i<=n;i++)scanf("%I64d",&a[i]);
for(ll i=1;i<=k;i++)scanf("%I64d",&b[i]);
sort(a+1,a+1+n);
sort(b+1,b+1+k);
ll ans=-1;
ll l=0;
ll r=2000000000+50;
while(r>=l)
{
ll mid=(l+r)/2;
if(Slove(mid)==1)
{
ans=mid;
r=mid-1;
}
else l=mid+1;
}
printf("%I64d\n",ans);
}
}



展开全文
• 题意：有一个数轴，有n个人分别在ai的地方，你要去目的地p，但是去目的地之前必需去拿钥匙，有k把钥匙，每个人每秒只能移动一格，问你所有人都进到办公室需要最少需要多少时间 解析：由于不知道怎么想贪心策略，...
题目链接：http://codeforces.com/contest/831/problem/D
题意：有一个数轴，有n个人分别在ai的地方，你要去目的地p，但是去目的地之前必需去拿钥匙，有k把钥匙，每个人每秒只能移动一格，问你所有人都进到办公室需要最少需要多少时间
解析：由于不知道怎么想贪心策略，但是发现数据的规模并不大，n^2应该是能过的，而每个人只能对应一把钥匙，那么就直接排个序，然后枚举，拿长度为n的端去扫b数组，然后依次相减，维护最小值即可

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 20005;
const int inf = 0x7fffffff;
int a[maxn],b[maxn];
int main(void)
{
int n,m,goal;
scanf("%d %d %d",&n,&m,&goal);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
for(int j=0;j<m;j++)
scanf("%d",&b[j]);
sort(a,a+n);
sort(b,b+m);
int ans = inf;
for(int i=0;i<m-n+1;i++)
{
int mx = 0;
for(int j=0;j<n;j++)
mx = max(mx,abs(a[j]-b[i+j])+abs(b[i+j]-goal));
ans = min(ans,mx);
}
printf("%d\n",ans);
return 0;
}
展开全文
• Office Keys time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n people and k keys on a straight ...
• Office Keys time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n people and k keys on a ...
• There are n people and k keys on a straight line. Every person wants to get to the office which is located on the line as well. To do that, he needs to reach some point with a key, take the key ...
• Office Keys time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n people and k keys on a straight line. ...
• 题意： 在一条x坐标轴上，有n个人（坐标a1,a2,,,an），k把钥匙(坐标b1,b2,,,bk)，这n个人要任意捡一把钥匙，到达目标点p。 求： 所有人都到达目标点，花费时间最短 规模：n, k and p (1 ≤ n ≤ 1 000, n ≤ ...
• 题目大意，给出n个人的位置给出k把钥匙位置，n个人要到某地拿到钥匙再去p上班。一把钥匙只能由一人拥有。问n个人上班的最少时间是多少。 解法：先将a和b排序，直接二分答案，然后用n*k的复杂度，把n个人和k把钥匙...
• Office Keys time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n people and k keys on a ...
• 题意： n个人要去一个地方p，给出每个人的一维坐标a[i]，去这个地方需要一把钥匙，总共有k把钥匙，给出每把钥匙的坐标b[i]，问n个人最后都到达了这个地方需要多少经过多少时间，每个人走一个单位距离需要一个单位...
• Office Keys time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output There are n people and k keys on a straight line. Every person wants to get
• 题意解析二分贪心#include &lt;iostream&gt; #include &lt;algorithm&gt; #include &lt;cstdio&gt; #define ll long long #define maxn 100010 using namespace std;......
• Office Keys 题目链接 分类：dp、二分、贪心 1.题意概述 一个坐标轴上有n个人，他们坐标分别为a[1...n]a[1...n]，而且有k把钥匙坐标分别在b[1...k]b[1...k]，现在办公室们在坐标为p的位置，每个人必须要拿到唯...
• 题目地址：http://codeforces.com/contest/831/problem/D 题意： 办公室被锁住了，每个人必须去拿钥匙才能打开门，有n个人，m把钥匙，让你求出n个人全部进办公室的最短时间是多少。
• 水题? 初始化一下 dp[i][j]为第i个人拿了第k把钥匙花的时间 dp[i][j]=min(dp[i][j-1],max(dp[i-1][j-1],abs(a[i]-b[j])+abs(b[j]-p))); 为啥第二个是max呢,因为为了让最大的最小,所以让最小的最大,不证. ...
• 题目链接：Office Keys题目大意：有一条直线上有一些客户和钥匙，然后有一个终点，然后每个客户至少捡到一把钥匙再到终点，一把钥匙只能一个人用，现在所有的客户都拿到了一把钥匙并且到了终点，这些所有客户里面...
• 思路： 问题的关键在于对钥匙按照位置排序之后，最终选择的n个钥匙一定是其中的一个连续的区间。 实现： 1 #include <iostream> 2 #include <cstdio> 3 #include <... 6 ...
• Office Keys time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n people and k keys on a ...
...