From cf2b7c528ac60c22c6dcf1e42946cc52100ec8b5 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Tue, 17 Sep 2024 18:55:15 +0800 Subject: [PATCH] update --- 20240823/十四届蓝桥比赛/主要成分.cpp | 3 +- 20240823/十四届蓝桥比赛/八进制回文平方数.cpp | 3 +- 20240823/十四届蓝桥比赛/数独填数.cpp | 190 ++++++++++--------- 20240823/十四届蓝桥比赛/简单算术题.cpp | 2 +- 20240907/testTpl/testTpl.cpp | 25 ++- 5 files changed, 115 insertions(+), 108 deletions(-) diff --git a/20240823/十四届蓝桥比赛/主要成分.cpp b/20240823/十四届蓝桥比赛/主要成分.cpp index 43eedc4..3aa281a 100644 --- a/20240823/十四届蓝桥比赛/主要成分.cpp +++ b/20240823/十四届蓝桥比赛/主要成分.cpp @@ -1,4 +1,5 @@ -#include +#include +#include using namespace std; typedef long long ll; diff --git a/20240823/十四届蓝桥比赛/八进制回文平方数.cpp b/20240823/十四届蓝桥比赛/八进制回文平方数.cpp index 3aea3a5..f26ea27 100644 --- a/20240823/十四届蓝桥比赛/八进制回文平方数.cpp +++ b/20240823/十四届蓝桥比赛/八进制回文平方数.cpp @@ -1,4 +1,5 @@ -#include +#include +#include using namespace std; // bool is_pf(int n){ diff --git a/20240823/十四届蓝桥比赛/数独填数.cpp b/20240823/十四届蓝桥比赛/数独填数.cpp index 9c62187..b381365 100644 --- a/20240823/十四届蓝桥比赛/数独填数.cpp +++ b/20240823/十四届蓝桥比赛/数独填数.cpp @@ -1,98 +1,104 @@ -#include -using namespace std; +// #include +// #include +// #include +// using namespace std; -int m[10][10]; -bool h_is_used[10][10],l_is_used[10][10],t_is_used[5][5][10]; +// int m[10][10]; +// bool h_is_used[10][10],l_is_used[10][10],t_is_used[5][5][10]; -#ifdef OI -#define DB(code){code} -#define PV(v){cout<<#v<<" : "<<(v)<> find_next(int x,int y); +// void dfs(int x,int y); +// optional> find_next(int x,int y); + +// int main(){ +// for(int i=1;i<=9;i++){ +// string str; +// getline(cin,str); +// for(int j=1;j<=9;j++){ +// if(str[j-1]=='.'){ +// m[i][j]=-1; +// }else{ +// m[i][j]=str[j-1]-'0'; +// h_is_used[i][m[i][j]]=true; +// l_is_used[j][m[i][j]]=true; +// t_is_used[i/3+1][j/3+1][m[i][j]]=true; +// } +// } +// } +// DB( +// for(int i=1;i<=9;i++){ +// for(int j=1;j<=9;j++){ +// cout<first, find->second); +// } + +// optional> find_next(int x,int y){ +// for (int j=y+1; j<=9; j++) { +// if(m[x][j]==-1){ +// return make_optional>({x,j}); +// } +// } +// for(int i=x+1;i<=9;i++){ +// for(int j=1;j<=9;j++){ +// if(m[i][j]==-1){ +// return make_optional>({i,j}); +// } +// } +// } +// return nullopt; +// } + +// void dfs(int x,int y){ +// DB(PV(x)PV(y)cout<first, find->second); + +// h_is_used[x][i]=false; +// l_is_used[y][i]=false; +// t_is_used[x/3+1][y/3+1][i]=false; +// m[x][y]=-1; +// } +// } int main(){ - for(int i=1;i<=9;i++){ - string str; - getline(cin,str); - for(int j=1;j<=9;j++){ - if(str[j-1]=='.'){ - m[i][j]=-1; - }else{ - m[i][j]=str[j-1]-'0'; - h_is_used[i][m[i][j]]=true; - l_is_used[j][m[i][j]]=true; - t_is_used[i/3+1][j/3+1][m[i][j]]=true; - } - } - } - DB( - for(int i=1;i<=9;i++){ - for(int j=1;j<=9;j++){ - cout<first, find->second); -} - -optional> find_next(int x,int y){ - for (int j=y+1; j<=9; j++) { - if(m[x][j]==-1){ - return make_optional>({x,j}); - } - } - for(int i=x+1;i<=9;i++){ - for(int j=1;j<=9;j++){ - if(m[i][j]==-1){ - return make_optional>({i,j}); - } - } - } - return nullopt; -} - -void dfs(int x,int y){ - DB(PV(x)PV(y)cout<first, find->second); - - h_is_used[x][i]=false; - l_is_used[y][i]=false; - t_is_used[x/3+1][y/3+1][i]=false; - m[x][y]=-1; - } + } \ No newline at end of file diff --git a/20240823/十四届蓝桥比赛/简单算术题.cpp b/20240823/十四届蓝桥比赛/简单算术题.cpp index f5e7364..c223807 100644 --- a/20240823/十四届蓝桥比赛/简单算术题.cpp +++ b/20240823/十四届蓝桥比赛/简单算术题.cpp @@ -1,4 +1,4 @@ -#include +#include using namespace std; typedef long long ll; diff --git a/20240907/testTpl/testTpl.cpp b/20240907/testTpl/testTpl.cpp index e656363..4cdcb8d 100644 --- a/20240907/testTpl/testTpl.cpp +++ b/20240907/testTpl/testTpl.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -17,16 +16,16 @@ std::ostream& operator<<(std::ostream &os,const std::vector &v){ } template -void print(const Args& ...args){ +void zprint(const Args& ...args){ ((std::cout< -void println(const Args& ...args){ +void zprintln(const Args& ...args){ std::stringstream ss; ((ss< v(10); v[0]=1; for(int i=1;(u8)i