QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#715180 | #8225. 最小值之和 | Take_A_Single_6# | 11 | 9ms | 7820kb | C++14 | 1.2kb | 2024-11-06 10:42:40 | 2024-11-06 10:42:41 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define db double
#define maxn 1000005
#define mod 998244353
#define fir first
#define sec second
#define pr pair<int,int>
#define pb push_back
#define mk make_pair
#define inf 10000000000000000
using namespace std;
inline int read()
{
int SS=0,WW=1;
char ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-')WW=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9')
{
SS=(SS<<1)+(SS<<3)+(ch^48);
ch=getchar();
}
return SS*WW;
}
inline void write(int XX)
{
if(XX<0)putchar('-'),XX=-XX;
if(XX>9)write(XX/10);
putchar(XX%10+'0');
}
int T,n,sum,a[maxn],f[15][15],b[maxn];
char s[maxn];
void dfs(int u)
{
if(u>=n)
{
for(int i=1;i<n;i++)
{
for(int j=i;j<n;j++)
{
f[i][j]=inf;
for(int k=i;k<=j;k++)f[i][j]=min(f[i][j],b[k]);
}
}
for(int i=1;i<=n;i++)
{
sum=0;
for(int j=1;j<i;j++)sum+=f[j][i-1];
for(int j=i;j<n;j++)sum+=f[i][j];
if(sum!=a[i])return;
}
puts("Yes");
for(int i=1;i<n;i++)write(b[i]),putchar(' ');
exit(0);
}
for(int i=0;i<=20;i++)b[u]=i,dfs(u+1);
}
signed main()
{
n=read();
for(int i=1;i<=n;i++)a[i]=read();
dfs(1),puts("No");
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 11
Accepted
Test #1:
score: 11
Accepted
time: 3ms
memory: 5564kb
input:
5 14 14 12 13 13
output:
Yes 5 3 3 4
result:
ok The answer is correct.
Test #2:
score: 11
Accepted
time: 0ms
memory: 5692kb
input:
5 4 4 7 7 4
output:
Yes 1 1 4 1
result:
ok The answer is correct.
Test #3:
score: 11
Accepted
time: 1ms
memory: 5696kb
input:
5 4 13 14 14 13
output:
Yes 1 4 5 4
result:
ok The answer is correct.
Test #4:
score: 11
Accepted
time: 2ms
memory: 5772kb
input:
5 11 11 10 5 5
output:
Yes 5 4 1 2
result:
ok The answer is correct.
Test #5:
score: 11
Accepted
time: 0ms
memory: 7724kb
input:
5 10 10 10 4 4
output:
Yes 4 4 1 1
result:
ok The answer is correct.
Test #6:
score: 11
Accepted
time: 3ms
memory: 5620kb
input:
5 20 20 17 7 4
output:
Yes 10 7 2 1
result:
ok The answer is correct.
Test #7:
score: 11
Accepted
time: 2ms
memory: 7616kb
input:
5 12 12 16 19 19
output:
Yes 3 3 5 8
result:
ok The answer is correct.
Test #8:
score: 11
Accepted
time: 2ms
memory: 7796kb
input:
5 2 2 6 11 11
output:
Yes 2 0 3 8
result:
ok The answer is correct.
Test #9:
score: 11
Accepted
time: 0ms
memory: 7796kb
input:
5 10 10 8 5 5
output:
Yes 5 3 1 2
result:
ok The answer is correct.
Test #10:
score: 11
Accepted
time: 2ms
memory: 5608kb
input:
5 24 24 28 28 26
output:
Yes 6 6 9 7
result:
ok The answer is correct.
Test #11:
score: 11
Accepted
time: 1ms
memory: 5608kb
input:
5 5 5 22 31 31
output:
Yes 2 1 10 19
result:
ok The answer is correct.
Test #12:
score: 11
Accepted
time: 2ms
memory: 5772kb
input:
5 8 33 38 38 29
output:
Yes 2 11 16 9
result:
ok The answer is correct.
Test #13:
score: 11
Accepted
time: 2ms
memory: 7704kb
input:
5 16 16 4 12 12
output:
Yes 13 1 1 9
result:
ok The answer is correct.
Test #14:
score: 11
Accepted
time: 4ms
memory: 7660kb
input:
5 29 29 24 26 26
output:
Yes 11 6 6 8
result:
ok The answer is correct.
Test #15:
score: 11
Accepted
time: 1ms
memory: 5684kb
input:
5 0 33 33 32 32
output:
Yes 0 13 10 12
result:
ok The answer is correct.
Test #16:
score: 11
Accepted
time: 2ms
memory: 7820kb
input:
5 20 16 8 25 22
output:
No
result:
ok The answer is correct.
Test #17:
score: 11
Accepted
time: 8ms
memory: 7788kb
input:
5 0 2 3 0 2
output:
No
result:
ok The answer is correct.
Test #18:
score: 11
Accepted
time: 8ms
memory: 5572kb
input:
5 28 23 29 29 24
output:
No
result:
ok The answer is correct.
Test #19:
score: 11
Accepted
time: 4ms
memory: 5560kb
input:
5 0 1 0 4 2
output:
No
result:
ok The answer is correct.
Test #20:
score: 11
Accepted
time: 8ms
memory: 5748kb
input:
5 12 21 21 13 4
output:
No
result:
ok The answer is correct.
Test #21:
score: 11
Accepted
time: 9ms
memory: 7732kb
input:
5 9 22 25 23 12
output:
No
result:
ok The answer is correct.
Test #22:
score: 11
Accepted
time: 2ms
memory: 5696kb
input:
5 6 7 7 6 6
output:
Yes 2 3 1 3
result:
ok The answer is correct.
Test #23:
score: 11
Accepted
time: 4ms
memory: 5692kb
input:
5 25 25 24 20 20
output:
Yes 8 7 5 5
result:
ok The answer is correct.
Test #24:
score: 11
Accepted
time: 4ms
memory: 7732kb
input:
5 17 9 8 16 9
output:
No
result:
ok The answer is correct.
Test #25:
score: 11
Accepted
time: 5ms
memory: 5772kb
input:
5 20 5 34 34 23
output:
No
result:
ok The answer is correct.
Test #26:
score: 11
Accepted
time: 9ms
memory: 7800kb
input:
5 15 33 35 35 31
output:
No
result:
ok The answer is correct.
Test #27:
score: 11
Accepted
time: 8ms
memory: 5684kb
input:
5 21 22 23 1 18
output:
No
result:
ok The answer is correct.
Test #28:
score: 11
Accepted
time: 4ms
memory: 7744kb
input:
5 4 2 3 4 2
output:
No
result:
ok The answer is correct.
Test #29:
score: 11
Accepted
time: 8ms
memory: 7792kb
input:
5 16 25 8 19 7
output:
No
result:
ok The answer is correct.
Test #30:
score: 11
Accepted
time: 9ms
memory: 5684kb
input:
5 4 0 8 6 6
output:
No
result:
ok The answer is correct.
Test #31:
score: 11
Accepted
time: 0ms
memory: 7784kb
input:
2 2 3
output:
No
result:
ok The answer is correct.
Test #32:
score: 11
Accepted
time: 1ms
memory: 5624kb
input:
2 2 2
output:
Yes 2
result:
ok The answer is correct.
Test #33:
score: 11
Accepted
time: 1ms
memory: 5764kb
input:
1 0
output:
Yes
result:
ok The answer is correct.
Test #34:
score: 11
Accepted
time: 1ms
memory: 5684kb
input:
1 233
output:
No
result:
ok The answer is correct.
Subtask #2:
score: 0
Time Limit Exceeded
Dependency #1:
100%
Accepted
Test #35:
score: 0
Time Limit Exceeded
input:
8 16 16 8 8 9 9 6 6
output:
result:
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Dependency #1:
100%
Accepted
Test #77:
score: 0
Wrong Answer
time: 1ms
memory: 5664kb
input:
49 28 28 28 24 37 37 33 36 36 29 43 43 41 41 29 48 51 51 44 49 50 50 9 9 15 18 18 3 17 17 9 13 17 17 13 13 0 6 6 16 21 25 25 19 7 19 19 17 4
output:
Yes 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
result:
wrong answer Your answer is wrong.
Subtask #5:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%