結果

問題 No.1994 Confusing Name
ユーザー mnmmnm
提出日時 2022-07-01 22:00:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,145 bytes
コンパイル時間 624 ms
コンパイル使用メモリ 80,336 KB
実行使用メモリ 12,068 KB
最終ジャッジ日時 2024-05-04 16:26:14
合計ジャッジ時間 4,679 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,624 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 4 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 4 ms
5,376 KB
testcase_10 AC 3 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <tuple>
#include <bitset>

#define rep(i,n) for(i=0; i<n; ++i)
#define inc_rep(i,a,n) for(i=a; i<n; ++i)
#define dec_rep(i,n,a) for(i=n; i>=a; --i)
#define in(a) cin >> a
#define out(a,b) cout << a << b
#define print_vec(v) for(auto it=v.begin();it!=v.end();++it)cout<<*it <<" ";cout<<endl
#define print_vec2d(v) for(int i=0;i<v.size();++i){for(int j=0;j<v[i].size();++j)cout<<v[i][j]<<" ";cout<<endl;}cout<<endl
using namespace std;
using lint = long long;


int main(void){
    lint i, j, k, cnt=0, x, y;
    lint p, q, n, m;
    in(n);
    vector<string> s(n);
    rep(i,n) in(s[i]);
    vector<lint> count(n,0);
    rep(i,n-1){
        inc_rep(j,i+1,n){
            if(s[i].size()==s[j].size()){
                // out(i,endl);
                cnt=0;
                rep(k,s[i].size()){
                    if(s[i][k]!=s[j][k]) cnt++;
                }
                if(cnt==1){
                    count[i]++; count[j]++;
                }
            }
        }
    }
    rep(i,n){
        out(count[i],endl);
    }

    return 0;
}
0