Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
75661 sh25_wangsj 全排列 C++ 通过 0 MS 248 KB 431 2025-12-09 10:48:10

Tests(2/2):


#include <iostream> #include <algorithm> using namespace std; int main() { int n; cin >> n; int nums[9] = {1,2,3,4,5,6,7,8,9}; do { for(int i=0; i<n; i++) { cout << nums[i]; } cout << endl; } while(next_permutation(nums, nums+n)); int count = 1; for(int i=1; i<=n; i++) count *= i; cout << count << endl; return 0; }


测评信息: