답안 #378868

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
378868 2021-03-17T06:46:59 Z Seanliu Gift (IZhO18_nicegift) C++14
컴파일 오류
0 ms 0 KB
#include <iostream>
#include <map>
#include <deque>
#include <vector>
#define int long long int
using namespace std;

const int maxN = 1e6 + 326;

int N, K;

signed main(){
	cin >> N >> K;
	int x;
	cin >> x;
	for(int i = 1; i <= N; i++) cin >> x;
	if(N % K){
		cout << -1 << endl;
		return 0;
	}
	cout << N / K << endl;
	for(int i = 1; i <= N; i += K){
		cout << arr[1] << " ";
		for(int j = i; j < i + K; j++) cout << j << " ";
		cout << endl;
	}
}

Compilation message

nicegift.cpp: In function 'int main()':
nicegift.cpp:23:11: error: 'arr' was not declared in this scope
   23 |   cout << arr[1] << " ";
      |           ^~~