Submission #845581

# Submission time Handle Problem Language Result Execution time Memory
845581 2023-09-06T14:15:51 Z vjudge1 Konstrukcija (COCI20_konstrukcija) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define int long long

using namespace std;

int MX = 62;

void solve(void){
	int x;
	cin >> x;

	/*
	 *     7k+2   7k+3       <- 7k+4
	 *
	 *  7k+5  7k+6 7k+7      <- 7k+8
	 *
	 *
	 */

	cout << 7*MX+23 << " " << 14*MX + 13 + MX << "\n";

	cout << "1 2 \n2 3\n2 4\n3 6\n4 7\n3 8\n4 6\n4 7\n4 8\n"
	for(int i=1; i<MX; i++){

		cout << 7*i-2 +1 << " " << 7*i+2 +1 << "\n";
		cout << 7*i-2 +1 << " " << 7*i+3 +1 << "\n";

		cout << 7*i-1 +1 << " " << 7*i+2 +1 << "\n";
		cout << 7*i-1 +1 << " " << 7*i+3 +1 << "\n";

		cout << 7*i+0 +1 << " " << 7*i+2 +1 << "\n";
		cout << 7*i+0 +1 << " " << 7*i+3 +1 << "\n";

		cout << 7*i+3 +1 << " " << 7*i+5 +1 << "\n";
		cout << 7*i+3 +1 << " " << 7*i+6 +1 << "\n";
		cout << 7*i+3 +1 << " " << 7*i+7 +1 << "\n";

		cout << 7*i+2 +1 << " " << 7*i+5 +1 << "\n";
		cout << 7*i+2 +1 << " " << 7*i+6 +1 << "\n";
		cout << 7*i+2 +1 << " " << 7*i+7 +1 << "\n";

		cout << 7*i+4 +1 << " " << 7*i+2 +1 << "\n";
		cout << 7*i+4 +1 << " " << 7*i+3 +1 << "\n";

		cout << 7*i+8 +1 << " " << 7*i+5 +1 << "\n";
		cout << 7*i+8 +1 << " " << 7*i+6 +1 << "\n";
	}

	int zero = 7*MX + 20;
	cout << zero << " " << 7*MX << "\n";

	cout << 7*MX-1 << " " << 7*MX+23 << "\n";
	cout << 7*MX+0 << " " << 7*MX+23 << "\n";
	cout << 7*MX+1 << " " << 7*MX+23 << "\n";

	int shift = 5;

	if(x<0){
		shift += 4;
		i = -i;
	}

	for(int i=0; i<MX; i++){
		int point = (MX-i-1)*7+shift;
		if( (x>>i)%2 == 0 )
			point = zero;

		cout << "1 " << point << "\n";
	}
}

signed main(){
	int t=1;
//	cin >> t;
	while(t--)
		solve();
	return 0;
}

Compilation message

konstrukcija.cpp: In function 'void solve()':
konstrukcija.cpp:22:58: error: expected ';' before 'for'
   22 |  cout << "1 2 \n2 3\n2 4\n3 6\n4 7\n3 8\n4 6\n4 7\n4 8\n"
      |                                                          ^
      |                                                          ;
   23 |  for(int i=1; i<MX; i++){
      |  ~~~                                                      
konstrukcija.cpp:23:15: error: 'i' was not declared in this scope
   23 |  for(int i=1; i<MX; i++){
      |               ^