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
2934922086d8ceb37e325d6d0d5d5408d238fd8e
C++
gamecheung/framework
/Qt/XTextLengthEditor.h
UTF-8
1,814
2.859375
3
[]
no_license
#ifndef _X_TEXT_LENGTH_EDITOR_H #define _X_TEXT_LENGTH_EDITOR_H #include <QComboBox> #include <QSpinBox> #include <QTextLength> #include <Qt/XComboBoxHelper.h> class XTextLengthEditor : public QObject { Q_OBJECT signals: void valueChanged(const QTextLength& value); public: XTextLengthEditor(QComboBox* combo,QSpi...
true
c2d0b72289a80bc1756827da0672d8aba34ce0bc
C++
Zumisha/FPTL
/Testing/Arrays/ArrayGetErrors.cpp
UTF-8
5,071
2.65625
3
[ "MIT" ]
permissive
#include "../Shared.h" namespace UnitTests { namespace Arrays { TEST(ArrayGetErrors, PositiveOOR) { const std::string innerCode = R"(@ = ((3 * 0).arrayCreate * 3).arrayGet.print;)"; std::stringstream expected; FPTL::Parser::Support::printPositionalMessage(expected, 1, 43, FPTL::Runtime::ArrayValue::bad...
true
9624fa34de2c53f4e5aa8de04520f9837dda1dd4
C++
AykanAkdag/rwth_infoprak1
/Versuch05Teil2/ListElem.cpp
UTF-8
1,367
3.8125
4
[]
no_license
/** * @file ListElem.cpp * * @brief ListElem Class methods */ #include "ListElem.h" ListElem::ListElem(const Student &s, ListElem* const nextPointer, ListElem* const prevPointer): data(s), next(nextPointer), prev(prevPointer) { } /** * @brief Setter method for the 'data' variable of the ListElem class * *...
true
030590bd6293eb172d1fbb03f7d3f2446d0a08e5
C++
yushroom/pat-basic
/1005.cpp
UTF-8
1,168
3.03125
3
[]
no_license
// PAT 1005 // // cpp by yunkang yu #include <iostream> using namespace std; int num[100+5]; bool covered[100+5]; // is covered int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> num[i]; covered[i] = false; } // bubble sort for (int i = 0; i < n; i++) { ...
true
deb3ff1360d6b7770009239a176c66e762e89c10
C++
bohaoist/OxSocket
/examples/mini_udp_client.cpp
UTF-8
334
2.765625
3
[]
no_license
#include <iostream> #include <string> #include <OxSocket.h> int main() { char buf[255]; int bsize = 0; std::string msg = "Hello World"; OxSocket::UDPClientSocket sock("127.0.0.1", 1234); sock.send(msg.data(), msg.size()); bsize = sock.recv(buf, sizeof(buf)); std::cout << std::string(buf, bsize) << std::endl; ...
true
3b44ddd1d840921ac7c996c9cd4a7487df4af59f
C++
sotigr/CppGrades
/src/CsvReader.cpp
UTF-8
685
2.75
3
[]
no_license
#include "CsvReader.h" CsvReader::CsvReader(const char *filePath) { path = new char[strlen(filePath)]; strcpy(path, filePath); } CsvReader::~CsvReader() { delete [] path; } CSV_RESULT * CsvReader::read(const bool skipFirstLine) { CSV_RESULT * rows = new CSV_RESULT(); ifstream infile(path); ...
true
d02e8d9bee0a823fd9bd6115da230bb60ef5f968
C++
LeptusHe/raytracer
/src/textures/imgtexture.cc
UTF-8
730
2.65625
3
[]
no_license
#include "textures/imgtexture.h" #include <fstream> namespace leptus { ImageTexture::ImageTexture(const std::string& image_path, const MappingPtr& mapper) : image_(std::make_shared<Image>(image_path)), mapper_(mapper) { } ImageTexture::ImageTexture(const ImagePtr& image, const MappingPtr& mapper) : image_(image...
true
96be89a7774aaea934587746d18d53bf44112148
C++
POD153/C-
/li0102.cpp
UTF-8
202
3.21875
3
[]
no_license
#include<iostream> using namespace std; int sum(int x,int y) { int z; z=x+y; return z; } int main(void) { int a,b,c; a=3;b=5; c=sum(a,b); cout<<c<<'\n'; return 0; }
true
281f372b1235a878729b8659d63f1816f3dc5bca
C++
izzyreal/vmpc-unreal-plugin
/VmpcPlugin/Source/ThirdParty/include/mpc/src/lcdgui/TwoDots.cpp
UTF-8
2,724
2.5625
3
[]
no_license
#include <lcdgui/TwoDots.hpp> #include <gui/Bressenham.hpp> #include <Util.hpp> using namespace mpc::lcdgui; using namespace moduru::gui; using namespace std; TwoDots::TwoDots() { selected = vector<bool>(4); visible = vector<bool>(4); // for (int i = 0; i < 4; i++) //visible[i] = true; //SetDirty(); rect = MR...
true
38934395828c506e30527130091a462dc2cb7f8e
C++
lucast98/Redes
/Trab 2 - Redes/Aplicacao.cpp
UTF-8
5,529
2.96875
3
[]
no_license
/* 10345251 - Higor Tessari 10295180 - Lucas Tavares dos Santos 10716612 - Renan Peres Martins 10373663 - Renata Oliveira Brito */ /** Importamos as bibliotecas iostream pra realizar o fluxo de entrada e saída de dados*/ #include <iostream> /** A biblioteca bits/stdc++ possui uma enorme quantidade de funções padroes,...
true
db7d8dba756daa2599eeb819c8bb0f0fd32ae68c
C++
Carlos-Santos-Altamirano/Trabajo_algoritmo
/partidos.cpp
UTF-8
2,064
3.171875
3
[]
no_license
#include <iostream> int matriz [5][4]; using namespace std; void llenar(); void mostrar(); int multiplicar(); int suma(); int main(){ llenar(); mostrar(); multiplicar(); suma(); resultado(res); } int suma() { int i,c,res; for (i=1;i<=5;i++) { for (c=1;c<=4;c++) { if(c=2) { res=res+matriz[i][c];...
true
df10e2fc5c5ed9b0741397acde8db0641c56a148
C++
shawwwn/YDWE
/Development/Editor/Core/ydbase/base/lua/make_range.h
UTF-8
1,556
2.625
3
[ "Apache-2.0" ]
permissive
#pragma once #include <base/config.h> #include <base/lua/state.h> namespace base { namespace lua { template <class T> int convert_to_lua(state* ls, const T& v); template <class F, class S> int convert_to_lua(state* ls, const std::pair<F, S>& v) { int nresult = 0; nresult += convert_to_lua(ls, v.first); nr...
true
0bf7ccb767050f2ac62d117f670085d215e69658
C++
nitsiey4u/CodeExercise
/LinearDS/shift_sort_arrays.cpp
UTF-8
4,870
3.96875
4
[]
no_license
/***********************************************/ /***** Basic Array Related Problems **********/ /***********************************************/ #include <cstdio> #include <cstdlib> #include <algorithm> // Class for array of shifting elements class ShiftArray { protected: int* arr; int size; int usage; p...
true
2a9a87022ccc7001cb03ceadcff51357a699b55f
C++
alecches/raytracer
/src/light/PointLight.h
UTF-8
563
3.046875
3
[]
no_license
#pragma once #include "../light/Light.h" class PointLight : public Light { private: Tuple position_; Color intensity_; public: PointLight(Tuple p, Color c) :position_{ p }, intensity_{ c } {} PointLight(const PointLight& pl) : position_{ pl.position() }, intensity_{ pl.intensity() } {} Color intensity() const { ...
true
061d8fc748c5d1819217151948cd89a29ec1d133
C++
arcsridhar/Programming-Practicum
/Stack/Stack.cpp
UTF-8
878
3.453125
3
[]
no_license
// File Name: StackDriver.cpp // // Author: Jill Seaman // Date: 4/14/2019 // Assignment Number: 6 // CS 2308.255 and CS 5301 Spring 2019 // Instructor: Jill Seaman // // A demo driver for Stack. // #include <iostream> #include <cassert> #include "Stack.h" Stack :: Stack () { head = NULL; } void Stack :: push(stri...
true
fcf740625cae23d85ba86805d9a5936387350bbb
C++
MinorCollaboration/LINAL
/Framework/SDLFramework/SDLFramework/Linal/graphical3D/3dpoint.cpp
UTF-8
916
2.84375
3
[]
no_license
#include "./3dpoint.h" #include "../constants.h" Linal::G3D::Point::Point() : xAxis(1), yAxis(1), zAxis(1) { } Linal::G3D::Point::Point(double xAxis, double yAxis, double zAxis) : xAxis(xAxis), yAxis(yAxis), zAxis(zAxis) { } Linal::G3D::Point::~Point() { } Linal::G3D::Vector Linal::G3D::Point::ToVector() { return ...
true
24aff28c94ed00bd0c1dc42ecaee8c24b240d559
C++
TerryBryant/MyLeetCode
/towards_offer/62_find_last_remain.cpp
UTF-8
1,299
3.9375
4
[]
no_license
// 问题:将0,1,...n-1这n个数字排成一个圆圈,从数字0开始,每次从圆圈中删除第m个数字,求最后剩的那个数字 // 思路:该圆圈可以看成一个环形链表,于是问题就变成了环形链表中删节点的问题了 // 书上介绍的另一种方法,推了大半天,得到了一个递推公式,真的服了。。 int LastRemaining(unsigned int n, unsigned int m) { if (n < 1 || m < 1) return -1; unsigned int i = 0; std::list<int> numbers; for (int i = 0; i < n; ++i) numbers.push_back(...
true
0b757993c6f9a7fa40dba6b177cea0387a77afc0
C++
Thomas-WebDev/CSS503Project2
/New/Shop.h
UTF-8
1,718
2.984375
3
[]
no_license
#ifndef _SHOP_H_ #define _SHOP_H_ #include <pthread.h> #include <queue> using namespace std; #define DEFAULT_CHAIRS 3 #define DEFAULT_BARBERS 1 class Shop { public: /* Note that this is only a "starter" template provided for your convenience: Among other things, you will need to add some private variable...
true
3d7ce2c78d41d282511e8d8c4eb83ecac3ae2f89
C++
miguelmc/Online-Judge-Problems
/sepap/railroad.cpp
UTF-8
1,950
3.15625
3
[]
no_license
#include <iostream> using namespace std; int main() { int n1, n2, *arr1, *arr2, *result, *temp1, *temp2; cin >> n1 >> n2; while(n1 || n2) { arr1 = new int[n1+1]; arr2 = new int[n2+1]; result = new int[n1+n2]; for(int i=0; i<n1; i++) cin >> arr1[i]; fo...
true
543b1a6fd01f3752c2d899cf1e2b869e828cb62f
C++
impirios/CODE
/parabola.cpp
UTF-8
380
2.671875
3
[]
no_license
#include<iostream> using namespace std; int main() { char pa[6][100]; for(int i=0;i<6;i++) { for(int j=0;j<100;j++) pa[i][j] = ':'; } for(int i=0;(4*i*i)<=100;i++) { int j = 4*i*i; if(i!=0){j--;} pa[i][j] = '*'; } for(int i=0;i<6;i++) { for(int j=0;j<100;j++) cout<</*"[...
true
9827d7577150c29ba1c1d3e2ad79bb83bb339421
C++
team-charls/charls
/src/color_transform.h
UTF-8
4,587
2.75
3
[ "BSD-3-Clause" ]
permissive
// Copyright (c) Team CharLS. // SPDX-License-Identifier: BSD-3-Clause #pragma once #include "util.h" namespace charls { // This file defines simple classes that define (lossless) color transforms. // They are invoked in process_line.h to convert between decoded values and the internal line buffers. // Color transf...
true
93a3cc4b3648e7e292a7e69f5602e1d9625c6956
C++
wowns9270/code_up
/백준/다이나믹 프로그래밍/1520_내리막길.cpp
UTF-8
664
2.5625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int n, m; int arr[501][501]; int dp[501][501]; int dx[] = { 1,-1,0,0 }; int dy[] = { 0,0,1,-1 }; int gogo(int x, int y) { if (x == n && y == m) return 1; int& ret = dp[x][y]; if (ret != -1) return ret; ret = 0; for (int i = 0; i < 4; i++) { int ux = x + dx[i]; ...
true
47765be8b8f94155abf9be6074fee51e9aace2b9
C++
pvdk276/Game_Rockman
/Game_Rockman/Game_Rockman/GameStateManager.cpp
UTF-8
1,282
2.515625
3
[]
no_license
/*+=================================================================== File: GameStateManager.cpp Summary: Định nghĩa các phương thức của CGameStateManager. ===================================================================+*/ #include "GameStateManager.h" //#include "PlayState.h" CGameStateManager* CGameS...
true
6024cbfd62dec86da3912c0916e34982b11203ff
C++
xaderil/Computer_Vision
/Ball.cpp
UTF-8
1,521
2.765625
3
[ "MIT" ]
permissive
#include "Ball.hpp" int Ball::f = 940; int Ball::H_MIN = 0; int Ball::H_MAX = 256; int Ball::S_MIN = 0; int Ball::S_MAX = 256; int Ball::V_MIN = 0; int Ball::V_MAX = 256; Ball::Ball(string Color) { try { JSON_Worker::readHSV(); } catch (exception err) { JSON_Worker::writeHSVFile(); } }; int Ball::getXP...
true
9d70f162b71ecfaf32cb4ffc508847a4b6bd7c0e
C++
burkell530/Repository321
/labs/Lab5/dl_node.cpp
UTF-8
520
2.8125
3
[]
no_license
#include "dl_node.h" DLNode::DLNode() { mp_previous = NULL; mp_next = NULL; m_contents = 0; } DLNode::~DLNode() { } void DLNode::SetContents(int in_contents) { m_contents = in_contents; } void DLNode::SetNext(DLNode* in_next) { mp_next = in_next; } void DLNode::SetPrevious(DLNode* in_previous) { mp_pre...
true
761ed7e037e9575ce9f8979ba19d1ac3af59c118
C++
ParedesNahuel/Proyecto-POO
/tparchivos_lab2.cpp
UTF-8
1,223
2.90625
3
[]
no_license
#include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> #include <fstream> #include <ctime> using namespace std; #include "tipos.h" #include "prototipos.h" #include "funcionesmusicos.h" int main () { int op=1; while (op!=0) { cout<< "MENU PRINCIPAL:"<<e...
true
1293c0f44aa3cf2a5273977c1330dac825b56a12
C++
Viz108/Personal-Projects
/C++ Practice/ArrayDemo/main.cpp
UTF-8
1,724
3.6875
4
[]
no_license
// // ArrayDemo - demonstrate the use of an array // to accumulate a sequence of numbers // #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; // displayArray - displays the contents of the array // of values of length nCount void displayArray(int nValue...
true
21a2e44143d2c4375a9147018b9b8aea5dcfab9a
C++
arturobp3/DataStructures_And_Algorithms
/Ejercicios/63/63/Source.cpp
UTF-8
728
2.859375
3
[]
no_license
// NOMBRE Y APELLIDOS #include <iostream> #include "bintree_ext.h" #include <fstream> using namespace std; bool resuelveCaso() { //Lee los datos bintree_ext<int> arbol = leerArbol_ext(-1); //Calcula el resultado bool binario = arbol.esBinario(); if (binario){ cout << "SI" << endl; } else{ cout << "NO...
true
b64da9828bf13f2624c0575195473588830f1293
C++
Andree6/LP1
/Punteros/Laboratorio1.cpp
ISO-8859-10
441
3.25
3
[]
no_license
#include <iostream> #include <vector> using namespace std; int main (){ cout << "el tamao de char es " << sizeof(char) <<' '<<sizeof('a')<<'\n'; cout << "el tamao de int es " << sizeof(int) <<' '<<sizeof(2+2)<<'\n'; int* p=0; cout << "el tamao de int* es " << sizeof(int*) <<' '<<sizeof(p)<<'\n'; vector<...
true
b99186dd8a9a5a07410ed31d84a9d81a6ff2fac7
C++
bhuman/BHumanCodeRelease
/Src/Modules/MotionControl/WalkingEngine/WalkGenerators/WalkAtSpeedEngine.cpp
UTF-8
3,586
2.828125
3
[ "BSD-2-Clause" ]
permissive
/** * @file WalkAtSpeedEngine.cpp * * This file implements a module that provides walk generators. * * @author Arne Hasselbring */ #include "WalkAtSpeedEngine.h" #include "Representations/MotionControl/MotionRequest.h" MAKE_MODULE(WalkAtSpeedEngine, motionControl); void WalkAtSpeedEngine::update(WalkAtAbsolute...
true
63c65a801101aba96a9fd3684627735019ffc72c
C++
uicus/sbg2gdl
/src/gdl_constants.hpp
UTF-8
3,572
2.828125
3
[]
no_license
#ifndef GDL_CONSTANTS #define GDL_CONSTANTS #include<string> #include"types.hpp" const std::string separator = ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n"; std::string player_name(bool uppercase); std::string piece_name(char symbol, bool uppercase); inline std::string playe...
true
d62287a52d4033b3a3a2d122ce8e58e9b5c9688a
C++
Wizmann/ACM-ICPC
/Codeforces/Codeforces Round #275 (Div. 2)/D.cc
UTF-8
3,978
3
3
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <algorithm> #include <vector> #include <cassert> using namespace std; #define input(x) cin >> x #define print(x) cout << x << endl class SegmentTree { public: SegmentTree(const vector<int>& ns): n(ns.size()) { init(0, n ...
true
c4d01d8effa6e256baaa99d604e4fe6d5daa1cbf
C++
ladinu/CSClasses
/cs260/lab1/list.cpp
UTF-8
8,221
3.171875
3
[]
no_license
#include "list.h" list::node::node(const winery &awinery) { nextByName = NULL; nextByRating = NULL; item = winery(); item.copy(awinery); } list::list() { headByName = NULL; headByRating = NULL; } list::~list() { node * current = NULL; node * next = NULL; ...
true
e659dbf644eb7845c21c575502072caa43a50078
C++
okmonn/DirectX12_3D
/DirectX12_3D/DirectX12_3D/Texture.cpp
SHIFT_JIS
27,409
2.515625
3
[]
no_license
#include "Texture.h" #include "WICTextureLoader12.h" #include <sstream> #include <tchar.h> #pragma comment (lib,"d3d12.lib") // RXgN^ Texture::Texture(std::weak_ptr<Device>dev) : dev(dev) { //WIC̏ CoInitialize(nullptr); //Qƌ result = S_OK; //N origin.clear(); //BMPf[^ bmp.clear(); //WICf[^ wic.clear(); ...
true
2f1d80c9a1dfa910d5befeb922af8b99671eb45a
C++
hrmay/project-euler
/pe10.cpp
UTF-8
570
3.734375
4
[]
no_license
/** Project Euler Problem 10: Summation of Primes pe10.cpp @author Evan May */ #include <cstdlib> #include <iostream> #include <vector> #include "factor.cpp" using namespace std; int main() { long long int sum = 0; for (int i=2; i<2000000; i++) { if (i%10000 == 0) cout<<"Progress: "<<i<<" out of 20000...
true
bbacdd3633ba76a3e4739a82440620e907438126
C++
playbar/kaleido3d
/Source/Core/Os.h
UTF-8
6,875
2.6875
3
[ "MIT" ]
permissive
#ifndef __Os_h__ #define __Os_h__ #include <Interface/IIODevice.h> #include <Config/OSHeaders.h> #include <functional> #include <map> /** * This module provides facilities on OS like: * File,Directory,Socket,Threading */ namespace Os { class K3D_API File : public ::IIODevice { public: File(); explicit File...
true
ae051a59298f810a7c6a1183a41d144c0677220a
C++
zzcym/NEUQ-ACM-Solution
/week1/王劲松/7-5.cpp
UTF-8
619
2.515625
3
[]
no_license
#include<stdio.h> typedef struct { int cx; char a[1000]; }jgou; int main(){ int n,m,i,cnt; scanf("%d%d",&n,&m); jgou xx[n]; for(i=0;i<n;i++){ scanf("%d%s",&xx[i].cx ,&xx[i].a ); } for(cnt=1;m>0;m--){ int j,k; scanf("%d%d",&j,&k); if(xx[cnt-1].cx==0){ if(j==0){ cnt-=k; } else if(j==1){ ...
true
c9dad635ab1b3ba48b2b6f927b5843dda6136a0d
C++
kevharvell/CompSci_I
/week5/Taxicab.cpp
UTF-8
1,582
3.796875
4
[]
no_license
/********************************************************************* ** Author: Kevin Harvell ** Date: 2/3/2018 ** Description: ** Taxicab class has three int data members to store its current x- and y-coordinates and the total distance it has driven so far(actual distance). ** Taxicab has a constructor that...
true
565db4945ea3c6780e42965b37a10f12b0f1d7ef
C++
martinberlin/ESP32-S2
/tests/protocols/http-client/main.cpp
UTF-8
2,419
2.921875
3
[]
no_license
#include "Arduino.h" #include <WiFi.h> #include <HTTPClient.h> HTTPClient http; // A very simple one liner PHP that just returns the time for this TZ String url = "http://fs.fasani.de/time.php?tz=Europe/Berlin"; #define LED_GPIO 17 // Not important int lostConnectionCount = 0; #ifdef S2 void lostCon(arduino_e...
true
2fd6b9eaf6903daf9bce9c7c87143546a7e3f211
C++
kotwani2883/Dsa-Daily-Practice
/Array/TripletWithGivenSum.cpp
UTF-8
718
2.6875
3
[]
no_license
//Tripet with the given sum /*Author-:Palak*/ #include<bits/stdc++.h> using namespace std; #define ll long long int main() { ll t; cin>>t; while(t--) { ll n{},sum{}; cin>>n>>sum; ll a[n]; for(ll i=0;i<n;i++) cin>>a[i]; sort(a,a+n); ll flag{0}; for(ll i=0;i<n-2;i++) { ...
true
0db5193e6764b0ef2e373e908b5fb56dc43e5c49
C++
zeroplusone/AlgorithmPractice
/Leetcode/663. Equal Tree Partition.cpp
UTF-8
972
3.53125
4
[]
no_license
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
true
3c70335685a4c2d882f1151a2a37a2dca29e35a1
C++
siqiliu/FirstWebApp
/nearestWordGeneratorEnc.cpp
UTF-8
3,522
2.6875
3
[]
no_license
#include <sys/stat.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <iostream> #include <string> #include <fstream> #include <vector> #include <cctype> #include <limits.h> #include <math.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <chrono> using names...
true
ac80aae3bfcb025e0fb4fa2a87d6fb8f0ef080d9
C++
WPISmartmouse/Smartmouse_2017
/test/Test.cpp
UTF-8
7,238
2.875
3
[]
no_license
#include <common/AbstractMaze.h> #include <common/Direction.h> #include <console/ConsoleMaze.h> #include <console/ConsoleMouse.h> #include <common/Mouse.h> #include <fstream> #include <common/WallFollow.h> #include <common/Flood.h> #include <common/Node.h> #include "gtest/gtest.h" const char *FLOOD_SLN = "ESSSEESSWSSS...
true
1342deaca36f2f27a007e7605daf2bb3c7b52999
C++
Sartech-B/Competitive-Programming
/CodeChef/p44.cpp
UTF-8
435
2.765625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; string a; cin>>a; bool s = 0, f = 1; for(int i=0; i<n; i++) { if(a[i]=='H') { if(s) { f = 0; break; } s = 1; } if(a[i]=='T') { if(!s) { f = 0; ...
true
a939578db8af0cabf3a8a3bd83e3f9da8d9ec39f
C++
Kanazawanaoaki/software-memo
/soft2/lec07/cpp/client.cpp
UTF-8
6,814
2.5625
3
[]
no_license
#include "Quiz.hh" #include <iostream> /** Name is defined in the server */ #define SERVER_NAME "Quiz" Quiz::QuizServer_ptr service_server; using namespace std; void insert_question(const char* sentence, int numAnswers, Quiz::Answer** answers, int numCorrectAnswers, CORBA::Char* correctAnswers); void create_questi...
true
719dc83d78c13ba5bfa82e17055db5d51bee3e8b
C++
TraurigeNarr/SupportSDK
/Sources/WorldInterfacing/PollingTask.h
UTF-8
1,233
2.9375
3
[ "MIT" ]
permissive
#ifndef __POLLING_TASK__ #define __POLLING_TASK__ #include "TypeDefines.h" #include <functional> namespace SDK { typedef std::function<ulong()> GetTickNumber; template <typename PollingType> struct MetaPollingTask { public: typedef PollingType PollingType; private: uint m_task_code; ulong ...
true
70496a6ac95c28c8c7ee4b135bacdc8c72a1823b
C++
abpprkonsalting/Salva_Red_VisualStudio_Cpp
/SyncFolder/Folder.cpp
WINDOWS-1250
57,328
3.109375
3
[]
no_license
#include "stdafx.h" #include "Common.h" Folder::Folder(){ Files_hashed = FALSE; hashing_algorithm = 0; // Initialize the Folder object arrays. Files.count = 0; Files.items = NULL; Subfolders.count = 0; Subfolders.items = NULL; Path = NULL; Full_name = NULL; Full_name_long = NULL; retur...
true
a8975514062421d827d563f89ee530ffd620cf3a
C++
7xxxx/CryptographicAlgorithms
/src/Public-Key/RabinAttack.cpp
UTF-8
710
2.59375
3
[]
no_license
/* * RabinAttack.cpp */ #include "PublicKeyAlgorithmBox.h" #include "RabinDecryptor.h" #include "RabinAttack.h" using namespace std; RabinAttack::RabinAttack() { } RabinAttack::~RabinAttack() { } int RabinAttack::factorize(const Integer& n, Integer& f, int max_tries, RabinDecryptor& rabin_dec) { PublicKey...
true
a22c1ba59384a89453d49803bdc6d7a0276d0153
C++
PracticallyNothing/SWAN-Game-Engine
/SWAN/Utility/Group.hpp
UTF-8
370
2.640625
3
[]
no_license
#ifndef SWAN_UTILITY_GROUP_HPP #define SWAN_UTILITY_GROUP_HPP #include <array> namespace SWAN { namespace Util { template <typename T, typename Iter> inline constexpr bool IsOneOf(T t, Iter begin, Iter end) { while(begin != end) { if(t == *begin) return true; begin++; } return false; }...
true
4e17dfc778cc3335c0661cad8b242a08e9abae52
C++
laquythi/laquythi.github.io
/C++/66-HocToanTuConTro/main.cpp
UTF-8
1,295
2.890625
3
[]
no_license
#include <iostream> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { int count=100; int *m=&count;//hoac int *m;dong tiep theo m=&count; cout<<"dia chi cua bien count="<<&count<<endl; cout<<"gia tri cua bien ...
true
3be39fa57b2ff99f6bfc2316b4ddcef17e803cc1
C++
dc-maggic/978-7-121-15535-2
/chapter6/practise6_33/practise6_33/practise6_33.cpp
UTF-8
407
3.359375
3
[]
no_license
#include <iostream> #include <vector> #include <string> using namespace std; void factorial(vector<string>::const_iterator beg, vector<string>::const_iterator end) { if (beg != end) { cout << *beg << endl; return factorial(++beg, end); } } int main() { const vector<string> str{ "sasd","sadasf","but","koh" }; a...
true
2299363f2025aa900a31145496191769c960a622
C++
bazindes/algo
/src/ds/BinaryTree.h
UTF-8
591
2.53125
3
[]
no_license
/* BinaryTree.h Created by: baz Date: 2019-04-09 17:13 */ #if !defined(BINARY_TREE_H) #define BINARY_TREE_H namespace BinaryTree { struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(); TreeNode(int x); ~TreeNode(); }; TreeNode* buildBT(int nums[], int n, int i); TreeNode* buildBT...
true
5b9ea3ff642a3fba8d97ea1d8f0484c9ba09826e
C++
vonKleve/Targets
/12-17/ptAbstract_Factory/Abstract_Factory(try1)/Abstract_Factory.cpp
UTF-8
781
2.53125
3
[]
no_license
#include "stdafx.h" #include "Abstract_Factory.h" English* DistributorA::EnglishSubs() { return new English("DistributorA"); } French* DistributorA::FrenchSubs() { return new French("DistributorA"); } English* DistributorB::EnglishSubs() { return new English("DistributorB"); } French* DistributorB::FrenchSubs()...
true
0de9937cdbc25ed72a6dad364ab11387123b21e5
C++
mayankvanjani/OOP
/Lab/LinkedListFunc/rec11.cpp
UTF-8
4,516
3.65625
4
[]
no_license
/* Rec11: Linked Lists Mayank Vanjani 11/17/17 CS2114 NYU Tandon School of Engineering */ #include <string> #include <iostream> using namespace std; struct Node { Node(int data=0, Node* next=nullptr) : data(data), next(next) {} int data; Node* next; }; void listInsertHead(Node*& headPtr, int da...
true
4803c48dc4306611a262e1373843f576e8980d13
C++
NicoG60/OpenOrganigram
/src/Vue/Scene.h
UTF-8
1,567
2.53125
3
[]
no_license
// Scene.h 1.0 21/02/14 N.Jarnoux #ifndef SCENE_H #define SCENE_H class Scene ; //===== Headers standards ===== #include <QGraphicsScene> #include <QGraphicsSceneDragDropEvent> //===== Headers Peros ===== #include "Item.h" #include "Fleche.h" #include "MarqueurDrop.h" class Scene : public QGraph...
true
869228e6c66e7f82da6dbf8aee18470236b6f87d
C++
Developer-Rajeev/code
/return_unit_digit_after_power.cpp
UTF-8
436
3.328125
3
[]
no_license
/* **This question was asked in Nagarro 2020** return unit digit input: x=4 y=4 output: 6 logic: y=0; while(i<y) box=(box*x) return box%10; */ #include<stdio.h> int main() { int x,y,box=1,res,i; printf("enter first number\n"); scanf("%d",&x); printf("enter power value\n"...
true
477cfb18f2db8616ee17a793fede26879e0c3ecd
C++
tomzig16/AoC20
/src/13/day13_main.cpp
UTF-8
4,646
2.640625
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> #include "../HelperFunctions.h" typedef unsigned long long t_ULL; int FirstPart(int minTime, std::vector<int> knownBusses) { std::vector<std::pair<int, int>> earliestAvailable; for (int busID : knownBusses) { int remainder = minTime % busID; ...
true
0d5ac36cac38b4b95e40b714d9598f842665cc02
C++
neelkanjariya1996/Algorithms
/Searching_and_Sorting/pigeonhole_sort.cpp
UTF-8
1,276
3.921875
4
[]
no_license
#include <iostream> #include <vector> using namespace std; void pigeonhole_sort (int arr[], int n) { int index = 0; int range = 0; int min = 0; int max = 0; int i = 0; min = arr[0]; max = arr[0]; for (i = 1; i < n; i++) { if (arr[i] < min) { ...
true
1553aab404f15be91d81a7712f03e5d0efa0d12e
C++
AIREL46/SCAO
/C++/premier.cc
UTF-8
692
3.328125
3
[]
no_license
#include <iostream> #include <cmath> using namespace std; int main() { int n(1); int D(0); do { cout << "Entrer un entier plus grand que 0" << endl; cin >> n; if (n<=0) { cout <<"Le nombre doit etre strictement positif"<<endl;} else {cout <<"OK"<<endl;} } while (n<=0); if (fmod(n,2)==0...
true
bb4b0593f4110ad9a6a3f370e7fbc0ac639d39fa
C++
tisi1988/Super-Hang-On
/ModuleSceneMap.cpp
UTF-8
4,168
2.515625
3
[]
no_license
#include "Globals.h" #include "Application.h" #include "ModuleTextures.h" #include "ModuleAudio.h" #include "ModuleInput.h" #include "ModuleRender.h" #include "ModuleFadeToBlack.h" #include "ModuleSceneMap.h" ModuleSceneMap::ModuleSceneMap(bool active) : Module(active) { // Backdrop backdrop.x = 0; backdrop.y = 0;...
true
8a41104aef46d08dbb995c37de8c3375f5ca3c25
C++
csteuer/ParallelBottomUpBalancedOctreeBuilder
/octreebuilder/octree.cpp
UTF-8
1,403
2.71875
3
[ "MIT" ]
permissive
#include "octree.h" #include <ostream> namespace octreebuilder { ::std::ostream& operator<<(::std::ostream& s, const OctreeNode& n) { s << "{ llf: " << n.getLLF() << ", level: " << n.getLevel() << ", size: " << n.getSize() << ", morton_llf: " << n.getMortonEncodedLLF() << " }"; s << ::std::endl; return s...
true
f11d389163447a01358fbad05abb9cde9efb0689
C++
stuart-ashley/bijouengine
/src/render/sphericalHarmonics.h
UTF-8
685
2.5625
3
[]
no_license
#pragma once #include "renderTask.h" #include <array> #include <memory> namespace render { class SphericalHarmonics final: public RenderTask { public: /** * * @param name * @param texture * @param floats */ SphericalHarmonics(const std::string & name, const std::shared_ptr<Texture> & textur...
true
1fb8928088ebc9f65d843352df5cd50708e84afb
C++
lorenmh/learn_c
/blackjack/deck.cpp
UTF-8
582
3.125
3
[]
no_license
#include "deck.h" #include "card.h" #include "randomf.h" const int DECKSIZE = 52; Deck::Deck() { index = 0; for (int i = 0; i < DECKSIZE; i++) { cards[ i ].setIndex( i ); } } void Deck::shuffle() { index = 0; for (int i = 0; i < DECKSIZE; i++) { // swapIndex is a random int between i and len ...
true
476c7447654a50f53c9b5c32938b3d8dbb63a19c
C++
menarus/C-Course
/Solutions/Ch7/Serendipity/bookinfo.cpp
UTF-8
924
2.9375
3
[ "MIT" ]
permissive
/* Project : bookinfo Author : Mohammad Al-Husseini Description : Displays the book information menu for the Serendipity Project. */ /////////////////////////////////////////////////////////////////////////////////////////////////// #include <iostream> // cout object for command line output using namespac...
true
1c1f7d8504cb86188684c95e736ab2ecf3be39db
C++
iamsidv/sdl-samples
/sdl-tutorial/sdltutorial/surfaceexample.cpp
UTF-8
1,419
2.765625
3
[]
no_license
// // surfaceexample.cpp // sdltutorial // // Created by Siddharth on 04/06/19. // Copyright © 2019 Siddharth. All rights reserved. // //#include "SDLHeader.h" //#include <stdio.h> // //const int WINDOW_WIDTH = 640; //const int WINDOW_HEIGHT = 480; //const char* win_name = "SDL Tutorial Test"; // //int main(int arg...
true
86e337d73996eacbf9b74374b26989ff4b512ee2
C++
frodal/Visualizer
/Visualizer/src/tests/Test.h
UTF-8
1,101
2.921875
3
[ "MIT" ]
permissive
#pragma once #include "PreCompiledHeader.h" #include "Window.h" namespace Test { class Test { public: Test() : testName("Unknown") {} Test(std::string& name) : testName(name) {}; Test(const char* name) : testName(name) {}; virtual ~Test() {} virtual void OnUpdate(float deltaTime) {} virtual void OnRen...
true
b4a43dd90c6cfe6505981d3cc5933dbf409b6c74
C++
AppleTater/CS100-Labs
/lab-04-strategy-pattern-sigsegv-noises/SelectionSort.hpp
UTF-8
550
2.984375
3
[]
no_license
#ifndef _SELECTION_SORT_HPP_ #define _SELECTION_SORT_HPP_ #include "container.hpp" #include "sort.hpp" #include <vector> using namespace std; class SelectionSort : public Sort { public: SelectionSort() {}; virtual void sort(Container* container) { int min, i, j; int size = container->size(); for(i = ...
true
727ecafdd3c95bc47f640311190d70e43f4ac2e9
C++
Starwolf-001/Real-Time_Image_Stitching
/Blending/main.cpp
UTF-8
4,156
2.875
3
[]
no_license
#include "opencv2/opencv.hpp" using namespace cv; int value = 2; // Taken from http://www.morethantechnical.com/2011/11/13/just-a-simple-laplacian-pyramid-blender-using-opencv-wcode/ class LaplacianBlending { private: int levels; Mat currentImg; Mat _down; Mat down; Mat up; Mat_<Vec3f> lef...
true
1daa331b564e1b5edc4765251db7ee8de667f12f
C++
MSergiev/EGT-course
/Tetris/Button.cpp
UTF-8
1,461
3.1875
3
[]
no_license
#include "Button.h" Button::Button() : TextTexture() { button.x = 0; button.y = 0; button.w = 0; button.h = 0; pressed = false; } Button::~Button() { } int Button::getWidth() { return button.w; } int Button::getHeight() { return button.h; } void Button::render( SDL_Renderer*& renderer, int x, int y ) { //...
true
a3bbebab5a88bfc937bccfd3940806057c9bb25c
C++
MadPidgeon/Order-versus-Chaos
/sat/visual.cc
UTF-8
728
3.109375
3
[]
no_license
#include <iostream> #include <string> const int dx[4] = { -1, 0, 1, 1 }; const int dy[4] = { 1, 1, 1, 0 }; const std::string arrow[] = { "↗", "→", "↘", "↓" , "↙", "←", "↖", "↑" }; int main() { int G[8][8]; std::string S; while( std::cin >> S ) { if( S[0] == 's' or S[0] == 'S' or S[0] == 'v' or S[0] == '0' ) c...
true
79fe936b02930bb7c268882adc26cc78d89b9648
C++
MashaIvanova5/Calculator
/Functii.cpp
UTF-8
7,764
3.078125
3
[]
no_license
#include "Functii.h" bool error(std::string s)//неверно написаны знаки возле скобок { if (std::count(s.begin(), s.end(), '(') != std::count(s.begin(), s.end(), ')')) { return true; } else if (s.find("*)") != std::string::npos || s.find("/)") != std::string::npos || s.find("-)") != std::st...
true
8d80472891437da26517ad4e020e223ea22cf05e
C++
adanil/CompetitiveProgramming
/ACMP113/main.cpp
UTF-8
1,364
2.734375
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { long long n; cin >> n; vector<vector<char>> table(n,vector<char>(n,0)); for (long long i = 0;i < n;i++){ for (long long j = 0;j < n;j++) cin >> table[i][j]; } vector<vector<long...
true
ee3089e5e279d41b5233b1eca06e0a586a5af1a7
C++
lemospring/brynet
/tests/test_stack.cpp
UTF-8
1,412
2.921875
3
[ "ICU", "MIT" ]
permissive
#define CATCH_CONFIG_MAIN// This tells Catch to provide a main() - only do this in one cpp file #include <brynet/base/Stack.hpp> #include "catch.hpp" TEST_CASE("Stack are computed", "[Stack]") { using namespace brynet::base; const size_t StackNum = 10; auto stack = stack_new(StackNum, sizeof(size_t)); ...
true
1c7737d12ac1bde579531352c497111afea28118
C++
ghyess2/haodifang
/1086.cpp
UTF-8
278
2.6875
3
[]
no_license
#include<iostream> #include<cstdio> using namespace std; int main(){ long int a; cin>>a; do{ if(a%2!=0) { cout<<a<<"*3+1="<<a*3+1<<endl; a=a*3+1; } else { cout<<a<<"/2="<<a/2<<endl; a/=2; } } while(a!=1); cout<<"End"<<endl; return 0; }
true
e2666c9e661947a6eeb38a01b11d1f39a325c0d5
C++
krishankant10/C-language
/ch7_1.cpp
UTF-8
611
3.203125
3
[]
no_license
1. Solution: The error, could not find a match for space::space (int) in function space operator :: ++(), occurs. The statement, return Space(mCount) creates a temporary object. It calls a constructor with one int variable and it is not available in this program. The constructor to be included in the program is Space...
true
c1300a8d13a21374f118723b45d8b217f7f065d2
C++
ccdxc/logSurvey
/data/crawl/squid/hunk_129.cpp
UTF-8
871
2.625
3
[]
no_license
fprintf( stderr, "%c requires a regex pattern argument!\n", option ); exit(1); } - if ( head == 0 ) - tail = head = new REList( optarg, option=='E' ); - else { - tail->next = new REList( optarg, option=='E' ); - ...
true
3727e51cff8c9c4d43de9039727be05fdaf1d6dc
C++
maggieelli/ghost-racer
/StudentWorld.cpp
UTF-8
15,009
3.015625
3
[]
no_license
#include "StudentWorld.h" #include "Actor.h" #include "GameConstants.h" #include <string> #include <sstream> using namespace std; GameWorld* createStudentWorld(string assetPath) { return new StudentWorld(assetPath); } // Students: Add code to this file, StudentWorld.h, Actor.h, and Actor.cpp StudentWorld::Stude...
true
dccd2f28b8516fd9b1ff00111c16846447577fbb
C++
Phantomape/paxos
/src/comm/event.cc
UTF-8
1,257
2.765625
3
[ "MIT" ]
permissive
#include "event.h" #include "event_loop.h" namespace paxos { Event::Event(EventLoop * event_loop) : event_(0), event_loop(event_loop) { is_destroried_ = false; } Event::~Event() {} int Event::OnRead() { return -1; } int Event::OnWrite() { return -1; } void Event::OnTimeout(const uint32_t timer_id, con...
true
9abd45cbe9a27a81563709bbdcdbdfacb85eacf6
C++
Sarthakshah30/TopCoder-Solutions
/MostProfitable.cpp
UTF-8
4,863
2.625
3
[]
no_license
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmat...
true
fa29aea8156d9aa6ec5856e93d776e412d3f3090
C++
Arekushi/Finite-State-Machine-Arduino
/src/Dictionary.h
UTF-8
875
3.21875
3
[]
no_license
#ifndef Dictionary_h #define Dictionary_h #include <Arduino.h> #include <ArrayList.h> template<class K, class V> class Dictionary { private: ArrayList<K> *m_keys; ArrayList<V> *m_values; public: Dictionary() { m_keys = new ArrayList<K>(); m_values = new...
true
c03c3df0b13f8a6e9c58927af962da312bcadfb7
C++
Devforlife07/Algorithms
/DivideAndConcquer/binSearchInRotatedArray.cpp
UTF-8
723
2.890625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int getResult(int a[], int n, int key, int s, int e) { if (s > e) return -1; int mid = (s + e) / 2; if (a[mid] == key) return mid; if (a[s] <= a[mid]) { if (key >= a[s] and key <= a[mid]) return getResult(a, n, key...
true
a609556520aeef0e7c47df107c89f9925de9acdd
C++
Angeld55/Object-oriented_programming_FMI
/Week 06/GpsPath/GpsPath.h
UTF-8
734
2.859375
3
[]
no_license
#pragma once #include <cmath> class GPSPath { struct Point { int x; int y; double getDist(const Point& other) const { int dx = x - other.x; int dy = y - other.y; return sqrt(dx * dx + dy * dy); } }; Point* data; ...
true
10c4865cb395620b7567a2829bea75de620fbaa0
C++
btbaggin/Yaffe
/Logger.cpp
UTF-8
898
2.609375
3
[]
no_license
#define DEBUG_LEVEL_None 0 #define DEBUG_LEVEL_Error 1 #define DEBUG_LEVEL_All 2 //Modify this define to control the level of logging #define DEBUG_LEVEL DEBUG_LEVEL_All #if DEBUG_LEVEL > DEBUG_LEVEL_Error #define YaffeLogInfo Log #else #define LogInfo(message, ...) #endif #if DEBUG_LEVEL != DEBUG_LEVEL_None #includ...
true
7523b11b832b50e04ee4ba9f7bf696064ba51285
C++
odilon-matos/LP1
/Roteiro 8 - Questão 2/main.cpp
UTF-8
3,069
3.046875
3
[]
no_license
#include <iostream> #include <cstring> #include "Imovel.h" #include "Terreno.h" #include "Casa.h" #include "Apartamento.h" int main() { double a, adt, ac, vdc; int ndp, qdq, ndvng; std::string p; Casa casa0, casa1; Terreno terreno0, terreno1; Apartamento apartamento0; casa0.setEndereco(); ...
true
35d222907e4a266ce2764aa43b6660c69e70dd11
C++
memoa/it-obuke
/Niz brojeva.cpp
UTF-8
585
3.1875
3
[]
no_license
/* Domaci Zadatak verzija 1 Napisati program koji unosi brojeve u niz. Kada zbir elemenata bude 1000, prekinuti unos brojeva. Autor: Dejan Cvijetinovic, Web Aplikacije, grupa 1 Datum: 15.10.2018 */ #include <iostream> using namespace std; int main() { int a[1000]; int n; printf("Unesite ve...
true
429cd305a0d4f701d37f7842e289239fdc397f60
C++
przemykomo/cppexp
/include/Vector.hpp
UTF-8
1,871
3.84375
4
[]
no_license
#pragma once #include <initializer_list> #include <cstring> template<class T> class Vector { public: Vector() : Vector(0) {} Vector(int initialSize) : m_size(initialSize), m_capacity(initialSize) { dataPtr = new T[m_size]; } Vector(std::initializer_list<T> list) : Vector(list.size()) { ...
true
176995e511ef0894d63c4df5d70eede26d5c398d
C++
alexandramoraitaki/Progintro
/askisi15.cpp
UTF-8
1,140
2.578125
3
[ "Apache-2.0" ]
permissive
#include "pzhelp" #include <iostream> #include <cstring> using namespace std; void justify(char array[],int k, int d, int s) { int a=s/d; int b=d-(s%d); int dwritten=0; for(int i=0; i<k; i++) { WRITE(array[i]); if(array[i]==' ') { dwritten++; for(int j=0; j<a; j++) { W...
true
9e27a3ceec3cd285924b96378043f9d23350f895
C++
roshid2500/PingingServer
/client.cpp
UTF-8
1,830
2.875
3
[]
no_license
#include <iostream> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <time.h> #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> #include <netinet/in.h> #include <chrono> #define PORT 12551 using namespace std; int main() { int sockfd, n, send; socklen_t len...
true
2013ca75665018c34945797257267ed9d1c59e21
C++
XinweiChai/ALGPR
/TP5/fourmi.cpp
UTF-8
7,224
2.796875
3
[]
no_license
/************************************************************* Fonctions de déplacement des fourmis ------------------------------------------------------ Auteurs : équipe pédagogique ALGPR Date : 01/10/2009 Modifié : 10/04/2013, 04/11/2013 (Vincent Tourre) Fichier: fourmi.cpp ****************************...
true
0ec74c711941dcc6ae1037572c8ede7841b79f4b
C++
cupcake08/LinkedList-1
/palindromeLinkedList.cpp
UTF-8
1,240
3.125
3
[]
no_license
//coding ninjas platform /*First Approach********/ Node* reverse(Node *head) { if(head->next==NULL) { return head; } Node *tail=head->next; Node *newHead=reverse(head->next); tail->next=head; head->next=NULL; return newHead; } bool isPalindrome(Node *head) { Node *slow=head; Node *fast=head;...
true
58ccf9d62fb6957c8a0b8af9fce18919a9fa14d8
C++
luliyucoordinate/Leetcode
/src/0996-Number-of-Squareful-Arrays/0996.cpp
UTF-8
744
2.953125
3
[]
no_license
static int x = []() {std::ios::sync_with_stdio(false); cin.tie(0); return 0; }(); class Solution { public: int numSquarefulPerms(vector<int>& A) { sort(A.begin(), A.end()); int res = 0; permute(A, 0, res); return res; } private: void permute(vector<int> A, int i, i...
true
6d4940ad2fac90122b7fb47d6e109aad910eb1e1
C++
mcclown1991/RavelEngine
/Ravel Engine/Source/Systems/Scene Management/SceneManager.cpp
UTF-8
1,387
2.65625
3
[]
no_license
#include "SceneManager.h" #include "RavelEngine.h" SceneManager * SceneManagement() { static SceneManager s; return (&s); } SceneManager::SceneManager() { } void SceneManager::Init() { m_currentScene = m_NextScene = std::make_pair<unsigned int, Scene*>(-1, nullptr); } void SceneManager::Update(...
true
6d17dfdd6ff74df1533eef9cc9cea113efcb84ad
C++
MrDetectiv/fb-labs-2020
/cp_4/chudo_fb-83_tushchenko_fb-83_cp4/main.cpp
UTF-8
3,237
3.09375
3
[]
no_license
#include "func.h" int main() { size_t gen_sz; cout << "Enter generator size: " << endl; cin >> gen_sz; cout << endl << endl; Pers Chris(gen_sz); cout << "***************************************************************************" << endl; cout << endl << "Chris" << endl; Chris.printpublickey(); cout...
true
56a9c3cbf246f394fd54e983b0985e2579b053e7
C++
timchenggu123/darepo
/052ECE/Project1/P1-src/Dynamic_range_stack.h
UTF-8
5,218
3.25
3
[]
no_license
/***************************************** * Instructions * - Replace 'uwuserid' with your uWaterloo User ID * - Select the current calendar term and enter the year * - List students with whom you had discussions and who helped you * * uWaterloo User ID: uwuserid @uwaterloo.ca * Submitted for ECE 250 * Depa...
true
fcee197d43b5aba505a09637b147c57397a90384
C++
lhju4e/TIL
/algo/7453.cpp
UTF-8
1,653
2.734375
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; int a[4000]; int b[4000]; int c[4000]; int d[4000]; int main() { vector<int> ab; vector<int> cd; int n; long long cnt=0; cin >> n; for(int i=0; i<n; i++) { cin >> a[i]; cin >> b[i]; cin >>...
true
40f50d47781ada0d88048597fb5792a7f956ef94
C++
Jeffrey-P-McAteer/ros_object_recognition
/src/object_detection_2d_vis/src/visualizer_main.cpp
UTF-8
1,569
2.921875
3
[ "MIT" ]
permissive
/** \file * \brief main function for running the Visualizer. */ // std. #include <iostream> #include <exception> // Qt. #include <QApplication> // ROS. #include <ros/ros.h> // object_detection_*. #include <object_detection_2d_vis/visualizer.h> using object_detection_2d_vis::Visualizer; using namespace std; /**...
true
e88a4cf0601c08177ee5dc7d16925109c547cdf3
C++
Atsuiai/ATAC
/DataStructureFunctionsATAC.cpp
UTF-8
112,380
2.890625
3
[]
no_license
#include "DataStructureFunctionsATAC.h" // Builds a list of Neighbors. imat DataStructureFunctionsATAC::buildNeigh(mat pos) { int posn_rows = pos.n_rows; int maxNumberOfNeighbors = 4; imat neigh(posn_rows, maxNumberOfNeighbors); /* row is atom number on original position list, columns are 4 ...
true
d692f843a45080fc6e09de7267e9e8672ff0c82c
C++
Nickqiaoo/TinySTL
/Alloc.h
UTF-8
2,087
3.109375
3
[]
no_license
#ifndef ALLOC_H__ #define ALLOC_H__ #include <cstddef> #include <cstdlib> namespace TinySTL { //包装接口,使用传入的Alloc分配内存,Alloc默认第二级 template <class T, class Alloc> class simple_alloc { public: static T* allocate(size_t n) { return n == 0 ? 0: (T*)Alloc::allocate(n * sizeof(T)); } static T* ...
true
c8ee91bb4ec95162ecf1934ec2af7dad5cb55946
C++
hiromk6/socket-study
/002_basic/2-11_copy.cpp
UTF-8
829
3.765625
4
[]
no_license
//remove_copy, replace_copy #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { char str[] = "Algorithms operate on containers through iterators."; vector<char> v, v2(100); vector<char>::iterator p; int i; for(i=0; str[i]; i++) v.push_back(str[i]); cout << "Input sequen...
true
d4940394fec9f65bc86ab81b54aaafd0edec835e
C++
demaisj/ZiaModuleAPISpec
/include/Zia/API/Module.hpp
UTF-8
1,964
2.90625
3
[]
no_license
/* ** EPITECH PROJECT, 2019 ** ZiaModuleAPISpec ** File description: ** Module spec */ #pragma once #include <string> #include "ServerConfig.hpp" #include "RequestHandler.hpp" namespace Zia { namespace API { /* * BASE MODULE * * This class is the main module interface. It describes the module meta-data, * and ...
true