Submission #551459

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5514592022-04-20 18:28:47Ai7081Travelling Merchant (APIO17_merchant)C++17
0 / 100
48 ms2016 KiB
#include <bits/stdc++.h>
using namespace std;
#define long long long
const bool debug = 0;
const int N = 105;
const int K = 1005;
const long inf = 1e18;
struct item{
long x, t=inf;
item() {}
item(long x, long t) : x(x), t(t) {}
bool operator < (const item &o) const {
if (!t) return true;
if (!o.t) return false;
if (x == 0 && o.x == 0) return t < o.t;
return x*o.t < t*o.x;
}
bool operator > (const item &o) const {return !(*this < o);}
item operator + (const item &o) {return item(x+o.x, t+o.t);}
void operator += (const item &o) {x+=o.x; t+=o.t;}
};
long n, m, k, b[N][K], s[N][K];
item dis[N][N], out;
int main() {
scanf(" %lld %lld %lld", &n, &m, &k);
for (int i=1; i<=n; i++) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

merchant.cpp: In function 'int main()':
merchant.cpp:29:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   29 |     scanf(" %lld %lld %lld", &n, &m, &k);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
merchant.cpp:31:39: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |         for (int j=1; j<=k; j++) scanf(" %lld", &b[i][j]);
      |                                  ~~~~~^~~~~~~~~~~~~~~~~~~
merchant.cpp:32:39: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |         for (int j=1; j<=k; j++) scanf(" %lld", &s[i][j]);
      |                                  ~~~~~^~~~~~~~~~~~~~~~~~~
merchant.cpp:36:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   36 |         scanf(" %lld %lld %lld", &x, &y, &z);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...