This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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,(s[e.fi][j]-b[0][j])/(2*e.se));
}
}
cout<<mx<<'\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |