题目大意 给出 n × n n\times n n×n的二维数组 a a a,你要选定一个长度为 n n n的排列 p p p,求 ∑ i = 1 n ∑ j = 1 n ∣ p i − p j ∣ × a i , j \sum\limits_{i=1}^n\sum\limits_{j=1}^n|p_i-p_j|\times a_{i,j} i=1∑nj=1∑n∣pi−pj∣×ai,j
题意: 表示题意真的不好懂。 意思是n个车站,你要从1号车站走到n号车站,每走一个车站时间为1。 然后有行程为 i i i的地铁卡,代表最多能走 i i i个车站。 进入和离开第 i i i个站台的时间为 d [ i ] d[i] d[i] 现在已知每个地铁卡的价格 p [ i ] p[i] p[i],求选择一个地铁卡使得能在 t t t时间内到达 n n n车站 思路: 首先需要设置 p
A Journey Across Canada 一场横穿加拿大的旅行 across journey After a quiz last autumn, Kuang crossed the continent eastward to Toronto to visit his schoolmate, the distance measuring approximately 5000 ki
POJ-2488 A Knight’s Journey## A Knight’s Journey Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 43097 Accepted: 14620 Description Background The knight is getting bored of seeing the sam
题目描述 Recently Irina arrived to one of the most famous cities of Berland — the Berlatov city. There are n showplaces in the city, numbered from 1 to n , and some of them are connected by one-direction