language: C++ 4.7.2 (gcc-4.7.2)
date: 134 days 16 hours ago
link:
visibility: private
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <set>
using namespace std;
 
#define SZ 200
 
int main()
{
    int t[SZ][SZ];
    for (int y=0; y<SZ; y++) {
        for (int x=0; x<SZ; x++) {
            std::set<int> s;
            for (int yy=0; yy<y; yy++)
                s.insert(t[yy][x]);
            for (int xx=0; xx<x; xx++)
                s.insert(t[y][xx]);
            int r;
            for (r=0; s.count(r); r++) {}
            t[y][x] = r;
            if (r != (x^y))
            {
                cout << "Incorrect :( " << endl;
                return 0;
            }
        }
    }
    cout << "It works!" << endl;
}