結果
| 問題 | No.1130 Grid Numbers |
| ユーザー |
|
| 提出日時 | 2020-08-01 05:54:02 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 471 bytes |
| 記録 | |
| コンパイル時間 | 930 ms |
| コンパイル使用メモリ | 77,976 KB |
| 最終ジャッジ日時 | 2025-01-12 12:11:45 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
void solve() {
int h, w;
std::cin >> h >> w;
int n = h * w;
std::vector<int> xs(n);
for (auto& x : xs) std::cin >> x;
std::sort(xs.begin(), xs.end());
for (int i = 0; i < n; ++i) {
std::cout << xs[i] << " ";
if (i % w == w - 1) std::cout << "\n";
}
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
return 0;
}