Submission #408698

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4086982021-05-19 14:00:08mat_vCarnival Tickets (IOI20_tickets)C++14
100 / 100
881 ms102712 KiB
#include "tickets.h"
#include <bits/stdc++.h>
#define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
#define fb(i,a,b) for(int (i) = (a); (i) >= (b); --(i))
#define pii pair<int,int>
#define xx first
#define yy second
#define pb push_back
using namespace std;
typedef long long ll;
pii mat[1505][1505];
int ans[1505][1505];
int kol[1505];
int dole[1505];
int ima[1505];
bool uzo[1505];
long long find_maximum(int k, std::vector<std::vector<int>> x) {
int n = x.size();
int m = x[0].size();
ff(i,0,n - 1){
ff(j,0,m - 1){
mat[i + 1][j + 1] = {x[i][j], j+1};
}
}
ff(i,1,n)sort(mat[i] + 1, mat[i] + m + 1);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:25:2: note: in expansion of macro 'ff'
   25 |  ff(i,0,n - 1){
      |  ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:26:9: note: in expansion of macro 'ff'
   26 |         ff(j,0,m - 1){
      |         ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:30:2: note: in expansion of macro 'ff'
   30 |  ff(i,1,n)sort(mat[i] + 1, mat[i] + m + 1);
      |  ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:38:5: note: in expansion of macro 'ff'
   38 |     ff(i,1,n)ff(j,1,m)ans[i][j] = -1;
      |     ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:38:14: note: in expansion of macro 'ff'
   38 |     ff(i,1,n)ff(j,1,m)ans[i][j] = -1;
      |              ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:41:5: note: in expansion of macro 'ff'
   41 |     ff(i,1,n){
      |     ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:42:9: note: in expansion of macro 'ff'
   42 |         ff(j,1,k)suma -= mat[i][j].xx;
      |         ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:46:5: note: in expansion of macro 'ff'
   46 |     ff(i,1,n){
      |     ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:49:5: note: in expansion of macro 'ff'
   49 |     ff(i,1,(n*k)/2){
      |     ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:59:5: note: in expansion of macro 'ff'
   59 |     ff(i,1,n){
      |     ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:66:5: note: in expansion of macro 'ff'
   66 |     ff(j,1,k){
      |     ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:69:9: note: in expansion of macro 'ff'
   69 |         ff(i,1,n)uzo[i] = 0;
      |         ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:70:9: note: in expansion of macro 'ff'
   70 |         ff(i,1,n){
      |         ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:76:9: note: in expansion of macro 'ff'
   76 |         ff(i,1,n){
      |         ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:84:9: note: in expansion of macro 'ff'
   84 |         ff(i,1,n){
      |         ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:119:5: note: in expansion of macro 'ff'
  119 |     ff(i,1,n){
      |     ^~
tickets.cpp:4:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
    4 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
tickets.cpp:121:9: note: in expansion of macro 'ff'
  121 |         ff(j,1,m)row.pb(ans[i][j]);
      |         ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...