結果
| 問題 | No.3407 Birds-of-Paradise' Christmas Live |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2025-12-14 04:49:13 |
| 言語 | cLay (20250308-1 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,316 bytes |
| 記録 | |
| コンパイル時間 | 3,055 ms |
| コンパイル使用メモリ | 199,548 KB |
| 実行使用メモリ | 8,448 KB |
| 最終ジャッジ日時 | 2025-12-14 04:49:18 |
| 合計ジャッジ時間 | 5,138 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 10 WA * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:145:17: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
145 | for(auto[x,y]:a){
| ^
main.cpp:159:17: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
159 | for(auto[x,y]:a){
| ^
main.cpp:181:17: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
181 | for(auto[x,y]:a){
| ^
main.cpp:195:17: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
195 | for(auto[x,y]:a){
| ^
main.cpp:215:11: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
215 | for(auto[x,y]:a){
| ^
ソースコード
ll@n,@w[n],@m,@s[m];
rep(i,1,n)w[i]+=w[i-1];
rep(i,1,m)s[i]+=s[i-1];
map<pair<ll,ll>,ll>a,b;
a[{0,0}]=0;
a[{1,0}]=0;
ll c=0,d=0;
while(c<n&&d<m){
if(!(d<m)||c<n&&w[c]<=s[d]){
if(c&1){
// 0 open
if(c+1<n&&(!(d<m)||w[c+1]<=s[d])){
c+=2;
continue;
}
for(auto[x,y]:a){
if(x.first==0){
b[x]>?=y;
}else if(x.first==1){
b[x]>?=y;
b[{0,w[c]}]>?=y+(w[c]-x.second)**2;
}else{
b[{0,w[c]}]>?=y;
}
}
}else{
// 0 close
for(auto[x,y]:a){
if(x.first==0){
if(d&1){
b[{-1,0}]>?=y+(w[c]-x.second)**2;
}else{
b[{1,w[c]}]>?=y+(w[c]-x.second)**2;
}
}else{
b[x]>?=y;
}
}
}
c+=1;
}else{
if(d&1){
// 1 open
if(d+1<m&&(!(c<n)||s[d+1]<=w[c])){
d+=2;
continue;
}
for(auto[x,y]:a){
if(x.first==1){
b[x]>?=y;
}else if(x.first==0){
b[x]>?=y;
b[{1,s[d]}]>?=y+(s[d]-x.second)**2;
}else{
b[{1,s[d]}]>?=y;
}
}
}else{
// 1 close
for(auto[x,y]:a){
if(x.first==1){
if(c&1){
b[{-1,0}]>?=y+(s[d]-x.second)**2;
}else{
b[{0,s[d]}]>?=y+(s[d]-x.second)**2;
}
}else{
b[x]>?=y;
}
}
}
d+=1;
}
a.swap(b);
b.clear();
}
ll z=0;
for(auto[x,y]:a){
if(x.first>=0){
z>?=y+(w[n-1]-x.second)**2;
}else{
z>?=y;
}
}
wt(z);
tails