結果

問題 No.1130 Grid Numbers
ユーザー elphe
提出日時 2025-02-16 11:49:48
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 472 bytes
コンパイル時間 1,066 ms
コンパイル使用メモリ 103,268 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-02-16 11:49:50
合計ジャッジ時間 2,050 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdint>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	
	uint32_t H, W, i, j;
	cin >> H >> W;
	vector<char> A(H * W);
	for (i = 0; i != H; ++i)
		for (j = 0; j != W; ++j)
			cin >> A[i * W + j];

	sort(A.begin(), A.end());
	for (i = 0; i != H; ++i)
	{
		cout << A[i * W];
		for (j = 1; j != W; ++j)
			cout << ' ' << A[i * W + j];
		cout << '\n';
	}

	return 0;
}
0