結果
| 問題 | No.3657 Gathering Stones |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-30 14:26:41 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 707µs | |
| コード長 | 1,111 bytes |
| 記録 | |
| コンパイル時間 | 5,515 ms |
| コンパイル使用メモリ | 390,116 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-30 14:26:50 |
| 合計ジャッジ時間 | 7,289 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 57 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using mint = modint998244353;
ll MOD=998244353;
#define all(x) x.begin(), x.end()
#define rep(i, n) for(ll i = 0; (i) < (n); (i)++)
template<class T>
auto comp_idx(const T* ptr){
return [ptr](auto l_idx, auto r_idx){
return ptr[l_idx] < ptr[r_idx];
};
}
template<class T>
vector<ll> IndexSort(T vec){
vector<ll> ind(vec.size());
iota(all(ind), 0);
sort(all(ind), comp_idx(vec.data()));
return ind;
}
void yn(bool flag){
string ans = (flag) ? "Yes" : "No";
cout<<ans<<endl;
}
int main(){
ll n, m; cin>>n>>m;
vector<ll> count(m, 0);
rep(i, n){
string s; cin>>s;
rep(j, m){
if(s[j]=='#') count[j]++;
}
}
sort(all(count));
ll pre=0;
rep(i, m){
ll now=count[i];
rep(j, now-pre){
rep(k, m-i){
cout<<"#";
}
rep(k, i){
cout<<'.';
}
cout<<endl;
}
pre=now;
}
rep(i, n-count[m-1]){
rep(k, m){
cout<<'.';
}
cout<<endl;
}
}