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
9b7e471baf19e37d85b20e470f7edbaf7942b7d5
C++
sevabeat/algorithms
/2019-2020/lab03/sort.cpp
UTF-8
1,518
3.625
4
[]
no_license
#include <iostream> #include <string> #include <vector> #include <fstream> #include <utility> using namespace std; class Heap { public: int heap_size; vector<int> &array; explicit Heap(vector<int>& b) : array(b){ this->array = b; heap_size = b.size(); } int siftDown(int i){ ...
true
3d9d9ba76b9e5d7c5d5e684826fe6d7d3fc8a581
C++
amayii0/Homie-DHT22
/src/main.cpp
UTF-8
1,915
2.734375
3
[]
no_license
#include <Homie.h> // DHT sensor consts/vars #include "DHT.h" #define DHTPIN D5 // What pin we're connected to #define DHTTYPE DHT22 // Can be DHT11, DHT22 (AM2302), DHT21 (AM2301) DHT dht(DHTPIN, DHTTYPE); // Initialize DHT sensor for normal 16mhz Arduino const int MEASURE_INTERVAL = 10; // How o...
true
4c7196b52add2f73bfb2ac3ab51ae5eb9d18aa8c
C++
oabushama/Introduction-to-Scientific-Programming
/Code/func/twicein.cxx
UTF-8
690
3.03125
3
[]
no_license
/**************************************************************** **** **** This file belongs with the course **** Introduction to Scientific Programming in C++/Fortran2003 **** copyright 2017-9 Victor Eijkhout eijkhout@tacc.utexas.edu **** **** twicein.cxx : simple function illustration **** ******************...
true
0e09ef2b35de8c88022960b0efccef7451c9a441
C++
SakuraSinojun/destiny
/s1/scene_game.cc
UTF-8
3,141
2.84375
3
[]
no_license
#include "scene_game.h" #include "gamemap.h" #include <sstream> #include <iostream> #include "ui.h" #include "log.h" #include "hero.h" #include "item.h" #include "monster.h" #include "creature.h" #include "dice.h" SceneGame::SceneGame() : current_creature(NULL) { current_creature = new CreatureCircle(Hero::G...
true
8407d411efce2c4ff1645fc27b2561e9f6a651f8
C++
illyuha/UkrWords
/UkrWordsProj/secondwidget.cpp
UTF-8
1,158
2.609375
3
[]
no_license
#include "secondwidget.h" #include "ui_secondwidget.h" #include "wheelukrword.h" SecondWidget::SecondWidget(QWidget *parent) : QWidget(parent), ui(new Ui::SecondWidget) { ui->setupUi(this); ui->nextPushButton->setText("ДАЛІ"); ui->backPushButton->setText("НАЗАД"); scene = new QGraphicsScene(t...
true
528980dd2104e233d42ed3729e353c71c08a738e
C++
CyberChimeraUSA/Cpp-Tutorials
/C++ Basics Videos/2-Conditional Statements/6-NestedIfPrime/6-NestedIf.h
UTF-8
308
3
3
[]
no_license
#include <iostream> #include <iomanip> using namespace std; #include <process.h> int main () { unsigned long x, y; cout << "Enter a Number: "; cin >> x; for(y = 2; y <= x/2; y++) if(x%y == 0) { cout << "Not Prime, Divisible by " << y << endl; } cout << "Prime"; return 0; return 0; }
true
c73027b2f99bf32dab4f2d9642d7e786f38336a2
C++
vix515/NIU-Undergrad-Course-Work
/NIU_CSCI241_AdvancedC++/Assign2/SalesDB.h
UTF-8
760
2.515625
3
[]
no_license
#ifndef SALESDB_H #define SALESDB_H #include "Seller.h" /**************************************************************** FILE: Seller.h AUTHOR: Victor Padilla LOGON ID: Z1689628 (your Z number here) DUE DATE: 9/22/2015 PURPOSE: This header file sets up the methos prototypes and default vari...
true
ee39be48eeffe40e764e2f9287b4b8103e8d567d
C++
ekmbcd/Cpp_Piscine
/cpp04/ex03/MateriaSource.cpp
UTF-8
998
3.078125
3
[]
no_license
#include "MateriaSource.hpp" MateriaSource::MateriaSource() { for (int i = 0 ; i < 4 ; i++) { _learned[i] = NULL; } } MateriaSource::MateriaSource(const MateriaSource & src) { *this = src; } MateriaSource::~MateriaSource() { for (int i = 0 ; i < 4 ; i++) { if (_learned[i] != NULL) delete _learned[i]; }...
true
9270b21042cbb6667673f424f98e740042706e65
C++
reitmas32/DataStructures
/CLL/CLL.hpp
UTF-8
1,483
3.203125
3
[]
no_license
/** * @file CLL.hpp * @version 2.0 * @date 14/07/2019 * @author Zamora Ramírez Oswaldo Rafael * @brief API de una CLL de tipos dinamicos */ #ifndef CLL_CLL_HPP #define CLL_CLL_HPP #include "Node.hpp" #include "Node.cpp" template <class Item> class CLL{ private: Node<Item>* first; Node<Item...
true
fa2ce0a2e7c30c6f54dc3a0961fc1cddc023b97c
C++
krinnewitz/Transform
/Main.cpp
UTF-8
1,115
3.078125
3
[]
no_license
#include <stdlib.h> #include "Transform.hpp" #include <stdio.h> #include <math.h> #include <iostream> /** * \file Main.cpp * \brief This is an approach to calculate the translation, * rotation and scaling between two images which show the same object. The main goal is to verify how * good this method is when...
true
6bef5576a5d68f295e4565f2b0c89a7591430de0
C++
RCVWPHASEII/V2I-Hub
/src/tmx/TmxUtils/src/ThreadWorker.h
UTF-8
1,801
3.234375
3
[ "Apache-2.0" ]
permissive
/* * ThreadWorker.h * * Created on: Aug 19, 2016 * Author: ivp */ #ifndef SRC_THREADWORKER_H_ #define SRC_THREADWORKER_H_ #include <atomic> #include <thread> namespace tmx { namespace utils { /** * Abstract class that manages a thread for performing work. */ class ThreadWorker { pub...
true
04983591c7eb044ec02b2610743169423118040a
C++
udacity/CppND-Game-Server
/test/test_HoldemScore.cpp
UTF-8
555
2.796875
3
[]
no_license
// test_HoldemScore.cpp // Created by Robin Rowe 2019-01-21 // License MIT MIT open source #include <stdio.h> #include "../holdem/HoldemScore.h" #include "../Hand.h" #include "../KnuthShuffler.h" #include "../Deck.h" void ScoreHand(Deck& deck) { Hand hand(5); hand.Draw(deck,5); hand.Print(); printf(" "); HoldemS...
true
534937beab379f2eb46921af37d2675933c19e88
C++
Pincinato/C_plus_plus_1
/qt/ex5/vector.h
UTF-8
1,765
3.515625
4
[]
no_license
#ifndef VECTOR_H #define VECTOR_H #include <memory> #include <iostream> using namespace std; class vector { public: vector(); ~vector(); vector(const int &size); vector(const int &size,const int &initialValue); /** * @brief vector * @param copySource */ vector(const vector &cop...
true
1f20165cac56e1c4ea6f4308ec8bb5fbf9b36f2a
C++
danielcu888/Template_Metaprogramming
/Chapter4/exercises/4_3/main.cpp
UTF-8
3,892
3
3
[]
no_license
#include <cstdlib> #include <boost/mpl/apply.hpp> #include <boost/mpl/next.hpp> #include <boost/mpl/eval_if.hpp> #include <boost/mpl/identity.hpp> #include <boost/mpl/not_equal_to.hpp> #include <boost/mpl/equal_to.hpp> #include <boost/mpl/greater.hpp> #include <boost/mpl/minus.hpp> #include <boost/mpl/plus.hpp> #includ...
true
8d0d747fe31464ed8e19cf127ae83736e093bb6a
C++
alicezywang/cognition
/src/micros/resource_management/cognition/cognition_manager/cognition_dev/src/cognition.cpp
UTF-8
4,654
2.546875
3
[]
no_license
#include "cognition/cognition.h" #include <boost/algorithm/string.hpp> namespace cognition { /** * @brief Handle::Handle * @param type * @note In Future, will add function calling of model_select and so on; */ Handle::Handle(UesType type ) :type_(type) { } Handle::~Handle(){ if (UesType::...
true
d14d8687442681706378fe3c9ee59e2e09795a6d
C++
matei-re/holiday2018
/training005/training005/training005.cpp
UTF-8
880
2.96875
3
[]
no_license
// training005.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; // Se citeste n. Apoi un sir de n nr. Sa se spuna daca in sir exista // sau nu cel putin nr prim. int main() { int n, m, p, o, d, c; // n e nr de nr din sir // m retine nr de...
true
2b2ceb2d7b0304d05e48c955fa02995e6b599333
C++
raghuteja/DataStructures-Algorithms
/BinarySearchTree/BinarySearchTree.h
UTF-8
1,201
2.75
3
[]
no_license
/* * BinarySearchTree.h * * Created on: Jul 11, 2013 * Author: RAGHUTEJA */ #ifndef BINARYSEARCHTREE_H_ #define BINARYSEARCHTREE_H_ #include <iostream> #include <cstdlib> #include <queue> #include "BinarySearchTreeNode.h" using namespace std; class BinarySearchTree { private: BinarySearchTreenodePtr ro...
true
bcc092478794d78b18f94fc94f38cda109538045
C++
YashxD/self-balancing-robot
/test_Programms/pid_tuning/pid_tuning_RemoteController/pid_tuning_RemoteController.ino
UTF-8
6,472
2.546875
3
[]
no_license
/* Two Wheel Balancing Robot Project - Test Program - PID Tuning Author: Jichun Qu Date: 07.2017 Library Version: LiquidCrystal - 1.0.5 RF24 - 1.3.0 PID parameters are sent via NRF24L01+ module. Four pushbuttons are used to adjust two parameters. Robot's angle is sent via NRF24L01+ mod...
true
93ccef37417ad2d4694f3c0d5366a46d99da208b
C++
seckcoder/lang-learn
/algo/iterator/tree_iter.cc
UTF-8
4,088
3.25
3
[ "Unlicense" ]
permissive
#include "../base.h" void preOrder(const TreeNode *root, vector<int> &trav) { vector<const TreeNode *> ts; trav.clear(); ts.push_back(root); while (!ts.empty()) { const TreeNode *r = ts.back(); ts.pop_back(); if (r) { ts.push_back(r->right); ts.push_back(r->left); trav.push_bac...
true
f6915e38da0ddf774343db31b8d5d15dbe315524
C++
NathanAamodt50/DataStructures
/Data Structures/AamodtA4/Queue.h
UTF-8
438
2.96875
3
[]
no_license
#ifndef _QUEUE_H const int STRING_SIZE = 10; typedef char Element [ STRING_SIZE + 1]; class Queue { public: Queue(); Queue(Queue &); ~Queue(); void enqueue( const Element); void dequeue( Element); void view(); private: struct QNode; typedef QNode * QNodePtr; struct ...
true
21e07a8cc7d292d78c50a7eff33857d520c98b5e
C++
atakanakbulut/30DaysOfCode
/Day2/queueX.h
UTF-8
650
3.40625
3
[]
no_license
#include <iostream> #include <queue> template <typename T, class Q = std::queue<T>> class queueX { public: void push(T&& o) { queue.push(std::move(o)); } const T& top() { return private_top(queue); } private: Q queue; te...
true
5064de3a12ed237af01cca8340b6255adf53e404
C++
ohnoitsalobo/platformio
/ESP32/panelDisplay/src/FFT.ino
UTF-8
2,645
2.53125
3
[]
no_license
#define LeftPin 36 #define RightPin 39 #define samples 512 // must ALWAYS be a power of 2 #define samplingFrequency 12500 // 25000 #define noise 1500 #define MAX 40000 #define max_max MAX #define max_min MAX/5 #define min_max noise #define min_min noise/5 unsigned int sampling_period_us; unsigned long microseconds;...
true
cc00993bcf83e8006c6212ee4043cd391020d813
C++
ConnorDY/Super-Free-Ghosts
/Platformer/weapondrop.h
UTF-8
713
2.578125
3
[]
no_license
#ifndef WEAPONDROP_H #define WEAPONDROP_H #include <SFML/Graphics/Rect.hpp> #include <SFML/Graphics/Sprite.hpp> #include <vector> #include "globals.h" #include "object.h" #include "weapons/player_weapon.h" class WeaponDrop : public Object { private: sf::Sprite innerGlow, outerGlow; DEBUG(sf::RectangleShape rect;...
true
d9ab485a9ffeafe12062159a44a97b5d6b2c289a
C++
Thomas-X/arduino
/stepmotor-28byj-48/stepmotor-28byj-48.ino
UTF-8
661
2.765625
3
[]
no_license
#include <AccelStepper.h> #define HALFSTEP 8 // Motor pin definitions #define motorPin1 8 #define motorPin2 9 #define motorPin3 10 #define motorPin4 11 // Initialize with pin sequence IN1-IN3-IN2-IN4 for using the AccelStepper with 28BYJ-48 AccelStepper stepper1(HALFSTEP, motorPin1, motorPin3, motorPin2, mo...
true
7184fb81ff2065ecfe9ca65c0156fb976d0bb67a
C++
yszc-wy/learn_np
/train/Mutex.h
UTF-8
805
2.65625
3
[]
no_license
/* * Author: * Encoding: utf-8 * Description: */ #pragma once // C系统库头文件 #include <pthread.h> // C++系统库头文件 // 第三方库头文件 // 本项目头文件 namespace train { class MutexLock { public: MutexLock() { pthread_mutex_init(&mutex_,NULL); } ~MutexLock() { pthread_mutex_destroy(&mutex_); }...
true
56fcfa6490082c893bde465962843912ef274444
C++
arajajyothibabu/C
/Delete_N_nodes_after_M_nodes.cpp
UTF-8
3,713
3.125
3
[]
no_license
#include<stdio.h> #include<conio.h> #include<stdlib.h> #pragma warning(disable:4996) struct test { char input[30]; int l1; int M; int N; int output[30]; int l; }test[8] = { {"1,2,3,4,5",9,3,1,{1,2,3,5},4}, {"1,2,3",5,4,2,{1,2,3},3}, {"23,45,67",8,3,3,{23,45,67},3}, {"1,2,3,4",7,1,1,{1,3},1}, {"-23,-56,-34,1...
true
7a4b20144a559fe990795b1a368596511cbb8ee4
C++
SudhanshuSingh100/Diary_rogram
/DupliIn_Array.cpp
UTF-8
517
3.375
3
[]
no_license
#include<iostream> using namespace std; int arrayConsecutiveDuplicate(int a[],int n) { if(n==0 || n==1) return n; int temp[n]; int j=0; for(int i=0;i <n-1;i++) { if(a[i] != a[i+1]) temp[j++]=a[i]; } temp[j++]=a[n-1]; for(int i=0;i<j ;i++) { a[i] = temp[i]; } ...
true
489ed687933b22123d8d197ee99bc72030bdec1c
C++
rahul-badgujar/My-Coursera-Codes
/Data Structures and Algorithms Specialization/C2 Data Structures/DS Implementations/AVL with Merge.cpp
UTF-8
11,124
3.25
3
[]
no_license
#include <iostream> #include <string> #include <vector> #include <cstring> #define deb(x) cout << #x << " : " << x << '\n' #define logn(x) cout << x << '\n' #define logs(x) cout << x << ' ' #define log(x) cout << x #define MOD 1000000007 #define uInt unsigned long long int #define Int long long int using namespace std...
true
aa32709f82ae2bad37a01b040dca2a570e0b49e3
C++
md-jamal/arm
/C_NOTES/5c++/1st/code/24reference.cpp
UTF-8
1,139
4.25
4
[]
no_license
#include <iostream> using namespace std; //引用 int main(void) { int a = 3; //注意: 在上述声明中,&是引用声明符,并不代表地址。不要理解为“把a的值赋给b的地址”。声明变量b为引用类型,并不需要另外开辟内存单元来存放b的值。b和a占内存中的同一个存储单元,它们具有同一地址。声明b是a的引用,可以理解为: 使变量b具有变量a的地址。见图6.26,如果a的值是20,则b的值也是20。 //定义引用b 指向a b是a的别名 int &b = a; //在声明一个引用类型变量时,必须同时使之...
true
6e7bbedad891d0dc1d7dc550c0beae518d578343
C++
ElitCoder/EDA031
/lab1/list.cc
UTF-8
1,597
3.859375
4
[]
no_license
#include <iostream> #include "list.h" List::List() : first(nullptr) { } List::~List() { Node *current = first; while(current != nullptr) { Node *next = current->next; delete current; current = next; } } bool List::exists(int d) const { Node *current = first; while(current != nullptr) { if(current->v...
true
08d69d8332066f8cfc93d0d3d78f5b5514039102
C++
dpariag/leetcode
/edit_distance.cpp
UTF-8
2,377
3.640625
4
[]
no_license
// Leetcode: https://leetcode.com/problems/edit-distance/description/ // Given two words, find the minimum number of edits (insert/delete/substitute) required to // convert word1 to word2. // Brute Force: Recursively edit each position in word1, stopping at word2. Exponential time. // Better: Compute the Levenshtein ...
true
deaf19812730fbb3c1de3e5380c682a1a294814e
C++
DongJunK/Algorithm
/boj/2156.cpp
UTF-8
647
2.75
3
[]
no_license
#include <iostream> #include <algorithm> using namespace std; int arr[10001]; int dp[10001][3]; int solution(int n) { dp[0][0] = arr[0]; dp[0][1] = arr[0]; int maxValue = dp[0][0]; if(1<=n) { dp[1][0] = arr[1]; dp[1][1] = arr[0]+arr[1]; maxValue = dp[1][1]; } for(int i=2;i<n;++i) { dp[i][0] = arr[i] + ...
true
19f643cc6ea52d346e9411b2ff278a5b8170bc73
C++
tktk2104/TktkLib
/TktkGameProcessLib/TktkAppend2DComponentLib/src/TktkAppend2DComponent/RectColliderExtrusion.cpp
SHIFT_JIS
5,451
2.578125
3
[]
no_license
#include "TktkAppend2DComponent/RectColliderExtrusion.h" #include <limits.h> #include <TktkMath/MathHelper.h> #include <Tktk2dCollision/Body2dBase/Body2dBase.h> #include <Tktk2dCollision/BoundingPolygon2d.h> namespace tktk { void RectColliderExtrusion::onCollisionStay(CfpPtr<GameObject> other) { auto otherTransfo...
true
2d6a64ab7d501e9d1ed9d52cfd4688dd887af3c0
C++
protasov-ilja/OOP
/lab6/HttpUrl/CUrlParsingError.h
UTF-8
222
2.78125
3
[]
no_license
#pragma once #include <stdexcept> class CUrlParsingError : public std::invalid_argument { public: CUrlParsingError(const std::string& message); std::string GetMessage() const; private: std::string m_error_message; };
true
93255af1ef7171d0e41e5582b540edb015a2c4b0
C++
SamueleMeta/videogame-cpp
/Strategy.cpp
UTF-8
36,133
2.8125
3
[]
no_license
#include "Strategy.h" void Strategy::EnemyAttack(std::vector<Mob> &enemies, sf::Time &elapsedAngry, sf::Clock &clockAngry, Projectile &projectile, Hero &hero, sf::Sound &soundShot, std::vector<Projectile> &projectileArray) { // Angry enemies int angryCount...
true
18423b7bd487098774b72ca7f42ea9fcf7ae16e4
C++
NightPlow/Zappy
/Graphical/GraphicalAPI/includes/Team.hpp
UTF-8
937
2.734375
3
[]
no_license
/* ** EPITECH PROJECT, 2019 ** Team.hpp ** File description: ** Team header */ #pragma once #include "Player.hpp" #include <vector> #include <memory> #include <list> namespace zapi { class Team { public: Team(unsigned int width, unsigned int height, const std::string &name = "trash"); ...
true
5bbd3dc666b2e8250ec09710ab1ebf1674ff4591
C++
4drama/obj_loader
/mtl_loader.cpp
UTF-8
7,467
2.625
3
[]
no_license
#include "mtl_loader.hpp" #include <fstream> #include <istream> #include <sstream> #include <stdexcept> #include <iostream> namespace{ void material_parser( std::map<std::string, objl::mtl> &materials, std::fstream &mtl_file, std::string &cmd); } std::map<std::string, objl::mtl> obj...
true
06f46143e88b43d0ae731853ef8d82f277d90965
C++
tlgman/WarsMaster
/WarsMaster/CollisionManager.h
ISO-8859-1
330
2.609375
3
[]
no_license
#pragma once #include <vector> #include "InteractEntity.h" class CollisionManager { public: CollisionManager(); /** * Ajout d'une entit la liste des entits sur lesquelles il faut vrifier les collisions */ void add(InteractEntity* entity); ~CollisionManager(); private: std::vector<InteractEntity*> entities; };...
true
9f42c133bf01f8f5266b58fa881ecbedb54a90f1
C++
dothithuy/ElastosRDK5_0
/Sources/Elastos/LibCore/src/elastos/math/CMathContext.cpp
UTF-8
1,781
2.734375
3
[]
no_license
#include "cmdef.h" #include "CMathContext.h" namespace Elastos { namespace Math { static AutoPtr<IMathContext> CreateMathContext(Int32 p, RoundingMode mode) { AutoPtr<CMathContext> obj; CMathContext::NewByFriend(p, mode, (CMathContext**)&obj); return (IMathContext*)obj.Get(); } const AutoPtr<IMathContex...
true
010a1dbb3f78dc1c0173ffc55bbec16aa0f05eb7
C++
pranav1698/algorithms_implementation
/Greedy-Problems/activity_selection.cpp
UTF-8
781
3.25
3
[]
no_license
// Good Greedy Problem #include<bits/stdc++.h> using namespace std; int getNoOfActivities(vector<pair<int,int>> pairs){ int start=pairs[0].first; int finish=pairs[0].second; int count=1; for(int i=0; i<pairs.size(); i++){ //cout << finish << endl; if(finish <= pairs[i+1].first){ count++; finish=pairs[i+1...
true
cb42f26ba37676fe49e892a545f7141530aeae66
C++
personne13/vtt
/td1/readwriteshow.cpp
UTF-8
1,055
2.78125
3
[]
no_license
#include <iostream> #include <cstdlib> #include <opencv2/opencv.hpp> using namespace cv; using namespace std; #define WIDTH_OUT_IMG 200 #define HEIGHT_OUT_IMG 100 void process(const char* imsname, const char* imdname) { Mat image_src; image_src = imread(imsname, CV_LOAD_IMAGE_COLOR); if(!image_src.data){ ...
true
0de6ce0cb8d6da8cb123bbbb59ae149a373fb4e0
C++
GaelGuegan/project_euler
/src/problem_24/problem_24.cpp
UTF-8
2,105
3.28125
3
[]
no_license
/************************************************************************* * Copyright (c) 2022 Gael GUEGAN. All rights reserved. * * The computer program contained herein contains proprietary information * which is the property of Me. * The program may be used and/or copied only with the written permission * of ...
true
42af397e79dd764f14567124187826647e90c102
C++
youtube/cobalt
/third_party/llvm-project/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-templated-cxx.cpp
UTF-8
2,086
2.8125
3
[ "NCSA", "MIT", "LLVM-exception", "Apache-2.0", "BSD-3-Clause", "GPL-1.0-or-later", "LGPL-2.0-or-later" ]
permissive
// UNSUPPORTED: ios // RUN: %clangxx_asan -O0 -g %s -o %t.executable // RUN: %env_asan_opts="symbolize=0" not %run %t.executable > %t_no_module_map.log 2>&1 // RUN: %asan_symbolize --force-system-symbolizer < %t_no_module_map.log 2>&1 | FileCheck %s #include <cassert> #include <cstdio> #include <cstdlib> #include <func...
true
de519ebc2dd0c99d5e396dc5516c4e848c100499
C++
h3xu588/Asteroids
/Documents/Visual Studio 2015/Projects/Asteroids/Asteroids/ship.h
UTF-8
690
2.71875
3
[]
no_license
#ifndef ship_h #define ship_h #define _USE_MATH_DEFINES #include <cmath> #include "flyingObject.h" #include "uiDraw.h" #define SHIP_SIZE 10 #define ROTATE_AMOUNT 6 #define THRUST_AMOUNT 0.5 class Ship : public FlyingObject { private: bool thrust; int angle; float aDX; float aDY; public: Ship() {}; Ship(Point ...
true
c0e590485ca0fc7f0c6a5776e53e307ba367c1e6
C++
grace915/creativeSoftwarePrograming
/hw8-1/rectangle.cpp
UTF-8
592
3.421875
3
[]
no_license
#include "rectangle.h" Rectangle::Rectangle(int width, int height) { this->width = width; this->height = height; } int Rectangle::getArea() { return width * height; } int Rectangle::getPerimeter() { return 2 * (width + height); } void Square::print() { cout << width << "x" << width << " Square" << endl;...
true
c162db82d2dbbdf9270be950c190c6d689b19971
C++
MikamiTetsuro365/Atcoder
/JOI/2012/C.cpp
UTF-8
1,285
2.53125
3
[]
no_license
#include "bits/stdc++.h" using namespace std; typedef long long int ll; int main(){ ll N; cin >> N; ll A, B; cin >> A >> B; //ピザのカロリー ll pizza_k; cin >> pizza_k; //トッピングのカロリー vector<pair<ll, ll > > t; t.push_back(make_pair(0, 0)); for(ll i = 0; i < N; i++){ ll in; ...
true
c597245abdf3f01139bc2aee44222735c883eb57
C++
punkproger/Project-Euler
/Problem 95/main.cpp
UTF-8
2,028
3.03125
3
[]
no_license
#include <iostream> #include <vector> #include <set> #include <cmath> #include <string.h> using namespace std; vector<unsigned long> get_primes(unsigned long max); constexpr size_t size{1000000}; unsigned long divisors_sum[size] = {0}; vector<unsigned long> primes{get_primes(size)}; const size_t prime_size = primes...
true
a5b353f459973fb2d85f8fa5b75ecfe8bbe80763
C++
Cplo/leetcode
/leetcode153_154/findMin.cpp
UTF-8
882
2.9375
3
[]
no_license
#include<iostream> #include<vector> #include<string> #include<string.h> #include<algorithm> #include<map> #include<float.h> #include<stack> #include<math.h> #include<queue> #include<unordered_set> using namespace std; //Definition for singly-linked list. struct ListNode { int val; ListNode *next; ListNode...
true
bd04f502a63d0c63235c67e45578ccaaaaa29f93
C++
kashyap99saksham/SDE_Solutions
/ARRAY/DAY 2/12 Maximum Index.cpp
UTF-8
813
3.640625
4
[]
no_license
// Problem Description: Given an array A of integers, find the maximum of j - i subjected to the constraint of A[i] <= A[j]. // Time complexity : O(n) Space Complexity : O(n) // We used two arrays leftmin ans rightmax // and calculate maximum difference of j-i int Solution::maximumGap(const vector<int> &A) { in...
true
f575dce72d2ffc726fe7d2ae6539b50c219ff4aa
C++
abeir/syberide-plugin
/tools/sdk-manager/common/parserfile.cpp
UTF-8
4,801
2.90625
3
[]
no_license
#include "parserfile.h" #include<QDomElement> #include<QDomDocument> #include<QDomNodeList> #include<QDebug> #include<QFile> static const QLatin1String SDKName("SDKName"); static const QLatin1String Targets("Targets"); static const QLatin1String Name("Name"); static const QLatin1String archName("archName"); static co...
true
fcf504aec74336842516780b3a5af3853056a780
C++
gaoliang5813/vbcplusfrombuck
/vbcService/include/TCPConnection.h
UTF-8
585
2.546875
3
[]
no_license
// // Created by joey on 12/27/20. // #ifndef VBCSERVICE_TCPCONNECTION_H #define VBCSERVICE_TCPCONNECTION_H #include <string> #include "Logger.h" using namespace std; class TCPConnection{ public: TCPConnection(); ~TCPConnection(); int connectWithTCP(string deviceIP, int devicePort); int sendCommand(const char* ...
true
d9c00180954e3baa0d3763fbb01288bd769ed2db
C++
psalios/Bloomberg-CodeCon-Finals-2016
/OptimalWordFinder.cpp
UTF-8
757
2.578125
3
[ "MIT" ]
permissive
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<vector> #include<set> #include<map> #include<queue> #include<stack> #include<string> #include<cmath> using namespace std; vector<pair<int,char> >table; int vis[100]; int main(){ char c; while( cin>>c ){ int value; cin>>value; ...
true
864b7dc85e7b44fa1499dcaee5dce0d03708b59c
C++
poorpy/pamsi
/jakdojade/inc/graph.hpp
UTF-8
2,193
3.375
3
[]
no_license
/** \file * File contains definitions for classes Vertex and Graph * \author Bartosz Marczyński */ #pragma once #include <map> #include <list> #include <iterator> #include <algorithm> #include <tuple> typedef unsigned int id_t; typedef unsigned int weight; typedef std::tuple<id_t, id_t, weight> edge; class Vert...
true
9437723aef40855053756513747159673eb27a4f
C++
richnakasato/lc
/790.domino-and-tromino-tiling.cpp
UTF-8
1,098
3.21875
3
[]
no_license
/* * [806] Domino and Tromino Tiling * * https://leetcode.com/problems/domino-and-tromino-tiling/description/ * * algorithms * Medium (34.42%) * Total Accepted: 6K * Total Submissions: 17.4K * Testcase Example: '3' * * We have two types of tiles: a 2x1 domino shape, and an "L" tromino shape. * These sha...
true
f67bf6c0b9bc7e8216555db5e5bdeede456791f7
C++
KeyMaster5899/Assignment5-python-
/python1/include/Math/Plane.h
UTF-8
498
2.5625
3
[]
no_license
#ifndef _A3MLPLN_ #define _A3MLPLN_ #include "Vector3.h" #include "Rectangle.h" #include "Circle.h" #include "Ray.h" class Plane { public: float a,b,c,d; Plane():a(0),b(0),c(0),d(0){} Plane(float aa, float ab, float ac, float ad):a(aa),b(ab),c(ac),d(ad){} void Create(Vector3 &t1, Vector3 &t2, Vector3 &t3); bool...
true
4ceffe96a04cd5aa080336f459d965215762769c
C++
yataw/folio
/C++/mccme/problem_652.cpp
UTF-8
1,577
2.59375
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <stack> #include <string> #include <list> #include <limits.h> #include <cmath> #include <climits> using namespace std; void dfs(pair<int, int> v, pair<int, int> parent, vector<vector<int>>& G, vector<vector<int>>& used) { int M = G...
true
3d0bb4055118d58925a35e1119f221ee1a29d39c
C++
sunshadown/Ashes
/source/Ashes/D3D11Renderer/Src/Buffer/D3D11Buffer.hpp
UTF-8
671
2.515625
3
[ "MIT" ]
permissive
/** *\file * RenderingResources.h *\author * Sylvain Doremus */ #ifndef ___D3D11Renderer_Buffer_HPP___ #define ___D3D11Renderer_Buffer_HPP___ #pragma once #include "D3D11RendererPrerequisites.hpp" #include <Buffer/Buffer.hpp> namespace d3d11_renderer { class Buffer : public ashes::BufferBase { public: Buffer(...
true
35ba45567999ae41381cbf4c4baa3d6b8d1a9871
C++
goyalrahul310/Data-Structure
/Trie/maxxorsubarray.cpp
UTF-8
1,408
3.53125
4
[]
no_license
#include<iostream> #include<vector> #include<unordered_map> #include<cmath> using namespace std ; class trie{ public: trie* left ; trie* right ; } ; void ele(vector<int> &element,int *a,int n){ int x = a[0]; element.push_back(a[0]) ; for(int i = 1 ; i < n; i++){ x ^= a[i] ; element.push_back(x) ; }...
true
5137acc3d32ce43c8c38bb915609dde43bc1b5ea
C++
anhducpn67/Game_Pacman
/renderGame.cpp
UTF-8
3,137
2.65625
3
[]
no_license
#include "renderGame.h" #include "externVariables.h" #include "creatWallandPoint.h" void RenderGame() { //Clear screen SDL_SetRenderDrawColor(gRenderer, 0, 0, 0, 255); SDL_RenderClear(gRenderer); //Render walls for (int i = 1; i <= NUMBER_WALLS; i++) SDL_RenderDrawRect(gRenderer, &walls[i...
true
e0d669318791812b7d4d5553c27c5ab5f6285ece
C++
DemingYan/cs110b
/BSearch/bst.cpp
UTF-8
7,163
3.65625
4
[]
no_license
/* Author: Kevin Morris Assignment 3: Number Guesser This program guesses numbers in a both psuedo random and standard binary fashion. The user thinks of a number between 1-100, and the program attempts to find out what it is. The extra credit part of this program was not implemented with the getRando...
true
d10bd6ca23aaaee0100a1fc7347cc9d3703d0998
C++
Rahul-111/Competitivecode
/unique.cpp
UTF-8
547
3.4375
3
[]
no_license
#include<iostream> using namespace std; int main() { int test; cin>>test; while(test--) { int n; cin>>n; int arr[n]; for(int i=0;i<n;i++) cin>>arr[i]; int count=0; for (int i=0; i<n; i++) { // Check if the picked element is already printed int j; for (...
true
8d4c45a82567e0c92b042a5001940ff82f2e7501
C++
FranklinLiao/undergraduate
/GProjectDemo2/src/ANR/UserANR.h
GB18030
3,298
2.53125
3
[]
no_license
#ifndef _USERANR_H #define _USERANR_H #include "stdafx.h" #include "stdlib.h" #include "time.h" #include "User.h" #include "CreateSqlTool.h" #include "DBHelper.h" //A3¼ֵ // 4db //ƫ 0-6db #define HYST 4 //Ͳ #define CELLOFFSET 2 //ƫò #define TIMELAST 2 #define TIMELASTCMP 3 #define AREARSRPGATE -90 //A2¼ Сźŵƽijһֵ ˴...
true
bc848f3f73188de78d21ca596d46a7f0a10bb7b5
C++
15831944/job_mobile
/lib/lib_mech/src/tool/restarter/tool_command_util.cpp
UTF-8
2,971
2.515625
3
[]
no_license
#include "stdafx.h" #include <psapi.h> #pragma comment(lib, "Psapi.lib") bool Is_Exist(cstr sz) { FILE* fp = jt_fopen(sz,_T("r") ); if(!fp) return false; fclose(fp); return true; } #include "header/jBoost.h" #include <io.h> void for_each_folder( tcstr szPath,for_each_folder_function_t* func ,void* v) { name...
true
224b25c31266818313b8086b4f87d1f79dc9d2ad
C++
LaCulotte/chinko_bot
/std_bot/messaging/connectionMessages/ConnectionIdGetMessage.h
UTF-8
1,209
3
3
[]
no_license
#ifndef CONNECTIONID_GET_MESSAGE #define CONNECTIONID_GET_MESSAGE #include "Message.h" #include "Connection.h" #include <functional> // Asks the ConnectionUnit to get the id of one or multiple connections class ConnectionIdGetMessage : public Message { public: // Contructor ConnectionIdGetMessage() {}; //...
true
5474cf8152702ab9ec02adea00637c1c2615ce23
C++
ShazimC/LED-Dice
/LED Dice/LED_Dice/LED_Dice.ino
UTF-8
1,683
2.859375
3
[]
no_license
int leftTwo = 7; int midTwo = 6; int rightTwo = 5; int redOne = 3; int button = 13; int input; int r; void setup() { // put your setup code here, to run once: pinMode(leftTwo, OUTPUT); pinMode(midTwo, OUTPUT); pinMode(rightTwo, OUTPUT); pinMode(redOne, OUTPUT); pinMode(button, INPUT); randomSeed(analogR...
true
1fb3c06b5543ff3f97a022c545c7c353003bd180
C++
praveen4698/competitiveProgrammingWithCpp
/college/bfs mine.cpp
UTF-8
1,856
3.609375
4
[]
no_license
#include<iostream> #include<vector> #include<list> #include<utility> #include<limits> using namespace std; class Graph{ int n; vector<int> *g; int *distance; int *parent; public: Graph(int n); void addedge(int u,int v); vo...
true
1bee3681ac388fd683f8118cffebe95a41962234
C++
kegarlv/DPLDC
/chartviewer.cpp
UTF-8
2,657
2.515625
3
[]
no_license
#include "chartviewer.h" ChartViewer::ChartViewer(const QVector<double> &activeData, const QVector<double> &reactiveData, QWidget *parent) : QWidget(parent) { m_activeSeries = new QtCharts::QLineSeries(this); m_reactiveSeries = new QtCharts::QLineSeries(this); QVector<double> activeDiff, reactiveDiff; ...
true
85e22c42587c770ecd2f9ff2be13d550db61d57b
C++
andrejr95/LP1-2020.5
/aula02/main.cpp
UTF-8
241
3.03125
3
[]
no_license
#include <iostream> #include <string> int main(int argc, char *argv[]) { if (argc == 1) { std::cout << "Uso: " << argv[0] << " <nome>" << std::endl; return -1; } std::cout << "Olá, " << argv[1] << std::endl; return 0; }
true
71c2b6be5b9aa678c2e942c54d6e304a28194ef4
C++
Hjok/MeetingUT
/touredition.h
UTF-8
693
2.71875
3
[]
no_license
#ifndef TOUREDITION_H #define TOUREDITION_H #include <QWidget> #include <QLineEdit> #include <QPushButton> namespace Ui { class TourEdition; } /*! * \brief La classe TourEdition permet d'éditer le nombre de tours du problème */ class TourEdition : public QWidget { Q_OBJECT public: explicit TourEdition(QWid...
true
46832d35fd905b00c21448e47e133fd101fa0fb2
C++
wittyResry/topcoder
/SRM 706/MovingCandies.cpp
UTF-8
4,468
2.734375
3
[ "Apache-2.0" ]
permissive
#include <cstdio> #include <cmath> #include <cstring> #include <ctime> #include <iostream> #include <algorithm> #include <set> #include <vector> #include <sstream> #include <typeinfo> #include <fstream> using namespace std; const int N = 25; int a[N][N]; struct node{ int x, y; int deep; int cost; node(...
true
b3039c6d43f4548bdaa24dc64bae6632a577f21c
C++
nlarosa/CPlusPlusProgramming
/MortgageCalculator/mortgage.cpp
UTF-8
5,098
3.625
4
[]
no_license
// Nicholas LaRosa // CSE 20212, Lab 0 // // Implementation for our Mortgage class #include <iostream> #include <iomanip> #include "mortgage.h" // includes Mortgage interface #define STD_PRINCIPAL 100000 #define STD_RATE 5 #define STD_PAYMENT 5000 using namespace std; Mortgage::Mortgage() // default const...
true
94c0a8b3115fd37a80a33ea08bd39946ac179d2a
C++
MisterrW/opengl-tutorial
/CanvasVectors/GenericModel.cpp
UTF-8
6,707
3.046875
3
[]
no_license
#include "GenericModel.h" std::vector<std::vector<glm::vec3>> GenericModel::GetNormals(std::vector<std::vector<glm::vec3>> vertexArrays, GLenum renderFormat) { std::vector<std::vector<glm::vec3>> normalsArrays = std::vector<std::vector<glm::vec3>>(); if (renderFormat == GL_TRIANGLES) { } else if (renderFormat == ...
true
78d0f449e050b1ea81963dda876a30cec712a6b7
C++
luqian2017/Algorithm
/LintCode/1678_Train-compartment-problem/1678_Train-compartment-problem.cpp
UTF-8
683
3.25
3
[]
no_license
class Solution { public: /** * @param arr: the arr * @return: the number of train carriages in this transfer station with the largest number of train carriages */ int trainCompartmentProblem(vector<int> &arr) { int n = arr.size(); if (n == 0) return 0; stack<int> st; i...
true
eda02bdc800493156ff8ef3048400bef0539ca74
C++
a-gridnev/ReIGen
/src/Curve_Koch.hpp
UTF-8
869
2.90625
3
[ "MIT" ]
permissive
#ifndef CURVE_KOCH_HPP #define CURVE_KOCH_HPP #include "Curve.hpp" #include "Constants.hpp" class Curve_Koch: public Curve { public: enum class Base{ LINE, TRIANGLE, SQUARE }; private: float m_angle = 60; sf::RenderTexture m_texture; sf::Sprite m_sprite; Base m_base = Base::LINE; ...
true
a6661fac9385e72a9748ddb8ec36050bc79ec2b4
C++
thirty30/UDPBattle
/TMuffin/ShaderHelper/CShaderHelper.cpp
UTF-8
3,320
2.546875
3
[]
no_license
#include "pch.h" tbool CShader::GenerateShaderID() { switch (this->m_eShaderType) { case E_SHADER_TYPE_VERTEX: { this->m_nOpenGLID = glCreateShader(GL_VERTEX_SHADER); } break; case E_SHADER_TYPE_FRAGMENT: { this->m_nOpenGLID = glCreateShader(GL_FRAGMENT_SHADER); } break; default: { return false; } ...
true
d3c28062b455256b2f9fa0d9cfc3d0ade3d1e784
C++
boa9448/InputUtil
/libs/input_util.h
UTF-8
5,041
2.796875
3
[ "MIT" ]
permissive
#pragma once #include <Windows.h> #include <iostream> #include <vector> namespace utils { namespace input { const INT SERIAL_WAIT_TIME = 2000; class Serial { private: //Serial comm handler HANDLE m_hSerial; //Connection status BOOL m_bConnected; //Get various information about the connection ...
true
9b73845c12785dc7890b9f58725100089f562d48
C++
jrl-umi3218/tvm
/include/tvm/constraint/internal/LinearizedTaskConstraint.h
UTF-8
5,648
2.546875
3
[ "BSD-3-Clause" ]
permissive
/** Copyright 2017-2020 CNRS-AIST JRL and CNRS-UM LIRMM */ #pragma once #include <tvm/Task.h> #include <tvm/constraint/abstract/LinearConstraint.h> #include <tvm/utils/ProtoTask.h> namespace tvm { namespace constraint { namespace internal { /** Given a task \f$(e, op, rhs, e^*)\f$, this class derives the constrai...
true
d7671f4ae62fafa5b318db15a1682977c9bddf02
C++
freechw/LiteFifo
/examples/simple_queue/simple_queue.ino
UTF-8
1,239
3.65625
4
[]
no_license
#include <lite_fifo.h> /* Simple example of a queue with 32 elements */ /* user defined data struct to be inserted into queue */ typedef struct { uint16_t x; uint16_t y; } Point; #define QUEUE_LEN 32 /* backing storage for the queue */ Point buffer[QUEUE_LEN]; /* create FIFO and point to the storage...
true
4acb66316e7e9185f7a01fc9cda8500ac35e4172
C++
wangdschina/sword_finger_offer
/14_ReorderOddEven.cpp
UTF-8
1,810
4.15625
4
[]
no_license
//概述:调整数组顺序使奇数位于偶数前面 //题目:输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有奇数位于数组的前半部分,所有偶数位于数组的后半部分。 //解题:俩指针,前后扫描数组,前边的指针移动到偶数,后边的指针移动到奇数,然后交换,继续移动。 //时间复杂度:O(n) // it's me. void ReorderOddEven(int* pData, int length) { if (nullptr == pData || length <= 0) return; int* pStart = pData; int* pEnd = pData + lengt...
true
e26430e25769e577b85d6b8f748df5b910f0a2d8
C++
hiibs/Leka3D
/src/PointLight.cpp
UTF-8
273
2.53125
3
[ "MIT" ]
permissive
#include "PointLight.h" #include "Scene.h" PointLight::PointLight(Scene* scene) : Object(scene), intensity(1.f), color(glm::vec3(1.f)), radius(10.f) { name = "Point Light"; scene->addPointLight(this); } PointLight::~PointLight() { scene->removePointLight(this); }
true
fca23324dbd0fbc5fd39625d6961652fe6288704
C++
Jaxan/hybrid-ads
/lib/test_suite.hpp
UTF-8
1,604
2.6875
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
#pragma once #include "mealy.hpp" #include "separating_family.hpp" #include "transfer_sequences.hpp" #include "types.hpp" #include <functional> #include <vector> struct writer { std::function<void(word)> apply; // store a part of a word std::function<bool(void)> reset; // flush, if flase is returned, testing is st...
true
7a56cc77c2298c3e0526e729633b380b9f89f8e5
C++
errorcodexero/newarch
/old/robots/common/jacispath/Waypoint.h
UTF-8
483
2.734375
3
[]
no_license
#pragma once namespace xero { namespace jacispath { class Waypoint { public: Waypoint() { m_x = 0.0; m_y = 0.0; m_angle = 0.0; } Waypoint(double x, double y, double a) { m_x = x; m_y = y; m_angle = a; } double getX() const { return m_x; } double getY...
true
6a7ec9142e5f200067934e3b62aa72294bd9b3a5
C++
Otrebus/timus
/1485.cpp
UTF-8
3,425
3.390625
3
[]
no_license
/* 1485. Football and Lie - http://acm.timus.ru/problem.aspx?num=1485 * * Strategy: * No pair of entries (i, j) and (j, i) can both be zero, so given the truthiness of some captain * and its according mutation of the row of matrix values, we can create implications about the * truthiness of other captains (see lin...
true
d2699ec60bddd0f656ac20ca4584a68bbc5ebc0b
C++
Kirakise/CPPModules
/CPP05/ex00/Bureaucrat.cpp
UTF-8
1,605
3.28125
3
[]
no_license
#include "Bureaucrat.hpp" Bureaucrat::Bureaucrat(std::string name, int grade) : name(name), grade(grade) { if (this->grade <= 0) throw Bureaucrat::GradeTooHighExp(); else if (grade > 150) throw Bureaucrat::GradeTooLowExp(); } Bureaucrat::Bureaucrat(const Bureaucrat& copy) { if (copy.getGrade...
true
f2f11f7b04328e32c3da37d58f7cab6166fa2d97
C++
JosafatV/FIleSystem
/src/dataStructures/Node/SimpleListNode.h
UTF-8
2,249
3.65625
4
[]
no_license
#ifndef SIMPLELISTNODE_H #define SIMPLELISTNODE_H #include "src/dataStructures/interfaceNode.h" /*! * \brief The SimpleListNode class. A simple list node is the corresponding node to the data structure * "simple linked list". */ template <typename K> class SimpleListNode: public interfaceNode<K> { public: /*! ...
true
2a2cadec9edb1c6a0731928aba6e7df7140b4661
C++
LucyWangs/cpp-games
/tictactoe/tictactoe/main.cpp
UTF-8
1,767
3.234375
3
[]
no_license
// // main.cpp // tictactoe // // Created by Lucy Wang on 1/28/18. // Copyright © 2018 Lucy Wang. All rights reserved. // #include <iostream> #include <cstdlib> #include <stdio.h> #include "tictactoe.cpp" #include "rockpaperscissors.cpp" #include "mastermind.cpp" #include "hangman.cpp" class TicTacToe; class Rock...
true
d6b1053275f83c825e35a233c3614c25e348bc00
C++
Dmitry666/VNet
/VirtualNetworkCommon/MemoryBuffer.h
UTF-8
4,466
2.90625
3
[]
no_license
// Author: Oznabikhin Dmitry // Email: gamexgroup@gmail.com // // Copyright (c) GameX Corporation. All rights reserved. #pragma once #include "Archive.h" #ifndef _MSC_VER #include <string.h> #endif namespace vnet { /** * @brief Memeory buffer. */ class MemoryBuffer { public: MemoryBuffer() : _nbBytes(0) , _...
true
f28da0c8450f8627b517a5cfaac86599e32cdb04
C++
qcscine/database
/src/Database/Database/Objects/ElementaryStep.h
UTF-8
16,650
2.546875
3
[ "BSD-3-Clause" ]
permissive
/** * @file * @copyright This code is licensed under the 3-clause BSD license.\n * Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group.\n * See LICENSE.txt for details. */ #ifndef DATABASE_ELEMENTARYSTEP_H_ #define DATABASE_ELEMENTARYSTEP_H_ /* Internal Include */ #include <...
true
25f37ceadbd4d9b9c92944f721b5f1f83f7212c4
C++
fLindahl/trayracer
/material.h
UTF-8
826
2.734375
3
[]
no_license
#pragma once #include "color.h" #include "ray.h" #include "vec3.h" #include <string> //------------------------------------------------------------------------------ /** */ struct Material { /* type can be "Lambertian", "Dielectric" or "Conductor". Obviously, "lambertian" materials are dielect...
true
ae0c782843446f7a3e36b1a1324b928121fc52bf
C++
BGMer7/LeetCode
/32. Longest Valid Parentheses/longestValidParentheses.cpp
UTF-8
1,031
3.609375
4
[]
no_license
#include <iostream> #include <string> #include <vector> using namespace std; class Solution { public: int longestValidParentheses(string s) { int res = 0, left = 0, right = 0; // left左括号数量,right右括号数量 for (int i(0); i < s.size(); i++) { if (s[i] == '(') left+...
true
28c08c157fd68cd0ff19190a6ee441134ddf4f6f
C++
Dito9/ICPC
/Uva/1237.cpp
UTF-8
1,036
3.171875
3
[ "MIT" ]
permissive
#include <iostream> #include <vector> #include <string> using namespace std; struct Carro { string name; int low; int high; Carro(string n, int l, int h) { name = n; low = l; high = h; } }; int main() { int N, numDB, query, val, cont; cin>>N; while(N--) { vecto...
true
5e28e3f96d4907c65cd510c68d3678a6612513b3
C++
nguyentrisinh/EmployerManagement
/EmployerManagement/Manage.cpp
UTF-8
9,833
2.953125
3
[]
no_license
#include "stdafx.h" #include "Manage.h" void Manage::NhapDepartment() { system("cls"); int departmentCount; cout << "Nhap so phong ban: "; cin >> departmentCount; while (departmentCount <= 0) { cout << "So phong ban phai > 0. Xin vui long nhap lai so phong ban:"; cin >> departmentCount; } cin.ignore(); ...
true
6eb8a4e1f6aaed44428faed95371343006a289cd
C++
paularnav/cs-assignment-4a
/a4q2.cpp
UTF-8
380
3.546875
4
[]
no_license
# cs-assignment-4a #include <iostream> using namespace std; void diameter(int a) {cout<<"\nThe diameter is "<<2*a;} void area(int b) {float c; c=3.14*b*b; cout<<"\nThe area is "<<c;} void circumference(int a) {cout<<"\nThe circumference is "<<2*3.14*a; } int main() { int r; cout<<"Enter the value of radius "; cin>>r...
true
ca4ae13ffcca0717389f337df3326f7b4e894c76
C++
diegodc/algoritmo-id3
/src/CargadorDeClientes.h
UTF-8
1,358
3.265625
3
[]
no_license
/** * CargadorDeClientes.h * * Autor: * Diego De Cristofano **/ #ifndef CARGADORDECLIENTES_H_ #define CARGADORDECLIENTES_H_ #include "Cliente.h" #include "Lista.h" #include <string> /** * CargadorDeClientes genera una lista de Clientes, creandolos * a partir del archivo CSV donde estan conteni...
true
f0f1720169762eb4cb8ed62f3c514ec70221046b
C++
JcBaze/1063-DS-Baze
/Practice/Exam Reviews/Final/Stack-LIFO.cpp
UTF-8
452
3.484375
3
[]
no_license
struct Node { int Data; Node *Next; Node(int x) { Data = x; Next = NULL; } }; class list { private: Node *Top; public: list() { Top = NULL; } void Push(int x) { Node *temp = new Node(x); if (Top == NULL) Top = temp; else { temp->Next = Top; Top = temp; } } int Pop() { if ...
true
c70756c5d765df281c2f5dc34e7ecfe6e0380f05
C++
Boryusik/SmartHome
/work/advcpp/sharedPtr/Counter.cpp
UTF-8
875
3.171875
3
[]
no_license
#include "Counter.h" namespace advcpp{ Counter::Counter(size_t a_val) :m_val(a_val) { } Counter::Counter(Counter const& _other) :m_val(_other.m_val) { } Counter::~Counter() { } Counter& Counter::operator++() { __sync_add_and_fetch (&m_val, 1); return *this; } Counter Counter::operator++ (int ) { ...
true
2c4a24cd77e75777c7f34e6defb42f17ffd75e1f
C++
OdearOgy/Polytech-cpp-exam-preparation
/n249.cpp
UTF-8
428
3.203125
3
[]
no_license
#include <iostream> #include <string> #include <cmath> int main() { int n, k, number_count = 0; float num[1000]; std::cout << "Enter the numbers of data: "; std::cin >> n; std::cout << "Enter thenumber of your preference: "; std::cin >> k; for (int i = 0; i < n; i++) { if (i % k == 0) { numbe...
true
7cf2868a9398bb06998e542c25a079d29b1428ae
C++
stefolog/fmi-sdp2015
/templates/compression.cpp
UTF-8
1,953
3.125
3
[]
no_license
#include <iostream> #include <cstring> #include <fstream> #include "stack.cpp" #include "queue.cpp" using namespace std; // A2(BC) // f^ // cout << A // repeat 2, expr [B, C] // decompress(f -> , expr = [] ) // get(c) // A2(BC) // f^ expr = [B] // A2(BC) // f^ expr = [B, C] // A2(BC3(X)) // f^ ...
true
dac68b726d22627f4f70195a3853d966e26147a6
C++
adammorley/cpp
/sort/test.cc
UTF-8
538
3.28125
3
[ "Apache-2.0" ]
permissive
#include <new> #include "sort.h" /* test cases create random length array and see if sorted */ void testSort() { int len = 10; int* arr = new (std::nothrow) int[len]; arr[0] = 65; arr[1] = 22; arr[2] = 73; arr[3] = 29; arr[4] = 22; arr[5] = 102; arr[6] = 135; arr[7] = 9102...
true
27c3d005def530a668ad2ddb2a2ad2ae5ebf4831
C++
aaadriano/RICO
/rico/src/MyVector.cpp
UTF-8
697
2.8125
3
[]
no_license
#include "MyVector.h" #include "UnitTest++/UnitTest++.h" //////////////////////////////////////////////////////////////////////// TEST(TestMyVector) { MyVector<double> x(4,7,2); MyVector<bool> m(1,0,1); //cout << "(4, 7, 2) == " << x << endl; const float xm_true[] = {4,2}; CHECK_ARRAY_EQUAL(xm_true, x[m...
true