結果
| 問題 | No.3723 Climb or Detour |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-19 13:50:27 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 856 bytes |
| 記録 | |
| コンパイル時間 | 2,162 ms |
| コンパイル使用メモリ | 351,240 KB |
| 実行使用メモリ | 10,040 KB |
| 最終ジャッジ日時 | 2026-09-19 13:50:37 |
| 合計ジャッジ時間 | 6,845 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 38 WA * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,k;cin>>n>>k;
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;sx--;sy--;tx--;ty--;
int dis=abs(sx-tx)+abs(sy-ty);
int mn=dis,mx=dis*2-dis%2;
if(k<mn||k>mx||k%2!=dis%2){
cout<<"-1\n";
return 0;
}
int cnt=(k-mn)/2;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(i==sx&&j==sy||i==tx&&j==ty)cout<<".";
else if((i+j)%2){
if(i==sx&&(j>sy&&j<ty||j>ty&&j<sy)||j==sy&&(i>sx&&i<tx||i>tx&&i<sx)){
if(cnt){
cout<<"#";
cnt--;
}else{
cout<<".";
}
}else{
cout<<"#";
}
}else cout<<".";
}
cout<<endl;
}
}