結果
問題 |
No.1130 Grid Numbers
|
ユーザー |
![]() |
提出日時 | 2022-11-11 09:12:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 494 bytes |
コンパイル時間 | 1,555 ms |
コンパイル使用メモリ | 164,460 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 03:59:25 |
合計ジャッジ時間 | 2,003 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <stdio.h> #include <iomanip> #include <iostream> #include <string> #include <algorithm> int main(){ int a, b; cin >> a >> b; vector<int> vec(a*b); for(int i=0;i<a*b;i++){ cin >> vec.at(i); } sort(vec.begin(),vec.end()); for(int i=0; i<a*b;i++){ if((i%b==0)&&(i!=0)){ cout << endl << vec.at(i); } else if(i==0){ cout << vec.at(i); } else{ cout << " "<< vec.at(i); } } }