Submission #1010133

#TimeUsernameProblemLanguageResultExecution timeMemory
1010133giorgi123glmXoractive (IZhO19_xoractive)C++17
Compilation error
0 ms0 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main () { long long k = 0; cin >> k; int largestbit = 0; for (int i = 60; i >= 0; i--) if ((k & (1ll << i))) { largestbit = i; break; } k = (k ^ (1ll << largestbit)); int siz = max ( largestbit + 1, 5 ); vector <string> gr (siz, string (siz, '.')); for (int i = 0; i < largestbit; i++) { gr[i][i] = 'X'; gr[i + 1][i] = 'r'; gr[i][i + 1] = 'd'; } for (int i = 0; i < siz - 1; i++) { gr[siz - 1][i] = 'r'; gr[i][siz - 1] = 'd'; } for (int i = 2; i < largestbit; i++) if ((k & (1ll << i))) { gr[i][i - 1] = 'X'; gr[i - 1][i] = 'X'; } if ((k & 2ll) && (k & 1ll)) { gr[1][0] = 'X'; gr[0][1] = 'X'; gr[siz - 2][0] = 'X'; gr[siz - 2][1] = 'd'; } else if ((k & 2ll)) { gr[1][0] = 'X'; gr[0][1] = 'X'; } else if ((k & 1ll)) { gr[1][0] = 'X'; } cout << siz << ' ' << siz << '\n'; for (int y = 0; y < siz; y++) cout << gr[y] << '\n'; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccFHG0lN.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccSfh8PK.o:Xoractive.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccFHG0lN.o: in function `main':
grader.cpp:(.text.startup+0xdc): undefined reference to `guess(int)'
collect2: error: ld returned 1 exit status