There are several types of folder.
- First type is the online judges folder prefixed by OJ_ . These are the online judges I've used to practice my problem solving.
- Second type is the folders I've used for my own practice and bug fixes, these are the Tests, Tricks, Learn folders
- Third type is the outside code folders, these are the folders that have mostly codes that I didn't write. Like: External, Programming Contest Book, Remember_solution etc
- The next type is the contest, seasons types, These are the periodic solutions that I needed to do from time to time.
- Convert string to int/double, convert int/double to string
- Vector/list's declare, size, push/append, how to empty, insert at any position, is double linked or single.
- Stack's size, is empty, clear, push, pop, top
- how to declare long long
- how to do foreach loop
- How to make a single character to string
- How to do merge sort by hand
Stack<int> stackOfNumbers = new Stack<int>();
stackOfNumbers.Push(50);
stackOfNumbers.Pop();
stackOfNumbers.Peek();
stackOfNumbers.Count;
stackOfNumbers.Clear();
var queue = new Queue<int>();
queue.Enqueue(52);
queue.Dequeue();
queue.Peek();
var size = queue.Count;
queue.Clear();
// string to int
int.Parse(str)
double.Parse(str)
// Length of array
var arr = new string[]{"H", "e", "l"};
arr.Length
C++
// convert array to vector
int x[3] = {1, 2, 3};
vector<int> v(x, x + sizeof x / sizeof x[0]);
// string to int,long, long long
stoi("50")
stol("50")
stoll("50")
stof("50")
stod("50")
stold("50")
atoi
atol
atoll
// int, doule to string
int i=50, d=50.5;
i.to_string()
d.to_string()
- Install C/C++ extension >> ms-vscode.cpptools
- Go to a .cpp file and on the top left select the down arrow on the RHS of the play buttno and select
Run File
- If a configuration panel is shown, select the C++ option.
This will add a tasks.json
file in the .vscode folder
.vscode/tasks.json
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: c++.exe build active file",
"command": "c:/Program Files/CodeBlocks/MinGW/bin/c++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "c:/Program Files/CodeBlocks/MinGW/bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++: c++.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "c:/Program Files/CodeBlocks/MinGW/bin",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "c:\\Program Files\\CodeBlocks\\MinGW\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: c++.exe build active file"
}
]
}
- install node
.vscode/launch.json
file
{
"name": "Run JS",
"program": "${fileDirname}\\${fileBasenameNoExtension}.js",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
}
- install node
- install ts-node using
npm install -g ts-node
.vscode/launch.json
file
{
"name": "Run TypeScript",
"type": "node",
"request": "launch",
"runtimeExecutable": "ts-node",
"program": "${fileDirname}\\${fileBasenameNoExtension}.ts"
}
csc test.cs & test.exe