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
536270d345197f5f66b9b93a37c4121edb0a2d2c
C++
Marneus68/WorkingTitle
/src/Resource.cpp
UTF-8
1,137
2.9375
3
[]
no_license
#include "Resource.h" #include <ostream> #include "ResourceType.h" namespace wot { Resource::Resource() { resourceType = ResourceType::NONE; rawPath = ""; name = ""; description = ""; loaded = false; } Resource::Resource(const Resource & resource){ reso...
true
ad79ff9a63e37a524e9db98c4a320c785abca636
C++
MehrajShakil/Solving-problem-in-different-OJ
/Leetcode/Graph/Flood fill/733. Flood Fill.cpp
UTF-8
949
2.859375
3
[]
no_license
class Solution { void dfs ( vector<vector<int>>& image , int row , int col , int x , int y ,int source , int newColor ){ if ( x<0 or x>=row or y<0 or y>=col or image[x][y]!=source ) return; image[x][y] = newColor; dfs ( image , row , col , x+1 , y , source , newColor )...
true
b068ce4fa58b85981dc4e00009e219affa0f0c59
C++
sunn1t/shortest-superstring
/src/graph.h
UTF-8
586
3.015625
3
[]
no_license
#ifndef GRAPH_H #define GRAPH_H #include <cstddef> struct Path { public: size_t *v_sequence; size_t n; }; class Graph { public: Graph(size_t n_vertex); Graph(const Graph &old); Graph &operator = (const Graph &old); void AddEdge(size_t from, size_t to, size_t length); size_t ** GetMatri...
true
5c89119f38cc7f6c79ecb06663f13ef41627b031
C++
luismoax/Competitive-Programming---luismo
/COJ_ACCEPTED/3141 - Fountain.cpp
UTF-8
3,371
2.90625
3
[]
no_license
/* Author: Luis Manuel D?az Bar?n (LUISMO) Problem: Fountain Online Judge: COJ Idea: Solved using a custom Segment Tree, nice one */ #include<bits/stdc++.h> // Types #define ll long long #define ull unsigned long long // IO #define sf scanf #define pf printf using namespace std; const int lim = 1e5 + ...
true
e93fff6fab9299d4ff21bacdca3f8f88da588b01
C++
Rodousse/Arverne-Viewer
/src/renderer/src/camera/ArcBallCamera.cpp
UTF-8
2,039
2.9375
3
[]
no_license
#include "renderer/camera/ArcBallCamera.h" #include <glm/gtc/constants.hpp> #include <glm/gtc/matrix_transform.hpp> #include <algorithm> #include <math.h> namespace renderer { #ifndef M_PI const float M_PI = glm::pi<float>(); #endif ArcBallCamera::ArcBallCamera(): Camera(), radius_(2.0f), phi_(3.0f * M_...
true
4a3643195a07c123374e2f00811a33079ff08dc9
C++
Retnirps/ITMO
/C++/HW2class/Report.cpp
UTF-8
1,603
3.53125
4
[ "MIT" ]
permissive
#include <iostream> #include <iomanip> #include "Report.h" Report::Report() { setZero(); mName = ""; } Report::Report(const std::string name) : mName(name) { setZero(); } void Report::setZero() { mAverage = 0; mAdmissionNumber = 0; for(int i = 0; i < MARKS_AMOUNT; ++i) { mMarks[i] = 0; } } void Report...
true
d72b32c88cf181bbc41d51c179ce70f36a0b2e12
C++
effekseer/EffekseerForCocos2d-x
/Players/Cocos2d-x_v4/3rdParty/LLGI/src/Vulkan/LLGI.SingleFrameMemoryPoolVulkan.cpp
UTF-8
3,065
2.65625
3
[ "MIT" ]
permissive
#include "LLGI.SingleFrameMemoryPoolVulkan.h" #include "LLGI.BufferVulkan.h" namespace LLGI { InternalSingleFrameMemoryPoolVulkan::InternalSingleFrameMemoryPoolVulkan() {} InternalSingleFrameMemoryPoolVulkan ::~InternalSingleFrameMemoryPoolVulkan() {} bool InternalSingleFrameMemoryPoolVulkan::Initialize(GraphicsVul...
true
adda0f1382d225c43ace39a0ac332e46ddb3e6d4
C++
PhoenixGS/Test
/Test000006.cpp
UTF-8
905
2.734375
3
[]
no_license
#include <cstdio> #include <algorithm> using namespace std; int x[40000]; int F1[40000][4]; int F2[40000][4]; int calc(int x, int y) { if (x == y) { return 0; } return 1; } int main() { int n; scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d", &x[i]); } for (int i = 1; i <= n; i++) { F1[i...
true
5f70a4507a3c233413ffb35d18f7ce56a926c959
C++
icelinker/structured-light
/OpenFrameworks/apps/earlyDemos/slCapture/ThreadedImageSaver.h
UTF-8
1,412
3.015625
3
[]
no_license
#pragma once #include "ofxThread.h" #include "GlobalLogger.h" #include <queue> struct SaveableImage { ofImage img; ofImage temp; string filename; void saveImage() { img.saveImage(filename); } void rotate() { int w = (int) img.getWidth(); int h = (int) img.getHeight(); temp.allocate(h, w,...
true
4b4244e369245f29415fd1536a789bc22802c709
C++
mengkaibulusili/leetcode
/cpp/0010-regular-expression-matching.cpp
UTF-8
1,286
3.484375
3
[]
no_license
#include <iostream> #include <string> #include <vector> using namespace std; class Solution { public: bool isMatch(string s, string p) { int m = s.size(); int n = p.size(); auto matches = [&](int i, int j) { if (i == 0) { return false; } if (p[j - 1] == '.') { ...
true
ca7281b2ec6094373e8a6415e5c9bd7b0eb540ed
C++
sgumhold/cgv
/plugins/examples/visibility_sorting.cpp
UTF-8
4,024
2.5625
3
[]
permissive
#include <random> #include <cgv/base/node.h> #include <cgv/gui/provider.h> #include <cgv/render/drawable.h> #include <cgv_gl/sphere_render_data.h> #include <cgv_gpgpu/visibility_sort.h> class visibility_sorting : public cgv::base::node, public cgv::render::drawable, public cgv::gui::provider { protected: cgv::render...
true
ac2602429c63fb3b451fcf8c0aa9b1a4d004a605
C++
CodeWithKartik/Mafia
/Detective.cpp
UTF-8
538
2.796875
3
[]
no_license
#include "Detective.h" #include <iostream> Detective::Detective(int ID, std::string nm):Player(ID, nm, DETECTIVE) { } std::string Detective::SuspectWho() { std::cout<<"Do you suspect someone?"; bool ch; std::string choice; std::string who = ""; std::cin>>choice; if (choice == "YES"...
true
23bea3a3aec231a7e77ba1ca85ad6fdb90753b33
C++
Stypox/olympiad-exercises
/olinfo/panama/main.cpp
UTF-8
2,736
2.6875
3
[]
no_license
#pragma GCC optimize ("O3") #include <bits/stdc++.h> using namespace std; #define int int64_t #define float long double ifstream in{"input.txt"}; ofstream out{"output.txt"}; #ifdef DEBUG template<class A,class B>ostream&operator<<(ostream&o,const pair<A,B>&p){cout<<"("<<p.first<<", "<<p.second<<")";return o;} templat...
true
3893c6dd2150d3a5af8611941c7cb7cb9084b9c2
C++
chilogen/workspace
/acm/oj/codeforce/problems/ac/876c.cpp
UTF-8
569
2.84375
3
[]
no_license
//because x no exceed 10^9,so the digtalsum //no exceed 9*9==81 //so calc the digtal sum j from max(0,x-81) to x //and add it to j,if equal to x,it is one of the anser #include <bits/stdc++.h> using namespace std; typedef long long LL; LL digtalsum(LL x) { LL sum=0; while(x) { sum+=x%10; x=x/10; } return sum;...
true
0c39f6d25948a5a099281b12ab8ab9275d0828ee
C++
xczhang07/leetcode
/cpp/middle/longest_substring_without_repeating_charactors.cpp
UTF-8
2,549
3.421875
3
[]
no_license
class Solution { public: int lengthOfLongestSubstring(string s) { if(s.size() <= 1) return s.size(); int maxLen = 0; int start = 0; unordered_map<char, int> distance; for(int i = 0; i < s.size(); ++i) { if(distance.find(s[i]) != distance.end() ...
true
54cb7117e8a1248ac2dc618e4a42ad24a8a78a40
C++
SV-Seeker/SeekerROV
/ROV4/CCommand.cpp
UTF-8
6,283
3.09375
3
[ "MIT" ]
permissive
#include "CCommand.h" // File local variables and methods namespace { char dataBuffer[COMMAND_DATA_BUFFER_SIZE + 1]; //Add 1 for NULL terminator byte dataBufferIndex = 0; boolean commandReady = false; const char endChar = ';'; // or '!', or whatever your end character is boolean storeString = false;...
true
b6dc54137a79e3e09ae92c460d0f0ae7a9db87e0
C++
WProduction/ProjectOszi
/ProjectOszi/src/Oszi/Window.h
UTF-8
972
2.703125
3
[ "Apache-2.0" ]
permissive
#pragma once #include <ozpch.h> #include "Oszi/Core.h" #include "Oszi/Events/Event.h" namespace Oszi { //Properties used to Create a Window struct WindowProps { std::string Title; unsigned int Width; unsigned int Hight; WindowProps(const std::string& title = "Oszi", unsigned int width = 1280, unsigned i...
true
cd90009e2f379c15b8726b45ae79d4cd904dd1bb
C++
ahmad307/Visual-DataStructures
/DataStructures/DataStructures/BST/BST.cpp
UTF-8
8,987
2.875
3
[]
no_license
#include "BST.h" template<class T> node<T>::node(T value, sf::Texture * nodeTexture, float radius) { this->value = value; left = right = nullptr; Circle.setTexture(nodeTexture); Circle.setRadius(radius); Circle.setFillColor(sf::Color(43, 62, 80)); Circle.setOutlineColor(sf::Color::Black); Circle.setOutlineThic...
true
9220e3608e72aa6931558f0cc4c201e8cecc8d7a
C++
yisonPylkita/lonesome
/logger.cpp
UTF-8
416
2.578125
3
[]
no_license
#include "logger.hpp" namespace Engine { namespace Logger { _Logger::_Logger(const std::string & file_name) { log_file.open(file_name.c_str()); } _Logger::~_Logger() { log_file.close(); } void _Logger::log(std::string log_message) ...
true
5b6718f86f591ea26402441418a55d3967bc5e1e
C++
bradley27783/Concurrent-Parallel-and-Distributed-Programming
/Portfolios/Parallel/Task3/t3.cpp
UTF-8
1,512
2.890625
3
[]
no_license
#include "omp.h" #include <iostream> #include <cmath> #include <cstdlib> #include <string> #include "stdio.h" #include <vector> #include <random> std::vector<std::vector<int>> matrix = {{5,14,10}, {7,-8,-14}, {-2,9,8}, ...
true
fe7706891c2edffad7c20a51df270833f6d01961
C++
chrinide/vowpal_wabbit
/library/library_example.cc
UTF-8
2,445
2.59375
3
[]
no_license
#include <stdio.h> #include "../vowpalwabbit/parser.h" #include "../vowpalwabbit/vw.h" inline feature vw_feature_from_string(VW::workspace& v, std::string fstr, unsigned long seed, float val) { auto foo = VW::hash_feature(v, fstr, seed); feature f = { val, foo}; return f; } int main(int argc, char *argv[]) { VW...
true
a2e748e0a22ceadbef78c041a186b901d5a0f27d
C++
root670/dance-pad
/Firmware/lib/firmware/src/Sensor.h
UTF-8
1,033
2.6875
3
[ "MIT" ]
permissive
#pragma once #include <Arduino.h> #include "Config.h" class Sensor { public: Sensor(uint8_t nPin); // Set the thresholds based on the most recent reading void calibrate(); // Read value from pin void readSensor(); // Update state of the sensor void update(); bool isPressed()const;...
true
5442477fffd58dd47e964900e78230237bfd0b88
C++
OfficialPouya/Safety_Suite_For_Electric_Longboard
/DEV Work/board_dev/board_battery_mimick/1way_remote.ino
UTF-8
1,793
2.5625
3
[]
no_license
#include <SPI.h> #include "RF24.h" #include <Arduino.h> #include <U8g2lib.h> #ifdef U8X8_HAVE_HW_SPI #include <SPI.h> #endif #ifdef U8X8_HAVE_HW_I2C #include <Wire.h> #endif RF24 myRadio (9, 10); byte addresses[][6] = {"0"}; unsigned long lastTransmission; // typedef struct package Package; // Package dataTransmit...
true
cc76da19d7ea2017b0e91d1e7568d7068a03dc50
C++
melshazly89/Algo_ToolBox
/week3_greedy_algorithms/6_maximum_salary/largest_number.cpp
UTF-8
938
3.296875
3
[]
no_license
#include <algorithm> #include <sstream> #include <iostream> #include <vector> #include <string> using std::vector; using std::string; string largest_number(vector<string> a) { int temp; std::vector<int> b; for (int i=0; i< a.size(); i++) { int num = atoi(a.at(i).c_str()); while(num) { ...
true
34cfd4ad227f7bd6017d0863fe081da89f78155a
C++
meister4ever/mi-biografia
/src/domain_AutorId.h
UTF-8
659
2.6875
3
[]
no_license
#ifndef DOMAIN_AUTORID_H_INCLUDED #define DOMAIN_AUTORID_H_INCLUDED #include "logica_Comparable.h" #include <iostream> class AutorId : public Comparacion { public: AutorId(const char* autor, int id); AutorId(); virtual ~AutorId(); virtual int comparar(Comparacion *c) const; ...
true
b4ddf232e40093ab827854eb8dabdf5fe1e94bab
C++
CdecPGL/PlanetaEngine
/PlanetaEngine/src/planeta/core/Matrix2_2.hpp
UTF-8
1,030
2.90625
3
[ "MIT" ]
permissive
#pragma once #include <array> #include "Vector2D.hpp" namespace plnt { namespace math { //2*2行列 template<typename T> struct Matrix2_2 { std::array<std::array<T, 2>, 2> lines; std::array<T, 2>& operator[](int l) { return lines[l]; } constexpr const std::array<T, 2>& operator[](int l)const { ...
true
3557a4a8b7603cefab71d19c13ccf00fb9cfee19
C++
liujun0603/option-hedge
/StrategyConstructible.h
UTF-8
1,364
3.09375
3
[]
no_license
// // // StrategyConstructible.h // // #ifndef STRATEGY_CONSTRUCTIBLE_H #define STRATEGY_CONSTRUCTIBLE_H #include <iostream> #include "StrategyFactory.h" #include <string> //for each Strategy class, we declare a global variable of StrategyHelper<kind of Strategy> // , which cr...
true
2ed902b9497eab66fa2449a49aaf4d5625aad4e2
C++
hosword/Study-Practice-Collection
/20150410SqHuiWen/SqHuiWen/Main.cpp
GB18030
755
2.90625
3
[]
no_license
#include "SqStack.h" #include "SqQueue.h" #include <string> #include <iostream> using namespace std; void HuiWen() { char str[MAXQSIZE]; cin >> str; SqStack S1; InitStack(S1); SqQueue S2; InitQueue(S2); SElemType e1; QElemType e2; int len = strlen(str),i=0,temp1,temp2; for (i = 0; i < len; i++){ Push(S1, st...
true
483ae802f5434d4e81f2b50e66367ae654d5c7c9
C++
Rillell/1_Grade_Project
/c언어/C언어 2학기/실습/0903/0903/0903-1.cpp
UHC
212
2.828125
3
[]
no_license
#include<stdio.h> void main() { int num; printf(" : "); scanf("%d", &num); if (num % 2 == 0) { printf(" ¦Դϴ.\n"); } else { printf(" ȦԴϴ.\n"); } }
true
abffb033f0ca2c8fc152639033bfbc6d090e6531
C++
Rostik18/Homework-University
/FirstSecondYear/Cplusplus/1 семестр/B_10/B_10/B10.cpp
UTF-8
503
2.828125
3
[]
no_license
// B10.cpp: определяет точку входа для консольного приложения. // #include "stdafx.h" #include <iostream> #include <math.h>> using namespace std; int main() { int q = 1; do { double n, S = 0; do { cout << "Enter n : "; cin >> n; } while (n < 1); int m = n; for (int i = 0; i < n; i++) { ...
true
bdbbb9df2d711fddd28c779f54896c0fcea550df
C++
benreid24/BLIB
/include/BLIB/Util/Signal.hpp
UTF-8
2,923
3.234375
3
[]
no_license
#ifndef BLIB_UTIL_SIGNAL_HPP #define BLIB_UTIL_SIGNAL_HPP #include <BLIB/Util/NonCopyable.hpp> #include <functional> #include <optional> #include <variant> #include <vector> namespace bl { namespace util { /** * @brief Utility class perform callback actions on events. Can be configured to perform * multiple callbac...
true
f6909fb60557d290154f548cf7c41296350ae0af
C++
czipobence/dp-gyakorlat
/1Gyak/10.cpp
UTF-8
169
2.953125
3
[]
no_license
//take the first H element of the list list take(const list L, const int H) { if (L == nil) return L; if (H == 0) return nil; return cons(hd(L), take(tl(L), H-1)); }
true
f81b53c4b1adb715fd3b22e3a7889dcbcfb4de13
C++
eduhirt/CG
/t1/SCV 4.2.2 CodeBlocks/SCV/src/ComponentSpring.cpp
UTF-8
1,778
2.734375
3
[ "BSD-2-Clause" ]
permissive
#include "SCV/stdafx.h" #include "SCV/ComponentSpring.h" namespace scv { ComponentSpring::ComponentSpring(Component *component, int min, int pref, int max) : Spring() { _component = component; _min = min; _pref = pref; _max = max; } int ComponentSpring::calculateMinimumSize(Axis axis) { if (!isVisibl...
true
f770b033b4b1f786aa03d174f43208f041bd8849
C++
lww296/Kernel
/include/IDBHelper.h
UTF-8
3,359
2.5625
3
[ "Apache-2.0" ]
permissive
#ifndef __I_DB_HELPER_H__ #define __I_DB_HELPER_H__ #include "Types.h" enum DbHelperStatus { HELPER_STATUS_NULL, // 无效状态 HELPER_STATUS_INIT, // 初始化 HELPER_STATUS_CONNECTING, // 正在连接 HELPER_STATUS_CONNECTED, // 已连接 HELPER_STATUS_FREE, // 空闲(可使用) HELPER_STATUS_IDLE, // 忙 HELPER_STAUTS_STOP, // 停止 ...
true
a510e58fa63b7f802c91a92e88794587a2a89b87
C++
almost7/Csharp
/C#/repos/Classe Conta/Classe Conta/Conta.cpp
UTF-8
1,320
3.5
4
[]
no_license
#include "Conta.h" Conta::Conta() { Titular = "sem nome"; Numero = 0; Saldo = 0; Estado = -1; } Conta::Conta(string t, int n) { Titular = t; Numero = n; Saldo = 0; Estado = 1; } Conta::Conta(const Conta &c) { Titular = c.Titular; Numero = c.Numero; Saldo = c.Saldo; Estado = c.Estado; } void Conta::setTi...
true
48ac6fed39e693b682a38e273e27e734426d5b64
C++
mzlogin/LeetCode
/algorithms/cpp/sumOfTwoIntegers/solution.h
UTF-8
848
3.75
4
[ "MIT" ]
permissive
/** * Source : https://leetcode.com/problems/sum-of-two-integers/ * Author : Zhuang Ma * Email : chumpma(at)gmail.com * Date : 2016-11-02 * */ /** * Problem: * Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. * * Example: * Given a = 1 and b = 2, return 3. ...
true
b0ae7eb21272ad708d595a4eaa50d257e5e997f0
C++
pelcointegrations/VxSdk.NET
/VxSdkNet/Include/AnalyticConfig.h
UTF-8
4,366
2.8125
3
[]
no_license
// Declares the analytic config class. #ifndef AnalyticConfig_h__ #define AnalyticConfig_h__ #include "VxSdk.h" #include "Resolution.h" #include "Utils.h" namespace VxSdkNet { ref class AnalyticBehavior; ref class NewAnalyticBehavior; /// <summary> /// The AnalyticConfig class represents a specific a...
true
2d7de5c03ba6ff7f51a5b81165f715db4cf00c47
C++
shihchinw/baktsiu
/src/view.cpp
UTF-8
5,367
2.96875
3
[ "MIT" ]
permissive
#include "view.h" namespace baktsiu { Vec2f View::getViewportCoords(const Vec2f& imgCoords) const { Vec2f imageOffset = getImageOffset(); return glm::clamp(imgCoords * mImageScale + imageOffset, Vec2f(0.0f), mViewSize); } Vec2f View::getImageCoords(const Vec2f& viewCoords, bool* isClamped) const { Ve...
true
638c2d30fed741a8e8960dc2e33ac0935f80b5bd
C++
menglecho/Kattis
/bijele.cpp
UTF-8
255
2.90625
3
[]
no_license
#include <cstdio> #include <iostream> using namespace std; int main(void){ int arr[6], cor[6] = {1,1,2,2,2,8}; for(int i = 0; i < 6; i++){ cin >> arr[i]; cout << cor[i] - arr[i] << " "; } cout << endl; return 0; }
true
91d76c113c585306e20bb4d14a74f52366b0a2d5
C++
gabriellerosa/Codigos-Maratona
/atCoder/beginner170/a/a.cpp
UTF-8
379
2.75
3
[]
no_license
#include <iostream> using namespace std; int main(){ int x1, x2, x3, x4, x5; cin >> x1 >> x2 >> x3 >> x4 >> x5; if(x1 == 0){ cout << "1\n"; } if(x2 == 0){ cout << "2\n"; } if(x3 == 0){ cout << "3\n"; } if(x4 == 0){ cout << "4\n"; } ...
true
1fdb33a5a18f9b3bd05b34e16bc54732acc88e02
C++
LucasYang7/JobduOJ-InterviewQuestions
/1503binarySearchTreeToSortDoubleLinklist/main.cpp
UTF-8
7,541
3.46875
3
[]
no_license
#include<stdio.h> #include<string.h> #include<stack> using namespace std; #define MAX 3001 // 定义二叉树结点的结构 typedef struct Node { int data; // 数据域 Node * lchild; // 左子树指针 Node * rchild; // 右子树指针 Node * pre; // 中序遍历序列的前继指针 Node * next; // 中序遍历序列的后继指针 bool isConstructLeft...
true
75d81ae2c72e44659845690da6a600680cacf652
C++
enzoqueiroz/Arq
/sistemacadastro.cpp
UTF-8
1,295
3.265625
3
[]
no_license
#include <iostream> using namespace std; int main() { string nome; cout << "insira seu nome"; cin >> nome; int diaInicio; cout << "Insira o dia de inicio"; cin >> diaInicio; int diaTermino; cout << "Insira o dia de termino"; cin >> diaTermino; int investimentoDia; cout...
true
f97027caa1f43912322ec3d0ab7915af6dda4f34
C++
jimwwalker/drum_scope
/bar_drawer.cc
UTF-8
3,848
2.53125
3
[]
no_license
#include <exception> #include <string> #include "bar.h" #include "bar_drawer.h" BarDrawer::BarDrawer(int screenX, int screenY, int barX, int barY, int beats, int bpm) : list(beats, bpm) { const int border = 20; if (SDL_Init(SDL_INIT_VIDEO) < 0) { throw std::runtime_error("SDL_Init f...
true
7474e198d137a3554dc90b8b81e7562536293526
C++
achak98/Stuff-I-did-with-Cplusplus
/euler 3.cpp
UTF-8
555
2.875
3
[]
no_license
#include<iostream> using namespace std; unsigned long long gNo=600851475143; bool isPrime (unsigned long long a){ for(unsigned long long i=3l;i<=((a/2)+1);i+=2){ if (a%i==0 || a%2 == 0){ return 0; } } return 1; } unsigned long long largestF(unsigned long long a){ unsigned long long max=1l, i...
true
bf6acdf03dae8597fa592a15ec84ff349c7223b9
C++
plasticlouie/Notes
/cpp/Offer/翻转单词顺序列/main.cpp
UTF-8
1,006
3.390625
3
[]
no_license
/* 题目描述 牛客最近来了一个新员工Fish,每天早晨总是会拿着一本英文杂志,写些句子在本子上。 同事Cat对Fish写的内容颇感兴趣,有一天他向Fish借来翻看,但却读不懂它的意思。 例如,“student. a am I”。后来才意识到,这家伙原来把句子单词的顺序翻转了, 正确的句子应该是“I am a student.”。Cat对一一的翻转这些单词顺序可不在行,你能帮助他么? */ class Solution { public: string ReverseSentence(string str) { if(str.size()==0) return str; str =...
true
99d8284fbf8f642d69f1c2a5f721327aa1c53dee
C++
rapidsai/cudf
/cpp/include/cudf/strings/strip.hpp
UTF-8
2,459
2.515625
3
[ "Apache-2.0" ]
permissive
/* * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable...
true
f003fd66681f37dd2cc465b16380a7490b778f06
C++
tienanhnguyen191999/FinalContest_CTDL_GT
/69/main.cpp
UTF-8
916
2.765625
3
[]
no_license
#include <iostream> #include <cstring> #include <stack> using namespace std; char x[1000] = "*-a/bc-/akl"; void init(){ cin >> x; } void solve(){ stack<char> s; int c =0,save = 0; for (int i = 0 ; i < strlen(x) ; i++){ if (x[i] >= 'a' && x[i] <= 'z'){ cout << x[i]; c++...
true
a66a29c4e8980308c6dcbd3fe1d14b68546070c8
C++
flaming-snowman/pps
/2020-2021/summer-contest-3/MakingCheese/makingcheese.cpp
UTF-8
850
2.84375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll solve(ll inc, ll req, ll need) //"cheese mod" incrementer, cheese requirement, cheese needed { //binary search ll hi = need; ll lo = 0; while(lo < hi) { ll m = lo+(hi-lo)/2; ll cheeselo=req-req%inc+inc; //floor of ...
true
8690ca82cdd224c8f46938eec1d89e8724d02e8f
C++
flomerz/HomieSonoffRGBWW
/src/RGBController.hpp
UTF-8
4,652
3.09375
3
[]
no_license
#ifndef RGBCONTROLLER_H #define RGBCONTROLLER_H #include <Arduino.h> #define RGBRANGE 255 class RGBController { const uint8_t pinRed; const uint8_t pinGreen; const uint8_t pinBlue; unsigned short currentRed; unsigned short currentGreen; unsigned short currentBlue; unsigned short currentBrightness; ...
true
a1912af3da5782a065a3ceab2acc2515d9c64f5b
C++
mrcece/CppStrangeIoC
/CppStrangeIoC/framework/injector/injectionexception.h
UTF-8
649
2.671875
3
[ "Apache-2.0" ]
permissive
#pragma once #include <string> #include <stdexcept> using namespace strange::extensions::injector::api; namespace strange { namespace extensions { namespace injector { namespace impl { class InjectionException : public std::exception { private: InjectionExceptionType privatetype = static_cast<InjectionExcep...
true
139b67063a7cfa4198ba2b02dcc5d26c5151c2e3
C++
chris-mcclure/C2P
/Circle.cpp
UTF-8
1,598
2.65625
3
[]
no_license
// // Circle.cpp // C2P // // Created by Chris McClure on 3/21/18. // Copyright © 2018 Chris McClure. All rights reserved. // #include "Circle.h" using std::ostream; using std::endl; using std::string; using std::ostringstream; Circle::Circle(double width, const string & name):_radius(width/2), _width(width), _he...
true
6056738af49b99fbc0686203fb7d7f1a914df786
C++
storm-ptr/step
/test/longest_repeated_substring.hpp
UTF-8
2,246
3.03125
3
[ "MIT" ]
permissive
// Andrew Naplavkov #ifndef STEP_TEST_LONGEST_REPEATED_SUBSTRING_HPP #define STEP_TEST_LONGEST_REPEATED_SUBSTRING_HPP #include <map> #include <step/longest_repeated_substring.hpp> #include <step/test/case_insensitive.hpp> #include <string_view> TEST_CASE("longest_repeated_substring_hello_world") { auto range = s...
true
d831f0d8a8d8c017c636c64f330bf0553bfc2731
C++
MercuriXito/PicProcess
/lib/ops/basicops.h
UTF-8
1,537
3.0625
3
[]
no_license
#ifndef BASICOPS_H #define BASICOPS_H #include <cassert> #include "lib/ops/ops.h" class WImage; typedef unsigned char uchar; typedef struct hsipixel{ double i; // i \in [0,1] double s; // s \in [0,1] double h; // h \in [0,360] hsipixel():h(0),s(0),i(0){}; hsipixel(double h, double s, double i):h...
true
512a0005f00e9053c92af331b8b3492540c6b7d6
C++
gbrltorres/cmp1048-trabalho1
/util2b.h
UTF-8
432
2.703125
3
[]
no_license
#ifndef LIB2B_H #define LIB2B_H #include <iostream> #include <cmath> using namespace std; int size(char* s); int str_to_int(char* s, int q); string remove_whitespaces(char* s1); int count_words(string s, char c); string* split(string s, char c, int & q); int index_of(char* s1, char* s2); char* complete_array(ch...
true
8bff66ba0e01c9c071a91fd24e7b21984169aaad
C++
Leybee/DaniilYarokhmedov
/Laba_2/Laba_2_c++/Laba_2/main.cpp
WINDOWS-1251
2,988
3.453125
3
[]
no_license
#include <iostream> #include <string> #include <vector> using namespace std; class Row { string row; public: Row() { row = ""; } Row(string r) { row = r; } char operator[] (const int index) { return row[index]; } int length() { return row.length(); } void set(string r) ...
true
45cb00b4ecba3180403b005fa6eac54c33e688de
C++
swielgus/vctrsKL
/src/RegionConstructor.cpp
UTF-8
17,946
2.578125
3
[]
no_license
#include <algorithm> #include <deque> #include <iostream> #include "RegionConstructor.hpp" RegionConstructor::RegionConstructor(const std::vector<PolygonSide>& usedSideData, const std::vector<PixelGraph::edge_type>&& usedGraphData, unsigned int ...
true
315f7db471b1a874104258a0190a1afb51059ae2
C++
BoomerangDecompiler/boomerang
/src/boomerang/visitor/stmtmodifier/StmtModifier.h
UTF-8
2,895
2.625
3
[ "BSD-3-Clause" ]
permissive
#pragma region License /* * This file is part of the Boomerang Decompiler. * * See the file "LICENSE.TERMS" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL * WARRANTIES. */ #pragma endregion License #pragma once #include "boomerang/core/BoomerangAPI.h" #include <memory> ...
true
f53cfe7648d430a6ba4a8b414b1d202ae21305d8
C++
michi201/gitrepo
/cpp/samogloski.cpp
UTF-8
1,009
3.328125
3
[]
no_license
#include <iostream> #include <fstream> #include <cstring> #include <cstdlib> #include <iomanip> using namespace std; int liczZnaki(char nazwa[]) { char kopia[15]; cout << kopia << endl; // otwieranie pliku ifstream wejscie(nazwa); if (!wejscie) { cout << "Brak pliku!"; return 1; } o...
true
1c4df4d175af1c76b5ea612d3586432c81dd8807
C++
DHushchin/SeaBattle
/BattleShip/Cell.cpp
UTF-8
852
2.859375
3
[ "MIT" ]
permissive
#include "Cell.hpp" Cell::Cell(float x, float y) { isHit = isMiss = isBorder = isBoat = false; pos = sf::Vector2f(x, y); sprite.setPosition(pos); } bool Cell::SetUpSprite(string TextureName) { if (!texture.loadFromFile(TextureName)) return false; sprite.setTexture(texture); return true; } sf::Sprite Cell:...
true
a4001438b6aba35fb8719674183730a17e64358c
C++
aminbenarieb/cg_lab1
/lab1/mainwindow.cpp
UTF-8
2,249
2.609375
3
[]
no_license
#include "mainwindow.h" #include "congif.h" #include <QGridLayout> #include <QEvent> #include <QResizeEvent> #include <QPushButton> #include <QHeaderView> #include <QStatusBar> MainWindow::~MainWindow() { wgt->deleteLater(); } void MainWindow::addRow(QPointF point) { // Сбрасываем решение wgt->triangle...
true
0e3984bd561b3642f20a42a1c17c1ae72296bfa5
C++
Kathelyss/Study
/LabyrinthProject-master/Labyrinth-master/Labyrinth/main.cpp
UTF-8
1,635
3.296875
3
[]
no_license
// // main.cpp // Labyrinth // // Created by Екатерина Рыжова on 09.05.15. // Copyright (c) 2015 Екатерина Рыжова. All rights reserved. // #include <iostream> #include <stdlib.h> using namespace std; int main() { int n = 10; //т. к. лабиринт квадратный int array[n][n]; //т. к. лабиринт квадратный int...
true
4ec89cd5006dd2d6db02f0eda436a26a8d5ba47d
C++
ArdoncII/Labos-de-progra
/guialabo3/Promedio.cpp
UTF-8
274
3.1875
3
[]
no_license
#include "iostream" using namespace std; int main() { float a,b,c,prom; cout << "Para realizar el promedio de tres cifras digite los valores" <<endl; cin>> a >> b >> c; prom = ((a+b+c)/3); cout<< "El promedio de los valores es: "<<prom <<endl; }
true
efa708cc10adf9e9d2854da7f9350566c04a967b
C++
jpmdossantos/SheetCreator
/src/PulseLoader.cpp
UTF-8
2,181
2.84375
3
[]
no_license
/* * PulseLoader.cpp * * Created on: 2 de abr de 2020 * Author: joaopaulo */ #include "PulseLoader.h" #include <string> #include <iostream> #include <fstream> #include <sstream> #include <boost/algorithm/string.hpp> PulseLoader::PulseLoader(std::string path) { // TODO Auto-generated constructor stub this...
true
68363412d50933c101e839d38721850728261f7a
C++
dinesh5583/Data-Structure-and-Algorithm-using-c-
/Data Structure and algorithm/Tree/FindMax_in_BTree.cpp
UTF-8
1,534
3.78125
4
[]
no_license
#include <iostream> using namespace std; class node{ public: int value; node *left; node *right; }; class btree{ public: btree(); void insert(int key); void findmax(); private: void insert(int key, node *leaf); int find(node *root); node *root; }; btree::btree(){ root = NULL; } v...
true
19388254400655f142dfb74ef28211e7016481cb
C++
soheil647/Advance_Programming_Cpp
/Hotel_Reservation/source/hotel.cpp
UTF-8
12,647
3.265625
3
[]
no_license
#include "../header/hotel.hpp" using namespace std; struct Hotel::Rating { float location; float cleanliness; float staff; float facilities; float value_for_money; float overall_rating; }; Hotel::Hotel(const vector<string> &information_path) { parse_hotel_information(information_path); ...
true
db425ad627bd8fd27a42e798ffd2ef8aebf93b60
C++
Dixcit-TV/Rasterizer-DX11-Software
/source/Texture.h
UTF-8
729
2.578125
3
[]
no_license
#pragma once #include <string> #include <SDL_surface.h> #include "ERGBColor.h" #include "EMath.h" class Texture final { public: explicit Texture(const std::string& texturePath); Texture(const Texture& texture) = delete; Texture(Texture&& texture) noexcept = delete; Texture& operator=(const Texture& texture) = dele...
true
c962629f07e31846fa281b0e20563edb0874164e
C++
SamMul815/A-
/sceneManager.cpp
UHC
3,513
2.8125
3
[]
no_license
#include "stdafx.h" #include "sceneManager.h" #include "gameNode.h" //private publicó ٰ ĸȭ DWORD CALLBACK LoadingThread(LPVOID prc) { //ü init Լ sceneManager::_readyScene->Init(); // ü ٲ sceneManager::_currentScene = sceneManager::_readyScene; //ε sceneManager::_loadingScene->Release(); sceneManager::_...
true
3ad7481c7a275226d2d27be4400d5281d7b7e313
C++
njuszj/leetcode
/leetcode76.cpp
UTF-8
1,957
3.28125
3
[]
no_license
// 最小覆盖子串 // 给你一个字符串 S、一个字符串 T,请在字符串 S 里面找出:包含 T 所有字符的最小子串。 /* 示例: 输入: S = "ADOBECODEBANC", T = "ABC" 输出: "BANC" 说明: 如果 S 中不存这样的子串,则返回空字符串 ""。 如果 S 中存在这样的子串,我们保证它是唯一的答案。 */ /* // 官方题解 class Solution { public: unordered_map <char, int> ori, cnt; bool check() { for (const auto &p: ori) {...
true
00ad48eaa9fd8556d6dc9d90f7c7352e7abdb251
C++
KhNishad/Programs-of-Data-Structure-and-Algorithms
/Linear search.cpp
UTF-8
375
2.8125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main() { int i, n ,ar[13]={21,4,2,3,5,7,8,76,57,54,34,23,22} ; cout<<"Enter the number to find :"<<endl; cin>>n; for(i=0;i<14;i++) { if(ar[i]==n) { cout<<"Element number "<<++i<<endl; return 0; } ...
true
eb2d19a2c8d0346b0329106d05a6d0bc058fc256
C++
SirNate0/Archival
/Utils.h
UTF-8
21,446
3.046875
3
[ "MIT" ]
permissive
#pragma once #include <Urho3D/Graphics/Skeleton.h> #include <Urho3D/IO/Log.h> #include <Urho3D/Graphics/DebugRenderer.h> #include <Urho3D/Math/MathDefs.h> #include <exception> /// Unfinished code exception to be thrown. struct Unfinished: public std::exception { }; inline void PrintBone(Urho3D::Skeleton& sk, Urho3D...
true
81b6841e63ff54737b1bc5d60d5566b50711c56a
C++
aiekick/engine
/src/modules/util/Console.h
UTF-8
2,617
2.703125
3
[]
no_license
#pragma once #include <SDL.h> #include <vector> #include <string> #include "core/Var.h" #include "core/IComponent.h" #include "math/Rect.h" namespace util { enum ConsoleColor { WHITE, BLACK, GRAY, BLUE, GREEN, YELLOW, RED, MAX_COLORS }; extern std::string getColor(ConsoleColor color); class Console : public core:...
true
1ca2a08fc94cf8c9ed1e6db248873308e0b0ede9
C++
ericlin1001/offlineJudge
/hws/problem1/16308109/zuoye.cpp
UTF-8
617
2.578125
3
[]
no_license
#include<iostream> #include<fstream> #include<iomanip> using namespace std; int main() { ifstream inData; ofstream outdata; inData.open("name.dat"); float a,b,c,d,e,f,g,h,i,j,k,l; cin>>a>>b>>c>>d>>e>>f>>g>>h>>i>>j>>k>>l; outdata.open("temdata.dat"); cout<<a<<'\t'<<endl; cout<<b<<'\t'<<b-a<<endl; ...
true
7051824a31d5ac081947fa736870a13814684f76
C++
sharhar/Grapher2DCL
/VS/CLTest/GLUI/CheckBox.cpp
UTF-8
3,004
2.59375
3
[ "MIT" ]
permissive
#include <GLUI/GLUI.h> #include <GLUIExt.h> namespace glui { CheckBox::CheckBox(Rectangle bounds, Layout* layout, std::string text, CheckBoxDescriptor desc) : GLUIObject(bounds,layout){ m_text = text; m_desc = desc; m_checked = desc.checkedAtStart; m_prevDown = false; } void CheckBox::poll() { float p...
true
aff3c266c26098d546fe18da6bf229e3d9e4bf6d
C++
AlexNilbak/Class_1
/Autotest.h
UTF-8
603
2.84375
3
[]
no_license
#pragma once #include "CPoint.h" #include "CDist.h" using namespace std; int Autotest1(){ CPoint A(0,1); CDist B(1,2); CPoint S=A+B; if (S.X()==1 && S.Y()==3){ return 0; } else{ return 1; } } int Autotest2(){ CDist A(-1,0); CPoint B(1,2); CPoin...
true
4b4894ea3d9b9d50e5c86bd4e831387e3b8046cc
C++
ElenoMome/atcoder
/others/typical_dp/B.cpp
UTF-8
2,636
2.6875
3
[]
no_license
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <stack> #include <queue> #include <cmath> #include <tuple> #include <cstdio> #include <bitset> #include <sstream> #include <iterator> #include <numeric> #include <map> #include <cstring> using namespace std; //#define DEBUG_ //!!提出時...
true
9ae41a102aa0daf8e36f260d90168f0001332521
C++
EvertonCa/ProgrammingMarathon
/Graphs/1317 - Eu Odeio SPAM, Mas Algumas Pessoas Amam.cpp
UTF-8
4,562
2.90625
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> // sort #include <string.h> // memset #include <list> #define LIMPO 0 #define INFECTANDO 1 #define INFECTADO 2 using namespace std; vector<vector<int>> conexoes; class Spam { public: int originador, limite1, limite2; string a1, a2, a3; public: Sp...
true
d17961fa9cae84ce22984a7a80486d4c0b585fd5
C++
navispeed/IFT-3100
/src/model/material/Material.h
UTF-8
956
2.734375
3
[]
no_license
#pragma once #include <ofMain.h> #include "MaterialType.h" #include "BaseMaterial.h" #include "MaterialGouraud.h" #include "MaterialLambert.h" #include "MaterialPhong.h" enum class typeIllum:int { BASE,GOURAUD,LAMBERT,PHONG }; class Material { public: void beginMaterial(map<int,ofLight*> &lights); void endMater...
true
42de9e8b3d17017c575e12b109525af71c8d47b6
C++
csi-byte/cpp-maze-resolver-2016
/maze-master/model/algorithm.h
ISO-8859-1
2,603
2.734375
3
[ "MIT" ]
permissive
#ifndef ALGORITHM_H #define ALGORITHM_H //baptiste millot -- pierre antoine duchange 2017 class Maze; class Room; class Door; #include<iostream> #include <fstream> #include "mazesolver.h" #include "mazegenerator.h" #include <stack> // using typePileRoom = std::stack<Room *>; // type d'un stack de *room using typeTabV...
true
f04dcf97816446ab40e089db7e165b33c7368693
C++
pdschubert/WALi-OpenNWA
/Source/wali/lib/Markable.cpp
UTF-8
962
2.96875
3
[ "MIT" ]
permissive
/*! * @author Nicholas Kidd */ #include "wali/Common.hpp" #include "wali/Markable.hpp" namespace wali { Markable::Markable() : IMarkable(), marker(false) {} /*! * Anytime a Markable is created it is in the unmarked state. * This makes the copy constructor do nothing. */ Markable::Markable( const Mar...
true
40fd8a81b40ff752a1c28fc2b8b38adb39d2c1ab
C++
a-kashirin-official/spbspu-labs-2018
/egorov.maxim/common/rectangle.cpp
UTF-8
2,592
3.25
3
[]
no_license
#include "rectangle.hpp" #include <iostream> #include <cmath> #include <stdexcept> using namespace egorov; Rectangle::Rectangle(const rectangle_t &rectangle) : rectangle_(rectangle), points_ {{rectangle_.pos.x - rectangle_.width / 2, rectangle_.pos.y + rectangle_.height / 2}, {rectangle_.pos.x + rectangle_.widt...
true
676bf43f20403faf1195d91f9fc00c45628e2f31
C++
Twinparadox/AlgorithmProblem
/Baekjoon/14489.cpp
UTF-8
166
2.75
3
[ "MIT" ]
permissive
#include <iostream> using namespace std; int main(void) { int a, b, c; cin >> a >> b >> c; if (a + b >= c * 2) cout << (a + b) - c * 2; else cout << a + b; }
true
25dd93bbaa2ab13560949599a88bbd6df4416fe7
C++
jlcrodrigues/Learning-cpp
/Sheet 1/Exercise 3/ex12.cpp
UTF-8
823
3.703125
4
[]
no_license
#include <iostream> #include <cmath> using namespace std; double area(double radius) { return pow(radius, 2) * 3.14156; } //returns the distance between 2 points (x1, y1) and (x2, y2) double distance(double x1, double y1, double x2, double y2) { return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2)); } //returns th...
true
ffd04659e7a09cfa41f5df769ee2bc6371f12fca
C++
UniStuttgart-VISUS/tpf
/include/tpf/module/tpf_module_interface_parameters.h
UTF-8
1,246
2.625
3
[ "MIT" ]
permissive
#pragma once namespace tpf { namespace modules { /// <summary> /// Parameter interface for modules /// </summary> template <typename... Parameters> class interface_parameters { public: /// State that set_parameters(...) needs to be called befo...
true
95d6ee4ca3a4227a39608def6434fb7a11a03cad
C++
rohitsingh2901/Fundamental_of_Cpp_questions
/DSA_Assignment_q5(number is Prime or Not).cpp
UTF-8
818
3.578125
4
[]
no_license
#include<iostream> using namespace std; int main(){ int n; cout<<"Enter any number: "; cin>>n; if (n%2==0 and n!=2) { cout<<"Number is not prime."<<endl; } else if(n%3==0 and n!=3) { cout<<"Number is not prime."<<endl; } else if(n%5==0 and ...
true
134ada8e05edee6c749f91eead21851e8a9e491b
C++
roymacdonald/ofxHomography
/example/src/ofApp.cpp
UTF-8
2,853
2.78125
3
[]
no_license
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup(){ originalRect.set(0,0,ofGetWidth(), ofGetHeight()); originalRect.scaleFromCenter(0.7); originalCorners = ofxHomography::rectangleToCorners(originalRect); distortedCorners.resize(4); for(int i =0; i < 4; i ...
true
4cdfd407fee117c42a73696bd51bf226b6189459
C++
blizmax/galileo
/bounds.h
UTF-8
595
2.75
3
[]
no_license
#ifndef _BOUNDS_H #define _BOUNDS_H #include "ray.h" namespace galileo { class c_bounds { public: c_bounds() { } c_bounds(const c_vector3& min, const c_vector3& max) { pp[0] = min; pp[1] = max; } const c_vector3& min() const { return pp[0]; } const c_vector3& max() const { retu...
true
f1bc9a1c1d16161ab6b57952e0a6b19b9cd21a28
C++
JoaoDanielRufino/Algorithms
/String/permutation_in_string.cpp
UTF-8
893
3.078125
3
[]
no_license
// https://leetcode.com/problems/permutation-in-string/description/ class Solution { public: bool equal(vector<int>& a, vector<int>& b) { for(int i = 0; i < a.size(); i++) { if(a[i] != b[i]) return false; } return true; } bool checkInclusion(string s1, ...
true
585320cfcc4b3d82985fb7616b22c7d68ff16776
C++
akoo1/auto-indexer
/test.cpp
UTF-8
4,637
3.21875
3
[]
no_license
// // Created by Alfred on 2/28/20. // #include "catch.h" #include <cstring> #include "DSString.h" #include "DSVector.h" // After each SECTION, the variables in the scope will be reset to the variables in the TEST_CASE TEST_CASE("DSString class", "[DSString]"){ DSString s[10]; s[0] = DSString("testDSStri...
true
d2bbd8afd17d7fd7fe5be93d8c72eab41fca8560
C++
ssajnani/LifeVectorBluetoothServer
/LifeVectorServer/squasher.cpp
UTF-8
3,636
3.0625
3
[]
no_license
/** * @file squasher.cpp * @brief Squasher to process raw data * * Used for processing raw data from front end, which recording * the time stamps, latitude, and longitude. Adding unfound location * into archived library and squash continuous points at same * location together */ #include "squasher.h" #incl...
true
e3c7eb553363571e977928ba10d551f521f155a7
C++
nagyistoce/liblearning
/include/camp/args.hpp
UTF-8
4,573
3.140625
3
[]
no_license
/**************************************************************************** ** ** Copyright (C) 2009-2010 TECHNOGERMA Systems France and/or its subsidiary(-ies). ** Contact: Technogerma Systems France Information (contact@technogerma.fr) ** ** This file is part of the CAMP library. ** ** CAMP is free software: you ca...
true
0f0e46c353fbef74a4ea12ab6920f9bf91c6a9d9
C++
santhoshpro05/codekata
/minimumcost.cpp
UTF-8
774
2.9375
3
[]
no_license
include <iostream> #include <stdio.h> #include<math.h> using namespace std; int main() { char str1[100],str2[100],i,cost=0,cost1=0; cout<<"enter string1"; cin>>str1; cout<<"enter string2"; cin>>str2; int hash1[26]={0}; int hash2[26]={0}; int l1=strlen(str1); int l2=strlen(str2); ...
true
ac101834cd4ed1449759751da28b3d355dd65c87
C++
yukeyi/LeetCode
/20 Valid Parentheses/Valid Parentheses.cpp
UTF-8
1,372
3.390625
3
[]
no_license
class Solution { public: bool isValid(string s) { int len = s.length(); int start = -1; string stack = s; for(int i = 0; i<len;i++) { switch(s[i]) { case '(': case '[': case '{': start...
true
24e9503373de391f4f26d18308c7bbc52a552679
C++
dzui42unit/Modern-Cpp
/compiler_generated_methods.cpp
UTF-8
1,052
3.796875
4
[]
no_license
#include <iostream> /* 1. default constructor(is geerated if no constructor is provided) 2. copy constructor (is generated only if no 3,4,5,6 provided) 3. coppy assignment operator (is generated only if 2,4,5,6 are not provided) 4. destructor 5. move constructor (is generated only if 2,3,4,6 are not provid...
true
76c101eac0bb176c5a25de99baa191d856cc8a03
C++
MatteoMele98/GOP-Gioco-dell-oca-pazza
/src/Questions.cpp
UTF-8
4,677
2.921875
3
[ "MIT" ]
permissive
/* * Questions.cpp * * Created on: 30 apr 2018 * Author: Vincenzo */ #include "Questions.h" #include "AuxiliaryFunctions.h" using namespace std; Question questions[] = { {"La capitale del Nuova Zelanda è...?","Cracovia","Boston","Wellington","Washington",3}, {"La capitale di El Salvador è...?",...
true
e47cf828b8b34c88890337caaf168ca6bb0d4a4f
C++
nagyist/BaiduPS-tera
/src/master/test/procedure_executor_test.cc
UTF-8
2,344
2.765625
3
[ "Apache-2.0" ]
permissive
#include "gflags/gflags.h" #include "gtest/gtest.h" #include "master/procedure_executor.h" namespace tera { namespace master { namespace test { class ProcedureExecutorTest : public ::testing::Test { public: ProcedureExecutorTest() : executor_(new ProcedureExecutor) {} virtual ~ProcedureExecutorTest() {} virtu...
true
644f6ce350552eddb48ac1cf77a1d0ed7eda8703
C++
weak-dog/de-duplication-system
/client/client/security.cpp
UTF-8
7,169
2.71875
3
[]
no_license
#include "security.h" Security::Security() { } QString Security::HashMD5(QString password) { // 创建加密对象 QCryptographicHash hash(QCryptographicHash::Md5); // 添加明文数据 hash.addData(password.toUtf8()); // 获取加密后的数据 // 16个字节的数据 QByteArray new_password = hash.result(); // 转16进制 //qDebug()<<...
true
81e2df90d434bdb41c99e69affb6870612802303
C++
seddon-software/cplusplus
/24_RegEx/01.match_or_search.cpp
UTF-8
1,028
3.78125
4
[]
no_license
////////////////////////////////////////////////// // // Advanced pattern matching ... // ////////////////////////////////////////////////// /* * When we work with regular expressions we can "match"or "search". * matches have to match the entire string * searches match on substrings */ #include <iostream> #i...
true
3844e01938cf43ea2303f597ad8d28ba843c8585
C++
Claudiaf26/Network_sharing
/TCPServerSocket/TCPServerSocket_Linux.cpp
UTF-8
1,886
2.875
3
[]
no_license
#ifdef __linux__ #include "TCPServerSocket_Linux.h" TCPServerSocket_Linux::TCPServerSocket_Linux(uint16_t port) : TCPServerSocket_Interface() { accepting=false; s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (s < 0) throw std::invalid_argument("Error during socket: " + errno); u_int reuse = 1; if ( sets...
true
384b9468fbad419d9173df51c2e73630adc74d0f
C++
kenkerr/lvLights
/include/modbusTransaction.h
UTF-8
1,892
2.59375
3
[]
no_license
#ifndef MB_TRANSACTION_H #define MB_TRANSACTION_H class ModbusTransaction { // Return Definitions #define MB_VALID_REQUEST 0x00 #define MB_INVALID_FUNCTION 0x01 #define MB_ILLEGAL_ADDRESS 0x02 #define MB_ILLEGAL_DATA_VALUE 0x03 #define MB_INVALID_MBAP 0x20 #define MB_INV...
true
4f4a3cf39742aa6c00233a0b872c3dd664712972
C++
Mrsuyi/stl
/src/iterator/iterator_traits.hpp
UTF-8
1,180
2.75
3
[]
no_license
#pragma once #include "cstddef" #include "iterator_category.hpp" namespace mrsuyi { template <class T> class iterator_traits { public: using value_type = typename T::value_type; using difference_type = typename T::difference_type; using reference = typename T::reference; using pointer = typename T::pointer; ...
true