結果

問題 No.69 文字を自由に並び替え
ユーザー 29da16429da164
提出日時 2020-07-22 16:38:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 953 bytes
コンパイル時間 2,725 ms
コンパイル使用メモリ 66,068 KB
実行使用メモリ 4,496 KB
最終ジャッジ日時 2023-09-02 21:59:01
合計ジャッジ時間 1,445 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
void aaa(int *a,int start,int end){
  if(start<end){
	for(int i=start;i<end; i++){
      if(a[i]>a[i+1]){
        int tmp=a[i];
        a[i]=a[i+1];
        a[i+1]=tmp;
      }
    }
    aaa(a,start,end-1);
  }
}

int main(void){
  int suma=0;
  int sumb=0;
  int xa[10],xb[10];
  
  std::string a;
  std::string b;

  std::cin >> a >> b;
  
  const char* ca = a.c_str();
  const char* cb = b.c_str();

  for(int i=0;i<a.length();i++){
    xa[i]=(int)ca[i];
  }
  for(int i=0;i<b.length();i++){
    xb[i]=(int)cb[i];
  }
  
  aaa(xa,0,a.length());
  aaa(xb,0,b.length());
  /*
  for(int i=0;i<a.length();i++){
    std::cout << (char)xa[i] <<',';
  }
  for(int i=0;i<a.length();i++){
    std::cout << (char)xb[i] <<',';
  }
  */
  int j=0;
  for(int i=0;i<a.length();i++){
    if(xa[i]!=xb[i]){
      std::cout << "No" <<std::endl;
      break;
    }
    else{
      j++;
    }
  }
  if(j==a.length())std::cout << "Yes" <<std::endl;
}
0