Submission #403433

# Submission time Handle Problem Language Result Execution time Memory
403433 2021-05-13T07:32:29 Z Wasrek Swapping Cities (APIO20_swap) C++14
0 / 100
128 ms 10928 KB
#include<bits/stdc++.h>
#include "swap.h"
// #include"grader.cpp"
#include <vector>
#define SIZE 100010
#define MAX 2000000000
using namespace std;
struct A{
  int u,w;
  bool operator< (const A& o) const{
    return w<o.w;
  }
};
int sub2=1,n;
A m1={MAX,MAX},m2={MAX,MAX},m3={MAX,MAX};
vector<A> g[SIZE],wei;

void init(int N, int M, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
    n=N;
    for(int i=0;i<M;i++){
      g[U[i]].push_back({V[i],W[i]});
      g[V[i]].push_back({U[i],W[i]});
      wei.push_back({V[i],W[i]});
    }
    sort(wei.begin(),wei.end());
    // printf("%d %d\n%d %d\n%d %d\n",m1.u,m1.w,m2.u,m2.w,m3.u,m3.w);
    return ;
}

int getMinimumFuelCapacity(int X, int Y) {
  //min path ที่มี node อยู่ระหว่าง path
  //หา min ถนนที่เชื่อมกับโหนดตรงกลาง
  //เทียบ min กับ path อื่นๆ ไปได้ (เชื่อมตรงเลยก็ได้)
  // if(sub2){
    if(X==0 || Y==0 || n<=3) return -1;
    // printf("%d %d\n",g[X][0].w,g[Y][0].w);
    // for(auto x: wei){
    //   // printf("%d %d\n",x.u,x.w);
    //   if(X!=x.u && Y!=x.u) return max(g[X][0].w,max(g[Y][0].w,x.w));
    // }
  // }
  return -1;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 3 ms 2636 KB Output is correct
6 Correct 3 ms 2636 KB Output is correct
7 Correct 3 ms 2636 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 52 ms 7912 KB Output is correct
10 Correct 61 ms 8784 KB Output is correct
11 Correct 74 ms 8612 KB Output is correct
12 Correct 65 ms 9020 KB Output is correct
13 Correct 70 ms 8980 KB Output is correct
14 Correct 70 ms 8152 KB Output is correct
15 Correct 125 ms 10624 KB Output is correct
16 Correct 126 ms 10408 KB Output is correct
17 Correct 128 ms 10712 KB Output is correct
18 Correct 128 ms 10720 KB Output is correct
19 Incorrect 61 ms 6004 KB Output isn't correct
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Incorrect 114 ms 10928 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 3 ms 2636 KB Output is correct
6 Correct 3 ms 2636 KB Output is correct
7 Correct 3 ms 2636 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Incorrect 2 ms 2636 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2636 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2636 KB Output is correct
2 Correct 2 ms 2636 KB Output is correct
3 Correct 2 ms 2636 KB Output is correct
4 Correct 2 ms 2636 KB Output is correct
5 Correct 3 ms 2636 KB Output is correct
6 Correct 3 ms 2636 KB Output is correct
7 Correct 3 ms 2636 KB Output is correct
8 Correct 2 ms 2636 KB Output is correct
9 Correct 52 ms 7912 KB Output is correct
10 Correct 61 ms 8784 KB Output is correct
11 Correct 74 ms 8612 KB Output is correct
12 Correct 65 ms 9020 KB Output is correct
13 Correct 70 ms 8980 KB Output is correct
14 Correct 70 ms 8152 KB Output is correct
15 Correct 125 ms 10624 KB Output is correct
16 Correct 126 ms 10408 KB Output is correct
17 Correct 128 ms 10712 KB Output is correct
18 Correct 128 ms 10720 KB Output is correct
19 Incorrect 114 ms 10928 KB Output isn't correct
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2636 KB Output isn't correct