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
63a70bc8d0212ea743a62c5403ee156ab3470d19
C++
InDieTasten/--EXP-old-
/src/Input/EventManager.cpp
UTF-8
8,588
2.65625
3
[ "LicenseRef-scancode-other-permissive" ]
permissive
#include <Input\EventManager.hpp> EventManager::EventManager(sf::RenderWindow& _target) : EventPublisher(), target(_target) { listening = false; EXP::log("[Info]EventManager has been constructed: " + utils::tostring(this)); } EventManager::~EventManager() { if (listening) { EXP::log("[Warning]Forc...
true
acb4c25f4a24c27c5fdc5bf642227a2d20fa75ea
C++
tbydza/simple-chess-cpp
/src/Move.h
UTF-8
1,337
3.34375
3
[ "MIT" ]
permissive
#ifndef MOVE_H #define MOVE_H #include "Position.h" using namespace std; /** * Move class. * This class represents one chess move. * Move consist of source and destination Position * and its properties. */ class Move { public: /** * Move class default constructor. * this creates invalid move */ Move();...
true
7e0440c4dc737e9026297dbcf0f4cec6092d4f3a
C++
fabba/BH2013-with-coach
/Src/Controller/Visualization/PaintMethods.h
UTF-8
677
2.703125
3
[ "BSD-2-Clause" ]
permissive
/** * @file Controller/Visualization/PaintMethods.h * Declaration of class PaintMethods. * * @author <A href="mailto:juengel@informatik.hu-berlin.de">Matthias Jüngel</A> * @author Colin Graf */ #pragma once class DebugDrawing; class QPainter; /** * @class PaintMethods * * Defines static methods to paint debug ...
true
9dc651ff30ec53e030583c9c32957e027b10fcf1
C++
lingjiankong/leetcode
/244. Shortest Word Distance II.cpp
UTF-8
2,425
3.875
4
[]
no_license
// *** // // Design a class which receives a list of words in the constructor, and implements a method that takes two words word1 // and word2 and return the shortest distance between these two words in the list. Your method will be called repeatedly // many times with different parameters. // // Example: // // Assume ...
true
6e945d8f1a807f1cf5cb8cc2aeefaa7fcb7e61b4
C++
sihan010/Tower-of-Hanoi
/tower of hanoi.cpp
UTF-8
692
3.640625
4
[]
no_license
#include<iostream> using namespace std; int TOH(int disc,int source,int destination) { static int counter=0; if(disc==1) { cout<<source<<" --> "<<destination<<endl; counter++; } else { TOH(disc-1,source,1+2+3-source-destination); cout<<source<<" --> "<<destinatio...
true
d76eee564ae16769aad80041d39f282f7a099275
C++
NikolaJackova/ICPP1_2020
/Exercise07/Exercise07/Source.cpp
UTF-8
1,270
3.390625
3
[]
no_license
#include <ostream> #include "Date.h" #include "Address.h" #include "Person.h" #include <iostream> #include <fstream> #include <string> using namespace std; #define SIZE_OF_ARRAY 3 void save() { Date d1(1, 1, 2010); Date d2(1, 2, 2015); Date d3(1, 3, 2020); Address a1("Dvorska", "Pardubice", "12345"); Address a2...
true
d3649fee09a685c2749e61925f533938dd409a4f
C++
ddpub/cafe
/src/shared/vfd_display/customer_display.cpp
UTF-8
1,524
3.015625
3
[]
no_license
#include "customer_display.hpp" void customer_display_t::writebyte(char ch) { char buff[1] = {ch}; com_.write<char>(buff, 1); } void customer_display_t::pos_cursor(int x, int y) { writebyte(0x1B); writebyte(0x6C); writebyte(x); writebyte(y); } void customer_display_t::clear_all() { writebyte(0x0C); writeby...
true
750205445ca37ae4cb67653acd1af5b8c27a40be
C++
sourcehold/Sourcehold
/test/SurfaceTest.cpp
UTF-8
4,177
3.078125
3
[ "MIT" ]
permissive
#include <gtest/gtest.h> #include <array> #include <numeric> #include "Rendering/Surface.h" #include "SDL/SDLHelpers.h" using namespace Sourcehold::Rendering; using namespace Sourcehold::SDL; constexpr Vector2<int> size_k = {10, 10}; constexpr Color color = {0xFF, 0xFF, 0xFF}; TEST(Surface, DefaultIsNull) { Surfac...
true
5735e344d1e051207367b957a096469f64fd9d44
C++
EFanZh/Archived
/Visual Studio/Misc/LeetCode OJ/324. Wiggle Sort II/Solution.h
UTF-8
1,178
3.46875
3
[]
no_license
#pragma once class Solution { static int getMedian(vector<int> &nums) { const auto it = nums.begin() + nums.size() / 2; nth_element(nums.begin(), it, nums.end()); return *it; } public: void wiggleSort(vector<int> &nums) { if (nums.size() < 2) { ...
true
0f14c1c261805f42a556b414ef85dfeb9e87bcfb
C++
Jaycar-Electronics/WiFi-Datalogger
/datalog/datalog.ino
UTF-8
2,155
2.703125
3
[]
no_license
#include <ESP8266WiFi.h> #include <ESP8266HTTPClient.h> #include <SPI.h> #include <ArduinoJson.h> const char* WIFI_SSID = "wifiName"; const char* WIFI_PASS = "wifiPassword"; const char* URL = "http://maker.ifttt.com/trigger/EVENT_NAME_HERE/with/key/YOUR_KEY_HERE"; const int CS = D8; StaticJsonDocument<300> doc; ...
true
38a6e791a64a7ed6dcfa1cfcd93738c24c7eee8d
C++
nicebub/CPP_CrashCourse
/chptr1/sum.cpp
UTF-8
413
3.25
3
[]
no_license
#include <cstdio> int sum(int x, int y){ return x+y; } int main(){ int my_number = -10; int my_number2 = 10; int my_number3 = 255; printf("The sum of %d and %d is %d\n", my_number, my_number2, sum(my_number,my_number2)); printf("The sum of %d and %d is %d\n", my_number, my_number3, sum(my_number,my_number3)); p...
true
63200320238663862f5a72d6ab35e3f8f8610409
C++
oberonlievens/computertechnologie-3
/labo/2015-2016/08/02.ino
UTF-8
720
2.796875
3
[]
no_license
#include <TM1636.h> TM1636 disp(7,8); const byte leds[] = {2, 3, 4, 5}; int8_t pr [] = {17,0,0,12}; short temp = 0; void setup() { Serial.begin(9600); pinMode(14,INPUT); for (byte i = 0; i < sizeof(leds) / sizeof(byte); i++) { pinMode(leds[i], OUTPUT); } disp.init(); disp.display(pr); } int8_t getTempe...
true
205822ff99d38939ecfc09ada3674d00d0bfbed3
C++
christocs/ICT398
/src/afk/render/Camera.cpp
UTF-8
2,921
2.75
3
[ "ISC" ]
permissive
#include "afk/render/Camera.hpp" #include <algorithm> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> #include <glm/gtx/matrix_decompose.hpp> #include "afk/NumericTypes.hpp" using glm::mat4; using glm::vec2; using glm::vec3; using afk::render::Camera; auto Camera::ha...
true
930dd190cec9b53f96e6f664de4c2a5647dec578
C++
drlongle/leetcode
/algorithms/problem_1124/other2.cpp
UTF-8
538
2.671875
3
[]
no_license
class Solution { public: int longestWPI(vector<int>& hours) { int res = 0, cnt = 0, n = hours.size(); for (int i = 0; i < n; ++i) { if (hours[i] > 8) ++cnt; if (cnt * 2 > i + 1) res = i + 1; int left = 0, curCnt = cnt; while (left < i && curCnt * 2 <= ...
true
f42c8480f5b6246dc645ff01eee0b0d14299e311
C++
paulzik/Mortal-Kombat
/MortalCombat/MortalCombat/Animator/Animator/MovingPathAnimator.cpp
UTF-8
1,605
2.515625
3
[]
no_license
#include "MovingPathAnimator.h" #include <iostream> #include <math.h> bool fall; bool once; void MovingPathAnimator::Progress(timestamp_t currTime) { if (currTime > lastTime && currTime - lastTime >= anim->GetDelay()) { int x = anim->GetDx(); if (fall) { if (sprite->y < 150) sprite->y += (float)sqrt((((1 -...
true
018eb2c48b82934add09c75441cd81d9ad0ac66a
C++
Sharundaar/OpenGLSDL
/GraphicEngine/ShaderBank.cpp
UTF-8
438
2.75
3
[]
no_license
#include "ShaderBank.h" std::unordered_map<std::string, Shader*> ShaderBank::s_bank; ShaderBank::ShaderBank() { } ShaderBank::~ShaderBank() { for (auto elem : s_bank) { delete elem.second; } s_bank.clear(); } Shader* ShaderBank::getShader(const char* _name) { if (s_bank.find(_name) == s_bank.end()) { Sh...
true
810774b2543445b9bc468317699980719b861e07
C++
elilitko/ArduinoStuff
/PSRAM/ESP_PSRAM64/examples/PutGetTest/PutGetTest.ino
UTF-8
2,363
3.171875
3
[]
no_license
#include <Printing.h> #define USE_PINOPS true #include <ESP_PSRAM64.h> class CAnekdot : public Printable { char m_origin[16]; char m_body[100]; int m_id; public: CAnekdot(void) {} CAnekdot(const int id, const char * origin, const char * body) { strcpy(m_origin, origin); strcpy(m_body, body); ...
true
a88faefff2b5b48e038ae061957295a2e32087b1
C++
robertsdionne/textengine
/libraries/rsd/source/program.cpp
UTF-8
2,875
2.8125
3
[]
no_license
#include <unordered_map> #include <vector> #include "checks.h" #include "program.h" #include "shader.h" namespace rsd { Program::Program() : shaders(), handle() {} Program::~Program() { if (handle) { glDeleteProgram(handle); handle = 0; } } GLuint Program::get_handle() const { retur...
true
57dd8827267532e72eb94c14e5422482a9a6687d
C++
naddu77/ModernCppChallenge
/076_Deserializing_data_from_JSON/076_Deserializing_data_from_JSON.cpp
UTF-8
1,911
3.5
4
[]
no_license
// 076_Deserializing_data_from_JSON.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다. // #include "pch.h" #include <iostream> #include <cassert> #include <string_view> #include <fstream> #include <nlohmann/json.hpp> struct casting_role { std::string actor; std::string role; }; struct movie { unsigned int ...
true
186ea7c7ea09c9bda2effc622b5cea457a21d170
C++
Cegard/Parallel_Matrices
/parallel_openmp.cpp
UTF-8
3,126
3.0625
3
[ "MIT" ]
permissive
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <omp.h> #define PAD 2*sizeof(double) using namespace std; double** createMatrix(int dim, bool zeroes){ double **matrix = (double**) malloc(dim * sizeof(double*) * PAD); for (int i = 0; i < dim; i++){ *(matrix + i) = (double*...
true
b218085fa2c0adb23b79eb689ec9202eb2f2dd9a
C++
PDcsc5/pd2503230
/Homework/Assignment_2/Gaddis_ch3_prob15/main.cpp
UTF-8
697
3.359375
3
[]
no_license
/* * File: main.cpp * Author: rcc *Created on July 3, 2014, 1:04 PM * Math Tutor Write a program that can be used as a math tutor for a young student. The program should display two random numbers to be added, such as 247 + 129 The program should then pause while the student works on the problem. When the stud...
true
8c1fa8a01179bca0936294b7343a56840dc9ae3f
C++
cenariusxz/ACM-Coding
/homework/CandC++/E31.cpp
UTF-8
320
2.984375
3
[]
no_license
#include<stdio.h> #define N 1000 int main() { int prim(int x); int i,count=0; for (i=2;i<=N;i++) { if (prim(i)==1) { printf("%d\t",i); count++; if (count%8==0) printf("\n"); } } return 0; } int prim(int x) { int m; for (m=x-1;m>=1;m--) { if (x%m==0) break; } if (m==1) return 1; return 0; }
true
434c2956d3256594caf42bd837effb881a086ac0
C++
dhbloo/light2D
/light2D/ShapeTriangle.h
UTF-8
967
3.09375
3
[]
no_license
#pragma once #include "shape.h" class ShapeTriangle : public Shape { private: float bx, by, cx, cy; float segment(float x, float y, float ax, float ay, float bx, float by) const { float vx = x - ax, vy = y - ay, ux = bx - ax, uy = by - ay; float t = fmaxf(fminf((vx * ux + vy * uy) / (ux * ux + uy * uy), 1.0f),...
true
4290a7b7ef67245d172059ca2292b477bf314b84
C++
mitchinator1/ColourCube
/ColourCube/Source/UI/Font/Word.cpp
UTF-8
363
2.96875
3
[]
no_license
#include "Word.h" namespace Text { Word::Word(float fontSize) : m_FontSize(fontSize) { } void Word::AddCharacter(Character& character) { m_Characters.emplace_back(character); m_Width += character.xAdvance * m_FontSize; } std::vector<Character>& Word::GetCharacters() { return m_Characters; } float...
true
65049202289751ffd76cbdbe23cf1150571b7360
C++
FRC-3277/2018POWER-UP
/src/Commands/InvertDriverControlsCommand.cpp
UTF-8
1,081
2.6875
3
[ "MIT" ]
permissive
#include "InvertDriverControlsCommand.h" InvertDriverControlsCommand::InvertDriverControlsCommand() { // No exclusive access required to drivetrain subsystem. lumberJack.reset(new LumberJack()); } // Called just before this Command runs the first time void InvertDriverControlsCommand::Initialize() { } // Called r...
true
ad8e9854f3b70e1f7291fd2ecda85450f14b1b00
C++
hthappiness/codebase
/src/util/tools.hpp
UTF-8
8,520
3.015625
3
[]
no_license
#include <iostream> #include <chrono> /* The ulitity about time ,the function ,the class, the object, the operation, the variables These resources are well organized by the c++ library. 1、基本功能的正交 2、好用、直观的接口 3、 OOP + template 的组织方式 std::chrono::stready_clock ; std::chrono::system_clock ; std::chrono...
true
d86c3b205370df09894fdae12648a88b44f5e1e5
C++
fg123/sea
/src/ASTPrinter.h
UTF-8
5,678
2.84375
3
[]
no_license
#pragma once #include "ASTVisitor.h" #include "CompilationContext.h" #include <ostream> class ASTPrinter : public ASTVisitor { size_t depth = 0; std::ostream& out; public: virtual void PreVisitChildren() override { depth += 1; } virtual void PostVisitChildren() override { ...
true
380aa2bb13803ff73e9355d7b8d336d40f425e42
C++
linnitel/cpp_pool
/day04/ex03/AMateria.hpp
UTF-8
572
2.953125
3
[]
no_license
#ifndef AMATERIA_HPP # define AMATERIA_HPP # include <iostream> class ICharacter; # include "ICharacter.hpp" # define XP_ICR 10 class AMateria { private: std::string const _type; unsigned int _xp; AMateria(); public: AMateria(std::string const & type); AMateria(AMateria const & materia); virtual ~AMateria...
true
9388a381d167bafec53169d2b5c1633e47dde71f
C++
oudream/leetcode
/algorithms/cpp/6.zigzag_conversion.cpp
UTF-8
2,514
3.203125
3
[]
no_license
#include "global.h" using namespace std; class SolutionLeetcode { public: string convert(string s, int nRows) { if (nRows == 1) return s; vector<string> rows(min(nRows, int(s.size()))); int curRow = 0; bool goingDown = false; for (char c : s) { row...
true
2dc8d03ef042b1cecfc4cc6371b4b991f29dadfb
C++
shubhanshusv/ALGORITHMS
/Dynamic Programming/longest_increasing_subsequence.cpp
UTF-8
1,264
3.59375
4
[]
no_license
// Shubhanshu Verma // Dynamic Programming // Longest Increasing Subsequence // For an array of n elements, let L(i) be the length of the LIS ending at index i such that arr[i] is the last element of the LIS. // Then, L(i) can be recursively written as: // L(i) = 1 + max( L(j) ) where 0 < j < i and arr[j] < arr[i]; or...
true
28a410d186be6cf589398eda6c4447fa8b10a72d
C++
TudorPavaluca7/Faculty
/Licenta/Semester 2/OOP/pet gui/Dog.h
UTF-8
868
3.09375
3
[]
no_license
#pragma once #include <iostream> class Dog { private: std::string breed; std::string name; int age; int weight; std::string source; public: Dog(); // constructor with parameters Dog(const std::string& breed, const std::string& name,int age,const std::string& source,int weight); std::string getBreed() const ...
true
e3aace7e5945dfcdd198f60ff1f94b2633769e0b
C++
hcthanhhh/UCC
/UCC_base/src/CColdFusionCounter.h
UTF-8
1,449
2.609375
3
[ "Zlib", "BSL-1.0", "MIT" ]
permissive
//! Code counter class definition for the ColdFusion language. /*! * \file CColdFusionCounter.h * * This file contains the code counter class definition for the ColdFusion language. */ #ifndef CColdFusionCounter_h #define CColdFusionCounter_h #include "CTagCounter.h" //! ColdFusion code counter class. /*! * \class C...
true
47682f223606db24b14b81c1ee5887085250fc7a
C++
Santirax/competitive-solutions
/UVa_online_judge/armyBuddies_(with_SET).cpp
UTF-8
2,032
3.046875
3
[]
no_license
#include <iostream> #include <set> using namespace std; int main () { long long int S, B; long long izq, der; while (cin>>S && cin>>B && S != 0 && B != 0) { set<int>conjunto; //declaracion del set, donde estan los soldados for(int i=1; i<=S; i++){ conjunto.insert(i); ...
true
9bbe7b1d492109fa854ede208626a2d94e9eb5aa
C++
prateekbose/30-seconds-of-cpp
/snippets/vector/accumulate.cpp
UTF-8
230
2.75
3
[ "MIT" ]
permissive
#include<iostream> #include<vector> #include<numeric> using namespace std; int main(){ vector<int> num; num.push_back(10); num.push_back(15); num.push_back(20); cout << accumulate(num.begin(),num.end(),0); }
true
02110361aa6ba98636265d2c14f72dd6634ff14c
C++
gvenet/CPP
/Module_04/ex01/srcs/AWeapon.cpp
UTF-8
985
3.1875
3
[]
no_license
#include "../inc/AWeapon.hpp" //=================================COPLIAN================================================================ AWeapon::AWeapon(std::string const &name, int apcost, int damage) : _name(name), _apcost(apcost), _damage(damage) { std::cout << _name << "\t | apcost : " << _apcost << " | damage ...
true
3bf4b10d4cbda479044b603ec5b1856806fc6338
C++
xinwangcas/operating-systems
/hw5/race22.cpp
UTF-8
2,892
3.5
4
[]
no_license
#include <iostream> #include <pthread.h> #include <iomanip> #include <stdlib.h> #include <fstream> using namespace std; pthread_mutex_t mutex; int main(int argc, char* argv[]) { int n = 1000;//the initial amount ot bank account int errno_create1, errno_create2, errno_create3;//error message of creating threads in...
true
cd0ed670bfc4a9b021588ecb0e410e633ca2c18f
C++
AlexeyKulbitsky/Shadow
/engine/source/video/VertexDeclaration.h
UTF-8
2,687
2.765625
3
[]
no_license
#ifndef SHADOW_VERTEX_DECLARATION_INCLUDE #define SHADOW_VERTEX_DECLARATION_INCLUDE #include "../Globals.h" namespace sh { namespace video { struct SHADOW_API Attribute { Attribute() : semantic(AttributeSemantic::POSITION) , type(AttributeType::FLOAT) , componentsCount(3) {} Attribute(Attr...
true
ea806be1da7431f7404ef0d1b3db42741e977601
C++
17342983498/zhuxu
/Code/AVLTree/23-4-30/AVLTree.h
GB18030
3,998
3.265625
3
[]
no_license
#include <iostream> using namespace std; template<class K,class V> struct AVTreeNode { AVTreeNode<K, V>* _pLeft; AVTreeNode<K, V>* _pRight; AVTreeNode<K, V>* _pParent; pair<K, V> _kv; int _bf;//ƽ AVTreeNode(const pair<K,V> kv) :_pLeft(nullptr), _pRight(nullptr), _pParent(nullptr) , _kv(kv), _bf(0) {} }; t...
true
2a17efcbbfd0917a16491ddeffedd4b8ae0d2119
C++
Dwillnio/GameOfLife
/rule.h
UTF-8
530
2.953125
3
[]
no_license
#ifndef RULE_H #define RULE_H #include <vector> class rule { public: virtual int calculate(const std::vector<int>& neighbours) = 0; }; class rule_classic : public rule { public: virtual int calculate(const std::vector<int>& neighbours); }; class rule_lifelike : public rule { public: rule_lifelike(std::v...
true
a1ed5b3ed301d051d08e2cbb8d2f03dd15914d8e
C++
magicrex/personal
/sort/httpserver/httpserver.cpp
UTF-8
14,292
2.765625
3
[]
no_license
#include"httpserver.h" #include"util.hpp" namespace httpserver{ //将打印请求进行声明 void PrintRequest(const Context* context); //解析请求的第一行,即方法和url //主要是进行字符串的分割 int Parseline(std::string first_line,std::string* method,std::string* url){ std::vector<std::string> output; common::StringUtil::Sp...
true
e4a8268b1242b258231e9ffd1a019581b3f0442b
C++
holoskii/RenderEngine
/RenderEngine.h
UTF-8
1,275
2.71875
3
[]
no_license
/* Created: 29.04.2021 * Author: Makar Ivashko * Short description: 3d rendering engine, * projects polygons from 3d space into 2d screen */ #pragma once #include "Util.h" #include "SFML/Graphics.hpp" class RenderEngine { public: // because of OpenGL render inside window // width and height does not have muc...
true
eb6afd47dd5f4305b0672914496c64e247ff93b8
C++
kbigdelysh/FreePIE-HTCVive-Custom-Controller
/Lib/piefreespace/piefreespace.cpp
UTF-8
7,318
2.53125
3
[]
no_license
/* Author: Brant Lewis (brantlew@yahoo.com) - July 2012 piefreespace (PFS) is a proxy dll that is used to translate complex freespacelib calls into a simple API for easy linking by the FreePIE FreeSpacePlugin. It sets up the device connection, handles I/O reads, and converts quaternion vectors into Euler angles. T...
true
db3188a16cda0b177f66ed2ea7789a39faab9763
C++
alvin-me/MIVT
/tgt/progressbar.cpp
UTF-8
2,267
2.71875
3
[]
no_license
#include "progressbar.h" #include "logmanager.h" #include "tgt_string.h" namespace tgt { std::string ProgressBar::loggerCat_ = "ProgressBar"; ProgressBar::ProgressBar(ProgressCallback callback) : progress_(0) , progressRange_(0.f, 1.f) , printedErrorMessage_(false) , callback_(callback) {} v...
true
bfd4d8976cda708be3a189909d1d9beb11db8ec3
C++
ruankotovich/B-Tree
/src/debug.cpp
UTF-8
2,659
3.140625
3
[]
no_license
#include "secondarybtree.hpp" #include <iostream> union BlockDerreference { Block_t block; SecondaryBTreeNode node; }; void printAll(Block_t& block, FILE* indexFile, BlockDerreference* derreference) { int i = 0; rewind(indexFile); while (fread(&block, sizeof(Block_t), 1, indexFile)) { std...
true
6cbef319f7086dae2c602a190f88535a33bd5f79
C++
QuantumBird/ACM_Team
/LZL/Data_structure/ST/HDU-1166.cpp
UTF-8
2,151
2.890625
3
[]
no_license
//单点更新 区间查询 结点存区间数值和 #include<bits/stdc++.h> using namespace std; #define lson (q<<1) #define rson (q<<1|1) #define mid ((l+r)>>1) const int maxn = 50000+10; int book[maxn]; int segt[maxn<<2]; int T,m,n; int flag; void init(){ memset(book,0,sizeof(book)); memset(segt,0,sizeof(segt)); } void push_up(int q){ ...
true
0a541d78b945c166b062379fd04f731b34877067
C++
jordantonni/Design_Patterns
/6 Flyweight/flyweight.cpp
UTF-8
1,816
3.953125
4
[]
no_license
#include <iostream> #include <boost/bimap.hpp> #include <ostream> using namespace std; using namespace boost; /* * ABSTRACT: * Users can have the same names. * We store the names in a static bi-directional map of the user class. * * When we add a new name it gets added to the map with the id of the object. * C...
true
cc6c878a9ed264e21523139b4e051f5b52ae5721
C++
Strider-7/code
/graph/find-mother-vertex.cpp
UTF-8
996
3.546875
4
[ "MIT" ]
permissive
// A Mother Vertex is a vertex through which we can reach all the other vertices of the Graph. #include <bits/stdc++.h> using namespace std; void dfsUtil(int u, vector<bool> &visited, vector<int> adj[]) { visited[u] = true; for (auto v : adj[u]) if (!visited[v]) dfsUtil(v, vi...
true
bab18d2661624873c7d7faf1a9efffa9b4d8851b
C++
sonyhome/DigitalIO
/Examples/1_Button_and_builtin_LED/1_Button_and_builtin_LED.ino
UTF-8
9,984
3.078125
3
[ "MIT" ]
permissive
//////////////////////////////////////////////////////////////////////////////// // A Digital IO Library for Arduino // Copyright (c) 2015-2020 Dan Truong //////////////////////////////////////////////////////////////////////////////// // Button_and_builtin_LED // // This simple demo declares push button and an LED. Th...
true
6a8712c515ca24f7cd47f0a58b3a396ae8396d33
C++
Rena7ssance/Database-Implementation
/SQL/headers/ExprTree.h
UTF-8
24,722
2.703125
3
[]
no_license
#ifndef SQL_EXPRESSIONS #define SQL_EXPRESSIONS #include "MyDB_AttType.h" #include "MyDB_Catalog.h" #include <string> #include <vector> #include <algorithm> // create a smart pointer for database tables using namespace std; class ExprTree; typedef shared_ptr <ExprTree> ExprTreePtr; enum ExprType { NUMBER_TYPE, ...
true
dd2002c687f00352833551df47a163b2cb4c5b31
C++
DejotaFreitas/LANG-C-PLUS-PLUS
/SERVER-GAME/headers/Computer.hpp
UTF-8
3,338
2.515625
3
[ "MIT" ]
permissive
// // Computer.hpp // server // // Created by Bruno Macedo Miguel on 10/12/16. // Copyright © 2016 d2server. All rights reserved. // #ifndef Computer_hpp #define Computer_hpp #include <cstdlib> #include <queue> #include <boost/asio.hpp> #include <iostream> #include "Consts.hpp" #include "Account.hpp" #include "Me...
true
779a1c86484affd85ab43e93d1cf0436fd16fb35
C++
lijiaxin-dut/leetcode
/leetcode_train/Solution_536.cpp
GB18030
1,633
3.671875
4
[]
no_license
#include<vector> #include"TreeNode.h" #include<string> using namespace std; //You need to construct a binary tree from a string consisting of parenthesis and integers. // //The whole input represents a binary tree.It contains an integer followed by zero, one or two pairs of parenthesis.The integer represents the root...
true
a4189b4764c7d119877d87bce4c5799060947546
C++
vitalbit/labApple
/TPlab1/TPlab1.cpp
WINDOWS-1251
2,488
3.25
3
[]
no_license
// TPlab1.cpp: . // #include "stdafx.h" #include <string> #include <vector> #include <time.h> #include <iostream> using namespace std; class Apple { private: bool ripe; string color; int seeds; public: Apple() { ripe = true; color = "red"; seeds = rand() % 11; } int getSeeds() { retu...
true
e91f5fcbe38e13d51a21cb9d1d7499ceff38498f
C++
Ting2003/LDO
/util.h
UTF-8
793
2.625
3
[]
no_license
#ifndef __UTIL_H__ #define __UTIL_H__ #include <iostream> #include <fstream> #include <vector> #include <string> #include <cmath> using namespace std; #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) #define AT __FILE__ ":" TOSTRING(__LINE__) #define report_exit(a) _report_exit(AT,a) #define fzero(a) (fabs(a)...
true
2571ab11c39a46a69c09e029458356db6703060b
C++
RyanStonebraker/Snowball
/c++/test/neuralNetworkTests.cpp
UTF-8
5,640
2.84375
3
[ "MIT" ]
permissive
#include "catch.hpp" #include "WeightedNode.h" #include "IOHandler.h" #include <fstream> #include "BranchTracker.h" #include <vector> #include "board.h" #include <chrono> using std::chrono::system_clock; using std::chrono::duration; #include "moveGenerator.h" TEST_CASE ("Basic Gameplay") { WeightedNode currentWeight...
true
8dec23fcc8eb910f3eadc86f8410099c5a2bd394
C++
aqfaridi/Competitve-Programming-Codes
/SPOJ/PARTY.cpp
UTF-8
1,531
2.703125
3
[ "MIT" ]
permissive
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #define MAX 2010 typedef unsigned long long int LL; using namespace std; int w[MAX],v[MAX]; int main() { int W,n,K; while(1) { scanf("%d %d",&W,&n); if(W==0 && n==0) break; for(int i=1;i<=n;i++...
true
da68f8d38d47f35149f06a6ff57a98939ad7a060
C++
davidvodnik/OptionalCoroutine
/src/optional_coroutine.h
UTF-8
1,417
3
3
[]
no_license
#include <experimental/coroutine> #include <optional> template<typename T> struct OptionalPromise { auto initial_suspend() { return std::experimental::suspend_never(); } auto final_suspend() { return std::experimental::suspend_never(); } void unhandled_exception() {} struct Ret...
true
f5dd4e59cb060dbca1c99a47c35fb9e8f0ffb8b6
C++
AshrafTasin/UVA_
/136-Ugly Numbers.cpp
UTF-8
732
2.53125
3
[]
no_license
/*----------------------| / Author : Ashraf Tasin | / Date : 10.09.18 | /----------------------*/ #include<bits/stdc++.h> #define pb push_back #define mp make_pair #define ll long long #define all v.begin(),v.end() #define M it=m.begin(),it!=m.end(),it++ #define db double #define show for(int i=0;i<v.size();i++)...
true
da35389cd72cab07f21222943464b58cfc87371c
C++
novikov-ilia-softdev/thinking_cpp
/tom_2/chapter_01/06/main.cpp
UTF-8
394
3.28125
3
[]
no_license
#include <iostream> class MyClass{ public: MyClass() { std::cout << "MyClass::MyClass" << std::endl; } ~MyClass() { std::cout << "MyClass::~MyClass" << std::endl; throw 5; } }; int main() { try { MyClass* myClassPtr = new MyClass; delete myClassPtr; } catch( ...) { std::cout << "exception!" << ...
true
6dcc9359a6b2b07f497b000d96e8b7ed2fbbd0d1
C++
IlyaOvodov/tensorflow-cc-inference
/lib/Inference.cc
UTF-8
3,147
2.875
3
[ "MIT" ]
permissive
#include <fstream> #include <sstream> #include <exception> #include "tensorflow_cc_inference/Inference.h" using tensorflow_cc_inference::Inference; /** * Read a binary protobuf (.pb) buffer into a TF_Buffer object. * * Non-binary protobuffers are not supported by the C api. * The caller is responsible for freein...
true
1182aba9a118c6f62edf14de667b6de7d093b954
C++
Waseem-Akram7/PGJQP_Waseem
/greater of two.cpp
UTF-8
328
3.671875
4
[]
no_license
#include<iostream> using namespace std; class greateroftwo { int num1,num2; public:void number() { cout<<"Enter the numbers"; cin>>num1>>num2; if(num1>num2) { cout<<"NUM1 is greater"; } else { cout<<"Num2 is greater"; } } }; int main() { greateroftwo num; num.number...
true
943394625a4a2959cee3f00071f45c21930e779e
C++
sergeyampo/Incoming-Stock
/Good.h
UTF-8
182
2.71875
3
[]
no_license
#ifndef GOOD_H #define GOOD_H #include <string> //Товар, содержащий наименование и цену. struct Good{ std::string name; float price; }; #endif
true
632087d2b92173c1bc6eb8a4787bb9f5de64296c
C++
soumy47/Data-Structures-Algorithms-in-C
/algorithm/5872. Number of Pairs of Strings With Concatenation Equal to Target.cpp
UTF-8
942
3.5625
4
[ "MIT" ]
permissive
Given an array of digit strings nums and a digit string target, return the number of pairs of indices (i, j) (where i != j) such that the concatenation of nums[i] + nums[j] equals target. #include<bits/stdc++.h> using namespace std; int numOfPairs(vector<string>& nums, string target) { int n = nums.si...
true
14409d20c3704910c0951fc9d23ed55cbfd85328
C++
zxycode007/Sapphire2
/Core/Mutex.h
GB18030
683
3.0625
3
[]
no_license
#pragma once #include "Sapphire.h" namespace Sapphire { /// class SAPPHIRE_API Mutex { public: Mutex(); ~Mutex(); // õ壬Ѿõ void Acquire(); /// ͷŻ void Release(); private: /// void* handle_; }; // ԶúͷŻ class SAPPHIRE_API MutexLock { public: /// 첢û MutexLock(Mutex& mutex); /// ͷŻ ...
true
302285be6be1c0d36d7a0e2b270222f9e4b74b95
C++
ZhongZeng/Leetcode
/lc148sortLst.cpp
UTF-8
2,279
3.46875
3
[]
no_license
/* Leetcode 148. Sort List Related Topics Linked List, Sort Similar Questions Merge Two Sorted Lists, Sort Colors, Insertion Sort List Next challenges: Insert Interval, Convert Sorted List to Binary Search Tree, Reorganize String Test Cases: [1,6,2,5,7,3,4] [] Runtime: 61 ms Your runtime beats...
true
b8db4284299f8be210af62a0a366c8541ceb94e7
C++
Mniek/project
/ProjektMapa/randomCityGene.cpp
UTF-8
529
3.28125
3
[]
no_license
#include <iostream> #include <ctime> #include <random> #include <string> using namespace std; string randomCity( size_t length) { static const string alphabet = "abcdefghijklmnopqrstuvwxyz"; static default_random_engine randomCity(time(nullptr)); static uniform_int_distribution<size_t>distribution(0,alphabet.siz...
true
46f4597609468d1d61d12f665a89b86103960a34
C++
opendarkeden/server
/src/Core/CGBuyStoreItem.h
UHC
2,597
2.90625
3
[]
no_license
//////////////////////////////////////////////////////////////////////////////// // Filename : CGBuyStoreItem.h // Written By : 輺 // Description : // ÷̾ NPC â , ϰ // Ŷ̴. ÷̾ κ丮 // ڸ ִ , ÷̾ ѱ. //////////////////////////////////////////////////////////////////////////////// #ifndef __CG_BUY_STORE_ITEM...
true
29ee65ce669f3d4fe0edcd9527f2193c70f47ee1
C++
Lacty/2DCollisionToTexture
/src/shape.hpp
UTF-8
202
2.9375
3
[]
no_license
#pragma once template<typename T> class Rect { public: T l, r, t, b; Rect(T l, T r, T t, T b) : l(l), r(r), t(t), b(b) {} Rect(const Rect& src) : l(src.l), r(src.r), t(src.t), b(src.b) {} };
true
f4f3bf1985592a43193e4ec5189a81efd20e37d7
C++
wailo/orderbook-matching-engine
/test/market_test.cpp
UTF-8
8,128
2.953125
3
[]
no_license
//Link to Boost #define BOOST_TEST_DYN_LINK //Define our Module name (prints at testing) #define BOOST_TEST_MODULE "BaseClassModule" #include "matchingEngine.hpp" #include "trader.hpp" #include "orderBook.hpp" #include <boost/test/unit_test.hpp> // dummy representation of order contracts enum contract { IBM, APPLE };...
true
5905bb271cc749dd85eb5e416c2c96e691885510
C++
Satzyakiz/CP
/Array/Segmented_Sieve_Prime_Nos.cpp
UTF-8
633
2.921875
3
[]
no_license
// Generate all prime numbers between two given numbers. // Input: // 2 // 1 10 // 3 5 // Output: // 2 3 5 7 // 3 5 #include<bits/stdc++.h> using namespace std; int sieve[100001]; void solve(){ int s,e; cin>>s>>e; for(int i=s; i<=e; i++){ if(sieve[i] == 0) cout<<i<<" "; } cout<<...
true
c7dfe6be8209cf2a1de9416055808de2374c17b6
C++
P-compete/Trees
/Sum_tree.cpp
UTF-8
476
3.046875
3
[]
no_license
#include<bits/stdc++.h> using namespace std; struct node { int data; node *left,*right; node(int item) { data=item; left=NULL; right=NULL; } }; int sum(node *t) { if(t==NULL){return 0;} int old=t->data; t->data=sum(t->left)+sum(t->right); return t->data+old; } int main() { node *root=ne...
true
500d58dc110954d5f5d93d80ec49f49dc3ff60e0
C++
xczhang07/leetcode
/cpp/middle/fraction_to_recurring_decimal.cpp
UTF-8
900
2.875
3
[]
no_license
class Solution { public: string fractionToDecimal(int numerator, int denominator) { if(numerator == 0) return "0"; if(!denominator) return ""; string ret; if((numerator < 0 && denominator > 0) || (numerator > 0 && denominator < 0)) ret = "-" + ret; long n = abs((l...
true
858e87fd513d955020a1e973bfc9df177e43958c
C++
leoqingliu/StateGrid
/Public/IPC.h
UTF-8
334
2.625
3
[]
no_license
#pragma once class IPC { public: IPC(void); ~IPC(void); public: BOOL Create(LPCTSTR pszName); BOOL Open(LPCTSTR pszName); VOID Close(); BOOL IsOpen(void) const {return (m_hFileMap != NULL);} BOOL Read(LPBYTE pBuf, DWORD &dwBufSize); BOOL Write(const LPBYTE pBuf, const DWORD dwBufSize); protected: HANDLE m...
true
981d6fa424eefd6bb331fea23d4dfa36df3bfce8
C++
Laz-berry/Sensor_Robot_ROS
/my_publisher_class/src/my_publisher_class.cpp
UTF-8
3,017
2.953125
3
[]
no_license
#include <my_publisher_class.hpp> namespace my_publisher_class { MyPublisherClass::MyPublisherClass() : private_nh("~") { //launch file parameter if(!private_nh.getParam("param_int", param_int_)) throw std::runtime_error("fail to get param_int"); if(!private_nh.getParam("param_flo...
true
450149bcf6a5e0bac80003e19aa9b4b224bbd134
C++
vivia1994/SummerTest5
/VIJOS-P1037/源.cpp
GB18030
1,300
3.109375
3
[]
no_license
#include<stdio.h> #include<iostream> #include<string.h> #include<algorithm> using namespace std; /*ڵiˮ 3 1 2Ÿ 3Ű 1.Ը 2.*/ int dp[105][20005]; //dp[i][j]ʾǰi,߶ȲΪj,ĸ߶ȡYYתƷ int tmp[105]; int main() { int n; cin >> n; int sum = 0; for (int i = 1; i <= n; i++) { cin>>tmp[i]; sum += tmp[i]; } memset(dp, -1...
true
0e50ea55549516377ffdf1ffe7ca214e5ef07c72
C++
fdoperezi/Thesis
/Code/Thesis/include/thesis/BoltzmannPolicy.h
UTF-8
4,837
2.546875
3
[ "MIT" ]
permissive
/* * Copyright (c) 2016 Pierpaolo Necchi * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, pu...
true
1423dd6e8347017f38f6fd002f4bda2233e46e54
C++
kpnaranj/Athabascau-c-
/Eckles examples/TMA1/TMA1Question4.cpp
WINDOWS-1258
3,811
3.828125
4
[]
no_license
//: TMA1Question4.cpp /* Title: TMA1Question4.cpp Description: Write a program that creates an array of 100 string objects. Fill the array by having your program open a (text) file and read one line of the file into each string until you have filled the array. Display the array using the format ...
true
86a23f7983505519b65ff7f3b9d54dd11c85cdd2
C++
15831944/src-1
/TestDrive/UpVersion/UpVersion.cpp
UHC
4,356
2.734375
3
[ "BSD-3-Clause", "MIT" ]
permissive
#include "stdafx.h" #include "stdio.h" #include "stdlib.h" #include <string> #include <list> using namespace std; typedef list<string> LineList; class CLineLink{ public: char m_line[1024]; CLineLink* m_pNext; CLineLink(void){m_pNext = NULL;} ~CLineLink(void){if(m_pNext) delete m_pNext;} CLineLink* New(void){...
true
dd0e4ce5887c5ab821e9d9bc98ea4344e0560acc
C++
mshipchandler/NeuralNetDev
/src/image_preprocessor.h
UTF-8
10,159
3.0625
3
[]
no_license
/* Ma'ad Shipchandler Neural Net Input Module 2.0 - image_preprocessor.h 21-09-2015 */ /* SUGGESTED INPUT IMAGE SIZE: 256 x 256 */ #include <iostream> #include <vector> #include <fstream> // OpenCV 3 Library List ------------------------------------------------------------------- #include <opencv2/core.hpp> #inc...
true
f08bf32509dd46b11fa9690108da646133b8023c
C++
l3shen/PHY1610
/Assignment 8/walkring.cc
UTF-8
2,038
3.234375
3
[]
no_license
// // walkring.cc // // 1d random walk on a ring // // Compile with make using provided Makefile // #include <fstream> #include <rarray> #include "walkring_output.h" #include "walkring_timestep.h" #include "walkring_parameters.h" // the main function drives the simulation int main(int argc, char *argv[]) { // Si...
true
5c4458ae10443b36eabf6612c8648a8d7ed367ad
C++
Maigo/gea
/gea/libs/gea_math/src/gea/mth_vector/point3.inl
UTF-8
4,367
3.0625
3
[]
no_license
// gea includes #include <gea/utility/assert.h> namespace gea { namespace mth { // ------------------------------------------------------------------------- // // point3 // // ------------------------------------------------------------------------- /...
true
2987e83d65f97193a25d3c37ce7a080849477c67
C++
bdliyq/algorithm
/leetcode/palindrome-linked-list.cc
UTF-8
2,535
3.78125
4
[]
no_license
// Question: https://leetcode.com/problems/palindrome-linked-list/ #include "headers.h" struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: bool isPalindrome(ListNode* head) { if (!head || !head->next) { return true; ...
true
4afa93f84372257db38d08928464f4663bc93306
C++
arthurlz/hairy-coding
/Chinese chess.cpp
UTF-8
241
2.9375
3
[]
no_license
#include <iostream> using namespace std; typedef unsigned char byte; int main(int argc, char *argv[]) { byte b = 81; while(b--) { if(b/9%3 == b%9%3) continue; cout<<"A="<<(b/9+1)<<" B="<<(b%9+1)<<endl; } return 0; }
true
aa5ca2f9557970d6e529d24277251d2b413c3dca
C++
ashwitharao21/silver-train
/BST.CPP
UTF-8
1,087
3.25
3
[]
no_license
#include<iostream.h> #include<conio.h> //using namespace std; struct bstnode{ int data; struct bstnode* left; struct bstnode* right; }; bstnode* getnewnode(int data){ bstnode* newnode= new bstnode(); newnode->data=data; newnode->left=newnode->right=NULL; return newnode; } bstnode* Insert(bstnod...
true
98acea01547cc90f01edae4a8632f96738abdc3a
C++
HDBaggy/Sboard
/Main/Client/ClsClient.cpp
UTF-8
2,582
2.546875
3
[]
no_license
#include <iostream> #include <signal.h> #include "TCPClient.h" #include <fstream> #include <unistd.h> #include <stdio.h> #include <cstdlib> #include <pthread.h> #include <thread> #include <chrono> #include "ClsClient.h" #include "../Common.hpp" using namespace std; void *startTmpMsg(void *t); void sendMessage(); TCP...
true
b64f88b1b297d499523bc9ad6d881830cb7648bb
C++
shadowSQ/practice
/模拟赛第四题.cpp
GB18030
1,254
3.21875
3
[]
no_license
#include <iostream> using namespace std; #include <stdio.h> int total=0; int flag=0; struct Cages{ int cages[100]; int size; }; void push(int t,Cages &cage) { int i ; for(i=0;i<cage.size;i++) { if(cage.cages[i]==t) return; } cage.cages[cage.size] = t; cage.size++; } bool initcages(Cages &cage) { cage.s...
true
484f0a99b021c3c98aafb5490a1dc44c685c2808
C++
isysoi3/SPOVM
/lab4/linux/main.cpp
UTF-8
2,661
3.328125
3
[]
no_license
#include <stack> #include <iostream> #include <termios.h> #include <unistd.h> #include <stdio.h> #include "pthread.h" #define DELAY_TIME_SEC 2 std::stack <pthread_t> childThreads; pthread_mutex_t consoleMutex; int getch() { struct termios oldattr, newattr; int ch; tcgetattr( STDIN_FILENO, &oldattr ); ...
true
59dfad05178c5d0c247d1c342bec4d4754d3e515
C++
luchev/uni-object-oriented-programming-2021
/Week 09/Template inheritance/string_using_vector.hpp
UTF-8
381
3.28125
3
[]
no_license
#pragma once #include <vector> class String : public std::vector<char> { public: String() { push_back('\0'); } void push_back(char c) { if (!this->empty()) { pop_back(); } std::vector<char>::push_back(c); std::vector<char>::push_back('\0'); } ...
true
bb715aeddcc896069de0f1420c590b885131a8c2
C++
Req1630/TankDefense
/TankDefense/SourceCode/Object/Collider/CollisionManager/CollisionManager.cpp
SHIFT_JIS
10,531
2.546875
3
[]
no_license
#include "CollisionManager.h" #include "..\Sphere\Sphere.h" #include "..\Capsule\Capsule.h" #include "..\Box\Box.h" #include "..\Ray\Ray.h" #include "..\Mesh\Mesh.h" namespace coll { //---------------------------------------. // ̓m̓蔻. //---------------------------------------. bool IsSphereToSphere( CSphere* pMyS...
true
b7495cdc90bb15017edc8e8efdd437ba1f61a58d
C++
CermakM/CodinGame
/Medium/ShadowsOfTheKnightEpisode1.cpp
UTF-8
1,507
3.296875
3
[]
no_license
#include <iostream> #include <string> #include <cmath> using std::cin; using std::cout; using std::endl; int Difference( const int& bound, const int& current ) { return round( fabs( (float)bound - (float)current) / 2 ); } int main() { int W, H; // width and height of the building. cin >> W >> H; cin.ignore()...
true
9e4c3b784e62eea308519432b7b7eaed91ba1cc9
C++
bmclaine/Space-Yetis-In-Space
/Code/source/IntroState.h
UTF-8
1,469
2.921875
3
[]
no_license
//*********************************************************************// // File: IntroState.h // Author: Brian McLaine // Course: SGD // Purpose: IntroState class handles the intro screen //*********************************************************************// #pragma once #include "IGameState.h" class IntroSt...
true
016e93535927cbca2b1c95869726500847c4f4bc
C++
iomeone/PudgeNSludge
/Source/Utilities/CollisionLib/CollisionRay.cpp
UTF-8
5,303
2.96875
3
[]
no_license
////////////////////////////////////////////////////////////////////////////////////// // Filename: CollisionRay.cpp // Author: Josh Fields // Date: 5/24/12 // Purpose: This class holds on to the information for a Ray ////////////////////////////////////////////////////////////////////////////////////// #include "Co...
true
6203c3410fdb501b4a4d888979022736db7b2c6f
C++
moevm/oop
/8383/maximova_anastasia/gameField.h
UTF-8
782
2.765625
3
[]
no_license
#pragma once #include "Object.h" #include "Unit.h" #include "AbstractFactory.h" class GameField { protected: int width, height; int step; int maxUnits; Object*** field; //двумерный массив указателей public: GameField(); GameField(int height, int width); GameField(const GameField& other); //к...
true
741a75088568c6a21232dec58f9c40458d810602
C++
kangli-bionic/algorithm
/lintcode/1568.dfs.cpp
UTF-8
1,782
3.28125
3
[ "MIT" ]
permissive
/** 1568. Minimum Number of Days to Disconnect Island https://leetcode.com/problems/minimum-number-of-days-to-disconnect-island/ DFS **/ class Solution { private: vector<int> DELTA_X = {0, 0, -1, 1}; vector<int> DELTA_Y = {-1, 1, 0, 0}; bool isOneIsland(vector<vector<int>> &grid) { int n = grid...
true
67f3340afc67b8152301f2efd14408b24215214c
C++
YacerRazouani/INF1010
/TP3_versionRemise/TP3_versionRemise/ProduitAuxEncheres.h
ISO-8859-1
1,086
2.828125
3
[]
no_license
/******************************************** * Titre: Travail pratique #3 - ProduitAuxEncheres.h * Date: 25 fvrier 2018 * Modifier par: Amar Ghaly (1905322) & Yacer Razouani (1899606) *******************************************/ #ifndef PRODUITAUXENCHERES_H #define PRODUITAUXENCHERES_H #include <string> #include <ios...
true
382c0fe8a42325f9c262bf1dd95903742f694884
C++
proweb4all/c-cpp
/urok96-massiv-obj-class.cpp
WINDOWS-1251
1,456
3.234375
3
[]
no_license
#define _CRT_SECURE_NO_WARNINGS #include <iostream> // using namespace std; class Pixel{ public: Pixel(){ r = g = b = 0; } Pixel(int r, int g, int b){ this->r = r; this->g = g; this->b = b; } string getPixel(){ return "Pixel(r,g,b): (" + to_string(r) +...
true
ef2d9a94e1659463ff50ed5255f9f10b631293d5
C++
alaneurich/darksnakes
/helpers.cpp
UTF-8
1,012
2.640625
3
[]
no_license
// // Created by alane on 02.01.2018. // #include <afxres.h> #include <sys/time.h> #include "helpers.h" Snake* getDynamicSizedSnakeArray(int size) { auto *snakes = new Snake[size]; int playerCount = gPlayerCount; for(int a = 0; a < size; a++) { snakes[a].positions[0][0] = 0; snakes[a].posi...
true
1841277d7e2db522256d50c754641d8196483d1c
C++
habib302/leetcode-1
/166. Fraction to Recurring Decimal.cpp
UTF-8
1,113
2.75
3
[]
no_license
class Solution { public: string fractionToDecimal(int num, int den) { if( num == 0 ) return "0"; if( den == 1 ) return to_string(num); if(num==INT_MAX&&den==-1)return to_string(INT_MIN) ; if(num==INT_MIN&&den==-1)return "2147483648" ; string sign = ""; if( ( ...
true
a0095a3fe2f534b885929e630d70995b87b5e68e
C++
navpreetkaurr/OOP345_final
/milestone2/CustomerOrder.cpp
UTF-8
3,231
2.90625
3
[]
no_license
// Name: Navpreet Kaur // Seneca Student ID: 148332182 // Seneca email: nk79 // Date of completion: 26 March, 2020 // // I confirm that I am the only author of this file // and the content was created entirely by me. #include "CustomerOrder.h" #include"Utilities.h" #include<vector> #include<iostream> #include<iomani...
true
5f16d42a08496c3b97cfa43ba74ce1c85c75f2ee
C++
shadab16/SymlinkMerge
/src/invalid_path.h
UTF-8
491
2.59375
3
[]
no_license
/* * invalid_path.h * * Author: Shadab Ansari */ #ifndef INVALID_PATH_H_ #define INVALID_PATH_H_ #include <exception> #include "boost/filesystem.hpp" namespace SymlinkMerge { namespace fs = boost::filesystem; class invalid_path : public std::exception { protected: const fs::path _path; public: invalid_...
true
9ca3369f555c9d0d63550f6e8b3d575323ca7b83
C++
rika77/competitive_programming
/atcoder/event/dwa/b.cpp
UTF-8
307
2.625
3
[]
no_license
#include<iostream> #include<cstdio> #include<string> #include<algorithm> using namespace std; int main(){ string a; cin >> a; int cnt2=0; int cnt5=0; for (int i=0;i<a.length();i++) { if (a[i]=='2') cnt2++; else cnt5++; } if (cnt2 != cnt5) { cout << "-1" <<endl; return 0; } return 0; }
true