제출 #1353553

#제출 시각아이디문제언어결과실행 시간메모리
1353553nikulid카니발 티켓 (IOI20_tickets)C++20
컴파일 에러
0 ms0 KiB
#include "tickets.h"
#include <vector>
#include <bits/stdc++.h>

using namespace std;

#define ll long long

long long find_maximum(int k, vector<vector<int>> x) {
	int n = x.size();
	int m = x[0].size();
	vector<vector<int>> answer(n, vector<int>(m));
  ll total=0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
      answer[i][j] = 0;
      ns[i] = x[i][0];
		}
	}
  allocate_tickets(answer);
  sort(ns.begin(), ns.end());
  return ns[n/2];
}

컴파일 시 표준 에러 (stderr) 메시지

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:17:7: error: 'ns' was not declared in this scope; did you mean 'n'?
   17 |       ns[i] = x[i][0];
      |       ^~
      |       n
tickets.cpp:21:8: error: 'ns' was not declared in this scope; did you mean 'n'?
   21 |   sort(ns.begin(), ns.end());
      |        ^~
      |        n