結果
| 問題 | No.2680 研究室配属 |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2024-04-26 14:11:34 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 50 ms / 2,000 ms |
| + 754µs | |
| コード長 | 776 bytes |
| 記録 | |
| コンパイル時間 | 156 ms |
| コンパイル使用メモリ | 53,856 KB |
| 実行使用メモリ | 9,836 KB |
| 最終ジャッジ日時 | 2026-09-21 22:32:49 |
| 合計ジャッジ時間 | 3,836 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/algorithm:62,
from main.cpp:7:
In function 'void std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int*; _Tp = int]',
inlined from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = int*; _Tp = int]' at /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/bits/stl_algobase.h:979:21,
inlined from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int*; _Tp = int]' at /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/bits/stl_algobase.h:1011:20,
inlined from 'int main()' at main.cpp:33:7:
/home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/bits/stl_algobase.h:925:18: warning: 'void* __builtin_memset(void*, int, long unsigned int)' specified bound between 18446744065119617024 and 18446744073709551612 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
925 | *__first = __val;
| ~~~~~~~~~^~~~~~~
ソースコード
/* -*- coding: utf-8 -*-
*
* 2680.cc: No.2680 研究室配属 - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_N = 1000;
const int MAX_M = 1000;
/* typedef */
/* global variables */
int as[MAX_M], ts[MAX_N][MAX_M], ls[MAX_N];
/* subroutines */
/* main */
int main() {
int n, m;
scanf("%d%d", &n, &m);
for (int j = 0; j < m; j++) scanf("%d", as + j);
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++) scanf("%d", ts[i] + j);
fill(ls, ls + n, -1);
for (int j = 0; j < m; j++) {
for (int i = 0; i < n; i++)
if (ls[i] < 0 && as[ts[i][j]])
ls[i] = ts[i][j], as[ts[i][j]]--;
}
for (int i = 0; i < n; i++)
printf("%d%c", ls[i], (i + 1 < n) ? ' ' : '\n');
return 0;
}
tnakao0123