제출 #862225

#제출 시각아이디문제언어결과실행 시간메모리
862225HossamHero7Set (COCI21_set)C++14
40 / 110
1098 ms58484 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define endl '\n' void solve(){ int n,k; cin>>n>>k; vector<string> v(n); for(auto &i:v) cin>>i; map<string,bool> exist; for(auto i : v) exist[i] = 1; ll ans = 0; for(int i=0;i<n;i++){ exist[v[i]] = 0; for(int j=i+1;j<n;j++){ exist[v[j]] = 0; string tmp = ""; for(int f=0;f<k;f++){ if(v[i][f] == v[j][f]) tmp += v[i][f]; else tmp += 6-(v[i][f]-48+v[j][f]-48) + 48; } if(exist[tmp]) ans ++; } for(int j=i+1;j<n;j++) exist[v[j]] = 1; } cout<<ans<<endl; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t=1; //cin>>t; while(t--){ solve(); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...