What do you want to save?
Add Code snippet
New code examples
-
C++ 2021-11-05 23:59:14
intersection between vector c++
#include <algorithm> //std::sort #include <iostream> //std::cout #include <string> //std::string #include <vector> //std::vector std::vector<std::string> intersection(std::vector<std::string> &v1, ... Add solution -
C++ 2021-11-05 07:08:15
what does emplace_back back return in c++
// vector::emplace_back #include <iostream> #include <vector> int main () { std::vector<int> myvector = {10,20,30}; myvector.emplace_back (100); myvector.emplace_back (200); std::cout << "myvector contains:"; ... Add solution -
C++ 2021-11-02 13:38:13
c++ load file as vector
#include <iostream> #include <iterator> #include <fstream> #include <vector> #include <algorithm> // for std::copy int main() { std::ifstream is("numbers.txt"); std::istream_iterator<double> start(is), en... Add solution -
TypeScript 2021-10-29 21:43:07
Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initially a score equal to 0 . Koa starts.
#include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <cmath> using namespace std; typedef long long ll; const int maxn = 3e5 + 7; const int INF = 2e9; int a[maxn]; int main() { int T;sc... Add solution -
C++ 2021-10-28 23:16:07
kruskal's algorithm c++ hackerearth
#include <iostream> #include <vector> #include <utility> #include <algorithm> using namespace std; const int MAX = 1e4 + 5; int id[MAX], nodes, edges; pair <long long, pair<int, int> > p[MAX]; void initialize() { f... Add solution