結果
問題 |
No.1971 Easy Sudoku
|
ユーザー |
|
提出日時 | 2022-06-10 21:56:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 784 bytes |
コンパイル時間 | 912 ms |
コンパイル使用メモリ | 92,048 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-21 06:15:12 |
合計ジャッジ時間 | 3,022 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 WA * 11 |
ソースコード
#include <iostream> #include <vector> #include <map> #include <queue> #include <algorithm> #include <set> #include <cmath> using namespace std; int main() { int n;cin>>n; vector<vector<int>> dp(n,vector<int>(n,-1)); vector<vector<bool>> tate(n,vector<bool>(4,false)); vector<vector<bool>> yoko(n,vector<bool>(4,false)); for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ for(int k=0;k<n;k++){ if(!tate[j][k] && !yoko[i][k]){ dp[i][j] = k; tate[j][k] = true;yoko[i][k]=true; break; } } } } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cout << dp[i][j]+1 << " "; } cout << endl; } }