結果

問題 No.170 スワップ文字列(Easy)
ユーザー Div9851
提出日時 2015-03-22 23:31:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 275 bytes
コンパイル時間 644 ms
コンパイル使用メモリ 71,460 KB
実行使用メモリ 6,816 KB
最終ジャッジ日時 2024-12-23 00:09:20
合計ジャッジ時間 1,514 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:14:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::set<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wformat=]
   14 |         printf("%d\n",poyo.size()-1);
      |                 ~^    ~~~~~~~~~~~~~
      |                  |               |
      |                  int             std::set<std::__cxx11::basic_string<char> >::size_type {aka long unsigned int}
      |                 %ld

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <set>
using namespace std;
int main() {
	string S;
	cin>>S;
	sort(S.begin(),S.end());
	set<string> poyo;
	do {
		poyo.insert(S);
	}while(next_permutation(S.begin(),S.end()));
	printf("%d\n",poyo.size()-1);
}
0