Submission #1322813

#TimeUsernameProblemLanguageResultExecution timeMemory
1322813dadadadadPIN (CEOI10_pin)C++20
30 / 100
30 ms10916 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define str string #define fi first #define se second #define pll pair<ll, ll> #define pii pair<int, int> #define pb push_back #define all(x) x.begin(), x.end() const ll N = 1e5+5, INF = INT_MAX, MOD = 1e9 + 7; const ll INFL = LLONG_MAX; void solve(){ int n, d; cin >> n >> d; vector <str> s(n); for(int i = 0; i < n; i ++) { cin >> s[i]; } if(d == 1) { unordered_map <str, int> cnt; int ans = 0; for(int i = 0; i < n; i ++) { for(int j = 0; j < 4; j ++) { str s2 = s[i]; s2[j] = 'X'; ans += cnt[s2] - cnt[s[i]]; } for(int j = 0; j < 4; j ++) { str s2 = s[i]; s2[j] = 'X'; cnt[s2] ++; } cnt[s[i]] ++; } cout << ans; } if(d == 2) { unordered_map <str, int> cnt; } } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen(s".in", "r", stdin); // freopen(s".out", "w", stdout); int t; t = 1; // cin >> t; for(int i = 1; i <= t; i ++) { // cout << "Case " << i << ":\n"; solve(); // clean(); } // while(cin >> n){ // solve(); // } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...