| Task: | Illuminati |
| Sender: | francden |
| Submission time: | 2025-10-27 17:50:26 +0200 |
| Language: | C++ (C++17) |
| Status: | COMPILE ERROR |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:29:33: error: expected ';' before '}' token
29 | count+=b.count()
| ^
| ;
30 |
31 | }
| ~Code
#include <iostream>
#include <vector>
#include <bitset>
#include <utility>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<bitset<3005>> tableau(n);
ios::sync_with_stdio(0);
cin.tie(0);
for (int i = 0; i < n; ++i) {
bitset<3005> x;
string s;
cin >> s;
for (int j = 0; j < n; ++j){
x[j]= s[j]-'0';
}
tableau[i] = x;
}
int count = 0;
for (int i = 0; i < n-2; ++i){
for (int j = i+1; j < n-1; ++j){
if (tableau[i][j]==1){
bitset<3005> b = (tableau[i]<<j+1)&(tableau[j]<<j+1);
count+=b.count()
}
}
}
cout << count;
}
