diff --git a/.gitignore b/.gitignore index ffb781c..bc6314b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .vscode run test -*.swp \ No newline at end of file +*.swp +markdown-cheat-sheet.md \ No newline at end of file diff --git a/contests/5contest/1.cpp b/contests/5contest/1.cpp index 61e4bb1..fd5e59e 100644 --- a/contests/5contest/1.cpp +++ b/contests/5contest/1.cpp @@ -2,20 +2,18 @@ #include #include -bool comp(unsigned int a, unsigned int b) { +int cnt_bit(unsigned int a) { int res1 = 0; while (a != 0) { res1 += a & 1; a = a >> 1; } - int res2 = 0; - while (b != 0) { - res2 += b & 1; - b = b >> 1; - } + return res1; +} - return res1 < res2; +bool comp(unsigned int a, unsigned int b) { + return cnt_bit(a) < cnt_bit(b); } diff --git a/contests/5contest/2.cpp b/contests/5contest/2.cpp index c36fe1e..573d524 100644 --- a/contests/5contest/2.cpp +++ b/contests/5contest/2.cpp @@ -11,12 +11,12 @@ int main() { mp[name].push_back(grade); } - for (auto x : mp) { + for (auto& x : mp) { std::cout << x.first << " "; double tmp = 0; int n = 0; - for (auto i : x.second) { + for (auto& i : x.second) { tmp += i; ++n; } diff --git a/contests/5contest/4.cpp b/contests/5contest/4.cpp index 453da20..14f2649 100644 --- a/contests/5contest/4.cpp +++ b/contests/5contest/4.cpp @@ -18,7 +18,7 @@ int main() { mp[std::make_pair(r, c)] %= mod; } - for (auto x : mp) { + for (auto& x : mp) { if (x.second) std::cout << x.first.first << " " << x.first.second << " " << x.second << std::endl; } diff --git a/seminars/4.pdf b/seminars/4.pdf deleted file mode 100644 index f726671..0000000 Binary files a/seminars/4.pdf and /dev/null differ diff --git a/seminars/7.pdf b/seminars/7.pdf deleted file mode 100644 index 473c7a5..0000000 Binary files a/seminars/7.pdf and /dev/null differ diff --git a/seminars/markdown-cheat-sheet.md b/seminars/markdown-cheat-sheet.md deleted file mode 100644 index c94cb27..0000000 --- a/seminars/markdown-cheat-sheet.md +++ /dev/null @@ -1,119 +0,0 @@ -# Markdown Cheat Sheet - -Thanks for visiting [The Markdown Guide](https://www.markdownguide.org)! - -This Markdown cheat sheet provides a quick overview of all the Markdown syntax elements. It can’t cover every edge case, so if you need more information about any of these elements, refer to the reference guides for [basic syntax](https://www.markdownguide.org/basic-syntax/) and [extended syntax](https://www.markdownguide.org/extended-syntax/). - -## Basic Syntax - -These are the elements outlined in John Gruber’s original design document. All Markdown applications support these elements. - -### Heading - -# H1 -## H2 -### H3 - -### Bold - -**bold text** - -### Italic - -*italicized text* - -### Blockquote - -> blockquote - -### Ordered List - -1. First item -2. Second item -3. Third item - -### Unordered List - -- First item -- Second item -- Third item - -### Code - -`code` - -### Horizontal Rule - ---- - -### Link - -[Markdown Guide](https://www.markdownguide.org) - -### Image - -![alt text](https://www.markdownguide.org/assets/images/tux.png) - -## Extended Syntax - -These elements extend the basic syntax by adding additional features. Not all Markdown applications support these elements. - -### Table - -| Syntax | Description | -| ----------- | ----------- | -| Header | Title | -| Paragraph | Text | - -### Fenced Code Block - -``` -{ - "firstName": "John", - "lastName": "Smith", - "age": 25 -} -``` - -### Footnote - -Here's a sentence with a footnote. [^1] - -[^1]: This is the footnote. - -### Heading ID - -### My Great Heading {#custom-id} - -### Definition List - -term -: definition - -### Strikethrough - -~~The world is flat.~~ - -### Task List - -- [x] Write the press release -- [ ] Update the website -- [ ] Contact the media - -### Emoji - -That is so funny! :joy: - -(See also [Copying and Pasting Emoji](https://www.markdownguide.org/extended-syntax/#copying-and-pasting-emoji)) - -### Highlight - -I need to highlight these ==very important words==. - -### Subscript - -H~2~O - -### Superscript - -X^2^ \ No newline at end of file