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
0b24ed442b2414f49751a9b9a4c7e5279743d33e
C++
FlowBo/Cinder_Apps
/coding_01/src/coding_01App.cpp
UTF-8
1,981
2.609375
3
[]
no_license
#include "cinder/app/AppNative.h" #include "cinder/gl/gl.h" #include "cinder/Text.h" #include "cinder/Font.h" #include "cinder/gl/Texture.h" #include "cinder/CinderMath.h" using namespace ci; using namespace ci::app; using namespace std; class coding_01App : public AppNative { public: void setup(); void mouseDow...
true
1bc304744f5b14de2198aa0435bce7777289a8dd
C++
atakandrmz/Nautilus
/Multiplexer/Multiplexer.ino
UTF-8
4,965
2.84375
3
[]
no_license
int val = 0; // variable to store the read value int A_zero = 8; int A_one = 9; int A_two = 10; int A_three = 11; int z = 12; void setup() { pinMode(z, INPUT); // sets the digital pin "z" as input pinMode(A_zero, OUTPUT); // sets the digital pin "A_zero" as output pi...
true
0e579ddf2d562f5b436582f44d340b6be668a2d3
C++
Minusie357/Algorithm
/BackjoonAlgorithm/9205. 맥주 마시면서 걸어가기.cpp
UTF-8
1,668
2.609375
3
[ "Unlicense" ]
permissive
//#include <iostream> //#include <cmath> //#include <queue> //#include <vector> //#include <utility> //using namespace std; // //#ifdef _DEBUG //#include "Utility.h" //#endif // _DEBUG // // // //typedef pair<int, int> mcoord; //constexpr int max_limit = 100; //int main() //{ // ios::sync_with_stdio(false); // cin.tie(...
true
254a6efe7bac7e0c7f624887637f2e589564f065
C++
skakri09/StarTris---Tetris-school-project-fall-2011
/StarTris/NITHris/Piece.cpp
UTF-8
10,751
2.859375
3
[]
no_license
/******************************************************** * File: Piece.cpp * Orginal Author: Kristian Skarrseth / NITH / 2011 * Changed by: - * * Description: Handles the basic needs of any piece in a tetris * game. Trough public functions another class * spawn new current and new pieces, move current...
true
b33f1171e2c7897992c8f08188b2071fab42d27b
C++
letsjdosth/GtCP
/helloworld/vector_return.cpp
UTF-8
246
3.015625
3
[]
no_license
#include <vector> #include <iostream> using namespace std; vector<int> vector_return(int a, int b){ vector<int> temp; temp.push_back(a); temp.pop_back(); return temp; } int main(){ int a = 42; cout << &a << endl; }
true
df2d539eaccd775b6b0bff49ef370e47783be2a9
C++
BCS-MLi/spr_multitarget_tracking
/Definitions.hpp
UTF-8
1,097
2.5625
3
[]
no_license
// // Created by Nikita Kruk on 27.11.17. // #ifndef SPRMULTITARGETTRACKING_DEFINITIONS_HPP #define SPRMULTITARGETTRACKING_DEFINITIONS_HPP #include <cstdlib> // size_t #include <iostream> #include <string> #include <cassert> #include <cmath> #define PARTIAL_IMAGE_OUTPUT typedef double Real; typedef long CostInt; ...
true
50930da54a85db3b1cf0c97eb74173f9a2c401c1
C++
mdqyy/OpenVision
/ImgML/hmm.hpp
UTF-8
6,870
2.765625
3
[]
no_license
#ifndef HMM_H #define HMM_H #include "ImgML/eigenutils.hpp" #include "Common/OpenCVCommon.hpp" /** * @brief The HMM class : * This class encapsulates the representation of a Discrete Hidden Markov model * A hidden markov model is composed of transition matrix,emission matrix * and initial probability matrix */ c...
true
029b6dda4a298fb700f86f2439eec6425c961ad9
C++
cosunae/stencil_benchmarks
/src/blockgen.cpp
UTF-8
780
3
3
[ "BSD-3-Clause" ]
permissive
#include <cmath> #include <iostream> #include "blockgen.h" std::vector<int> prime_factors(int n) { if (n < 2) return std::vector<int>(); std::vector<int> primes; std::vector<bool> sieve(n / 2, true); for (int i = 2; i <= std::sqrt(n / 2); ++i) { if (sieve[i]) { primes.pus...
true
9278a1da01c95d32e3ca2287404ba9f153d7113d
C++
andsssf/cg_2d_line_drawing
/WM/WindowManager.cpp
UTF-8
668
2.65625
3
[]
no_license
#include "WindowManager.h" #include "Elems/Line_DDA.h" #include "Elems/Line_MP.h" #include "Elems/Circle_MP.h" void WindowManager::init() { } void WindowManager::pushElem(Drawable *elem) { elems->push_back(elem); } void WindowManager::popElem() { if (elems->empty()) { return; //需要完善 } els...
true
95864e2b4e48874f851381f6618c1d6387ba1147
C++
yu3mars/proconcpp
/aoj/ITP1_6_A.cpp
UTF-8
271
2.53125
3
[ "MIT" ]
permissive
#include <stdio.h> int main(){ int n; scanf("%d",&n); int a[100] = {0}; for(int i=0;i<n;i++) { scanf("%d",&a[n-1-i]); } for(int i=0;i<n;i++) { printf("%d",a[i]); if(i<n-1) printf(" "); else printf("\n"); } return 0; }
true
2e5cab202a3889468b394d1e20ed69d22fe79784
C++
mellowLoveGH/cpp_OOP_objected_oriented_programming
/cpp_bingo_game-main/Bingo/Bingo_2016000000.h
UTF-8
1,591
3.109375
3
[]
no_license
/******************************************************** This is the code you need to modify. IMPORTANT NOTE 1. Change "2016000000" in the filename, class name, preprocessing statements to your real student id. 2. Change "MyName" in the constructor to your real name. These two changes are very imp...
true
ae54b0b1fc4d48f8c9d9b590fd741db893e619dc
C++
axax002/DeviceControl
/DeviceDetect/Win_Thread.h
UTF-8
578
2.6875
3
[]
no_license
#ifndef _WIN_THREAD_H_ #define _WIN_THREAD_H_ #include "Win_WaitObject.h" namespace DeviceDetectLibrary { class CThread : public CWaitObject { public: typedef void (*ThreadFunction)(void * state); explicit CThread(ThreadFunction routine); virtual ~CThread(void); public: void Start(void * state); bool ...
true
fd34b7d2e7d2175ab7ab822e902bc813c200cae0
C++
arrows-1011/CPro
/AOJ/Volume21/2102.cpp
UTF-8
1,011
3.078125
3
[]
no_license
#include <iostream> #include <algorithm> #include <string> using namespace std; int T,card[10]; string str; bool check1(int a,int b,int c){ if(a == b && b == c) return true; return false; } bool check2(int a,int b,int c){ if(a+2 == b+1 && b+1 == c) return true; return false; } bool check3(int a...
true
6eccd9174a75f45dbc49d392b6c67e49be48c80f
C++
TheToaster202/2802ICT-NQueensSolver
/nQueens.cpp
UTF-8
16,946
3.1875
3
[]
no_license
#include <cstdio> #include <iostream> #include <cstdlib> #include <queue> #include <utility> #include <vector> #include <chrono> #include <random> using namespace std; //Note this program needs to be complied with -O3 optimization to be relatively quick class Problem{//Holds information regarding the given problem ...
true
208dfa62e4b11a059ad32b1904eb71af35e61125
C++
strategist614/ACM-Code
/刷题比赛/LUOGU/P1030求先序遍历.cpp
UTF-8
513
2.640625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; char a[10]; char b[10]; struct node { char f; char l; char r; }t[10]; int lenb = 0; int lena = 0; int find(char c) { for(int i= 0;i<lena;i++) if(a[i] == c) return i; } void dfs(int l1,int r1,int l2,int r2) { int m = find(b[r2]); cout<<b[r2]; if(m > l1) dfs(l1,m-1...
true
81a4b5be5e9ca645fe4385d4899e52f8bb1ebde2
C++
saimadanmohan/Cplusplus-Tutorials
/vector_operations.cpp
UTF-8
817
3
3
[]
no_license
class Compare { public: bool operator()(const pair<string,int>& pr1, const pair<string,int>& pr2) { return pr1.second == pr2.second ? lexicographical_compare(pr1.first.begin(), pr1.first.end(), pr2.first.begin(), pr2.first.end()) : pr1.second > pr2.second; ...
true
1fa7424b8804e59e05b824cb697df9aabe634469
C++
i-radwan/Image2Code
/src/LineSegmentation/Components/Chunk.h
UTF-8
1,330
2.625
3
[]
no_license
// // Created by Ibrahim Radwan on 11/29/17. // #ifndef IMAGE2LINES2_CHUNK_H #define IMAGE2LINES2_CHUNK_H #include "Peak.h" #include "Valley.h" #include "../../Utilities/Utilities.h" /// Image Chunk. class Chunk { friend class LineSegmentation; /// Valleys and peaks detection in this image chunk. /// \p...
true
4ccd2a9344296e957daf42f82b34176b4d1d029a
C++
macton/DDLParser
/src/Set.h
UTF-8
1,915
2.9375
3
[ "BSD-2-Clause" ]
permissive
#pragma once #include <stdint.h> #include "BlockAllocator.h" namespace DDLParser { template< typename T > class Set { private: struct Element { uint32_t m_Key; T m_Payload; Element* m_Next; }; BlockAllocator< Element > m_Elements; ...
true
06558943e1587e2c1794c4a7effba20253f9c136
C++
FahimSifnatul/problem_solving_with_FahimSifnatul_cpp_version
/codeforces round 409 div2 B.cpp
UTF-8
305
2.53125
3
[]
no_license
//bismillahir rahmanir rahim #include<bits/stdc++.h> using namespace std; string x,z; int len; int main() { cin>>x>>z; len=x.length(); for(int i=0;i<len;i++) { if(x[i]<z[i]) { cout<<-1; return 0; } } cout<<z<<endl; return 0;...
true
82431b38b83134d96c63ced058ceb568773e76c4
C++
miemiemi/zju_ds_mooc_pa
/04-树6 Complete Binary Search Tree.cpp
UTF-8
619
2.859375
3
[]
no_license
#include <iostream> #include <algorithm> using namespace std; const int N = 1010; int n, k; int tree[N], val[N]; //完全二叉树按照堆存 //得到中序序列后还原二叉树 void dfs(int u) { if(u * 2 <= n) dfs(u * 2); tree[u] = val[k++]; if(u * 2 + 1 <= n) dfs(u * 2 + 1); } int main() { cin...
true
61c2b016e8e475f28952674afd3a1ea387f186e7
C++
ec2822460/ContrerasEmmanuel_CIS5_41366
/Homework/Gaddis chap2 hw/Gaddis_9thEd_Ch02_Prob10_MPG/main.cpp
UTF-8
996
3.359375
3
[]
no_license
/* * File: main.cpp * Author: Emmanuel M. Contreras * Created on January 10, 2021, 5:29 PM * Purpose: Miles Per Gallon Assignment Problem #10 */ //System Libraries #include <iostream> //I/O Library using namespace std; //User Libraries //Global Constants //Math, Science, Universal, Conversions, High Dimen...
true
7a8c0ff83d065b5243a86eac76556886d993e187
C++
Mokona/La-Grille
/sources/wordgrid/DictionaryTreeImpl.h
UTF-8
770
2.515625
3
[]
no_license
#ifndef WORDGRID_DICTIONARYTREEIMPL #define WORDGRID_DICTIONARYTREEIMPL #include "wordgrid/Dictionary.h" #include "wordgrid/CharTree.h" #include <vector> #include <string> namespace Wordgrid { class DictionaryTreeImpl : public Dictionary { public: DictionaryTreeImpl(); virtual ...
true
4ec2cde8aec9b4fb35814e6debf72a54b7fc3787
C++
Melnikoo/HovercraftGame_OpenGL
/Hovercraft/RigidBody2D.h
UTF-8
681
2.515625
3
[]
no_license
#include <string> #include <iostream> #include "GameObject.h" #include "SphereCollider.h" class RigidBody2D : public GameObject { private: float inertia; float mass; float orient = 0; float length; float width; glm::vec3 testPos = glm::vec3(1, 1, 0); glm::vec3 testForce = glm::vec3(2, 0, 0); glm::vec3 forc...
true
1c618a556b4bffd3c3f205e508d226c5618b8a93
C++
SuYuxi/yuxi
/Algorithms/Tree/116. Populating Next Right Pointers in Each Node.cpp
UTF-8
1,284
3.640625
4
[]
no_license
/** * Definition for binary tree with next pointer. * struct TreeLinkNode { * int val; * TreeLinkNode *left, *right, *next; * TreeLinkNode(int x) : val(x), left(NULL), right(NULL), next(NULL) {} * }; */ class Solution { public: void connect(TreeLinkNode *root) { if(root == nullptr) return; queue<TreeL...
true
e9caabb63b5729cff57ddeede91d7692c1e51755
C++
Dinghow/MyRoadToAlgorithm
/JobDo/1008_the_shortest_route.cpp
UTF-8
1,598
2.78125
3
[]
no_license
#include<iostream> #include<vector> #define MAX 10000000 using namespace std; struct Edge{ int des; int dis; int cos; Edge(int a, int d, int c):des(a),dis(d),cos(c){} }; bool vis[1001] = {0}; int dis[1001]; int cost[1001]; int main(){ int n, m, s, t; while(cin>>n>>m){ vector<Edge> ad...
true
e525cd3f1783f5ca4faedd395fca90731461d899
C++
ChrisLidbury/CLSmith
/src/CLSmith/StatementAtomicReduction.h
UTF-8
1,730
2.5625
3
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
// Atomic reduction statement representing a series of instructions used to // exercise atomic operations, while still keeping the program generated // deterministic #ifndef _CLSMITH_STATEMENTATOMICREDUCTION_H_ #define _CLSMITH_STATEMENTATOMICREDUCTION_H_ #include "CLSmith/CLStatement.h" #include "Block.h" #include...
true
b22da4d84a0734d9148f262fc9cac43db17a3d69
C++
beebdev/FashionMNIST-CNN-Accelerator
/cnn_classification/src/fashionMNIST.cpp
UTF-8
1,999
2.890625
3
[]
no_license
#include <stdint.h> #include <stdlib.h> #include <iostream> #include <sys/time.h> #include "../include/utils.h" #include "../include/cnn.h" int main() { /* Read test cases */ cases_t cases = read_test_cases(); /* Stats var */ double total_duration = 0.0; long int correct = 0; // for (int i = ...
true
906de05a8bfe1dc5839ee8cf30ef6ca12060dcc8
C++
hazzus/os-net-multiplexing
/socket/socket_wrapper.cpp
UTF-8
2,613
3.109375
3
[]
no_license
#include "socket_wrapper.h" ssocket::ssocket() : descriptor(socket(AF_INET, SOCK_STREAM, 0)) { if (descriptor == -1) { throw socket_exception("Cannot create a socket"); } flags = fcntl(descriptor, F_GETFL); if (flags == -1) { throw socket_exception("Cannot get socket status"); } } ...
true
ada2d293f1d8bc658b66fa9063659e7cb232a6d0
C++
Conny14156/OneFlower
/Project/OLD/Model/TextureMapPoint.hpp
UTF-8
584
2.703125
3
[]
no_license
#ifndef TEXTUREMAPPOINT_HPP #define TEXTUREMAPPOINT_HPP #include <Core/Vector.h> #include <SFML\Graphics\Color.hpp> struct TextureMapPoint { inline TextureMapPoint() : pos(0, 0), size(0, 0), rotated(false), color(255, 255, 255) {}; Core::Vector2i pos; Core::Vector2i size; bool rotated; sf::Color color; template...
true
8cb975c808a3459ea2844ad33e2658fbd8fe8bed
C++
jaguar-paw33/CODE_AAI
/6.Data Structures/3.Queue/queue_using_linked_list.h
UTF-8
937
3.609375
4
[]
no_license
#include<bits/stdc++.h> using namespace std; template<typename T> class Node { public: T data; Node<T> * next; Node(T data) { this->data = data; this->next = NULL; } }; template<typename W> class Queue { Node<W> * head; Node<W> * tail; int size; public: Queue() { head = NULL; tail = NULL; size ...
true
d43134ca5df7a09be6e75f816901d6d0379f2096
C++
palmerst/CS-4ZP6
/Proof of Concept Demo/include/DynamicObject.h
UTF-8
1,223
2.71875
3
[]
no_license
#ifndef DYNAMICOBJECT_H_INCLUDED #define DYNAMICOBJECT_H_INCLUDED #include "PhysicsObject.h" /*! The DynamicObject class is derived from the Obj class. This type of object is subject to all physics calculations. */ class DynamicObject : public PhysicsObject { public: //! DynamicObject constructor ...
true
fa393bf1d36c109ec12653d1eb77f86723fbfc4f
C++
yameenjavaid/Online-Judge-Solutions
/UVa/uva10706.cpp
UTF-8
1,173
2.59375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; // Number Sequence #define num long long int inline string build(num l){ string s = ""; for(num i = 1; i <= l; i++) s += to_string(i); return s; } vector<num> seq; int main(){ num last = 1, inc = 1, cnt = 2; seq.push_back(1); while(true)...
true
f4c2fb60f4508e3c044de12131b72aa09c01d626
C++
Unrealf1/RootExtraction
/General/source/JSON/JSONWriter.cpp
UTF-8
2,764
2.703125
3
[]
no_license
// // Created by fedor on 9/29/19. // #include "JSON/JSONWriter.hpp" JSONWriter::JSONWriter(std::ostream &stream): stream(stream) { } void JSONWriter::BeginBlock() { stream << block_begin; last_property = false; ++current_depth; } void JSONWriter::BeginBlock(const std::string &name) { CheckForComma...
true
c2a856c024651f31053d4283ca2689891bd41cf3
C++
smsguy927/UltimateOmaha
/Card.cpp
UTF-8
5,211
3.203125
3
[]
no_license
#include "Card.h" Card::Card() { } Card::Card(int ID) { setId(ID); } Card::Card(int rankID, int suitID) { } Card::~Card() { } void Card::setId(int id) { this->id = id; setRank(id % NUM_RANKS); setRankId(id % NUM_RANKS); //setSuit(id % NUM_SUITS); //setSuitId(id % NUM_SUITS);...
true
ccbf456d56c43b1b70efee2dcd496e0fc068403c
C++
dbwls89876/Ru
/BAEKJOON/Step/7. string/11720_char_sum.cpp
UTF-8
215
2.625
3
[]
no_license
#include <iostream> using namespace std; int main(){ int n, sum = 0; char arr[101]; cin>>n; for(int i = 0; i<n; i++) cin>>arr[i]; for(int i = 0; i<n; i++){ sum += (arr[i]-'0'); } cout<<sum; return 0; }
true
f35f753014cfa975fd435a86152901ba124aefd6
C++
tngo0508/Cplusplus-OCC-
/A250_TEMP_E6_Ngo_NhatTan-2016-04-13/A250_TEMP_E6_Ngo_NhatTan/Project/Movie.cpp
UTF-8
649
3.390625
3
[]
no_license
#include "Movie.h" ostream& operator<<(ostream& out, const Movie& otherMovie) { out << otherMovie.getMovieTitle() << "(" << otherMovie.getYear() << ")"; return out; } Movie::Movie() { year = 0; } Movie::Movie(const string& newMovieTile, int newYear) { movieTitle = newMovieTile; year = newYear; } ...
true
db09455ceba2dd30875eb6be11d9555bae4e8ac0
C++
Rayyan06/Snake_Game
/Apple.h
UTF-8
465
2.546875
3
[]
no_license
#ifndef APPLE_H #define APPLE_H // #include "Point.h"// When I learn inheritance #include "Point.h" #include <Arduino.h> #include "snakegame.h" class Snake; class Point; class Apple { private: uint8_t m_x; uint8_t m_y; public: Apple() = default; Apple(uint8_t x, uint8_t y) : m_x{ x }, m_y{ y } ...
true
5ad4cef2a5896741628345e1b76f57b9fe5a283d
C++
david-docteur/DataStructures
/DoublyLinkedList/Node.cpp
UTF-8
872
3.4375
3
[]
no_license
#include <string> #include "Node.h" using namespace std; template<typename T> Node<T>::Node(T value) { data = value; previous = NULL; next = NULL; } template<typename T> Node<T>::~Node() { } template<typename T> const Node<T>* Node<T>::operator=(const Node<T>* n) { cout << "Calling Node Assignment Operator." ...
true
172f6852dc2231706539d3f12f68d28bad44a1d1
C++
zhengyunhai/CCFCSP
/code/CCF201712-2 游戏.cpp
UTF-8
1,152
2.953125
3
[]
no_license
#include<cstdio> #include<cstdlib> struct dl{ int id; int num; dl* pre; dl* next; }dl; void gendl(struct dl*temp,int n) { int i; struct dl* r=temp; struct dl* head; head=r; for(i=0;i<n;i++) { struct dl* temp1; temp1=(struct dl*)malloc(sizeof(struct dl)); temp1->id=i+2; temp1->num=0; temp1->next=NUL...
true
da9bd6e57722aa62d45d741dfcb1882580722a1b
C++
aaaaaepp1/tapin
/ArduinoProgram/Smoothing.cpp
UTF-8
755
3.140625
3
[]
no_license
#include "Arduino.h" #include "Smoothing.h" Smoothing::Smoothing () { } void Smoothing::setNext(Smoothing *smoothing_) { next = smoothing_; length = smoothing_->getLength (); } void Smoothing::setLength (int length_) { length = length_; } void Smoothing::setValue (int value_) { value = value_; } int Smooth...
true
073b3eed64d087a40c21675612f8d95065da9fe9
C++
Julsperez/Practicas-distribuidos
/practica10-23-27marzo/practica10/Solicitud.cpp
UTF-8
1,037
2.59375
3
[]
no_license
#include "SocketDatagrama.h" #include "Solicitud.h" #include "mensaje.h" Solicitud::Solicitud() { } char * Solicitud::doOperation(char* IP, int puerto, int operationId, char* arguments) { struct mensaje msj; char* resultado; int res; for(int i=0;i<1;i++){ msj.messageType = 0; msj.requestId = id; id++; ...
true
09a1949deea741171ca8cc6eba8d5f3ee76ffd48
C++
nickcharron/lidar_snow_removal
/src/radiusOutlierFilter.cpp
UTF-8
2,979
2.59375
3
[]
no_license
#include <ros/ros.h> #include <iostream> #include <vector> // PCL specific includes #include <sensor_msgs/PointCloud2.h> #include <std_msgs/Float64.h> #include <pcl_conversions/pcl_conversions.h> #include <pcl/point_cloud.h> #include <pcl/point_types.h> #include <pcl/filters/radius_outlier_removal.h> ros::Publisher p...
true
83c1a430008a23ea8e43a417b7be006342c99963
C++
Kattjakt/kolv-hardware
/kolv.ino
UTF-8
3,193
3.140625
3
[]
no_license
#include <SoftwareSerial.h> #include <MD5.h> SoftwareSerial bluetooth(4, 2); // RX, TX struct Entry { String name; unsigned pin; int(*callback)(unsigned, String); }; class Handler { private: Entry **list; size_t size; public: Handler(); ~Handler(); bool bind(String name, u...
true
2ff55ed186b8b1e6fa794b31a5e6c457bc2abbb8
C++
Fantendo2001/FORKED---CourseMaterials
/2018-2019_Term2/CSC3002-Programming_Paradigms/Course_Material/Week 05/06 Programs/PointWithFreeFuncsAndOps/point.cpp
UTF-8
927
3.578125
4
[ "MIT" ]
permissive
/* * File: point.cpp * --------------- * This file implements the point.h interface. The comments have been * eliminated from this listing so that the implementation fits on a * single page. */ #include <string> #include <math.h> #include "point.h" using namespace std; Point::Point() { x = 0; y = 0; } P...
true
8ff98b4bb29f178f3690871e4cd54035d1d3c2d1
C++
Ali-Fawzi-Lateef/C-PrimerPlus
/Chapter4/pe4-1.cpp
UTF-8
899
3.921875
4
[]
no_license
// pe4-1.cpp -- this program requests and displays information // This is exercise 1 of chapter 4 in C++ Primer Plus by Stephen Prata #include<iostream> int main(void) { using namespace std; cout << "What is your first name? "; char first_name[20]; cin.getline(first_name, 20); // we can see that cin does not lea...
true
c24fb7359f570b058bb1edb2517cd2d0e7f93caa
C++
saushirur1/Justify_Text
/Text_Justification.cpp
UTF-8
1,369
3.0625
3
[]
no_license
#include <iostream> #include <vector> #include "Text_Justfication.h" using namespace std; greedy_justify::greedy_justify(string text) { string word=""; for(int i=0;i<text.length();i++) { if(text[i]==' ' || i==text.length()-1 || text[i]=='.') { v.push_back(word); word=""; } else { word=word+text[i]...
true
00af5181bd0b3e7f51eb04f594d8c3a21d867be1
C++
DrewGaard/Comp-53-Labs-Data-Structures
/Lab 14 Queues/Lab 14 Queues/Node.h
UTF-8
260
2.984375
3
[]
no_license
#ifndef NODE_H #define NODE_H #include "Student.h" class Node { protected: Student data; Node* next; public: Node(); Node(Student item, Node* n = NULL); Student getData(); Node* getNext(); void setData(Student item); void setNext(Node* n); }; #endif
true
5375d4d38b33eca6ab8b9ac62cf5d3233738c328
C++
BrandonAO/Estructura-Datos
/Taller1/Blackjack.cpp
UTF-8
6,710
2.96875
3
[]
no_license
#include "Blackjack.h" #include "Croupier.h" #include "Admin.h" #include "Jugador.h" #include <iostream> #include <Windows.h> using namespace std; Blackjack::Blackjack() { this->croupier = Croupier(); this->mazo = Mazo(); this->cantActual = 0; this->max = 6; //maximo de jugadores en mesa, minimo 1 this->jugadore...
true
30e9db3c841b6e87d8c9343ee13ef44264de5679
C++
keith-mcqueen/MessageServer
/MessageStore.h
UTF-8
603
2.765625
3
[]
no_license
/* * File: MessageStore.h * Author: keith * * Created on September 23, 2013, 10:29 PM */ #ifndef MESSAGESTORE_H #define MESSAGESTORE_H #include <string> #include <semaphore.h> #include <map> #include <vector> #include "Message.h" class MessageStore { public: MessageStore(); virtual ~MessageStore(); ...
true
910586bdce8c8fe4b35692fb82f8bd59267adf19
C++
WickedLukas/BMP388_Test
/src/main.cpp
UTF-8
1,865
2.84375
3
[]
no_license
// BMP388_DEV - I2C Communications, Default Configuration, Normal Conversion, Interrupt #include <Arduino.h> #include <BMP388_DEV.h> // Include the BMP388_DEV.h library #include "Plotter.h" #define BAROMETER_INTERRUPT_PIN 7 volatile boolean barometerInterrupt = false; float temperature, pr...
true
8047f781a73b9db736fe37996127a6e713e516dc
C++
burakcoskun/programming_contests
/codeforces/411div2/B/soln.cpp
UTF-8
552
2.515625
3
[]
no_license
#include<cstdio> #include<cstdlib> #include<string> #include<vector> #include<map> #include<set> #include<queue> #include<stack> #include<algorithm> #include<iostream> #include<cmath> using namespace std; #define pb push_back #define mp make_pair #define fs first #define sc second int n; void read_input(){ cin ...
true
66dd790e29f5cc723f5800793278ac21dab3f207
C++
sankalpkotewar/algorithms-1
/tree/path-sum-iv.cpp
UTF-8
993
3.578125
4
[]
no_license
#include "tree.h" /* * If the depth of a tree is smaller than 5, then this tree can be represented by a list of three-digits integers. For each integer in this list: The hundreds digit represents the depth D of this node, 1 <= D <= 4. The tens digit represents the position P of this node in the level it belongs t...
true
5e9f3bd4d79d7a8cbed777f44be0af4068014caa
C++
s0lstice/carto-qt
/askdatabase.cpp
ISO-8859-1
4,295
2.6875
3
[]
no_license
/** * \file askdatabase.cpp * \brief Fenetre de gestion des bases de donnees, permet de choisir ou creer une nouvelle base * \author Guillaume Lastecoueres & Mickael Puret * \version 0.1 * * La creation ou la selection d'une base de donn necessite la selection de son emplacement. La creation necessite de creer to...
true
54f1be788404c2b3a178e53a10ac720481276648
C++
jmoraes7/Elements-of-Programming-Interviews
/Linked Lists/DeleteNode.cpp
UTF-8
914
3.171875
3
[]
no_license
/* * DeleteNode.cpp * ----------------- * * Chapter 8 Question 7 */ #include <cassert> #include <iostream> #include <vector> #include <algorithm> #include <random> #include <unordered_map> #include "./Linked_list_Prototype.h" using namespace std; void deleteNode(shared_ptr<ListNode<int> >& node) { node->data = no...
true
cd1f8d2795725a7f8e9a882f62707a6f0cf65a6c
C++
lieroz/CourseOnCompilers
/lab_04/main.cc
UTF-8
227
2.515625
3
[]
no_license
#include <iostream> #include "parser.h" int main() { auto &&[f, r] = parse({"a", "and", "c", "xor", "(", "b", "or", "c", ")", "and", "1"}); std::cout << std::boolalpha << f << ": " << r << std::endl; return 0; }
true
91506784efa3dc6ceed71eacaa0ba9cb6a9a69f1
C++
LyudmilaPetrashko/useful_information
/tree/theory.cpp
UTF-8
6,631
2.90625
3
[]
no_license
Введение: Для того чтобы граф T считался деревом, он должен следовать всем следующим ограничениям (которые могут быть доказаны как эквивалентные ограничения): 1)T соединен и не имеет неориентированных циклов (т. Е. Если бы направленные направленные ребра T не были направлены, циклов не было бы) 2)T является ациклич...
true
21483623cfd3884f26f10815f0485eb94fcca1c0
C++
christopheryou/EarthquakeData
/a3-earthquake/earthquake.h
UTF-8
713
3.109375
3
[]
no_license
/** CSci-4611 Assignment 3: Earthquake */ #ifndef EARTHQUAKE_H_ #define EARTHQUAKE_H_ #include <string> #include "date.h" /** Small data structure for storing earthquake data. */ class Earthquake { public: // Create an earthquake from a datafile's line of text Earthquake(std::string s); ...
true
4ea7cf5a211a3fa1fee5b5d45a5e5c069d71115b
C++
sikao1990/XFramework
/Mem/MemMgr.cpp
UTF-8
3,010
2.984375
3
[]
no_license
#include "MemMgr.h" #include <stdlib.h> #include <new> MemMgr::MemMgr():pEleHead(NULL),nUnit(0){ } MemMgr::~MemMgr(){ EleNode* pBegin = pEleHead; EleNode* pBak = NULL; for(;NULL!=pBegin;pBegin = pBak) { pBak = pBegin->pNext; destoryImpl(pBegin); if(NULL==pBak) break; } } bool MemMgr::Init(int blockSize...
true
85ae0f4e03a735eb189276972f4961f288d1f03a
C++
BYOA/MonsterGame
/main.cpp
UTF-8
7,001
3.53125
4
[]
no_license
//Author:BYOA //Program: MonsterGame #include <iostream> #include <stdlib.h> /* srand, rand */ #include <time.h> /* time */ #include "monstergame.hpp" //contains function prototypes, user-defined types and global variables. using namespace std; int main () { srand (time(NULL));/* initialize random...
true
090a02c6e1abb329c1137b1203647acae02074bf
C++
chinann6213/TouristInformationSystem
/Attraction.h
UTF-8
1,350
2.953125
3
[]
no_license
/************************************* Program: Attraction.h Course: OOPDS Year: 2015/16 Trimester 2 Name: NG CHIN ANN ID: 1142701684 Lecture: TC01 Lab: TT03 Email: chinann6213@gmail.com Phone: 011 - 1076 6957 *************************************/ #ifndef ATTRACTION_HPP #define ATTRACTION_HPP #inc...
true
e52d0e56979727623ad5c6634fb989213cf30360
C++
ccl1616/programming-10802
/mid02/hw3/lab03-11413Rational.cpp
UTF-8
2,259
3.75
4
[]
no_license
#include <iostream> //#include "function.h" // include definition of class Rational using namespace std; class Rational { public: Rational( int = 0, int = 1 ); // default constructor Rational addition( const Rational & ) const; // function addition Rational multiplication( const Rational & )...
true
51586e4f43361ea42bb05a7586b0cc67f7b339f9
C++
Arc-Pintade/GraphMaker
/src/function.cpp
UTF-8
626
3.21875
3
[]
no_license
#include "../include/function.hpp" #include <iostream> double Function::factorial(int n){ double foo = 1; if(n > 0) for(int i=1; i<(n+1); i++){ foo *= i; } return foo; } Function::Function(int precision_user){ precision = precision_user; x = std::vector<double>(precisi...
true
0ecc56e9328835be6687141a800296172f64b2b7
C++
M-Schenk-91/forschungsseminar2018
/cpp/processing/datastructures/document.cpp
UTF-8
1,108
2.515625
3
[]
no_license
#include <opencv2/core/types.hpp> #include "document.h" #include "../tracking/TrackableTypes.h" document::document(long id, std::vector<uint8_t> & marker_bits, uint8_t marker_size, std::string const & name, int type) : m_id(id), m_marker_bits(marker_bits), m_marker_size(marker_size), Trackable(TrackableTypes::PHYSICAL...
true
097f46c6ec534d1d8f397e183133e894b17eaf67
C++
justin95214/c-add-add-study
/c++study2/Random.cpp
UTF-8
495
3.1875
3
[]
no_license
#include <iostream> #include "Random.h" using namespace std; Random::Random() { } int Random::nextInRange(int a, int b) { int random = rand(); if (random > b || random < a) { return random % 3 + 2; } else return random; } int Random::nextEvenInRange(int a, int b) { int random = ran...
true
089436af32e2d31a7a3f97050c351ff342c45a20
C++
liqihao2000/VEM_project
/freefunc.cpp
UTF-8
1,613
2.984375
3
[]
no_license
#include "freefunc.hpp" //computes the degrees in the order 00,10,01,20... std::vector<std::array<int,2> > Polynomials(int k) { std::vector<std::array<int,2> > degree; for (int i=0; i<=k; i++) { for (int j=i; j>=0; j--){ degree.push_back(std::array<int,2>{{j,i-j}}); } } return degree; } //gives the GLL we...
true
84548beda728a9f79e0b9af93b67cf462a6094aa
C++
danjr26/game-engine
/Utilities/include/internal/misc.h
UTF-8
3,303
2.640625
3
[]
no_license
#ifndef MISC_H #define MISC_H #include <random> #include <algorithm> #include <fstream> #include <sstream> #include <iostream> #include "windows_misc.h" #include "definitions.h" #define fail() exit(fprintf(stdout, "error @%s:%d\nwin: %s", __FILE__, __LINE__, getWindowsErrorMessage().c_str()) & std::cin.get()) inlin...
true
17b266fdd01a0018d45bbf4fd6975b08cc525d75
C++
euns2ol/algo
/백준/dp/11057/11057/소스.cpp
UTF-8
462
2.515625
3
[]
no_license
#include <iostream> using namespace std; long long arr[1001][10] = { 0 }; int main() { int N; cin >> N; for (int i = 0; i <= 9; i++) arr[1][i] = 1; for (int i = 2; i <= N; i++) { for (int j = 0; j <= 9; j++) { for (int k = j; k <= 9; k++) { arr[i][j] += arr[i-1][k]; arr[i][j] %= 10007; ...
true
cfc3a4c61ec18948b857789bcc24642b953a6441
C++
021800527/C-Review
/5.5.1_BST.cpp
UTF-8
926
3.328125
3
[]
no_license
#include <iostream> using namespace std; typedef struct BSTNode{ int data; struct BSTNode *lchild,*rchild; }BSTNode,*BiTree; /* * 查找 */ BSTNode *BST_Search(BiTree T , int key , BSTNode *&p){ p = NULL; while (T!=NULL && key != T ->data){ p = T; if (key < T ->data) T = T ->lc...
true
45e9dd3c582015248bb4fe2d9a93af094de9066d
C++
SDPoplar/Binaland
/src/config/ConfigPropertyTpl.cpp
UTF-8
3,937
2.515625
3
[]
no_license
#include "ConfigItem.h" #include <boost/algorithm/string.hpp> #include <boost/regex.hpp> #include <iostream> using namespace SeaDrip::Binaland; ConfigPropertyTpl::ConfigPropertyTpl( std::string tpl ) : m_b_well_loaded( false ) { // +f, , class std::string, m_s_input_file, InputFileName, defaultValue std::vect...
true
cc9ce30ba9ad4f9b6928a34dad3b2abaa2d6f913
C++
nathaliandrad/hell_dimension_game
/Game Project/Game Project/IdleGameState.cpp
UTF-8
487
2.5625
3
[]
no_license
#include "IdleGameState.h" #include "Entity.h" IdleGameState::IdleGameState() { } IdleGameState::~IdleGameState() { } void IdleGameState::update(float dt){ idleTimer -= dt; if (idleTimer <= 0){ done = true; } } void IdleGameState::render(){ } bool IdleGameState::onEnter(){ idleTimer = rand() % 20 + 1;//1 -...
true
bb72f97a336d980de7a0188dd45ad77305a74c64
C++
Fox-Rain/C_Plus_Plus
/C++/050 new와 delete 동적할당.cpp
UHC
1,696
3.578125
4
[]
no_license
#include<iostream> using namespace std; int main() { // int var; // var = 7; Ʒ new int ̿ . int *ptr = new int; // new int? osκ ޾ƿ 4bytesũ ޸ ּ *ptr = 7; // ptr de-referenceϿ 7 // int *ptr = new int(7); <<< ̷ ѹ cout << ptr << endl; // os Ҵ (new int) ּҰ µ cout << *ptr << en...
true
fe0dd39f497b8c2db60de0a944edb17ee2a602f0
C++
JMAR-DNY/School_CPlusPlus
/CS121_LABS/Lab 4/Lab 4.cpp
UTF-8
574
3.53125
4
[]
no_license
//*************************** //Jeffrey Marron //CS - 121 //Mr. Mackay //Lab 4 //10/15/2014 //*************************** #include <iostream> #include <string> using namespace std; int main() { int num, remainder; string x, y; cout << "Please input an integer: "; cin >> num; remainder = n...
true
eb8c0f37d59b7d05bc5263ebe34c7b9a79f162b5
C++
twonaja/Lab3-OOP-
/Point.cpp
WINDOWS-1251
1,259
3.703125
4
[]
no_license
#include "Point.h" Point::Point(int x, int y) { this->m_x = x; this->m_y = y; } const Point& Point::operator+=(const Point& rObj) { if (this != &rObj) { this->m_x += rObj.m_x; this->m_y += rObj.m_y; return *this; }// TODO: return return *this; } Point Point::operator+=(const int& tmp) { return Point(...
true
5529086d7b62fe656ff99c3a2d128c209ac4bd1f
C++
Graphics-Physics-Libraries/RenderLibrary
/TFMEngine/src/SceneObject.cpp
UTF-8
1,635
2.625
3
[]
no_license
#include "SceneObject.h" #include "EngineInstance.h" #include "SceneManager.h" namespace RenderLib { SceneObject::SceneObject() : initialized(false), parent(NULL) { transform.object = this; transform.update(); } SceneObject::~SceneObject() { } void SceneObject::initialize() { initializ...
true
1d769e7096c49f76649c6bde7a6c83a4eca7da6e
C++
Caster89/Sql_Data
/mystackedwidget.cpp
UTF-8
1,049
2.75
3
[]
no_license
#include "mystackedwidget.h" #include <QDebug> #include <QVBoxLayout> MyStackedWidget::MyStackedWidget(QWidget * parent, Qt::WindowFlags f) : QWidget(parent, f), curr_index(0) { } int MyStackedWidget::count() { return widgets.count(); } void MyStackedWidget::addWidget(QWidget * w) { ...
true
c00fa471fd6af1a3d76555a27d81b0c9456ace3b
C++
Winterpuma/bmstu_OOP
/lab4/iterator/cameraiterator.cpp
UTF-8
1,042
3.015625
3
[ "MIT" ]
permissive
#include "cameraiterator.h" #include "scene.h" #include <iostream> CameraIterator::CameraIterator() { this->scene = nullptr; this->current_child = std::shared_ptr<ObjectPosition>(nullptr); } CameraIterator::CameraIterator(Scene *_ch) { this->scene = _ch; if (this->scene->cameras.size() > 0) th...
true
ce0c1aa741a351f6b5e855c90d4a29a5d6e36d54
C++
i0r/i0rTech
/OpenGL/FrameBuffer.cpp
UTF-8
8,643
2.515625
3
[ "BSD-3-Clause", "Zlib" ]
permissive
#include "Common.hpp" #include "FrameBuffer.hpp" FrameBuffer::FrameBuffer( const i32 frameWidth, const i32 frameHeight ) : m_Object( 0 ), m_DepthAttachement( { 0, false } ) { m_FrameWidth = frameWidth; m_FrameHeight = frameHeight; ...
true
b7189fe5ae07493473d6e285d6483165ecd7812c
C++
KShaleev/Reports
/main.cpp
WINDOWS-1251
4,949
2.765625
3
[]
no_license
/* " ". , : - ; - ; - ; - ; - . , , XML Windows-1251. . : <parts_list ...> <part .../> <part .../> ... <part .../> </parts_list> "parts_list" - . "root_uid" - . "part" - , . : uid - ; item_id - ; rev_id - ;...
true
e4ad903fe39c8c5d366604d30f7ffced84396122
C++
roneiberlezi/one-real
/map-editor/Source/MapSelection.cpp
UTF-8
1,617
2.921875
3
[]
no_license
// // MapSelection.cpp // Map Editor // // Created by Ronei Berlezi on 27/09/14. // Copyright (c) 2014 Ronei Berlezi. All rights reserved. // #include "MapSelection.h" MapSelection::MapSelection(int tileWidth, int tileHeight){ this->tileHeight = tileHeight; this->tileWidth = tileWidth; } bool MapSelectio...
true
44697c2796217de08485927212e34cd1c3a81af8
C++
cristianfrasineanu/stackplusplus
/app/QuestionModel.cpp
UTF-8
5,545
2.796875
3
[]
no_license
#include "QuestionModel.h" Question QuestionModel::setAfterUserId(int userId) { this->io.seekg(0, this->io.beg); while (this->io.read(reinterpret_cast<char *>(&this->question), sizeof(question))) { if (this->question.user_id == userId) { return this->question; } } throw invalid_argument("Question not fo...
true
8ded8f10ad347879a59eb445de1370f591a32042
C++
yikouniao/basic-surpervised-classifications
/h-k/H-K.cpp
UTF-8
3,121
2.59375
3
[]
no_license
#include "H-K.h" #include <iostream> #include <fstream> namespace HK { using namespace std; using namespace Eigen; void InitDatSet(DatSet& ds, char* f_name) { ifstream f(f_name); if (!f) { cerr << f_name << " could not be opened!\n" << endl; exit(1); } array<double, 2> xy; array<char, 5> c; whil...
true
ad0b0571724f43a52d3df0bc25df9e2960f3b933
C++
sevakon/2nd-semester-ITMO-Cplusplus-labs
/Lab3/methods.cpp
UTF-8
1,177
3.421875
3
[]
no_license
// // methods.cpp // secondSemesterThirdLab // // Copyright © 2019 Vsevolod Konyakhin. All rights reserved. // #include <stdio.h> #include <string> #include "header.h" #include <iostream> using namespace std; Queue::Queue(Queue &q) : queueSize(q.queueSize){ queue = new string[queueSize]; head = 0; tail...
true
67a51aa1cffa4f2eace5ec89a7b6f30871f617ad
C++
DonCastillo/go-fish-mvc
/test/TestDeck.cpp
UTF-8
2,997
3.453125
3
[]
no_license
#include <vector> #include "Deck.h" #include "Card.h" #include "gtest/gtest.h" enum suits { Club, Diamond, Heart, Spade }; enum ranks { Ace = 1, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King }; TEST(TestDeck, createAndClearDeck) { Deck* deck = new Deck(); deck->createD...
true
6f2d9ddca1d18f43d5c5c533afe019f13af305c1
C++
derickfelix/pppucpp_answers
/Part02/11.Customizing-Input-and-Output/ex11.cpp
UTF-8
910
3.875
4
[]
no_license
/* Write a function vector<string> split(const string& s, const string& w) that returns a vector of whitespace-separated substrings from the argument s, where whitespace is defined as "ordinary whitespace" plus the characters in w. */ #include "std_lib_facilities.h" vector<string> split(const string& s, const st...
true
4fca91b71f84f9bc0b46f9265f1d73e9e17bea3b
C++
wang17/nanahan
/map/benchmark.cc
UTF-8
2,606
2.765625
3
[ "CC-PDDC" ]
permissive
#include <boost/chrono.hpp> #include <string> #include <boost/unordered_map.hpp> #include <boost/lexical_cast.hpp> #include <tr1/unordered_map> #include <boost/random.hpp> #include <google/sparse_hash_map> #include <google/dense_hash_map> #include "map.hpp" using namespace boost::chrono; using namespace nanahan; using ...
true
f6eb4b73f858be4862c0733466bb4eaaad881654
C++
prgwiz/lurker-ng
/reg2c/sml/grep.cpp
UTF-8
1,263
2.796875
3
[]
no_license
#define longfn find_url_end #define scanner find_url_starts #include <string> #include <cstdio> #include <cstdlib> using namespace std; extern char* scanner(const char* start, const char* end); extern const char* longfn(const char* start, const char* end); void dump_yes(const char* start, const char* end) { fwrit...
true
c69b0a2bf7976b3f82e498f71b66bbf7775d8062
C++
pmiddend/fcppt
/examples/cast.cpp
UTF-8
888
2.90625
3
[ "BSL-1.0" ]
permissive
// Copyright Carl Philipp Reh 2009 - 2018. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include <fcppt/cast/float_to_int.hpp> #include <fcppt/cast/to_unsigned.hpp> #include <fcppt/confi...
true
78677d511230689e57fe26755f35396a46ab0fc0
C++
kuenzhao/NiukeC-Code
/牛客网在线编程/牛客网在线编程/第二题.cpp
UTF-8
396
3.21875
3
[]
no_license
#include<iostream> #include<string> #include<sstream> using namespace std; int main() { string str; while (cin >> str) { string tmp; for (string::size_type i = 0; i < str.size()-1; i++) { if (str[i] == '0'&&str[i + 1] == 'x') { tmp += str[i + 3]; if (str[i + 2] >= '0'&& str[i + 2] <= '9') { ...
true
fdb8d2225593d5542b11252c196c26571a6f8eb7
C++
hnefatl/Connect4
/Engine/AssetManager_impl.h
UTF-8
3,267
3.203125
3
[]
no_license
#ifndef _ASSETMANAGER_IMPL_H #define _ASSETMANAGER_IMPL_H #include "AssetManager.h" enum UnloadBehaviour { Immediate, OnEmpty, }; template<typename AssetType, typename KeyType, typename SettingsType> AssetManager<AssetType, KeyType, SettingsType>::AssetManager(const std::string &AssetDir, const UnloadBehaviour Beh...
true
5a0a07f3878df572f54fc9a9e71208c37fb19c50
C++
scrottty/CarND-PID-Control-Project
/src/TWIDDLE.cpp
UTF-8
4,157
2.71875
3
[]
no_license
#include "TWIDDLE.h" TWIDDLE::TWIDDLE(double dp[3], double p[3]) : m_step(0), m_pNum(0), m_count(0), m_bestError(0.0), m_currentError(0.0), m_step_initialised(false), TOL(0.005), RESTART_VALUE(4000), ACCUMSTART(100), MIN_MAX_ERROR(80000), m_restartSim(false), m_cte(0.0) { for (int i=0; i<3; i...
true
926f1c91ba1b557551bee75e606b5ed6e20741ab
C++
HarshitShirsat/Zilla-HC
/ACC_FR.CPP
UTF-8
1,326
2.578125
3
[]
no_license
//function which allows the user to either accept or decline the friend request int accept_friend_request() { setfillstyle(SOLID_FILL,LIGHTGRAY); bar(500,400,600,430); bar(500,440,600,470); settextstyle(1,0,1); setcolor(GREEN); outtextxy(510,405,"ACCEPT"); setcolor(RED); outtextxy(510,445,"DECLINE"); restric...
true
e59d04cc73c71f76b34a254aef0a084f41cbab4a
C++
athelare/SourceCode-ACM
/2017-2018s_Summer_Acm/July30-AOJ0525-Osenbei.cpp
UTF-8
869
2.515625
3
[]
no_license
#include<cstdio> #include<iostream> using namespace std; int R,C; int ColCount[10005]; int situ[11][10002]; void solve() { int flip=0,MaxTime=1; bool flipflag[11]; int MaxCount=0; for(int i=0;i<R;++i)MaxTime*=2; for(int flip=0;flip<MaxTime;++flip){ for(int i=0;i<R;++i) flip...
true
ee3b1f32720ada8eec887e3bbdf3dbaa3e6b8552
C++
wangkendy/TiCpp
/ch07/MultiSetWordCount.cpp
UTF-8
776
3.03125
3
[]
no_license
//: C07:MultiSetWordCount.cpp //{L} StreamTokenizer // Count occurrences of words using a multiset #include "StreamTokenizer.h" #include "../require.h" #include <string> #include <set> #include <fstream> #include <iterator> using namespace std; int main(int argc, char* argv[]) { requireArgs(argc, 1); ifstream in(arg...
true
05956ffc833105c71bcdb1ec684e6cd1ee73712e
C++
mboydenko/visualization-of-the-prim-algorithm
/Graph/node.cpp
UTF-8
2,651
2.84375
3
[]
no_license
#include "node.h" #include "arc.h" #include <QPainter> Node::Node(const QSize &sizeNode, const qint32 &borderWidht, QFont &fontNode, qint32 indexNode) : QGraphicsItem(), m_index(indexNode), m_sizeNode(sizeNode), m_font(fontNode), m_borderWidth(borderWidht) { refreshFont();...
true
f68c388bc572d5dd4466a3f5b40364dc1c6980e7
C++
MaSteve/UVA-problems
/UVA12468.cpp
UTF-8
276
2.578125
3
[ "MIT" ]
permissive
#include <iostream> #include <algorithm> using namespace std; int main() { int a, b; while (cin >> a >> b && !(a == -1 && b == -1)) { int c1 = max(a, b) - min(a, b), c2 = min(a, b) + 100 - max(a, b); printf("%d\n", min(c1, c2)); } return 0; }
true
9ad10525ae9bc955cf9d3913641b3bf4c39bd964
C++
pawelwojtowicz/ecuApp
/Src/UCL/CSemaphore.cpp
UTF-8
605
2.828125
3
[]
no_license
#include "CSemaphore.h" #include <sys/types.h> #include <sys/stat.h> #include <sys/fcntl.h> namespace UCL { CSemaphore::CSemaphore() : m_lockHandle(SEM_FAILED) { } CSemaphore::~CSemaphore() { } bool CSemaphore::Initialize(const std::string& semaphoreName, const UInt32 semaphoreCount) { m_lockHandle = sem_open(sem...
true
d36aaa096f9ec68629e2d78cc7e7a7a707d59e37
C++
Back-Log/Competitive-Programming-Algorithms
/Number_of_Subarray_Divisible_by_K.cpp
UTF-8
715
3.25
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int TotalSubarray(int *arr,int n,int k) { int ans=0; int freq[k]={0}; int sum=0; for(int i=0;i<n;i++) { //we are going to mentain the running sum //in case of reminder is negative ,we are adding k to it sum+=((arr[i]%k+k))%k; freq[sum%k]++; } //handl...
true
420adf8756768cf2535309e03e0a452ce0af05bd
C++
lucabello/kangaroo-docs
/common/MessageQueue.h
UTF-8
902
3.078125
3
[ "MIT" ]
permissive
#ifndef MESSAGEQUEUE_H #define MESSAGEQUEUE_H #include <QQueue> #include <QMutex> #include <QWaitCondition> #include "Message.h" /* * Implementation of a thread safe queue. * NEEDS TESTING!! */ class MessageQueue { QQueue<Message> queue; QWaitCondition cv; QMutex mutex; public: MessageQueue(){} ...
true
5fe9a981e6eae4ed263a4823923cdcf8b61d9906
C++
SolidStateSociety-Src/Introduction-to-CPP-Programming
/Lessons/Lesson 4/Lesson 4.1/BasicArrays/BasicArrays/Main.cpp
UTF-8
3,473
4.21875
4
[]
no_license
#include <iostream> #include <string> using namespace std; class BasicArrays { public: /***** Methods for all the arrays *****/ /**** For showing basic array declarations ****/ void basicArrays() { /** ways to declare size of array **/ /* while most languages fill in 0s automatically, C and ...
true
8acb43de5faf8fc87931400f92fa437ddc35bef5
C++
Benshakalaka/DataStructure
/数据结构/226_查找/226_查找表(静态查找)/静态查找/顺序查找/顺序表的查找/head.cpp
UTF-8
2,524
3.53125
4
[]
no_license
#include "head.h" void Create_Seq(SSTable &ST,int n,Elemtype* r) //构建一个含n个数据元素的静态顺序查找表 { int i; ST.elem = (Elemtype *)malloc((n+1)*sizeof(Elemtype)); if(!ST.elem) exit(1); for(i=1;i<=n;i++) ST.elem[i] = r[i-1]; ST.length = n; } void Ascend(SSTable &ST) //重建查找表为按关键字的非降序排序 { //这个...
true