From becea492dbe9a7d976e28141f2f28b1384fa6332 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 26 Oct 2023 06:05:13 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=85=20Auto=20update=20Working=20Progr?= =?UTF-8?q?ess?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/UnworkedProject.md | 9 +++++++-- docs/WorkedProject.md | 33 +++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/docs/UnworkedProject.md b/docs/UnworkedProject.md index eabd311..6d0a27d 100644 --- a/docs/UnworkedProject.md +++ b/docs/UnworkedProject.md @@ -2,7 +2,12 @@ List các file chưa làm: +## PROBLEM_006 + 1. [6_004](../Problem_006/6_004.cpp) 2. [6_007](../Problem_006/6_007.cpp) -3. [7_002](../Problem_007/7_002.cpp) -4. [7_007](../Problem_007/7_007.cpp) + +## PROBLEM_007 + +1. [7_002](../Problem_007/7_002.cpp) +2. [7_007](../Problem_007/7_007.cpp) diff --git a/docs/WorkedProject.md b/docs/WorkedProject.md index 9c30a72..b1f99bf 100644 --- a/docs/WorkedProject.md +++ b/docs/WorkedProject.md @@ -2,19 +2,24 @@ List các file đã làm: +## PROBLEM_006 + 1. [6_001](../Problem_006/6_001.cpp) -1. [6_002](../Problem_006/6_002.cpp) -1. [6_003](../Problem_006/6_003.cpp) -1. [6_005](../Problem_006/6_005.cpp) -1. [6_006](../Problem_006/6_006.cpp) -1. [6_008](../Problem_006/6_008.cpp) -1. [6_009](../Problem_006/6_009.cpp) -1. [6_010](../Problem_006/6_010.cpp) +2. [6_002](../Problem_006/6_002.cpp) +3. [6_003](../Problem_006/6_003.cpp) +4. [6_005](../Problem_006/6_005.cpp) +5. [6_006](../Problem_006/6_006.cpp) +6. [6_008](../Problem_006/6_008.cpp) +7. [6_009](../Problem_006/6_009.cpp) +8. [6_010](../Problem_006/6_010.cpp) + +## PROBLEM_007 + 1. [7_001](../Problem_007/7_001.cpp) -1. [7_003](../Problem_007/7_003.cpp) -1. [7_004](../Problem_007/7_004.cpp) -1. [7_005](../Problem_007/7_005.cpp) -1. [7_006](../Problem_007/7_006.cpp) -1. [7_008](../Problem_007/7_008.cpp) -1. [7_009](../Problem_007/7_009.cpp) -1. [7_010](../Problem_007/7_010.cpp) +2. [7_003](../Problem_007/7_003.cpp) +3. [7_004](../Problem_007/7_004.cpp) +4. [7_005](../Problem_007/7_005.cpp) +5. [7_006](../Problem_007/7_006.cpp) +6. [7_008](../Problem_007/7_008.cpp) +7. [7_009](../Problem_007/7_009.cpp) +8. [7_010](../Problem_007/7_010.cpp) From 62eb8cd379bf9bfb123f4b0264be8f38fbf245f0 Mon Sep 17 00:00:00 2001 From: NTGNguyen <23521049@gm.uit.edu.vn> Date: Thu, 26 Oct 2023 14:42:35 +0700 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=85=20replace-correct-7=5F003?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Problem_007/7_003.cpp | 52 ++++++++++--------------------------------- 1 file changed, 12 insertions(+), 40 deletions(-) diff --git a/Problem_007/7_003.cpp b/Problem_007/7_003.cpp index d4ee4a6..955ad0e 100644 --- a/Problem_007/7_003.cpp +++ b/Problem_007/7_003.cpp @@ -5,60 +5,32 @@ const int MAX_SIZE = 100; const int MAXR = 100; const int MAXC = 100; -bool isFrobeniusMatrix(float matrix[MAX_SIZE][MAX_SIZE], int size) -{ - int countNonZeroColumns = 0; - - for (int i = 0; i < size; i++) - if (matrix[i][i] != 1) - return false; - for (int i = 0; i < size; i++) - for (int j = 0; j < size; j++) - if (i < j && matrix[i][j] != 0) - return false; +bool isMaTranDonVi(int matrix[MAX_SIZE][MAX_SIZE], int size); +void NhapMaTran(int matrix[MAX_SIZE][MAX_SIZE], int &size); +void NhapMaTran(int matrix[MAX_SIZE][MAX_SIZE], int &size) +{ + cin >> size; for (int i = 0; i < size; i++) { - int k = 0; for (int j = 0; j < size; j++) { - if (j > i && matrix[j][i] != 0) - k++; + cin >> matrix[i][j]; } - if (k != 0) - countNonZeroColumns++; } - if (countNonZeroColumns > 1) - return false; - return true; } -void NhapMaTran(float matrix[MAX_SIZE][MAX_SIZE], int size) +bool isMaTranDonVi(int matrix[MAX_SIZE][MAX_SIZE], int size) { for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { - cin >> matrix[i][j]; + if ((i == j && matrix[i][j] != 1) || (i != j && matrix[i][j] != 0)) + { + return false; + } } } -} - -int main() -{ - float a[MAXR][MAXC]; - int n; - cin >> n; - int m; - cin >> m; - NhapMaTran(a, n); - if (isFrobeniusMatrix(a, n)) - { - cout << "Yes"; - } - else - { - cout << "No"; - } - return 0; + return true; } \ No newline at end of file From 6be52c748d7eff047f6b1462cb58bf9bb8490f2a Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 26 Oct 2023 07:42:53 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9C=85=20Auto=20update=20Working=20Progr?= =?UTF-8?q?ess?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/UnworkedProject.md | 5 ++--- docs/WorkedProject.md | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/UnworkedProject.md b/docs/UnworkedProject.md index 6d0a27d..23411a1 100644 --- a/docs/UnworkedProject.md +++ b/docs/UnworkedProject.md @@ -1,13 +1,12 @@ ## UNWORKED PROJECTS -List các file chưa làm: -## PROBLEM_006 +### PROBLEM_006 1. [6_004](../Problem_006/6_004.cpp) 2. [6_007](../Problem_006/6_007.cpp) -## PROBLEM_007 +### PROBLEM_007 1. [7_002](../Problem_007/7_002.cpp) 2. [7_007](../Problem_007/7_007.cpp) diff --git a/docs/WorkedProject.md b/docs/WorkedProject.md index b1f99bf..a2d8869 100644 --- a/docs/WorkedProject.md +++ b/docs/WorkedProject.md @@ -1,8 +1,7 @@ ## WORKED PROJECTS -List các file đã làm: -## PROBLEM_006 +### PROBLEM_006 1. [6_001](../Problem_006/6_001.cpp) 2. [6_002](../Problem_006/6_002.cpp) @@ -13,7 +12,7 @@ List các file đã làm: 7. [6_009](../Problem_006/6_009.cpp) 8. [6_010](../Problem_006/6_010.cpp) -## PROBLEM_007 +### PROBLEM_007 1. [7_001](../Problem_007/7_001.cpp) 2. [7_003](../Problem_007/7_003.cpp)