結果

問題 No.696 square1001 and Permutation 5
ユーザー YukiDarumaYukiDaruma
提出日時 2018-06-08 22:59:08
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 408 bytes
コンパイル時間 2,343 ms
コンパイル使用メモリ 166,264 KB
実行使用メモリ 8,468 KB
最終ジャッジ日時 2023-09-13 00:08:44
合計ジャッジ時間 24,170 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
int i;
int N;
int iCnt;

	ios::sync_with_stdio( false );
	cin.tie( 0 );

	cin >> N;

vector<int> p( N );
vector<int> A( N );

	iota( A.begin(), A.end(), 1 );
	for( i = 0; i < N; i++ ) cin >> p[ i ];

	iCnt = 0;
	do
	{
		iCnt++;
		if( A == p ) break;
    }
	while( next_permutation( A.begin(), A.end() ) );

	cout << iCnt << endl;

	return 0;
}



0