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
04468615bce1c6cdecb5194ce411fd8b8aed2a93
C++
liruida/kaoyan-data-structure
/00-Keypoint_in_WangDao/Chapter_05-Tree/00-Binary_Tree/00-Basic_Binary_Tree/01-Create_BiTree/03-Full_BiTree_PreOrder_to_PostOrder.cpp
UTF-8
1,114
3.65625
4
[ "MIT" ]
permissive
#include <iostream> using namespace std; typedef char ElemType; void printArray(ElemType arr[], int length) { for (int i = 0; i < length; i++) cout << arr[i] << " "; cout << endl; } // 满二叉树 // 根据先序遍历序列,得到后序遍历序列 void preToPost(ElemType preOrder[], int preOrderSize, ElemType postOrder[], int postOrderSi...
true
a20b17265eae6aa18fa73839c691acd120ca3896
C++
pzenie1/Pipeline
/Project1/Clipper.cpp
UTF-8
3,475
3.0625
3
[]
no_license
// // Clipper.cpp // // Created by Warren R. Carithers on 01/15/14. // Based on a version created by Joe Geigel on 11/30/11. // Copyright 2014 Rochester Institute of Technology. All rights reserved. // // Contributor: Paul Zenie, pxz5572 // #include "Vertex.h" #include "Clipper.h" /// // Simple module that perf...
true
b60a2387ef9cfd810f86e317616da4f30b7815ee
C++
givenone/practice
/groom/cost.cpp
UTF-8
429
2.78125
3
[]
no_license
#include<iostream> #include<algorithm> using namespace std; int interval[3000]; int num[3000]; int main() { int N, K; cin >> N >> K; for(int i=0; i<N;i++) cin >> num[i]; for(int i=0; i<N-1;i++) interval[i] = num[i+1]-num[i]; sort(interval, interval + N-1); // 0 ~ N-2 (N-1개) int sum = 0...
true
ed6819adb251d941ae486201bc694f0b367d27e7
C++
nicolaslopez99/lista
/main.cpp
UTF-8
1,418
3.65625
4
[]
no_license
#include <iostream> using namespace std; int main(){ lista a; int aux=0; int n; int valor; int pos; do{ cout<<"1.Saber el tamano de la lista"<<endl; cout<<"2.Saber si la lista esta vacia"<<endl; cout<<"3.Ingresar un nuevo elemento"<<endl; cout<<"4.Ingresar un nuevo elemento al final de la list...
true
0ba16a51f535988f5e02ec0e3d6bf57f6984651c
C++
DronMDF/zond
/http/HttpHeader.cpp
UTF-8
973
2.5625
3
[ "MIT" ]
permissive
// Copyright (c) 2018-2019 Andrey Valyaev <dron.valyaev@gmail.com> // // This software may be modified and distributed under the terms // of the MIT license. See the LICENSE file for details. #include "HttpHeader.h" #include <regex> using namespace std; HttpHeader::HttpHeader(const string &header) : header(header)...
true
91fa01c41d498af63777c9908db761d41958d4f7
C++
mvlahovi/Home-Weather-Station
/IndoorUnit/lib/Adafruit_FRAM_I2C-master/Adafruit_EEPROM_I2C.cpp
UTF-8
4,505
2.921875
3
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
/**************************************************************************/ /*! * @file Adafruit_EEPROM_I2C.cpp */ /**************************************************************************/ #include <math.h> #include <stdlib.h> #include "Adafruit_EEPROM_I2C.h" /*==================================================...
true
dce0aba2142cd6a2eae33d50a9c4e0aa3687b182
C++
AleChelli/oF_Project
/RandomWalkerMouse/RandomWalker.cpp
UTF-8
453
2.875
3
[]
no_license
#include "RandomWalker.h" RandomWalker::RandomWalker(){ x= ofGetWindowWidth()/2; y=ofGetWindowHeight()/2; } void RandomWalker::display(){ ofSetColor(ofColor::black); ofVertex(x,y,0); } void RandomWalker::step(){ int choice = int(random(4)); if (choice == 0){ x++; } ...
true
9d4031f3eda57407efdf29a7b39b7e3cfa85e6f8
C++
FilipaDurao/Advent-Of-Code-2016
/Day5/Day5 Part1.cpp
UTF-8
823
2.859375
3
[]
no_license
/* * Day5 Part1.cpp * * Created on: 03/11/2017 * Author: filipa */ #include <iostream> #include "md5.h" using namespace std; bool checkIf5Zeros(string hashed){ if(hashed.substr(0,5) == "00000"){ return true; } else return false; } int main(){ string password = "", input = "ojvtpuvg"; string ...
true
51334bffd73ad805427efba86696d96afd9a9ff2
C++
yjfdl123/unix
/01multithread/download.cpp
UTF-8
1,134
2.84375
3
[]
no_license
#include <iostream> #include <stdio.h> #include <pthread.h> #include <unistd.h> #include <semaphore.h> using namespace std; sem_t sem; void* downloader(void* data) { if (sem_wait(&sem) == 0){ printf("tid:%ld\t begin\n",pthread_self()); sleep(5); printf("tid:%ld\t end\n",pthread_self()); ...
true
922afcd8efdbf0e60fd8ef1b243d8a5fa8235577
C++
hanmon/ameba-arduino-samples
/ReedRelay/build/sketch/ReedRelay.ino.cpp
UTF-8
1,334
2.578125
3
[]
no_license
#include <Arduino.h> #line 1 "d:\\project\\ameba-arduino-samples\\ReedRelay\\ReedRelay.ino" const int reedPin=3,ledPin=9,buzzerPin=4; static bool lastState; #line 3 "d:\\project\\ameba-arduino-samples\\ReedRelay\\ReedRelay.ino" void setup(); #line 13 "d:\\project\\ameba-arduino-samples\\ReedRelay\\ReedRelay.ino" void l...
true
79003c032f3e6def1d59b296a425a4d08c1706e8
C++
jonmarinello/hammerhead
/HhUnitTestFramework/utHhUnitTestFramework/utHhUnitTestFramework.cpp
UTF-8
2,783
2.9375
3
[]
no_license
/* * Copyright (c) 2003-2005, Jon Marinello * */ #include <HhUnitTestFramework/UnitTest.h> class UtHhUnitTest : public HH_UnitTest { public: UtHhUnitTest( bool& variableDataGeneration, bool interactive ) : HH_UnitTest( variableDataGeneration, interactive ), m_stringValue( "defaultStringValue"...
true
c42e468301ca8399cead71d346e499edcf6fe599
C++
technopizza/kdesrosiers_jaconklin_PA5
/pa5kms/bank.cpp
UTF-8
5,406
2.984375
3
[]
no_license
/* * bank.cpp * * Created on: Oct 4, 2018 * Author: kdesrosiers */ #include <iostream> #include <cstdlib> #include <cmath> #include "teller.h" #include "customer.h" #include "tellerevent.h" #include "customerevent.h" #include <time.h> #include "tellerqueue.h" #include "eventqueue.h" using namespace std; cons...
true
3f0f11c6eefa8cf9a72e4b6992037afe4195443b
C++
buptlxb/leetcode-utility
/include/tester.h
UTF-8
877
2.546875
3
[]
no_license
#ifndef TESTER_H #define TESTER_H #include <cassert> #include <lc_config.h> #include <iostream> __LC_NAMESPACE_BEGIN struct Verify; class Tester { friend Verify; static int livecount; const Tester* self; public: Tester() :self(this) {++livecount;} Tester(const Tester&) :self(this) {++livecount;} ...
true
31ddc2e5bd46925e96091817a4b496751562c88a
C++
mzry1992/workspace
/OJ/CDOJ/Ideal Path.cpp
UTF-8
1,606
2.65625
3
[]
no_license
#include <iostream> #include <cstring> #include <cstdio> #include <queue> using namespace std; struct Edge { int to,c,next; }; Edge edge[400000],nedge[400000]; queue<int> Q; int dis[100000],head[100000],nhead[100000],nL,L,n,m,u,v,c; void init(int n) { nL = L = 0; for (int i = 0;i < n;i++) { h...
true
1c5dd6282b5d8a34f776c1717d588fffaa0c4a8d
C++
JoeyTeng/OI
/Google Code Jam/2020/Round 1C/overrandomized.cpp
UTF-8
4,050
2.640625
3
[]
no_license
// Overrandomized #include <bits/stdc++.h> const int64_t QUERIES = 10000; auto input() { int64_t U = 0; std::vector<std::pair<int64_t, std::string>> query; std::cin >> U; for (int i = 0; i < QUERIES; ++i) { int64_t q; std::string r; std::cin >> q >> r; query.push_back...
true
838e1b1d727bbfd821be4451d75bb9ddedcfdb4f
C++
AllenWang0217/DesignPatterns
/TestHelper/TestBuilder.h
UTF-8
777
3.0625
3
[]
no_license
#pragma once #include "../BuilderPattern/Director.h" #include "../BuilderPattern/CBuilder1.h" #include "../BuilderPattern/CBuilder2.h" #include "../BuilderPattern/Product.h" class TestBuilder { public: TestBuilder() { IBuilder* builder = new CBuilder1(); Director* director = new Director(builder); director->C...
true
c270d3f77ee75124f353ca30b5a86922e562eee9
C++
Iviyan/RPGgame
/RPGgame/helper.cpp
WINDOWS-1251
8,036
3.203125
3
[]
no_license
#include "helper.h" int ReadInt(const char* text, std::function<bool(int i, string& msg)> pred, bool nl) { int val = 0; cout << text; while (1) { if (!(cin >> val)) { cin.clear(); cin.ignore(INT_MAX, '\n'); cout << " " << std::endl << "_> "; continue; } cin.ignore(INT_MAX, '\n'); string predMsg...
true
8458cfae2b7a89fafe0c75517165d445c41c6b4c
C++
uechoco/CompetitionProgramming
/AtCoder/BeginnersSelection/Qiita/AGC012A.cpp
UTF-8
444
2.546875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main(){ int64_t n; cin >> n; std::vector<int64_t> a(3 * n, 0); for (int i = 0; i < 3 * n; ++i) { cin >> a[i]; } // 先頭から2つずつとっていったときの2つめの値がチームの強さ sort(a.begin(), a.end(), std::greater<int64_t>()); int64_t total = 0; for (int i = 0; i < n; ++i) { ...
true
b2f620703c54cdaa45c68c2287aa3ec00a62e1e0
C++
Coolchirutha/CP
/Step2/349.intersection-of-two-arrays.cpp
UTF-8
457
2.9375
3
[]
no_license
/* * @lc app=leetcode id=349 lang=cpp * * [349] Intersection of Two Arrays */ #include <bits/stdc++.h> using namespace std; // @lc code=start class Solution { public: vector<int> intersection(vector<int> &nums1, vector<int> &nums2) { set<int> hashmap(nums1.begin(), nums1.end()); vector<int> result; fo...
true
bcb641efaf6b11667a3a9d6203abe08ed6dec90b
C++
pointwind/PWL
/code/functional.h
GB18030
5,902
3.34375
3
[]
no_license
#pragma once #include<cstddef> namespace PWL { template<class Arg, class Result> struct Unarg_Function { using arguemnt_type = Arg; using result_type = Result; }; template<class Arg1,class Arg2,class Result> struct Binary_Function { using first_argument_type = Arg1; using second_argument_type = Arg2; ...
true
320586e930eb9b4d6060fae238d62d3c5e752260
C++
Elizabethvk/UP-2020
/Assessment_1/Assessment_1_task03.cpp
UTF-8
3,228
3.265625
3
[]
no_license
/* Задача 3: Напишете програма, която прочита от стандартния вход размера (цяло число n, по-малко от 1000000) и елементите на масив от числа с плаваща точка. След това програмата ви трябва да провери дали има такoва число k (0 < k < n-1), за което всички числа в масива, намиращи се на разстояние k едно от друго, се раз...
true
4060a32bcbcee66231cc32166bb985a8b5b695d4
C++
Kullsno2/C-Cpp-Programs
/Diameter.cpp
UTF-8
1,986
3.640625
4
[]
no_license
#include<algorithm> #include<utility> #include<windows.h> #include<map> #include<vector> #include<iostream> using namespace std ; struct node{ int val ; struct node * left ; struct node * right ; node(int x) : val(x) , left(NULL) , right(NULL) {} }; int diameter(struct node * root,int &height) { if(!root){ h...
true
ff494eef2f81c2066780c867ab4de3697e2bec3e
C++
PratAm/Algorithms
/testMiddle.cpp
UTF-8
742
3.15625
3
[]
no_license
#include<iostream> using namespace std; int main(){ int array[]={9,7,5}; int start = 0; int end =2; int middle_index = (end-start+1)/2; cout<<"middle"<<middle_index<<endl; int first = 0; int second = -1; int high = array[start]; int high2= -1; if (high< array[middle_index]){ high = array[middle_index]...
true
ad5d4a0e303e8d1f0fca31f9f1c020c4f8a69e2a
C++
StumpyTheStump/Graphics-Engine-2020
/Graphics Engine/Graphics/camera.cpp
UTF-8
1,823
2.703125
3
[]
no_license
#include "camera.h" //glm::mat4 projection = glm::perspective(glm::radians(90.0f), 16 / 9.0f, 0.1f, 100.0f); // //glm::mat4 model = glm::mat4(1); // //const float radius = 10.0f; //float camX = sin(glfwGetTime() * radius); //float camZ = cos(glfwGetTime() * radius); // //glm::vec3 cameraPos = glm::vec3(0.0f, 0.0f, 3.0...
true
1fa840837a3db4c5ff4a9cc7a06e2d29e2a01a00
C++
seddon-software/cplusplus
/10_TypeCasting/09.RuntimeTypeInformation.cpp
UTF-8
913
3.21875
3
[]
no_license
/////////////////////////////////////////////////////////////// // // Runtime Type Information // /////////////////////////////////////////////////////////////// #include <iostream> #include <typeinfo> using namespace std; /* * Run Time Type Information (RTTI) is appended to the v-table * Only the na...
true
8f2430292d5163868f8cc8d6d1d95a79395ff2c6
C++
duchedwa/ne697-lectures
/lecture09/map_demo.cpp
UTF-8
1,790
4
4
[]
no_license
#include <iostream> #include <map> #include <string> using namespace std; int main(int argc, char* argv[]) { // We must specify both types, the key type and the value type // These can be whatever you want map<string, int> my_map = { {"one", 1}, {"one thousand", 1000}, {"two", 2} }; // Access wit...
true
67ee0f994c75a3054eeabb3acdd7e10a9991c6f0
C++
kkisic/Procon
/CPP/AtCoder/arc/043/a.cpp
UTF-8
876
2.609375
3
[]
no_license
#include <cmath> #include <iostream> #include <vector> #include <queue> #include <algorithm> #include <utility> #include <iomanip> #define int long long int using namespace std; typedef pair<int, int> P; const int inf = 1e15; signed main(){ int n, a, b; cin >> n >> a >> b; vector<double> s(n); for...
true
2ea206a13c2ddbec86b65c4277d0dbe0a0d0d0a0
C++
slealq/estructuras_abstractas
/Lab8/principal.cpp
UTF-8
1,023
3.109375
3
[]
no_license
#include "heap.h" void test(void){ // Probar el heap C_Heap heap_min = C_Heap(1, 20); C_Heap heap_max = C_Heap(0, 20); cout << "Insertando secuencia 0, 1, 2,.. 19" << endl; for(int i =0; i<20; i++){ heap_min.insert(i); heap_max.insert(i); } cout << "Heap MAX: " << endl; heap_max.print_heap(); ...
true
319b144a98d071f06e0d37fb4c52c2e84f2dbecd
C++
Parul-Gupta/Data-Structures
/cStack.hpp
UTF-8
2,179
3.671875
4
[]
no_license
#ifndef CSTACK_HPP #define CSTACK_HPP #include<iostream> using namespace std; template <typename E> class cStack { // an interface for a stack private: E* arr; int size; //max capacity of the cStack int red_top; //index of the top elem of red_stack int blue_top; //index of...
true
39d5cab773662028acd853604500d1630a078261
C++
storm3d/cw-icfpc-2017
/solver/Solver.h
UTF-8
2,329
3.03125
3
[]
no_license
#ifndef CW_ICFPC_2017_SOLVER_H #define CW_ICFPC_2017_SOLVER_H #include "GameState.h" #include "Empire.h" /** A decision proposed by a strategy */ struct StrategyDecision { River river; /** Immediate score increase */ score_t scoreIncrease{0}; /** * How much score we're risking if we don't take...
true
c73da9db983e5257e7f2f2618700243d8c28edd8
C++
da96jdm/rf_sniffer
/arduino/rf_sniffer.ino
UTF-8
2,677
2.96875
3
[]
no_license
#define ledPin 7 // Onboard LED on shield #define buttonPin 6 // Onboard button attached on the shield #define RxAdataPin A0 //RF Receiver data pin = Analog pin 0 int rxAdata = 0; const int dataSize = 200; //Arduino memory is limited (max=1700) byte storedData[dataSize]; //Create an ar...
true
33380cb1d9a5a0f899d0a2bf1e7538ae238360d8
C++
MuhammadUsaid/GameProject
/MyGame/MenuScreen.cpp
UTF-8
3,456
2.859375
3
[]
no_license
#include "MenuScreen.h" #include "TextManager.h" #include "Button.h" MenuScreen::MenuScreen() { state = 0; running = true; // Screen::pause = 0; backGround = TextureManager::LoadTexture("Images/menu.png"); fontSheet = TextureManager::LoadTexture("Images/font.png"); newGameButton = new Button(fon...
true
af0c15fa53b09f7e8fd6d2f7c6344648699d5939
C++
geranium12/Algorithms
/DataStructures/BinaryHeap/BinaryHeap/Source.cpp
UTF-8
517
2.96875
3
[]
no_license
#include <fstream> #include <vector> using namespace std; int main() { ifstream fin("input.txt"); ofstream fout("output.txt"); long n; fin >> n; vector<long> v(n); for (int i = 0; i < n; i++) { fin >> v[i]; } bool f = true; for (int i = 1; i <= n && f; i++) { long a = 2 * i; long b = 2 * i + 1; if (...
true
9a5e4572a583d42fca0c72080a9d268283246c51
C++
DavidHoskins/SpaceInvaders
/SpaceInvader.h
UTF-8
1,090
2.546875
3
[]
no_license
#ifndef SPACEINVADER_H #define SPACEINVADER_H #include <SFML/Graphics.hpp> #include <SFML/System.hpp> #include "AlienHandler.h" #include "NetworkHandler.h" #include "Player.h" #include "MenuScreen.h" class SpaceInvader { public: //Constructor & Destructor. SpaceInvader(); ~SpaceInvader(); //Public methods. voi...
true
b18155fd054a0861c76b36b2cbd30f8eb01eaa5e
C++
theJinFei/C-Test
/CCF/t1/main.cpp
UTF-8
579
2.875
3
[]
no_license
#include <iostream> #include <vector> using namespace std; int main() { int n, k; cin >> n >> k; int ans = 0; vector<int> v1; for(int i = 0; i < n; i++){ int temp; cin >> temp; v1.push_back(temp); } for(int i = 0; i < v1.size();){ if(v1[i] >= k || (i == v1.si...
true
9932e899e19e4a642d3cec05c1b3a5b56dfbbe77
C++
mkoldaev/bible50cpp
/lang/ur/gen/Bible53.h
UTF-8
10,969
2.546875
3
[]
no_license
#include <map> #include <string> class Bible53 { struct ur1 { int val; const char *msg; }; struct ur2 { int val; const char *msg; }; struct ur3 { int val; const char *msg; }; public: static void view1() { struct ur1 poems[] = { {1, "1 پَولُس اور سِلوانُس اور تِیمُتھِیُس کی طرف سے تھِسّلُنیکِیوں کی کلِیسیا کے نام ج...
true
3acea11bf249b385c125f65fce42f4fb9d185ed3
C++
Towkir7970/Operating-System-Algorithms-Implementation-In-C-
/Deadlock/Deadlock_Detection.cpp
UTF-8
1,197
2.90625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; vector<int> graph[100]; int color[100], cycle[100], ara[100]; int nodes, edges, top=-1, track; void print() { int j=0, i; while(cycle[top]!=track){ ara[j]=cycle[top]; color[cycle[top]]=-1; top--; j++; } ara[j]=cycle[top]; ...
true
0c898be2f835d1dfa8130a6a4cff03984065c06c
C++
Isabelle-Angrignon/Labyrinthe
/LabyrintheConsole/LabyrintheConsole/Commande.h
UTF-8
384
2.9375
3
[]
no_license
#pragma once #include <Windows.h> class CCommande { public: CCommande(int vkKey) :m_Key{ vkKey }{} bool operator==(const CCommande &c) const { return GetKey() == c.GetKey(); } bool operator!=(const CCommande &c) const{ return !CCommande::operator==(c); } int GetKey()const { return m_Key; } CCommande() :m_Key{ V...
true
d639d0c69a72ba8de93254b0169a3e939ab2302d
C++
bsc-ssrg/hermes
/include/hermes/transport.hpp
UTF-8
4,269
2.546875
3
[]
no_license
#ifndef __HERMES_TRANSPORT_HPP__ #define __HERMES_TRANSPORT_HPP__ #include <cstddef> #include <stdexcept> #include <unordered_map> namespace hermes { /** Valid transport types (i.e. transport types supported by Mercury) */ enum class transport : std::size_t { // BMI plugin bmi_tcp = 0, // MPI plugin ...
true
46cab20b508f64f218d2a2c5daac2ef897f4240c
C++
ETalienwx/Linux
/RingQueue/ring.cc
UTF-8
1,725
3.3125
3
[]
no_license
#include <iostream> #include <pthread.h> #include <stdlib.h> #include <time.h> #include <semaphore.h> #include <unistd.h> #define NUM 16 class ring{ private: int Ring[NUM]; sem_t blank_sem; sem_t data_sem; int p_step; int c_step; public: void P(sem_t *sem) ...
true
49a1ce077b16529c6773f3e2bacdf4eaa13e14fc
C++
grahamjx/cpp-graph
/source/main.cpp
UTF-8
7,991
3.734375
4
[]
no_license
/* Name: Joel Graham Course: CS 163 Programming Assignment #5 File: main.cpp Purpose: This program simulates a topic / dependency graph. Each topic will be passed into the corresponding ADT which handles storage and manipulation of the data. Each topic will be stored in one data structure, adjacency list. The...
true
7a07b7c8386d5295c24a29863e9995c4f41ec181
C++
ftiasch/ccpc-final-2020
/main/kmp/gen.cc
UTF-8
8,533
2.859375
3
[]
no_license
#include "testlib.h" #include <algorithm> #include <cstring> #include <vector> using i64 = long long; // Two Efficient Algorithms for Linear Suffix Array Construction #define pushS(x) sa[--cur[(int)s[x]]] = x #define pushL(x) sa[cur[(int)s[x]]++] = x class SuffixArray { public: std::vector<int> sa; std::vector<in...
true
93841780a1cac575538693a9ea7f054a681b6fb8
C++
fengjixuchui/liblgpp
/src/lgpp/repl.hpp
UTF-8
517
2.78125
3
[ "MIT" ]
permissive
#ifndef LGPP_REPL_HPP #define LGPP_REPL_HPP #include <iostream> #include <optional> #include <sstream> namespace lgpp { using namespace std; struct REPL { REPL(istream &in, ostream &out): in(in), out(out) {} istream &in; ostream &out; function<bool (const string &line)> on_getline; }; ...
true
d4b003305d37c53d6501aaa2500124e16b3ab58d
C++
menomuel/amazing_maze
/renderobject.cpp
UTF-8
2,024
2.734375
3
[]
no_license
#include "renderobject.h" RenderObject::RenderObject() : indexBuf_(QOpenGLBuffer::IndexBuffer) { initializeOpenGLFunctions(); // Generate 2 VBOs arrayBuf_.create(); indexBuf_.create(); } RenderObject::~RenderObject() { arrayBuf_.destroy(); indexBuf_.destroy(); } void RenderObject::render(QOp...
true
415e53781c9df39ffd675d00c0a4c1816a76a3da
C++
disklogrrr/LA_Enigma
/Enigma.cpp
UTF-8
6,870
2.59375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <windows.h> #include <time.h> void setcolor(unsigned short text, unsigned short back) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), text | (back << 4)); } int InvMatrix(int n, const double* A, double* b) { double m; regi...
true
e6d48160b50bafc70abdafe9d4dd16abb081f6e2
C++
Kingwl/MiniStl
/mini stl/Stack/Stack.cpp
GB18030
304
2.84375
3
[]
no_license
// Stack.cpp : ̨Ӧóڵ㡣 // #include "stdafx.h" #include "Stack.hpp" int _tmain(int argc, _TCHAR* argv[]) { Stack<int> s; s.push(1); s.push(2); std::cout << s.top(); s.pop(); std::cout << s.top(); s.pop(); std::cout << s.size(); system("pause"); return 0; }
true
e7f631d772933ab87146ce0a1ee3ec2befae3919
C++
neowei1987/Zeus
/algorithm/dfs.cc
UTF-8
2,206
3
3
[]
no_license
#include "iostream" #include <vector> #include <sstream> #include <stack> #include "defines.h" #include <map> using namespace std; /* dfs */ class Solution { public: void dfs(vector<vector<char>>& grid, int m, int n, int i, int j, vector<bool>& visit) { //方向数组 pair<int, int> ds[4] = { ...
true
b28906b69bcb72f40e557c8e3198c3dac66dbdb5
C++
sraihan73/Lucene-
/core/src/test/org/apache/lucene/util/automaton/TestLevenshteinAutomata.cpp
UTF-8
12,755
2.59375
3
[]
no_license
using namespace std; #include "TestLevenshteinAutomata.h" namespace org::apache::lucene::util::automaton { using LuceneTestCase = org::apache::lucene::util::LuceneTestCase; // import static // org.apache.lucene.util.automaton.Operations.DEFAULT_MAX_DETERMINIZED_STATES; void TestLevenshteinAutomata::testLev0() ...
true
f2e5741ab72774f84d873a18381b352c173bffee
C++
Wingedcross/UCR-CS14-Lab6
/Lab 6/AVLTree.h
UTF-8
752
2.8125
3
[]
no_license
#pragma once #ifndef __AVLTREE_H #define __AVLTREE_H #include "Node.h" #include <fstream> #include <string> using std::string; using std::ofstream; // Class declaration for EVLTree class AVLTree { private: Node * root; Node * findUnbalancedNode(const string &); void insert(const string &, Node *); void visualiz...
true
ff78e14bdbf7942c352edc7e186a11d08c5624c1
C++
MarcosK11/Campo-Minado
/main.cpp
UTF-8
6,625
2.8125
3
[]
no_license
#include <iostream> #include <stdlib.h> #include <time.h> #define NADA 0 #define MINA -1 using namespace std; int main() { int bombas, auxBombas, posL=0, posC=0, Lin, Col, qtlinha, qtcoluna, auxCoord, entradaLinha, entradaColuna, qtdJogadas = 0, fimDeJogo = 0; srand(time(NULL)); // Entrada d...
true
db37b785876f65251640881f1cb7997c52e789a1
C++
averywallis/Assorted-Arduino-Code
/alternate_SD_logging/alternate_SD_logging.ino
UTF-8
2,173
2.921875
3
[]
no_license
/* SD card test This example shows how use the utility libraries on which the' SD library is based in order to get info about your SD card. Very useful for testing a card when you're not sure whether its working or not. The circuit: SD card attached to SPI bus as follows: ** MOSI - pin 11 on Arduino Un...
true
63a392fa8599d378473429fac24f12cc0f4b4375
C++
KertAles/Osvajalec-Game
/queueitem.cpp
UTF-8
306
2.515625
3
[]
no_license
#include "mainwindow.h" #include "queueitem.h" extern MainWindow* w; QueueItem::QueueItem(){ owner = nullptr; pos = nullptr; } void QueueItem::countdown() { turnsLeft--; qDebug() << "Countdown for" << type << " Left: " << turnsLeft; if(turnsLeft < 1) { createItem(); } }
true
f85154e8ec9b8c26c5f7217ac2c3778afb1d29e5
C++
aquan0/C-
/hoanvi.cpp
UTF-8
539
2.671875
3
[]
no_license
#include<iostream> using namespace std; int Bool[30] = {0}; int arr[30] = {0}; int n; void xuat(); void Try(int i); int main() { cin >> n; Try(1); } void xuat() { for(int i = 1; i <= n; i++) { cout << arr[i]; } cout << " "; } void Try(int k) { for(int i = 1; i <= n; i++) { ...
true
48bbf05dc00f845717ece3a541b38244c2057f72
C++
yangqi137/lattices
/src/lattices/bravias3d/offset.hpp
UTF-8
2,528
2.75
3
[ "MIT" ]
permissive
#ifndef LATTICES_BRAVIAS3D_OFFSET_HPP #define LATTICES_BRAVIAS3D_OFFSET_HPP #include "lattice.hpp" #include <type_traits> #include <cassert> #include <algorithm> namespace lattices { namespace bravias3d { template <typename TAG, typename SIZE_TYPE> struct OffsetCat { typedef TAG Tag; typedef SI...
true
d82f3c12b30ef534598dcb77f6b496fb7e49f10e
C++
intoxicated/Graphics
/Vector/Vector.cpp
UTF-8
6,493
3.65625
4
[]
no_license
/** * Vector Implementation * * Purpose: Vector class allows an application to perform * vector arithmatic in a simple manner. * * Author: Wooyoung Chung * * Date: Jan 13th, 2014 * * This work complies with the JMU Honor Code. */ #include "Vector.h" #pragma mark - Constructors Vector::Vector(in...
true
91d77c2ab452d46992da5bfad460084cdd239be9
C++
DinCahill/ury-playd
/src/tokeniser.cpp
UTF-8
2,682
3.015625
3
[ "MIT", "BSL-1.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// This file is part of playd. // playd is licensed under the MIT licence: see LICENSE.txt. /** * @file * Definition of the Tokeniser class. * @see tokeniser.hpp */ #include <algorithm> #include <cassert> #include <cctype> #include <cstdint> #include "response.hpp" #include "tokeniser.hpp" Tokeniser::Tokeniser...
true
39d1c3314c39f49da17655008eac0a25250bc3ef
C++
antoinechalifour/Cpp_TP4
/main.cpp
UTF-8
2,922
3.3125
3
[]
no_license
#include <iostream> #include <stdio.h> #include "Chaine.h" #include "CTableGType.h" #include "DynamicTable.h" using namespace std; template <class T> void swapT(T&a, T&b){ T tmp; tmp=a; a=b; b=tmp; } ostream& operator<<(ostream& os, const Chaine& c){ os<<c.getString(); return os; } int main(){ // --...
true
8c810cf8c53dafb32fd92d2cbcb7a4773b5ffcf1
C++
lesroad/Linux_System_Programming
/进程/mmap2.cpp
UTF-8
609
2.75
3
[]
no_license
//有血缘关系匿名映射区 #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/mman.h> #include <unistd.h> #include <cstring> #include <sys/wait.h> using namespace std; int main(int argc, char **argv) { int length = 4096; void *ptr = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANON, -1, 0); if(pt...
true
01ac9ecb9379073b8e828c382709c1d867f684bb
C++
jean-tu/GoogleTu
/searcheng.h
UTF-8
1,030
2.53125
3
[]
no_license
#ifndef SEARCHENG_H #define SEARCHENG_H #include <map> #include <vector> #include <string> #include "webpage.h" #include "myset.h" #include "pageparser.h" class SearchEng { public: SearchEng(); ~SearchEng(); void add_parse_from_index_file(std::string index_file, PageParser* parser); void add_parse_page...
true
3569058f16184eefd2d6a59eb25f3d288b0214b7
C++
yaoReadingCode/University-SVN
/2019/s2/pssd/week09practice/main.cpp
UTF-8
543
2.875
3
[]
no_license
#include "VeryInterestingMovie.hpp" #include <iostream> #include <string> #include <vector> #include <ctype.h> using namespace std; int main() { vector<string> test32; test32.push_back("YYYYYYN"); test32.push_back("YYYYNYY"); test32.push_back("NYYYNYY"); test32.push_back("NYYYYYN"); test32.push_back("YYYYYYN")...
true
f8a3a5d3ae5d528bbccaace93c0fd399e9d9c953
C++
objective-audio/db
/db/additions/object/yas_db_object_utils.cpp
UTF-8
2,748
2.578125
3
[ "MIT" ]
permissive
// // yas_db_object_utils.cpp // #include "yas_db_object_utils.h" #include <cpp_utils/yas_stl_utils.h> #include "yas_db_entity.h" #include "yas_db_model.h" #include "yas_db_relation.h" using namespace yas; std::vector<std::optional<db::const_object_ptr>> db::get_const_relation_objects( db::const_object_ptr co...
true
f79bb720abbab372603ce05bdfb03ad912c06098
C++
Luis-Lamat/Coding_Challenges
/UVa/nlogonia.cpp
UTF-8
916
3.359375
3
[]
no_license
/* * UVa problem: 11498 - Division of Nlogonia */ #include <iostream> #include <string> using namespace std; int main () { // initial user inputs int queries, centerX, centerY, X, Y; cin >> queries >> centerX >> centerY; do { // query while loop while (queries--){ // house coordinates input...
true
322a4808999813b5580afb65a8fdd969412dd5a3
C++
sohardforaname/ACM_ICPC_practice
/POJ/3393.cpp
GB18030
1,953
2.5625
3
[]
no_license
#include <iostream> using namespace std; int num[10010][15][2]; const int ping[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; const int run[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int getnum(int y, int m) { if ((y < 1582 && y % 4 == 0) || y == 1700) return run[m - 1]; else if (y >=...
true
a6938563fb82c1974e08d7b320c7ef5b4a6ddb00
C++
ut0s/atcoder
/ABC/ABC125/c.cpp
UTF-8
1,772
3.25
3
[]
no_license
/** @date Time-stamp: <2019-04-29 08:35:45 tagashira> @file c.cpp @url https://atcoder.jp/contests/abc125/tasks/abc125_c **/ #include <algorithm> #include <chrono> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; uint gcd(uint a, uint b) { if (b...
true
3a9b3f55e57a79d1254896bbc15112e0f1d5afac
C++
vindarten/game_server
/include/Parser.h
UTF-8
2,444
2.640625
3
[]
no_license
#ifndef PARSER_H #define PARSER_H #include "Ipn.h" #include "StackOperations.h" #include "automat.h" class ParsExc { public: ParsExc() {} virtual ~ParsExc() {} virtual void PrintError() const = 0; }; class ParsExcLParen: public ParsExc { char *str; public: ParsExcLParen(const char *s) { str = MyStrdup(s); } vi...
true
f043e7315e63c3f93aea675b70cc784a5f2367e8
C++
MichaelAPatel/NNSB_Pipe_Analysis
/utilities/ArrayUtilities.cpp
UTF-8
2,110
3.0625
3
[]
no_license
//============================================================================ // Name : ArrayUtilities.cpp // Author : Michael Patel, Jeffrey McKaig, Gracen Dickens, // Chase Ziegler, and Jessica Masterson // Version : 0.1.0 // Description : //====================================================...
true
2ee919609d714789ad35bd3be15ad5ec6603eebb
C++
Snektron/Anaconda
/src/ast/expr/variablenode.h
UTF-8
634
2.53125
3
[]
no_license
#ifndef SRC_AST_EXPR_VARIABLENODE_H_ #define SRC_AST_EXPR_VARIABLENODE_H_ #include <string> #include "ast/expr/expressionnode.h" class VariableNode : public ExpressionNode { private: std::string variable; DataTypeBase* datatype; public: VariableNode(const std::string&); virtual...
true
d4359edacfe7c933377d8abc99d6dcfc09c1099f
C++
MSTSIGGame/Megaminer-6
/client/c/game.cpp
UTF-8
23,035
2.59375
3
[]
no_license
//Copyright (C) 2009 - Missouri S&T ACM AI Team //Please do not modify this file while building your AI //See AI.h & AI.cpp for that #pragma warning(disable : 4996) #include <string> #include <cstring> #include <cstdlib> #include <iostream> #include <sstream> #include <fstream> #include <vector> #include <algorithm> ...
true
ce6378b5da1f4b46210e1bd65c104f7d4a5a497e
C++
1160208849wfl/cpp-primer5e
/src/concurrency/chapter6/stack/stack.cc
UTF-8
1,710
3.828125
4
[]
no_license
// // C++ concurrency in Action. // #include <exception> #include <memory> #include <mutex> #include <stack> #include <thread> #include <iostream> template <typename T> class thread_safe_stack { private: std::stack<T> data; mutable std::mutex m; public: thread_safe_stack() = default; // copy-ctor, important...
true
b78f20223a0df8018ac418ab0cb9a58a2941bb9c
C++
WasifMTahir/CPP-Mini-Projects
/Airline Ticketing System/task2.cpp
UTF-8
9,986
2.96875
3
[]
no_license
#include<iostream> using namespace std; void login(string grid[][8], string roll[][8], string students[][2]); void logoff(string grid[][8], string roll[][8]); void reset(string grid[][8], string roll[][8], string students[][2], string request[][2]); void message(string grid[][8], string roll[][8], string stude...
true
63e0f827d4b33caefb8639cb24a3d2c75819ad32
C++
socc-io/algostudy
/codeforce/1365/c2.cpp
UTF-8
403
2.609375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; const double pi = 3.14159265358979323846264338327950288; void solve() { int n; scanf("%d", &n); n <<= 1; double t = pi/2 - pi/n; double k; k = sqrt(1/(cos(t)*cos(t)) - 3.0/4.0); printf("%lf\n", k); k = tan(t); printf("%lf\n", k); k = 1/cos(t); printf("...
true
0d3d53142b1a7ab74cc011b56602f6701a06374b
C++
aaronwhitesell/Massasauga
/Massasauga/Engine/globals.h
UTF-8
1,014
2.921875
3
[]
no_license
#ifndef GLOBALS_H #define GLOBALS_H #include "keyboard.h" #include "FrameRateRegulator.h" #include "../Game/game.h" #include "SDL.h" // alw - 6/10/10 - Using the Singleton design pattern // Modern C++ Design: Generic Programming and Design Patterns Applied class Globals { public: static Globals* Instance(); int get...
true
84ab6a35984814ecf604c05336abae2cc1b72daa
C++
changx03/pacman_homage
/source_file/pacman_ver041/mesh_utils.cpp
UTF-8
6,600
2.984375
3
[]
no_license
#include "mesh_utils.h" #include "render.h" namespace mesh_utils{ void PrintSceneInfro(const aiScene *mScene){ std::cout << "-------------PRINT SCENE INFORMATION-------------\n"; std::cout << "lights = " << mScene->mNumLights << std::endl; std::cout << "material = " << mScene->mNumMaterials << std::endl; std...
true
4d10535c717bc07ab6f9a67027ec38ee1a47d8ae
C++
jash-git/Jash-good-idea-20210419-001
/C++ Builder example/CBuilder6(BCB6)与Windows API经典范例/Ch3_Window Functions/ch03-49-2/Unit2.cpp
GB18030
2,419
2.5625
3
[]
no_license
//--------------------------------------------------------------------------- //ĿģɶʱʱĻλãѡȡӴ //--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Unit2.h" //--------------------------------------------------------------------------- #pragma package(sma...
true
166a1c8547b3ad82f30df29be3c9bb082e7989c6
C++
ZNika/kurs
/Model/lib/Search/search_tests.cpp
UTF-8
10,143
2.671875
3
[]
no_license
#include <gtest/gtest.h> #include <iostream> #include "include/GraphInterface/GraphInterface.h" #include <include/Graph/Graph.h> #include <GraphNode/GraphNode.h> #include <include/Search/Search.h> #include <GraphConnection/GraphConnection.h> // ConnectionParams using namespace Polaris; TEST( SearchTest, SimpleSearchHa...
true
37bfae130d3ef002b75817a8fcb35e8a7ec837aa
C++
uiuc-cs126/NaiveBayesWorkshop
/interface/expression.h
UTF-8
2,354
3.359375
3
[]
no_license
#ifndef EXPRESSION_H #define EXPRESSION_H #include <iostream> #include "operation.h" //============== // How NOT to define constants // This method is C-style, and we should avoid it for a few reasons //============== /* #define PI 3.14 #define E 2.7 */ namespace math { //================== // Constants (The right ...
true
448705f7b96e18767b098932a83a286218c79a36
C++
burnian/Online-Judge
/HangDian/HangDian/2014_09_1.h
WINDOWS-1252
405
2.671875
3
[]
no_license
//date: 2019/2/1 //author: burnian //des: #pragma once #include<iostream> using namespace std; #define N 10000 void Solution() { bool flag[N + 1] = { false }; int n, temp, sum = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> temp; flag[temp] = true; if (temp - 1 >= 0 && flag[temp - 1]) sum++; if (t...
true
5b51d7e111e08b863e0fc469b402a3866aac6aa8
C++
channyHuang/leetcodeOJ
/2075.cpp
UTF-8
698
2.828125
3
[]
no_license
class Solution { public: string decodeCiphertext(string encodedText, int rows) { int len = encodedText.length(); if (len == 0) return ""; string res; int cols = len / rows; for (int j = 0; j <= (cols - rows) + 1; ++j) { for (int i = 0; i < rows; ++i) { ...
true
faf7eeb8de581f811d86110d6295fb75fffb206a
C++
pombredanne/MI
/ankit/Templates/StackT.cpp
UTF-8
885
3.8125
4
[ "Unlicense" ]
permissive
#include<iostream> using namespace std; template<class T> class Stack { private: class Node { private: T data; Node *next; public: Node(T d):data(d){} Node *getNext(){return next;} void setNext(Node *temp){ next=temp;} T getData(){ return data;} }; Node *top; public: Stack<T>(); void pus...
true
f7416ff5e72fe06bf4c540c9ee9ce849b7a1246c
C++
mkbn-consultancy/modern_cpp
/type traits/6_enable_if_2.cpp
UTF-8
1,367
3.28125
3
[]
no_license
//-------- MKBN Training and Consultancy --------// //--------------- miri@mkbn.co.il ---------------// #include <iostream> #include <type_traits> #include <limits> //example from : https://stackoverflow.com/questions/25251380/stdnumeric-limits-as-a-condition template<typename T> void isInt(T t){} template<typename T...
true
ad6b9816b79fec0a0bde89c5cd461db646ec87eb
C++
TeodorKolev/c-tasks
/chetvurta_zadacha.cpp
UTF-8
1,380
3.671875
4
[]
no_license
#include <iostream> #include <math.h> using namespace std; double greaterThanZero(int point, int pointMinusOne, int pointPlusOne) { return (((pow(pointMinusOne, 2) ) - (point * 2) + (pow(pointPlusOne, 2))) / (pointMinusOne - pointPlusOne)); } double lessThanZero(int point, int pointMinusOne, int pointPlusOne) { ...
true
cfd86845ea5aad29efa7a6201ff37c9d56656fb9
C++
frankbozar/Competitive-Programming
/Solo Practice/UVa/AC/11103.cpp
UTF-8
620
2.546875
3
[]
no_license
#include<cstdio> #include<cstring> #include<string> using namespace std; string sol(const string& S) { string T, K, N, P; for(char c : S) { if( strchr("KACE", c) ) K+=c; else if( strchr("pqrst", c) ) P+=c; else N+=c; } if( P=="" ...
true
281f5385f7efac0952b8eb2c4187c78257d19613
C++
NataliaD/SE2P
/Software/SE2P2/Thread.cpp
UTF-8
1,013
2.578125
3
[]
no_license
/* * Thread.cpp * * Created on: 02.10.2013 * Author: Jannik Schick (2063265) * Philipp Kloth (2081738) * Rutkay Kuepelikilinc (2081831) * Natalia Duske (2063265) */ #include "Thread.h" #include <iostream> #include <unistd.h> #include "HWaccess.h" #include "HAL.h" #i...
true
5518be50b6f1075a0ccbbc74db0a61d8f70c9ef1
C++
ajimenezduque/MonteCarloEngine
/src/Option/Option.cpp
UTF-8
11,004
2.859375
3
[]
no_license
// // Created by alejandro on 17/06/19. // #include "Option.h" #include <cmath> #include <boost/math/distributions/exponential.hpp> #include <boost/math/distributions/normal.hpp> #include <iostream> #include <numeric> using namespace std; OptionBS::OptionBS (optionType tipo,double interesAnual, double strike, double ...
true
7d27f8817aa2777ebceceae4f3abd14a90c4c0a0
C++
Yapele/Fingerprint-scanner-for-exam-room
/yun_camera/yun_camera.ino
UTF-8
1,545
2.796875
3
[]
no_license
// Sketch to upload pictures to Dropbox when motion is detected #include <Bridge.h> #include <Process.h> int flag = 1; // Picture process Process picture; // Filename String filename; // Pin int accessgranted = 13; // Path String path = "/mnt/sda1/"; void setup() { Serial.begin(9600); pinMode(accessgranted,INPU...
true
dd8433571fafadf7d5012907e432d47ac9922606
C++
Anton94/OOP-Cplusplus
/SD semester projects mostly/Homework three/MyTestStruct.h
UTF-8
557
2.703125
3
[]
no_license
#pragma once #include <iostream> #include <vector> // My type for testing, it can be with very big data if it needs... for now it`s only int value for comparation and some load for bad swapping! struct MyTestStruct { friend std::ostream& operator<<(std::ostream& out, MyTestStruct & val); public: MyTestStruct& oper...
true
260f969f8a10bdfc989fca76dddc3f74c6567b61
C++
jstnhuang/rapid
/rapid_pr2/include/rapid_pr2/joint_states.h
UTF-8
736
2.703125
3
[ "BSD-3-Clause" ]
permissive
#ifndef _RAPID_PR2_JOINT_STATES_H_ #define _RAPID_PR2_JOINT_STATES_H_ #include <map> #include <string> namespace rapid { namespace pr2 { // JointStates holds default joint values for the PR2. // These can be replaced as needed, and passed to a RobotStatePublisher. // The default joint values are with the wheels facin...
true
7d6e51e1eaefcd72ac32a9fdc054cff75a4cc15e
C++
yuzhuowen/codingpractice
/poj/poj3006.cpp
UTF-8
619
2.96875
3
[]
no_license
#include<iostream> #include<cmath> using namespace std; bool isprime ( int k ) { if(k==2||k==1)return true; for ( int i = 2 ; i <= sqrt (k) ; i ++ ) { if ( k % i == 0 ) { return false ; } } return true ; } int main() { int a,d,n,j,i; while(1) { ...
true
95b09399f16c275f525497cf77db93ca7a49939c
C++
kokay/CodingPractice
/TopCoder/VolumeGuess.cc
UTF-8
1,008
3.25
3
[]
no_license
#include <iostream> #include <vector> #include <sstream> #include <algorithm> #include <set> using namespace std; class VolumeGuess { public: int correctVolume(vector<string> queries, int numBoxes, int ithBox) { string strIdx1, strIdx2, strVol; vector<set<int>> memo(numBoxes + 1); vector<int> volumes(nu...
true
4e129f5cc0eb643d8b8a775756efeb97642b8948
C++
ji12345ba/CS225-UIUC
/mp7/tests/GraphTests.cpp
UTF-8
2,798
3.28125
3
[]
no_license
#include "../cs225/catch/catch.hpp" #include "../Graph.h" #include "../Edge.h" #include "../Vertex.h" Graph<Vertex, Edge> createTestGraph() { /* _ b /--------- h / | _/ | a -- c -- e f -- g \_ _/ d */ Graph<Vertex, Edge> g; g.insertVertex("a"); g...
true
902b3651f440443a6d1cff281b856e6b43b0084e
C++
newparts/TAPOO
/Observer/main.cpp
UTF-8
2,920
3.453125
3
[ "MIT" ]
permissive
#include <iostream> #include <vector> using namespace std; class Subiect { vector < class Observator * > observatori; bool scor; // trigger, event public: // se inregistreaza singur void attach(Observator *obs) { observatori.push_back(obs); } // event // set daca ...
true
91f0cb9bd6ea7c2f116e1d63d15e7917e8ba0ca4
C++
aliasvishnu/leetcode
/Solutions/523***-ContinuousSubarraySum.cpp
UTF-8
767
2.78125
3
[]
no_license
class Solution { public: bool checkSubarraySum(vector<int>& nums, int k) { int sum = 0; bool nonzero = false; unordered_set<int> st; // if( k < 0) k *= 1; if(k == 0){ for(int i = 0; i < nums.size()-1; i++) if(nums[i] == 0 && nums[i+1] == 0) return true; retur...
true
6d37dd698953da2d315ec18a6eaf2d0c663c007f
C++
DavidLee528/Cpp_Primer_5th_edition
/ex/3-5.cpp
UTF-8
290
2.765625
3
[]
no_license
/* * @ Author: 李天昊 * @ Description: * @ Date: * @ E-mail: 13121515269@163.com */ #include<iostream> using namespace std; int main() { string tmp; string str; while ( cin >> tmp ) { str += tmp + ' '; } cout << str << endl; return 0; }
true
eb70d12a0478ceab76aee837f91e077851347e18
C++
hilkojj/CG-windesheim-OpenGL
/Project1/source/graphics/ShaderProgram.cpp
UTF-8
1,876
2.828125
3
[]
no_license
#include "ShaderProgram.h" #include <vector> #include <iostream> ShaderProgram::ShaderProgram(std::string name, const char* vertSource, const char* fragSource) : name(std::move(name)) { compile(vertSource, fragSource); } void ShaderProgram::compile(const char* vertSource, const char* fragSource) { progr...
true
c5418c0b022239467eda198bd997d8f84e010942
C++
Menooker/Kuai
/src/Kuai/ConcurrentHashMap.hpp
UTF-8
8,409
2.75
3
[ "Apache-2.0" ]
permissive
#pragma once #include "SpinLock.hpp" #include "ListNode.hpp" #include "LogicalClock.hpp" #include <stdint.h> #include <utility> namespace Kuai { struct PolicyNoRemove { static void updateLocalClock() { } struct DeletionFlag { constexpr bool isDeleted() ...
true
32452cbb11659126a70a5d985cb7bf13266cec16
C++
thomaszhang/coding-challenges
/cpp/to_lower_case.cpp
UTF-8
515
2.859375
3
[]
no_license
/* Find out why "if (str[i] >= 'A' && str[i] <= 'Z')" is needed? Line 64: Char 16: runtime error: index -123 out of bounds for type 'std::__cxx11::string [256]' (_Serializer_.cpp) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior _Serializer_.cpp:73:16 */ class Solution { public: string toLowerCase...
true
c604f06259e8dbdb50842a61f4f6382b8bfbee63
C++
yuansun97/Data-Structures-cpp
/mp_traversals/imageTraversal/ImageTraversal.cpp
UTF-8
4,266
3.25
3
[]
no_license
#include <cmath> #include <iterator> #include <iostream> #include "../cs225/HSLAPixel.h" #include "../cs225/PNG.h" #include "../Point.h" #include "ImageTraversal.h" ImageTraversal::~ImageTraversal() { } /** * Calculates a metric for the difference between two pixels, used to * calculate if a pixel is within a ...
true
3456cb46e9e877d41861cf6461782c6a89b24cdc
C++
casual-hostility/symmetrical-palm-tree
/conditional statements.cpp
UTF-8
205
3.15625
3
[]
no_license
int main() { int x = 0; 42 == x; //Equality 42 != x; //Inequality 100 > x; //Greater than 123 >= x; //Greater than or equal to -10 < x; //Less than -99 <= x; //Less than or equal to
true
fafee456e6bf9f5b8360bc15f206a9f53756f2e8
C++
reisdima/Trabalho-DCC146
/ProjetoTrabalho/Tag.cpp
UTF-8
1,228
3.484375
3
[]
no_license
#include "Tag.h" #include <stack> Tag::Tag(string tag) { primeiro = NULL; } Tag::~Tag() { //dtor } void Tag::InserirElemento(string a, string b){ ElementoTag *elemento1 = new ElementoTag(a); ElementoTag *elemento2 = new ElementoTag(b); elemento1->SetProx(elemento2); if(primeiro == NULL){ ...
true
3ed930b8c19e33eb2cdd4e8a1068cf499d10e881
C++
MathProgrammer/CodeForces
/2020/Practice/Programs/Line.cpp
UTF-8
746
3.171875
3
[]
no_license
#include <iostream> #include <string> #include <algorithm> using namespace std; long long extended_gcd(long long A, long long B, long long &x, long long &y) { if(B == 0) { x = 1; y = 0; return A; } long long x1, y1; long long gcd = extended_gcd(B, A%B, x1, y1); y ...
true