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
f1eade793d4a25b1dd5119f01ba78ce1de4bdbdb
C++
dawidjk/naive_bayes
/Naive Bayes/Naive Bayes/ImageTesting.cpp
UTF-8
2,873
2.9375
3
[]
no_license
// // ImageTesting.cpp // Naive Bayes // // Created by David Kluszczynski on 3/26/19. // Copyright © 2019 David Kluszczynski. All rights reserved. // #include "Catch2.hpp" #include "Image.hpp" #include "ImageSet.hpp" #include "FileIO.hpp" #include <string> TEST_CASE( "Read Image Successfully", "[Image]" ) { F...
true
cdfaa0e0b161542eb8313369ef49ea19af45bbc9
C++
LPD-EPFL/consensusinside
/protocols/tpc/T_Reply.h
UTF-8
4,352
2.6875
3
[ "MIT" ]
permissive
#ifndef _T_Reply_h #define _T_Reply_h 1 #include "types.h" #include "libbyz.h" #include "T_Message.h" #include "Digest.h" class T_Principal; class T_Rep_info; // // T_Reply messages have the following format. // struct T_Reply_rep : public T_Message_rep { View v; // current view Request_id rid; // unique request...
true
a4cd8778603458370c293139114c79851425867c
C++
yogeshg/small-projects
/lc/p131.cpp
UTF-8
1,935
3.375
3
[]
no_license
#include<iostream> #include<vector> #include<string> #include<cstring> class Solution { public: std::vector<std::vector<std::string>> partitionRec(const char* cstr, int len, std::vector<std::string>partSolution ) { std::vector<std::vector<std::string>> r...
true
88fac527c478d0e25fd59c5a891d8b5b0e760eca
C++
ab-dragon/workshop_oct2018
/need_for_speed/need_for_speed/test_perf.cpp
UTF-8
1,103
3.234375
3
[]
no_license
#include <utility> #include <chrono> #include <iostream> #include <vector> struct Point { std::vector<double> v; double x; double y; }; Point go_left(const Point& p) { Point tmp; tmp.x = p.x + 1; tmp.y = p.y; tmp.v = p.v; return tmp; } Point go_up(const Point& p) { Point tmp; t...
true
f7ce5e96941ddb859636d398eccc39f4d9d0f832
C++
Sunshine334419520/gstl
/test/set/test.cc
UTF-8
1,443
3.015625
3
[]
no_license
/** * @Author: YangGuang <sunshine> * @Date: 2018-03-18T15:25:37+08:00 * @Email: guang334419520@126.com * @Filename: test.cc * @Last modified by: sunshine * @Last modified time: 2018-03-18T15:51:57+08:00 */ #include "Set.h" #include <iostream> using namespace std; int main(int argc, char const *argv[]) { ...
true
fe64d48a248865d505ac94c1ed985eba3bd71271
C++
vyldr/potential-pancake
/src/uiDraw.cpp
UTF-8
6,386
2.796875
3
[]
no_license
// Functions for drawing on the screen. Also random functions because of reasons // TODO: Maybe find a better place for the random functions #define LINUX //#define MAC_XCODE //#define WIN_VISUAL_STUDIO #ifdef MAC_XCODE #include <openGL/gl.h> // Main OpenGL library #include <GLUT/glut.h> // Second OpenGL libr...
true
be248f3d141e090f541ec1cf800a9036e65b6a82
C++
ivtipm/oop-lab5-Rosspal
/Gukov/Forgotten city/Item/item.cpp
UTF-8
1,637
3.03125
3
[]
no_license
#include "item.h" int Item::getStatus() const { return status; } void Item::setStatus(int value) { status = value; } void Item::addDurability(int a) { if((durability + a) >= 100){ durability = 100; }else{ if((durability + a) <= 0){ durability = 0; }else{ ...
true
d3eb724529a17783c45446e687f19bef1af4c143
C++
generation472/Rmstr
/indicator.h
UTF-8
1,279
2.828125
3
[]
no_license
//--------------------------------------------------------- #ifndef INDICATOR_H #define INDICATOR_H //--------------------------------------------------------- #include <QWidget> //--------------------------------------------------------- /** \class Indicator \brief Класс виджет круглого индикатора.<br> ...
true
45a2f19e12461bb2657b7c6cc8d2dbd2e84481a8
C++
mingkaic/travis-test
/jobs/scope_guard.hpp
UTF-8
903
3.140625
3
[ "MIT", "BSL-1.0" ]
permissive
/// /// scope_guard.hpp /// jobs /// /// Purpose: /// Simulate golang defer statement /// #ifndef PKG_JOBS_SCOPE_GUARD_HPP #define PKG_JOBS_SCOPE_GUARD_HPP #include <functional> namespace jobs { using GuardOpF = std::function<void(void)>; /// Invoke held function upon destruction /// Operates as C++ style of Golan...
true
51011de0cc52c9e829d73cd68e73d41837b74a00
C++
Angella3/Jutge.org-PRO1
/Jutge-P08/06 - P63414 CountingFrequences/main.cpp
UTF-8
317
2.640625
3
[]
no_license
#include <iostream> #include <vector> using namespace std; int main(){ unsigned long n; cin >> n; vector<int> v(1001); int a; for (int num = 0; num < n; num++){ cin >> a; v[a%10000]++; } for (int i = 0; i < 1001; i++){ if(v[i] != 0) cout << 1000000000+i << " : " << v[i] << endl; } }
true
f3defb67af070faa22d0b6f688b00d1893d88970
C++
ttalvitie/frivol
/frivol/fortune/algorithm.hpp
UTF-8
4,528
2.71875
3
[]
no_license
#ifndef FRIVOL_FORTUNE_ALGORITHM_HPP #define FRIVOL_FORTUNE_ALGORITHM_HPP #include <frivol/containers/priority_queue_concept.hpp> #include <frivol/fortune/beach_line.hpp> #include <frivol/policy.hpp> #include <frivol/voronoi_diagram.hpp> #include <frivol/geometry_traits.hpp> namespace frivol { namespace fortune { //...
true
9083746e82ebe66bc6725e3e0cbd678e1220ccd2
C++
Geeksongs/Traditional-code
/虚函数.cpp
GB18030
985
4.03125
4
[]
no_license
#include<iostream>//дһ麯Ӷĵ using namespace std; class A { public: void great() { cout<<"һʵ,BʵܹǴ˺Ϊָ"<<endl; }//һʵ virtual void great2() { cout<<"һ麯Dzܹõ"<<endl; }//һ麯 }; class B:public A { public: void great2() { cout<<"BеʵḲAе麯"<<endl; } void great() { cout<<"BеʵӦòḲ...
true
7509c98b32053c06b9a911cd96cc5b9885d07d3e
C++
Flostin1/temp
/Advanced Calculator/Math.cpp
UTF-8
1,698
3.53125
4
[]
no_license
#include "Math.h" #include <ctype.h> #include <regex> void removeWhiteSpace(std::string& str) { int i = str.length() - 1; while ((i--) > 0) { if (str.at(i) == ' ') { str.erase(i, 1); i++; } } } // Split Equation // 1. Find first operator (using PEMDAs + going left to right) // 2. Number...
true
5b8d5e3b520dc309d6c55a403e6ea2f8a82f4092
C++
CalebSarikey/cplusplus
/Calkin-Wilf-Enumeration.cpp
UTF-8
5,588
3.578125
4
[]
no_license
#include<iostream> #include<iomanip> #include<cmath> #include<string> #include<cstring> #include<cstdlib> using namespace std; struct Fraction { int num; int den; }; int bin_array[100]; //global array to hold binary numbers Fraction cwfrac(int p); //Returns the fraction in position p in the Calkin-Wilf enum...
true
60a4b2010c43ed729c63928cb6855c69751a6966
C++
PasserByJia/algorithm-train
/EC/PAT1027/src/PAT1027.cpp
UTF-8
522
2.671875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main() { int n,sf=1,be=1;char f; cin>>n>>f; while(sf<=n){ sf+=((be+=2)*2); } sf-=(be*2); be-=2; for(int i=be;i>1;i-=2){ for(int l=0;l<(be-i)/2;l++)cout<<" "; for(int j=1;j<=i;j++){ cout<<f; } cout<<endl; } for(int l=0;l<(be-1)/2;l++)cout<<" "; c...
true
a402c1638c9487daf4b4cdb6aad388c7618f342c
C++
JeffreyC1998/CS115-Assignment-project-small-game
/ItemManager.cpp
UTF-8
4,825
2.96875
3
[]
no_license
#include "ItemManager.h" #include "Item.h" #include "Location.h" #include <cassert> const int NO_SUCH_ITEM = 999999999; ItemManager::ItemManager() { item_count = 0; my_item_array = new Item[item_count]; assert(invariant ()); } ItemManager::ItemManager(const string& game_name) { for(int i = 0;i< item_count;i...
true
ab0069dfd7d524db6a4ae88c0aa59d7fc2a8a01a
C++
salvomob/Esercitazioni_Prog2
/2020/lezioni/algoritmi di sorting/selectionsort.cpp
UTF-8
1,111
3.40625
3
[]
no_license
#include<iostream> using namespace std; template <class T> void selectionsort(T *v, int n); template <class T> void r_1selectionsort(T *v, int n); template <class T> void r_2selectionsort(T *v, int n); template <class T> void scambia(T *v,int i, int j); template <class T> void stampa(T *v, int n); int main(){ int a[]...
true
0209cf3d3c2a11eee270c32902890a967bf8c5d5
C++
JPTIZ/libgba-cpp
/libgba-cpp/engine/graphics/maps.h
UTF-8
1,823
2.6875
3
[ "MIT" ]
permissive
#ifndef GBA_ENGINE_GRAPHICS_MAPS_H #define GBA_ENGINE_GRAPHICS_MAPS_H #include <array> #include <libgba-cpp/arch/display/tilemap.h> #include "geometry.h" namespace gba::engine::graphics { template <std::size_t TilesetLength> using TileSet = std::array<display::map::Tile, TilesetLength>; template <std::size_t Map...
true
a9b9ff2e323fc407b945a356a277342968e49281
C++
spatial-model-editor/spatial-model-editor
/core/mesh/src/boundary.cpp
UTF-8
1,115
2.625
3
[ "MIT", "Zlib", "LGPL-2.0-or-later", "LGPL-3.0-only", "BSD-3-Clause", "GPL-1.0-or-later", "GPL-2.0-only", "BSL-1.0", "Apache-2.0", "LicenseRef-scancode-other-copyleft", "GPL-3.0-only" ]
permissive
#include "boundary.hpp" #include "line_simplifier.hpp" #include <algorithm> #include <utility> namespace sme::mesh { bool Boundary::isLoop() const { return lineSimplifier.isLoop(); } bool Boundary::isValid() const { return lineSimplifier.isValid(); } const std::vector<QPoint> &Boundary::getPoints() const { return p...
true
dd51c535806fbd8eecbdc388b8fa9a806d205095
C++
pranaykrpiyush/Codeforces--solutions
/Print Name Initials.cpp
UTF-8
1,004
2.75
3
[]
no_license
#include <stdio.h> #include <string> using namespace std; int main(){ int space_count=0, space_index[2]={0,0}; char name[100]; fgets(name, sizeof(name), stdin); // read string printf("%s",name); for (int i=0; name[i]!='\0';i++){ if (name[i]==32){ space_index[space_coun...
true
24815c936641e55906fffff8143c3bd4c4732b4f
C++
LasseD/uva
/P11455.cpp
UTF-8
517
3.078125
3
[]
no_license
#include <iostream> #include <algorithm> int main() { unsigned long N, a[4]; std::cin >> N; for(unsigned long cas = 0; cas < N; ++cas) { std::cin >> a[0] >> a[1] >> a[2] >> a[3]; std::sort(a, a+4); if(a[0] == 0 || a[3] >= (a[0]+a[1]+a[2])) std::cout << "banana" << std::endl; else if(a[0] ==...
true
dfdd94ad22175b982cc0fbefe521de2ae099a1a7
C++
wen-zhi/PAT-Advanced-Level
/C++/1061-dating.cc
UTF-8
1,654
3.484375
3
[]
no_license
#include <iostream> #include <string> #include <array> #include <cctype> #include <iomanip> const std::array<std::string, 7> kWeekName = { "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN" }; int main() { std::string day; int hour, minute; std::string str1, str2; std::getline(std::cin, str1); ...
true
7c9eb528a7dc4184bffe03039f650231f35331d3
C++
PriyanshBordia/CodeForces
/1426C.cpp
UTF-8
340
2.578125
3
[]
no_license
#include <iostream> #include <math.h> #include <algorithm> typedef long long ll; using namespace std; void solve() { int n; cin >> n; int ans(1e09); for (int i = 1; i * i <= n; i++) { ans = min(ans, i - 1 + (n - 1) / i); } cout << ans << endl; return; } int main() { int t; cin >> t; while (t--) sol...
true
6ebad9b5544d3375f1d6d04959db46350f30b182
C++
Hung150/Lab4
/task8.cpp
UTF-8
387
3.59375
4
[]
no_license
#include <iostream> using namespace std; void swap(int&, int&); int main() { int n1, n2; cout << "Enter 1-st number" << endl; cin >> n1; cout << "Enter 2-st number" << endl; cin >> n2; swap(n1, n2); cout << n1 << ' ' << n2 << endl; system ("pause"); return 0; } void swap(int& num1, ...
true
469502515834ea30b90cde6d06a30add18d46efc
C++
epain17/Lab2C
/LAB2C++EP/LAB2C++EP/Rational.h
UTF-8
2,132
3.1875
3
[]
no_license
#pragma once #include <iostream> #include "GCD.h" template<typename Tint> class Rational { public: Tint P, Q; //nom, denom friend std::ostream & operator<< (std::ostream & cout, Rational<Tint> R) { cout << R.P << '/' << R.Q; return cout; } friend std::istream & operator>> (std::istream & cin, Rational<Tint...
true
996f4c0d1af74a9696f24ef5a7dd316c6abb5b95
C++
ParagSaini/Competitive-Practice
/Striver_Series/SDE Problems/String/LongestCommonPrefix.cpp
UTF-8
552
3.0625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; string findPrefix(string s1, string s2) { string result = ""; int i = 0, j = 0; while(i < s1.length() && j < s2.length() && s1[i] == s2[j] ) { result.push_back(s1[i]); i++; j++; } return result; } string longestCommonPrefix(vector...
true
600f2c7150da6fe821c7db37164e26b6f417f99a
C++
rlabrecque/RLEngine
/Core/src/CInput.cpp
UTF-8
4,454
2.84375
3
[]
no_license
#include "Core.hpp" #include "CInput.hpp" CInput::CInput() { m_directInput = nullptr; m_keyboard = nullptr; m_mouse = nullptr; } CInput::CInput(const CInput&) { } CInput::~CInput() { } bool CInput::Initialize(HINSTANCE hinstance, HWND hwnd, int screenWidth, int screenHeight) { HRESULT result; ...
true
9df8f94872087f66b57baedaca1a42565fe7d1bb
C++
Rookie35/C-plus-plus-practice
/派生类赋值兼容.cpp
UTF-8
703
3.234375
3
[]
no_license
/* * @Author: ZKF * @Date: 2019-04-10 14:20:01 * @Last Modified by: ZKF * @Last Modified time: 2019-04-10 15:04:39 */ #include <iostream> using namespace std; class base { public: base(int a=0,int b=0) { x=a; y=b; } void show2() { cout<<"x="<<x<<endl; cout<<"y="<<y<<endl; } int x; int y; }; clas...
true
3188f19bf2af3b25f1f2dc4386048d65773d6fdc
C++
philou/philou
/opengl/isiviewerCpp/my_scene.cpp
UTF-8
7,452
2.625
3
[]
no_license
#include "my_scene.h" #include <iostream> #include <math.h> #include <GL/gl.h> // OpenGL include file #include <boost/shared_ptr.hpp> using namespace std; /** * Constructor * * @param radius */ MyScene::MyScene(float radius) : _allObjects(NULL) { std::cout << "constructing : MyScene" << std::endl; _cu...
true
2364a05ad442c19be349cc9c1da989337ab7ca55
C++
zleviz1/csi2372-project
/deck.cpp
UTF-8
1,528
3.140625
3
[]
no_license
#include "Deck.h" using std::istream; using std::cout; using std::endl; using std::string; using std::getline; Card* Deck::draw() { if (size() > 0) { Card* card = this.begin(); erase(begin()); return card; } else { return nullptr; } } void Deck::print() { for (auto& ...
true
a788f7847c2f0a52784d16611475d01c6737e14e
C++
jorgmo02/Problemas-resueltos-MARP
/32 - El alienígena infiltrado.cpp
ISO-8859-1
2,486
3.390625
3
[]
no_license
#include <iostream> #include <fstream> #include <queue> #include <string> struct Trabajo { int c, f; bool operator < (const Trabajo& other) const { return c > other.c || (c == other.c && f < other.f); } }; int resolver(std::priority_queue<Trabajo>& q, int C, int F) { // empezamos por C porque ...
true
050505a233742ecf88f9a28ea84a6d808585b8b0
C++
lizlyon/CPSC350_SP21_ASSIGNMENT6_LYON
/main.cpp
UTF-8
7,488
3.765625
4
[]
no_license
#include <iostream> #include <string> #include "Database.h" #include "DbStack.h" //#include "Student.h" using namespace std; int main(){ bool loadMenu = true; string userChoice; int id, sid, fid = 0; Database db; DbStack stack; while(loadMenu){ //prompt user with menu options c...
true
23733941a2a4289932eb9f2daae8d25514fd7aaa
C++
deepakchinnadurai/SortVisualization
/main.cpp
UTF-8
16,031
2.984375
3
[ "MIT" ]
permissive
/** * main.cpp * @author: Kevin German **/ #include <SDL.h> #include <vector> #include <thread> #include <iostream> #include <fstream> #include "settings.h" #include "SortingData.h" #include "sort.h" //-------Prototypes------- void init_settings(const int argc, char** argv); void close_system(); void p...
true
23c6df1975469cf0c6c1cf804f91773d1e7c8f2b
C++
bpieszko/BoostTraining
/String_Handling/StringAlgorithms/to_upper_copy.cpp
UTF-8
217
2.875
3
[]
no_license
#include <iostream> #include <string> #include <boost/algorithm/string.hpp> using namespace boost::algorithm; int main () { std::string s{"hello world"}; std::cout << to_upper_copy(s) << std::endl; return 0; }
true
d604772017a0763ff0b17ce4ac6ec22dea41c36e
C++
xinyuang/9_chapter_cpp_algorithm
/1.Linked_List vector string stack/segmentTree/439. Segment Tree Build II.cpp
UTF-8
1,445
3.703125
4
[]
no_license
/** * Definition of SegmentTreeNode: * class SegmentTreeNode { * public: * int start, end, max; * SegmentTreeNode *left, *right; * SegmentTreeNode(int start, int end, int max) { * this->start = start; * this->end = end; * this->max = max; * this->left = this->right...
true
f8f56cbeee014d793a6ab2bd634389dbd679ec00
C++
sonicaks/Cryptography
/lab-7/MD4.cpp
UTF-8
4,602
2.96875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; char hexa[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; string C[3] = {"00000000", "5A827999", "6ED9EBA1"}; int S[3][16] = { {3, 7, 11, 19, 3, 7, 11, 19, 3, 7, 11, 19, 3, 7, 11, 19}, {3, 5, 9, 13, 3, 5, 9, 13, 3, 5, 9, 13, 3, ...
true
1297414a8f2235e068109a3af4be15fa03639e29
C++
rwgriffithv/IEEE-Advanced-Projects
/Motor-Control/motor_control.ino
UTF-8
267
2.5625
3
[]
no_license
#define MOTOR 10 void setup() { pinMode(MOTOR, OUTPUT); } void loop() { for (int i = 1; i <= 150; i++) { analogWrite(MOTOR, i); delay(50); } for (int i = 1; i <= 150; i++) { analogWrite(MOTOR, 150 - i); delay(50); } delay(1000); }
true
3a974dedbefacf52f7a48963458ca27ba0a40dd9
C++
vladyslavkazachenko/pdfio
/test/pdfio/pdf1_0/istream/pdf1_0_istream_array_testsuite.cpp
UTF-8
1,527
2.84375
3
[]
no_license
#include <sstream> #include "pdfio/pdf1_0/indirect_reference.h" #include "pdfio/pdf1_0/istream/read_hexstring.h" #include "pdfio/pdf1_0/istream/read_array.h" #include "gtest/gtest.h" namespace pdf1_0 = pdfio::pdf1_0; TEST(ArrayTestSuite, emptyStream) { pdf1_0::Array<pdf1_0::IndirectReference> array; std::istringst...
true
8cf512d410e7dad9bbbe29425f8305b0496dafa8
C++
chrzhang/abc
/matrices/rotateSquare90Degs/main.cpp
UTF-8
1,601
4.0625
4
[]
no_license
#include <iostream> #define N 3 // Rotate a N x N matrix 90 degrees where each pixel is 4 bytes struct Pixel { int i; Pixel() { } Pixel(int val) { i = val; } }; void printMatrix(Pixel matrix[N][N]) { for (int i = 0; i < N; ++i) { for (int j = 0; j < N; ++j) { std:...
true
48fff44546ec33c70c75b70e97697877833cb7fd
C++
agrippa/chimes
/src/libchimes/set_of_aliases.h
UTF-8
874
3.046875
3
[]
no_license
#ifndef SET_OF_ALIASES_H #define SET_OF_ALIASES_H #include <set> #include <stdio.h> class set_of_aliases { public: set_of_aliases(unsigned set_capacity) { capacity = set_capacity; set = (unsigned char *)malloc(capacity * sizeof(unsigned char)); memset(set, 0x00, capacit...
true
7f55825c8567be897b632c1cab638afda5617e5e
C++
shawnmolga/CPP-rock-paper-scissors
/EX3/RPSFight.cpp
UTF-8
950
3.09375
3
[]
no_license
/* * RPSFight * * Created on: 24 ����� 2018 * Author: OR */ #include "RPSFight.h" //RPSFight::RPSFight(RPSpoint inputPosition,char inputOpponentPiece, int inputWinner): position(inputPosition),opponentPiece(inputOpponentPiece),winner(inputWinner) {} RPSFight::RPSFight() : position(RPSpoint(0, 0)),playerOneP...
true
3825d93098c346d471ac43dafca0c1a4e2f54904
C++
jmserrano-dev-university/Practica3Arquitectura
/main.cpp
UTF-8
5,730
3.25
3
[]
no_license
/* * File: main.cpp * Author: José Manuel Serrano Mármol * Author: Raúl Salazar de Torres * Date: 16 - 1 - 2012 */ #include <cstdlib> #include <stdio.h> #include <iostream> #include <vector> #include <math.h> #include "imgs.h" using namespace std; /** * Función que lee un núcleo desde fichero * @param rut...
true
54c398048ca9553e9cc14d1751f85ab37205e257
C++
pauldoo/scratch
/PolyRender/AutoTest.cpp
UTF-8
4,091
3.109375
3
[ "ISC" ]
permissive
#include "stdafx.h" #include "AutoTest.h" #include "Auto.h" #include "DestructionAsserter.h" std::string AutoTest::Name() const { return "Auto Test"; } namespace { class DestructorParent : public LinkCount { public: DestructorParent(bool& destroyed) : m_destructionAsserter(new DestructionAsserter(d...
true
a4c7efc903f7c56c8c66599e335d860f5ce52528
C++
daodaokami/FeaturesAbout
/src/datas_map.cpp
UTF-8
4,842
2.65625
3
[]
no_license
// // Created by lut on 18-12-25. #include <iostream> #include "datas_map.h" KeyPoints_Map::KeyPoints_Map(int preSize){ this->pre_size = pre_size; this->unm_v_ikps.reserve(this->pre_size); } void KeyPoints_Map::CreateUnorder_Map_KpIndex_vecIndex_IndexKP(vector<cv::KeyPoint> &kps) { int count = 0; for...
true
1aaf0c82eb90af479b87686a01eece9e51f2b76e
C++
JasbirCodeSpace/Spider-Task-2
/Data Structures/Linear/Stack/question3.cpp
UTF-8
1,081
3.328125
3
[]
no_license
//Question: https://www.hackerearth.com/practice/data-structures/stacks/basics-of-stacks/practice-problems/algorithm/fun-game-91510e9f/ #include <bits/stdc++.h> using namespace std; void output(int *A, int *B, int n) { stack<int> a, b; for (int i = 0; i < n; i++) { a.push(A[i]); } ...
true
661b38544c53871e6cb196ce611f243db34aa528
C++
JonMuehlst/CPP2014
/mStack/mStack.h
UTF-8
402
2.921875
3
[ "MIT" ]
permissive
#ifndef MSTACK_H #define MSTACK_H #include <string> using std::string; struct Node { int value; Node * next; }; class MStack { public: MStack(); ~MStack(); void push(int value); int pop(); string toString(); bool isEmpty(); size_t size()...
true
3a16932b75ee7afa214dd2f8afa1545e62c2d1bd
C++
oNddleo/AlgorithmDataStructure
/sudoku.cpp
UTF-8
1,841
3.25
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <iostream> //Array store value need to find int a[9][9]; int I, J; void process(){ for(int i = 0; i <= 8; i++){ for(int j = 0; j <= 8; j++){ printf("%d ", a[i][j]); } printf("\n"); } printf("---------------------\n"); return; } //Check...
true
957a472d9da860673edcd2604881f3e43403f843
C++
keithreynoldsworld/oysterman3
/oysterman3.ino
UTF-8
13,332
2.6875
3
[]
no_license
#include <Servo.h> #include <NewPing.h> #define TRIGGER_PIN 12 // Arduino pin tied to trigger pin on the ultrasonic sensor. #define ECHO_PIN 11 // Arduino pin tied to echo pin on the ultrasonic sensor. #define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is...
true
7108fc7c5f3bc49eb50bc13a4359beb4588862f9
C++
galoscar07/college2k16-2k19
/2nd Semester/Object Oriented Programming /Lecture/Code/Lecture5_demo/Lecture5_demo/Penguin.h
UTF-8
249
2.84375
3
[]
no_license
#pragma once #include "Animal.h" class Penguin: public Animal { private: std::string type; public: Penguin(std::string _colour, double _weight, std::string _type); ~Penguin(); std::string getType() const; std::string toString() const; };
true
50c1fe3c32cf73a1f0d745dd7d9e85ee0ad0b354
C++
fcvarela/glsg
/glsg/render/Camera.h
UTF-8
2,493
2.796875
3
[ "MIT" ]
permissive
#ifndef GLSG_CAMERA_H #define GLSG_CAMERA_H #include <string> #include <memory> #include <glmext/glmext.h> #include <render/Framebuffer.h> #include <scenegraph/SceneNode.h> #include <component/InputComponent.h> namespace glsg { class Camera { public: typedef std::shared_ptr<Camera> Ptr; typedef std::map<std...
true
a406da1618ebaf553a906ca3d3fb1d0f55513f72
C++
swethanandha/ok
/42.cpp
UTF-8
522
3.015625
3
[]
no_license
#include<iostream> #include<string> using namespace std; int main() { string str; string str1; int count=0,i,j; cin>>str; cin>>str1; //cout<<str<<endl; for(i=0;str[i]!='\0';i++) { for(j=0;str1[j]!='\0';j++) { if(str[i]==str1[j]) { count++; cout<<str[i]; ...
true
54d02f03fd6b6c94b05d8fdd7aa52be3e26c31cf
C++
oflucas/Leetcode-Cpp
/Design/p146_LRU_Cache.cpp
UTF-8
1,300
3.3125
3
[]
no_license
class LRUCache { typedef list<int> key_queue; typedef pair<int, key_queue::iterator> record; typedef unordered_map<int, record> hmap; int capacity; key_queue lru_q; hmap cache; public: LRUCache(int capacity) : capacity(capacity) { } int get(int key) { auto it = cache....
true
c885d9688c300daaab2c09d8c301e3c0867eae78
C++
sunny-aguilar/matrix-calculator
/determinant.cpp
UTF-8
1,541
3.671875
4
[]
no_license
/********************************************************************* ** Author: Sandro Aguilar ** Date: Jan 2019 ** Description: A function that calculates the determinant of a ** 2x2 or 3x3 matrix calculator. Returns the ** calculated value. *****************...
true
c93ab29691949989d6d9967aea9d6f3ce79f1d09
C++
saching13/Coding-challenge
/Algoexpert/moveElementToEnd.cpp
UTF-8
421
3.296875
3
[]
no_license
#include <vector> using namespace std; vector<int> moveElementToEnd(vector<int> array, int toMove) { sort(array.begin(),array.end()); int left = 0; int right = array.size()-1; while(right > left){ if(array[left] == toMove){ int temp = array[left]; array[left] = array[right]; array[right] = temp; l...
true
03fd4f236c4cb44e3d7e03b7724168801fbcfff9
C++
gwanhyeon/algorithm_study
/beakjoon_algorithm/beakjoon_algorithm/CodingTestExam/selection_sort.cpp
UTF-8
1,641
3.625
4
[]
no_license
//#include <stdio.h> //#include <iostream> //using namespace std; //void selection_sort(int arr[],int size){ // int min = 0; // int temp = 0; // // for(int i=0; i<size; i++){ // // 맨처음값을 min으로 넣는다고 생각하면된다 // min = i; // for(int j=i+1; j<size; j++){ // // 최소값 변경 arr[min]보다 작으므로 /...
true
c7b7c4d0eecf10fab9a9907501b8d4e3c2378d76
C++
MolinDeng/PAT
/1110.cpp
UTF-8
968
2.890625
3
[]
no_license
#include <cstdio> #include <iostream> #include <vector> #include <queue> #include <string> using namespace std; struct Node { int left; int right; }; int main() { int N, root = 0; scanf("%d", &N); vector<Node> Tree(N); vector<bool> isroot(N, true); for(int i = 0; i < N; i++) { char...
true
83391fc430f12597b91479902b42c534bae1d231
C++
Crawping/cDesktop
/Player.h
UTF-8
706
2.78125
3
[]
no_license
#pragma once #include "Object.h" #include "Events.h" class EventData; class TaskData; class Player : public Object { public: Player(std::string name, Position pos); ~Player(void); void onKeyboardKeyPress(const KeyPressEvent&, EventData*); // calls MoveEvent void onPlayerMove(const PlayerMoveEvent&, EventData*)...
true
55dc2a16e9d37b0d13c1b98f6d9374b93c1a3ad3
C++
The4Bros/Starcraft_AI
/Motor2D/UI_PositionManagement.cpp
UTF-8
1,533
2.828125
3
[]
no_license
/* void UIElement::Center(UIElement* element) { SDL_Rect elementRect = element->GetWorldRect(); int centerX = elementRect.x + elementRect.w / 2; int centerY = elementRect.y + elementRect.h / 2; SetGlobalPosition(centerX - collider.w / 2, centerY - collider.h / 2); } void UIElement::Center(iPoint point) { SetGloba...
true
e104d45c0884ddc3060c6021ce126ca8ae9909a7
C++
Valzur/Pinball
/Utility/PixelPerfectCollision.cpp
UTF-8
640
2.78125
3
[]
no_license
#include "PixelPerfectCollision.h" Vector2D PixelPerfectCollision::CheckCollision(Ball ball, Sprite sprite) { Vector2D Acc={0,0}; image =sprite.getTexture()->copyToImage(); size=image.getSize(); ballPosition=ball.getCenter(); for (int i = 0; i < size.x; i++) { for (int j = 0; j < size.y; j+...
true
f8d8d7556112423517be4e6331bb7e15b44a741d
C++
Nblhshda/ProgrammingAssignmentClassScheduling
/PRIORITY(NON-PREEMPTIVE).cpp
UTF-8
3,052
3.5
4
[]
no_license
/* MAISARAH BINTI HAMZAH 1810325 NUR MAISARA BINTI AHMAD RASID 1818356 NOR NABILAH SHUHADA BINTI MOHD KAMAL 1817510 SITI NUR AISHAH BINTI SULAIMAN 1816454 CSC3401 Operating System Section 5 */ // C++ implementation for non-preemptive Priority Scheduling #include <bits/stdc++.h> using namespace std; struct...
true
1d1faeac54fbd9b1a3c115ef4af655a20189bdbd
C++
vrcordoba/Klondike
/src/views/text/SaveTextView.cpp
UTF-8
874
2.53125
3
[]
no_license
#include "SaveTextView.hpp" #include "SaveController.hpp" #include "IO.hpp" #include "YesNoDialog.hpp" namespace Views { SaveTextView::SaveTextView() : saveFileNameM() { } SaveTextView::~SaveTextView() { } void SaveTextView::interact(Controllers::SaveController* saveController) { if (saveFileNameM.empty()) ...
true
815a8399ad2f85f41ef189c2302563bfbf117bed
C++
xuxiandi/LiquidFL
/current/gameswf/lfl_TAG_PlaceObject2_impl.h
UTF-8
1,395
2.53125
3
[]
no_license
// lfl_TAG_PlaceObject2_impl.h - by Timur Losev 2010 // For embedding event handlers in place_object_2 #ifndef __lfl_TAG_PlaceObject2_impl_h__ #define __lfl_TAG_PlaceObject2_impl_h__ #include "lfl_execute_tag.h" namespace gameswf { class CTAGPlaceObject2: public execute_tag { private: int ...
true
a3696c56fb40e9549dfb4e6a73b672f39f777f10
C++
liuyaqiu/LeetCode-Solution
/48.cpp
UTF-8
1,106
3.421875
3
[]
no_license
#include <iostream> #include <string> #include <vector> #include <utility> using namespace std; void rotate(vector<vector<int>>& matrix) { int len = matrix.size(); vector<vector<int>> res; for(int j = 0; j < len; j += 1) { vector<int> row; for(int i = 0; i < len; i += 1) { row....
true
acfd962e5d5ff1a21814c968be76896f7f430a8f
C++
Naveen110501/Hackerrank
/lab ater vector.cpp
UTF-8
1,439
3.6875
4
[]
no_license
#include<iostream> #include<cstdio> #include<istream> using namespace std; class employee_data; class employee_data { int id; float salary; int acc_num,bal; string name; public: employee_data() { salary=0.00; } friend float pay_sal(employee_data&,int ); friend istream &operator >>(istream &in ,employ...
true
9eca38d76600f967c17a36c2d96949f936c791fc
C++
mamepika426/Atcoder
/atcoder_problems/C_GetAC.cpp
UTF-8
1,053
2.703125
3
[]
no_license
#include <iostream> #include <bits/stdc++.h> #include <vector> using namespace std; vector<int> starting_indices_AC(int N, string S) { vector<int> indices; for(int index=0; index < N-1; index++) { if(S.substr(index, 2) == "AC"){ indices.push_back(index); } } retu...
true
f7cb8ee3967276184bf96fba6da5e4217d7e548f
C++
cuzdav/baneful
/src/levelgen/src/phase1/test/TestGraphCreator.cpp
UTF-8
11,531
2.5625
3
[]
no_license
#include "AdjacencyMatrix.hpp" #include "AdjacencyMatrixPrinter.hpp" #include "Color.hpp" #include "GraphCreator.hpp" #include "jsonlevelconfig.hpp" #include "jsonutil.hpp" #include "graph_utils.hpp" #include "color_constants.hpp" #include "boost/json.hpp" #include "gtest/gtest.h" #include <algorithm> namespace test ...
true
d46f25bc91fb98a864a0d72371995db2bf503c79
C++
LeiShi1313/leetcode
/leetcode_cpp/49_group_anagrams.cpp
UTF-8
786
3.25
3
[]
no_license
// // Created by Dicky Shi on 6/13/17. // #include <iostream> #include <vector> #include <map> #include <unordered_map> #include <string> #include <ctime> #include "utils.h" using namespace std; class Solution { public: vector<vector<string>> groupAnagrams(vector<string>& strs) { unordered_map<string, vec...
true
73b7d2acb80c6983623c36499bff8935f4404f91
C++
jpoffline/pascal_shp
/PYRAMID.cpp
UTF-8
431
2.546875
3
[]
no_license
#include "PYRAMID.h" PYRAMID::PYRAMID(){ } PYRAMID::PYRAMID(int n){ _nrows = n; } void PYRAMID::create(){ int offset = 1; int nspaces = std::sqrt(3)/2 * _nrows * 3 + offset; nspaces = nspaces / 2; for(int r = 0; r < _nrows; r++){ for(int s = 0; s < nspaces;s++){ add_plaque(PLAQUE("--b")); } fo...
true
6f6e4c0876228b3e198dca48cf05fd0346571976
C++
rafern/multiplayer_roguelike
/src/client/MenuItem.cpp
UTF-8
2,106
3.359375
3
[]
no_license
#include "MenuItem.hpp" MenuItem::MenuItem(int key, std::string text, bool selectable, const Formating& formatting, const Formating& selectedFormatting) : key(key), text(text), formatting(formatting), selectedFormatting(selectedFormatting), selectable(selectable) {} int MenuItem::getKey() const { ...
true
1441d04ff3822839e7603dff307ae29b686525d9
C++
levey-lee/GraphicsEngine
/DiamondGraphicsEngine/inc/core/ComponentBase.h
UTF-8
8,823
2.90625
3
[]
no_license
#pragma once #include "core/Object.h" #include "core/ComponentPool.h" //flag for if a component needs acceess to graphics engine #define SHADED true //flag for if a component needs acceess to graphics engine #define UNSHADED false namespace Graphics { enum class ShaderType; class ShaderProgram; class Gra...
true
f62b5a05eee0ee73d82941ec6dbe08ecad9e242a
C++
playfultechnology/arduino-wirebuzz
/arduino-wirebuzz.ino
UTF-8
1,716
3.34375
3
[ "Apache-2.0" ]
permissive
// CONSTANTS // The "start zone" which players must touch to start the game each time const byte startPin = 8; // Touching any part of the wire itself causes a failure const byte failPin = 9; // The "win zone" at the end of the wire const byte endPin = 10; // A piezo buzzer chirps to signify success/failure const byte ...
true
60ea7baf9d313f9017335bebad45a0afea66792e
C++
Jedibassist/CPlus-Valencia
/ArraysFunctions4/ArraysFunctions4/ArraysFunctions4.cpp
UTF-8
6,289
3.328125
3
[]
no_license
// ArraysFunctions4.cpp : Defines the entry point for the console application. /* Jed Gravelin, June 2013 * * Part 1 Answers: * 1 : If a variable is declared within the paramaters of a function, that variable is NOT available in main * 2 : If a variable is declared within a function itself, that variable is NOT av...
true
73d0108d99d805c094e5879d4932daee79bd6564
C++
piax93/CNodePP
/core/strutils.hpp
UTF-8
2,111
3.140625
3
[]
no_license
#ifndef UTILITIES_HPP_ #define UTILITIES_HPP_ #include <vector> #include <string> namespace util { /** * Split string into tokens * @param src String to split * @param delimiter Delimiter string * @return Vector of tokens */ std::vector<std::string> splitString(const std::string& src, const std::string& delimi...
true
4c29c5f795b2013c46a14b7cc40b1a9f41962d03
C++
novo1985/Leetcode
/Easy/Remove duplicates from sorted array/RemoveDuplicatesFromSortedArray.cpp
UTF-8
555
3.546875
4
[]
no_license
#include <iostream> #include <vector> using namespace std; /* Remove the duplicated number in a sorted array and return the length * for example : [2,2,3,4] -> [2,3,4] return len = 3; * in-place, no extraspace */ class Solution{ public: int removeDuplicates(vector<int>& nums){ //double indice, one for old arr...
true
ce6517f899cec27f09b6f507fc4bde3b2125863e
C++
M-o-C-u-i-s-h-l-e/GeeksforGeeks
/Basic/Binary Array Sorting.cpp
UTF-8
449
2.515625
3
[]
no_license
#include <iostream> using namespace std; int main(void) { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { int n, Count = 0; cin >> n; for (int i = 0, temp; i < n; ++i) { cin >> temp; Count += (temp ==...
true
ea3d03e2bcecaf7feb6522b60067428b685f05ed
C++
woodbineZ/Cplusplus
/Projekt4autochess/Project1/Project1/Postac.cpp
UTF-8
1,442
3.125
3
[]
no_license
#include <iostream> #include "Postac.h" #include "Druzyna.h" using namespace std; Postac::Postac() { atakowal = false; zyje = true; } Postac::Postac(int _koszt, int _hp, int _dmg, string _nazwa, char _rodzaj) { hp = _hp; dmg = _dmg; koszt = _koszt; atakowal = false; zyje = true; dostepna =...
true
ad89d782eecedad306bfc01163b74a5fed547f26
C++
liuguolu/data_structure
/tree/binary/traversing_binary_tree/binary_tree_traversing.cpp
UTF-8
7,373
3.015625
3
[]
no_license
#include <stdio.h> #include <malloc.h> #include <conio.h> #include <queue> #include <stack> // 建立的二叉树模型 // // 1 // / \ // / \ // / \ /...
true
d59bd653b154351c4f1ef3f01e36a28f6f4bb827
C++
wduraes/curso-iot
/sample-code/local.ino
UTF-8
2,726
2.5625
3
[]
no_license
#include <ESP8266WiFi.h> #include <Adafruit_MQTT.h> #include <Adafruit_MQTT_Client.h> #include <Adafruit_Sensor.h> #include <DHT.h> #include <DHT_U.h> #include <SPI.h> #define DHTPIN 10 #define DHTTYPE DHT11 DHT_Unified dht(DHTPIN, DHTTYPE); #define WLAN_SSID "WI-FI" #define WLAN_PASS "SENHA" #define AIO_SERVER...
true
ada3b74b4ffc23c7736a254956327650a2cf969f
C++
eriser/xh_jucemodules
/xh_Utilities/misc/ArrayDuplicateScanner.h
UTF-8
2,158
3.078125
3
[ "MIT" ]
permissive
#ifndef ARRAYDUPLICATESCANNER_H_INCLUDED #define ARRAYDUPLICATESCANNER_H_INCLUDED template <class ValueType> class ArrayDuplicateScanner { JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ArrayDuplicateScanner); public: ArrayDuplicateScanner () { } ~ArrayDuplicateScanner () { } void reset () ...
true
40354085a18595f151846de63688cb9d767c9055
C++
alfmorente/aticaprojectsvn
/CITIUS/CITIUS_Control_Driving/include/RosNode_Driving.h
UTF-8
1,697
2.546875
3
[]
no_license
/** * @file RosNode_Driving.h * @brief Declara el tipo de la clase "RosNode_Driving" * - La clase implementa la gestión del nodo de conduccion (Driving) del * Subsistema de control de UGV * @author Carlos Amores * @date 2013, 2014 * @addtogroup DrivingRosNode * @{ */ #ifndef ROSNODE_DRIVING_H #define ROSN...
true
8d16f7c72139b0d6dad86872bd86a806838cf071
C++
Disbalance/cryptoadapter
/src/platform/websocket.cpp
UTF-8
11,951
2.53125
3
[]
no_license
/*************************************************** * websocket.cpp * Created on Fri, 28 Sep 2018 09:37:36 +0000 by vladimir * * $Author$ * $Rev$ * $Date$ ***************************************************/ #include <map> #include <iostream> #include <exception> #include <platform/log.h> #include "websocket.h...
true
df03e3591780491c575305dfc2304ad4d004426e
C++
whileskies/curriculum_design
/SoftwareArchitecture/linux server/access/ClientAccessInfo.cpp
UTF-8
1,176
2.6875
3
[]
no_license
// // Created by whileskies on 19-6-13. // #include "ClientAccessInfo.h" namespace access { ClientAccessInfo::ClientAccessInfo() {} ClientAccessInfo::ClientAccessInfo(evutil_socket_t sockfd, struct sockaddr_in addr, struct bufferevent *client_bufferevent) : ...
true
ffa5dd45bdab1b48ca9f1931b01ab10a6e8c4ffe
C++
LinkItONEDevGroup/LASS
/SensingOfRiceFields/SensingOfRiceFields.ino
UTF-8
2,914
2.6875
3
[ "MIT" ]
permissive
#include <SoftwareSerial.h> #include <OneWire.h> #include <DallasTemperature.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> #include <Stepper.h> #define DELAY 60000 #define WATER_WIRE_BUS 2 #define SOIL_WIRE_BUS 3 #define ETAPE_PIN A0 #define ETAPE_NUMSAMPLES 15 #define ETAPE_SERIESRESISTOR 560 #define ETAPE_F...
true
899aac849e37e4a6f75e34ab8d207d322b5efaed
C++
colmap/colmap
/src/colmap/math/math.h
UTF-8
8,425
2.53125
3
[ "BSD-3-Clause" ]
permissive
// Copyright (c) 2023, ETH Zurich and UNC Chapel Hill. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright // notic...
true
0ce03433010f3bb87f7440e8b93cb182fbcf4ff5
C++
threeal/sunny-land
/Image.cpp
UTF-8
796
2.90625
3
[]
no_license
#include <stdio.h> #include "Game.h" #include "Resource.h" Image::Image(std::string name, std::string fileName) { this->name = name; texture = NULL; LoadImage(fileName); } Image::~Image() { if (texture != NULL) { SDL_DestroyTexture(texture); texture = NULL; } } ...
true
ad7d2c1b0963199fb033f9ca7d16f1a7c257d4f1
C++
chae-y/coding_test_practices
/map/1302.cpp
UTF-8
422
2.859375
3
[]
no_license
#include<iostream> #include<map> #include<iterator> using namespace std; int main() { int n; cin >> n; map<string, int> m; map<string, int> ::iterator it; for (int i = 0; i < n; i++) { string temp; cin >> temp; m[temp]++; } int maxx = 0; string m_book; for (it = m.begin(); it != m.end(); it++) { if (...
true
8145de709a0cd4584f8f40419e47fda6d6896229
C++
Chinmay-20/Generalized-Data-Structure
/GENERALIZEDDATASTRUCTURES.cpp
UTF-8
70,542
3.6875
4
[]
no_license
#include<iostream> using namespace std; template<class h> struct node { h slldata; struct node *next; }; template<class h> class SLL { private: struct node <h>* head; int isize; public: SLL() { head=NULL; isize=0; } ~SLL() { struct node <h>* temp=NULL; ...
true
f8daef2e18dc8fa1a6e9f3f4af384c7f826ef291
C++
shubhamgupta372/lockless_pubsub_framework
/subscriber.cpp
UTF-8
2,252
3.015625
3
[]
no_license
#include<iostream> #include"message.h" #include"pubsubservice.h" #include"subscriber.h" #include<chrono> #include<unistd.h> using namespace std; subscriber::subscriber() { subscriberMessages = new LocklessQueue; msgcount=0; size = 1024; } subscriber::subscriber(size_t size ) { subscriberMessages = new LocklessQue...
true
8597bcea2040a755205fa7a3ec811ede9efcbe08
C++
tjakway/digital-ant-farm
/src/Util.cpp
UTF-8
1,004
2.5625
3
[ "MIT" ]
permissive
#include "Util.hpp" #include "Types.hpp" #include <random> #include <utility> namespace jakway_antf { namespace { //mersenne //see http://stackoverflow.com/questions/5008804/generating-random-integer-from-a-range std::random_device rd; std::mt19937 mersenne_rng(rd()); } template<typename T> T getR...
true
6961c80261606a74c0bec9381fcaf47a30373613
C++
pjt1988/project_euler
/7/main.cpp
UTF-8
1,273
3.578125
4
[]
no_license
#include <iostream> #include <vector> #include <time.h> using namespace std; int main(){ clock_t t0 = clock(); int num_primes=1; int max_prime=2; int iter=3; while(num_primes < 10001){ int check=0; for(int i=2;i<iter;i++){ if(iter % i == 0){ check=1; break; } } ...
true
feb7e219d994cfb5edec04ac45e8f2b11d2219bd
C++
yejh123/cpp-repos
/练习/练习/文件复制.cpp
GB18030
1,539
3.140625
3
[]
no_license
#include <iostream> #include <fstream> #include <Windows.h> using namespace std; /** * ļ * @param src ԭļ * @param des Ŀļ * @return ture ɹ, false ʧ */ bool CopyFile(const char *src, const char *des) { FILE * fSrc; int err1 = fopen_s(&fSrc, src, "rb"); if (err1) { printf("ļ`%s`ʧ", src); return false; } FIL...
true
d53d37aac16c5df675c8cd368d1362e78fa456ce
C++
ShreyashRoyzada/DSA-Practice-
/LeetCode/#413. Arithmetic Slices.cpp
UTF-8
628
2.671875
3
[]
no_license
class Solution { public: int numberOfArithmeticSlices(vector<int>& A) { if(A.size()<3) return 0; vector<int> res (A.size(),0); for(int i = 2;i<A.size();i++) { if(A[i]-A[i-1] == A[i-1]-A[i-2]) { if(res[i-1]>0) ...
true
5636b686fae0e4a70e1678e05b28de422cc81dae
C++
dany74q/sshpassten
/sshpassten.hpp
UTF-8
2,536
2.96875
3
[ "MIT" ]
permissive
#pragma once #include "pseudo_terminal_manager.hpp" #include <string> #include <vector> #include <memory> #include <unistd.h> namespace sshpassten { namespace detail { inline namespace v1 { /* SSHPassten is a C++14 mini-port of SSHPass (Not every feature was implemented). This utility provides the ability ...
true
d433a937338e54c711cc061fb7432b3046401c7f
C++
refinap/Pulse-Convertion-to-voltage
/Konversi_Pulsa_Jarak_Ke_tegangan.ino
UTF-8
1,256
2.765625
3
[ "CC0-1.0" ]
permissive
;/* =============================================================================== ;Program untuk konversi pulsa jarak ke tegangan ;------------------------------------------------------------------------------------ ; Komponen : ; Encoder ; Arduino Nano ; Resistor 1K ; Kapasitor 220uF ;-----------------------...
true
36eb667abce07503bfd4f08d357d8b1b7ba865df
C++
everpan/tidp
/include/TL_DictMap.h
UTF-8
2,629
2.890625
3
[]
no_license
/* * File: TL_DictMap.h * Author: everpan * * Created on 2011年6月22日, 下午3:41 */ #ifndef TL_DICTMAP_H #define TL_DICTMAP_H #include <map> #include <stdlib.h> #include "TL_Exp.h" namespace tidp { template <class T> class TL_DictMap { public: TL_DictMap() { _kv.clear(); ...
true
5c6bf7c6cd4c1814d54afbedc1dfb50df8d4aa31
C++
hemanth5585/LintCode
/Others/574.Build-Post-Office/574.Build-Post-Office.cpp
UTF-8
1,612
3.125
3
[]
no_license
class Solution { public: /** * @param grid: a 2D grid * @return: An integer */ int shortestDistance(vector<vector<int>> &grid) { int m = grid.size(); int n = grid[0].size(); vector<int>countX(n); for (int j=0; j<n; j++) for (int i=0; i<m; i++) ...
true
808d45ec06d0136c7dd7a6b686adae0039dccb0d
C++
muripic/tp_algoritmos2
/src/Registro.h
UTF-8
589
2.59375
3
[]
no_license
#ifndef __REGISTRO_H__ #define __REGISTRO_H__ #include <string> #include "Tipos.h" #include "modulos_basicos/string_map.h" using namespace std; class Registro { public: Registro(); void definir(const NombreCampo& campo, const Valor& valor); const linear_set<NombreCampo>& campos() const; Valor& opera...
true
5f209f73c4d4bbd2cef1b96cb2379037176ce2cd
C++
luyiming112233/PatCodeRepo
/PatCodeRepo/PatBasic/Basic1027.cpp
GB18030
776
2.84375
3
[]
no_license
#include<cstdio> int main() { int a[100] = { 0,1 }, num, l, k, i, j; char c; scanf("%d %c", &num, &c); for (i = 2; i < 100; i++) { a[i] = a[i - 1] + 2 * (2 * i - 1); } for (i = 1; i < 100; i++) { if (a[i] > num) { l = num - a[i - 1]; k = i - 1; break; } } for (i = 0; i < k - 1; i++) { //ӡո f...
true
d2c58186bac19fbe10cff3280b91dc2a0715ed37
C++
sanchitgoel10/365_of_code
/MMASS SOPJ.cpp
UTF-8
1,049
2.921875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main(){ string s; while(cin >> s){ int n = s.size(); stack <int> Stack; for(int i = 0; i < n; i++){ if(s.at(i) == '('){ Stack.push(-1); } else if(s.at(i) == ')'){ int x = 0; while(S...
true
873a6f757904d933bf388ae7149a20aecd5084e9
C++
mikhaputri/Review-Chapter-2
/4. Restaurant Bill.cpp
UTF-8
672
2.90625
3
[]
no_license
// // 4.cpp // REVIEW BAGUS // // Created by Mikha Yupikha on 11/10/2016. // Copyright © 2016 Mikha Yupikha. All rights reserved. // #include <iostream> using namespace std; int main() { double meal = 88.67; double mealTax = 0.0675; double tipCharge = 0.2; double mealCost = meal + (meal*mealT...
true