blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
117
path
stringlengths
3
268
src_encoding
stringclasses
34 values
length_bytes
int64
6
4.23M
score
float64
2.52
5.19
int_score
int64
3
5
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
text
stringlengths
13
4.23M
download_success
bool
1 class
f980ae2b0bf2452f2c02605b1e25ec62bacf5b21
C++
warelab/snapdragon
/src/bvec/bvec.cpp
UTF-8
5,646
3.203125
3
[ "MIT" ]
permissive
#include "bvec.h" // constructor - given a sorted vector of distinct 32bit integers BitVector::BitVector(vector<word_t>& vals) { count = vals.size(); // if the density is too low, run length encoding will take MORE space if (lowDensity(vals)) { if (DEBUG) printf("constructed non rle\n"); wo...
true
2e8071237bffeb00d194d82631d6dd134909fb7c
C++
tonyplotnikov/Labs_PSTU
/9/9.cpp
UTF-8
1,970
3.359375
3
[]
no_license
// Лабораторная работа №9. Плотников Антон. ИВТ-19-1Б. #include <iostream> #include <string.h> #include <string> #include <ctime> using namespace std; void umalch(string name = "Антон", string soname = "Плотников", string otchestvo = "Андреевич") { cout << "Фамилия: " << soname << endl << "Имя: " << name << e...
true
1ee43f1ce8636b089c89508ea32747100bd4ea6d
C++
TushGoel/Fundamentals_of_ComputerEngineering
/Task-1/Problem_3.cpp
UTF-8
1,753
3.890625
4
[]
no_license
/* Name: Tushar Goel Student_id: 001356901 */ #include <stdio.h> #include <iostream> #include <string> using namespace std; // Function for inputting the data of the student from the teacher void input_data (int s, string n[], int g[]) { for (int i=0; i<s; i++) { cout << "Enter the name of the student --> "; c...
true
c6160bf29575cfa55b0f333a457f92df8f5b1756
C++
liurnd/ronald-leetcode
/length-of-last-word.cpp
UTF-8
830
3.203125
3
[]
no_license
// // Created by Ronald Liu on 29/5/15. // #include <string> using namespace std; class Solution { public: int lengthOfLastWord(string s) { int l=-1, r=-1; int state = 0; for (int i = 0 ; i < s.size(); i++) { if (state == 0) { if (s[i] == ' ')...
true
7a2493e642caf1a4acbfe8d2debfd1c934cbb161
C++
jewela29/codeforces
/339A_Helpful Maths.cpp
UTF-8
370
2.9375
3
[]
no_license
#include<iostream> #include<algorithm> #include<string> using namespace std; int main() { int i; string s; string s1; cin >> s; sort(s.begin(), s.end()); for (i = 0; i < s.length(); i++) { if (s[i] != '+') { s1.push_back(s[i]); } } cout << s1[0]; for (i = 1; i < s1.length(); i++)...
true
d01ddd9358d2b6067eda7e148c37a9804a8b155e
C++
1998factorial/Codeforces
/practice/DP/CF1129C.cpp
UTF-8
1,835
2.671875
3
[]
no_license
/* let DP[l][r] = the number of decoding way for s[l .. r] LCS[i][j] = longest common suffix for s[...i] and s[...j] ans for s[..i] is the ans for s[1...i-1] + some DP[x][i] where s[x..i] has not been counted before, so x < i - max(LCS[j][i]) where j < i */ #include <bits/stdc++.h> #define MOD 100000000...
true
905b46e03acd02fcc27cee5fd867fa3504bbe3f6
C++
graphisoft-python/DGLib
/Support/Modules/GSRoot/EventSender.hpp
UTF-8
7,896
2.578125
3
[ "Apache-2.0" ]
permissive
// ***************************************************************************** // // Class EventSender // // Module: GSRoot // Namespace: GS // Contact person: MB // // SG compatible // // ***************************************************************************** #if !defined EVE...
true
e59361490b228e5a550f6e9fa02d74a824183021
C++
xpbluesmile/How-Not-to-Program-in-Cpp
/program061_faulty.cpp
UTF-8
5,260
3.828125
4
[]
no_license
/************************************************ * find_word -- find a word in the dictionary. * * * * Usage: * * find_word <word-start> [<word-start>...] * ************************************************/ #include <iostream>...
true
46e93bc79a2b99641aeed1242079bdfbcf40fd77
C++
bertolinocastro/cimatec_senai
/desenvolvimento_sistemas/cpp/heranca/conta.cpp
UTF-8
1,651
3.703125
4
[]
no_license
#include "conta.hpp" #include <iostream> using namespace std; Conta::Conta(int numConta, float saldo){ this->NumConta(numConta); this->Saldo(saldo); } Conta::~Conta(void){ cout<<"Oi! Eu:"<<this->NumConta()<<" com "<<this->Saldo()<<" Morri!"<<endl; } // getters e setters void Conta::NumConta(int numConta){ this-...
true
ccfce7c54fd443e612a68233f9766e79423f1f22
C++
guarrod/statuslight-rgb-device
/src/main.cpp
UTF-8
5,805
2.859375
3
[ "MIT" ]
permissive
#include <Arduino.h> #include <Adafruit_NeoPixel.h> #include <Homie.h> #define PIN D4 #define LED_NUM 7 // When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals. // Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest // ...
true
85d8be9b35039956790ae7a8da732661c0f3ce06
C++
RaunakJalan/CP-Practice
/STL/multiset_stl.cpp
UTF-8
2,041
4.125
4
[]
no_license
#include <iostream> #include <set> using namespace std; typedef multiset<int>::iterator It; // Multi Set is a set like container that can store multiple elements with same value. // All elements are stored in a specific order -> sorted according to internal comparing object, can give custom object too. // MultiSet al...
true
9a4afcf21ce9c0855f4f6faa05521b6df90ca5ee
C++
wolvestotem/LeetCode
/面试题/tencent/笔试/solve/solve.cpp
UTF-8
2,867
2.84375
3
[]
no_license
#include<iostream> #include<vector> #include<unordered_map> #include<algorithm> #include<queue> using namespace std; struct Listnode { int val; Listnode* next; Listnode(int x):val(x),next(nullptr){} }; //void solve(Listnode* fir, Listnode* sec) { // if (!fir || !sec) // return; // Listnode* pre = new Listnode(0)...
true
f9a1eec64fdaf3e57d652be90adebcf1666da698
C++
GabeOchieng/ggnn.tensorflow
/program_data/PKU_raw/45/2467.c
UTF-8
331
2.703125
3
[]
no_license
int locate(char s[], char w[]) {int m, k,len1,len2; len1=strlen(s); len2=strlen(w); m=0; while(m+len1<=len2) { k=0; while((k<len1)&&(s[k]==w[m+k])) ++k; if(k==len1) return m; m++; } return -1; // ??? } int main() { char s[50],w[50]; scanf("%s %s",s,w); int a; a=locate(s,w); printf("%d",a); ret...
true
9dabfa84494fa84f03e61e4bfeeed32e692ded6f
C++
danys/streamscraper
/Flv2m4a.cpp
UTF-8
9,893
2.921875
3
[]
no_license
#include <iostream> #include <fstream> #include "Flv2m4a.h" #include "AudioFile.h" #include "AudioExtractor.h" using namespace std; //declarations related to file I/O ifstream::pos_type fsize; ifstream::pos_type fosize; //output file size ifstream inputFile; ofstream outputFile; int Flv2m4a::power10(int x) { int...
true
4ace9046000165dc62884d4baf205040a88c6340
C++
Bharath-k06/Compi_practise
/wave.cpp
UTF-8
575
3.296875
3
[]
no_license
#include<bits/stdc++.h> using namespace std; void wave(int *arr,int n) { //arrange the elements into a sequence such that a1 >= a2 <= a3 >= a4 <= a5..... (considering the increasing lexicographical order). for(int i=0;i<n-1;i+=2) { if(arr[i]<arr[i+1]) { arr[i] = arr[i]+arr[i+1]; arr[i+1] = arr[i]-arr[i+1];...
true
929efabafccec3db341d3b4ceadf9354fea0a017
C++
Straygear/ServerSocket
/ServerSocket/SERVER.cpp
UTF-8
6,624
2.625
3
[]
no_license
#include "SERVER.h" #include "ACCOUNTS.h" SERVER::SERVER(): result(0), ptr(0), iResult(0) { ZeroMemory(&hints, sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; hints.ai_flags = AI_PASSIVE; ListenSocket = INVALID_SOCKET; ClientSocket = INVALID_SOCKET;...
true
8d45e226645e0da36ab10a19d7909770e1050763
C++
scottwang54/cs22001
/warm-up-project/src/person.cpp
UTF-8
4,904
3.46875
3
[]
no_license
#include "person.h" #include <regex> #include <iostream> #include <fstream> // bool str_isalpha(const string str){ // for(int i = 0; i < str.size(); i++) // if((isalpha(str[i]) == 0) || (str[i] == ' ')) // return false; // return true; //} bool str_isalnum(const string s) { std::string::const_iter...
true
6792feb37db326e189863f587800a3f70fb3805b
C++
vadixidav/gpi-cpp
/meprogram.h
UTF-8
1,310
2.75
3
[ "BSD-2-Clause" ]
permissive
#ifndef MEPROGRAM_H #define MEPROGRAM_H #include "chromosome.h" namespace gpi { struct Scratchpad { double result; Scratchpad(); bool isSolved(); }; struct MEProgram { unsigned tInputs; //Total inputs to network unsigned tOutputs; //Total outputs from net...
true
3202fca8529fc22f747eae29aa4314b7192cf470
C++
geckods/CodeForces
/206/c.cpp
UTF-8
6,534
2.65625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll altcost(ll arr[], ll cum[], ll n, ll i, ll j, bool isleft, ll l, ll r){ if((j-i+1)%2 == 0){ ll left = cum[(i+j)/2]*l; if(i>0)left-=cum[i-1]*l; ll right = cum[j]*r; if((i+j)/2>0)right = cum[(i+j)/2 -1]*r; return left+right; } else{ ...
true
e388d6ab946638de08acc01b6d3958eac04c422b
C++
tanvirtareq/programming
/uva/UVA 11308.cpp
UTF-8
1,812
2.734375
3
[]
no_license
#include<bits/stdc++.h> using namespace std; string binder, ingredient, reciep, requrment; map<string, int>ing, req; map< int, string>out; void printmap() { map<string, int>::iterator i; for(i=ing.begin();i!=ing.end();i++) { cout<<i->first<<" "<<i->second<<endl; } } v...
true
8553ebe431d32ef91f8ad79c759fc91bea62b455
C++
habib302/leetcode-1
/951. Flip Equivalent Binary Trees.cpp
UTF-8
1,167
3.3125
3
[]
no_license
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ void dfs(TreeNode* node, vector < vector < int > > &graph) { if( node == NULL ) return; graph[node->val].pus...
true
6b08a60575011b3dde6daa2f8e7acd0a22aad7b8
C++
Oskari-Tuormaa/E4PRJ-2021
/ControlUnit/WebSocket, UserData, Controller/WebSocketServer_IF/WebSocketServer_IF.h
UTF-8
13,366
2.515625
3
[]
no_license
#pragma once /*#define ASIO_STANDALONE*/ #include <websocketpp/config/asio_no_tls.hpp> #include <websocketpp/server.hpp> #include <iostream> #include <fstream> #include <ctime> #include <functional> #include <chrono> #include <thread> #include "json.hpp" #include "WebSocket_Message.hpp" using json = nlohmann::json; ...
true
5084854934e1f9e7380914eb9f771df709cf69ac
C++
patrickbergel/huji-rich
/source/3D/GeometryCommon/Tessellation3D.hpp
UTF-8
5,167
3.203125
3
[]
no_license
/*! \file Tessellation3D.hpp \brief Abstract class for the tessellation in 3D \author Elad Steinberg */ #ifndef TESSELLATION3D_HPP #define TESSELLATION3D_HPP 1 #include <vector> #include "HilbertOrder3D.hpp" #include "Face.hpp" #include "OuterBoundary3D.hpp" using std::vector; /*! \brief Abstract class for tessella...
true
efbb8ab7cb43067373ce0cd13472df1d762c3f8e
C++
jfantell/ReactiveProjectionMapping
/shadows/include/mesh.h
UTF-8
1,852
2.890625
3
[]
no_license
#ifndef SHADOWS_SHADOWS_INCLUDE_MESH_H_ #define SHADOWS_SHADOWS_INCLUDE_MESH_H_ #include <string.h> #include <iostream> #include <vector> #include "glm/vec2.hpp" #include "glm/vec3.hpp" // Needed later for interlacing everything - see interlaceAll() struct vertex_struct { glm::vec3 vertex; glm::vec3 normal; glm...
true
473a18f963dd54ceb5cff91af90330ba59334840
C++
echo-team/Snoke
/app/Widgets/logo.cpp
UTF-8
2,109
3.234375
3
[]
no_license
#include "logo.h" /** * Sets coordinates of logo * @param {int} left - x coordinate of left logo side * @param {int} top - y coordinate of top logo side */ void Logo::setPosition(int left, int top) { x = left; y = top; } /** * Returns size of the logo * @return {Point} - width and height of the logo *...
true
8ab906734f6bb8397d94220ee4cf97cad48508f9
C++
lineCode/ABx
/abserv/abserv/OctreeQuery.h
UTF-8
3,584
3.03125
3
[]
no_license
#pragma once #include "BoundingBox.h" #include "Vector3.h" #include "Sphere.h" #include "Ray.h" namespace Game { class GameObject; } namespace Math { class OctreeQuery { public: OctreeQuery(std::vector<Game::GameObject*>& result) : result_(result) { } virtual ~OctreeQuery() = default; Octree...
true
cab794be792db567a619b19cd640138024b1cc08
C++
scaevola96/online-courses
/Hackerrank C++/STL/vectorerase.cpp
UTF-8
437
2.875
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> int main() { int n; std::cin >> n; std::vector<int> vec(n); for(auto& i:vec){ std::cin>>i; } int x; int a,b; std::cin >> x; std::cin >> a >> b; vec.erase(vec.begin()+x-1); vec.erase(vec.begin()+a-1,vec.begin...
true
35194dd794abbd7db2b12d32cc5bec8abf24c94c
C++
taowenyi/zhangziyu
/GetLeastNumbers/GetLeastNumbers/GetLeastNumbers.cpp
GB18030
955
3.171875
3
[]
no_license
// GetLeastNumbers.cpp : ̨Ӧóڵ㡣 // #include "stdafx.h" #include<set> #include<vector> #include<functional> using namespace std; vector<int> GetLeastNumbers(vector<int> input, int k) { multiset<int,greater<int>> LeastSet;//һݼset LeastSet.clear(); int length = input.size(); if (length <= 0 || k <= 0) return vector<...
true
1c32f6a34ea3ce2854649af98331469c6af93243
C++
lordzizzy/leet_code
/04_daily_challenge/2021/06-june/week1/max_perf_of_team.cpp
UTF-8
3,966
3.265625
3
[]
no_license
// https://leetcode.com/problems/maximum-performance-of-a-team/ // Maximum Performance of a Team // You are given two integers n and k and two integer arrays speed and // efficiency both of length n. There are n engineers numbered from 1 to n. // speed[i] and efficiency[i] represent the speed and efficiency of the it...
true
0ebe0aac6506ed3533f949f10d974e91fa70081f
C++
AravindVasudev/datastructures-and-algorithms
/datastructures/linked-list/modular_node.cc
UTF-8
1,104
3.96875
4
[ "MIT" ]
permissive
#include <iostream> #include <vector> struct Node { int data; Node *next; }; Node* array_to_list(std::vector<int> arr) { Node *head = new Node; Node *ptr = head; int size = arr.size(); for (int i = 0; i < size; i++) { ptr->data = arr[i]; ptr->next = (i == size - 1 ? NULL : new ...
true
1a98470b8f17206b29bf6db3620554091a024a7e
C++
Kotevode/Purple
/src/purple/include/purple/efdist.h
UTF-8
3,003
2.9375
3
[]
no_license
// // Created by Mark on 08.03.17. // #ifndef PURPLE_EFDIST_H #define PURPLE_EFDIST_H #include "hdist.h" #include <set> using namespace std; namespace Purple { template<class _info_iterator> bool strong_rule(_info_iterator begin, _info_iterator end, int min_node_index, int max_node_index, int &delta) { ...
true
4f9adac4f67d79d2181ebc3408bdeecbf07f50a5
C++
Bhaikko/data-structures
/Graphs/Prim.cpp
UTF-8
2,114
3.484375
3
[]
no_license
#include <iostream> #include <climits> int minVertex(int* weights, bool* isVisited, int vertices) { int minIndex = -1; for (int currentVertex = 0; currentVertex < vertices; currentVertex++) { if (!isVisited[currentVertex] && (minIndex == -1 || weights[currentVertex] < weights[minIndex])) { ...
true
24b87f774bedba27b517f2263aee63aa6a6363f1
C++
sric0880/web_extractor
/src/HtmlProcessor.cpp
UTF-8
1,062
2.578125
3
[]
no_license
/* * HtmlProcessor.cpp *html文档处理核心模块 *实现多线程 线程安全列队 * Created on: 2013-5-20 * Author: qiong */ #include "HtmlProcessor.h" HtmlProcessor::HtmlProcessor(Output* output, Template * temt): info_ext(output,temt),queue_html(), text_ext(280, 6),flag(false) { if (!NLPIR_Init(".", UTF8_CODE))//Data文件夹所在的路径,默认为GBK编...
true
f9bab6d1f922793472c9eb8297707f448c23c8c6
C++
muhammet-mucahit/My-CPlusPlus-Studies
/School KTU/Sinav Cozumleri/2010 - Final/3/Source.cpp
UTF-8
305
2.78125
3
[]
no_license
#include <iostream> #include "base.h" #include "derived.h" using namespace std; int main(){ Derived X, Y, *p = new Derived; X.Dizi_Al(); Y.Dizi_Al(); if (Y.Min() > X.Max()){ X.Ekle(Y.Min()); *p = X; } else{ Y.Ekle(X); *p = Y; } p->print(); cout << endl; Y.print(); cout << endl; }
true
ed318094df52e445e7c16ec84a1ff9065c169712
C++
YangZhongLou/LearningVulkan
/Src/Utils.cpp
UTF-8
4,967
2.671875
3
[]
no_license
#include "Utils.h" #include <iostream> namespace yzl { bool LoadVulkanLib(LIBRARY_TYPE & vulkanLibrary) { #if defined _WIN32 vulkanLibrary = LoadLibrary("vulkan-1.dll"); #elif defined __linux vulkanLibrary = dlopen("libvulkan.so.1", RTLD_NOW); #endif if (vulkanLibrary == nullptr) { std::cout << "Error, Lo...
true
1e8f21f731d4c9dd8432005902fd8583454e12de
C++
j3lew/BME-261-Chemotherapy-Drug-Box
/combine/combine.ino
UTF-8
5,002
3.40625
3
[]
no_license
// include the library for LCD #include <math.h> #include <LiquidCrystal.h> // Variables String data = ""; String morning, after, evening, bed, patient, age, treatment = ""; String infoForDay[7]; unsigned int time; // Time variables unsigned long timeNow = 0; unsigned long timeLast = 0; int seconds = 0; int day = 1;...
true
ea9479e8c008f4c4a32a4f43a94b0c604020301c
C++
math132d/APshot
/Arduino/SerialTest/SerialTest.ino
UTF-8
1,462
3.078125
3
[]
no_license
char input; int num = 0, cng = 0; int minimum = 0, maximum = 100, increment = 20; void setup() { // put your setup code here, to run once: // initialize digital pin LED_BUILTIN as an output. pinMode(LED_BUILTIN, OUTPUT); // open serial port Serial.begin(9600); // //loop to wait for confirmation from t...
true
dbf25a03d5d46ffce079ad99f1a4ab9dd5bc0bb7
C++
phg1024/UVa
/10961-Factstone-Benchmark/main.cpp
UTF-8
736
2.90625
3
[]
no_license
#include <cstdlib> #include <iostream> #include <vector> #include <string> #include <cmath> using namespace std; // compare 2^(2^x) with n! // boils down to compare 2^x with sum_{i=1}^n log_2(i) int main() { double logsum = 0; // all the benchmark scores vector<int> pos(23); int i=1, w=2, cutoff_w = 4...
true
3fb0ac42780ccb614cb9472b8adac662a9e096ed
C++
fbocharov/au-grafon
/src/glpp/texture.h
UTF-8
644
2.78125
3
[]
no_license
#ifndef GLPP_TEXTURE_H #define GLPP_TEXTURE_H #include <string> #include <vector> #include <memory> #include <GL/glew.h> namespace glpp { class Texture; using TexturePtr = std::shared_ptr<Texture>; class Texture { public: explicit Texture(GLuint texture); ~Texture(); Texture(Texture const &) = delete; Texture...
true
76015cc8926ab97f17c202e8ed85305e445016e8
C++
JUSTYNTOWLER/PERSONAL-PROJECT
/2020-9-27/三角函数.cpp
GB18030
6,789
2.984375
3
[]
no_license
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cmath> #include "Ǻ.h" #include "ȫָ.h" using namespace std; Calc_SC::Calc_SC() {}; void Calc_SC::checkSC() { if (s) { in[0] = '\0'; int d = 0; strcpy(in, INPUT.c_str()); for (int i = 0; i < INPUT.size()-2; i++) { if (...
true
dca673a298f24b594a04e390a90c4167921bf1be
C++
esdream/AIEngineer
/julyDSA/Graph/leetcode_207_Course_Schedule.cpp
UTF-8
1,840
3.734375
4
[]
no_license
/* 使用邻接表结构实现 */ #include <iostream> #include <vector> #include <map> #include <queue> using namespace std; class Solution { public: bool canFinish(int numCourses, vector<pair<int, int>>& prerequisites) { if (prerequisites.empty()) return true; v_ = numCourses; int edgesNum = ...
true
5fd3a415364eee0e17986c11bb97046a81367976
C++
IvanBacic/LV1rgrv
/RG_LV1/RVL3DTools.h
UTF-8
23,413
2.921875
3
[]
no_license
//V = [x y z]' #define RVLSET3VECTOR(V, x, y, z) {V[0] = x; V[1] = y; V[2] = z;} // Tgt = Src(3x1) #define RVLCOPY3VECTOR(Src, Tgt) Tgt[0] = Src[0]; Tgt[1] = Src[1]; Tgt[2] = Src[2]; // Tgt = Src(3x3) #define RVLCOPYMX3X3(Src, Tgt) Tgt[0] = Src[0]; Tgt[1] = Src[1]; Tgt[2] = Src[2]; Tgt[3] = Src[3]; Tgt[4] = Src[4]; Tgt...
true
efa4dd654a0516049010367762f466c147bf004c
C++
IAmDylanDennison/CS1B
/Lab6_powerball/Lab6_powerball/powerball.cpp
UTF-8
1,635
3.578125
4
[]
no_license
// Dylan Dennison // Lab6_powerball // Array size of 20 with random numbers 1-100 // 10/1/19 #include <iostream> #include <cmath> #include <cstdlib> #include <ctime> #include <random> using std::cin; using std::cout; using std::endl; void assign(int[], int); int entry(); bool check(int guess, int wins...
true
15e6c107b7b20f31e6e8feb1a8c2931a7c626762
C++
iscsi/algorithms
/rili/test/BaseFixture.cpp
UTF-8
2,449
2.953125
3
[]
no_license
#include <algorithm> #include <iterator> #include <rili/test/BaseFixture.h> #include <rili/test/TestStorage.h> #include <string> #include <utility> #include <vector> namespace rili { namespace test { void TestBaseFixture::before() {} void TestBaseFixture::after() {} const std::string& TestCreatorBase::fixtureName() ...
true
a0e8d15ea8c440806f3e22f3c624c832f8908f61
C++
Bigstorm20008/CrazyTank3
/src/RandomEngine.cpp
UTF-8
698
2.921875
3
[]
no_license
#include "RandomEngine.h" namespace helpers { std::shared_ptr<RandomEngine> RandomEngine::m_instance = nullptr; RandomEngine::RandomEngine() : m_defaultRandomEngine{ std::default_random_engine{ static_cast<unsigned int>(time(0)) } } { } RandomEngine::~RandomEngine() { } std::shared_ptr<RandomEngine> Ra...
true
4194c32407cc39ee9e74d8602ed8b651c354f2cb
C++
sh4062/Leetcode
/301.cpp
UTF-8
1,217
2.984375
3
[]
no_license
class Solution { public: bool isvalid(string S){ stack<char>st; for(int i = 0;i<S.size();i++){ if(S[i]=='('){ st.push(S[i]); } if(S[i]==')'){ if(st.empty()){ return false; } st.po...
true
d8f96e623c699226dfe290f6e2d23fa078247591
C++
niltonvasques/gl-data-structure
/TestShape.cpp
UTF-8
1,397
2.890625
3
[]
no_license
#include "TestShape.h" TestShape::TestShape() :Shape(Color()){ } TestShape::~TestShape(){ } void TestShape::Draw(){ // Altera a cor do desenho para azul glColor3f(0.0f, 0.0f, 1.0f); // Desenha a casa glBegin(GL_QUADS); glVertex2f(-15.0f,-15.0f); glVertex2f(-15.0f, 5.0f); gl...
true
7da98082978e0b652ad651b9415141557b9d9c5b
C++
KrzaQ/secret-dangerzone
/kq/menu.hpp
UTF-8
2,058
3.3125
3
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
#ifndef IOUTILS_H #define IOUTILS_H #include <functional> #include <iosfwd> #include <iostream> #include <map> #include <memory> #include <limits> #include <string> #include <utility> namespace kq{ namespace detail{ template<typename Func> class ExceptionWrapper { public: template<typename T, typename U = typen...
true
711d87be30f5ed8a907f690765d60927e4a09d66
C++
dsamt/Data-Strcutures-and-Algorithms-Projects
/Project5.1/P5.1/P5.1/treap_bst.hpp
UTF-8
3,117
3.484375
3
[]
no_license
#ifndef TREAP_BST_HPP #define TREAP_BST_HPP #include <random> #include <iostream> #include "abstract_bst.hpp" template <typename KeyType, typename ValueType> class TreapBST : public AbstractBST<KeyType, ValueType> { public: /** Default contructor. */ TreapBST(); /** Copy constructor. */ TreapBST(const TreapBST ...
true
9cd071a5dea7d9b4c35046ae7a56bb7ae351516c
C++
Sean-Huang65/leetcode
/code/561.cpp
UTF-8
391
3.140625
3
[]
no_license
#include <vector> #include <iostream> #include <algorithm> using namespace std; class Solution { public: //先排序,后取奇数 //sort(),给出首尾指针 int arrayPairSum(vector<int>& nums) { int result = 0; sort(nums.begin(),nums.end()); for(int i =0;i<nums.size();i+=2) result+=...
true
7dab04658b54ea9e5b91617c589344942b097b01
C++
hacker-taso/algorithm_judges
/facebook/hacker-cup/2021/Qual/A1.cpp
UTF-8
1,003
2.921875
3
[]
no_license
#include<iostream> #include<vector> #include<algorithm> #include<limits> using namespace std; string s; vector<char> vowels = {'A', 'E', 'I', 'O', 'U'}; #define showthis(s) cout << s << endl; int solve() { vector<int> cnts(256, 0); for (char c: s) { cnts[c]++; } int vcnt = 0; char vmax = 'A'; char cmax...
true
ec98ce78d2b57432387f3bc5d8e626e2ea5853ad
C++
i-am-arvinder-singh/CP
/OOPS/mutable_lambda_capture_dynamic_allocation_class_destructor_using_delete_message_const_keyword.cpp
UTF-8
1,045
3.609375
4
[]
no_license
#include<bits/stdc++.h> class Base { private: int a, b ; mutable int cc=0 ; const int w = 5; public: Base(int a, int b) { Base * const c = this; c->a = a; c->b = b; } void Show() { std::cout<<"The value of 'a' and 'b' are "<<a<<" "<<b<<s...
true
c99400d0c17bfd90baffc2517ce3e1e48605a7b4
C++
betallcoffee/leetcode
/old/Merge Sorted Array/Merge Sorted Array/main.cpp
UTF-8
2,934
3.5625
4
[ "Apache-2.0" ]
permissive
// // main.cpp // Merge Sorted Array // // Created by liang on 1/11/17. // Copyright © 2017年 liang. All rights reserved. // https://leetcode.com/problems/merge-sorted-array/description/ /** Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that n...
true
70f81622cd6c18287ca9c9f282eef75cb4c56081
C++
emculber/AndroidOpenCL
/sendCode/main.cpp
UTF-8
4,534
3
3
[]
no_license
#include <iostream> #include <vector> #include <fstream> #include <cstring> #include <netdb.h> #include <unistd.h> #include <fcntl.h> #include <strings.h> using namespace std; int main(int argc, char * argv[]) { //Test to ensure the user has provided one argument as required. If not, default the server hostnam...
true
81483e03b211c45d9c998732eddb0c2b4a4de210
C++
vsokh/DataStructures-Algorithms
/algorithms/sorting/non-comparison/string-sort.cpp
UTF-8
990
3.234375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; template<typename T> using KeyGetter = function<int(vector<T> const& A, int i)>; template<typename T> void printV(vector<T> const& v) { for (auto i : v) cout << i << " "; cout << endl; } template<typename T> vector<T> countingSort( vector<T> const& A, int k, Key...
true
a29dcbac258cae3fcefeb014b8a307d7d0310e82
C++
onyazuka/Simple-system-monitor
/widgets/memorywidget.cpp
UTF-8
2,764
2.90625
3
[ "MIT" ]
permissive
#include "memorywidget.hpp" MemoryWidget::MemoryWidget(InfoManager::pointer _infoManager, QWidget* parent) : EmulateableWidget{parent}, dataPrecision{2}, infoManager{_infoManager} { setUpdateInterval(500); createWidgets(); createLayout(); createUpdaterFunctions(); } void MemoryWidget::createWidget...
true
e9c12c6ac77bff844a03d9d7aefd53db52f59043
C++
yohe/CLI-DevTool
/parser/tokenize_argument.cc
UTF-8
1,793
2.953125
3
[ "MIT" ]
permissive
#include "parser/tokenize_argument.h" #include <iostream> namespace clidevt { std::vector<std::string>* divideArgumentList(std::string& src) { std::vector<std::string>* result = new std::vector<std::string>(); if(src.empty()){ return result; } std::string::iterator begin = src.begin(); ...
true
fd913b82c5cfc64cc50039d5b9809d24a060710d
C++
songchengjiang/Lutra
/runtime/Lutra/Resources/Mesh.cpp
UTF-8
2,570
2.640625
3
[]
no_license
// // Mesh.cpp // Lutra // // Created by JasonCheng on 2021/1/4. // #include "Mesh.h" #include "Stream.h" namespace Lutra { void Mesh::Serialize(WriteStream& stream) { Resource::Serialize(stream); stream.WriteValue("Vertices", Vertices); if (!Normals.empty()) stream.Wr...
true
3c144ae39cbe62ee6d91802fb3f62809fca47da5
C++
kioco/Benchmark
/Network/client.cpp
UTF-8
6,109
2.625
3
[]
no_license
#include <string.h> #include <cstring> #include <unistd.h> #include <stdio.h> #include <netdb.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <iostream> #include <fstream> #include <sstream> #include <iomanip> #include <pthread.h> #include <strings.h> #include <stdlib.h> #include <str...
true
77e16d50d6010bc47bec2932a5e30050bfc8505b
C++
lucasfranklin/Programacao-Orientada-a-Objetos
/C++/TP4/2.2/include/Matriz.h
UTF-8
16,538
3.0625
3
[]
no_license
#ifndef MATRIZ_H #define MATRIZ_H #include <string> #include <vector> #include <fstream> #include <algorithm> #include <iostream> #include "CVetor.h" #include "ETamMatrix.h" #include "ECompMatrix.h" #include "EPosMatrix.h" using namespace DataStructures; namespace Matematica { template <class T> class Matriz { priv...
true
d54d6261f8c86edfbe04715ecaac2dff324143d0
C++
EagleCarlton/linked_list
/Node.cpp
UTF-8
679
3.296875
3
[]
no_license
#include "stdafx.h" #include "Node.h" Node *Get_node(Type item, Node *prev0, Node *next0) {//生成一个节点,返回此节点指针 Node *p; p = (Node*)malloc(sizeof(Node)); if (p == NULL) { printf("Memory allocation failure!"); exit(1); } p->data = item; p->prev = prev0; p->next = next0; return p; } Type Get_data(Node *current) ...
true
5d0a2e8ceed7cb0991e09e45a8338495240f6321
C++
mendsley/sched
/src/sema.cpp
UTF-8
3,648
2.546875
3
[ "BSD-2-Clause" ]
permissive
/** * Copyright 2015-2017 Matthew Endsley * All rights reserved * * Redistribution and use in source and binary forms, with or without * modification, are permitted providing that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions...
true
32a2e15da7ff6aacece6fe2284cca0aa071e4eb1
C++
Karun842002/Algos-for-Amigos
/Computer_Science/2_Competitive_Programming/Leetcode/p08_pascal_Triangle.cpp
UTF-8
1,036
3.765625
4
[ "MIT" ]
permissive
/* Given an integer numRows, return the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it Example: Input: numRows = 5 Output: [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]] */ #include <iostream> #include <vector> using namespace std; class Solution { pub...
true
83eb68ef11292a17d5b3e79d99220b145e9cff94
C++
21901040/nowic
/labs/lab7/quick.cpp
UTF-8
3,427
3.421875
3
[]
no_license
// quicksort algorithm // // A quicksort algorithm - its time complexity is O(n^2). // 2019/02/02: Created by idebtor@gmail.com // 2021/01/02: Testing added, updated c++11 and documented // 2021/01/20: partition_lo() partition_hi() added // now, the pivot can be either the first or the last element. // 20...
true
70410d1aab3db3d5395fa048c22710854d4ddc2a
C++
xiaochuanle/lesv
/src/ncbi_blast/str_util/str_cmp.hpp
UTF-8
22,060
2.765625
3
[]
no_license
#ifndef __STR_CMP_HPP #define __STR_CMP_HPP #include "../ncbi_blast_aux.hpp" #include "tempstr.hpp" BEGIN_HBNSTR_SCOPE using namespace ncbi; int strcmp(const char* s1, const size_t n1, const char* s2, const size_t n2, ECase use_case = ECase::eCase); // NOTE. On some platforms, "strn[case]cmp()" can work f...
true
81fa5e298f1c3ed16681086b2289965355fed534
C++
rrwick/genome_painter
/src/painter/paint.cpp
UTF-8
1,624
2.78125
3
[]
no_license
#include "paint.h" namespace paint { std::vector<PaintBucket> paint_sequence(genome::FastaRecord &fasta, db::Database &database) { std::vector<PaintBucket> paint(fasta.sequence.size(), PaintBucket(database.header.species_num)); for (size_t i = 0; i < fasta.sequence.size()-KMER_SIZE; i++) { std::vecto...
true
b49a6ddddde8e28a785eb48b6bb6c00e56394145
C++
AveryFerrante/FinalProject
/interactivemode.cpp
UTF-8
18,555
2.90625
3
[]
no_license
#include "interactivemode.h" using namespace std; InteractiveMode::InteractiveMode(int consoleArgs, char **consolePaths) { argc = consoleArgs; argv = consolePaths; setToNull(); // Sets the member variable pointers to null } InteractiveMode::~InteractiveMode() { /*deleteObjects();*/ } // AWFUL PROGRAMMIN...
true
cf250824ae2164b69ac1231a014de67404193385
C++
kamilgajewski11/SparseArray
/SparseArray.h
UTF-8
8,963
3.109375
3
[]
no_license
#ifndef SPARSE_ARRAY_SPARSEARRAY_H #define SPARSE_ARRAY_SPARSEARRAY_H #include <iostream> #include <map> #include <cstdlib> #include <stdexcept> using namespace std; template <class V, unsigned D> class SparseArray { public: class Index{ private: unsigned *indexArray; unsigned counter; pu...
true
a9d94e177b061f0c7780aa251c431b092882374d
C++
tardate/LittleArduinoProjects
/playground/PrecisionTimer/MicroTimer2.cpp
UTF-8
1,539
2.5625
3
[ "MIT" ]
permissive
#include "MicroTimer2.h" MicroTimer2 microTimer2; // Handle Timer2 overflow. this will occur every 128us ISR(TIMER2_OVF_vect) { microTimer2.increment_overflow_count(); } MicroTimer2::MicroTimer2() { _overflow_count = 0; _total_count = 0; _started = false; } void MicroTimer2::enable() { if (_started) r...
true
cc16cddf57487e3cb697e42610d8299d737e3874
C++
a1368017681/study
/src/define.h
UTF-8
659
2.578125
3
[]
no_license
#pragma once #include <iostream> #define PR(...) printf(__VA_ARGS__) #define LOG(...) {\ fprintf(stderr, "%s:Line %d:\t", __FILE__, __LINE__);\ fprintf(stderr, __VA_ARGS__);\ fprintf(stderr, "\n");\ } void test_LOG(){ int x = 6; LOG("x = %d", x); } struct TestStructFun { TestStructFun():name(...
true
c6b3d5272e50b89fdd11608de19872221b1b2982
C++
HolySmoke86/blank
/src/world/EntityState.hpp
UTF-8
1,127
2.734375
3
[]
no_license
#ifndef BLANK_WORLD_ENTITYSTATE_HPP_ #define BLANK_WORLD_ENTITYSTATE_HPP_ #include "../geometry/Location.hpp" #include "../graphics/glm.hpp" #include <glm/gtc/quaternion.hpp> namespace blank { struct EntityState { ExactLocation pos; glm::vec3 velocity; glm::quat orient; float pitch; float yaw; EntityState...
true
b56ea62c13c2855043e136f625bdd43bde48ab78
C++
erwanbou/LatMRG
/include/latmrg/Weights.h
UTF-8
2,008
2.6875
3
[]
no_license
// This file is part of LatMRG. // // LatMRG // Copyright (C) 2012-2016 Pierre L'Ecuyer and Universite de Montreal // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.ap...
true
d36df381beb9f8df210261cf8a2cdaff059a481d
C++
sfinae/watcher
/src/ClientTcpSocket/global.h
UTF-8
4,488
2.546875
3
[]
no_license
#ifndef GLOBAL_H #define GLOBAL_H #include <QPixmap> #include <QDateTime> namespace global { namespace types { /* operation type if equal zero then previous operation compleated and wait a new command */ typedef qint8 operation_t; /* operation data size which re...
true
a46b03db5db517a32b16c8b1147ff8a271d05987
C++
codiy1992/fzu_031102406
/大一大二/C,C++,数构/算法与数据结构/8. 银行(完成)/银行.cpp
GB18030
2,302
3.234375
3
[]
no_license
#include<iostream> using namespace std; typedef struct people *link; link p1=NULL,head; typedef struct people { long ID; long P; link next; link last; }peo; struct people *creat(long IDs,long Ps) { link q1; q1=(struct people *)malloc(sizeof(struct people)); q1->ID=IDs; q1->P=Ps; q1->next=NULL; q1->...
true
762b1b220158849e045d85c879e30d553f33548d
C++
tcarrel/Brain
/Brain/src/Brain/Events/app_event.h
UTF-8
1,646
2.546875
3
[ "Apache-2.0" ]
permissive
#pragma once #include "Brain/Events/event.h" namespace Brain { class Window_Resize_Event : public Event { unsigned width_; unsigned height_; public: Window_Resize_Event( unsigned width, unsigned height ) : width_( width ), height_( height ) {} ...
true
996ca01b4a5a313cb5bb2513e68e132c4dbb95b9
C++
JonathanZip/COP3503-Fall2016
/Exam1-Review/const-with-classes.cpp
UTF-8
339
3.78125
4
[ "MIT" ]
permissive
#include <iostream> class Person { int age; std::string name; public: Person(int age, std::string name) { this->age = age; this->name = name; } int getAge() const { return age; } void setAge(int age) { this->age = age; } }; int main() { const Person max(22, "Max"); max.getAge(); ...
true
e547531525b0c76a3906678619a7a30935a6a429
C++
Needrom/TCP_Data_Send
/src/clientTest.cpp
UTF-8
1,773
2.515625
3
[]
no_license
#include"tcp.h" #include<stdlib.h> #include<stdio.h> #include<pthread.h> #include"myqueue.h" #include"dataStruct.h" #include"file.h" #include<fstream> #include <csignal> #include<sys/time.h> using namespace std; MyQueue queue = MyQueue(2058); OptFile myfile = OptFile(sizeof(DataFrame)); void* HeadCheck_thread(void* a...
true
13bc1701716582abdab4bc4e21009f74865b6c72
C++
geekbitcreations/illinoistech
/ITM_312/ITM312/Project1A/ConsoleApplication6/ConsoleApplication6/Source.cpp
UTF-8
1,543
4.8125
5
[]
no_license
// This program asks for the number of hours worked by six employees. It stores // the values in an array. #include <iostream> using namespace std; int main() { /*const int NUM_EMPLOYEES = 6; int hours[NUM_EMPLOYEES]; // Get the hours worked by each employee. cout << "Enter the hours worked by " << NUM_EMPLOYE...
true
3a5b20f8f228b72deff19e22ec70c33b947a2c14
C++
mohamedAAhassan/airhockey
/AHokey/AHokey/NeuronLayer.cpp
UTF-8
851
2.90625
3
[]
no_license
#include "StdAfx.h" #include "NeuronLayer.h" NeuronLayer::NeuronLayer(int inputsPerNeuron, int numberOfNeurons) : m_inputsPerNeuron(inputsPerNeuron), m_numberOfNeurons(numberOfNeurons) { for(int i=0; i<m_numberOfNeurons; i++) { m_neurons.push_back(new Neuron(m_inputsPerNeuron)); } } vect...
true
4d926478e8607abbe992dcac0c5bc9af425bdfe5
C++
depp/dreamless
/src/game/physics.hpp
UTF-8
2,254
2.921875
3
[ "BSD-2-Clause" ]
permissive
/* Copyright 2014 Dietrich Epp. This file is part of Dreamless. Dreamless is licensed under the terms of the 2-clause BSD license. For more information, see LICENSE.txt. */ #ifndef LD_GAME_PHYSICS_HPP #define LD_GAME_PHYSICS_HPP #include "defs.hpp" namespace Game { class Level; /// Utility class for objects th...
true
3398c53c4afe6485433413841e56aefa096d6e7f
C++
jacobtruman/college
/CS/135/prog4/prog4.cpp
UTF-8
1,419
3.578125
4
[]
no_license
// Truman, Jacob // CSC 135 - Program Assignment 4 // Inputs: Reads times from file. // Outputs: Either adds of subtracts the numbers read in outputs the results. #include <iostream> #include <fstream> using namespace std; long rtime(ifstream&); void wtime(long); int main(){ cout << endl; char op, coln, ch; long ...
true
d84d3526cf261dd1070c822e554e610c6208f516
C++
suyinlong/leetcode
/010-Regular.Expression.Matching.cpp
UTF-8
744
2.65625
3
[]
no_license
class Solution { public: bool isMatch(string s, string p) { int m = p.size(), n = s.size(); vector<vector<bool>> dp(m + 1, vector<bool>(n + 1, false)); dp[0][0] = true; // match p = 'x*x*x*' for (int i = 1; i <= m; i++) dp[i][0] = i > 1 && p[i-1] == '*' && dp[i-2...
true
a9ed0c6e5bee7264e744e46152e32b9e65617dcf
C++
samcsanttos/MTP
/aula20171123/matriz.cpp
UTF-8
2,861
3.046875
3
[]
no_license
#ifndef MATRIZ_H #define MATRIZ_H #include <stdio.h> #include <stdlib.h> #include <math.h> typedef struct aMatriz { double ** m; int lin, col; } Matriz; Matriz criarMatriz(int M, int N) { Matriz A; int i; A.m = calloc(M, sizeof(double *)); for(i = 0; i < M; i++) A.m[i] = calloc(N, sizeof(double)); A.lin...
true
cfc3f67cb346247a773b971b93c49bdeffb6fd4c
C++
dmzhuang/cpp-reference
/std/algorithm_usage.cpp
UTF-8
2,462
3.53125
4
[]
no_license
// Standard Tempate Library: Algorithms // The header <algorithm> defines a collection of functions especially designed // to be used on ranges of elements. #include <algorithm> #include <array> #include <iostream> template <class InputIterator1, class InputIterator2> bool my_equal(InputIterator1 first1, InputIterator...
true
40065ffa1757d069973c480f33bace156475d524
C++
autious/kravall
/src/gfx/Renderer/Console/ConsolePainter.hpp
UTF-8
1,585
2.59375
3
[]
no_license
#ifndef SRC_GFX_RENDERER_CONSOLE_PAINTER_HPP #define SRC_GFX_RENDERER_CONSOLE_PAINTER_HPP #include "../BasePainter.hpp" #include <Shaders/ShaderManager.hpp> #include "../DebugRenderer/DebugManager.hpp" #include "../DeferredRenderer/FBOTexture.hpp" #include "../../Buffers/UniformBufferManager.hpp" #include <GL/glew.h>...
true
479099ecea5302ee345837fb8facc2c4eb1d17e8
C++
PatrykWasowski/EAPoL
/app/GUI/TextFieldManager.cpp
UTF-8
2,706
2.703125
3
[]
no_license
#include "TextFieldManager.h" TextFieldManager::TextFieldManager () { font.loadFromFile ("./Resources/data_control/data-latin.ttf"); } TextFieldManager::~TextFieldManager () { } void TextFieldManager::associateWindow (sf::RenderWindow& wind) { window = &wind; } void TextFieldManager::createFields () { fieldsL...
true
3b5cd509d9d4d5bf4d50fba9bb484a66b775b496
C++
TyeBryant/MaxKB
/dev/sdk/include/qgf2d/gameobject.h
UTF-8
1,753
2.53125
3
[]
no_license
#ifndef QGF2D_GAMEOBJECT_HEADER #define QGF2D_GAMEOBJECT_HEADER #include "kf/kf_vector2.h" #include <SFML/Graphics.hpp> #include "box2d/Box2D.h" namespace qgf { class GameObject { public: enum PhysicsStyle { e_psNone=0, e_psNewtonian, e_psBox2D }; kf::Vector2 m_position; kf::Vector2 m_velocity; ...
true
368b47f2964d69498e4fd0aa95b2aa7aa3e41bf9
C++
Ajay35/spoj
/big_mod.cpp
UTF-8
319
2.65625
3
[]
no_license
#include <bits/stdc++.h> #define ll long long using namespace std; ll pow(ll a,ll b,ll c){ ll res=1; while(b){ if(b&1) res=(res*a)%c; a=(a*a)%c; b=b>>1; } return res; } int main(int argc, char const *argv[]) { ll a,b,c; while(cin>>a>>b>>c){ printf("%lld\n",pow(a,b,c)); } return 0; }
true
e01f918cbbf88bd40095db170d230d48b8c88379
C++
fagan2888/dtccClient
/dtccCommon/src/application/web/queries/eod.hpp
UTF-8
749
2.53125
3
[]
no_license
#ifndef QUERY_EOD_HPP_ #define QUERY_EOD_HPP_ #include <string> #include <locale> #include <boost/date_time.hpp> #include "application/web/query.hpp" #include "application/asset/description.hpp" namespace dtcc { namespace web { class eod : public query { public: eod(const boost::gregorian::date & date, ...
true
11f76f798bcd92fe6ed4c4ebc51904346c95bce3
C++
nikkaramessinis/Qbert
/BitmapLoader.cpp
UTF-8
709
2.6875
3
[]
no_license
#include "BitmapLoader.h" ALLEGRO_BITMAP* BitmapLoader::GetBitmap(const std::string path) const { BitmapMap::const_iterator i = bitmaps.find(path); return i != bitmaps.end() ? i->second : (ALLEGRO_BITMAP*)0; } ALLEGRO_BITMAP * BitmapLoader::Load(const std::string& path) { ALLEGRO_BITMAP* b = GetBi...
true
1db07684f7ded4dc346f55d67c88bb62830dc214
C++
MaquedaPaul/Ejercicios-C-
/Ejercicios-Nahuel/Bloque2/While.cpp
UTF-8
372
3.171875
3
[]
no_license
#include <iostream> #include <math.h> using namespace std; int main(){ float a, resultado; cout<<"Digite el valor del numero"; cin>>a; int cantidadVeces; cout<<"Digite la cantidad de veces a dividir"<<endl; cin>>cantidadVeces; int i=0; while (i < cantidadVeces) { a = a / 2; i++; } resultado = a; cout<...
true
1ab0a4781a11d58e14e0691953a05ebc7c6cb703
C++
bargle/SympEngine
/API/message.h
UTF-8
785
3.1875
3
[ "MIT" ]
permissive
#ifndef _MESSAGE_H_ #define _MESSAGE_H_ #include <vector> #define CREATE_MESSAGE(x) CMessage *x = new CMessage; #define CREATE_MESSAGE_RESERVE(x, n) CMessage *x = new CMessage(n); #define RELEASE_MESSAGE(x) delete x; class CMessage { public: CMessage():m_nPointer(0){} CMessage(int nReserve):m_nPointer...
true
fa4a20c1b90de6adc744af0340c22b912aad5505
C++
zjucsxxd/ImageResizer
/src/include/matrix.hh
UTF-8
2,215
3.140625
3
[]
no_license
// File: matrix.hh // Date: Sun Dec 29 02:34:52 2013 +0800 // Author: Yuxin Wu <ppwwyyxxc@gmail.com> #pragma once #include <cstring> #include <memory> #include "debugutils.hh" #include "utils.hh" // basic 2-d array class Matrix { public: typedef real_t vtype; real_t **val; int w = 0, h = 0; Matrix(){} M...
true
7fc6bf40862778b33c0c59e160224781c1811e72
C++
AnPelec/Incremental-TopSort
/simple.h
UTF-8
460
2.703125
3
[]
no_license
#include <bits/stdc++.h> #include <iostream> typedef std::vector < size_t > vs; class SimpleAlgorithm { private: size_t n; size_t m; std::vector < size_t > L; // partial ordering of each node std::vector < vs > adj; // adjacency list bool update_label(size_t, size_t); public: SimpleAlgo...
true
e52311023548aa1e52e1414cdaa3d5ec274f8486
C++
Gtrakas1/OOP345
/LAB5_OOP345/LAB5_OOP345/Grades.h
UTF-8
475
3.109375
3
[]
no_license
#include <iostream> #include <string> #include <fstream> namespace sict { class Grades { std::string* studentnum; double* grade; size_t size; public: Grades() : studentnum(nullptr), grade(0), size(0) {} ~Grades(); Grades(std::string File); template<typename T> void displayGrades(std::...
true
79e404cc5f75ad5ce9a29fd38c6fe80901b3dd7f
C++
RohitRajoria28/pep_practice
/LECTURE 4/b1.cpp
UTF-8
646
3.515625
4
[]
no_license
#include <iostream> using namespace std; int binary(int arr[], int size, int data) { int start =0; int end = size-1; while (start<=end) { int mid =start+end/2; if ( arr[mid]==data) { return mid ; } else if(arr[mid]< data) { ...
true
9f43932dc9d8974ac9d36e122490167f011a303f
C++
AlConta/ITP_Study
/ITP/ITP_1_8_C/ITP_1_8_C.cpp
UTF-8
1,856
2.859375
3
[]
no_license
// ITP_1_8_C.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。 // #include<iostream> #include<string> #include<vector> using namespace std; #define rep(i, a, b) for(int i = a; i < b; i++) #define Rep(i, a, b) for(int i = a; i <= b; i++) #define sz(s) (int)s.size() int main() { string str; vector<int> ...
true
9826b76d6b1f7da64412ca4dd63f523d27a8b7c0
C++
yumdeer/daily_practice
/vs_project/Template_/依赖/依赖.cpp
UTF-8
624
3.453125
3
[]
no_license
#include <iostream> #include <list> template <typename T> class CCustomerList { public: void push(T item) { m_customer.push_back(item); } void show_item() { CCIterator it = m_customer.begin(); while (it != m_customer.end()) { std::cout << (*it) << std::endl; ++it; } } private: typedef std::li...
true
a646a3c6a30c96f1c2c4d77fe64ab81502818447
C++
sychov/seabattle
/screen.h
UTF-8
771
2.828125
3
[]
no_license
// // Header: some functions for text-mode output with color and positioning // /////////////////////////////////////////////////////////////////////////////// #pragma once namespace seabattle_screen { // -----ENUMS----- enum class Colors { Black, Blue, Green, Cyan, Red, Magenta, Yellow, ...
true
5b6e5c106cf123171b5b1d67e953d49df0f8d59e
C++
HC-Chang/Learn-CPlusPlus
/10-Pointer/3.cpp
UTF-8
1,003
3.625
4
[]
no_license
# include <iostream> using namespace std; // pointer - 3 void method1(); void method2(); void method3(); int main() { method1(); cout << "\n"; method2(); cout << "\n"; method3(); return 0; } void method1() { double x = 3.14; double y = 2.71; double *p1 = &x; double *p2 = &y; cout << "This is ...
true