提交记录 5206
| 提交时间 |
评测时间 |
| 2018-08-12 18:41:43 |
2020-08-01 00:13:48 |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#include<math.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAXN 100001
unsigned a[MAXN];
int n;
void down(int x){
int i=x,j;
while (i<<1<=n){
j=i; if (a[i<<1]<a[i])j=i<<1;
if ((i<<1)+1<=n&&a[(i<<1)+1]<a[j])j=(i<<1)+1;
if (j==i)break;
swap(a[i],a[j]); i=j;
}
}
int main() {
fread(a, 1, MAXN * 4, stdin);
n = a[0];
// Rearrange the ducks a[1] .. a[n] here
//std::sort(a + 1, a + n + 1); // ha?
for (int i=n/2;i;--i)down(i);
fwrite(a + 1, 1, n * 4, stdout);
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Subtask #1 Testcase #1 | 34.2 us | 44 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #2 | 39.47 us | 44 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #3 | 39.57 us | 44 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #4 | 35.4 us | 44 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #5 | 105.19 us | 120 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #6 | 176.37 us | 196 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #7 | 249.09 us | 276 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #8 | 391.95 us | 432 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #9 | 498.97 us | 552 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #10 | 500.96 us | 552 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #11 | 762.81 us | 816 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #12 | 253.47 us | 816 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #13 | 480.46 us | 816 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #14 | 481.97 us | 816 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #15 | 253.62 us | 816 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #16 | 761.67 us | 816 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #17 | 764.35 us | 816 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #18 | 485.22 us | 816 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #19 | 254.09 us | 816 KB | Wrong Answer | Score: 0 | 显示更多 |
| Subtask #1 Testcase #20 | 761.87 us | 816 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-12 06:24:16 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠