<commit_before>---
layout: post
title: C++ CheatSheet
excerpt: "Notes about C++"
categories: articles
tags: [cpp]
author: riken_shah
comments: true
share: true
modified: 2017-03-17T14:18:57-04:00
published: true
---

# Random tips and tricks

- Use `long long` when very long numbers like 10^16

- `getline(cin, input_string);` can be used to readline from cin and store in input_string

-  Both of the following gives same o/p.

```
cout << fixed << setprecision(2) << pi << endl;
printf("%.2f", pi);
```



### References

- http://www.cs.wustl.edu/~schmidt/C++/<commit_msg>Update 2017-03-16-c++-cheatsheet.md<commit_after>---
layout: post
title: Competitive Programming Cheatsheet
excerpt: "Notes about Competitive Programming"
categories: articles
tags: [cpp, python, algorithms]
author: riken_shah
comments: true
share: true
modified: 2017-03-17T14:18:57-04:00
published: true
---

# Random tips and tricks

- Use `long long` when very long numbers like 10^16

- `getline(cin, input_string);` can be used to readline from cin and store in input_string

-  Both of the following gives same o/p.

```
cout << fixed << setprecision(2) << pi << endl;
printf("%.2f", pi);
```

- `(a + b) % n = (a % n + b % n ) % n`



### References

- http://www.cs.wustl.edu/~schmidt/C++/
{'fraction_non_alphanumeric': 0.1546310832025118, 'fraction_numerical': 0.04395604395604396, 'mean_word_length': 4.019685039370079, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6950252', 'n_tokens_mistral': 499, 'n_tokens_neox': 444, 'n_words': 144}