結果
問題 |
No.696 square1001 and Permutation 5
|
ユーザー |
|
提出日時 | 2018-06-08 22:59:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 408 bytes |
コンパイル時間 | 1,554 ms |
コンパイル使用メモリ | 169,948 KB |
実行使用メモリ | 10,652 KB |
最終ジャッジ日時 | 2024-06-30 10:57:32 |
合計ジャッジ時間 | 24,021 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | TLE * 1 -- * 11 |
ソースコード
#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; }