結果

問題 No.1994 Confusing Name
ユーザー rogi52rogi52
提出日時 2022-10-03 23:37:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,471 ms / 2,000 ms
コード長 670 bytes
コンパイル時間 2,567 ms
コンパイル使用メモリ 208,272 KB
実行使用メモリ 6,284 KB
最終ジャッジ日時 2023-08-27 21:14:58
合計ジャッジ時間 22,348 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 7 ms
4,376 KB
testcase_06 AC 14 ms
4,380 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 AC 11 ms
4,376 KB
testcase_09 AC 16 ms
4,376 KB
testcase_10 AC 8 ms
4,376 KB
testcase_11 AC 7 ms
4,376 KB
testcase_12 AC 1,152 ms
6,196 KB
testcase_13 AC 1,471 ms
6,196 KB
testcase_14 AC 1,332 ms
5,928 KB
testcase_15 AC 1,087 ms
5,424 KB
testcase_16 AC 923 ms
5,408 KB
testcase_17 AC 1,050 ms
5,348 KB
testcase_18 AC 1,406 ms
6,148 KB
testcase_19 AC 1,418 ms
6,204 KB
testcase_20 AC 1,412 ms
6,208 KB
testcase_21 AC 241 ms
4,376 KB
testcase_22 AC 109 ms
4,376 KB
testcase_23 AC 1,248 ms
5,928 KB
testcase_24 AC 1,224 ms
6,284 KB
testcase_25 AC 734 ms
4,876 KB
testcase_26 AC 347 ms
4,380 KB
testcase_27 AC 1,128 ms
5,936 KB
testcase_28 AC 796 ms
5,172 KB
testcase_29 AC 84 ms
4,380 KB
testcase_30 AC 879 ms
5,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    int N; cin >> N;
    vector<string> S(N);
    rep(i,N) cin >> S[i];

    auto T = S;
    sort(T.begin(), T.end());
    rep(i,N) {
        int ans = 0;
        rep(j,int(S[i].size())) {
            for(char c = 'a'; c <= 'z'; c++) {
                if(S[i][j] != c) {
                    swap(S[i][j], c);
                    ans += binary_search(T.begin(), T.end(), S[i]);
                    swap(S[i][j], c);
                }
            }
        }
        cout << ans << "\n";
    }
}
0