제출 #564333

#제출 시각아이디문제언어결과실행 시간메모리
564333jeqcho여행하는 상인 (APIO17_merchant)C++17
0 / 100
15 ms1108 KiB
#include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<pair<int,int>> vpi; #define FOR(i,a,b) for (int i = (a); i < (b); ++i) #define F0R(i,a) FOR(i,0,a) #define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i) #define R0F(i,a) ROF(i,0,a) #define trav(a,x) for (auto& a: x) #define pb push_back #define rsz resize #define sz(x) int(x.size()) #define all(x) begin(x), end(x) #define fi first #define se second int const N=1e2+3; int const K=1e3+3; int b[N][K],s[N][K]; vpi adj[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n,m,k; cin>>n>>m>>k; F0R(i,n) { F0R(j,k) { cin>>b[i][j]>>s[i][j]; } } F0R(i,m) { int a,u,t; cin>>a>>u>>t; --a;--u; adj[a].pb({u,t}); } int mx=0; trav(e,adj[0]) { F0R(j,k) { if(s[e.fi][j]==-1||b[0][j]==-1)continue; mx=max(mx,(max(s[0][j],s[e.fi][j])-b[0][j])/(2*e.se)); } } cout<<mx<<'\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...