编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#20178 #1060. youngmagician爆肝抽卡手游 Accepted 100 1977 ms 324 K C++ / 828 B 192023215325 2024-12-09 8:59:19
显示原始代码
#include <stdio.h>
#include <algorithm>
using namespace std;
struct information {
    int num;
    int value;
};
struct information x[10005];
int isget[10005] = { 0 };
bool cmp(struct information x, struct information y);
void isdrawn();
int n, m;
int a, b, c;
int main() {
    scanf("%d %d", &n, &m);
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            x[j].num = j;
            scanf("%d", &x[j].value);
        }
        sort(x + 1, x + m + 1, cmp);  // m个数排序,期望最大靠前
        isdrawn();
    }
    for (int j = 1; j <= m; j++) {
        printf("%d ", isget[j]);
    }
    return 0;
}
bool cmp(struct information x, struct information y) { return x.value > y.value; }
void isdrawn() {
    int i = 1;            //排序后的第一位
    int temp = x[i].num;  //原数据的真实位置
    while (isget[temp] == 1) {
        i++;
        temp = x[i].num;
    }
    isget[temp] = 1;  //置1
    return;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:397 ms
内存:324 KiB

输入文件(2.in

647 3832
2595 3238 2024 2678 2515 1212 3408 1670 2592 1435 3727 2214 3613 1291 2366 3424 2243 739 4
<11681495 bytes omitted>

答案文件(2.out

0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 
<7566 bytes omitted>

用户输出

0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 
<7536 bytes omitted>

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:315 ms
内存:304 KiB

输入文件(3.in

1000 2000
1255 1563 714 1801 986 517 1203 47 1865 1038 119 340 398 207 1986 1037 510 433 1049 1818 
<8894911 bytes omitted>

答案文件(3.out

1 1 1 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 0 1 0 0 0 1 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 
<3902 bytes omitted>

用户输出

1 1 1 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 0 1 0 0 0 1 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 
<3872 bytes omitted>

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:314 ms
内存:304 KiB

输入文件(4.in

1000 2000
398 1992 494 729 842 825 1013 29 1288 1544 341 248 1850 706 1476 516 596 431 1755 1168 11
<8894911 bytes omitted>

答案文件(4.out

0 1 0 0 0 1 0 1 0 1 0 0 0 1 1 1 1 0 1 0 1 0 0 1 1 0 1 1 1 0 1 0 1 0 0 1 1 0 1 1 0 0 0 0 0 0 1 0 0 1 
<3902 bytes omitted>

用户输出

0 1 0 0 0 1 0 1 0 1 0 0 0 1 1 1 1 0 1 0 1 0 0 1 1 0 1 1 1 0 1 0 1 0 0 1 1 0 1 1 0 0 0 0 0 0 1 0 0 1 1 1 1 0 0 0 1 0 0 0 0 1 0 1 
<3872 bytes omitted>

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:321 ms
内存:308 KiB

输入文件(5.in

1000 2000
1298 859 1921 1666 1460 790 203 1530 406 605 827 1972 723 438 106 713 593 974 181 1856 17
<8894911 bytes omitted>

答案文件(5.out

1 0 1 1 1 1 0 0 1 1 1 0 1 0 1 1 0 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1 0 0 1 1 1 0 1 1 1 0 1 1 1 0 0 
<3902 bytes omitted>

用户输出

1 0 1 1 1 1 0 0 1 1 1 0 1 0 1 1 0 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1 0 0 1 1 1 0 1 1 1 0 1 1 1 0 0 1 1 0 0 1 0 0 0 1 0 1 1 1 0 
<3872 bytes omitted>

系统信息

Exited with return code 0
测试点 #5
Accepted
得分:100
用时:315 ms
内存:308 KiB

输入文件(6.in

1000 2000
1480 815 900 1261 241 845 178 1613 787 881 1522 1897 354 68 40 397 1887 1400 1593 1563 13
<8894911 bytes omitted>

答案文件(6.out

0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 1 0 1 1 0 0 1 1 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 1 1 1 
<3902 bytes omitted>

用户输出

0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 1 0 1 1 0 0 1 1 1 0 1 1 1 1 0 1 1 0 1 0 0 0 1 1 1 1 1 1 0 1 1 1 0 0 0 0 0 1 0 0 
<3872 bytes omitted>

系统信息

Exited with return code 0
测试点 #6
Accepted
得分:100
用时:315 ms
内存:312 KiB

输入文件(7.in

1000 2000
414 380 896 547 199 1384 229 601 892 516 996 1185 860 1326 775 825 1360 511 1513 134 1573
<8894911 bytes omitted>

答案文件(7.out

1 0 1 1 0 0 1 1 1 1 1 0 1 1 0 1 1 1 0 0 0 1 0 1 1 1 1 1 0 1 0 0 1 1 0 0 0 1 1 0 0 1 1 1 0 0 0 1 1 0 
<3902 bytes omitted>

用户输出

1 0 1 1 0 0 1 1 1 1 1 0 1 1 0 1 1 1 0 0 0 1 0 1 1 1 1 1 0 1 0 0 1 1 0 0 0 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 
<3872 bytes omitted>

系统信息

Exited with return code 0