zoukankan      html  css  js  c++  java
  • hdu_1027(好吧。。。牛。。。next_permutation也可以水过)

     1 #include<cstdio>
     2 #include<cstring>
     3 #include<algorithm>
     4 using namespace std;
     5 const int N = 1010;
     6 int tm[N];
     7 int main()
     8 {
     9     int n, m;
    10     while (~scanf("%d%d", &n, &m))
    11     {
    12         for (int i = 1; i <= n; i++) {
    13             tm[i] = i;
    14         }
    15         m--;
    16         while (m--) {
    17             next_permutation(tm + 1, tm + n + 1);
    18         }
    19         for (int i = 1; i < n; i++)
    20             printf("%d ", tm[i]);
    21         printf("%d
    ", tm[n]);
    22     }
    23 }
  • 相关阅读:
    USB
    Google
    机型参数
    mac
    反编译
    xcode
    Ios 消息推送
    真机:特殊
    Android
    object-c
  • 原文地址:https://www.cnblogs.com/shanyr/p/6706627.html
Copyright © 2011-2022 走看看