結果
問題 |
No.459 C-VS for yukicoder
|
ユーザー |
![]() |
提出日時 | 2025-06-21 19:01:24 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,562 bytes |
コンパイル時間 | 3,199 ms |
コンパイル使用メモリ | 281,676 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-06-21 19:01:36 |
合計ジャッジ時間 | 9,819 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 WA * 25 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define fi first #define sc second #define pii pair<int,int> #define pdd pair<double,double> #define pb push_back #define umap unordered_map #define mset multiset #define pq priority_queue #define ull unsigned long long #define i128 __int128 #define ld long double #define fixs fixed<<setprecision const int maxn=1e5+10; int n,m,k,res[maxn][3],s[maxn]; vector<int> vec[maxn]; void solve(){ cin>>n>>m>>k; for(int i=1;i<=n;i++){ string str; cin>>str,str=" "+str; for(int j=1;j<=m;j++) s[j]+=(str[j]=='#'); } for(int i=1,x;i<=k;i++) cin>>x,x++,vec[x].pb(i); for(int i=1;i<=m;i++){ int sum=0; for(int j:{0,1,2}) if(i-j>0) sum+=vec[i-j].size(); if(sum==0) continue; for(int j:{0,1,2}){ if(i-j>0){ for(int x:vec[i-j]) res[x][j]+=s[i]/sum; } } s[i]%=sum; for(int j:{0,1,2}){ if(i-j>0){ for(int x:vec[i-j]){ if(s[i]>0) res[x][j]++,s[i]--; } } } } // for(int i=1;i<=k;i++) cout<<res[i][0]<<" "<<res[i][1]<<" "<<res[i][2]<<endl; for(int i=1;i<=k;i++){ for(int y=3;y;y--,cout<<endl){ for(int x=0;x<3;x++) cout<<(y<=res[i][x]?"#":"."); } } } int main(){ ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); int t=1; // cin>>t; while(t--) solve(); return 0; } /* Samples input: output: THINGS TODO: ??freopen??????? ???? ???????????? */