제출 #715088

#제출 시각아이디문제언어결과실행 시간메모리
715088keystoneSet (COCI21_set)C++14
0 / 110
1 ms212 KiB
#include <iostream> #include <cstring> using namespace std; int main() { int n, k; cin >> n >> k; int cards[n][k]; for (int i = 0; i < n; i++) { string s; cin >> s; for (int j = 0; j < k; j++) { cards[i][j] = s[j] - '0'; } } int count = 0; for (int i = 0; i < n-2; i++) { for (int j = i+1; j < n-1; j++) { bool is_set = true; for (int l = 0; l < k; l++) { int sum = cards[i][l] + cards[j][l] + cards[n-1][l]; if (sum % 3 != 0 && sum % 3 != 3) { is_set = false; break; } } if (is_set) { count++; } } } cout << count << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...