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
4b536d9f5f4b695242d4431799f67b053abd9cde
C++
afeer123/c-
/表达式函数.cpp
GB18030
972
2.5625
3
[]
no_license
#include"tcp.h"; int wsa() { WSADATA wsadata; WORD wVersionRequested = MAKEWORD(1, 1); int nResult = WSAStartup(wVersionRequested, &wsadata); return nResult; } BOOL SOCKET_Select(SOCKET hSocket, int nTimeOut, BOOL bRead) { fd_set fdset; timeval tv; FD_ZERO(&fdset); FD_SET(hSocket, &fdset); nTim...
true
52fe7a481356cf44bbc8e9fe783169b303f1535f
C++
cristiancristea00/tic-tac-toe
/src/BoardManager.cpp
UTF-8
5,290
2.953125
3
[ "GPL-3.0-only" ]
permissive
/******************************************************************************* * @file BoardManager.cpp * @author Cristian Cristea * @date September 17, 2021 * @brief Source file for the BoardManager class. * * @copyright Copyright (C) 2021 Cristian Cristea. All rights reserved. *******************************...
true
5aae0c084e22cfa7114b64da2719fb14fd1a8396
C++
wwuhn/wwuhn.github.io
/witisoPC/32cpp/贺利坚/类相关/立方柱类.cpp
GB18030
1,305
3.671875
4
[]
no_license
#include <iostream> using namespace std; // class Bulk { public: void get_value(); void display(); private: void get_volume(); //ڲģΪ˽кϢ void get_area(); float lengh; float width; float height; float volume; float area; }; void Bulk::get_value() { cout<<"ple...
true
47a6d8f48a568cdda14c68cbd9e6e0c08d49d59d
C++
sympiler/sympiler
/sparse_blas/dense_blas/test_main.cpp
UTF-8
1,395
2.71875
3
[ "MIT" ]
permissive
// // Created by George Huang on 2019-11-21. // #include <cmath> #include <iostream> #include <chrono> #include "testBLAS.cpp" #include "BLAS.cpp" std::chrono::time_point<std::chrono::system_clock> start, end; int main() { /// Benchmark for dot product int N = 1000000; auto x0 = new double[N](); auto x1 = new do...
true
f42e93a2a32ca1b045732bb3fdbeff7b5329c727
C++
lethanhtam1604/SNY
/Algorithm & Data Structure/Algorithm/BellmanFord.cpp
UTF-8
1,568
3.171875
3
[]
no_license
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <queue> #include <algorithm> using namespace std; #define MAX 100 const int INF=1e9; struct triad { int source; int target; int weight; }; vector<int> dist(MAX, INF); vector<triad> graph; int n, m; int path[MAX]; //SPFA là...
true
55860ef7819f58a593e826279ec9a72b77302e17
C++
neonmag/Dates
/Project18/main.cpp
UTF-8
4,118
3.03125
3
[]
no_license
#include <iostream> #include "CDate.h" using namespace std; class InputOuptut { private: char m_charackter; int m_data; public: InputOuptut(); InputOuptut(const char m_charackter, const int m_data); void SetMCharactrer(const char m_charackter) { this->m_charackter = m_charackter; } void SetMData(const int ...
true
c446f9a6b3cd017907900d944d3d1bb31197bdb2
C++
mkulagowski/Voronoi
/src/Vector.hpp
UTF-8
327
2.859375
3
[]
no_license
#pragma once #include <cstdint> class Vector { public: Vector(); Vector(uint8_t x, uint8_t y, uint8_t z); Vector(uint8_t x); Vector avg(const Vector& other) const; uint8_t operator[] (uint8_t index) const; bool operator== (const Vector& b) const; bool operator!= (const Vector& b) const; private: uint8_t mVal...
true
9a0f1161a60cebcf5ab550c9650cb6c749aea0dd
C++
Marco2018/leetcode
/leetcode752.cpp
UTF-8
2,061
2.734375
3
[]
no_license
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <vector> #include <math.h> #include <algorithm> #include <string> #include <queue> #include <limits.h> using namespace std; struct point { int a; int b; int c; int d; point(int a, int b, int c, int d) :a(a), b(b), c(c), d(d) {} };...
true
4b7d86057a998daed6401e8056ce4e82fe5cf57b
C++
XiaoXiaoLui/LeetCode
/Create_Maximum_Number.cpp
UTF-8
2,081
3.109375
3
[]
no_license
/****************************************************************************************** Create Maximum Number ******************************************************************************************/ #include<bits/stdc++.h> using namespace std; #define pii pair<int, int> #define mp make_pair #define ...
true
a6c9361eb7a945fd5ad959f78e1a68ab80773b77
C++
vincentchauau/Real-Time-Gaming
/Source.cpp
UTF-8
4,091
2.734375
3
[]
no_license
#include <windows.h> // Global variables const int ID_TIMER = 1; // timer id HDC hdc; // memory HBITMAP *hImages = new HBITMAP[8]; // frames int time = 0; // time int x = 0, y = 0, dx = 2, dy = 3; // location(x,y), velocity(2,3) bool bContinue = true; // continue flag // Check whether continue or not bool CanWeContinu...
true
437fb49737714f9d031d15b3a92b27138fc3bbe8
C++
Cuda-Chen/DCP3573
/Assignment8/main.cpp
UTF-8
1,998
3.53125
4
[ "MIT" ]
permissive
// https://www.geeksforgeeks.org/find-four-elements-that-sum-to-a-given-value-set-2/ #include <bits/stdc++.h> using namespace std; class pairSum { public: int first; int second; int sum; }; int compare(const void *a, const void *b) { const int ia = (*(const pairSum *)a).sum; const...
true
c9571fcb455f2cddcb6a89397c93813e64561135
C++
980f/safely
/pileup/main.cpp
UTF-8
3,367
2.625
3
[]
no_license
//(C) 2017 Andrew Heilveil #include <iostream> #include <random> #include "minimath.h" /** simulation of deatime tracking amptek DP5 SCA signals on a tiny3.0 class controller */ class CounterIsr { public: double quantum;//processor clock rate, 1 / Hz /** time from event to isr acknowledges it*/ unsigned late...
true
81f29ae965bb5d065a5d72513b22314fd84b4f1b
C++
kukaro/KamangBlogData
/ZZZ-MyStudy/멀티미디어응용-김종남/20180430/4_4_1.cpp
UTF-8
1,713
3
3
[]
no_license
/* 이미지 로딩해서 데이터 확인 */ #include <iostream> #include <opencv/cv.hpp> using namespace std; using namespace cv; void print_matInfo(string name, Mat img) { string mat_type; switch (img.depth()) { case CV_8U: mat_type = "CV_8U"; break; case CV_8S: ...
true
8b4fa9f744a88b71141d9d8248747e350993baed
C++
rajeshkumarblr/datastructures
/LinkedList/addlists.cpp
UTF-8
1,274
3.34375
3
[ "MIT" ]
permissive
#include "LinkedList.h" #include <stack> static Node* addLinkedList(Node* list1, Node* list2) { stack<Node*> stack1; Node* tmp = list1; while (tmp) { stack1.push(tmp); tmp = tmp->next; } stack<Node*> stack2; Node* nd = list2; while (nd) { stack2.push(nd); nd = nd->next; } Node* t...
true
db554dd29dfe17b86826a8b24f993027c68ea66e
C++
dingyaguang117/AOJ
/511 车队/main.cpp
UTF-8
744
2.75
3
[]
no_license
#include <stdio.h> #include <algorithm> #include <string.h> using namespace std; struct Pair { int a,b; }; int N; Pair A[5001]; bool steped[5001]; bool cmp(const Pair &a,const Pair &b) { if (a.a==b.a) { return a.b<b.b; } return a.a<b.a; } int main() { int T,i,j,num,count=0; Pair one; scanf("%d",&T); whi...
true
b2c523f11fab9d0f062c085fffe8c5f11ca0823e
C++
jstarw/practice
/random/heap.cpp
UTF-8
3,191
3.578125
4
[]
no_license
#include <iostream> using namespace std; class MinHeap { int *arr; int capacity; int heapSize; public: MinHeap(int); void minHeapify(int i); int parent(int i) { return (i-1)/2; } int left(int i) { return 2*i+1; } int right(int i) { return 2*i+2; } int getMin() { return arr[0]; } void swap(int* a, int* b); ...
true
dbf6ab3f1d67e36e299ea3a94f1d34a112326b69
C++
vtudio/PhoneWarsDemo
/Engine/Source/Rendering/CCFrameBufferManager.h
UTF-8
3,175
2.625
3
[ "Apache-2.0" ]
permissive
/*----------------------------------------------------------- * 2c - Cross Platform 3D Application Framework *----------------------------------------------------------- * Copyright © 2010 – 2011 France Telecom * This software is distributed under the Apache 2.0 license. * http://www.apache.org/licenses/LICENSE-2....
true
1519d38b7c6b6f321e75d9473ce8ab4858d9d454
C++
EskAere/EpicMonsterTruckSimulator
/PetitMoteur3D/AnimationComponent.h
UTF-8
680
2.734375
3
[]
no_license
#pragma once #include "GameObject.h" #include "AnimationManager.h" namespace PM3D { class AnimationComponent : public Component { public: static constexpr char* typeId = "AnimationComponent"; virtual const char* GetTypeId() { return "AnimationComponent"; } private: GameObject* owner; public: virtual Game...
true
dae31e658e9b0baeab27cae26bc60ff7bb3fde6a
C++
Hugo-Marques-work/WizardsChess
/server/Player.h
UTF-8
603
2.9375
3
[]
no_license
#ifndef PLAYER_H #define PLAYER_H #include <string> #include <list> #include <map> #include "Game.h" class Player { private: std::string _userId, _password; std::map<int, Game*> _games; public: Player (const std::string& userId, const std::string& password); const std::string& user() {return _us...
true
c23ddf2b0d701d7db3467e0c162f26abf6e202f3
C++
eduherminio/UVa_OnlineJudge
/10420_Conquests.cpp
UTF-8
1,568
3.53125
4
[ "MIT" ]
permissive
#include <iostream> #include <string> #include <vector> using namespace std; class lovers { public: string _country; int _n_women; lovers(string country, int n); lovers(string country); }; lovers::lovers(string country, int n) { _country= country; _n_women= n; } lovers::lovers(string country) { _country= c...
true
c8810af4750a5d66510d9eed6204d73ad6f41880
C++
InfoTeddy/SSVOpenHexagon
/src/SSVOpenHexagon/Utils/Timeline2.cpp
UTF-8
3,452
2.703125
3
[ "LicenseRef-scancode-unknown-license-reference", "AFL-3.0", "AFL-2.1" ]
permissive
// Copyright (c) 2013-2020 Vittorio Romeo // License: Academic Free License ("AFL") v. 3.0 // AFL License page: https://opensource.org/licenses/AFL-3.0 #include "SSVOpenHexagon/Utils/Timeline2.hpp" #include "SSVOpenHexagon/Utils/Match.hpp" #include <type_traits> #include <variant> #include <utility> #include <chrono>...
true
daf4ba38f811a488900d84dc226fd11513555ac0
C++
TheMediocritist/MemoryLCD-2
/main.cpp
UTF-8
1,006
2.609375
3
[]
no_license
/* * STM32F4 Sharp Memory LCD test * * Copyright 2014 <b@Zi.iS> * License GPLv2 */ #include "stm32f4xx.h" #include "MemoryLCD.h" MemoryLCD lcd; void setup() { lcd.begin(); lcd.setTextColor(0); lcd.setTextSize(1); lcd.setTextWrap(1); } void loop() { puts("Loop"); lcd...
true
a3eee192ef3f6a547bb634c5309a422059b159fc
C++
climoge/moteur_physique
/apps/project/PMat.cpp
UTF-8
995
2.5625
3
[]
no_license
#include "PMat.hpp" PMat::PMat(glm::vec3 _pos, float _m, bool _isFix) { pos = glm::vec3(_pos.x, _pos.y, _pos.z); m = _m; vit = glm::vec3(0, 0, 0); frc = glm::vec3(0, 0, 0); isFix = _isFix; } void PMat::UpdateLeapFrog(double h) { if(isFix) return; vit.x += h / m * frc.x; vit.y += h / m * frc.y; vit.z += h /...
true
fe317a82e71806c6c0621bd5e203a275fe86bcfd
C++
naelmansi/cpptraining2
/GradeBook.cpp
UTF-8
1,836
3.5625
4
[]
no_license
//GradBook.cpp - Grade Book class implementation //This is the GradeBook class implementation //ver 1.0 . by Nael #include <iostream> // #include "GradeBook.h" // Import class header. I still have problem with VSC, that I have to put all the files in the //working directory. I will search and...
true
7a832903ced647c9c0a6068895bbff564013cde9
C++
alexwalterbos/brick-plane-razor
/col.h
UTF-8
1,295
3.609375
4
[ "MIT" ]
permissive
#pragma once #include "glm/glm.hpp" #include <algorithm> struct Rect { glm::vec2 min, max; }; struct Circle { //Center position glm::vec2 center; float radius; }; class Collision { public : static bool intersects(const Rect & rect, const Circle & circle) { // Find the closest point to the circle within ...
true
40051fa5892c112d604cae2cf5844b6c99be9a06
C++
b00n3r/oostubs-1
/working_dir/object/strbuf.h
UTF-8
2,331
3.328125
3
[]
no_license
/***************************************************************************** * Operating Systems I * *---------------------------------------------------------------------------* * * * ...
true
774212040a28a0b3bc0bd8d857ae72e8c9d02f83
C++
Mayank-Parasar/leetcode
/count_unival_subtrees.cpp
UTF-8
2,018
3.921875
4
[]
no_license
// // Created by Mayank Parasar on 2020-01-11. // /* * A unival tree is a tree where all the nodes have the same value. Given a binary tree, * return the number of unival subtrees in the tree. For example, the following tree should return 5: 0 / \ 1 0 / \ 1 0 / \ 1 1 The 5 trees are: - The t...
true
ee4f83f1d3d2aa6cf797d425c85e5cccb788308e
C++
razmik1996/JustExercises
/AbstractEmployeePolimorph/AbstractEmployeePolimorph/HourlyEmployee.h
UTF-8
491
3.0625
3
[]
no_license
#pragma once #ifndef HOURLY_H #define HOURLY_H #include "Employee.h" class HourlyEmployee : public Employee { public: HourlyEmployee(const string& first, const string& last, const string& ssn, double wage = 0.0, double hours = 0.0); void setWage(double wage); double getWage() const; void setHours(double hour);...
true
ae796fc7fe26672a2d608516a33525f864970d60
C++
dlx-designlab/Aura
/Aura_8/LightCount.cpp
UTF-8
1,022
2.765625
3
[ "MIT" ]
permissive
#include "Arduino.h" #include "LightCount.h" #include "FastLED.h" /*———————————————— Constructer ————————————————*/ LightCount::LightCount() {} /*———————————————— Initialize ————————————————*/ void LightCount::setup(int _index) { index = _index; //randomSeed(analogRead(0)); setTime(); } /*———————————————— ...
true
1c650e93b3112451e9c6691078fdc070fbbcadc6
C++
LLLLOREN/Courseworks
/数据结构/作业/5_28.cpp
UTF-8
1,025
3.296875
3
[]
no_license
//Determine whether it is a complete binary tree bool isCompleteBTree(bTree* tree){ queue<bTreeNode*> allnode; bTreeNode* temp = tree; bool isleaf = false; if(tree == NULL){ return false; } if(tree->lChild == NULL && tree->rChild == NULL){ return true; }else{ allnode...
true
482f0fc44c6e8c3994aa9ef9c26d6249c78c6eec
C++
MichaelRiccardi/TigerZone
/Core/BoardManager/Move.h
UTF-8
1,928
3.078125
3
[]
no_license
#ifndef __MOVE_H #define __MOVE_H #include "../Tiles/Tile.h" #include "Coord.h" class Move { public: Tile& getTile() const; const Coord& getCoord() const; unsigned int getRotation() const; int getMeepleLocation() const; bool getHasCrocodile() const; bool getPlacesTi...
true
01040174c8abba5076cc03dc8460918b305d97d6
C++
rkbjunior/pubkcrypto
/helpers.cpp
UTF-8
505
3.328125
3
[ "MIT" ]
permissive
#include <fstream> #include <sstream> #include <vector> #include <cstdint> #include <iostream> #include <iomanip> #include "helpers.h" using namespace std; /* Converts a uint64_t into an ascii equivalent string Param: value - a uint64_t value to be converted Returns: An ascii representation of a uint64_t */ string...
true
7bf4d7b09c4c285907865be958c6728ad413286e
C++
cszawisza/riscv-vm
/riscv_vm/elf.cpp
UTF-8
2,695
2.640625
3
[ "MIT" ]
permissive
#include <memory> #include <stdio.h> #include <stdlib.h> #include "elf.h" #include "memory.h" #include "../riscv_core/riscv.h" elf_t::elf_t() : hdr(nullptr) , raw_size(0) { } bool elf_t::upload(struct riscv_t *rv, memory_t &mem) const { // set the entry point rv_set_pc(rv, hdr->e_entry); // loop over all ...
true
2741bfb03c0555cd96ecccfe42cc26eb780b7f02
C++
jerryhanhuan/test-code-backup
/TEST_DIR/test_ctors/test/ctors.cpp
GB18030
2,470
3.734375
4
[]
no_license
#include "stdafx.h" #include <iostream> using namespace std; //һ 캯ĵ˳ // 1 Ӳܼ̳и׵Ĺ // 2 ִ˳: // a) Ķ󣬹캯ִкûйϵ // b) Ķ󣬹캯ִ˳ // i. ִиĹ캯 // ii. dzԱĹ캯 // iii.ִĹ캯 // iv. ִ˳͹캯෴ // // // class Base { public: Base() { cout<<"Ĺ캯ִ!"<<endl; } ~Base() { cout<<"ִ!"<<endl ;} }; //ijԱ c...
true
6555133aadde185d940b24e9c3741cf184f618d3
C++
maheshvele/DataDrivenGameEngine
/Tetris/source/Library/Datum.h
UTF-8
14,370
3.671875
4
[]
no_license
#pragma once #include <cstdint> #include <string> #include <iostream> #include <sstream> #include "glm/glm.hpp" #include "RTTI.H" namespace Library { //Forward declaration class Scope; /** Datum class. Run-time polymorphic array of values */ class Datum { public: /** Enum used to keep track of the type of...
true
7846cc67f20991930b916726dbdda3295e5500cc
C++
shivam04/codes
/leetcode-questions/score-after-flipping-matrix.cpp
UTF-8
1,021
2.84375
3
[]
no_license
class Solution { public: int power(int m, vector<int> g) { int ans = 0; int n = g.size(); for(int i=0;i<n;i++) { ans += i*pow(2,n-i-1); } return ans; } int matrixScore(vector<vector<int>>& grid) { int m = grid.size(); int n = grid[0].size()...
true
53e1846161aa08fd348158fc7534c55d09cf26a3
C++
stevester94/CppExamples
/_unsorted/toodleDoAPI/toodleDoAPI.cpp
UTF-8
2,767
2.828125
3
[]
no_license
//Toodledo API access #include "md5.h" #include <string> #include <iostream> #include <curl/curl.h> #include "json.hpp" using namespace std; using json = nlohmann::json; #define APP_TOKEN "api56d886468fd70" #define APP_ID "ssmackeyTDAPI" #define USER_ID "td52d2442ce2e79" #define CACHED_SESSION_TOKEN "td56dc219d4a09...
true
d1f7e64d7ec7e509861fc6f80ff2237da84ed955
C++
toffaletti/libten
/tests/test_task.cc
UTF-8
10,812
2.765625
3
[ "Apache-2.0" ]
permissive
#include "gtest/gtest.h" #include <thread> #include "ten/descriptors.hh" #include "ten/semaphore.hh" #include "ten/channel.hh" #include "ten/task.hh" using namespace ten; using namespace std::chrono; static void bar(std::thread::id p) { // cant use EXPECT_TRUE in multi-threaded tests :( EXPECT_NE(std::this_th...
true
1bba6d5dacda6191288694f3ed63bcea2204f055
C++
kiseop91/OpenRPG
/OpenRPG/States/State.h
UTF-8
1,413
2.734375
3
[ "MIT" ]
permissive
#pragma once class State { private: protected: sf::RenderWindow* window; std::map<std::string, int>* supportedKeys; std::map<std::string, int> keybinds; bool paused; float keyTime; float keyTimeMax; sf::Vector2i mousePosScreen; sf::Vector2i mousePosWindow; sf::Vector2f mousePosView; // Resources std:...
true
81d44471207701ad2b0390f3a5869bd1976674bc
C++
GeorgeBely/Arduino
/Lesson/RadioReceiver/RadioReceiver.ino
UTF-8
1,388
3.046875
3
[]
no_license
#include <VirtualWire.h> /** Подключаем приёмник к пину 11 */ #define RADIO_RX_PI 11 void setup() { Serial.begin(9600); vw_set_ptt_inverted(true); // Необходимо для DR3100 vw_set_rx_pin(RADIO_RX_PI); vw_setup(2000); // Задаем скорость приема vw_rx_start(); // Начинаем мониторинг эфира } void lo...
true
17715c5b2d7be93115a15e4d90b3784681636909
C++
deniskoronchik/sc-machine
/tools/builder/src/main.cpp
UTF-8
2,326
2.53125
3
[ "MIT" ]
permissive
/* * This source file is part of an OSTIS project. For the latest info, see http://ostis.net * Distributed under the MIT License * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT) */ #include "builder.h" #include <iostream> #include <boost/program_options.hpp> int main(int argc, ...
true
401bea3bf380aae7fc3c85ed99dca13e4614d3c7
C++
FMock/College_Work
/CS144/Assignment_02/main_employee_database.cpp
UTF-8
7,699
3.75
4
[]
no_license
#include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <string> #include <cctype> using namespace std; #include "employee.h" /* CS144 Assignment #2 Frank Mock This program uses a text file called "data.txt" This file is included with the source code. Some names in data.txt are Fra...
true
ceea480763c5520f15a09c10b8968ba232f2a57c
C++
WhiZTiM/coliru
/Archive2/88/dd8ae5b1885521/main.cpp
UTF-8
1,645
3.015625
3
[]
no_license
#include <sstream> #include <iostream> #include <typeindex> #include <wiertlo/enum_enable.hpp> struct Base { virtual void print() const { std::cout << "Base\n"; } }; struct A : Base { virtual void print() const { std::cout << "A\n"; } }; struct B : Base { virtual void print() const { std::cout << "B\n"; } }; s...
true
84d66e3a7dec17068771615483fa9fe53a19fadd
C++
zerocity/Neurocid
/src/placer.hpp
UTF-8
10,086
2.75
3
[]
no_license
/* * placer.hpp * * Created on: Mar 7, 2014 * Author: elchaschab */ #ifndef PLACER_HPP_ #define PLACER_HPP_ #include <vector> #include "util.hpp" #include "2d.hpp" #include "population.hpp" #include "ship.hpp" #include <functional> #include <iostream> namespace neurocid { using std::vector; using std::fu...
true
20cde6476d2928f716efd08ad6b8e84bd3fdb6f0
C++
Rurril/IT-DA-3rd
/study/Ace/Week1/BOJ_1405_이정혁.cpp
UHC
1,654
3.3125
3
[]
no_license
#include<iostream> #include<vector> using namespace std; int movement[4][2] = { {1,0},{-1,0} ,{0,1},{0,-1} }; int n, L, R, U, D; bool visit[33][33]; //˳ 33 double result; vector<double> v; /* bfs Ϸٰ ׸׷ dfs ȯ , Žؼ ö󰡴° . 湮ó,,, ׷ ȹԵ,,, n Ȯ ؼ ָ ,,, length n϶ return ϸ ȵǷ... ->̰ ƴϰ Ҽ ... */ void...
true
c39f46a5a007ad95345b887c00e87e90c9ac7e80
C++
brookswithrow/RPG
/RPG/BattleMenu.cpp
UTF-8
1,768
2.90625
3
[]
no_license
// // BattleMenu.cpp // RPG // // Created by Brooks Withrow on 7/7/16. // Copyright © 2016 Brooks Withrow. All rights reserved. // #include "BattleMenu.h" BattleMenu::BattleMenu() { } BattleMenu::BattleMenu(BattleInfo* aInfo, SDL_Renderer* aRenderer) { init(aInfo, aRenderer); } void BattleMenu::init(Ba...
true
9c58f610bc9f82091c77bd16afe22cd83474651d
C++
compilepeace/DS_AND_ALGORITHMS
/DS_with_C++/recursion_challenges/practice/replace_pi.cpp
UTF-8
829
3.421875
3
[]
no_license
#include <iostream> #include <cstring> #include <cstdlib> using namespace std; #define MY_STRING "apibpicpidddddpie" void shift2places(char *s, int n) { for (int i = n - 1; i >= 0; --i) s[i + 2] = s[i]; } // Replace "apibcpiee" --> "a3.14bc3.14ee" void replacePi(char *s, int n) { // base case: if len...
true
dc3e5cf120e30c528b3c39aebb8d752482a09c33
C++
mikislidstrom/Mikis
/C++ stuff/ShapesLibrary/ShapesLibrary/Cone.h
UTF-8
403
3
3
[]
no_license
#pragma once #include "Shape.h" class Cone : public Shape { public: Cone(double height, double radius); double getVolume() const override; double getSurface() const override; const std::string& getTypeName() const override; void setDimensions(double height, double radius); const Dimensions& getDimensions() con...
true
30c214d4a060c03ecee41406e7abfe166f7ecf6c
C++
jackytck/topcoder
/DocumentSearch.cxx
UTF-8
3,143
3.359375
3
[ "MIT" ]
permissive
// BEGIN CUT HERE // PROBLEM STATEMENT // You have been tasked with writing a function that will scan through a given document, and determine how many times a given word or phrase appears in that document. However, it is important that your function does not count overlapping occurrences. For instance, if the docum...
true
71d8399143524e30fd76a9f67cddbeb5ff9c9c61
C++
stetre/moonfonts
/src/fonts/stb_font_consolas_26_latin_ext.inl
UTF-8
98,365
2.828125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// Font generated by stb_font_inl_generator.c (4/1 bpp) // // Following instructions show how to use the only included font, whatever it is, in // a generic way so you can replace it with any other font by changing the include. // To use multiple fonts, replace STB_SOMEFONT_* below with STB_FONT_consolas_26_latin_e...
true
bef6ddb8f607b3caf95d6c1ccb2d1dcb8781e267
C++
pinkslot/myf4k
/Algorithms/Detection/detection.h
UTF-8
1,078
2.859375
3
[]
no_license
// Interface for a generic motion detection class. #ifndef ALG_DETECTION_H #define ALG_DETECTION_H #include <cv.h> #include <context.h> #include "../algorithm.h" namespace alg { class Detection : public Algorithm { public: // Analyze next frame and return motion mask virtual cv::Mat nextFr...
true
ed47639623a8af8739b42f4b5fd3058c8a8f56cb
C++
amundada2310/SFND_Lidar_Obstacle_Detection
/processPointClouds.cpp
UTF-8
13,365
2.84375
3
[]
no_license
// PCL lib Functions for processing point clouds #include "processPointClouds.h" #include <unordered_set> //constructor: template<typename PointT> ProcessPointClouds<PointT>::ProcessPointClouds() {} //de-constructor: template<typename PointT> ProcessPointClouds<PointT>::~ProcessPointClouds() {} template<typename...
true
1d1e1abcdc624e44dd23d207f0321f5f5fb1da77
C++
uvazke/AtCoder
/ABC/ABC230/Dans.cpp
UTF-8
855
2.5625
3
[]
no_license
#include <algorithm> #include <float.h> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <vector> #define myfor(i, N) for (i = 0; i < N; i++) #define myforFL(i, f, l) for (i = f; i < l; i++) #define myforInv(i, N) for (i = N; i >= 0; i--) #define myforFLInv(...
true
5725ea98a443dd1ea4aa27e94851d05fd41434ac
C++
stef52/Game-Dev-Class
/Physics for Students - VS12 LEAN/Game/Source/frameBuffers.cpp
UTF-8
7,156
2.609375
3
[]
no_license
//*****************************************************************************************// // Includes // //*****************************************************************************************// #include "includes.all" //**********...
true
44f980761748cc26a70827ca7cb888313634f7c9
C++
nicknick1945/melonoma
/semion/SLib/Processing/sgaussfilter.h
UTF-8
3,307
3.21875
3
[]
no_license
#ifndef SGAUSSFILTER_H #define SGAUSSFILTER_H #include "../Core/smatrix.h" #include "../Processing/sprocessing.h" /*! * \ingroup Processing * \brief Размеры Фильтра. */ enum SIZE { THREE, FIVE }; /*! * \ingroup Processing * \brief Класс для фильтра Гаусса. * \details Вид усредняющего фильтра, в котором...
true
1e5a715ba4595a80034553d727c13837713f095e
C++
Xu-Sir/Project2
/Project2/test.cpp
GB18030
3,224
2.625
3
[]
no_license
#include <iostream> #include <string> //#include "myArrays.cpp" //#include "conntect.cpp" #include <fstream> #include <Windows.h> using namespace std; class Person12 { public : int age; string name; int id; }; HMODULE hm = LoadLibrary(L"F:\\dll̬ӿ\\Dll1\\Debug\\Dll1.dll"); typedef int (*_Hello)(int a, int b); t...
true
151a741db1c9167175a523b7355e32a02041a091
C++
raebex/twitter-roboplush
/roboplush-twitter-arduino/roboplush-twitter-arduino.ino
UTF-8
3,403
2.828125
3
[]
no_license
#include <Servo.h> //servos Servo myservo; Servo myservoTwo; int pos1 = 0; int pos2 = 30; long interval = 15; int t = 0; //iterator for servo delay int motorSteps = 0; //capture incoming serial data from node server char incomingByte = 0; //matrix int outTop = 13; int outBottom = 12; int in1 = 11; int in2 = 10; int ...
true
1650ad70de55692ed47ba5b07ab12a1202d9fe21
C++
hohaidang/CPP_Basic2Advance
/Learning/WriteTxt/Source.cpp
UTF-8
450
2.59375
3
[]
no_license
#include <iostream> #include <fstream> #include <time.h> #include <random> #include <sstream> #include <string> #include <iomanip> using namespace std; int main() { random_device rd; mt19937 gen(rd()); uniform_real_distribution<> distribution(1000000000, 2000000000); ofstream myFile; myFile.open("LargeData.txt")...
true
8daf8b20bf76febd898dafd99f5fcf52a3ac9197
C++
csellsword/Asteroids
/WinMgr.cpp
UTF-8
563
2.53125
3
[]
no_license
#include <cstdio> #include <cstdlib> #include <GL/glfw.h> #include "WinMgr.h" //default constructor //creates asteroid window WinMgr::WinMgr(){ //start glfw if(!glfwInit()){ fprintf(stderr,"Call to glfwInit() failed\n"); exit(-1); } //creates default glfw window if(!glfwOpenWindow(0,0,0,0,0,0,0,0,GLFW_WINDO...
true
579ef66febad95d7d5c66519dcd71be18c13cd6f
C++
LucasVB-TheyCallMeAPoro/Graphics-Programming
/RayTracer/PerspectiveCamera.cpp
UTF-8
1,752
2.890625
3
[]
no_license
#include "pch.h" #include "PerspectiveCamera.h" #include "Ray.h" #include <cmath> using namespace Elite; PerspectiveCamera::PerspectiveCamera() :m_Position{ 0,0,0 } , m_FOV{ 0 } , m_AspectRatio{ 0 } , m_WorldUp{ 0,1,0 } , m_Pitch{ 0.f } , m_Yaw{ 0.f } { } PerspectiveCamera::PerspectiveCamera(const Elite::FPoint3&...
true
e86c7fa0b9c7d1262046348c846fa369a42c46a6
C++
zrss/LeetCode
/Subsets.cpp
UTF-8
993
3.359375
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; class Solution { public: vector<vector<int>> subsets(vector<int>& nums) { sort(nums.begin(), nums.end()); vector<vector<int>> rel; rel.push_back(vector<int>()); vector<int> tmp; aux(rel, tmp, num...
true
2a3fc4a02c76e158ed37d9b49807ff0b94c00141
C++
csy-59/C-Study
/7~9/9-2.cpp
UTF-8
470
3.125
3
[]
no_license
#include <iostream> #include "Fan.h" using namespace std; int main() { Fan f1, f2; f1.setSpeed(3); f1.setOn(true); f1.setRadius(10); f2.setSpeed(2); f2.setOn(false); f2.setRadius(5); cout << "f1 is..." << endl; cout << "Speed: " << f1.getSpeed() << " On: " << f1.getOn() << " Radius: " << f1.getRadius() << ...
true
12330fae7e671c549e92624e82c4fadb976b8062
C++
eigenbom/SDS
/SDSMath/src/basis.cpp
UTF-8
23,219
2.75
3
[]
no_license
#include "basis.h" #include "hmath.h" #include <iostream> using namespace Math; using std::string; // Basis std::vector<Parameter> Basis::mParameters; bool Basis::mInit = false; Basis::Basis() :pContrast(1),pXScale(1),pYScale(1),pZScale(1) { if (!mInit) { mParameters.push_back(Parameter("cont...
true
d40091704808ec74a1d2cf001bf6bf11c1ceb8ca
C++
eschipellite/GamePhysics
/GamePhysics_EvanSchipellite_ForceGame/GamePhysics_EvanSchipellite/Contact.h
UTF-8
1,121
2.796875
3
[]
no_license
//============================================================================= // Contact // // Written by Evan Schipellite // // Stores and resolves collisions //============================================================================= #ifndef CONTACT_H #define CONTACT_H //========...
true
f65381bc0e153a8d485be36159a63339a69f7bfa
C++
pickjd1/BITCourseWork-Year3
/3rd Year IN613 C++ Programming/Practicals7-12/JoelPickworthWeek09ScrollingTileMap/pickjd1TileMapLab/TileMap.cpp
UTF-8
1,369
3.046875
3
[]
no_license
#include "StdAfx.h" #include "TileMap.h" using namespace System::IO; //tile map constructor TileMap::TileMap(TileList^ startTileList, Graphics^ startCanvas) { tileList = startTileList; canvas = startCanvas; map = gcnew array<int,2>(COLS,ROWS); } //set the values of the map grid void TileMap::setMapValue(int col, ...
true
6d7385d0a40c1c406e38783a41eee2fb3abd9d72
C++
DaDaMrX/ACM
/Code/General/CodeForces Gym100971K Palindromization (字符串).cpp
UTF-8
937
3.140625
3
[]
no_license
// CodeForces Gym100971K Palindromization (字符串) #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long ll; const int INF = 0x3f3f3f3f; const int N = 2e5 + 10; char s[N], t[N]; void del(char s[], int t) { int len = strlen(s); for (int i = t; i < len - 1; i++) s[i] = s[i + 1]...
true
8de243984d2fcfc00c4543f4483bb6e4b17fb370
C++
MarioStoev99/Data-Structures-and-Algorithms-2019-2020
/Homeworks/HW3/FindProteins.cpp
UTF-8
2,711
2.734375
3
[]
no_license
#include "FindProteins.h" const int FindProteins::notExistInSequence = -1; const int FindProteins::notExistInFile = -2; void FindProteins::inputLogic(string& filenameSequence,string& filenameCodonToAminoacids) { getline(cin, filenameSequence); getline(cin, proteinsFilename); getline(cin, filenameCodonToAminoacids); ...
true
2eb720567eb1c0dd633806f7570391204b09fa4f
C++
cekaem/chess
/PgnCreator.h
UTF-8
534
2.6875
3
[]
no_license
#ifndef PGN_CREATOR_H #define PGN_CREATOR_H #include <ostream> #include <sstream> #include "Board.h" class PgnCreator : public BoardDrawer { public: PgnCreator(std::ostream& ostr) : ostr_(ostr) {} void onFigureAdded(Figure::Type type, Figure::Color color, Field field) override {} void onFigureRemoved(Field f...
true
14bc3f4e259662503448bf0282f89d1157d369cf
C++
StefanRRachkov/SVG-Library
/source/CommandTypes/Erase.cpp
UTF-8
694
2.90625
3
[]
no_license
// // Created by User on 3.6.2019 г.. // #include "../../headers/SVG_CommandTypes/Erase.h" #include <iostream> void Erase::Execute(const std::string& elementIndex) { auto index = new unsigned int; *index = std::stoi(elementIndex); if(*index > this -> figureContainer -> GetFigures().size()) { t...
true
f21fd301b1275eb3a9e692b83b86aaba70bc2abb
C++
brorica/Algorithm
/USACO/5919.cpp
UTF-8
417
2.546875
3
[]
no_license
#include <iostream> #include <algorithm> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int hay[10001] = { 0, }; int T, sum = 0, average, ans = 0; cin >> T; for (int i = 0; i < T; i++) { cin >> hay[i]; sum += hay[i]; } average = sum / T; for (int i = 0;...
true
87288ce1d4b6fcd546c85a96add68c2bfe212e4d
C++
shashank0302/phonebook-management-system
/Contact.cpp
UTF-8
3,810
3.03125
3
[]
no_license
#include<bits/stdc++.h> #include<fstream> #include "Contact.h" #include "ContactDB.h" using namespace std; ContactDB b; void Contact::AddRecord() { ofstream fout; fout.open("PhonBook.txt",ios::out|ios::binary|ios::app); b.storeData(); fout.write((char*)&b,sizeof(b)); fout.close(); ...
true
f919bfd895734a9f8933bbd74e9a96d0d96d92a2
C++
saiteja1111n/c-learning
/overloadfunctions.cpp
UTF-8
468
3.703125
4
[]
no_license
#include<iostream> #include<sstream> using namespace std; int mult(int a,int b) { return a*b; } double mult(double a1,double b1) { return a1*b1; } int main() { int a,b; double a1,b1; cout<<"Give the values of a and b"<<endl; cin>>a; cin>>b; cout<<"\nGive the values of a1 and b1"<<endl; cin>>a1; cin>>b1; ...
true
aca85c9457b6d562dd2fe48907da4bf53a89e067
C++
QtLab/PUBG-No-Recoil
/hax.cpp
UTF-8
1,009
2.796875
3
[]
no_license
#include "stdafx.h" #include "windows.h" #include <iostream> bool LeftMouseDown = true; int leftMouseVKCode = 1; int RecoilState = 3; void __stdcall RemoveRecoil() { HWND foregroundWin; leftMouseVKCode = 1; while (1) { foregroundWin = GetForegroundWindow(); if (foregroundWin == FindWindowA("UnrealWindow", 0)...
true
0730e463d0e589581a59ddabee78929b12bf8a77
C++
MAU143429/LetsPlay-Server-CE-2103
/Lets Play Server/src/BPGAME/BP_Controller.cpp
UTF-8
458
2.640625
3
[]
no_license
#include "BP_Controller.h" BP_Controller* BP_Controller::unique_instance{ nullptr }; mutex BP_Controller::mutex_; BP_Controller::BP_Controller() { } BP_Controller::~BP_Controller() {} /** * @brief Getter for the static class instance * @return the static instance */ BP_Controller* BP_Controller::getInstance() { l...
true
2547439b1056ed454f8a9a6f4fcd6c0826ebb584
C++
hykruntoahead/AndroidNdkStudy
/21DaysLearnCPlus/chapter14/14.4.cpp
UTF-8
1,004
3.96875
4
[]
no_license
// 包含两个成员属性的模板类 #include <iostream> using namespace std; template <typename T1 = int, typename T2=double> class HoldsPair { private: T1 value1; T2 value2; public: HoldsPair(const T1& val1,const T2& val2) : value1(val1),value2(val2){} // Accessor functions const T1 & GetFirstValue (...
true
08addc929d8b772ddd4a319478ff2cc39dbad588
C++
yanyanlili2020/LeetCola0714
/src/array/1385.cpp
UTF-8
1,419
3.28125
3
[]
no_license
class Solution12 { public: int findTheDistanceValue(vector<int>& arr1, vector<int>& arr2, int d) { sort(arr2.begin(), arr2.end()); int cnt = 0; for (auto &x: arr1) { unsigned p = lower_bound(arr2.begin(), arr2.end(), x) - arr2.begin(); bool ok = true; ...
true
ab9a59751a4a9831b3f9c664a964cfdec7e58919
C++
Faizan-Ali-code/C-programming-code
/saurab dev c/displayLinkedListSumCountAverage.cpp
UTF-8
2,588
3.875
4
[]
no_license
#include<iostream> #include<conio.h> using namespace std; class doubly_link{ private: struct node{ node* pre; int data; node* next; }; node* head = NULL; node* tail = NULL; public: void insert(int n); void display(); void display_reverse(); void sum_count_avg(); ...
true
039127c29c22f9b386aec40d9616a0e3bed79589
C++
espio/Mypaint
/menu_item.cpp
UTF-8
2,958
2.609375
3
[]
no_license
#include "menu_item.h" #include "callback.h" #include "paper.h" #include <list> #include <iostream> Menu_item::Menu_item(void) { this->__etat = false; this->__click = false; this->__size_child = 0; } Menu_item::~Menu_item(void) { std::list<Control*>::iterator it; it = this->__tmp_child.begin(); while (this->__...
true
60ab02915ac45a005592e3bf90b3bec76e2c278f
C++
MadinaZ/pro
/DvcScheduleSearchBST-3.cpp
UTF-8
2,763
3.140625
3
[]
no_license
#include <iostream> #include <fstream> #include <string> #include<algorithm> #include<set> #include <cstring> using namespace std; #include "BinarySearchTree.h" string searchSemester(int); int main() { cout<<"Programmer: Madina Sadirmekova \n"; cout<<"Programmer's ID: 1736270 \n"; cout<<"file: "<<__FILE_...
true
ae917879a8e70872685f2ba3e8527c4754cbb996
C++
yamikumo-DSD/my_game_project_unified
/source/vm/frame.cpp
UTF-8
2,029
2.796875
3
[]
no_license
//frame.cpp #include "frame.h" #include "exception_def.h" #include <iostream> #include "bit_calculation.h" #include <iterator> #include "express_debug.h" #include "debug.h" MyVM::Frame::Frame ( std::size_t _stack_size, std::size_t _maximum_local_variables_num ) :operand_stack(_stack_size + 1), local_variables(_ma...
true
4e20665fb678f5f5764fe328afd9bdf79fc98ea0
C++
neivv/teippi
/src/list.h
UTF-8
7,545
3.015625
3
[ "MIT" ]
permissive
#ifndef LIST_H #define LIST_H #include <stdint.h> #include <cstddef> #include "console/assert.h" template <typename T, typename M> M get_member_type(M T::*); template <typename T, typename M> T get_class_type(M T::*); template <class C, unsigned offset, bool reverse> class ListIterator { public: ListIter...
true
d2863674d54c23ef6f27a14f9f220a17b426eb50
C++
Muzain187/level3
/BST/constructLLfromTree.cpp
UTF-8
628
2.828125
3
[]
no_license
Node<int>* constructLinkedList(BinaryTreeNode<int>* root) { // Write your code here // return constructList(root)->head; if(root == NULL) return NULL; Node<int>* leftNode = constructLinkedList(root->left); Node<int>* rightNode = constructLinkedList(root->right); Node<int>* rootNode =...
true
eb46186f9ccb712e1a08c8112db998551728a437
C++
huanghl365/StudyNote_201308
/cpp/04_cpp_father_derive/4_8_constructor.cpp
UTF-8
451
3.453125
3
[ "MIT" ]
permissive
//派生类的构造函数与析构函数的执行顺序 #include <iostream> using std::cin; using std::cout; using std::endl; class Base{ public: Base(){ cout<<"Construction base class.\n";//1 } ~Base(){ cout<<"Destruction base class.\n";//4 } }; class Derive:public Base{ public: Derive(){ cout<<"Construction derived class.\n";//2 } ~Der...
true
c7152197e0e290de59c63646d62b00f6d0ad81cc
C++
thirtiseven/CF
/#505/C.cc
UTF-8
692
2.828125
3
[]
no_license
#include <iostream> #include <string> std::string s; int main(int argc, char *argv[]) { std::cin >> s; int ans = 0; int now = 1; int len = s.length(); for (int i = 1; i < len; i++) { if (s[i] != s[i-1]) { now++; } else { ans = std::max(now, ans); now = 1; } } ans = std::max(now, ans); now = 0...
true
09a583a6dec7c0a9dd5c3450377ccbf912df8893
C++
wangkaichao/wkc01
/project/demo/DemoThread.cpp
UTF-8
3,030
2.859375
3
[]
no_license
#if 0 #include <thread> #include <chrono> #include <iostream> #include <stdio.h> #include <unistd.h> int main() { std::thread t1([] { printf("thread1 start. id:%#x\n", std::this_thread::get_id()); std::this_thread::sleep_for(std::chrono::milliseconds(2000)); printf("thread1 start. id:%#x ~~~...
true
aa1de0b0d1751d6f435ae836f0338611ccf30b25
C++
waynebhayes/SANA
/wrappedAlgorithms/HGRAAL/src/LEDA/geo/segment_set.h
UTF-8
6,510
2.6875
3
[]
no_license
/******************************************************************************* + + LEDA 6.3 + + + segment_set.h + + + Copyright (c) 1995-2010 + by Algorithmic Solutions Software GmbH + All rights reserved. + *******************************************************************************/ #ifndef LEDA_SEGMEN...
true
0e5460dbfd7c362122b04cc61eaa33a3938af757
C++
andasilva/IceBroadcast
/audio/vumeter.cpp
UTF-8
849
2.65625
3
[]
no_license
#include "vumeter.h" VuMeter::VuMeter(QWidget *parent) : QWidget(parent) { setBackgroundRole(QPalette::Base); setAutoFillBackground(false); m_level = 0; setMinimumHeight(30); setMinimumWidth(200); } void VuMeter::paintEvent(QPaintEvent* event) { Q_UNUSED(event); QPainter painter(this); ...
true
03ff927edf91105a9d20cf306f5c6c5221aaab6e
C++
FrameSoftware/OPTIC_LASER
/interaddmont.cpp
UTF-8
2,818
2.65625
3
[]
no_license
#include "interaddmont.h" #include "ui_interaddmont.h" #include "fournisseurmanager.h" #include "articlemanager.h" #include <QMessageBox> #include "monture.h" InterAddMont::InterAddMont(QWidget *parent) : QWidget(parent), ui(new Ui::InterAddMont) { FournisseurManager::getFournisseurList(); // reinitialisat...
true
ee109d40e76beb1bbe619a0a216a3baf5e62b19c
C++
kofed/centers
/contour.cpp
UTF-8
3,071
2.953125
3
[]
no_license
#include "contour.h" #include <stdlib.h> #include "opencv2/opencv.hpp" #include "contour3d.h" #include "log.h" #include <stdlib.h> Contour::Contour(vector<CPoint> & _points):points(_points){ init(); } void Contour::init(){ if(points.size() < 5){ throw runtime_error("создание контура с колличеством точек < 5"); }...
true
aa5e16de049569349bba644a9d4d2047bbf77b7d
C++
ABucciarelli-CR/GameDev-1anno-2016-2017
/Esercitazione_24_11_16/es4/main.cpp
ISO-8859-13
2,606
3.25
3
[]
no_license
#include <iostream> #include <stdlib.h> #include <string> void exploration(); void defense(); void escort(); int ammo=50; int fuel=100; int supply=100; int main() { std::string choise; do { ////////////inizio gioco std::cout << "Hai a disposizione "<< ammo << " munizioni, " << fu...
true
6250aa787cabae94f9115ac3dc41d2950244e1e0
C++
blackenwhite/Competitive-Coding
/icecream_parlour.cpp
UTF-8
1,138
2.953125
3
[]
no_license
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int binarySearch(vector<int> cost,int beg,int end,int val) { while(beg<=end) { int mid=(beg+end)/2; if(cost[mid]==val) { cout<<"\nFound Val "<<cost[mid]<<"\t...
true
382598fc6ea03fe30c23b2bf086b42d68451b3eb
C++
GZHU-JourneyWest/West-Footprint
/Contests/2017 SCUT校赛/k.fail.cpp
UTF-8
1,706
2.71875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; using pi = pair<int, int>; // 成也暴力,败也暴力 // 裸折半失败 // 思路过于复杂, // 学习对分数的处理 // 学习分治的思路 const int maxN = 40; int gcd(int x, int y) { return y==0 ? x : gcd(y, x%y); } int a[maxN], b[maxN]; vector<pi> lft, rght; void reduce(pi &p) { int g = gcd(p.first, p.second); if (g ...
true
66ffb812fd123aad740ec39a0e7a3f8177e6c135
C++
vidma/snowman-game-3d
/prog3d/Tuple2d.cpp
UTF-8
2,711
3.171875
3
[]
no_license
#define EPSILON_PREC 0.000001 #include <math.h> #include <iostream> #include "Tuple2d.h" /*! * * @file * @brief Op\'erations sur les entit\'es de type (x,y) * * @author F. Aubert * */ using namespace prog3d; using namespace std; vector<float> Tuple2d::fc(2); void Tuple2d::cnew() { c.resize(2); this->set(0,0...
true
305d9be54bc42779a4eba67093bc515a0f7fa86c
C++
zoucuomiao/Algorithm_for_Interview-Chinese
/Algorithm_for_Interview/堆、栈、队列/队列_左旋转字符串.hpp
GB18030
1,578
3.65625
4
[]
no_license
/* תַ https://www.nowcoder.com/practice/12d959b108cb42b1ab72cef4d36af5ec?tpId=13&tqId=11196&tPage=3&rp=3&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking ĿԴָOffer Ŀ һλָѭƣROLи򵥵񣬾ַģָһַSѭKλ磬ַS=abcXYZdef,Ҫѭ3λĽXYZdefabcDzǺܼ򵥣OK㶨 ʱƣ1 ռƣ32768K ȶָ96578 ֪ʶ㣺 ַ ˼· û˫˶У һʮ str = "XYZdefabc"...
true
fa51bdc7585c67b207ae0d5d07f5e9486c8861f2
C++
SuperChenSSS/Lanqiao
/算法提高/ADV-12 算法提高 计算时间.cpp
UTF-8
756
3.21875
3
[]
no_license
算法提高 计算时间 问题描述   给定一个t,将t秒转化为HH:MM:SS的形式,表示HH小时MM分钟SS秒。HH,MM,SS均是两位数,如果小于10用0补到两位。 输入格式   第一行一个数T(1<=T<=100,000),表示数据组数。后面每组数据读入一个数t,0<=t<24*60*60。 输出格式   每组数据一行,HH:MM:SS。 样例输入 2 0 86399 样例输出 00:00:00 23:59:59 #include <iostream> #include <cstdio> using namespace std; int main() { int n; cin >> n; for(int ...
true
53b3a781cc20321ff6c747f8fe3c07eb78cece67
C++
NavadeepGaneshU/Arduino_Dev
/Capacitive_Soli_Moist_Sensor.ino
UTF-8
1,184
2.921875
3
[]
no_license
/* Find soil moisture level using generic capacitive moisture sensor (3 Pins) https://www.clevertronics.blogspot.com Used Hardware : ESP32 by ESPRESSIF SYSTEMS Used IDE : Arduino IDE 1.8.12 */ const int AirValue = 0; //Replace this value with ADC value when probe is in air(Val_1). const int WaterValue = 3100...
true
ed9f30ae9b7cf7820e29903dd6f1916b2623d6e4
C++
Kose-i/Euclear_Project
/clear_box/Problem037.cpp
UTF-8
1,584
2.953125
3
[]
no_license
#include <iostream> #include <vector> #include <map> #include <queue> using namespace std; int main() { constexpr int n {1000000}; vector<char> is_prime(n+1, 1); is_prime[0] = is_prime[1] = 0; for (int i=0;i<=n;++i) { if (is_prime[i] == 0) continue; for (int j=i+i;j<=n;j+=i) is_prime[...
true
0e18319cade9465a9de21f23dabe936a777926af
C++
JackYifan/Learning-Code
/1090.cpp
UTF-8
1,020
2.859375
3
[]
no_license
#include<cstdio> #include<vector> #include<cmath> using namespace std; const int maxn=100010; //用数组记录i的子结点 vector<int> child[maxn]; int n; double p,r; int maxdepth=0; int num=0; //全局变量+递归,当最大深度时返回就会递归完毕 //结点和结点的深度 void DFS(int root,int depth) { //如果是叶结点 if(child[root].size()==0) { if(depth>maxdepth...
true
7cef62b9855548a785d0dd823a201f6e3b91204f
C++
Telefragged/rndlevelsource
/rndlevelsource Unit Tests/WeightedVectorTests.cpp
UTF-8
1,317
2.921875
3
[ "MIT" ]
permissive
#include "stdafx.h" #include "CppUnitTest.h" #include "WeightedVector.h" using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace rndlevelsourceUnitTests { TEST_CLASS(WeightedVectorTest) { public: TEST_METHOD(TestWeightedVectorPushBack) { WeightedVector<size_t> vector; vector.push_back(1...
true
5f5883e1572a127c396b29c961274eddcee175e4
C++
nodamushi/nsvd-reader
/include/nodamushi/svd/value/void_value.hpp
UTF-8
1,209
2.546875
3
[ "CC0-1.0" ]
permissive
/*! @brief value&lt;void&gt; @file nodamushi/svd/value/void_value.hpp */ /* * These codes are licensed under CC0. * http://creativecommons.org/publicdomain/zero/1.0/ */ #ifndef NODAMUSHI_SVD_VALUE_VOID_VALUE_HPP #define NODAMUSHI_SVD_VALUE_VOID_VALUE_HPP # include "nodamushi/svd/value.hpp" namespace nodamushi{...
true