結果
問題 | No.2843 Birthday Present Struggle |
ユーザー | Butterflv |
提出日時 | 2024-08-24 01:08:43 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 769 bytes |
コンパイル時間 | 3,490 ms |
コンパイル使用メモリ | 276,412 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-08-24 01:08:50 |
合計ジャッジ時間 | 5,576 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#define _GLIBCXX_DEBUG #include<bits/stdc++.h> using namespace std; int N,x[3],y[3]; int dh[3]={-1,0,1},dw[3]={-1,0,1}; bool ichi(int h,int w){ if((h==x[0]&&w==y[0])||(h==x[1]&&w==y[1])) return true; else return false; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); cout<<fixed<<setprecision(15); cin>>N; if(N==5){ cout<<5<<endl; cout<<"1 3\n2 3\n3 3\n4 3\n5 3\n"; exit(0); } vector<pair<int,int>> ans; for(int i=0;i<3;i++)cin>>x[i]>>y[i]; for(int i=0;i<3;i++)for(int j=0;j<3;j++){ if(dh[i]==0&&dw[j]==0)continue; if(!ichi(x[2]+dh[i],y[2]+dw[j])) ans.push_back(make_pair(x[2]+dh[i],y[2]+dw[j])); } cout<<ans.size()<<endl; for(const auto& elm:ans)cout<<elm.first<<" "<<elm.second<<endl; }