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
5c9ad6e5dbe3600caa4548be1f61390df805b33b
C++
sogapalag/problems
/codeforces/601b.cpp
UTF-8
1,859
2.96875
3
[ "MIT" ]
permissive
#include <bits/stdc++.h> using namespace std; using ll=long long; // should hold transitivity. using PartialOrd = function<bool(int,int)>; // f(x, i): x by(<) i vector<int> get_dominating_left(int n, PartialOrd f) { assert(n > 0); vector<int> L(n); vector<int> stk; for (int i = 0; i < n; i++) { ...
true
c29264bf6a41d0f8a926f90b490a34dcd7bf184f
C++
raghavaggarwal99/Competitive
/Graphs/Interviewbit/steppingnumbers.cpp
UTF-8
874
3.015625
3
[]
no_license
void dfs(int A, int B, vector<int> &ans, int num){ if( num>B){ return ; } if(num==0 && num>=A && num<=B){ ans.push_back(0); return ; } else if(num==0){ return; } if(num>=A && num<=B){ ans.push_back(num); } int lastdigit...
true
0f15818a3c71d08dca3b66ae90b1f513532ea6dc
C++
gauthamip/MissionRnD-C-Strings-Worksheet
/src/StrWordsinRev.cpp
UTF-8
721
3.4375
3
[]
no_license
/* OVERVIEW: Given a string, reverse all the words not the string. E.g.: Input: "i like coding". Output: "coding like i" INPUTS: A string. OUTPUT: Modify the string according to the logic. NOTES: Don't create new string. */ #include <Stdio.h> #include <string.h> void str_words_in_rev(char *input, int len){ int i ...
true
693c41fb2be0aea5f605205388b4d05a773f9e52
C++
petrenko-alex/array-range-analyzer
/ArrayRangeAnalyzer/main.cpp
UTF-8
3,372
2.921875
3
[ "BSD-3-Clause" ]
permissive
/*! *\file *\brief Файл основной функции программы. *\author Александр Петренко gafk555@gmail.com. * * Данный файл содержит в себе функцию main - осовную функцию, вполняющую программу. */ #include <QtCore/QCoreApplication> #include "input.h" #include "analyzer.h" #include "output.h" #include "operations.h" #incl...
true
02ab96358733ec3b6764466120654e297955ebac
C++
goffrie/grapher
/dynamic_unique_cast.h
UTF-8
700
3.28125
3
[]
no_license
#ifndef _DYNAMIC_UNIQUE_CAST_H_ #define _DYNAMIC_UNIQUE_CAST_H_ template<typename B, typename A> std::unique_ptr<B> dynamic_unique_cast(std::unique_ptr<A> a) { B* b = dynamic_cast<B*>(a.get()); if (b != NULL) { a.release(); // let go of a's pointer; b holds it now } // otherwise, let a's destructor...
true
8d909afc2c48f8d709b9c078400045374b0f0e07
C++
vinicassol/poo
/JogoDaVelha/Jogador.hpp
UTF-8
221
2.578125
3
[]
no_license
#include <iostream> using namespace std; class Jogador { public: void SetPlayer(string nome, char simbolo); string GetNome(); char GetSimbolo(); private: char simbolo; // se eh X ou O string nome; };
true
6e5271ad4adab28ef3b17284d186cb19aea4fbff
C++
moejoe95/theConspiracy
/src/managers/Renderer.cpp
UTF-8
4,277
2.609375
3
[]
no_license
#include "Renderer.hpp" #include "../utils/Constants.hpp" #include "../utils/SDLException.hpp" #include "../utils/Utils.hpp" #include <SDL_image.h> #include <spdlog/spdlog.h> Renderer::Renderer() { if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0) throw SDLException("SDL_Init failed."); window = SDL_CreateWindow...
true
9d5056b3b7865d53d6dbdd8699716f08fbcb5945
C++
lordplatypus/Rhythm_Game_Remake
/Enemy/GlobalEnemyManager.cpp
UTF-8
1,352
2.953125
3
[]
no_license
#include "GlobalEnemyManager.h" GlobalEnemyManager::GlobalEnemyManager() { SetAtkModifier(0); SetMaxHPModifier(0); SetRangeModifier(0); SetHealModifier(true); SetMoneyModifier(0); } GlobalEnemyManager::~GlobalEnemyManager() { Clear(); } void GlobalEnemyManager::SetAtkModifier(const int atkMod...
true
a202a284350ae9247d8f5e0f6df417cc7233d790
C++
MrJookie/AGE
/Plugins/Physics/PhysX/PhysXMaterial.cpp
UTF-8
1,485
2.671875
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
#include "PhysXMaterial.hpp" #include "PhysXWorld.hpp" namespace AGE { namespace Physics { // Constructors PhysXMaterial::PhysXMaterial(PhysXWorld *world, const std::string &name) : MaterialInterface(name), material(static_cast<PhysXPhysics *>(world->getPhysics())->getPhysics()->createMaterial(GetDefaultStati...
true
542908e6bb0d034812c7921039794092b5eaf1e3
C++
ngc92/stargame
/src/game/detail/CGameObject.h
UTF-8
3,700
2.828125
3
[]
no_license
#ifndef CGAMEOBJECT_H_INCLUDED #define CGAMEOBJECT_H_INCLUDED #include "../IGameObject.h" #include "property/CPropertyObject.h" #include "../physics/body.h" #include "property/TypedProperty.h" namespace game { /*! \class CGameObject \brief default implementation for IGameObject. \details .... */ class CGameObje...
true
8c957589dd4640367bd49e3faf88554c12db3a82
C++
SyojiTakahiro/GamePerformance
/吉田学園情報ビジネス専門学校 荘司雄大/2年次作品/02 C++ 16Dayチーム制作/ソースコード/01_プロジェクトファイル/timer.h
SHIFT_JIS
1,606
2.6875
3
[]
no_license
//***************************************************************************** // // ^C}[̏[timer.h] // Auther:Hodaka Niwa // //***************************************************************************** #ifndef _TIMER_H_ #define _TIMER_H_ //*******************************************************************...
true
e8d7763c0eb241fca9698f1a330f15f5fcb76164
C++
Daniiil06/CppLab_and_other
/OLD/6.cpp
UTF-8
1,132
2.796875
3
[]
no_license
#include <iostream> #include <cmath> #include <iomanip> #include <string.h> #include <string> #include <cctype> #include <cstring> #include <stdio.h> #include <cctype> #include <cstdio> using namespace std; #pragma warning(disable:4996) int main() { setlocale(LC_ALL, "Russian"); printf("\033c"); cout << "\033]2;...
true
63fcd3422d1a923f1200a3f6b585d6ae10dea54b
C++
stumped2/school
/CS475/Project5/first.cpp
UTF-8
7,904
2.546875
3
[ "Apache-2.0" ]
permissive
#include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #include <omp.h> #include "errorcodes.h" #include <CL/cl.h> #include <CL/cl_platform.h> #ifndef GLOBAL #define GLOBAL 8192 #endif #ifndef LOCAL #define LOCAL 32 #endif const int NUM_ELEMENTS = GLOBAL*1024; const int ...
true
d981db58b455d5ce315408a45d05314e84eca667
C++
AR2A/imu-minimu-arduino
/process_imu_data/src/Sensor3DCalibration.cpp
UTF-8
4,728
2.53125
3
[ "BSD-3-Clause" ]
permissive
/** * \author CB * \brief Main file for calibrating the Pololu MinIMU-9. * \file Sensor3DCalibration.cpp * \license BSD-3-License */ /************************************************************************************** * INCLUDES ************************************************************************...
true
2f9c2a2da51259e80ffada90e5e2eb807395fa09
C++
binbin3828/rmserx
/com/common1.h
GB18030
1,107
2.6875
3
[]
no_license
#ifndef _COMMON1_H_ #define _COMMON1_H_ #include <pthread.h> // class CMutexLock { public: CMutexLock() { pthread_mutex_init(&m_MutexLock,NULL); } ~CMutexLock() { pthread_mutex_destroy(&m_MutexLock); } int Lock() { return pthread_mutex_lock(&m_MutexLock); } int Unlock() { return pthread_m...
true
743b10de101c0ca1fa5015e7767b567374247c7f
C++
Oleh0293/lab_3.3
/Lab_03_4.cpp
UTF-8
1,149
3.625
4
[]
no_license
// Lab_03_3.cpp // кулик олег // Лабораторна робота № 3.3 // Розгалуження, задане графіком функції. // Варіант 8 #include <iostream> #include <cmath> using namespace std; int main() { double x; //вхідний аргумент double R; //вхідний параметр double y; //результат обчислення cout << "R="; cin >> R; ...
true
1b9cb8723ed305a1a75b758b98b9737eeb10494b
C++
ytz12345/2019_ICPC_Trainings
/Opentrains_Contest/1038/A.cpp
UTF-8
921
2.796875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; struct node { int x, y, z; }; vector <node> a[4]; int sqr(int x) {return x * x;} int main() { srand(time(NULL)); for (int x, y, z, t = 0; t < 4; t ++) { x = rand() % 1000, y = rand() % 1000; while (x <= 100 || y <= 100) x = rand() % 1000, y = rand() % 1000; ...
true
6fdc9aba5074745cd1c3e748382f1914e0e4f5c8
C++
axrdiv/USACO
/Chapter_2/Section_2.4/Fractions_to_Decimals/Fractions_to_Decimals.cpp
UTF-8
1,111
2.65625
3
[]
no_license
/* ID: axrdiv1 PROG: fracdec LANG: C++ */ #include<iostream> #include<fstream> #include<vector> #include<string> #include<cstring> using namespace std; const int maxn = 100000*10+10; ofstream fout("fracdec.out"); ifstream fin("fracdec.in"); int N, D, vis[maxn]; vector<int> dig; char line[maxn]; int divi(int n, int d...
true
b645d04863e1686540f205c56071a63866e1d7f2
C++
jahid-coder/competitive-programming
/LeetCode/N-Queens II/main.cpp
UTF-8
1,222
3.234375
3
[ "MIT" ]
permissive
class Solution { private: vector<vector<string>> ans; bool isSafe(const vector<string> &board, int row, int col, int n) { for (int i = 0; i < row; ++i) { if (board[i][col] == 'Q') { return false; } } int i = row - 1, j = col - 1; ...
true
5e291c97c714d9be06dbddcbae2ae494924377a3
C++
susu/goodies
/include/goodies/enforce.hpp
UTF-8
1,085
2.984375
3
[ "MIT" ]
permissive
#ifndef GOODIES_ENFORCE_HPP_INC #define GOODIES_ENFORCE_HPP_INC #include <stdexcept> #include <goodies/MakeString.hpp> namespace goodies { class EnforceFailedError : public std::runtime_error { public: EnforceFailedError(const char* conditionStr, const char* file, int line, const std::stri...
true
17d037e9d5b264939d755fc35f09ca6b4273d5d6
C++
jackmcguire1/Multi-Threaded-Audio-Streaming-Server-
/client/WebClient/ClientSocket.cpp
UTF-8
1,977
2.796875
3
[]
no_license
#include "Client.h" using namespace std; ClientSocket::ClientSocket(Settings settings) { clientSocket = -1; serverIpAddress = settings.Hostname; port = (unsigned short)strtoul(settings.Port.c_str(), NULL, 0); } ClientSocket::~ClientSocket() { WSACleanup(); closesocket(clientSocket); } int Cl...
true
5d17e0c47de43df9486f384f94f5509a03d1186d
C++
brighton36/cpp-slim
/tests/types/Time.cpp
UTF-8
17,544
2.8125
3
[ "MIT" ]
permissive
#include <boost/test/unit_test.hpp> #include "expression/Parser.hpp" #include "expression/Ast.hpp" #include "expression/Lexer.hpp" #include "expression/Scope.hpp" #include "types/Time.hpp" namespace { boost::test_tools::predicate_result time_eq(time_t lhs, time_t rhs) { boost::test_tools::predicate_res...
true
45444944e6a64089bcffd589b3fe68d9b7d4d6ff
C++
EmmaSteinman/hash
/testclass.cpp
UTF-8
3,992
3.5625
4
[]
no_license
#include <iostream> #include <sstream> #include <cassert> using namespace std; #include <math.h> #include <string> #include "HashTable.h" /* * test class * this is a class to test our hash table */ class test { public: int key; test(void){key = 0;}; //default constructor test(int k){key = k;}; //sp...
true
67247694d68710515c1702cb21e769fec6aa549f
C++
anujrawatcode/7_Sem_Placement_Classes
/G3/4_Week_19July21/4_23July21/Reshape the Matrix.cc
UTF-8
1,726
3.015625
3
[]
no_license
// #include<bits/stdc++.h> using namespace std; // Brute force method vector<vector<int>>reshapeBF(vector<vector<int>>& a, int r, int c) { int m=a.size(); int n=a[0].size(); if(m*n != r*c) return a; else { int k=0; vector<vector<int>> ans; vector<int> tem...
true
2bf1501f9048d23b01dd210bc48aa8aff05780a8
C++
imjkdutta/Important_Training
/Training/c++/Assignment/Third_Assignment/Third_Assignment/source/template_smallest.cpp
UTF-8
1,535
4.21875
4
[]
no_license
#include<iostream> using namespace std; template <typename Type> Type find_min(Type* ptr,int num) /*template function definition*/ { for( int i = 0; i < num; i++) { for(int j = 0 ; j < num - 1; j++) { if(ptr[i] < ptr[j]) { Type temp = ptr[i]; /*toSwapping*/ ptr[i] = ptr[j]; ptr[j] = temp; ...
true
42c8227d3b31284d05d448daa794a83fc38998b0
C++
Zhangeaky/DataStructure
/BinaryTree/inorder/inorderStack.cc
UTF-8
874
2.765625
3
[]
no_license
#include<iostream> #include<stack> #include<vector> #include"Treenode.hpp" using namespace std; vector<int> container; void inorder(Treenode* root){ stack<Treenode*> ss; //ss.push(root); while( !ss.empty() || root != nullptr ){ if( root == nullptr ){ container.push_back(ss.top()->v...
true
1cf5c5508751c9aee5c258fe4f814eca80d64934
C++
minusminus/codechef
/median/main.cpp
UTF-8
7,816
3.03125
3
[]
no_license
/* MEDIAN https://www.codechef.com/problems/MEDIAN pomysl (PD): - tabela enkodowana do liczby binarnej, gdzie 1 - max, 0 - pozostale wartosci - w kazdym kroku analizujemy wszystkie mozliwe kombincje rozszerzania 1, dla kazdej kombinacji generujemy maksymalna tablice 1 jaka mozna z niej utowrzyc: kazda ma...
true
aed9475b73306b8101b0b1f18bc408e97c7efe63
C++
AleksievAleksandar/Cpp-Advanced
/Exam (12 September 2020)/02. Scientists/Scientist.h
UTF-8
487
3.015625
3
[]
no_license
#pragma once enum Fields { Chemistry, Physics, Linguistics, Philosophy }; class Scientist { private: char* name; int discoveriesCount; public: Scientist(); Scientist(char* name, int discoveriesCount); Scientist(const Scientist& other); Scientist& operator=(const Scientist& other); ~Scientist();...
true
ab4199890d5113bd2503f115ba9bbaa2c23625eb
C++
ConnectionMaster/AL-Engine
/AL-Engine/Renderer.cpp
UTF-8
762
2.6875
3
[]
no_license
#include "Core.h" #include "Renderer.h" namespace AL { void Renderer::Render() { Sort(); RenderTargets(); } void Renderer::Sort() { _renderTargets.sort([=](Node* node1, Node* node2) {return node1->GetLocalDepth() < node2->GetLocalDepth(); }); _renderTargets.sort([=](Node* node1, Node* node2) {return node...
true
68fb48a9f03182c0601fc554da3bc1ef4d6efd31
C++
animeshkarmakarAK/Computer-Programming
/Algorithm course/jbs.cpp
UTF-8
1,404
3.125
3
[]
no_license
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; struct job{ char id; int dead; int profit; }; bool comparison(job a,job b) { return (a.profit>b.profit); } void printfJobSe(job arr[],int n) { sort(arr,arr+n,comparison); for(int i=1;i<=n;++i){ cout<<arr[i].id<...
true
fb86f7c51b077681c24690961553c43dddad4ab3
C++
ttyang/sandbox
/sandbox/explore/boost/explore/manipulators.hpp
UTF-8
14,801
2.5625
3
[]
no_license
// // manipulators.hpp - stream manipulators for modifying how containers stream // // Copyright (C) 2007-2009, Jeffrey Faust // Copyright (C) 2008-2009, Jared McIntyre // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0....
true
4da2b2129a793ad58d88def7ad3514a6bf141639
C++
gssm-cs201/gRayT
/src/Triangle.cpp
UTF-8
7,558
2.765625
3
[]
no_license
#include "gssmraytracer/geometry/Triangle.h" using namespace gssmraytracer::math; namespace gssmraytracer { namespace geometry { class Triangle::Impl { public: Impl(const TriangleMesh *m, const int n) : mesh(m), v() { v = mesh->getVertexIndex(n*3); } const TriangleMesh *mesh; int *v; }; void ...
true
be8ef99ac2491ae39650a5a851a37d7e4d7f7d18
C++
eecs275/minimal_turtlebot
/turtlebot_controller.cpp
UTF-8
1,617
2.53125
3
[]
no_license
#include "minimal_turtlebot/turtlebot_controller.h" void turtlebot_controller(turtlebotInputs turtlebot_inputs, uint8_t *soundValue, float *vel, float *ang_vel) { //turtlebot_inputs.centerBumperPressed; //turtlebot_inputs.rightBumperPressed; //turtlebot_inputs.leftBumperPressed; //turtlebot_inputs.nanoSecs; bo...
true
2021cb7bba484a47189d9dd97d0594b89d566378
C++
Toocanzs/4coder-non-source
/test_data/lots_of_files/4ed_math.cpp
UTF-8
13,801
2.875
3
[]
no_license
/* * Mr. 4th Dimention - Allen Webster * * 15.05.2015 * * Math functions for 4coder * */ // TOP /* * Scalar operators */ #define C_MATH 1 #define DEG_TO_RAD 0.0174533f #if C_MATH #include <math.h> #endif inline f32 ABS(f32 x){ if (x < 0) x = -x; return x; } inline f32 MOD(f32 x, i32 m){ #if C_MA...
true
39171c0021d0319895e589033cb1aceca8e1ea2c
C++
zzmicer/Computer-Architecture-Labs
/Lab2/Lab2/Lab2_2.cpp
UTF-8
1,844
3.453125
3
[]
no_license
#include <iostream> #include <thread> #include <chrono> #include <algorithm> #include <mutex> #include <vector> #include <atomic> #include "windows.h" #include <queue> using namespace std; using namespace std::chrono; static const int TaskNum = 4 * 1024 * 1024; static const int ProducerNum = 4; static const int Cons...
true
1f9c594e5a0b5a06deb56a49ba661b91f179daef
C++
mdqyy/go2012
/player/src/lib/vision/ImageInput.cpp
UTF-8
2,000
3.1875
3
[]
no_license
/* * Name: ImageInput.cpp * @Author: Carlos Agüero (caguero@gsyc.es) * * Description: Class that stores the parameters of an image and implements some utilities. * * Copyright (C) 2008-2009 Universidad Rey Juan Carlos * All Rights Reserved. */ #include "ImageInput.h" /** * Class constructor that sets the...
true
bbbe2b965df5d68a023eedd57df211efc33c9be1
C++
webserver3315/Desktop_PS_BOJ
/PS_BOJ/BOJ2529.cpp
WINDOWS-1252
2,369
3.078125
3
[]
no_license
/* εȣ */ #include <iostream> #include <vector> #include <string> #include <cstring> #define endl '\n' using namespace std; int N; string futougo; vector<int> answer_max; bool ended_max; vector<int> answer_min; bool ended_min; bool visit[13]; void min_dfs(int now) { if (ended_min) return; if (now == N) { ended_...
true
765b305d25ae277b1ba9c02ae4e2e1f67c56f2b3
C++
hijarian/KSU-algorithmization-courses
/c1/s2/The Last Step/srcCore_datalayer.cpp
WINDOWS-1251
3,819
2.875
3
[]
no_license
// 13 " ++" // , , // . // 5.2.2 9 // ----------------------------------- // srcCore_datalayer // , . // srcCore_menuitems, // // ----------------------------------- // () .. . . , 2007 #include "srcCore_datalayer.h" ptNode listConstruct(size_t size) {// () .. ...
true
6b1034ee113ef3942c6ab2c890f6e09fa092ddc3
C++
annerose/mempool
/mempool/newoperator.cpp
UTF-8
901
2.5625
3
[]
no_license
 #include "kmempool.h" KMemoryPool pool; void* operator new(size_t size, char* pszFileName) { //char szMsg[256] = {0}; //sprintf(szMsg, "%d,%s", line, file); return pool.Malloc(size, pszFileName); } void* operator new[](size_t nSize, char* pszFileName ) { //char szMsg[256] = {0}; //sprintf(szMsg, "%d,%s", n...
true
10acc14f1db1ee565dbaa81fcfe4542a54e9154d
C++
Shalinor/Artificial-Intelligence-for-games
/GraphTraversalExercises/GraphTraversalExercises/source/Graph.cpp
UTF-8
3,593
3.109375
3
[]
no_license
#include "Graph.h" //Searches the graph starting from the "start" node until one of the // "potential end node's" are found. // The resulting path is added to the "outPath" list. void Graph::FindDijkstrasPath(Node* start_, const std::list<Node*> &potentialEndNodes_)// , std::list<Node*> &outPath_) { //Reset the list...
true
e4a8f9a1c08cdde4dbcfd1d736d184d0e6d028e2
C++
Maks-s/panzer-toy
/src/bullet.cpp
UTF-8
3,411
2.953125
3
[ "MIT" ]
permissive
#include "game.hpp" #include <memory> #include <vector> #include <glm/glm.hpp> #include <glm/gtc/constants.hpp> #include "bullet.hpp" #include "log.hpp" #include "map.hpp" #include "model.hpp" #include "shader.hpp" #include "enemy.hpp" namespace { Model bullet_mdl; std::vector<Bullet> bullets; } bool BulletManager...
true
2e4f40e02912f8c91eba4ebf5a60df70e47815e7
C++
willmoon/CPP_Primer
/Chapter_1/ifcount.cpp
UTF-8
742
3.9375
4
[]
no_license
/* *从窗口读入整数,计算整数出现的次数(相同数必须出现在一起。。。。) */ #include <iostream> int main(int argc, char const *argv[]) { //currval是正在统计的数;新读入的值将存放在val int currval = 0, val = 0; //读取第一个数 if (std::cin >> currval) { int cnt = 1; //记录当前值得个数 while (std::cin >> val) //读取剩余的数 { if (val == currval) { ++ cnt; } ...
true
b4fdf5391485262ea7266fedd02061a90ad98516
C++
baocvcv/thu-oop-exercises
/week5/Problem1/Edge.h
UTF-8
1,853
3.984375
4
[]
no_license
#pragma once /** * Edge class. * Stores an edge and supports basic operations. */ class Edge{ /// One vertex of the edge. int v; /// Another vertec of the edge. int w; /// Weight of the edge. double weight; /// Constant used in compare() static const double mu; public: /*...
true
2e328211dab95d2dc02501d1baec85de1dbc3802
C++
sajal243/DataStructures
/count_sort.cpp
UTF-8
699
3.265625
3
[]
no_license
#include<iostream> using namespace std; void countSort(int a[], int n){ int k = a[0]; for(int i=0; i<n; i++){ k = max(k, a[i]); } cout << k << endl; int count[10] = {0}; for(int i=0; i<n; i++){ count[a[i]]++; } for(int i=1; i<=k; i++){ count...
true
0268ca96ffe5f0c77178ae1f44152123dd102004
C++
CarlBye/LeetCode
/src/0001_Two_Sum/two_sum.cpp
UTF-8
420
3.046875
3
[]
no_license
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { int size = nums.size(); vector<int> s(2,0); for(int i = 0;i < size;i++) { for(int j = i+1;j < size;j++) { if(nums[i] + nums[j] == target){ s[0] = i; ...
true
158820ddd0469c031a9a9c87116aa332c9e9f8bc
C++
lzw3232/car
/framework/src/window/Window.cpp
UTF-8
2,764
2.65625
3
[]
no_license
#include "../../include/window/Window.h" #include "../../include/log/Log.h" #include <iostream> using namespace lzw; Window::Window() { } Window::Window(int windowWidth,int windowHeight,const char *windowName){ this->windowWidth=windowWidth; this->windowHeight=windowHeight; this->windowName=(char *)win...
true
a4fa4dbc8bad59c2c8791b310d28c886476a167c
C++
hyrise/hyrise
/src/lib/expression/in_expression.hpp
UTF-8
873
2.75
3
[ "MIT" ]
permissive
#pragma once #include "abstract_predicate_expression.hpp" namespace hyrise { /** * SQL's IN */ class InExpression : public AbstractPredicateExpression { public: InExpression(const PredicateCondition init_predicate_condition, const std::shared_ptr<AbstractExpression>& operand, const std::shared_pt...
true
da9f1f360c1887c3a375836aa1b3c23eacb2543d
C++
STEllAR-GROUP/hpx
/libs/core/algorithms/include/hpx/parallel/container_algorithms/merge.hpp
UTF-8
55,450
3.109375
3
[ "BSL-1.0", "LicenseRef-scancode-free-unknown" ]
permissive
// Copyright (c) 2017 Taeguk Kwon // Copyright (c) 2022 Dimitra Karatza // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /// \file parallel/container_algorithms/merge.hpp ...
true
596b981b638c046e1cdb6714f15468fdace75719
C++
kanika2296/c-book-code
/createBook.h
WINDOWS-1258
2,446
3.140625
3
[]
no_license
#include "Book.h" class CreateBook { private: Book b; public: CreateBook() { b.setTitle("Clean Code"); b.setPrice(700); b.setAuthor("Robert C. Martin"); b.addCoverPage(); b.addEndPage(); // adding two chapters Chapters* ch = b.addChapters("Cl...
true
91481aafd0dcc2758532bacbc54cf0b4780a1f88
C++
laballea/piscinecpp
/cpp06/ex02/main.cpp
UTF-8
2,039
2.890625
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.cpp :+: :+: :+: ...
true
f327f025b64366e02334f504864085224bf0cdac
C++
Kouen74/ANicoletti_CSC17A
/RainOrShine.cpp
UTF-8
1,077
3.046875
3
[]
no_license
/* * File: prob6.cpp * Author: Andrew Nicoletti * Created on July 12, 2016, 12:10 PM * Purpose: Just another sequence */ #include <iostream> // System Library #include <cmath> // Math Library #include <iomanip> using namespace std; // Standard I/O Namespace // User Libraries /...
true
35b9653cb168c4669dd451f6511fa42bc4dbab16
C++
unyieldingGlacier/coding-exercises
/intersection-arrays.cpp
UTF-8
1,284
3.6875
4
[]
no_license
/* LC 349 * Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element in the result must be unique. The result can be in any order. */ //approach 1 - sort and process duplicates while iterating class Solution { public: v...
true
b818af2cce95a34b2fd29583f35a814d7ceb422e
C++
Tomatosoup97/Web-Server
/src/exceptions.hpp
UTF-8
636
2.9375
3
[ "MIT" ]
permissive
#ifndef WEBSERVER_EXCEPTIONS_HPP #define WEBSERVER_EXCEPTIONS_HPP #include <iostream> #include <boost/asio.hpp> namespace webserver { void output_exception(std::exception &e) { std::cout << "Exception: " << e.what() << "\n"; } void output_error(const boost::system::error_code &error) { std::cout << "Error:...
true
009ce4b616f5cfd7a3669df400436b53c590d007
C++
QiuBiuBiu/LeetCode
/C++/Leetcode/16.cpp
UTF-8
1,193
3.8125
4
[]
no_license
/* 16. 最接近的三数之和 给你一个长度为 n 的整数数组 nums 和 一个目标值 target。请你从 nums 中选出三个整数,使它们的和与 target 最接近。 返回这三个数的和。 假定每组输入只存在恰好一个解。 输入:nums = [-1,2,1,-4], target = 1 输出:2 解释:与 target 最接近的和是 2 (-1 + 2 + 1 = 2) 。 */ /* 排序+双指针,T=O(n^2) 先排序,再固定一个数字nums[i],用双指针来寻找另外两个数字 */ class Solution { public: int th...
true
79bf379dfa092a90d46555d32d2be6d3e2bd0fd1
C++
robillardstudio/Images-Generiques
/App/Engines/AppEngine/Interactions.cpp
UTF-8
3,848
2.5625
3
[]
no_license
// // Interactions.cpp // Xcode // // Created by Valentin Dufois on 12/01/2018. // Copyright © 2018 Valentin Dufois. All rights reserved. // #include "AppEngine.hpp" #include "Core/AppObject.hpp" void AppEngine::parseEvents() { SDL_Event event; m_mouse.scrollX = 0; m_mouse.scrollY = 0; m_window.resized = fal...
true
9060a029b1e4d730c1c27abe2ae0928d425f2b7e
C++
pehlivanian/OrderedPartitions
/score.hpp
UTF-8
8,134
2.765625
3
[]
no_license
#ifndef __SCORE_HPP__ #define __SCORE_HPP__ #include <vector> #include <list> #include <limits> #include <algorithm> #include <numeric> #include <iostream> #include <cmath> #include <exception> #define UNUSED(expr) do { (void)(expr); } while (0) namespace Objectives { enum class objective_fn { Gaussian = 0, ...
true
c79b377cc036cf6c0137d4c04d986ca7f1bf64ec
C++
lilei/practice_book
/src/thread.cpp
UTF-8
706
3.609375
4
[]
no_license
#include <gtest/gtest.h> #include <thread> #include <chrono> #include <iostream> void foo() { std::this_thread::sleep_for(std::chrono::seconds(2)); std::cout<<"func foo"<<std::endl; } void bar() { std::this_thread::sleep_for(std::chrono::seconds(1)); std::cout<<"func bar"<<std::endl; } TEST(thread,th...
true
4609239516b2d5ee5a6580dff61c4184667a97fe
C++
Alimurrazi/Programming
/beginner_level_and_uva/priority queue-9.cpp
UTF-8
1,166
2.859375
3
[]
no_license
#include<stdio.h> #include<queue> using namespace std; struct data { char c; int h,m,s; bool operator < (const data & p)const { // if(p.dist > dist) // return true; // if(p.dist==dist && p.city>city) // return false; // if(p.dist > dist) // return false; ...
true
048c5eb64ffcb992d595f6947aafb6f316d16f42
C++
Giordan0/URIOJ
/Iniciante/1018.cpp
UTF-8
756
3.328125
3
[]
no_license
#include <iostream> using namespace std; int main() { int x, temp, temp2; cin >> x; cout << x << endl; temp = x%100; cout << (x - temp)/100 << " nota(s) de R$ 100,00" << endl; temp2 = temp%50; cout << (temp - temp2)/50 << " nota(s) de R$ 50,00" << endl; temp = temp2%20; ...
true
c0c6e5f001617a72a6e331e10d618d7007c049e6
C++
charlesgingras/GoLite-Compiler
/programs-solution/3-extra+codegen/valid/7-2-slices-recursive.cpp
UTF-8
2,751
2.984375
3
[]
no_license
#include <iostream> #include <string> #include <array> bool __golite__true = true; bool __golite__false = false; namespace GoLite { template <typename T> struct __golite_builtin__slice { unsigned int __size = 0; unsigned int __capacity = 0; T *__contents = NULL; __golite_builtin__slice<T> append(T element) { re...
true
22b1d5e4af926b8b1850250874125cd9047e8c3d
C++
brad9895/BrewOS
/ArduinoTempController/Controller.cpp
UTF-8
1,043
2.640625
3
[]
no_license
using std; #include "DallasTemperature.h" #include "OneWire.h" //#include #define ONE_WIRE_BUS 2 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); #define BUFFSIZE 20 float temps[BUFFSIZE]; uint8_t addresses[BUFFSIZE]; uint8_t numSensors = 0; volatile char buffer[40]; void setup() { setu...
true
924ca370d065a4ef4bfaf1eae54fea5bead50c73
C++
BenSlaney17/Ben-s-BurgARia-Code
/CollisionEngine.cpp
UTF-8
4,082
2.859375
3
[]
no_license
#include "CollisionEngine.h" #include "Collision.h" #include "GameObject.h" #include "CollisionObject.h" #include "graphics\mesh.h" #include <system\platform.h> #include "graphics\renderer_3d.h" #include <sony_sample_framework.h> CollisionEngine::CollisionEngine(gef::Platform * platform, gef::Renderer3D* renderer) : ...
true
a9a19991b5c81c54f1660a55ab973c24b6da4777
C++
balramsingh54/codeC-
/lect4/basicfunction.cpp
UTF-8
357
3.171875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; void increment(int*a){ *a=*a+1; cout<<"Inside function "<<&a<<endl; } int main(int argc, char const *argv[]){ int a; a=10; increment(&a); cout<<"Inside main "<<a<<endl; int x = 10; int &z = x; cout<<z<<endl; cout<<x<<endl; cout<<&z<<endl; z++; cout<<x...
true
765f5fc334a8921ce2f43731dd00387e60e1a100
C++
abhay-iy97/30-days-of-code
/Day29/day29_bitwise.cpp
UTF-8
692
3.078125
3
[]
no_license
#include <bits/stdc++.h> using namespace std; vector<string> split_string(string); void calculate(int n, int k) { int max = 0; for(int i=1;i<k;i++) { for(int j=i+1; j<=n; j++) { int temp = i & j; if(temp < k && temp > max) { max = temp; ...
true
e4509b81295aca13321ff440c50bc8d8d21f1ce1
C++
helloAda/Algorithm-Study
/Algorithm-Study/Algorithm-C++/Algorithm-C++/替换空格/ReplaceSpaces.cpp
UTF-8
2,906
3.890625
4
[ "MIT" ]
permissive
// // ReplaceSpaces.cpp // Algorithm-C++ // // Created by HelloAda on 2018/9/11. // Copyright © 2018年 HelloAda. All rights reserved. // #include "ReplaceSpaces.hpp" #include <iostream> /* 面试题5:替换空格 题目:请实现一个函数,把字符串中的每个空格替换成"%20"。例如输入“We are happy.”, 则输出“We%20are%20happy.”。 */ namespace namespace_replaceSpaces {...
true
c15c99a67d8fb97ba6840ebcd2a0273ea3d07dc6
C++
tsmit317/CIS-115-Labs
/Lab06/Lab06Program4.cpp
UTF-8
2,067
3.734375
4
[]
no_license
// Lab06Program4.cpp - Wake Tech Healthcare Phone System - Adding doctor choice. 3 // Created by Taylor Smith on 2/20/13. /* Input: Number Doctor number = dNumber Processing: Processing Items:None Algorithm: 1. Enter number. 2. Test value of number in switch 1: Ask which doctor to make an appointment w...
true
bd4826930cb3fc8da95a6a2e5abf4bd04ed55488
C++
zbomb/Hyperion-Engine
/Hyperion Engine/Source/Core/Object.cpp
WINDOWS-1252
8,287
2.59375
3
[]
no_license
/*================================================================================================== Hyperion Engine Source/Core/Object.cpp 2019, Zachary Berry ==================================================================================================*/ #include "Hyperion/Core/Object.h" namespace Hyperion...
true
d4b1656c06dbb9e7401637570f05cbe6eaf229cc
C++
yalishanda42/oop2021
/week2/2/Complex.hpp
UTF-8
364
2.984375
3
[]
no_license
#pragma once class Complex { public: double real; double imaginary; Complex(); Complex(double real); Complex(double real, double imaginary); bool isEqualTo(const Complex& other) const; Complex add(const Complex& other) const; Complex multiply(const Complex& other) const; Complex c...
true
38251cb6ff6a4e2f6c2ed8626e3a944af6a7db0d
C++
LightningBilly/ACMAlgorithms
/图形学算法/多边形扫描线法填充/多边形填充.cpp
UTF-8
6,826
2.953125
3
[]
no_license
#include "glew/2.2.0_1/include/GL/glew.h" #include "glfw/3.3.4/include/GLFW/glfw3.h" #include <iostream> #include <vector> using namespace std; double esp = 1e-6; void key_callback(GLFWwindow* window, int key, int scancode, int action, int mode) { //如果按下ESC,把windowShouldClose设置为True,外面的循环会关闭应用 if(key==GLFW_KE...
true
f1a4a3ac3b3df2f643f36d4d83145cab75364ded
C++
patrykpk/FYS4150
/Project_3/Scripts/C++ Scripts/Unit_Test/test.cpp
UTF-8
1,085
3.0625
3
[]
no_license
#define CATCH_CONFIG_MAIN #include <iostream> #include <cmath> #include <string> #include <iomanip> #include "catch.hpp" #include "lib.h" using namespace std; TEST_CASE("Checking if gauleg finds correct roots for 5th degree Legendre polynomial"){ int a = -1; int b = 1; int n = 5; double *x = new do...
true
0a54cb7d05c640d1d941607523def883ba66b155
C++
shivam-tripathi/code
/practice/graphs/colourfulGraph.cpp
UTF-8
949
2.609375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; vector<pii> adj[110]; int n, m; int a, b, c; bool visited[110]; bool dfs(int src, int c) { visited[src] = true; if (src == b) return true; for(int i=0; i<adj[src].size(); i++) { int node = adj[src][i].first; int color = adj[src][i].seco...
true
17777b7061825200474db82cfa4013adc2015ff2
C++
singhdharmveer311/PepCoding
/Level-2/18. Recursion-and-Backtracking/Coin Change - Permutations - 2.cpp
UTF-8
544
2.984375
3
[ "Apache-2.0" ]
permissive
#include "bits/stdc++.h" using namespace std; void coinchangePermutation(int idx,int *arr,int n,int sum,int ssf,string asf){ if(ssf > sum) { return; } if(ssf == sum){ cout << asf << "."<< endl; return; } for(int i=0;i<n;i++){ // if(arr[i]!=0){ int cn=arr[i]; // arr[i]=0; coinchangePermutation(i,...
true
5c61e93a5895c4964ab2c1da3ff8714cf412900c
C++
insightcs/PAT
/AdvancedLevel/general_oalindromic_number.cpp
UTF-8
591
3.125
3
[]
no_license
#include<iostream> #include<vector> using namespace std; int main(int argc, char *argv[]) { unsigned int N = 0, base = 0; vector<unsigned int> result; unsigned int i = 0; cin >> N >> base; do { result.push_back(N % base); N /= base; }while(N); unsigned int size = result.size(); bool flag = true; for(i=0;...
true
81da66d95d6f60019d53ded236c985ded72a4ff4
C++
Azure/azure-sdk-for-cpp
/sdk/core/azure-core/inc/azure/core/internal/diagnostics/log.hpp
UTF-8
7,443
3.03125
3
[ "MIT", "LicenseRef-scancode-generic-cla", "curl", "LGPL-2.1-or-later", "BSD-3-Clause", "ISC" ]
permissive
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma once #include "azure/core/diagnostics/logger.hpp" #include "azure/core/dll_import_export.hpp" #include <atomic> #include <iostream> #include <sstream> #include <type_traits> namespace Azure { namespace Core { namespace Diagnostics { ...
true
b906860d074d0faf6c610fd8329fb459d5f30a5a
C++
joycitta-siqueira/ProgramacaoEstruturada
/ordenacao.cpp
UTF-8
439
3.25
3
[]
no_license
// ORDENAÇÃO #include <stdio.h> int main() { int num[5] = {0, 3, 1, 4, 2}, i, j, aux; for (i = 0; i < 4; i++) { for (j = i + 1; j < 5; j++) { if (num[i] > num[j]) { aux = num[i]; num[i] = num[j]; num[j] = aux; ...
true
c3c736bed3d5b3db41ec5a3d728f05c123b39d42
C++
maomihz/kattis
/src/battlesimulation/battlesimulation.cpp
UTF-8
1,134
2.609375
3
[]
no_license
#include <iostream> #include <sstream> #include <stdexcept> #include <vector> #include <string> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <queue> #include <deque> #include <stack> #include <climits> #include <algorithm> #include <stdio.h> #include <stdlib.h> using namesp...
true
dd6cb62681042c146b423165d76054a39a02bcdb
C++
yukar1z0e/0day-Security
/Pointer/Pointer.cpp
UTF-8
2,782
2.90625
3
[ "Apache-2.0" ]
permissive
// Pointer.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <stdio.h> void f1(int x, int y, int* sum, int* product) { *sum = x + y; *product = x * y; }; int sum, product; void main() { f1(123, 456, &sum, &product); printf("sum=%d, product=%d\n", sum, product); }; /* --- C:\Users\test\0daySecurity\Pointer\Poin...
true
931ef9460db442499d4bb6cc6bb162a4841fda26
C++
dtraczewski/zpk2014
/home/dtraczewski/z2/nwd.cpp
UTF-8
377
2.890625
3
[]
no_license
#include <iostream> using namespace std; int nwd (int a, int b) { int r = a % b; while (r != 0) { a = b; b = r; r = a % b; } return b; } int main() { unsigned short n, a, x; cin >> n; cin >> a; x = a; for (unsigned short i = 2; i <= n; i++) { cin >> ...
true
b0dd98904c17ead0b3bd198c27ad84b197f24230
C++
shiinamiyuki/lunatic
/include/lunatic/opcode.h
UTF-8
1,840
2.546875
3
[ "MIT" ]
permissive
#pragma once #include <lunatic/common.h> namespace lunatic { constexpr size_t REG_MAX = 256; enum class Opcode { Add, //ABC Sub, //ABC Mul, //ABC Div, //ABC Mod,//ABC iDiv, //ABC, Concat, //ABC And, Or, Not, Neg, Len, LT, GT, LE, GE, NE, EQ, LoadNil, LoadInt, // A i32 LoadFlo...
true
57758f3e2354ca78358e7e871a55abad9ae769b6
C++
TrieuKhanh/thuvientinh
/phepcong.cpp
UTF-8
502
2.59375
3
[]
no_license
#include "phepcong.h" #include <iostream> phepcong::phepcong(const int a, const int b) { std::cout << __FUNCTION__ << "__builtin_extract_return_addr(__builtin_return_address(0)): " << __builtin_extract_return_addr(__builtin_return_address(0)) << &std::endl; std::cout << __FUNCTION__...
true
13edbcc3d091aa9ff9c72fab61c0521e952318ae
C++
prestocore/browser
/adjunct/m2/src/backend/irc/color-parser.h
UTF-8
3,414
2.546875
3
[]
no_license
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2006 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef IRC_COLOR_PARSER_H #define IRC_COLOR_PARSER_H # include "...
true
8483e3242f0066f7f71eb8137f55bad02ad9e914
C++
lewisHeath/VisualSorter
/visualSorter/src/drawer.cpp
UTF-8
801
3.078125
3
[]
no_license
// // drawer.cpp // visualSorter // // Created by Benjamin Lewis-Jones on 26/10/2021. // #include "../headers/drawer.hpp" ///* #include <iostream> using namespace std; //*/ Drawer::Drawer() : square(sf::Vector2f(20.0f, 20.0f)) { square.setFillColor(sf::Color::Red); square.setPosition(-20.0f, 20.0f); }...
true
44985309659d6d2a6b3fc2b19ac17adf4b01c008
C++
niuxu18/logTracker-old
/second/download/git/gumtree/git_repos_function_4895_git-2.3.10.cpp
UTF-8
296
2.515625
3
[]
no_license
static void pretty_print_menus(struct string_list *menu_list) { unsigned int local_colopts = 0; struct column_options copts; local_colopts = COL_ENABLED | COL_ROW; memset(&copts, 0, sizeof(copts)); copts.indent = " "; copts.padding = 2; print_columns(menu_list, local_colopts, &copts); }
true
9daee7164a6f058f3ea3903b81588468e6ca42fa
C++
GKimGames/parkerandholt
/Box2DandOgre/include/FSMStateMachine.h
UTF-8
4,402
3.140625
3
[]
no_license
/*============================================================================= FSMStateMachine.h Author: Matt King Finite State Machine =============================================================================*/ #ifndef FSMSTATEMACHINE_H #define FSMSTATEMACHINE_H #include "FSMState.h" #in...
true
06c9c153427be89f3e97a610c6aab9bce2cc0f3f
C++
MarUser04/Sudoku-Binario
/main.cpp
UTF-8
2,397
2.6875
3
[]
no_license
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <conio.h> #include <time.h> struct Mapa{ int **matriz; int filas, columnas; }; void cargarmatriz(Mapa *mapa); void mover(Mapa *mapa); int main(int argc, char** argv) { system("color b"); srand(time(0)); Mapa mapa; ca...
true
cd0a2b0aed133c50ac63bc14230118578ec4ef94
C++
SUQIGUANG/loop_subdivision
/src/LOOP.cpp
UTF-8
3,295
3.125
3
[ "MIT" ]
permissive
// loop-subdivision // // Author : Mi, Liang (Arizona State University) // Email : icemiliang@gmail.com // Date : Feb 22nd 2020 // License : MIT #include "LOOP.h" #include <assert.h> #include <math.h> #include <float.h> #include <iostream> #include <sstream> using namespace MeshLib; LOOP::LOOP(Mesh * mesh...
true
ea803319c6e5e7b51a07068947fd23196b3a9fd2
C++
xuxinqiujiaoyizhiyang/c-normal
/c/Huffman tree.cpp
GB18030
3,657
2.796875
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include<string.h> typedef struct BiThrNode { float weight; int parent,lchild,rchild; char data; } HTNode,*HuffmanTree; typedef char** HuffmanCode; void Select(HuffmanTree HT,int n,int &s1,int &s2)//parent=0С { float *a; int x=1; s1=0,s2=0; a=(float *)malloc(10...
true
4325ee16c9e7727c5b6f189011ac6ee27cafb3c1
C++
DongJunK/Algorithm
/line/2018/C.cpp
UTF-8
435
2.75
3
[]
no_license
#include <iostream> #include <algorithm> #include <vector> using namespace std; int toilet[151] = {0,}; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin>>n; while(n--) { int start,end; cin>>start>>end; for(int i=start;i<end;++i) { ...
true
490156e4c34148c07a8d01e4b91c0ce870e9d65d
C++
andNikita/KR_oskolkov
/mycompute.cpp
UTF-8
4,332
3.34375
3
[]
no_license
/* создаем 2 массива, один для хранения чисел, второй для хранения операций. просбегаем по всем возможным вариантам, сохраняем в строках те, которые подходят и выводим ектор строк. пояснение за массив операторов "operators" | res = 16 data 1 2 4 operators OP_NO OP_PL то есть после единицы не ставить ника...
true
e02eddf3dda7574465e3a88ab389b55a7709a29b
C++
mdakram09/C-and-Cpp-Practice
/votingAge.cpp
UTF-8
272
3.140625
3
[]
no_license
#include<iostream> using namespace std; int main() { int age; cout<<"Please enter your age \t : \t \n"; cin>>age; if(age>=18) { printf("Yes! You can vote, beacause your age is %d \n", age ); } else { printf("No! you cannot vote, your age is %d \n", age ); } }
true
4e5db0c895cf4009f8dd1ceec7900ca14da13bc5
C++
ritish73/codingBlocksPractice
/largest_histogram_area.cpp
UTF-8
1,375
3.390625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int largestHistogramArea(int* a, int n){ stack<int> s; s.push(0); int area = 0 , maximum_area = INT_MIN; int i; for(i=1; i<n; i++){ cout<<" for i = "<<i<<" stack size is "<<s.size()<<endl; int cur_val = a[i]; cout<<"cur val is "<<cur_val<<" and s.top is "<<...
true
de59234b50d62b3fec6b153891923555ce58f849
C++
jayacosta/TPI_LAB1
/TPI LAB1/Tp de lab/juego.h
ISO-8859-1
4,232
2.671875
3
[]
no_license
#pragma once #include <iostream> #include <stdlib.h> using namespace std; #include "menu.h" #include "dado.h" #include "combinaciones.h" int juegodeuno() { int puntos_c; int puntosronda=0; bool turnode= true; bool generala_s; int maxp=0;//Acumulador que me indica la puntuacin ...
true
ff24e329e656a5e8696abeb9f3f26bae7c11bfef
C++
hugh-jazz/bigkek
/ECE220_Lab1.cpp
UTF-8
1,166
3.90625
4
[]
no_license
#include <stdio.h> #include <stdlib.h> int main(void){ //declare the valuables int program_gussed_number; int user_hint; int counter = 1; //stores the number of times the program guessed the value int min; int max; //ask the user for two values that defines the range for...
true
970bb674d522ddebc8bcfe18c403f27dcc5c328d
C++
Cece-L/Code
/C++/二进制.cpp
GB18030
194
2.671875
3
[]
no_license
#include<iostream> using namespace std; int main(){ int x; int y; cout<<"һʮƵ"<<endl; cin>>x; while(x!=0){ y=x%2; cout<<y; x=x/2; } return 0; }
true
6adc385476c395f86c09beb78f01c4b14b2c8237
C++
jwbecalm/Head-First-Design-Patterns-CPP
/Composite/src/Waitress.cpp
UTF-8
624
2.8125
3
[]
no_license
#include "Waitress.hpp" #include <iostream> #include "Iterator.hpp" #include "Menu.hpp" Waitress::Waitress(MenuComponent* components) : m_components(components) { } Waitress::~Waitress() { } void Waitress::printMenu() { m_components->print(); } void Waitress::printVegetarianMenu() { ...
true
9bea3fcf10d276c8d04d9fbd792dbf0f2a37ef8b
C++
terpos/Birday
/Birday_arcade/Birday_arcade/src/Entities/Enemy/Weapon/E_Weapon.h
UTF-8
1,238
2.984375
3
[]
no_license
/* Classes that inherit this class will use the same functions */ #include "global.h" #include "Asset_management/Image.h" #include "Asset_management/Sound.h" #pragma once class E_Weapon { public: //puts in initial value E_Weapon(Image &sprite_sheet, int x, int y, int vel, int direction); ~E_Weapon(); //gets x p...
true
9b54ca86c3bc065951bcb946acee64d1242fc984
C++
nelson510/LeetCode
/21. Merge Two Sorted Lists Modified.cpp
UTF-8
966
3.75
4
[]
no_license
/** Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->4, 1->3->4 Output: 1->1->2->3->4->4 * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNo...
true
a219af4a45250c68a683936fe451a328930f1648
C++
m4n1c22/opovlint
/test/src/tests/ExplicitCastMatchSet.inl
UTF-8
1,469
2.53125
3
[ "MIT" ]
permissive
SIMPLE_TEST1("A static cast." , SCAST("a") , SCAST_S("a")); SIMPLE_TEST1("A static cast of a binary op." , SCAST("a*ab") , SCAST_S("a*ab")); SIMPLE_TEST1("A static cast of a nested binary op." , SCAST("a*ab*aa") , SCAST_S("a*ab*aa")); SIMPLE_TEST1("A static cast of a casted variable." , SCAST(SCAST_T...
true
93c43bfa2a4404fc19452a92bc77daf1120e2b2c
C++
dowmq/HelloGameWorld
/MonsterFactory.cpp
UTF-8
1,328
2.75
3
[]
no_license
#include "MonsterFactory.h" #include "CWindow.h" #include <string> #include <exception> #include "SpriteProvider.h" CMonster* MonsterFactory::CreateGoblin(float logical_x, float logical_y) { try { CMonster* monster = new CMonster(logical_x, logical_y); monster->sprites[CMonster::MonsterSprite::walking...
true
2b5ff12c27e956db761a290a7a3bb6499b1b61bc
C++
Isprinsessan/TNM096-Labs
/Lab2/Task 3 and Task 4/Lab2/Lab2/State.cpp
UTF-8
5,887
3.296875
3
[]
no_license
#include "stdafx.h" #include "State.h" using namespace std; State::State() { //Create a random schedule and calculate the number of conflicts in it //srand(time(0)); std::random_shuffle(std::begin(schedule), std::end(schedule)); numberOfConflicts = GetNumberOfConflicts(); } void State::Solve() { int totNrOfC...
true