結果

問題 No.2737 Compound Word
コンテスト
ユーザー Maeda
提出日時 2025-03-26 17:12:50
言語 C
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
RE  
実行時間 -
コード長 688 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 171 ms
コンパイル使用メモリ 38,720 KB
最終ジャッジ日時 2026-02-22 13:26:02
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <string.h>

void main(void){
	int n = 0 ;
    scanf("%d",&n);
    char str[n][200];
    for(int i = 0 ; i < n ; i++ ){
        scanf("%s",str[i]);
    }
    int count = 0 ;
    for(int i = 0 ; i < n ; i++){
        for(int j = i+1 ; j < n ; j++){
            char strA[1000] = "";
            char *strXY = strcat(strA,str[i]);
            strXY = strcat(strA,str[j]);
            char strB[1000] = "";
            char *strYX = strcat(strB,str[j]);
            strYX = strcat(strB,str[i]);
            if(strcmp(strXY,strYX) == 0){
                count++;
            }else{
                count += 2;
            }
        }
    }
    printf("%d",count);
}
0