結果

問題 No.69 文字を自由に並び替え
ユーザー dgd1724dgd1724
提出日時 2016-09-19 20:37:53
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,024 bytes
コンパイル時間 913 ms
コンパイル使用メモリ 96,548 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-09 21:04:34
合計ジャッジ時間 1,688 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 #

#define _USE_MATH_DEFINES	//M_PI
#include <iostream>			//std::cout, std::cin
#include <string>			//std::string
#include <vector>			//std::vector
#include <valarray>			//std::valarray	数値のみの一次配列
#include <algorithm>		//std::sort
#include <time.h>			//localtime_s
#include <cstdlib>			//abs
#include <cmath>			//abs, std::pow, sqrt, sin, cos,
#include <fstream>			//std::ifstream
#include <iomanip>			//std::setprecision
#include <random>			//std::random(C++11)
#include <numeric>			//std::accumulate

int main(void) {

	
	//test用
	//std::ifstream in("test.txt");
	//std::cin.rdbuf(in.rdbuf());

	std::string A, B;
	std::cin >> A >> B;

	std::vector<int> temp1(A.length()), temp2(B.length());
	for (int i = 0; i < A.length(); i++) {
		temp1[i] = A[i];
		temp2[i] = B[i];
	}

	std::sort(temp1.begin(), temp1.end());
	std::sort(temp2.begin(), temp2.end());

	if (std::equal(temp1.begin(), temp1.end(), temp2.begin())) {
		std::cout << "Yes" << std::endl;
	}
	else {
		std::cout << "No" << std::endl;
	}
	
}


0