diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2022-11-05 01:41:11 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2022-11-05 01:41:11 +0200 |
| commit | 7f856c7ff080b8d455b9ed16c2e57dd862c3879d (patch) | |
| tree | c2baf90f98c91567358003d6b97a4afed7fa9b42 /LightsOut | |
| parent | c52b36c6a37fdb1d1de146d3939cb42e2c691f44 (diff) | |
| download | competitive-programming-7f856c7ff080b8d455b9ed16c2e57dd862c3879d.tar.xz competitive-programming-7f856c7ff080b8d455b9ed16c2e57dd862c3879d.zip | |
moved some file
Diffstat (limited to 'LightsOut')
| -rw-r--r-- | LightsOut/inp | 0 | ||||
| -rwxr-xr-x | LightsOut/main | bin | 49856 -> 0 bytes | |||
| -rw-r--r-- | LightsOut/main.cpp | 47 | ||||
| -rw-r--r-- | LightsOut/main_input0.txt | 3 | ||||
| -rw-r--r-- | LightsOut/main_input1.txt | 3 | ||||
| -rw-r--r-- | LightsOut/main_output0.txt | 3 | ||||
| -rw-r--r-- | LightsOut/main_output1.txt | 3 |
7 files changed, 0 insertions, 59 deletions
diff --git a/LightsOut/inp b/LightsOut/inp deleted file mode 100644 index e69de29..0000000 --- a/LightsOut/inp +++ /dev/null diff --git a/LightsOut/main b/LightsOut/main Binary files differdeleted file mode 100755 index 8462cbf..0000000 --- a/LightsOut/main +++ /dev/null diff --git a/LightsOut/main.cpp b/LightsOut/main.cpp deleted file mode 100644 index 6b49d5d..0000000 --- a/LightsOut/main.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include<bits/stdc++.h> - -using namespace std; - -bool safeMove(int i, int j) { - if(i < 0 || i > 2 || j < 0 || j > 2) { - return false; - } - return true; -} - -vector<vector<int>> sumAdjacents(vector<vector<int>> v) { - vector<vector<int>> ans(3, vector<int> (3)); - vector<int> dx = {1, 0, -1, 0}; - vector<int> dy = {0, 1, 0, -1}; - for(int i = 0; i < v.size();i++) { - for(int j = 0; j < v[i].size(); j++) { - ans[i][j] += v[i][j]; - for(int k = 0; k < 4; k++) { - int x = i + dx[k]; - int y = j + dy[k]; - if(safeMove(x, y)) { - ans[i][j] += v[x][y]; - } - } - (ans[i][j] & 1) ? ans[i][j] = 0 : ans[i][j] = 1; - } - } - return ans; -} - -int main () { - ios_base::sync_with_stdio(false); - cin.tie(NULL); - vector<vector<int>> v (3, vector<int> (3)); - for(auto &x : v) { - for(auto &y : x) { - cin >> y; - } - } - for(auto x : sumAdjacents(v)) { - for(auto z : x) { - cout << z; - } - cout << endl; - } -} diff --git a/LightsOut/main_input0.txt b/LightsOut/main_input0.txt deleted file mode 100644 index 4d005ec..0000000 --- a/LightsOut/main_input0.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 0 0 -0 0 0 -0 0 1 diff --git a/LightsOut/main_input1.txt b/LightsOut/main_input1.txt deleted file mode 100644 index 200a92e..0000000 --- a/LightsOut/main_input1.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 0 1 -8 8 8 -2 0 3 diff --git a/LightsOut/main_output0.txt b/LightsOut/main_output0.txt deleted file mode 100644 index 4c5ffb7..0000000 --- a/LightsOut/main_output0.txt +++ /dev/null @@ -1,3 +0,0 @@ -001 -010 -100 diff --git a/LightsOut/main_output1.txt b/LightsOut/main_output1.txt deleted file mode 100644 index 94207d9..0000000 --- a/LightsOut/main_output1.txt +++ /dev/null @@ -1,3 +0,0 @@ -010 -011 -100 |
