QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#405367#6747. Permutationwifi32767AC ✓4ms3652kbC++206.5kb2024-05-05 19:58:392024-05-05 19:58:41

Judging History

你现在查看的是最新测评结果

  • [2024-05-05 19:58:41]
  • 评测
  • 测评结果:AC
  • 用时:4ms
  • 内存:3652kb
  • [2024-05-05 19:58:39]
  • 提交

answer

/*
                                       ____
                                          /|  |  |  |  l
                                     厂l  |  |  |  |
                                     | |  |  |  |  |
                                     | |_|_|_|_|
                                     { 个__o__}
                                     /|:i:厂\:i:i:i:i:i/^㍉
   八                                ./:i:|//¨ヽ  ̄ 彡、}
  i{  \                              .'/ハ|  艾_0  /<07|Y
  ,i{    寸                           .i人__|      {:.   |ノ
  i{      寸                           |:i:i:i:i:i:       /:.  ,'|
 ,i{        寸                             |:i:i:i:i八  /──-〉 /i|      那么开始投下
 ,i{         寸                       乂:i:i:i:| \     ./:iノ
 .i{          V                         .才:|   ≧寸彡ニ\
                 V                        .斗チ/ニl|    /ニニ    ー-
   乂       -─<{                      /   .|ニニ||   ./ニニ.     /  .V
     ` <   ∧ 寸厂V               /    .|ニニ||   /ニニ      /     ∨/
           ̄\ \ 寸              /      |ニニ||  //ニニ     /       ∨/
            / >v \            / .|    |ニニ|| .//ニニ     |       .V/
          / /./ 〉ハ',          /  |    |ニニ||//ニニ.      |        .∨/
          .{  / / ∨.|ニ\       /   |    |ニニ||/ニニ        |          ∨/
          .\. / /Vノニニ.\   ./     |    |ニニ|ニニ       |         ∨/
            \  ∨厂`)ニ.  寸<       .|    |ニニ|ニニ|       |          .∨/
              .\ 乂/ニ    \ \     |  |\|ニニニニニ|.∧       |           ∨/
              |ー::ニニニ      |  |    .|  |二ニニニニニニ|.      |             .∨/
              |ーニニニ            |  ⌒/ニニニ{ 寸     |              ∨/
              |ーニニニ            |   ./二/ Vニ.        |            ∨/
              |ーニニニ             |  /二/  |ニニ       |
              |=ニニニ            |  /二/   .|ニニ       |                                            ┛
*/
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define ll long long
#define ull unsigned long long
#define pii pair<ll, ll>
const int MAX = 2e6 + 10, mod = 998244353;
 
struct BIT{ //单点更新,区间查询
    int n;
    vector<ll> sum;
	BIT(const int &n = 0) : n(n + 5), sum(n + 5){}
    int lowbit(int x){
        return x & (-x);
    }
    void add(int pos, ll val){
        for (; pos <= n; pos += lowbit(pos))
            sum[pos] += val;
    }
    ll query(int pos){
        ll res = 0;
        for (; pos > 0; pos -= lowbit(pos))
            res += sum[pos];
        return res;
    }
    ll query(int l, int r){
        return query(r) - query(l - 1);
    }
};
ll power(ll x, int y){
    ll ans = 1;
    while (y){
        if (y & 1) ans *= x, ans %= mod;
        x *= x, x %= mod;
        y >>= 1;
    }
    return ans;
}
struct Hash{
    const ull P = 11037;
    int n;
    vector<ull> p, h1, h2;
    void init(string &s){
        n = s.size() - 1;
        p.resize(n + 2), h1.resize(n + 2), h2.resize(n + 2);
        p[0] = 1; h1[0] = 0, h2[n + 1] = 0;
        for(int i = 1 ; i <= n ; i ++) p[i] = p[i - 1] * P;
        for(int i = 1 ; i <= n ; i ++) h1[i] = h1[i - 1] * P + s[i];
        for(int i = n; i >= 1; -- i) h2[i] = h2[i + 1] * P + s[i];
    }
    ull get(int l, int r) { 
        return h1[r] - h1[l - 1] * p[r - l + 1];
    }
    ull get_rev(int l, int r){
        return h2[l] - h2[r + 1] * p[r - l + 1];
    }
};
// ll fac[MAX], inv[MAX];
// void init(int n){
//     fac[0] = 1;
//     for (int i = 1; i <= n; ++ i) fac[i] = fac[i - 1] * i % mod;
//     inv[n] = power(fac[n], mod - 2);
//     for (int i = n; i >= 1; i -- ) inv[i - 1] = inv[i] * i % mod;
// }
// ll cal(int x, int y){
//     if (y > x) return 0;
//     return (fac[x] * inv[y] % mod) * inv[x - y] % mod;
// }

int n;
void solve(){
    cin >> n;
    for (int i = 1; i <= n; ++ i) cout << i << ' ';
}
signed main(){
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	// cout << fixed << setprecision(6);
    // init();
    // int _;cin>>_;while (_ --)
        solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3552kb

input:

3

output:

1 2 3 

result:

ok ok

Test #2:

score: 0
Accepted
time: 1ms
memory: 3640kb

input:

7

output:

1 2 3 4 5 6 7 

result:

ok ok

Test #3:

score: 0
Accepted
time: 2ms
memory: 3584kb

input:

61956

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #4:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

79013

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #5:

score: 0
Accepted
time: 2ms
memory: 3572kb

input:

45517

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #6:

score: 0
Accepted
time: 2ms
memory: 3576kb

input:

40463

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #7:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

15281

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #8:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

69586

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #9:

score: 0
Accepted
time: 4ms
memory: 3524kb

input:

88636

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #10:

score: 0
Accepted
time: 1ms
memory: 3548kb

input:

2540

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #11:

score: 0
Accepted
time: 2ms
memory: 3652kb

input:

52103

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #12:

score: 0
Accepted
time: 4ms
memory: 3588kb

input:

76573

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #13:

score: 0
Accepted
time: 1ms
memory: 3572kb

input:

2893

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #14:

score: 0
Accepted
time: 3ms
memory: 3588kb

input:

60890

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #15:

score: 0
Accepted
time: 4ms
memory: 3612kb

input:

80639

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #16:

score: 0
Accepted
time: 3ms
memory: 3652kb

input:

70045

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #17:

score: 0
Accepted
time: 0ms
memory: 3484kb

input:

39320

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #18:

score: 0
Accepted
time: 1ms
memory: 3592kb

input:

9023

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #19:

score: 0
Accepted
time: 1ms
memory: 3596kb

input:

27667

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #20:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

63305

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #21:

score: 0
Accepted
time: 3ms
memory: 3548kb

input:

82556

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok

Test #22:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

12775

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok ok