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
42439ede6e11a2a0003e96592b12f29389a3b9ff
C++
aleksa2808/buffer-overflow-exploits
/scenario3/p3.cpp
UTF-8
936
3.453125
3
[]
no_license
#include <cstdio> #include <cstring> class BaseGreeter { public: void setName(char *s_name) { strcpy(name, s_name); } virtual void greet() = 0; protected: char name[256]; }; class ClassyGreeter : public BaseGreeter { public: virtual void greet() { printf("Good day %s!\n",...
true
ea10190ab17240bbce55bc77143671b2b4722bb9
C++
NeuroWhAI/CodeAdapter
/CodeAdapter/ListBox.h
UTF-8
1,867
2.703125
3
[ "MIT" ]
permissive
#ifndef __CA__LIST_BOX_H__ #define __CA__LIST_BOX_H__ #include <memory> #include <vector> #include "BasicDeclaration.h" #include "Control.h" #include "Point.h" #include "String.h" BEGIN_NAMESPACE_CA_UI class ListBox : public Control { private: USING_CA(i32); USING_CA_DRAWING(Point); USING_CA_DRAWING(Poi...
true
df2e93f87fd4ca3dc13a182ff2078f989d3f2fbc
C++
jjmalarkey/cs261_p1
/reporter.cpp
UTF-8
4,642
2.90625
3
[]
no_license
#include "reporter.h" #include <iostream> #include <iomanip> #include <string> #include <utility> reporter::reporter() { } reporter::reporter(productiondb &db) { //the only constructor because without a db to connect is useless connection = &db; db.getTables(&stationList); } reporter::~reporter() { stationList.cle...
true
ddcb4c9c02e6fc0fbdf6504f9fa1f46f66f2c50e
C++
RapidWorkers/ProblemSolving
/BOJ/세그먼트 트리/1615.cpp
UTF-8
1,279
3.046875
3
[]
no_license
//Segment tree and inversion counting #include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <map> #include <set> using namespace std; //Fast query/modify from codeforces http://codeforces.com/blog/entry/18051 int query(vector<int>& t, int n, int l, int r) { // sum on interval [l, r) ...
true
f12f858aec91f9b3478b22dceacdfa7ec2021ebd
C++
Sima214/vff-struct
/src/ssce/clock.hpp
UTF-8
1,114
2.796875
3
[]
no_license
#ifndef SSCE_CLOCK_HPP #define SSCE_CLOCK_HPP #include <cfloat> #include <stdint.h> #if defined(__linux__) #define INTERNAL_STORAGE 2 #elif defined(__APPLE__) #define INTERNAL_STORAGE 0 #elif defined(_WIN32) #define INTERNAL_STORAGE 1 #else #error "Unknown platform." #endif namespace ssce{ class Clock { pu...
true
deab59319c550a2a4279d0be9de2d530db5e7b0a
C++
Flare-k/Algorithm
/재귀/하노이탑_재귀_11729.cpp
UTF-8
915
3.296875
3
[]
no_license
#include <iostream> #include <utility> #include <vector> #define endl "\n" using namespace std; int cnt = 0; vector<pair<int, int> > ans; void honoiTop(int num, int from, int by, int to) { cnt++; if (num == 1) { ans.push_back(make_pair(from, to)); } else { honoiTop(num - 1, from, to...
true
19912a90fc041cd3dcb909d2ee2b802c094c0081
C++
jentlestea1/obs_xslt
/obs/src/cpp/FDIR/DC_StuckDataProfile.h
UTF-8
4,342
2.796875
3
[]
no_license
// // Copyright 2004 P&P Software GmbH - All Rights Reserved // // DC_StuckDataProfile.h // // Version 1.1 // Date 07.01.03 (Version 1.0) // 01.10.03 (Version 1.1) // Author A. Pasetti (P&P Software), R. Totaro // // Change Record: // Version 1.1: replaced double and int with TD_Float and TD_Inte...
true
cc301e830225c12e14f1f67eab6f25372acadd22
C++
blackbbc/plot
/bilibili/functionhelper.cpp
GB18030
2,467
2.640625
3
[]
no_license
#include "functionhelper.h" #include "config.h" #include "mathparser.h" FunctionHelper::FunctionHelper() { initialParser(); } FunctionHelper::FunctionHelper (LPTSTR raw, DWORD color, FUNC_TYPE type) { initialParser(); this->_raw = new TCHAR[128]; wcscpy(this->_raw, raw); this->_color = color; this->_type = type...
true
f7c6cb38ddfbf663448e8d1306ea58f9942ee670
C++
lkk-cxks/-
/大作业.cpp
GB18030
955
2.6875
3
[]
no_license
#include<bits/stdc++.h> #define min(x,y) ((x) > (y)?(y):(x)) //using namespace std; int edit(char *S,char *T) { int sLen = strlen(S); int tLen = strlen(T); int dp[sLen+1][tLen+1]; int i = 0; int j = 0; for ( i = 1;i <= sLen;i++) dp[i][0] = i; for ( j = 1;j <= tLen;j++) ...
true
60e4265e89ebaa581cee3a0d4a891a8ba825b780
C++
wayne155/Algorithm
/main.cpp
UTF-8
1,605
3.078125
3
[]
no_license
#include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; int findSubStringWindow(string s, int start){ int hashStr[256] = {-1}; for (int i = 0; i < 256; i++) hashStr[i] = -1; int n = s.size() , ans= 0 ; for(int start =0 ,end = 0 ; end < n ; end++)...
true
c9513728c06920023059897315783dc1fc6f4b18
C++
Anil1111/COSC1436
/Samples/Chapter 6/FunctionWithReturnValue/common.h
UTF-8
685
3.5625
4
[ "MIT" ]
permissive
/* * COSC 1436 * * Provides some common functions needed in applications. */ #pragma once #include <iostream> using namespace std; /* * Determines if the numeric value is even. * * PARAMETERS: * value = The value to check. * RETURNS: * True if the value is even or false otherwise. */ bool IsEven ( in...
true
9d7494376ad53cdbbe95af954d99d82de29518f5
C++
bvan-dyc/CPPPool
/J01/ex02/main.cpp
UTF-8
489
2.859375
3
[]
no_license
#include <iostream> #include <string> #include <time.h> #include <stdlib.h> #include "Zombie.hpp" #include "ZombieEvent.hpp" int main(void) { ZombieEvent Zevent; srand(time(NULL)); Zombie ZombieA = Zombie("Adam", "Stack"); Zombie ZombieB = Zombie("Eve", "Stack"); ZombieA.announce(void); ZombieB.announce(void); ...
true
4b85a464f6c1b0ebc3be46e95bbee5ed40cd90b5
C++
modulo-/SDP-2016-Team-F
/arduino/debug/manualMotor/manualMotor.ino
UTF-8
2,835
2.65625
3
[]
no_license
#include "SDPArduino.h" #include <Wire.h> int i = 0; /* Motor mapping 0 0 - Left motor (polarity reversed) 1 - Right motor (polarity reversed) 2 - Middle motor (left is 'forward') 3 - kicker 4 - flippers 5 - nothing */ void setup() { SDPsetup(); helloWorld(); } void loop() { react(); } void react() ...
true
f856eb33398c9b8697fb614f0f20bc9b6f052c80
C++
Eulring/ACM-ICPC_model
/String/Tire_tree.cpp
UTF-8
809
2.765625
3
[]
no_license
#include <stdio.h> #include <string.h> #include <iostream> using namespace std; typedef long long ll; struct Tire{ int v; Tire *next[26]; }root; void update(char *str){ int len=strlen(str); Tire *p=&root,*q; for(int i=0;i<len;i++){ int id=str[i]-'a'; if(p->next[id]==NULL){ q=(Tire*) malloc(si...
true
5c4f1a3e6a2fac3ace2678a0f7dadb619cf829a9
C++
ACTIONFENIX/diploma
/utility.cpp
UTF-8
835
3.015625
3
[]
no_license
#include "utility.h" void saveMatrix(const Matrix &m, const std::string& fullname) { std::ofstream file(fullname); for (size_t i = 0; i < m.rows(); ++i) { for (size_t j = 0; j < m.columns(); ++j) { file << m[i][j] << " "; } file << std::endl; } file.close...
true
972bc795b0c35a8968254622cdd80f691d0ad938
C++
mafemello/Lab-AdvancedAlgorithms
/[2nd WEEK]/ip.cpp
UTF-8
646
2.921875
3
[]
no_license
/* Advanced Algorithms Lab I Exercise 3 - IPs Maria Fernanda Lucio de Mello nUSP: 11320860 */ #include <iostream> #include <vector> #include <stdio.h> #include <utility> #include <string> #include <map> #include <algorithm> #include<queue> #include <assert.h> using namespace std; int main (void) { int serve...
true
1700018e9a77e4bcaf8a69ec49f29d177cdf0b9e
C++
taejin0323/Algorithm_Study
/HackerRank/Implementation/12.drawingBook.cpp
UHC
766
3.25
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int solve(int n, int p) { int ans = 0; int front = p / 2; int back = (n / 2 - p / 2); if (front<back) ans = front; else ans = back; return ans; } /* ... ------------------------------------------------- int solve(int n, int p){ int answer = 0; if (p <= n / 2) {...
true
d635b37d0d9cc0fae4a49e0fe0184ac8fb5571ad
C++
nerooc/preoop_labs
/Lab07/MyString.h
UTF-8
921
3.5625
4
[ "MIT" ]
permissive
#pragma once #include <iostream> #include <cstring> class MyString//klasa MyString { public: MyString(const char* napis) //konstruktor { _napis = (char*)napis; } ~MyString() // "głośny" destruktor { std::cout << "- deleting...
true
39d8299bf2982d69d6a4897ae54d7ab7df06ba33
C++
chiaminchuang/Leetcode
/Easy/496-Next Greater Element I/496.cpp
UTF-8
691
2.921875
3
[]
no_license
class Solution { public: vector<int> nextGreaterElement(vector<int>& findNums, vector<int>& nums) { int position[10000]; for(int i = 0; i < nums.size(); ++i) position[nums[i]] = i; vector<int> nextGreater; for(int i = 0; i < findNums.s...
true
7f971824e867381f17c3b170ed75bc0f2bcd88c9
C++
Akanksha494/CPP
/May2021/LUCKY02.cpp
UTF-8
347
3.09375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int check(int n){ string s= to_string(n); for(auto i : s){ if(i=='3'||i=='7'){} else return 0; } return 1; } int main() { int n,t; cin >> t; while(t--){ cin >> n; if(check(n)==1) { cout << "LUCKY"<< endl; } else cout << "BETTER LUCK NEXT TIME" ...
true
9572f569d96015387e1db19cedb622365aad3789
C++
ths-rwth/carl
/src/carl-arith/ran/interval/Evaluation.h
UTF-8
13,203
2.515625
3
[ "MIT" ]
permissive
#pragma once #include <carl-arith/interval/Interval.h> #include <carl-arith/poly/umvpoly/functions/IntervalEvaluation.h> #include <carl-arith/interval/Evaluation.h> #include <carl-arith/constraint/BasicConstraint.h> #include <carl-arith/constraint/Simplification.h> #include "Ran.h" #include "helper/AlgebraicSubstitut...
true
a654f5d9840f68e83d3e443552d1d5b255319c98
C++
bsella/fltk_Emergence
/src/gui/toolbox/toolbox.cpp
UTF-8
1,620
2.828125
3
[]
no_license
#include "toolbox.h" #include <FL/fl_draw.H> #include "toolbox_category.h" #include <cstring> std::list<Item*> Toolbox::toolbox_items; Toolbox::Toolbox(int x, int y, int w, int h):Graphics_View(x,y,w,h){ items= &toolbox_items; } Toolbox::~Toolbox(){} int Toolbox::content_height; void Toolbox::mouse_wheel_event(int,...
true
4b0c7cd43ac7d51da885acd406c0bb5e699e0915
C++
AsmitaKakkar/C-
/calculator.cpp
UTF-8
1,583
3.703125
4
[]
no_license
//*******SIMPLE CALCULATOR*********** #include<iostream> #include<conio.h> using namespace std; void printmenu() { system("cls"); cout<<"1. addition"<<endl; cout<<"2. substraction"<<endl; cout<<"3. multiplication"<<endl; cout<<"4. division"<<endl; cout<<"5. modolu"<<endl; cout<<"6. exit"<<endl; } int main()...
true
1e56214e6a727ebfb2f39fd29394b3d677f4d2b6
C++
ShinraTensei/libVDFS
/examples/extract.cpp
UTF-8
710
2.921875
3
[]
no_license
#include "../VDFS.hpp" #include <iostream> #include <fstream> std::string getFilename(const char* name) { int i; for (i = 0; *(name + i) != ' '; ++i); return std::string(name, i); } int main(int argc, char* argv[]) { if (argc != 3) { std::cout << "Need a filename and index as arguments\n"; return 1; } v...
true
7e851ea2e59291be3a843580f8e22e75e6b6ded8
C++
lindenis-org/lindenis-v833-package
/avs/libconfigutils/files/src/libs/utils/WavUtils.cpp
UTF-8
2,624
2.59375
3
[]
no_license
#include <stdio.h> #include <errno.h> #include <string.h> #include "utils/WavUtils.h" namespace AW { //for read int WavUtils::create(const std::string &file, const std::string& mode) { int ret = FileUtils::create(file, mode); if(ret < 0) return ret; ret = FileUtils::read((char*)&header, sizeof(header)); ...
true
2344f30ab2678c257ae35ee9ac4719156c2226b3
C++
nickyrasch/arduino_reference_programs
/reference_files/sweeping_distance_sensor/sweeping_distance_sensor.ino
UTF-8
2,300
3.359375
3
[]
no_license
// SWEEPING DISTANCE SENSOR #include <Servo.h> const int SERVO=9; // Servo on Pin 9 const int IR=0; // IR Distance Sensor on Analog pin 0 const int LED1=3; // LED Output 1 const int LED2=5; // LED Ou...
true
f06fa950d8c3ee12f6b38dc775ed759646357e45
C++
martinogden/mer
/src/ast/elaborator/expr.cpp
UTF-8
2,406
2.6875
3
[ "Unlicense" ]
permissive
#include "ast/elaborator/expr.hpp" #include "type/canonicaliser.hpp" ExprElaborator::ExprElaborator(SymTab<TypePtr>& env, Map<FunTypePtr>& funTypes, Map<StructTypePtr>& structTypes) : env(env), funTypes(funTypes), structTypes(structTypes) {} ExprPtr ExprElaborator::get(ExprPtr& expr) { expr->accept(*this); ret...
true
75fa2add268844993947fc119f1312a6e954aa31
C++
ms2295/Compiler_Project
/Program_4_Part_1_Lexical_Analyzer.cpp
UTF-8
8,546
2.953125
3
[]
no_license
/* Name: Manjot Singh Date: December 5, 2018 Class: CS280 Professor: Gerard Ryan Assignment: Program 4 Part 1 Lexical Analyzer File */ #include <iostream> #include <stdlib.h> #include <cctype> #include <string> #include <cstring> #include <algorithm> #include <vector> #include <fstream> #include <map> #include <iterat...
true
193cf216495b445c8a9a0b2cd3e1efe722b76e1f
C++
pfnet/intern-coding-tasks
/2017/ml/random_action.cc
UTF-8
1,027
3.0625
3
[]
no_license
#include <iostream> #include <vector> void get_observation(std::vector<double>& obs, bool& done) { std::string stat; std::cin >> stat; if (stat == "obs") { obs.resize(4); for (int i = 0; i < 4; ++i) std::cin >> obs[i]; done = false; } else if (stat == "done") { done = true; } } int main() {...
true
03683751d3ac861044e4ce694bed30eea41c9f55
C++
codenuri/CPP1
/SECTION1/04_VARIABLE2/string2.cpp
UTF-8
252
3.09375
3
[]
no_license
#include <iostream> #include <string> void foo( const char* s) { printf("foo : %s\n", s); } int main() { std::string s = "hello"; foo(s); // error foo((const char*)s); // error foo( s.c_str() ); // ok }
true
a669c8c263a53adc4f57e5f41f907df3daf8d394
C++
victoryckl/ctools
/mylib/IntSetBST.h
UTF-8
502
2.921875
3
[ "MIT" ]
permissive
class IntSetBST { public: IntSetBST(int maxlements, int maxval) { root = 0; n = 0; } ~IntSetBST(); int size() { return n; } void insert(int t) { root = rinsert(root, t); } void report(int * x) { v = x; vn = 0; traverse(root); } protected: private: int n, *v, vn; struct node { int val; node * lef...
true
5240aa99130c032b97106aa6f8ca08bc09e2f083
C++
magdalennaniewinska/Cybermysz
/zcpp/mainwindow.cpp
UTF-8
1,519
2.640625
3
[]
no_license
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QDebug> #include <QElapsedTimer> QElapsedTimer maze_timer; MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); timer = new QTimer(); connect(timer, SIGNAL(timeout()), this, SLOT(t...
true
cad517ef88c164bfd196608db73178d0e6c4f69e
C++
GOAT095/cpp
/m08/ex01/main.cpp
UTF-8
540
2.625
3
[]
no_license
#include "span.hpp" int main() { Span sp = Span(5); sp.addNumber(5); sp.addNumber(3); sp.addNumber(17); sp.addNumber(9); sp.addNumber(11); // sp.addNumber(80); //for error test try { std::cout << sp.shortestSpan() << std::endl; } catch(const std::exception & e) ...
true
e6c833f1d92725b001979fe0afa4e32143f2bf28
C++
Robin-P/arcade
/lib/opengl/srcs/class/menu.cpp
UTF-8
2,145
2.703125
3
[]
no_license
// // EPITECH PROJECT, 2018 // arcade // File description: // LIB SFML MENU // #include "opengl.hpp" void u_opengl::initMenu(std::map<std::string, void *> &game_lib_name, std::map<std::string, void *> &graphics_lib_name) { this->GraphicsPathName = ""; this->GamePathName = ""; this->createButtons(game_lib_n...
true
054d5cca2ae081a7cb30dd0146e7fa39f4a87b9c
C++
TresSheep/sigma
/src/Frontend/AST/Union.h
UTF-8
521
2.546875
3
[]
no_license
#pragma once #include <string> #include "Expression.h" namespace Frontend::AST { class Union : public Expression { public: Union(std::string id, std::vector<std::unique_ptr<Expression>> body); ~Union(); std::unique_ptr<Backend::CodeGen::IR::Value> GenerateCode(std::shared_ptr<Back...
true
8958c243d4d1fd41360bd07dac262c1b6e86c314
C++
xunilrj/sandbox
/books/3D Math Primer for Graphics and Game Development/include/autocheck/classifier.hpp
UTF-8
3,051
3.046875
3
[ "Apache-2.0" ]
permissive
#ifndef AUTOCHECK_CLASSIFIER_HPP #define AUTOCHECK_CLASSIFIER_HPP #include <unordered_map> #include <sstream> #include "function.hpp" #include "apply.hpp" namespace autocheck { template <typename... Args> class classifier { public: typedef typename predicate<Args...>::type pred_t; type...
true
3ac788c3342300545bbabafc5aaa6898b34ce800
C++
linjinze999/BUPTSSE2013
/Lab/大三(上)/算法分析与设计_2013/分治法/DivideAndConquer/DivideAndConquer/Maximum.cpp
GB18030
992
2.71875
3
[]
no_license
#include<iostream> #include<time.h> using namespace std; int Maximun(int data[], int length, int& left, int& right)//Ӵ { int i, cur_left, cur_right; int cur_max, max; cur_max = max = left = right = cur_left = cur_right = 0; for(i = 0; i < length; ++i) { cur_max += data[i]; if(cur_ma...
true
a217a7beb50bc9ac07f39ae5a92a92dd6569e44b
C++
leeeyupeng/leeeyupeng.github.io
/project/algorithm/hdu/src/2112.shortestpath_2.cpp
UTF-8
2,251
2.59375
3
[]
no_license
#include"hdu.h" #define CHARNUMS 256 #define VERTICEMAX 152 #define MAXLENGTH 32 #define TIMEMAX 101 class Solution{ public: int getshotestpath(vector<vector<int>>& matrix,int start,int end){ auto cmp = [](pair<int,int>& a,pair<int,int>& b){ if(a.second == b.second){ return a.fi...
true
aeb6ecee6663a0a5f224bec502b6ee11a9a695b5
C++
DarrellWulff/ElementEngine
/ElementEngine/src/Math/Quaternion.cpp
UTF-8
2,681
3.484375
3
[ "MIT" ]
permissive
#include "Quaternion.h" #include <cmath> #include "MathFunctions.h" #include "Vector3.h" Quaternion::Quaternion(float thetaAngle, float xVal, float yVal, float zVal) { float halfTheta = thetaAngle * 0.5f; double sinFactor = sin(halfTheta); w = (float) cos(sinFactor); x = (float) sinFactor * xVal; y = (float) sin...
true
f10e7bca5bdcd8bfb14af0bf54435f1a1d7c5569
C++
yekm/bench
/tasks/vector_length_test/vec_algs.hpp
UTF-8
12,370
2.875
3
[ "MIT" ]
permissive
#ifndef VEC_ALGS_H #define VEC_ALGS_H #include "algorithm.hpp" #include "vec_task.hpp" #include "mpl.hpp" #include <algorithm> #include "utils/dbg.hpp" #include "bexception.hpp" class vec_template : public Algorithm { public: vec_template() : Algorithm("template unrolling") {} private: template <...
true
b053ef8620f81bb262caaa14ec58296abd0f59ce
C++
CodingWD/course
/c/chenmingming/chapter04/ex4.30.cpp
UTF-8
329
3.0625
3
[]
no_license
#include<iostream> #include<cstring> using namespace std; int main() { const char *c1 ="good "; const char *c2 ="emotion"; size_t len = strlen(c1) + strlen(c2); char *c = new char[len]; strcpy(c,c1); strcat(c,c2); cout << c << endl; string s1="bad "; string s2 = "behavior!"; string s; s=s1+s2; cout << s <<...
true
80984430433a8f842159443e6b1e9e914ecc8d68
C++
junierr/hdoj
/3555.cpp
GB18030
932
2.578125
3
[]
no_license
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; long long dp[20][20][20]; int a[30]; long long dfs(long long pos,int pre,int sta,bool limit){ //pos:ǰλ;pre:һλֵ;sta:n/ǰ49n,0/ǰ治49limit:false/һλ;true:һλ) if(pos==-1) return sta!=0; if(!limit&&dp[pos][pre][sta]!=-1) return dp[pos][pre...
true
6d89f001796aa9e1a17e0938cfade836df5278a3
C++
prv1/Data-Structures-Alghorithms
/Maze/Maze/Source.cpp
UTF-8
6,949
3.359375
3
[]
no_license
#include <iostream> #include <fstream> #include <string> #include "Point2D.h" using namespace std; enum Direction { RIGHT = 0, DOWN = 1, LEFT = 2, UP = 3 }; // Prototypes template<typename T, size_t mazeX, size_t mazeY> void printMaze(T (&maze)[mazeX][mazeY]) { system("cls"); for (int i = 0; i < mazeX; ...
true
2312db3970f3b35ce1d86c67423fea00847efe1c
C++
MAvdB-88/IceFieldCreator
/src/Utils.cpp
UTF-8
2,981
2.71875
3
[]
no_license
// MIT License // Copyright (c) 2020 Marnix van den Berg <m.a.vdberg88@gmail.com> // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the ri...
true
fae7bf584f81ac9f2eb2b56386651de7f5121ba1
C++
hubartstephane/Code
/libraries/chaos/src/Windowing/LinearComposerLayout.cpp
UTF-8
2,930
2.875
3
[]
no_license
#include "chaos/ChaosPCH.h" #include "chaos/ChaosInternals.h" namespace chaos { // ===================================================================== // LinearComposerLayout implementation // ===================================================================== aabox2 LinearComposerLayout::ComputePlacement(aab...
true
b2dc6ea24d4b1e89e34d162c3eabc48171540359
C++
poojitha2002/The-Complete-FAANG-Preparation
/1]. DSA/1]. Data Structures/03]. Recursion/C++/_1)_Print_Subset_Strings.cpp
UTF-8
350
3.359375
3
[ "MIT" ]
permissive
#include <iostream> using namespace std; void printSub(string str, string curr, int index) { if(index == str.length()) { cout<<curr<<" "; return; } printSub(str, curr, index + 1); printSub(str, curr+str[index], index + 1); } int main() { string str = "ABC"; cout<<"Sub Strings:- "; printSub(str, "", 0);...
true
3c0158168e238f071caca4bfbbbd84bbb68bb8f8
C++
CasualCoder91/N_Body
/src/LookupTable.cpp
UTF-8
2,598
3.203125
3
[]
no_license
#include "LookupTable.h" LookupTable::LookupTable(std::string filename, std::string delimiter) { this->delimiter = delimiter; this->fileName = filename; init(); } bool LookupTable::isEmpty(){ return map.empty(); } double LookupTable::get(double key){ std::map<double, double>::iterator low, prev; ...
true
8ea6daf5ca2fe355ecf28f337fa93b7c14ccdaf1
C++
Callidon/cbastien
/src/interpreter.cpp
UTF-8
4,198
3.21875
3
[ "MIT" ]
permissive
/* * Fonctions d'interprétations du Pseudo code * Auteurs : Pierre Gaultier et Thomas Minier */ #include "interpreter.hpp" #include <functional> #include <iostream> #include <string> using namespace std; /* * Méthode exécutant une série d'instructions en Pcode */ void execute(PcodeStack& pile_pcode, int nb_vars) ...
true
ef9b78751d1f8906e4b09cb731d2eaf842c2afa0
C++
GabbyLayr/Algoritmos_Foruns_Aulas
/E1.NotasAlunos.cpp
ISO-8859-1
704
3.390625
3
[]
no_license
//Escrever um programa que declare um vetor de reais e leia e apresentar em tela as notas de 30 alunos. #include<stdio.h> //biblioteca de entrada e sada: pintf e scanf #include<locale.h> //biblioteca para utilizao de acentos grficos: setlocale int main(){ setlocale (LC_ALL, "portuguese"); //acentuao grfica ...
true
52ba74a8de9a6285abb13110fd4af575191bf027
C++
ValentinAriela/clase-6
/Ejercicio5.cpp
UTF-8
387
3.421875
3
[]
no_license
#include <stdio.h> int main () { float numero1; float numero2; float multiplicacion; printf("Ingresar el primer números de la forma X.X:\n"); scanf("%f", &numero1); printf("Ingresar el segundo números de la forma Y.Y:\n"); scanf("%f", &numero2); multiplicacion = numero1 * numero2; printf("La multipl...
true
c4bb6e7144ffc2271de8fb5ff35e53cb6bd443c4
C++
jimh0311/MMO_Fighter
/Client/PunisherActionGame/CPlayerObject.h
UHC
1,109
2.8125
3
[]
no_license
#pragma once #include "stdafx.h" class CPlayerObject : public CBaseObject { /* CBaseObject ִ ġ. Ÿ. Virtual ൿѴ. */ enum enDIRECTION { LEFT = false, RIGHT = true }; public: CPlayerObject(int id, int type, int x, int y, bool isMy, int hp) :CBaseObject(id, type, x, y) { _bIsMyPlayer = isMy; _iHP = ...
true
62aea71b8fa1470d3ccd52eef367fbfc54e214ea
C++
davekessener/VerteilteSysteme
/A3/src/monitor.h
UTF-8
1,183
3.03125
3
[]
no_license
#ifndef VS_SYNCBUF_H #define VS_SYNCBUF_H #include <mutex> #include "util.h" namespace vs { template < typename T, typename Mutex = std::mutex, typename Lock = std::unique_lock<Mutex> > class Monitor { public: typedef Monitor<T, Mutex, Lock> Self; typedef T value_type; typedef Mutex mutex_type; ...
true
5c31469c336aee3747293e65704e82e9d6aa61bf
C++
grahfoster/UECPPD
/Sections/Sec_02/TripleX/TripleX/TripleX.cpp
UTF-8
4,886
3.609375
4
[]
no_license
/* A simple yet flavorful code-breaking game in which the user is tasked with guessing three integer values given their sum and product. With each of the twelve levels, the maximum potential size of the numbers increases, making for a greater arithmetic challenge. If the player solves all twelve puzzles, they win ...
true
809de5d46dd104b8b2f1fc342e04fb4cdf1e462f
C++
pmdiano/shuati
/cpp/308-Range-Sum-Query-2D---Mutable/solution.cpp
UTF-8
1,619
3.203125
3
[]
no_license
class NumMatrix { vector<vector<int>> mat; vector<vector<int>> bit; int M, N; void updateBIT(int row, int col, int val) { int diff = val - mat[row][col]; mat[row][col] = val; row++, col++; for (int i = row; i <= M; i += i & (-i)) { for (int j = col; j <= N; ...
true
025261dcb0256e277f55fe0afd3bd0a49611a567
C++
kovleventer/FoD
/src/gui/popup.h
UTF-8
1,735
2.84375
3
[ "MIT" ]
permissive
#pragma once #include <SDL.h> #include <string> #include "basicgui.h" #include "button.h" #include "../util/point.h" #include "../player/item.h" #include "../core/animatabletexture.h" /*! * @author kovlev */ /*! * @enum PopupType * Offers two opion on popup types * One has only one button while the other has...
true
96a66657130cabbc911e2ed1bee51296cd95c0be
C++
iLCSoft/LCIO
/src/cpp/include/UTIL/LCWarning.h
UTF-8
1,532
3.21875
3
[ "BSD-3-Clause" ]
permissive
// -*- C++ -*- #ifndef UTIL_LCWARNING_H #define UTIL_LCWARNING_H 1 #include<map> #include<string> #include<iostream> namespace UTIL { /** Utility class to show warnings in LCIO. * * The maximum amount of warnings printed is configurable and per default set to 10. * * Warnings are shown one last time when app...
true
768e7fe12b5a1aa4fae3e6a030b4176ab2d4b206
C++
opus-meum/LoggerWavesInIce
/InitializeEEPROM/InitializeEEPROM.ino
UTF-8
2,219
3.328125
3
[ "MIT", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// initialize the EEPROM gestion for the loggers #include <EEPROM.h> // the addresses should correspond to the logger parameters // address in which stores if the EEPROM has been used to generate file numbers before int address_init = 0; // address in which stores the current file numbering int address_numberReset = 1...
true
1e20da19ff546b09c907a0002fbf2b3032de6fee
C++
sorokin/mpl_demo
/push_back.h
UTF-8
277
2.515625
3
[]
no_license
#pragma once #include "node.h" template <typename List, int Value> struct push_back { typedef node<List::data, typename push_back<typename List::next, Value>::result> result; }; template <int Value> struct push_back<nil, Value> { typedef node<Value, nil> result; };
true
14a0bdc43282d647be8129f808186618b17758e2
C++
Diivon/Glc
/include/GC/wrap.h
UTF-8
5,279
2.828125
3
[]
no_license
#pragma once #include <string> #include "GC/Optional.h" namespace gc{ namespace priv{ template<class T, class Tr, class All, template<class Y, class A> class C> struct StringWrapperSplitHelper{}; template<class T, class Tr, class All, class Y> struct StringWrapperAsHelper0{}; template<class T, class Tr, cla...
true
5a9b51f004563d190606ad438523f05ce324113d
C++
haoyuan2016/leetcode
/Q63.cpp
UTF-8
775
2.609375
3
[]
no_license
class Solution { public: int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) { if(obstacleGrid.empty()) return 0; int m = obstacleGrid.size(), n = obstacleGrid[0].size(); vector<int> dp(n, 0); for(int i = 0; i < n; i++) { if(obstacleGrid[m ...
true
07b2121cb1cd00599584d6ab5501a6ef810d5418
C++
barani008/C-programs
/Data structures/Trees/Kth Smallest Element in a BST.cpp
UTF-8
894
3.828125
4
[]
no_license
/** Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements. Follow up: What if the BST is modified (insert/delete operations) often and you need to find the kth smallest frequently? How would you optimize t...
true
6b6193bc2459f3a6b3269ec223fb7a0ce39a5773
C++
renatomatz/finance_cpp
/option_pricing/option_pricing.h
UTF-8
2,346
2.53125
3
[]
no_license
#pragma once #include <algorithm> #include <cmath> #include <unordered_map> #include <set> #include "ts_getters.h" using namespace std; // Constants unsigned char QUIET = 0, INIT = 1, STEPS = 2, FINAL = 4, VERBOSE = 7 ; enum OptionKind { call=1, put=-1 }; unordered_map<string, Option...
true
783a6e5550b860d42c18b2cdcdea60da93d2b3af
C++
efrenhdez2112/INAOEgit
/Tarea_2.cpp
UTF-8
973
3.578125
4
[]
no_license
#include<iostream> using namespace std; void sumav(float vec1[], float vec2[], float vec3[], int tam) { float *ptrvec1 = vec1; float *ptrvec2 = vec2; float *ptrvec3 = vec3; for (int i; i<tam; i++) { *vec3 = (*vec1 + *vec2); *vec1++; *vec2++; *vec3++; } } int main() { ...
true
3ea521441b29e8e35b5ec6faac8f155b7fc67e13
C++
jerrychen44/cci_algorithm_fundamentals_cpp
/Ch04.Trees and Graphs/4.5_Validate_BST_jerry/4.5_Validate_BST_1_in_order_traversal_jerry.cpp
UTF-8
1,944
3.65625
4
[]
no_license
#include <iostream> #include <vector> #include "tree_utility.cpp" bool checkBST(TreeNode* node,int *lastest_traversaled_node){ if(node == nullptr){ //hit the end std::cout << " hit the end, node = nullptr, return true" << std::endl; return true; } std::cout << "node->data: " ...
true
b35bc088593cf6ff10016665da0da17b84815d16
C++
RuneKokNielsen/TopAwaRe
/inc/ext/json/JSONConfigurationTree.hpp
UTF-8
1,355
2.71875
3
[ "MIT" ]
permissive
#ifndef JSON_CONFIGURATION_TREE_HPP #define JSON_CONFIGURATION_TREE_HPP #include "ConfigurationTree.hpp" #include "json.hpp" using json = nlohmann::json; /** * JSON backend for interfacing with JSON configuration files. * Based on the nlohmann JSON implementation: https://github.com/nlohmann/json **/ class JSONCon...
true
5ff9bf997ffc5d0ad939630599dec85adb201a26
C++
zhang35/qt-dataViewer
/readdatawidget.cpp
WINDOWS-1252
1,801
2.71875
3
[]
no_license
#include "readdatawidget.h" #include "ui_readdatawidget.h" #include <QDebug> ReadDataWidget::ReadDataWidget(QWidget *parent) : QWidget(parent), ui(new Ui::ReadDataWidget) { ui->setupUi(this); this->setWindowTitle(tr("¼빤")); } ReadDataWidget::~ReadDataWidget() { delete ui; ...
true
82f99160769957e9dca40571097c6dd8ea25609c
C++
DonRumata710/NetCowork
/Generator/main.cpp
UTF-8
1,682
2.90625
3
[ "MIT" ]
permissive
#include <iostream> #include <filesystem> #include "interface.lexer.hpp" #include "interface.parser.hpp" #include "printer.h" int main(int argc, char** argv) { std::vector<std::filesystem::path> input; std::string output_folder; for(int i = 1; i < argc; ++i) { if (strcmp(argv[i], "-i") == 0)...
true
b70e042b5344fb0731485a434abf021fee939751
C++
feechka-patrick/OOP_labs
/laba6/8.cpp
UTF-8
587
3.546875
4
[]
no_license
#include <iostream> #include <stdlib.h> #include <math.h> #include <vector> using namespace std; const int LIMIT = 10; class safearay { private: vector<int> array; public: safearay(){ array.resize(LIMIT); for (int i=0; i<LIMIT; i++) array[i] = i + 1; } void putel(int ind, int num){ if (ind >= 0 && ind...
true
7f56f97d2ab1f6fbba86c1c0f965299d11eed0b4
C++
KiaFarhang/Big-C-
/chapter_4/ex11.cpp
UTF-8
1,509
4.03125
4
[]
no_license
#include <iostream> #include <math.h> using namespace std; /* Calculates the Julian date of a given day. @param year - the given year. @param month - the given month. @param day - the given day. @return jul - The date as a Julian date. */ long julian(int year, int month, int day) { if(year < 0) { year++; } if(m...
true
94c087474530e4f5269b63937fe3ddaf55499428
C++
TomHarte/CLK
/Storage/Disk/DiskImage/Formats/D64.hpp
UTF-8
1,002
2.78125
3
[ "MIT" ]
permissive
// // D64.hpp // Clock Signal // // Created by Thomas Harte on 01/08/2016. // Copyright 2016 Thomas Harte. All rights reserved. // #ifndef D64_hpp #define D64_hpp #include "../DiskImage.hpp" #include "../../../FileHolder.hpp" namespace Storage::Disk { /*! Provides a @c Disk containing a D64 disk image: a decod...
true
c9e246c3cdff171b1a1851c1669b1c1988986099
C++
lowzhao/3391New
/354.2.cpp
UTF-8
601
3.28125
3
[]
no_license
#include <stdio.h> #include <iostream> using namespace std; int main() { int T; int digit,digit2,result; cin >> T; while (T--) { result = 0; for (int i = 0;i < 4; i++) { cin >> digit; result += digit % 10; digit /= 10; digit2 = digit % 10 * 2; result += digit2 % 10 +...
true
39a907c03c53bb0316b920cb2433118e24aaecc7
C++
fil1190/creating-a-grid-of-game
/GridGroupItem.cpp
UTF-8
4,716
2.609375
3
[]
no_license
#include "GridGroupItem.h" #include "HexagonalCell.h" GridGroupItem::GridGroupItem(NumberOfCells numberOfCells, QObject *parent, GridType typeGrid): _typeGrid(typeGrid), _numberOfCells(numberOfCells), QObject(parent) { _sceneSize.setHe...
true
26eece9772b8713256f1e7991adcf475b5fac755
C++
Jeon-JongChan/Programmers
/RectangularWidth.cpp
UTF-8
660
2.953125
3
[]
no_license
#include <iostream> #include <vector> using namespace std; long long solution(vector<vector<int> > rectangles) { long long answer = -1; // [실행] 버튼을 누르면 출력 값을 볼 수 있습니다. cout << "Hello Cpp" << endl; for each(auto start in rectangles) { for each(auto value in rectangles) { ...
true
60bcb26e0065d9051261f7de1903f11c1a6c9d47
C++
wxr031/DSA
/graph/print_all_patha.cpp
UTF-8
864
3.0625
3
[]
no_license
#include <iostream> class Graph { int vertex; std::list<int> *adj; std::vector<int> indegree; public: Graph(int); ~Graph(); void add_edge(int, int); void dfs(); }; Graph::Graph(int v) { vertex = v; adj = new std::list<int>[v]; indegree.resize(v, 0); } Graph::~Graph() { delete[] adj; } void Graph::add_edge(in...
true
b6dba79672211a86b608a7ded4af99fe2b1db072
C++
Paryul10/Competetive-Coding
/CodeForces/Div2/EducationalRound44/a.cpp
UTF-8
579
2.515625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int size = n / 2; int in[size], e[size], o[size]; int ed = 0, od = 0; int c = 1; for (int i=0; i<size; i++) { cin >> in[i]; } sort (in, in + size); for (int i=0; i<size; i++) { e[...
true
4cc0cb834e9d1542a468ca06215ea9f9d3ed757e
C++
haomiao/WinCommon
/src/common_base/smart_log.cpp
UTF-8
5,443
2.625
3
[ "MIT" ]
permissive
#include "stdafx.h" #include <time.h> #include "smart_log.h" #include "string_helper.h" namespace { #define LEVEL_STR_SIZE 4 static std::string levelStr[LEVEL_STR_SIZE] = { "INFO", "WARNING", "ERROR", "FATAL", }; #define SAFE_CLOSE_HANDLE(obj) \ { \ ...
true
f0a10926217a1d6ae5b35f54a42e7a2fd492bacd
C++
wohlleby/372_final_project_slave
/src/timer.cpp
UTF-8
1,724
2.984375
3
[]
no_license
// Description: This file implements functions that utilize the timers //----------------------------------------------------------------------// #include "timer.h" #include <Arduino.h> /* Initialize timer 1, you should not turn the timer on here. * You will need to use CTC mode */ void initTimer1(){ //...
true
555b659e91de18e272a52a3fd5a28cca8ed1483d
C++
lnlp/Led
/src/Led.h
UTF-8
1,307
3.484375
3
[ "MIT" ]
permissive
/* Led.h * * Description: Arduino library for controlling LEDs via GPIOs in a simple and straightforward way. * Makes controlling LEDs easy using clean and simple code (e.g. on, off, toggle, flash). * * Author: Leonel Lopes Parente * License: MIT (see LICENSE file in repository root) *...
true
4d5d964708d567390866007f1ad48c2029cacafa
C++
Blssel/Algorithm-Practice
/PAT/level-A/A1011.cpp
GB18030
634
2.8125
3
[]
no_license
// A1011.cpp : ̨Ӧóڵ㡣 // #include "stdafx.h" #include<cstdio> int main() { double table[3][3]; double max[3];//ÿλôŶӦεֵ char rel[3] = { 'W', 'T', 'L' }; int select[3];//ѡ for (int i = 0; i < 3; i++){ for (int j = 0; j < 3; j++){ scanf("%lf", &table[j]); if (*table[j]> max[i]){ max[i] = ...
true
273dfb7e6ed3d746e87cf4f6a9f2a024adbd5407
C++
UrosKrstic/Fakultet
/Godina2/OO1/2015Lab3/Z3Poruka/Tekstualna.h
UTF-8
333
2.515625
3
[]
no_license
#ifndef _tekstualna_h_ #define _tekstualna_h_ #include "Poruka.h" #include <string> using namespace std; class Tekstualna : public Poruka { private: string tekst_; protected: void pisi(ostream &izlaz) const override { izlaz << tekst_; } public: Tekstualna(string tekst) : tekst_(tekst) {} Tekstualna() = defaul...
true
fc8a1960ccce62931da424fc7d7b00469d6105cf
C++
linsallyzhao/earlyobjects-exercises
/2015/chapter_8/examples/Stats.h
UTF-8
1,460
3.65625
4
[]
no_license
#ifndef STATS_H #define STATS_H #include <iostream> class Stats { private: double data[30]; int count; public: Stats() { count = 0; } bool storeValue(double n); double getOne(int index) { return data[index]; } ...
true
1a7e3bb115f691863a8e129201a522f29fc05cdb
C++
shockzort/tld
/src/core/Box.cc
UTF-8
3,790
3.078125
3
[]
no_license
#include "core/Box.hpp" Box::Box(double x1, double y1, double x2, double y2) { this->id = 0; this->x1 = x1; this->y1 = y1; this->x2 = x2; this->y2 = y2; this->width = x2 - x1 + 1; this->height = y2 - y1 + 1; this->mean = 0.0; this->variance = 0.0; this->overlap = 0.0; th...
true
1a3998d6e36fb5ce56c3171b28ab31e1938b6c74
C++
blockspacer/HQEngine
/HQEngine/Source/HQGrowableArray.h
UTF-8
4,053
3.171875
3
[ "MIT" ]
permissive
/* Copyright (C) 2010-2013 Le Hoang Quyen (lehoangq@gmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the MIT license. See the file COPYING.txt included with this distribution for more information. */ #ifndef _GROWABLE_ARRAY_ #define _GROWABLE_ARRAY_ ...
true
445f7db0add91b4e6a7ae2a7b20add43fa118883
C++
Anna-Zvankovich/Zvankovich
/KR-1/kr1().cpp
UTF-8
2,002
3.21875
3
[]
no_license
#include <iostream> #include <fstream> using namespace std; const int N = 256; void ShowContentsFile(char*); int main() { char fileNameFirst[N], fileNameSecond[N]; cout << "Please, enter the name of source files: " << endl;//1.txt and 2.txt and 3.txt cout << "1st file: "; cin.getline(fileNameFirst...
true
13c1be9508f4151dfe3361b6a40f5a4ec6876c85
C++
mayd/tcom
/src/HandleSupport.h
UTF-8
4,531
2.875
3
[ "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-newlib-historical" ]
permissive
// $Id$ #ifndef HANDLESUPPORT_H #define HANDLESUPPORT_H #include <tcl.h> #include <string> #include "tcomApi.h" #include "Singleton.h" // This class represents an association from a handle to an application object. // A handle maps to an object of this class. class TCOM_API InternalRep { protected: Tcl_Interp *m...
true
baef639232132917cd845e198a087fdf329e357f
C++
Gurman8r/ML
/include/ML/Graphics/Color.hpp
UTF-8
4,695
3.015625
3
[ "MIT" ]
permissive
#ifndef _ML_COLOR_HPP_ #define _ML_COLOR_HPP_ #include <ML/Graphics/Export.hpp> #include <ML/Core/Matrix.hpp> #include <ML/Core/StandardLib.hpp> namespace ml { /* * * * * * * * * * * * * * * * * * * * */ namespace detail { template < class To, class From > static constexpr tvec4<To> color_cast(const tvec4<...
true
d5a89bb6f153719d732c17661734e68efc9f5b50
C++
NunoRCurado/CastleWar
/Interface.cpp
UTF-8
7,212
2.765625
3
[]
no_license
#include "Interface.h" #include "Jogo.h" #include "Colonia.h" #include "Terreno.h" Interface::~Interface() { } bool Interface::verificaComando(int controlo) { Desenho d; Mapa *mapa = jogo.getMapa(); if (comObj.getArg1() != "DIM" && controlo == 0) { d.limpaLinhaProntoAvisos(); cout << "ERRO! Insira primeiro...
true
ab66fdb2625456e8db962929e6fac770ad91d4c2
C++
zoya-0509/Practice-codes
/Codechef GCD and LCM.cpp
UTF-8
360
2.828125
3
[ "MIT" ]
permissive
#include <iostream> using namespace std; long long gcd(long long int a, long long int b) { if (b == 0) return a; return gcd(b, a % b); } long long lcm(int a, int b) { return (a / gcd(a, b)) * b; } int main() { int t; cin>>t; while(t--) {int a,b; cin>>a>>b; cout<<gcd(a,b)<...
true
6faca2fa1e361270fe14c0d3c41b51a02c003407
C++
lazy3311/design_patterns
/decorator/main.cpp
UTF-8
996
3.25
3
[]
no_license
#include <iostream> #include "thincrust_pizza.hpp" #include "topping_mozzarella.hpp" #include "topping_sauce.hpp" int main(int argc, char** argv) { std::cout << "-------------------------------------------------------------------" << std::endl; std::cout << " DECORATOR PATTERN : Structural" <...
true
feefbf60ec6eb3551826270647d51f5889e522c2
C++
kaik25/silver-potato
/Source/Handle.cpp
UTF-8
520
2.6875
3
[]
no_license
#include "..\Include\Handle.h" using namespace std; Handle::Handle(HANDLE& rawHandle) : _handle(rawHandle) { }; void Handle::closeHandle(){ if (_handle != nullptr){ if (!(CloseHandle(_handle))){ throw CloseHandleException(GetLastError()); } } }; HandleCloser::~HandleCloser() { closeHandle(); }; void F...
true
bd228b4a25e4209d474cdad0402ad4aee1b53ef1
C++
prashantmarshal/ds-codes
/Array/smallernumbersleft.cpp
UTF-8
516
3.46875
3
[]
no_license
#include <iostream> #include <stack> using namespace std; void prevsmaller(int *arr, int size){ stack <int> mystack; for(int i = 0; i < size; ++i){ int temp = arr[i]; while(!mystack.empty() && mystack.top() >= arr[i]) mystack.pop(); if(!mystack.empty()) arr[i] = mystack.top(); else arr[i] = -1; my...
true
8ddeaaf9d0bc1a9b51bc55e37fa13c0cdc3144a1
C++
y42sora/soraSRM
/00001-00500/SRM496/Div2/AnagramFreeTest.cpp
UTF-8
1,989
3.390625
3
[]
no_license
#include "AnagramFree.h" #include <iostream> #include <vector> using std::cerr; using std::cout; using std::endl; using std::vector; class AnagramFreeTest { static void assertEquals(int testCase, const int& expected, const int& actual) { if (expected == actual) { cout << "Test case " << testC...
true
bab99a0964d76cd2bdf83898ba27aceb160d2c30
C++
contropist/CodeWorld
/Trashbin/Google Code Jam 2016/T4.cpp
UTF-8
1,344
2.671875
3
[]
no_license
//@ Including Header #include <csl_std.h> /** * Name : T4.cpp * Date : 2016年5月28日 下午11:38:08 * Copyright : fateud.com * Anti-Mage : The magic ends here. */ const int N = 30; int n, g[N][N], h[N], f[N]; int ans; bool check(int x) { if (x == n) return true; int cnt = 0; rep(i, 0, n) if (!h[i] && g[f[x]]...
true
f30f194dc5035f1250465ebf14fa6bc18dcb5ca5
C++
jasmeet13n/tinysql-db
/MemoryManager.cc
UTF-8
1,775
2.890625
3
[]
no_license
#ifndef __MEMORY_MANAGER_INCLUDED #define __MEMORY_MANAGER_INCLUDED #include <stack> #include "./StorageManager/Block.h" #include "./StorageManager/Config.h" #include "./StorageManager/Disk.h" #include "./StorageManager/Field.h" #include "./StorageManager/MainMemory.h" #include "./StorageManager/Relation.h" #include ...
true
bdc70ad266d2dee791b0dfd8674a8f6792697ece
C++
rapyuta-robotics/alica
/supplementary/autodiff/src/Reification.cpp
UTF-8
1,326
2.703125
3
[ "MIT" ]
permissive
#include "Reification.h" #include "Tape.h" #include <sstream> namespace autodiff { Reification::Reification(TermPtr condition, TermHolder* owner) : BinaryFunction(condition, condition->negate(), owner) { } int Reification::accept(ITermVisitor* visitor) { return visitor->visit(this); } void Reification::...
true
03eeebb14b5ea47511e07d94780d3c3c3b2655c3
C++
AdamTT1/bdScript
/ftObjs.h
UTF-8
3,788
2.59375
3
[]
no_license
#ifndef __FTOBJS_H__ #define __FTOBJS_H__ "$Id: ftObjs.h,v 1.8 2008-04-01 18:54:42 ericn Exp $" /* * ftObjs.h * * This header file declares some FreeType classes for * convenience. * * freeTypeLibrary_t - used to open/close the freetype library * freeTypeFont_t - used to represent an in...
true
5ec3704943deca8647d4b56fff132a4fb2d12bae
C++
kobe24o/LeetCode
/程序员面试金典/16.17.contiguous-sequence-lcci.cpp
UTF-8
1,176
3.046875
3
[]
no_license
class Solution { public: int maxSubArray(vector<int>& nums) { vector<int> dp(nums); for(int i = 1; i < nums.size(); ++i) { if(dp[i-1] > 0) dp[i] = max(dp[i], nums[i]+dp[i-1]); } return *max_element(dp.begin(),dp.end()); } }; class Solution { public: int maxSubArray(vec...
true
58b8ed9c072517c6c5bdc3d29aff63384517e55d
C++
JohnyEngine/CNC
/deprecated/heeksart/Point.h
UTF-8
1,622
3.4375
3
[ "Apache-2.0" ]
permissive
// Point.h // Copyright (c) 2009, Dan Heeks // This program is released under the BSD license. See the file COPYING for details. #pragma once #include <cmath> // combines 3D vertex and vector class Point{ public: double x, y, z; Point():x(0.0), y(0.0){} Point(double X, double Y, double Z):x(X), y(Y), z(Z){} Po...
true
c120659cd6c381938757be8a6d7b4540e378eff4
C++
juner417/data_structure
/day5/1_voidpointer.cpp
UTF-8
420
3.84375
4
[]
no_license
// 1_void pointer #include <stdio.h> // 핵심 : 포인터 변수 + 1 -> 포인터가 가르키는 대상체의 크기만큼 증가 // ex ) int* 라면 +1은 4바이트 증가 p3=400 -> p3+1 -> p3=404 int main() { // 포인터 연산 char c = 0; short s = 0; int n = 0; char* p1 = &c; short* p2 = &s; int* p3 = &n; printf("%p, %p\n", p1, p1+1); printf("%p, %p\n", p2, p2+1); printf("...
true
04387540c7be8c6a670e68682dc055ffbf4cc47e
C++
gerardpf2/SuperMonacoGP
/Super Monaco GP/Minimap.cpp
UTF-8
4,576
2.75
3
[ "MIT" ]
permissive
#include "Minimap.h" #include "Car.h" #include "Road.h" #include "Utils.h" #include "MinimapUI.h" #include "ModuleJson.h" #include "ModuleTexture.h" #include "ModuleRenderer.h" using namespace std; using namespace rapidjson; Minimap::Minimap(const Road* road) : road(road) { courseRect = COURSE_RECT; } Minimap::~M...
true