Submission #759290

#TimeUsernameProblemLanguageResultExecution timeMemory
759290boyliguanhanTravelling Merchant (APIO17_merchant)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define l long long #define X(z) x[z][i][j] #define L F(i,n)F(j,n) #define F(x,y) for(l x=1;x<=y;++x) using namespace std; l n,m,K,x[4][101][1001]; bool C(l t) { L X(3)=-1e18; L { if(i==j||X(0)>1e9)continue; X(3)=-t*X(0); F(k,K) { if(x[1][i][k]<0||x[2][j][k]<0)continue; X(3)=max(X(3),x[2][j][k]-x[1][i][k]-t*X(0)); } } F(k,n)L X(3)=max(X(3),x[3][i][k]+x[3][k][j]); F(i,n) if(x[3][i][i]>=0)return 1; return 0; } int main() { cin >> n >> m >> K; L X(0)=2e9; F(i,n)F(j,K)cin>>X(1)>>X(2); F(k,m){ l i,j,c; cin>>i>>j>>c; X(0)=min(X(0),c); } F(k,n)L X(0)=min(X(0),x[0][i][k]+x[0][k][j]); l l=0,r=1e9; while(l<r-1){ if(C(l+r>>1)) l=l+r>>1; else r=l+r>>1; } cout << l<< '\n'; }

Compilation message (stderr)

merchant.cpp: In function 'int main()':
merchant.cpp:2:11: error: 'long long long' is too long for GCC
    2 | #define l long long
      |           ^~~~
merchant.cpp:32:7: note: in expansion of macro 'l'
   32 |     l l=0,r=1e9;
      |       ^
merchant.cpp:2:16: error: 'long long long' is too long for GCC
    2 | #define l long long
      |                ^~~~
merchant.cpp:32:7: note: in expansion of macro 'l'
   32 |     l l=0,r=1e9;
      |       ^
merchant.cpp:32:8: error: expected unqualified-id before '=' token
   32 |     l l=0,r=1e9;
      |        ^
merchant.cpp:2:16: error: 'long int' is not a template
    2 | #define l long long
      |                ^~~~
merchant.cpp:33:11: note: in expansion of macro 'l'
   33 |     while(l<r-1){
      |           ^
merchant.cpp:33:13: error: 'r' was not declared in this scope
   33 |     while(l<r-1){
      |             ^
merchant.cpp:2:11: error: expected primary-expression before 'long'
    2 | #define l long long
      |           ^~~~
merchant.cpp:33:11: note: in expansion of macro 'l'
   33 |     while(l<r-1){
      |           ^
merchant.cpp:33:11: error: expected ')' before 'long'
   33 |     while(l<r-1){
      |          ~^
      |           )
merchant.cpp:33:16: error: expected unqualified-id before ')' token
   33 |     while(l<r-1){
      |                ^
merchant.cpp:2:11: error: expected primary-expression before 'long'
    2 | #define l long long
      |           ^~~~
merchant.cpp:37:13: note: in expansion of macro 'l'
   37 |     cout << l<< '\n';
      |             ^