結果
| 問題 | No.3410 Happiest Art |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2025-12-17 04:30:16 |
| 言語 | cLay (20241019-1 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,094 bytes |
| 記録 | |
| コンパイル時間 | 3,840 ms |
| コンパイル使用メモリ | 194,400 KB |
| 実行使用メモリ | 47,892 KB |
| 最終ジャッジ日時 | 2025-12-17 04:30:27 |
| 合計ジャッジ時間 | 10,290 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 41 WA * 3 |
コンパイルメッセージ
warning: unknown type [error] for rd (reader) : s[i].a[y]
ソースコード
ull r[100][100];
if(1){
Rand g;
rep(y,100){
rep(x,100){
r[y][x]=(ull)g.get()<<32^g.get();
}
}
}
struct S{char a[100][101];};
ll@(n,u,h,w);
ll f[n];
S s[n];
rep(i,n){
rd(f[i]);
rep(y,h){
rd(s[i].a[y]);
}
}
ll best_v=-1;
S best_s;
unordered_map<ull,ll> m;
rrep(i,n){
ull b=0;
rep(y,h){
rep(x,w){
if(s[i].a[y][x]=='#'){
b^=r[y][x];
}
}
}
if(i<u){
ll v=++m[b];
if(best_v<v){
best_v=v;
best_s=s[i];
}
}else{
--m[b];
}
if(f[i]){
rep(y,h){
rep(x,w){
b^=r[y][x];
if(i<u){
ll v=++m[b];
if(best_v<v){
best_v=v;
best_s=s[i];
best_s.a[y][x]^='.'^'#';
}
}else{
--m[b];
}
b^=r[y][x];
}
}
}
}
if(best_v<0){
best_v=-200;
S s;
rep(y,h){
rep(x,w){
s.a[y][x]='.';
}
s.a[y][w]=0;
}
ull b=0;
unsigned t=0;
while(1){
unsigned c=__builtin_ctz(++t);
ll y=c/w;
ll x=c%w;
if(y>=h){
break;
}
b^=r[y][x];
s.a[y][x]^='.'^'#';
ll v=m[b];
if(best_v<v){
best_v=v;
best_s=s;
if(best_v==0){
break;
}
}
}
}
wt(best_v);
rep(y,h){
wt(best_s.a[y]);
}
tails