Submission #15214

# Submission time Handle Problem Language Result Execution time Memory
15214 2015-07-12T03:59:14 Z BothEarRim 분배 (kriii3_Q) C++
Compilation error
0 ms 0 KB
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <utility>
#include <locale>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <climits>
#include <cfloat>
#include <map>
#include <functional>
using namespace std;
const double PI=acos(-1);

int N, K, arr[100000][100000];

int get2_(int in)
{ return 1<<in; }

int main() // 제3회 kriiicon
{
	scanf("%d %d", &N, &K);
	int row = get2_(K), col = get2_(N-K), cnt1 = 0, cnt2 = get2_(N)-1;
	bool flag = false;
	for(int i=0; i<row; i++)
		for(int j=0; j<col; j+=2)
		{
			arr[i][j] = cnt1++;
			arr[i][j+1] = cnt2--;
		}

	for(int i=0; i<row; i++)
	{
		printf("%d", arr[i][0]);
		for(int j=1; j<col; j++) printf(" %d", arr[i][j]);
		printf("\n");
	}

    return 0;
}

Compilation message

Q.cpp: In function ‘int main()’:
Q.cpp:33:7: warning: unused variable ‘flag’ [-Wunused-variable]
  bool flag = false;
       ^
Q.cpp:31:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &N, &K);
                        ^
/tmp/ccrzXkDV.o: In function `main':
Q.cpp:(.text.startup+0x5): relocation truncated to fit: R_X86_64_32 against symbol `K' defined in .bss section in /tmp/ccrzXkDV.o
Q.cpp:(.text.startup+0xe): relocation truncated to fit: R_X86_64_32 against symbol `N' defined in .bss section in /tmp/ccrzXkDV.o
Q.cpp:(.text.startup+0x26): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccrzXkDV.o
Q.cpp:(.text.startup+0x2c): relocation truncated to fit: R_X86_64_PC32 against symbol `K' defined in .bss section in /tmp/ccrzXkDV.o
/tmp/ccrzXkDV.o: In function `_GLOBAL__sub_I_N':
Q.cpp:(.text.startup+0x155): relocation truncated to fit: R_X86_64_32 against `.bss'
Q.cpp:(.text.startup+0x164): relocation truncated to fit: R_X86_64_32 against `.bss'
Q.cpp:(.text.startup+0x17e): relocation truncated to fit: R_X86_64_PC32 against `.bss'
/usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.a(ios_init.o): In function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x19): relocation truncated to fit: R_X86_64_PC32 against symbol `std::ios_base::Init::_S_refcount' defined in .bss._ZNSt8ios_base4Init11_S_refcountE section in /usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.a(ios.o)
/usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.a(ios_init.o): In function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x4a): relocation truncated to fit: R_X86_64_PC32 against symbol `__gnu_internal::buf_cout_sync' defined in .bss._ZN14__gnu_internal13buf_cout_syncE section in /usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.a(globals_io.o)
/usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.a(ios_init.o): In function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x51): relocation truncated to fit: R_X86_64_PC32 against symbol `__gnu_internal::buf_cout_sync' defined in .bss._ZN14__gnu_internal13buf_cout_syncE section in /usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.a(globals_io.o)
/usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.a(ios_init.o): In function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x5c): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status