Submission #7509645
Source Code Expand
#include<bits/stdc++.h> using namespace std; bool b[110]; long long dis[110][110],len[110]; long long n,m,a,v; long long s,mb; long long leng; void dijkstra() { b[s]=1; len[s]=0; int mn1,mn2; for(int i=1;i<=n;i++) { mn1=420000000; for(int j=1;j<=n;j++) { if(!b[j]&&len[j]<mn1) { mn1=len[j]; mn2=j; } //cout<<i<<" "<<len[j]<<" "<<mn1<<" "<<mn2<<endl; } b[mn2]=1; for(int j=1;j<=n;j++) { //cout<<j<<" "<<len[j]<<" "<<mn2<<" "<<dis[mn2][j]<<endl;; len[j]=min(len[mn2]+dis[mn2][j],len[j]); } } } int main() { int a,b; cin>>a>>b; n=3,m=2; for(int i=0;i<=n;i++) for(int j=0;j<=n;j++) dis[i][j]=19260817123; for(int i=0;i<=n;i++) { len[i]=420000000; } dis[1][2]=a; dis[2][3]=-b; len[2]=a; s=1,mb=3; dijkstra(); cout<<len[mb]; return 0; } /* 5 5 1 2 1 1 3 5 2 4 9 3 4 1 4 5 1 1 5 */
Submission Info
Submission Time | |
---|---|
Task | A - 積雪深差 |
User | luogu_bot2 |
Language | C++ (GCC 5.4.1) |
Score | 0 |
Code Size | 846 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 0 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | WA | 1 ms | 256 KB |
00_sample_02.txt | WA | 1 ms | 256 KB |
00_sample_03.txt | WA | 1 ms | 256 KB |
test_01.txt | WA | 1 ms | 256 KB |
test_02.txt | WA | 1 ms | 256 KB |
test_03.txt | WA | 1 ms | 256 KB |
test_04.txt | WA | 1 ms | 256 KB |
test_05.txt | WA | 1 ms | 256 KB |
test_06.txt | WA | 1 ms | 256 KB |
test_07.txt | WA | 1 ms | 256 KB |
test_08.txt | WA | 1 ms | 256 KB |
test_09.txt | WA | 1 ms | 256 KB |
test_10.txt | WA | 1 ms | 256 KB |
test_11.txt | WA | 1 ms | 256 KB |
test_12.txt | WA | 1 ms | 256 KB |
test_13.txt | WA | 1 ms | 256 KB |
test_14.txt | WA | 1 ms | 256 KB |
test_15.txt | WA | 1 ms | 256 KB |
test_16.txt | WA | 1 ms | 256 KB |
test_17.txt | WA | 1 ms | 256 KB |