ios::sync_with_stdio(false);
#include<iostream>
using namespace std;
int main()
{
//ios::sync_with_stdio(false);
int t;
for(int e=0,n[6],m[6];e<t;e++)
{
int num=0;
for(int f=0;f<6;f++)
{
cin>>n[f];
}
for(int f=0;f<6;f++)
{
cin>>m[f];
}
for(int a=0,b=0;a<6;a++)
{
for(int b=0;b<6;b++)
{
if(n[a]>m)
{
num++;
}
}
}
cout<<num<<endl;
}
return 0;
}
using namespace std;
std::cin
定義d[x]為由原點p到x已知路徑中的最短距離
Relax(m,t){
if(d[t]>d[m]+w[m][t]){ d[t]=d[m]+w[m][t] }
}
如果d[t]存在另一路徑,由p至m再由m至t的路,其權值更小,則選擇較小值會更好
林宇翔 發表於 2014-11-9 16:58
請問要參加npsc要學會哪些演算法
歡迎光臨 竹園論壇 (http://forum.tfcis.org/) | Powered by Discuz! X3.2 |