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
7287eca09651eb9dcfd85b902c3dc77011563d48
C++
utkarsh914/LeetCode
/Arrays and hashing/870. advantage-shuffle.cpp
UTF-8
1,686
3.5
4
[]
no_license
// https://leetcode.com/problems/advantage-shuffle/ /* Given two arrays A and B of equal size, the advantage of A with respect to B is the number of indices i for which A[i] > B[i]. Return any permutation of A that maximizes its advantage with respect to B. Example 1: Input: A = [2,7,11,15], B = [1,10,4,11]...
true
04a3547c302035dc8e7e8eb1d1eabfb1b9d536aa
C++
ssiloti/http
/uri/basic_uri.hpp
UTF-8
3,991
2.625
3
[ "BSL-1.0" ]
permissive
#ifndef URI_BASIC_URI_HPP #define URI_BASIC_URI_HPP // Copyright 2009 Dean Michael Berris, Jeroen Habraken. // Copyright 2011 Steven Siloti. // 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) #include <ur...
true
2dc67db796b7c8177845c969b8bd61a20740c93b
C++
TylerMayxonesing/Uno
/Card.cpp
UTF-8
376
3
3
[]
no_license
// // Created by T Alpha 1 on 11/2/2019. // #include "Card.h" Card::Card(std::string value, std::string color){ m_value = value; m_color = color; } std::string Card::getValue(){ return m_value; } std::string Card::getColor(){ return m_color; } void Card::setValue(std::string value){ m_value = value; } v...
true
a449b724741bbcb039ad6d16d6937baaf47c0e09
C++
FrancoisSestier/fast_io
/helpers/bufsiz/iobuf.h
UTF-8
18,308
2.671875
3
[ "MIT" ]
permissive
#pragma once namespace fast_io { template<typename T,std::size_t alignment=4096> struct io_aligned_allocator { using value_type = T; using size_type = std::size_t; using difference_type = std::ptrdiff_t; [[nodiscard]] inline #if __cpp_lib_is_constant_evaluated >= 201811L && __cpp_constexpr_dynamic_alloc >= 20190...
true
01275ed4271d2b728d9146bd6be1f088e03554b0
C++
mas1904/SimpleGameInSFML
/src/item.cpp
UTF-8
2,177
2.828125
3
[]
no_license
#include "item.h" item::item() { item::count=0; build=false; //ctor } item::item(sf::Sprite s){ } item::~item() { //dtor } void item::set_count(short c){ item::count = c; } void item::setId(short c){ item::id = c; } void item::setHp(short c){ item::hp = c; } void item::setAD(short ...
true
9c36140148f576d2521fe415d1e18244ecbf6723
C++
xblunja/CubeMegaMod
/cwmods/cube/Item.h
UTF-8
1,037
2.65625
3
[ "MIT" ]
permissive
#ifndef ITEM_H #define ITEM_H #include "Spirit.h" #include "../common/Vector2.h" namespace cube { class Creature; class Item { public: char category; //3 bytes padding int id; unsigned int modifier; IntVector2 region; char rarity; //3 bytes padding int formula_c...
true
b3fda40d5ddde983c96fca69aa472b2864389747
C++
blegloannec/CodeProblems
/ACM-ICPC/Others/1113.cpp
UTF-8
2,652
3.203125
3
[]
no_license
#include <iostream> #include <vector> using namespace std; // Trie + kinda Backtracking with memoization (kinda DP too) typedef long long ll; typedef vector<bool> morse_string; /* Binary Trie for morse words terminal is the number of morse words of the dictionary that end on the current node (we know there ar...
true
d1c54163e98e474c39cb7a0e89d745851edba151
C++
hs-krispy/BOJ
/Choose number.cpp
UTF-8
1,020
2.765625
3
[]
no_license
// // Created by 0864h on 2021-01-10. // #include<iostream> #include<algorithm> #include<vector> using namespace std; int N; bool check[101], num_check[101]; vector<int> v[101], result, ans; void choose(int start, int next) { if(!result.empty() && start == next) { for(int i = 0; i < result.size(); i++) ...
true
dd87af9e1bafde44a78922baffcfbbc9c94e96f8
C++
jrtokarz/QtStackedBar
/QStackedBar.hpp
UTF-8
1,116
2.53125
3
[]
no_license
// // Created by jrt on 9/7/19. // #ifndef QTSTACKEDBAR_QSTACKEDBAR_HPP #define QTSTACKEDBAR_QSTACKEDBAR_HPP #include <QtCore> #include <QWidget> #include <initializer_list> class QStackedBar : public QWidget { Q_OBJECT public: struct Segment { int value; QColor colour; }; ...
true
3bd53b48b9ec47de2a51c85c1fc97e285edebaf5
C++
Cloudxtreme/CyberBot
/src/cyber_logger.cpp
UTF-8
528
2.90625
3
[]
no_license
#include "cyber_logger.h" CyberLogger::CyberLogger(void){ filePath = "main_log.log"; fileOut.open(filePath, std::ios_base::app); if(!fileOut.is_open()){ std::cout << "Error: could not open file for appending, creating a new one." << std::endl; fileOut.open(filePath); } fileOut << "STARTED LOGGING\n"; } Cy...
true
a5f33a2beb6c941dc72844dba76515519f387147
C++
rbx1219/cmaesXD
/FHH/gene.hpp
UTF-8
707
2.96875
3
[]
no_license
#ifndef _gene_hpp #define _gene_hpp #include <iostream> #include "random.hpp" using namespace std; class gene { public: double Allele; int code; gene() {} gene( const double v ) { Allele = v; } gene( const gene &g ) { Allele = g.Allele; } ~gene() {} void random(); double allele() { return Allele; }...
true
82070ff066090bf3dffa3b70f0069b16df7acc8c
C++
christianyoedhana/CppPractice
/Learn Advanaced Modern C++/Logger/TextLogger.cpp
UTF-8
896
3.5
4
[]
no_license
/* Logger is a text logger. User specifies the complete file path and name in the constructor. Logger constructor must be non-converting and take a std::string User enters the log using a function "log" that takes a std::string Logger does not provide a timestamp entry. User is responsible for giving a complete string ...
true
8d1ae115db707dd9f21f75422306683e8dc34c1a
C++
Shung-2/Scott_Pilgrim
/MapManager.cpp
UTF-8
1,562
2.78125
3
[]
no_license
#include "stdafx.h" #include "MapManager.h" HRESULT MapManager::Init() { sinkholeStartX = 2940; sinkholeEndX = 3340; sinkholeStartZ = 380; sinkholeEndZ = 568; slopeStartX1 = 16920; slopeEndX1 = 17240; slopeStartZ1 = 380; slopeEndZ1 = 800; slopeStartX2 = 18900; slopeEndX2 = 191...
true
a7e8ba5e417df65346a375257e048efc4168fbc7
C++
Ciamek/SDiZO_1
/Lista.cpp
UTF-8
3,851
3.671875
4
[]
no_license
// // Created by Maciej Ciura on 14.03.2020. // #include<iostream> #include "Lista.h" using namespace std; Lista::Lista() { head = nullptr; tail = nullptr; size = 0; } Lista::~Lista() { for (int i=0; i<size; i++) { ListEl *temp = head->next; delete head; head=temp; } ...
true
cdbd9e7267719804b7f3512ad2ba5e1cdebebef8
C++
Atsushi4/qtngy_examples
/Threading/threadnewmanager.cpp
UTF-8
1,830
2.734375
3
[]
no_license
#include "threadnewmanager.h" #include <QThread> #include <QDebug> class ThreadNewManager::CustomThread : public QThread { Q_OBJECT public: explicit CustomThread(QObject *parent) : QThread(parent) {} const QList<Worker*> &workers() {return workers_;} void go() {emit startWork();} signals: void sta...
true
22ec305e22e638124b71ecb76c22103972b1a027
C++
RaykoEZ/PPP_Asteroids
/PPP_Assteroids_Proj/include/GameObjects.h
UTF-8
4,718
3.125
3
[]
no_license
#ifndef GAMEOBJECTS_H #define GAMEOBJECTS_H #include <cmath> #ifdef WIN32 #include <Windows.h> // must be before gl.h include #endif #if defined (__linux__) || defined (WIN32) #include <GL/gl.h> #endif #ifdef __APPLE__ #include <OpenGL/gl.h> #endif #include "Vec4.h" ///\file GameObjects.h /// \author Chengy...
true
f9c8dfde047260754ad61a1432b26bb741a08214
C++
sogapalag/contest
/hackerrank/hourrank-21/c.cpp
UTF-8
3,847
2.578125
3
[]
no_license
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <str...
true
8799c7188e0cfc69918ce1bba13f55b42766e93c
C++
ChoiCheoulWon/BasicEngineeringDesign
/BasicEngineeringDesign/Project_1/project_1.cpp
UHC
2,963
3.875
4
[]
no_license
/* Ʈ1 Էµ Ģ ϴ α׷ ڸ ڸ Էµȴٰ Ҽ ° ڸ ϴ ޸𸮰 ִٰ ޸ ʱⰪ = 0 ޸𸮿 ڿ ڰ Ŀ '.' Է ݺϿ Է¹޴´. '.' ԷµǸ ޸𸮿 α׷ 䱸 ڡ Է ޴´. ȯ gcc Ѵ  0 ޽ Էµ Ѵ ڸ Է ϴ Ҽ ° ڸ ϳ. Ģ ݵ Լ ̿Ͽ ´. ޸𸮿 ϴ Լ ݵ call by reference Ѵ. ݺ Ѵ. */ #include <iostream> using namespace std; doubl...
true
9e81aef344f7c43f298fabcc9faf7f2e8fd0f5a9
C++
mokerjoke/Halide
/cpp/src/Reduction.h
UTF-8
882
2.765625
3
[ "MIT" ]
permissive
#ifndef HALIDE_REDUCTION_H #define HALIDE_REDUCTION_H #include "IntrusivePtr.h" namespace Halide { namespace Internal { struct ReductionVariable { std::string var; Expr min, extent; }; struct ReductionDomainContents { mutable RefCount ref_count; vector<ReductionVariable> domain; }; class ReductionD...
true
dbbdf7b3331a66cdaeb13e044eb00b9f05845a7b
C++
dzwduan/cpp-prog-lang-ex
/9_Statements/Ex/2/Source.cpp
UTF-8
525
3.53125
4
[ "MIT" ]
permissive
/* [2] (∗1) See how your compiler reacts to these errors: void f(int a, int b) { if (a = 3) // ... if (a&077 == 0) // ... a := b+1; } Devise more simple errors and see how the compiler reacts. */ #include <iostream> void f(int a, int b) { if (a = 3) std::cout << __LINE__ << "\n"; // no warning //if (a & 077 == 0...
true
c67699bc293630a0e31849c463c2dc0f93f87019
C++
maobing/AlgorithmsInCpp
/exponentialMA.cpp
UTF-8
946
3.640625
4
[]
no_license
// exponential moving average // S_t = a * Y_t + (1-a) * S_t-1 #include<vector> #include<iostream> using namespace std; class Solution{ public: Solution(): n(5) {} void expMA(const vector<double> &data) { if (data.size() == 0) return; alpha = 1.0/data.size(); movingAverage.push_back(data[0...
true
a258d84b286e6658ed5e248f4a5686abf6e2fcff
C++
OC-MCS/prog4-mortgage-01-DylanF967
/Prog4-Mortgage/main.cpp
UTF-8
1,703
3.609375
4
[]
no_license
//Dylan Fortney // Programming 2 // Mortgage #include <iostream> #include "Mortgage.h" #include <string> #include <iomanip> using namespace std; //This calls all the member functions and gets the needed values from them and it asks the user for the needed starting info //such as the interest on the loan and the n...
true
fc415de5d27581a4d887f74d441c8e182a98167a
C++
TrueAstralpirate/3DRenderer
/sources/camera.cpp
UTF-8
4,425
2.9375
3
[]
no_license
#include <math.h> #include <iostream> #include "camera.h" namespace Project { Camera::Camera(Eigen::Vector4d position, double rotX, double rotY, double rotZ) : position(position), shortBasis(4, 2) { Eigen::Vector4d v1 = Eigen::Vector4d::UnitX(); Eigen::Vector4d v2 = Eigen::Vector4d::UnitY(); Eigen::Matri...
true
2f9e13e7719690051789a2fbc37a130eaf08c4f8
C++
Snake266/labs_cpp
/6/six.cpp
UTF-8
10,195
3
3
[]
no_license
#include <iostream> #include <iomanip> #include <algorithm> #include <cstring> #define sep_len 40 //Копирует строку и возвращает указатель новую строку char* alloc_and_copy(char* str) { char* res = new char[strlen(str) + 1]; if(!res) throw std::exception(); strcpy(res, str); res[strlen(res)] = '\0'; ...
true
5881451e0b8a9cba158c57c6eb8538fa15d07735
C++
zhangchenghgd/zeroballistics
/code/libs/toolbox/src/Utils.h
UTF-8
6,506
3.125
3
[]
no_license
#ifndef LIB_UTILS_INCLUDED #define LIB_UTILS_INCLUDED #include <string> #include <iostream> #include <cmath> #include <sstream> #include "Datatypes.h" #include "Exception.h" #include "utility_Math.h" #define UNUSED_VARIABLE(v) (void)v; #define DELNULL(p) if(p) { delete p; p=NULL; } #define DELNULLAR...
true
cf5c655d5c625c5d7a3404754bc2c5e9402648f3
C++
kiriyasaa/learn-cpp
/Chapter P/617-introduction-to-iterators/back-to-range-based-for-loops.cpp
UTF-8
233
3.578125
4
[]
no_license
#include <array> #include <iostream> int main() { std::array array{1, 2, 3}; // This does exactly the same as the loop we used before. for (int i : array) { std::cout << i << ' '; } std::cout << '\n'; return 0; }
true
5423611171e0f0a55b72bbf21b0be0ba699e8fc9
C++
Viswonathan06/AlgoDS
/Arrays/FourSumNumbers.cpp
UTF-8
2,235
3.171875
3
[]
no_license
#include<bits/stdc++.h> using namespace std; bool included(vector<vector<int>> arr, vector<int> m ){ for( vector<int> a: arr){ if( a == m){ return true; } } return false; } vector<vector<int> > fourSum(vector<int> &arr, int k) { // St...
true
bbca7fb517dd65dcb9683ae671eed9bd34beac7b
C++
VityaP/AlgoLib
/simple_vector/simple_vector.cpp
UTF-8
2,715
3.375
3
[]
no_license
#include "simple_vector.h" template<typename T> SimpleVector<T>::SimpleVector(){ data = nullptr; size = 0; capacity = 0; } template<typename T> SimpleVector<T>::SimpleVector(size_t size) : data(new T[size]), size(size), capacity(size) { } template<typename T> SimpleV...
true
28858679b486a86f65212ca6860a3b9858a52d72
C++
realme72/beginning
/chapter 8/example/p812.cpp
UTF-8
795
2.9375
3
[ "MIT" ]
permissive
#include <bits/stdc++.h> using namespace std; #define row1 3 #define col1 4 #define row2 col1 #define col2 2 int main() { int mat1[row1][col1],mat2[row2][col2],mat[row1][col2]; int i,j,k; printf("Enter matrix mat1(%d*%d) row-wise \n",row1,col1); for(i=0; i<row1; ++i) for(j=0; j<col1; ++j) scanf("%d",&mat1[i...
true
51e6dda4f130d6d9f3de10ef36f211c08033cca8
C++
csamon/SurpriseControle
/SurpriseControle.ino
UTF-8
3,541
2.875
3
[]
no_license
// // --------------------------- // Programme Surprise Controle // --------------------------- // // Brancher aléatoirement des periph d'acquisition sur les entrées analogiques (un potar sur A1, A5 et un switch sur A4 par exemple), // brancher un periph audio sur la pin 9 (buzzer, HP+transistor,..), // brancher des pe...
true
696b768c368eba5249644815dc64d6a035a31e20
C++
houtaru/ACM-Notebook
/code/convexhull.h
UTF-8
968
3
3
[]
no_license
// Complexity: O(nlog(n)) template <class T> struct ConvexHull { int head, tail; T A[maxn], B[maxn]; ConvexHull(): head(0), tail(0) {} bool bad(int l1, int l2, int l3) { return 1.0 * (B[l3] - B[l1]) / (A[l1] - A[l3]) < 1.0 * (B[l2] - B[l1]) / (A[l1] - A[l2]); ...
true
abec92494fe0cf9d12c5e65bb0bfe4af0865de02
C++
gitjinyubao/MyProject
/PreviousProjects/C++Project/友元类/友元成员函数/Person.h
GB18030
327
2.6875
3
[]
no_license
#ifndef PERSON_H #define PERSON_H #include<string> using namespace std;//ûͲstring class Member; class Person { friend class Member; public: Person(string name,string sex,int age); private: void printMessage(); string m_strName; string m_strSex; int m_iAge; }; #endif
true
56b9b151abf1b099a10e84d165af9e489bf65521
C++
kishankr7979/CP
/largest_prime_factor.cpp
UTF-8
1,161
2.640625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; using ll = long long; #define MAX 10000 class Solution { public: long long int largestPrimeFactor(int N) { // code here bool prime[N + 1]; memset(prime, true, sizeof(prime)); prime[0] = prime[1] = false; for (int i = 2; i <= N; i++) { if (prime[i]) { ...
true
49b842e5d5d591ed30986e31187b659f08a47031
C++
cevazrem/Calculator
/Calc.cpp
UTF-8
2,380
3.453125
3
[]
no_license
#include <iostream> #include <stack> class LexAnalyser { private: int cur; public: int get_lex(); }; int LexAnalyser::get_lex() { while ((cur = getchar()) && (isspace(cur)) && (cur != ';')) {} return cur; } class Parser { private: LexAnalyser scanner; int cur; std::stack <int> result...
true
f3968c3a466c2852501d1fec0e7687e916b808ca
C++
tommyg141/EX4_b
/sources/Board.hpp
UTF-8
821
2.5625
3
[]
no_license
#pragma once #include <map> #include "City.hpp" #include "Color.hpp" #include <set> using namespace std; namespace pandemic { class Board { set<City> research_station; set<Color> discovered_cure; static std::map<City, std::set<City>> connect_maps; std::map<City, int> temp; static std::ma...
true
2b7edf1bf2cf35fac78282eeb0ce6ddc72bfb30a
C++
Wprofessor/DataStruct
/队列.cpp
GB18030
1,078
3.375
3
[]
no_license
#include<stdio.h> #include<iostream> #include<string.h> #define MAXSIZE 100 using namespace std; typedef int datatype; typedef struct { datatype a[MAXSIZE]; int front; int real; } sequence_queue; void init( sequence_queue *q ) { q->front = q->real = 0; } int empty(sequence_queue q) { return ( q.front == q.real )?1...
true
5de9b08d252f0a1814af1a7968b1bf2684549a7d
C++
roomyroomy/algorithm
/algospot/ROOTS.cpp
UTF-8
835
3.34375
3
[]
no_license
#include <iostream> #include <vector> #include <cmath> using namespace std; double calc(vector<double> &equation, double x) { double result = 0.0; int n = equation.size(); for(int idx = 0; idx < n; idx++) { result += pow(x, (n - idx - 1)); } return result; } double solve(vector<double> &equation) { doubl...
true
dc7bbac7039297873d50b7540cfa311fc09673a7
C++
myartings/yfs-1
/lock_server.cc
UTF-8
1,762
2.78125
3
[]
no_license
// the lock server implementation #include "lock_server.h" #include <sstream> #include <stdio.h> #include <unistd.h> #include <arpa/inet.h> #include "jsl_log.h" lock_server::lock_server(): nacquire (0) { pthread_mutex_init(&mutex, NULL); } lock_protocol::status lock_server::stat(int clt, lock_protocol::locki...
true
98f65b06f23a5b76c1aeca877dc3032988529631
C++
godnoTA/acm.bsu.by
/3. Структуры данных/28. Расписание #1089/[OK]224604.cpp
UTF-8
2,992
2.84375
3
[ "Unlicense" ]
permissive
#include <iostream> #include <fstream> #include <vector> #include <set> #include <algorithm> int main() { std::ifstream fin("input.txt"); int m, n; fin >> n;//quantity of jobs std::vector<int> sequence(n, 0);//contains optimal sequence std::vector<long long> processTimes(n, 0ll);//co...
true
765cdb21fd4fbf4076b367e7d7a738bf567a37d6
C++
jkred369/code_lib
/lock_tools.cpp
UTF-8
1,697
3.546875
4
[]
no_license
//基于pthread_mutex 实现一个互斥锁 class Mutex { public: Mutex() { m_count = 0; m_threadID = 0; //pthread_mutexattr_t attr; //pthread_mutexattr_init(&attr); //pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); //pthread_mutex_ini...
true
2c49733aa21841378f067f61e2664a24c827634e
C++
angrilove/Repositories
/ThinkInCpp/circle.h
UTF-8
305
2.71875
3
[]
no_license
#ifndef CIRCLE_H #define CIRCLE_H #include "shape.h" class Circle : public Shape { public: Circle(Point2D p, double rdi = 0.5) : Shape(p) { radius = rdi; } void draw() { // do someting here } private: double radius; // error: double radius = 0.5; }; #endif
true
6bd23adc89ed5931a8bc84e906c04bf52a4e6a39
C++
jimmylin1017/UVA
/12019 - Doom's Day Algorithm.cpp
UTF-8
477
3.09375
3
[]
no_license
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; int main() { string day[7] = {"Sunday", "Monday", "Tuesday", "Wednesday","Thursday", "Friday", "Saturday"}; int mon[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int n,m,d,count; cin>>n; while(n--) { cin>>m>>d; count = 0; for(...
true
ee08b3c18939b0c2dd064a47854dbc302465e5cb
C++
NullSeile/UITools
/src/Graph.cpp
UTF-8
7,738
2.609375
3
[ "Apache-2.0" ]
permissive
#include "Graph.h" #include "Line.h" #include <cmath> #include "Global.h" namespace ui { Graph::Graph(const std::string& id) : UIObject(id) , m_pos(0, 0) , m_size(100, 100) , m_backColor(sf::Color::White) , m_axisColor({ 10, 10, 10 }) , m_axisWidth(2) , m_gridWidth(1) { } void Graph::SetPosition(c...
true
5fa5d0016e5e25a57f2d2d720c10f57df86e834d
C++
prudentboy/leetcode
/Solutions/229.majority-element-ii.cpp
UTF-8
983
3.140625
3
[]
no_license
/* * @lc app=leetcode id=229 lang=cpp * * [229] Majority Element II */ class Solution { public: vector<int> majorityElement(vector<int>& nums) { vector<int> ans; if (nums.empty()) return ans; int ma(0), mb(0), cnta(0), cntb(0); for (int n : nums) { if (ma == ...
true
18c717ab56ca8904241eb98b2e63b00f41277055
C++
coreymack224/Ent
/Ent/FullTextureRenderer.h
UTF-8
627
2.609375
3
[]
no_license
//FullTextureRenderer.h #pragma once #include"RendererBase.h" class FullTextureRenderer : public RendererBase { vector<GLfloat*> positions; vector<VertexArrayObject*> vaos; vector<GLfloat*> scales; vector<GLuint*> textures; GLfloat* transformMatrix; int positionUL, scaleUL, textureUL, transformMatrixUL; public:...
true
b5d8a95c47b2cd5575a3949ca0d6d7c4bdce53be
C++
RoseAlice2018/AlgorithmProblemSet
/公司/字节跳动/技术中台/124.cpp
UTF-8
1,291
3.0625
3
[]
no_license
#include <iostream> #include <vector> #include <numeric> #include <limits> using namespace std; // Definition for singly-linked list. struct ListNode { int val; ListNode *next; ListNode() : val(0), next(NULL) {} ListNode(int x) : val(x), next(NULL) {} ListNode(int x, ListNode *next) : v...
true
9f9931afdd1e3777e16f5b74488d0b739165edb9
C++
kunni918/magic
/cpp/src/core/simulations/VdpTag.cpp
UTF-8
8,582
2.53125
3
[ "MIT" ]
permissive
#include "core/simulations/VdpTag.h" #include "core/Util.h" #include <opencv2/core/types.hpp> #include <opencv2/imgproc.hpp> #include <random> namespace simulations { VdpTag::Action VdpTag::Action::Rand() { Action action(std::uniform_real_distribution<float>(0, 2 * PI)(Rng())); action.look = std::bernoulli_distr...
true
202499436f7f0df49d68794749699a7f5af793fe
C++
kalokshukla/Boggle
/Boggle.cpp
UTF-8
10,968
2.984375
3
[]
no_license
/* * File: Boggle.cpp * ---------------- * Created by Alok K Shukla on July 4th 2012 * Copyright (C) 2012 MNNIT Allahabad. * * This code simulates playing of classic "Boggle" word building game. * Objective of this project is to effectively use recursive strategies. * */ #include <iostream> #include "gboggl...
true
b346498faeca2e0e10850997b768de73f5bd14d9
C++
davo16dev/my_coj_solutios
/JDkaka-p3757-Accepted-s1096604.cpp
UTF-8
625
2.953125
3
[]
no_license
#include <bits/stdc++.h> using namespace std; void cantDiv(int n){ int imp = 1; int sol = 1; for(int i = 2; i * i <= n; i++){ int e = 0; while(n % i == 0){ e++; n /= i; } sol *= (e + 1); if(i & 1){ imp *= (e + 1); } } ...
true
32934437edbe9f72b76422aa5099b58f2488e94c
C++
denghc/danmugame
/RSEngine/TextureManager.cpp
UTF-8
1,672
2.984375
3
[]
no_license
#include "TextureManager.h" #include "TextureClass.h" #include "GraphicsClass.h" TextureManager* TextureManager::m_instance = 0; TextureManager::TextureManager(void) { } TextureManager::~TextureManager(void) { } void TextureManager::Initialize() { this->m_textureList.clear(); } void TextureManager::Shutdown() { ...
true
228597942b8b3c2f016024789d47c6bd0f979658
C++
grant-h/gfx
/engine_template/CameraObject.hpp
UTF-8
1,255
2.640625
3
[ "MIT" ]
permissive
#ifndef _CAMERA_OBJECT_HPP #define _CAMERA_OBJECT_HPP #include <glm/glm.hpp> #include <memory> #include <string> #include <SceneObject.hpp> class CameraObject : public SceneObject { public: CameraObject(const char * name); virtual ~CameraObject(); void position(glm::vec3 & pos) override; void posit...
true
87adf5446e63df21ea7f38f6cf9a4c0575d1c0d7
C++
Phu-Mine/ArduinoHeroLive
/Stepper/Ramp15_Test/Ramp15_Test.ino
UTF-8
2,059
2.953125
3
[]
no_license
// Control stepper speed from an Arduino UNO. //X int enX = 38 ; int dirPinX = A1 ; int stepPinX = A0 ; //Y int enY = A2 ; int dirPinY = A7 ; int stepPinY = A6 ; //Z int enZ = A8 ; int dirPinZ = 48 ; int stepPinZ = 46 ; //E0 int enE0 = 24 ; int dirPinE0 = 28 ; int stepPinE0 = 26 ; //E1 int enE1 = 30 ; int dirPinE1 = 3...
true
e6af434b85d8fdca6771e44891b9dbb9dc814838
C++
LorenzM/Converter
/Picture/Picture.cpp
ISO-8859-1
2,874
3.03125
3
[]
no_license
#include "Picture.h" Picture::Picture(string file="Ouran.ppm", int step=16){ fileName=file; boost::iostreams::mapped_file mmap(fileName, boost::iostreams::mapped_file::readonly); pointer_mmap = mmap.const_data(); mmap_length = pointer_mmap + mmap.size(); this->step=step; setPicPara(); FFillStructureWi...
true
a80963e8ae1832b0868c283ebda7c298bc302f0d
C++
rishabh-live/oop-w-cpp-4-sem
/Labs/Lab 2/q3_c.cpp
UTF-8
385
2.6875
3
[]
no_license
#include <iostream> using namespace std; int main() { int n; cout<<"Enter Grid Size: "; cin>>n; for(int i=0;i<n;i++) { for(int j=1;j<=n;j++) { cout<<"+-----"; } cout<<"+"<<endl; for(int j=1;j<=3;j++) { for(int k=1;k<=n;k++) { cout<<"| "; } cout<<"|"<<endl; } } for(int j=1;j<=...
true
05c447fd22667365f017878824eef98b6a2e40ba
C++
HScarb/CPPLearn
/CPP5_10-2_14.12.21/CPP5_10-2_14.12.21/源.cpp
UTF-8
839
3.421875
3
[]
no_license
#include<iostream> #include<iomanip> #include<string> #include<cstring> using namespace std; class Person { public: Person(){ lname = ""; fname[0] = '\0'; } Person(const string & ln, const char * fn = "Heyyou") //#2 { lname = ln; strcpy(fname, fn); } void Show()const; //firstname lastname format void Forma...
true
3b379fc15f9a8c7e4f3e449801351068c6b541c6
C++
neurovertex/graphshell
/core/box.cpp
UTF-8
4,764
2.78125
3
[]
no_license
#include "graphshell.h" #include "sockets/controlsockets.h" namespace graphshell { using namespace graphshell::sockets; /*! * \brief Creates a new Box, adds the general input (start, stop) and output (started, stopped) control (signal) sockets. * \param typeName Box::typeName * \param autostart Box::autostart */...
true
cc4e8690afb3ba1f2489c65a167f09b190fca2d6
C++
JIbald/Doorman_raspberry
/src/eyes_servos.cpp
UTF-8
1,975
2.90625
3
[]
no_license
// #include <wiringPi.h> // #include <stdio.h> // #include <stdlib.h> // #include <stdint.h> // int main (void) // { // int bright ; // printf ("Raspberry Pi wiringPi PWM test program\n") ; // if (wiringPiSetup () == -1) // exit (1) ; // pinMode (1, PWM_OUTPUT) ; // for (;;) // { // for (bright = 0 ; brig...
true
78a798b97162356262e51b3e0aaa4d9c666c457b
C++
SharktasticA/Demo-SearchAlgorithms
/Source.cpp
UTF-8
604
2.8125
3
[]
no_license
#include "NodeLoader.h" #include "BFS.h" #include "DFS.h" #include "Dijkstra.h" using namespace std; int main(void) { try { NodeLoader nL("Map.txt"); vector<Node*> map = nL.GetNodes(); BFS bfsAl(map, "Andor", "Tau Ceti"); string path = bfsAl.Run(); cout << "BFS result:\n" << path << endl; DFS dfsAl(ma...
true
ed4b8ce08bd914b04e519a8719d48fe391a1c82e
C++
chanhx/PAT
/1090/1090.cc
UTF-8
1,328
3.25
3
[]
no_license
#include <cstdio> #include <vector> #include <queue> using namespace std; void BFS(const vector<vector<int>> &tree, int root, double p, const double r, double &highest_price, int &count) { highest_price = 0; count = 0; queue<int> q; q.push(root); whil...
true
e9e7ddbf55291263ff282dec50e19b4a6c5875ad
C++
wangrui22/haze
/AIGames/Include/Core/ortho_camera.h
UTF-8
1,247
2.59375
3
[]
no_license
#ifndef ARITHMETIC_ORTHO_CAMERA_H_ #define ARITHMETIC_ORTHO_CAMERA_H_ #include "Core/camera_base.h" #include "Core/quat4.h" #include "Core/vector2.h" class OrthoCamera : public CameraBase { public: OrthoCamera(); OrthoCamera(double left, double right, double bottom, double top, double near, double far0); ...
true
b3cec25156373ef6ffd7f208ef06fac3770a8290
C++
ProMoriarty/PointToOffer
/OJ43 N个骰子的点数.cpp
UTF-8
1,467
3.421875
3
[]
no_license
// // Created by ProMoriarty on 2017/9/8. // /** * n个骰子的点数 * 题目:把n个骰子扔在地上,所有骰子朝上一面的点数之和为S。输入n,打印出S的所有可能的值出现的概率。 */ //方法一:递归 // 思路:设n个骰子某次投掷点数和为s的出现次数是F(n, s),那么,F(n, s)等于n - 1个骰子投掷的点数和为 //s - 1、s - 2、s - 3、s -4、s - 5、s - 6时的次数的总和: //F(n , s) = F(n - 1, s - 1) + F(n - 1, s - 2) + F(n - 1, s - 3) + F(n - 1, s...
true
9aaaf3e336dd9eef4c1d7ed1ac48e172e9b93026
C++
lindobyte/cpprestapi
/src/resource/country/Country.cpp
UTF-8
1,214
2.625
3
[]
no_license
#include "Country.hpp" using namespace std; using namespace web; using namespace utility; using namespace http; using namespace web::http::experimental::listener; Country::Country(uri_builder uri) : Resource(uri.append_path(U("country")).to_string()) /*: Resource(uri.append_path(U("Country")).to_uri().to_stri...
true
f9554d294da657b41f1488f3fb46f16e12758afa
C++
ningjingdemayi/zhada
/subway4/subway4_main.cpp
UTF-8
6,497
2.8125
3
[]
no_license
#include <iostream> #include <string> #include <vector> #include <fstream> #include <sstream> #include <time.h> #include <stdio.h> #include "Station.h" #include "Log.h" using namespace std; vector<Station> stations; vector<Log> logs; bool stations_exist(int station_id); void print_stations(const vector<Station> ...
true
acb67f369d47a2d6cca2360b4ce1e7d9ca190cd8
C++
Emrace/Intro-Programming-2015
/71602_Юлиана Стайкова - checked/zadacha1.cpp
UTF-8
740
3.21875
3
[]
no_license
#include<iostream> using namespace std; int pr_chislo(int num) { if ((num >= 7) && (num <= 39)) { //got the idea, almost right for the task at hand - +0.3 if (((num%num == 0) && (num % 1 == 0)) && ((num % 2 == 0) || (num % 3 == 0) || (num % 5 == 0) || (num % 7 == 0))) return true; else return false; } ...
true
9a07346c6dfd9ccafcb7c0b527fae5a5528129b9
C++
kengonakajima/snippets
/cpp/cppsort/aho.cpp
UTF-8
487
3.40625
3
[]
no_license
#include <vector> #include <algorithm> #include <iostream> class X { public: X(int hoge ){ v = hoge; } int v; }; bool operator<(const X&a, const X&b) { return a.v < b.v ; } int main() { X x1(10); X x2(1); X x3(5); std::vector<X>v; v.push_back(x1); ...
true
aef6f90856de503f9d5860f7cbd98949b7188aa9
C++
frankynous/Sensoj-Project
/src/stars.cpp
UTF-8
1,076
2.90625
3
[]
no_license
#include "stars.h" stars::stars() { } stars::~stars() { } void stars::setup() { quantity = 1000; posXstar.resize(quantity); posYstar.resize(quantity); sizeStar.resize(quantity); for (int i = 0; i < posXstar.size(); i++) { posXstar[i] = ofRandom(-1000,1000); posYstar[i] = ofRandom(-1000,1000); sizeStar[i...
true
70cf6329eaaa3994076897ce6d85a8698c979edc
C++
assceron/collaborative-real-time-editor
/TextEditorServer/NetworkClasses/CursorPosition.h
UTF-8
2,276
2.75
3
[]
no_license
// // 14/09/2019. // #ifndef TEXTEDITOR_CURSORPOSITION_H #define TEXTEDITOR_CURSORPOSITION_H #include "GenericMessage.h" #include "../CustomCursor.h" class CursorPosition : public GenericMessage{ public: inline explicit CursorPosition(QJsonObject json): GenericMessage(std::move(json)){}; inline CursorPositio...
true
d976aa5d3d2a23d6b961f622db9f25b722c7d75b
C++
CISVVC/cis201-chapter06-vectors-cmmoritz
/main.cpp
UTF-8
1,306
3.15625
3
[]
no_license
/* Description: Program will store a day, amount, and description. It will list the daily transactions and balances. It will calculate balances and interest. File: main.cpp Author: Christina Moritz Date: 11-8-18 */ #include<iostream> #include "transaction.h" #include "transactionlog.h" void add_transactions(Transac...
true
09941a050c6909c9e53afba8bfb8e2db7cc7c3d4
C++
ysakasin/zipper
/src/huffman.cpp
UTF-8
449
2.859375
3
[ "MIT" ]
permissive
#include "huffman.h" #include <iostream> using namespace std; std::pair<uint16_t, int> static_huffman_table(uint16_t x) { if (x <= 143) { return {0b00110000 + x, 8}; } else if (x <= 255) { return {0b110010000 + (x - 144), 9}; } else if (x <= 279) { return {0b0000000 + (x - 256), 7}; } else if (x <= 287) {...
true
be16bf205e35f3fe75285156aff76d3d75110760
C++
legend507/Snippet
/Print All Path from Root to Leaf.cpp
UTF-8
1,108
3.765625
4
[]
no_license
/* Facebook Interview Question Print all path from root to left -> dfs */ #include<vector> #include<iostream> using namespace std; struct node{ char data; node *left; node *right; node(char d): data(d), left(nullptr), right(nullptr){} }; class solution_fbpath{ public: // dfs void printAllPath(node *root){ ...
true
8ea24d46f0dbbf11b386331162059c5f31518a2c
C++
naelstrof/Syme
/src/system/print.hpp
UTF-8
948
2.859375
3
[]
no_license
#ifndef AS_PRINT_H_ #define AS_PRINT_H_ #include <boost/nowide/iostream.hpp> namespace as { template<typename T, typename... Args> int printf( const char* s, T value, Args... args ); int printf( const char* s ); }; template<typename T, typename... Args> int as::printf( const char* s, T value, Args... args ) { ...
true
bba5ec6227bb3214a14e54a9d456aea52984a99c
C++
opencv/opencv
/modules/objdetect/src/aruco/apriltag/unionfind.hpp
UTF-8
4,275
2.5625
3
[ "Apache-2.0" ]
permissive
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. // // Copyright (C) 2013-2016, The Regents of The University of Michigan. // // This software was developed in the APRIL Robot...
true
0c2283d9542f8f1007634d8918835d2ca76a9429
C++
tdm1223/Algorithm
/acmicpc.net/source/2018.cpp
UTF-8
567
3.625
4
[ "MIT" ]
permissive
// 2018. 수들의 합 5 // 2019.08.10 // 수학 #include<iostream> using namespace std; int main() { int n; cin >> n; int ans = 0; // n이하로 반복을 돌린다. for (int i = 1; i <= n; i++) { int tmp = 0; // i부터 n까지 연속된 수의 합을 계산해본다. for (int j = i; j <= n; j++) { tmp += j; // 동일하다면 연속된 수로 표현 가능 if (tmp == n) { ...
true
fdebf67d723eaa0c795c339cf75044f093d8641a
C++
green-fox-academy/Dextyh
/Game/game.h
UTF-8
1,987
2.734375
3
[]
no_license
#ifndef GAME_GAME_H #define GAME_GAME_H #include <iostream> #include <SDL.h> #include <SDL_log.h> #include <SDL_image.h> #include <SDL_ttf.h> #include "resources.h" //Screen dimension constants const int SCREEN_SIZE = 600; const int SCREEN_WIDTH = SCREEN_SIZE; const int SCREEN_HEIGHT = SCREEN_SIZE; //The window we'...
true
bdeb6fc6e45c015841ea40b8cd844c22c7f29804
C++
Hyukli/leetcode
/763.cpp
UTF-8
807
3.078125
3
[]
no_license
#include<iostream> #include<map> #include<vector> using namespace std; class Solution { public: vector<int> partitionLabels(string S) { map<char,int> m; for(int i=0;i<S.size();i++) { m[S[i]]=i; } vector<int> ans; int t=m[S[0]]; for(int i=0;i<S.siz...
true
b15e7f6f60988fa1c0f3699bb406766de1b3c96f
C++
KrazyTako/space-shooter
/spaceShooter/main.cpp
UTF-8
8,413
2.546875
3
[]
no_license
#include <iostream> #include <SDL.h> #include <SDL_image.h> #include <SDL_mixer.h> #include <SDL_ttf.h> #include <string> #include <sstream> #include "player.h" #include "enemy.h" #include "asteroid.h" #include "boss.h" using namespace std; extern int const windowWidth = 640, windowHeight = 480; void init(SDL_Window...
true
650ba5a892e732ca10dbe5c8f267303c30fd8261
C++
HanWool-Jeong/Zigzag
/PlatformFuncs.cpp
UHC
2,303
2.578125
3
[ "MIT" ]
permissive
#include "PlatformFuncs.h" #include "Arrow.h" #include "Timers.h" #include "ScoreBoards.h" extern PlatformPtr platforms[13]; extern ScenePtr scene; extern ArrowPtr arrow; extern MakePlatformTimerPtr platformTimer; extern SpeedupTimerPtr speedupTimer; extern ScoreBoardPtr clickNumScore; extern SurviveBoardPtr surviveTi...
true
54d8d21471235c3b15cf3a0c0b5686ab0a63db82
C++
ndsev/zserio
/compiler/extensions/cpp/runtime/src/zserio/JsonEncoder.cpp
UTF-8
2,271
2.9375
3
[ "BSD-3-Clause" ]
permissive
#include <iomanip> #include <cmath> #include <array> #include "zserio/JsonEncoder.h" namespace zserio { void JsonEncoder::encodeNull(std::ostream& os) { os << "null"; } void JsonEncoder::encodeBool(std::ostream& os, bool value) { os << std::boolalpha << value << std::noboolalpha; } void JsonEncoder::encode...
true
86046e371a6a9633658762c9f07668df2150d659
C++
Bracciata/Advent-of-Code-2020
/Day Four/part1.cpp
UTF-8
3,116
3.453125
3
[]
no_license
#include <iostream> #include <fstream> #include <string> #include <array> using namespace std; // main() is where program execution begins. int main() { int valid = 0; fstream inputFile; // Reading a file from https://www.tutorialspoint.com/read-data-from-a-text-file-using-cplusplus#:~:text=Read%20Data%20...
true
468adb5cedda255ff35245a04cb2ace201eb750a
C++
cms-sw/cmssw
/SimTracker/TrackHistory/interface/Utils.h
UTF-8
1,416
2.796875
3
[ "Apache-2.0" ]
permissive
#ifndef Utils_h #define Utils_h #include <map> #include <utility> #include <vector> //! Generic matching function template <typename Reference, typename Association> std::pair<typename Association::data_type::first_type, double> match(Reference key, ...
true
ebd89753438f88cd0e54b64f4d9ff56d3d76ee93
C++
aceiii/cryptopals-cpp
/set_3_21.cpp
UTF-8
741
2.90625
3
[]
no_license
#include <iostream> #include <random> #include "mt19937.hpp" auto main() -> int { const uint32_t seed = 5489u; int N = 10240; // The 10000th consecutive invocation of a default-contructed std::mt19937 is required to produce the value 4123659995. std::mt19937 std_mt(seed); mt19937 mt(seed); ...
true
fff27b6071567389322cc49e9e9a52bfc31727d6
C++
AmrARaouf/algorithm-detection
/graph-source-code/29-C/9367425.cpp
UTF-8
781
2.515625
3
[ "MIT" ]
permissive
//Language: GNU C++ #include <map> #include <cstdio> #include <vector> #include <iterator> using namespace std; map< int, vector<int> >adj; void dfs(int node, int prev){ printf("%d ", node); for (int i = 0; i < adj[node].size(); i++){ if (adj[node][i] == prev) continue; dfs(adj[node]...
true
576fd9dd989481c13f116dfca63dc3b453e25162
C++
asdatapel/feud
/Client/include/AnimationDefinition.hpp
UTF-8
878
2.859375
3
[]
no_license
#ifndef FEUD_ANIMATIONDEFINITION_HPP #define FEUD_ANIMATIONDEFINITION_HPP #include <functional> #include "glm/glm.hpp" #include "glm/gtc/quaternion.hpp" struct AnimationDefinition { unsigned int entityId; glm::vec3 startPosition; glm::quat startRotation; glm::vec3 endPosition; glm::quat endRotat...
true
fe981040fe3a43b6649e4e5aa34742652b8f4abe
C++
CDDDJ-A-2015/Project
/EditProject.cpp
UTF-8
5,518
2.546875
3
[]
no_license
/* * File: EditProject.cpp * Author: dm940 * * Created on 14 May 2015, 6:01 PM */ #include "EditProject.h" #include "Project.h" #include "Coco1.h" #include "Coco2.h" #include "FuncPoints.h" #include <QMessageBox> #include "TeamMembers.h" using namespace std; EditProject::EditProject() { widget.setupUi(this); ...
true
8e6150ec418abe92a7ed64deb8cca0e1e0c1d55a
C++
ZFDxiaoer/algorithm
/quicksort.cpp
UTF-8
1,454
2.859375
3
[]
no_license
#include <bits/stdc++.h> #include <iostream> #include <vector> #include <map> #include <limits> #include <climits> #include <algorithm> #include <queue> #include <stack> #include <unordered_map> #include <set> #include <unordered_set> #include <math.h> #include <sstream> #include <deque> #include <ctime> using namespa...
true
142714628ad68f069e62b82416ef9dcf9a44d42d
C++
gargVader/CPP-Data-Structures-Algorithms-Launchpad
/Binary Tree/11. Nodes at distance K from from given target node.cpp
UTF-8
2,339
3.90625
4
[]
no_license
#include<iostream> #include<queue> using namespace std; class node { public: int data; node *right = NULL; node*left = NULL; node(int d) { data = d; } }; node* buildTree() { int d; cin >> d; // Base Case if (d == -1) { return NULL; } node *root = new node(d); root->left = buildTree(); root->right ...
true
8b5613ff34b775d7d8c83d021d105e0191937607
C++
warzes/Soulvania
/code/SoulVania/WhipFlashingRenderingSystem.cpp
UTF-8
3,243
2.671875
3
[ "MIT" ]
permissive
#include "stdafx.h" #include "WhipFlashingRenderingSystem.h" #include "MathHelper.h" #include "Whip.h" #include "Settings.h" WhipFlashingRenderingSystem::WhipFlashingRenderingSystem(Whip &parent, std::string spriteConfigPath) : WhipRenderingSystem{ parent, spriteConfigPath } { } void WhipFlashingRenderingSystem::Rec...
true
cc5caf1fdcf86fe152140b45da8473f639bcf4c7
C++
ennis/stronghold
/code/src/shape/Polygon2D.cpp
UTF-8
1,342
3.125
3
[]
no_license
#include "Polygon2D.hpp" #include <sstream> Polygon2D::Polygon2D() : Shape(ST_Polygon, glm::vec3(), glm::quat()) {} void Polygon2D::addPoint(glm::vec2 const &point) { points.push_back(point); } std::string Polygon2D::toString() const { std::ostringstream ss; std::vector<glm::vec2>::const_iterator it = points.begi...
true
7b5c71343226b2db7fd392cb09bf7179a71ba0f2
C++
Primus023008/LeetcodeSolutions_cpp
/Maths/Easy/ExcelSheetColumnTitle.cpp
UTF-8
732
3.359375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; class Solution { public: char toChar(int n) { if (n == 0) return 'Z'; return char(64 + n); } string convertToTitle(int columnNumber) { string str = ""; while (columnNumber > 0) { char...
true
4eea624b1c96a6949c469a6792573eae75d6cecd
C++
ajay09/design_patterns
/behavioral/1_strategyPattern/3_dynamic_array_7.cpp
UTF-8
6,781
3.75
4
[]
no_license
/* A thread-safe Array class using Strategy Pattern. Applying Strategy Pattern Our previous approach led to a lot of conditional statements. In this case the different algo are locking and not-locking. Thus we take these algo out and encapsulate them in their own classes. - Create a base-class that will ...
true
8357337f8abb9626270e9ae7e6c38ca6b7a2b16f
C++
dominik3131/PO
/PO/complex/wyk3/07-vector/testvector.cpp
UTF-8
239
2.84375
3
[]
no_license
#include <iostream> using namespace std; #include "vector.h" void printvector (vector v) { cout << v << endl; } int main () { vector a (10); cout << a << endl; a[0] = 15; a[5] = 32; vector b(10); b=a; printvector (b); }
true
c6d69e8182a181319a80c35b2bcfe824909da75b
C++
Totomosic/Ablaze2
/Ablaze/src/Scene/Scene.h
UTF-8
1,500
2.625
3
[]
no_license
#pragma once #include "Common.h" #include "Layer.h" namespace Ablaze { struct LayerMask; // Object that stores and manages all relavent Entities and Cameras class AB_API Scene : public Object { private: std::unordered_map<String, Layer*> m_Layers; std::vector<Layer*> m_LayerOrder; Layer* m_CurrentLayer; ...
true
9353a1acc5aad47c94576c0238fdb4df9c2d6626
C++
yyzYLMF/myleetcode
/54_spiral_matrix.cc
UTF-8
2,309
3.78125
4
[]
no_license
/* @yang 2015/3/13 Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the following matrix: [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] You should return [1,2,3,6,9,8,7,4,5]. */ #include <iostream> #include <cstdlib> #include <vector> using names...
true
2bf3c178f30c0b341ea8aa1a168b5b968be76fe7
C++
Bona612/GOP
/src/Game/Game.cpp
WINDOWS-1252
8,191
3.015625
3
[]
no_license
#include <iostream> #include <cstring> #include <iomanip> #include "Game.h" #include "../Dice/Dice.h" #include "../Box/VoidBox.h" #include "../Box/DrawCardBox.h" #include "../Box/MoveBox.h" #include "../Box/MissTurnBox.h" #include "../Box/BackStartBox.h" #include "../Box/StartBox.h" #include "../Box/FinishBo...
true
e7f6501b57f5e3432a370c7a454151f5c72e38c2
C++
huynguy97/IP-Week11
/main.5952043835344930115.cpp
UTF-8
3,645
3.4375
3
[]
no_license
#include <iostream> #include<cassert> #include<cmath> #include<string> // // using namespace std; int power (int base, int exponent) { // assert(exponent >= 0); // if (exponent == 0) ...
true
f104d2eaceb1aca918fcac38240c938b729b367f
C++
JanMalitschek/Gel
/Gel/Camera.cpp
UTF-8
1,991
2.78125
3
[]
no_license
#include "Camera.h" namespace Gel { glm::vec3 Camera::position = glm::vec3(0.0f, 0.0f, 0.0f); glm::vec3 Camera::up = glm::vec3(0.0f, 1.0f, 0.0f); glm::vec3 Camera::front = glm::vec3(0.0f, 0.0f, -1.0f); glm::vec3 Camera::right = glm::normalize(glm::cross(up, front)); glm::mat4 Camera::projection = glm::perspectiv...
true
e0989383796a7271f6ec50ccf56fbd95f638d3da
C++
GAlmyre/PFE_Terrain
/include/Sphere.h
UTF-8
8,114
2.765625
3
[]
no_license
#ifndef TERRAINTINTIN_SPHERE_H #define TERRAINTINTIN_SPHERE_H #include <Eigen/Geometry> #include <QOpenGLShaderProgram> #include "OpenGL.h" class Point { public: static void draw(GLFuncs *f, QOpenGLShaderProgram* prg, const Eigen::Vector3f& p) { unsigned int vertexBufferId; f->glGenBuffers(1,&vertexBuffer...
true
c8818dda1c8aaeca7821927741e88581c1cd7e34
C++
fuqinho/ChallengeBook
/quiz/052_01Knapsack/main.cpp
UTF-8
893
2.96875
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define dump(x) cerr << #x << " = " << (x) << endl; int solve(int N, vector<int>& v, vector<int>& w, int W) { // dp[i][j]: i番目までの品物から合計j以下の重さになるように // 選んだ時の...
true
d6e44f8b51f4c63d736f1b9561c17fb8c4893754
C++
tmyksj/atcoder
/AtCoder Beginner Contest 165/C - Many Requirements/main.cpp
UTF-8
935
2.890625
3
[]
no_license
#include <algorithm> #include <iostream> #include <vector> using namespace std; long long solve(int n, int m, int q, vector<int>& a, vector<int>& b, vector<int>& c, vector<int>& d, vector<int>& h) { if (n == static_cast<int>(h.size())) { long long res = 0; for (int i = 0; i < q; i+...
true
d8771720f8ec9aa8df8877e00a493f0d42f7a34b
C++
Counterfeit093/Stuff
/Library.cpp
UTF-8
4,458
3.234375
3
[]
no_license
#include <iostream> #include "Library.h" #include <windows.h> #include <fstream> #include <cstdlib> using namespace std; Library::Library() { takeABook = 0; numberOfAddedBooks = 0; } void Library::addBook(string title, string author) { if(numberOfAddedBooks<listOfBooks...
true