QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#99982#4923. 整数lingchen0 98ms3824kbC++141.5kb2023-04-24 11:52:232023-04-24 11:52:24

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-24 11:52:24]
  • 评测
  • 测评结果:0
  • 用时:98ms
  • 内存:3824kb
  • [2023-04-24 11:52:23]
  • 提交

answer

// 5pts
#include "integer.h"
#include <bits/stdc++.h>
using namespace std;

int p[5100];

namespace Sub1 {
    void work(int n)
    {
        for(int i=0; i<n; i++) operate(i);
        for(int i=0; i<n; i++)
        {
            p[i]=operate(i)-__builtin_popcount(i+1);
            for(int j=1; j<1<<(n-p[i]); j++) operate(i);
        }
    }
}
namespace Sub2 {
    void work(int n)
    {
        for(int i=0; i<n; i++) operate(i);
        p[0]=0;
        for(int i=1; i<n; i++)
        {
            p[i]=operate(i)-__builtin_popcount(i);
            for(int j=0; j<n; j++) if(j!=i) operate(j);
            operate(0);
        }
    }
}
namespace Sub3 {
    void work(int n)
    {
        int p0;
        memset(p, -1, sizeof(p));
        for(int i=0; i<n; i++) operate(i);
        for(int i=0,t=0; i<n; i++)
        if(p[i]==-1)
        {
            int now=operate(i);
            p[i]=now-__builtin_popcount(++t);
            if(p[i]==0) p0=i;
            for(int j=0,tt=t; j<n; j++)
            if(j!=i)
            {
                int val=operate(j);
                if(val!=now+1)
                {
                    p[j]=val-tt;
                    if(p[j]==0) p0=j;
                }
                now=val; ++tt;
            }
            operate(p0);
        }
    }
}
vector<int> findPermutation (int n)
{
    Sub3::work(n);
	// if(n<=10) Sub1::work(n);
    // else Sub2::work(n);

    vector<int> ans;
    for(int i=0; i<n; i++) ans.push_back(p[i]);
    return ans;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 5
Accepted
time: 2ms
memory: 3824kb

input:

1
0

output:

68F82AC1898AF4BFACDCBB49543233A61773093A
OK
Passed using 3 operation(s): scoring 1.000
1.0000000000

result:

ok Passed using 3 operation(s): scoring 1.000

Test #2:

score: 5
Accepted
time: 2ms
memory: 3704kb

input:

3
0 2 1

output:

68F82AC1898AF4BFACDCBB49543233A61773093A
OK
Passed using 15 operation(s): scoring 1.000
1.0000000000

result:

ok Passed using 15 operation(s): scoring 1.000

Test #3:

score: 5
Accepted
time: 2ms
memory: 3704kb

input:

3
0 2 1

output:

68F82AC1898AF4BFACDCBB49543233A61773093A
OK
Passed using 15 operation(s): scoring 1.000
1.0000000000

result:

ok Passed using 15 operation(s): scoring 1.000

Test #4:

score: 0
Wrong Answer
time: 2ms
memory: 3596kb

input:

10
0 2 8 9 1 5 6 3 4 7

output:

68F82AC1898AF4BFACDCBB49543233A61773093A
WA
Incorrect answer: p_0 is expected to be 0 but found -7

result:

wrong answer Incorrect answer: p_0 is expected to be 0 but found -7

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Wrong Answer

Test #84:

score: 0
Wrong Answer
time: 98ms
memory: 3648kb

input:

5000
0 4022 1149 1576 2995 1809 3803 4188 1400 1251 4042 2830 766 4811 1622 4002 4474 1003 1152 130 4794 1902 1292 968 4673 3459 1795 3812 531 2335 1660 4968 3632 4047 353 4448 2515 1581 4259 1389 3628 3760 1381 2527 2353 4323 2807 386 1731 1973 1209 1982 232 747 2904 897 4375 2921 3384 457 1050 936...

output:

68F82AC1898AF4BFACDCBB49543233A61773093A
WA
Incorrect answer: p_0 is expected to be 0 but found -4994

result:

wrong answer Incorrect answer: p_0 is expected to be 0 but found -4994

Subtask #5:

score: 0
Skipped

Dependency #3:

0%