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
347cb22183427c8826fbed5ffec600b811006a5a
C++
winterlich/pandora
/src/prg/path.cpp
UTF-8
9,948
2.796875
3
[ "MIT" ]
permissive
#include <cassert> #include <localPRG.h> #include "prg/path.h" #define assert_msg(x) !(std::cerr << "Assertion failed: " << x << std::endl) uint32_t prg::Path::get_start() const { if (path.size() < 1) return 0; return path.front().start; } uint32_t prg::Path::get_end() const { if (path.size() < ...
true
93d29da8fe0b0ac155050b78283ff401557fbf8c
C++
osumaru/Game
/osumaruEngine/Physics/RigidBodyDraw.h
SHIFT_JIS
1,361
2.65625
3
[]
no_license
#pragma once #pragma once #include "../Graphics/Primitive.h" #include "../Graphics/Shader.h" #include "IRigidBodyDraw.h" struct SRigidBodyVSLayout { CVector4 pos; CVector3 color; }; //̂\NX class CRigidBodyDraw : public IRigidBodyDraw { public: //RXgN^ CRigidBodyDraw(); //fXgN^ ~CRigidBodyDraw() override; //֐...
true
aef0742bd45c5e71f0a6c4765eeab09bda58c1cd
C++
knuu/competitive-programming
/aoj/12/aoj1275_2.cpp
UTF-8
367
2.515625
3
[ "MIT" ]
permissive
#include <bits/stdc++.h> using namespace std; int f(int n, int k) { return n == 1 ? 0 : (f(n-1, k) + k) % n; } int main() { // use scanf in CodeForces! cin.tie(0); ios_base::sync_with_stdio(false); while (1) { int N, K, M; cin >> N >> K >> M; if (N == 0 and K == 0 and M == 0) break; cout << (f(N...
true
250b1379c7cccd22d862b6b5255f810bdd661249
C++
f2006116/fuchsia
/src/developer/debug/zxdb/symbols/variant.h
UTF-8
2,786
2.609375
3
[ "BSD-3-Clause" ]
permissive
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SRC_DEVELOPER_DEBUG_ZXDB_SYMBOLS_VARIANT_H_ #define SRC_DEVELOPER_DEBUG_ZXDB_SYMBOLS_VARIANT_H_ #include <optional> #include <vector> #include "s...
true
2a250278bdb800a5299f86c292b8a41e59f110bd
C++
aelawson/voxel_engine
/include/renderer.hpp
UTF-8
327
2.640625
3
[]
no_license
#include <vector> #pragma once class Renderer { public: Renderer(); ~Renderer(); void renderBlock(GLint x, GLint y, GLint z); private: GLuint _vao; GLuint _vbo; std::vector<GLfloat> _vertices; void assembleBlock(GLfloat x, GLfloat y, GLfloat z); void addVertex(std::vector<GLfloat> verte...
true
d09677e4dcdefa7442491464cb152319032d272f
C++
zRegle/algorithm
/bfs/Coloring a Border.cpp
UTF-8
2,826
3.625
4
[]
no_license
/** * Leetcode 1034. 边框着色 * * 给出一个二维整数网格 grid,网格中的每个值表示该位置处的网格块的颜色。 * 只有当两个网格块的颜色相同,而且在四个方向中任意一个方向上相邻时,它们属于同一连通分量。 * 连通分量的边界是指连通分量中的所有与不在分量中的正方形相邻(四个方向上)的所有正方形, * 或者在网格的边界上(第一行/列或最后一行/列)的所有正方形。 * * 给出位于 (r0, c0) 的网格块和颜色 color, * 使用指定颜色 color 为所给网格块的连通分量的边界进行着色,并返回最终的网格 grid 。 * * 示例 1: * 输入:grid = [[1,1],[...
true
9f4213aa05ea69b6c66e9d5a0e8fa085582d98f9
C++
xingyingone/algorithm
/树/判断完全二叉树/a.cpp
GB18030
1,975
3.78125
4
[]
no_license
#include<iostream> #include<vector> #include<stack> #include<queue> using namespace std; // struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } }; typedef TreeNode *BiTree; //д int CreateBiTree(BiTree &T) { int dat...
true
db9f79ff540d49b9851e545b9bc70e4fc8c433de
C++
trunghe/EOlymp
/668_BusesAndAirplanes_Graph.cpp
UTF-8
2,758
2.796875
3
[]
no_license
/* * https://www.e-olymp.com/en/problems/668 * Category: Graph * Solution: Dijkstra */ #include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef pair<int, pii> ipii; #define FOR(i, a, b) \ for (int i = (a); i < (b); i++) #define FORE(i, a, b) \ for (int i = (a); i <= (b); i++) #def...
true
2d9ff277d75f06c6ca0132c14491bc9df29df7e3
C++
Lookyan/algos
/Treap/main.cpp
UTF-8
3,275
3.46875
3
[]
no_license
#include <iostream> using namespace std; template <class T> struct CNode { CNode(): key(0), left(0), right(0) {} CNode(T& k): key(k), left(0), right(0) {} T key; CNode* left; CNode* right; }; template <class T> class Tree { public: Tree(): root(0) {} ~Tree(); void Add(T& val); voi...
true
0594ae2edc995fbb4ad37698886d54fb4d7c78b4
C++
mauriciocele/arap-sr-linearized
/src/HalfEdge/Mesh.cpp
UTF-8
11,054
2.984375
3
[ "MIT" ]
permissive
/** \file Mesh.cpp Definitions for the Mesh class. \author Liliya Kharevych \date March 2006 */ #include "Mesh.h" #include <iostream> #include <fstream> #include "util.h" #include <stack> #include <iomanip> #include <algorithm> #include <map> #include <vector> #include <assert.h> using namespace std; Mesh::M...
true
d1dda45944dd230f9fe692b743850aa846b70a06
C++
AndresMontenegroArguello/UTC
/2020/Programación I/Programas/Tareas/Tarea 1/Programas/Ejercicio 05/Tarea01_Ejercicio05_Windows.cpp
UTF-8
3,798
3.453125
3
[]
no_license
// Tarea01_Ejercicio05_Windows.cpp // Tarea 01: Ejercicio 05 // Cálculo de Operaciones + Mayor/Menor // Desarrollado por: Andrés Montenegro // https://www.amsoftware.co // https://www.andresmontenegro.co // Plataforma: Windows // Bibliotecas #include <stdio.h> #include <stdlib.h> //#include <curses.h> // Utilizo la bi...
true
8959c7991da28b9bd65e0336679f8c147648b6d0
C++
RenatoBrittoAraujo/Competitive-Programming
/URI-Online-Judge/2235.cpp
UTF-8
313
2.90625
3
[]
no_license
#include <iostream> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; bool s=false; if(a==b||a==c||b==c)s=true; else{ if(c>b){int t=c;c=b;b=t;} if(b>a){int t=a;a=b;b=t;} if(a==b+c)s=true; } if(s)cout << "S\n"; else cout << "N\n"; return 0; }
true
702e0ff216b55b78533ada7fbec93bec1d98217f
C++
KrKush23/LeetCode
/Problems/0303. Range Sum Query - Immutable.cpp
UTF-8
472
3.171875
3
[ "MIT" ]
permissive
class NumArray { vector<int> preSum{}; public: NumArray(vector<int>& nums) { int n = nums.size(); preSum.resize(n+1); for(int i=0;i<n;i++){ preSum[i+1] = preSum[i] + nums[i]; } } int sumRange(int i, int j) { return preSum[j+1] - preSum[i]; } }...
true
0fc7ba0b15bc9527bad733627c761f0c10512948
C++
Cnd96/comp
/travelling.cpp
UTF-8
3,853
3.71875
4
[]
no_license
#include "bits/stdc++.h" using namespace std; int noCities; // integer variable to for number of cities int mindis = INT_MAX; //minimum distance (answer) initialized by maximum integer value bool visited[10000];// boolean array to check the visited nodes in the graph int randomNumber;//integer variable hold random num...
true
54f0a19d1b35735c965cfe4e6c7207ab6d15d12a
C++
fotopretty/SIM900-lib
/SIM900.h
UTF-8
8,410
2.890625
3
[ "MIT" ]
permissive
/** SIM900 Basic communication library for SIM900 gsm module. * * This library provide easy way to make GET and POST petitions to a web server. Use to interactue Arduino with restful apis, webs, etc. * * Released under MIT license. * * @author Miquel Vento (http://www.emevento.com) * @version 1.0 24/03...
true
399fbcba274d8ed86bb65722a30a42973c318d3d
C++
david990917/CPP-PROGRAMMING
/Textbook/Chapter5/顺序查找.cpp
UTF-8
269
2.953125
3
[]
no_license
#include<iostream> using namespace std; int main() { int idx, x=5; int array[] = { 2,3,1,7,5,8,9,0,4,6 }; for (idx = 0; idx < 10; idx++) { if (x == array[idx]) { cout << idx; break; } } if (idx == 10) { cout << "Not Found!" << endl; } return 0; }
true
e945a2596a5c7bd925a6392bdd6745490c60c41a
C++
skynet29/rpi
/utils/src/DThread.cpp
UTF-8
1,056
3.03125
3
[]
no_license
#include "DThread.h" #include "DTimer.h" #include <unistd.h> DThread::DThread() { handler = NULL; arg =NULL; } void DThread::SetCallback(ThreadHandler handler, void* arg) { this->handler = handler; this->arg = arg; } bool DThread::Start() { return (pthread_create(&desc, NULL, Handler, this) == 0); } v...
true
50bfb71f2438e80ea0f689695835ecf31e9f8f53
C++
richardcypher/leetcode
/120/main.cpp
UTF-8
997
3.203125
3
[]
no_license
#include <iostream> #include <vector> using namespace std; int minimumTotal(vector<vector<int> >& triangle) { if(triangle.empty()) return 0; vector<int> sum(triangle.size(), 0); sum[0] = triangle[0][0]; for (int i = 1; i < triangle.size(); ++i) { for (int j = triangle[i - 1].size()...
true
c04187a6aa2e5a9d3aa7e93a5046dd96480e5252
C++
johnsna7/162_FinalProject
/Game.hpp
UTF-8
2,804
3.640625
4
[]
no_license
/************************************************** * File Name: Game.hpp * Author: Nathan Johnson * Date: 06.09.2019 * Description: Creates and plays the game * ************************************************/ #ifndef GAME_HPP #define GAME_HPP #include "Player.hpp" #include "Room.hpp" #include "menu.hpp" #incl...
true
777be928cb6821479ed81ef59669daf7d309f3dd
C++
weakmale/hhabb
/HDU/1234/6491786_WA_0ms_0kB.cpp
UTF-8
832
2.609375
3
[]
no_license
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct node{ char id[20]; int h[2]; int m[2]; int s[2]; }stu[1111]; bool cmp(node a,node b){ if(a.h[0]!=b.h[0]) return a.h[0]<b.h[0]; if(a.m[0]!=b.m[0]) return a.m[0]<b.m[0]; if(a.s[0]<b.s[0]) return a.s[0]<b.s[0]; } bool cmp1(node...
true
7322155bfc90118283b461a444f7a8bc861b5949
C++
alexandraback/datacollection
/solutions_5769900270288896_0/C++/Pufforrohk/Bric.cpp
UTF-8
893
2.734375
3
[]
no_license
#include <iostream> #include <algorithm> #include <cassert> using namespace std; int N,R,C; int arr[17][17]; int count(){ int c=0; int b=0; for(int i=0;i<R;i++){ for(int j=0;j<C;j++){ if(arr[i][j]==1){ c++; if(arr[i+1][j]==1) b++; if(arr[i][j+1]==1) b++; } } } if(c==N) return...
true
56960ea2a9d2e4b7161c94fa89153450f39b7a08
C++
whing123/C-Coding
/Others/35.cpp
UTF-8
535
2.796875
3
[]
no_license
/* 聚力与攻击 */ #include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int main() { int hp, normal, buffer; cin >> hp >> normal >> buffer; vector<int> dp(hp + 1, 0); for (int i = 1; i <= hp; i++) { if (i - normal >= 0 && i - buffer >= 0) dp[i] = min(dp[i - normal] +...
true
08a2eac26ddc5ecfd17cfd93408dc2c7c59bdf31
C++
Futsy/Euler
/Problem - 001 to 050/Problem - 029.cpp
UTF-8
345
3.21875
3
[]
no_license
#include <iostream> #include <cmath> #include <set> int main () { std::set<double> powers; for (int i = 2; i <= 100; i++) { for (int j = 2; j <= 100; j++) { powers.insert(std::pow(i,j)); } } //Sorting doesn't change anything std::cout << "Solution: " << powe...
true
202494eacbb694c2633abfd544f310b05e856c01
C++
ribak100/ATM-emulator-system-with-C-
/Exception.cpp
UTF-8
1,394
3.359375
3
[]
no_license
/* #include "Exception.h" #include <iostream> using namespace std; NegativeNum::NegativeNum(){} NegativeNum::NegativeNum(int negativeNum) :negative(negativeNum){} NegativeNum::get_negative() { return negative; } TooFewNum::TooFewNum(){} TooFewNum::TooFewNum(int fewNum) : few(fewNum){} TooFewNum::get_few() {...
true
be39e1160ef64d8eaf1e40a93db2e59151fe0d4c
C++
cotecsz/WayofOffer
/4_队列/4-1_stl_queue_basic_op.cpp
UTF-8
818
3.671875
4
[]
no_license
// // Created by Yang Shuangzhen on 2020/7/17. // #include <iostream> #include <queue> using namespace std; /* * STL Queue 基本操作 * 1. Q.empty() 队列是否为空 * 2. Q.front() 队列队首 * 3. Q.back() 队列队尾 * 4. Q.push(x) 将元素x 添加至队尾 * 5. Q.pop() 弹出队首 * 6. Q.size() 队列长度 * */ ...
true
861ff7b8275a9dc85c31e41608b6d33740981ed1
C++
MusubiKamishiro/QuickHitShooting
/StageEditer/TestLoader/Target/TargetPosition.cpp
SHIFT_JIS
3,731
2.546875
3
[]
no_license
#include <cmath> #include "TargetPosition.h" #include "TargetType.h" TargetPosition::TargetPosition() : _alphaMax(256) { _alpha = 0; } TargetPosition::~TargetPosition() { } void TargetPosition::Update(int& wCnt, int& tCnt, const unique_input& input, std::vector<vec_target>& stageData) { if (input->IsTrigger(KEY_IN...
true
9520b54044bd4392cf6975e77737c2a01674f6c1
C++
araluce/Proyecto_Imagenes
/src/negativo.cpp
UTF-8
883
3.28125
3
[]
no_license
/** * @file negativo.cpp * @brief Fichero principal que se ocupa de recoger información para cambiar una imagen a negativo * * Permite pasar a negativo imágenes de tipo PGM * */ #include <iostream> #include <stdlib.h> #include "imagen.h" #include "transformar.h" using namespace std; int main( int argc, c...
true
4d78ddc178e528ba5ce1002e3fc988ff5e0c56fb
C++
tycho/crisscross
/source/crisscross/compare.h
UTF-8
1,898
2.953125
3
[]
no_license
/* * CrissCross * A multi-purpose cross-platform library. * * A product of Uplink Laboratories. * * (c) 2006-2022 Steven Noonan. * Licensed under the New BSD License. * */ #ifndef __included_cc_compare_h #define __included_cc_compare_h #include <crisscross/cc_attr.h> #include <crisscross/debug.h> ...
true
e0724be82143872f5776b42add611137178c078e
C++
leomaurodesenv/contest-codes
/contests/uri/uri-1129.cpp
UTF-8
1,163
2.765625
3
[ "MIT" ]
permissive
#include <stdlib.h> #include <stdio.h> using namespace std; int main(int argc, char *argv[]) { int a[5]; int n, resp, error; char r[6] = {'A', 'B', 'C', 'D', 'E', '*'}; // <= 127 preto // > 127 branco while(1){ scanf("%d", &n); if(n == 0) break; ...
true
f9a1a9f4757d00b1184670eec7c24ec1ef529eb8
C++
ymahinc/MyTypon
/sources/layers/movelayerundocommand.cpp
UTF-8
637
2.78125
3
[]
no_license
#include "movelayerundocommand.h" #include <QDebug> MoveLayerUndoCommand::MoveLayerUndoCommand(LayersStack *stack, Layer *layer, bool up) : m_stack(stack), m_layer(layer), m_up(up){ if ( up ) setText(QObject::tr("Move %1 layer up").arg(layer->name())); else setText(QObject::tr("Move %1 lay...
true
635da031b36d1d6644928826c0204e25911673d3
C++
aman1228/LeetCode
/Algorithms/split-array-with-equal-sum.cpp
UTF-8
1,658
3.703125
4
[]
no_license
// 548. Split Array with Equal Sum // https://leetcode.com/problems/split-array-with-equal-sum/ /* Given an array with n integers, you need to find if there are triplets (i, j, k) which satisfies following conditions: 0 < i, i + 1 < j, j + 1 < k < n - 1 Sum of subarrays (0, i - 1), (i + 1, j - 1), (j + 1, k - 1) and ...
true
b57c18d594dd722681a080ab99ec802432733492
C++
JoanK11/FIB-PRO1-Programacio-I
/X50401_en-Null_triplets.cc
UTF-8
547
3.03125
3
[]
no_license
#include <iostream> using namespace std; int main() { int n, total = 0; cin >> n; for (int i = 0; i < n; ++i) { // Nombre de casos int times, last, previous, next, counter = 0; cin >> times >> last >> previous; for (int j = 2; j < times; ++j) { // Nombres per cada cas ...
true
8c5b4404fac51431bb797aec7251c6216852063c
C++
chrzhang/abc
/geometry/rectangleArea/main.cpp
UTF-8
984
3.6875
4
[]
no_license
#include <iostream> #include <cassert> #include <algorithm> // Find the combined area of two rectangles // The lower left of the first rectangle is at (A,B), the upper right at (C,D) // The lower left of the other rectangle is at (E,F), the upper right at (G,H) int computeArea(int A, int B, int C, int D, int E, int F...
true
8c8658084de83e04b72bbe56cba5d863aefbbea8
C++
theanarkh/read-just-0.1.4-code
/modules/encode/encode.cc
UTF-8
8,749
2.671875
3
[ "MIT" ]
permissive
#include "encode.h" size_t just::encode::hex_decode(char* buf, size_t len, const char* src, const size_t srcLen) { size_t i; for (i = 0; i < len && i * 2 + 1 < srcLen; ++i) { unsigned a = unhex(src[i * 2 + 0]); unsigned b = unhex(sr...
true
cfd97e75e32620b16e15896778130ff3cf73f425
C++
NicoAcosta/utn-ayed
/1er-cuatrimestre/ejercicios/33 MCD/33 MCD/main.cpp
UTF-8
729
3.375
3
[]
no_license
// // main.cpp // 33 MCD // // Created by Nico on 12/06/2019. // Copyright © 2019 Nicolás Acosta. All rights reserved. // #include <iostream> using namespace std; int mcd(int a, int b) { int r; while (1 == 1) { r = a%b; if (!r) { return b; } ...
true
8b810d1110a89569313e71c8ce49b2191453b4b1
C++
studentstuff/rendercore
/Render.cpp
UTF-8
786
2.59375
3
[]
no_license
#include "Render.h" namespace Render { void RenderQueue::PushRenderObj(RenderObject* robj, glm::mat4 viewProjMat) { // TMP : hardcoded GatherRenderOps RenderOp rop = robj->rop; rop.MVP = viewProjMat*robj->frame.modelMatrix; rop.vertexArray = robj->vertexarray; rop.program = robj->program; renderOps.push...
true
4c5f39e8193a201386af754fedb97b7dd57e55e5
C++
clover7kso/Woony-s-Algorithm-WorkSpace
/7193. 승현이의 수학공부/7193. 승현이의 수학공부/main.cpp
UTF-8
377
2.59375
3
[]
no_license
#include <iostream> #include <string> using namespace std; int main(void) { int testCase; cin >> testCase; for (int t = 0; t < testCase; t++) { long long N; string X; cin >> N; cin >> X; long long result = 0; for (int i = 0; i < X.length(); i++) result += (X.at(i) - 48); result = result % (N - 1...
true
7b8380fb7ca55d5b22f1f32b390ea983005b7898
C++
TheLurkingCat/TIOJ
/1544.cpp
UTF-8
506
3.21875
3
[ "MIT" ]
permissive
#include <iostream> #include <string> using namespace std; int main() { string str1, str2; int t; cin >> t; while (t--) { cin >> str1 >> str2; if (str1.length() > str2.length()) { cout << "0\n"; } else if (str1.length() < str2.length()) { cout << "1\n"; ...
true
e3679884f3d8a2fd8ee998adbfb243024c10de9d
C++
chandl34/public
/personal/c++/TacticsEditor/LevelMap.h
UTF-8
2,730
2.546875
3
[]
no_license
/* * LevelMap.h * Pirate Tactics * * Created by Jonathan Chandler on 2/18/10. * Copyright 2010 __MyCompanyName__. All rights reserved. * */ #ifndef LEVEL_MAP_H_ #define LEVEL_MAP_H_ #include "Screen.h" #include "Camera.h" #include "BlockCursor.h" #include "Object.h" class GridBlock; class LevelMap : pu...
true
ced97d5f56e6cfcaa7cede7607058a01b98a3cba
C++
ComputerScience1-Period-2/program-problem-1-taileanguyen
/displaytext/displaytext/Source.cpp
UTF-8
767
3.40625
3
[]
no_license
/* Tailea Nguyen-9/21/17 2nd Assignment Name: Display Text Introdution into C++ IDE Visual Studios 2015 Create New Project and Display Text to Console */ // Libraries #include <iostream> //* gives access to cin, cout, endl, <<, >>, boolalpha, noboolalpha #include <conio.h> //* gives access to _kbhit() fo...
true
f3369c6108710c5832091a2906453da67e0ff209
C++
BreakEngine/Break-0.0
/inc/Transform.h
UTF-8
1,216
3
3
[]
no_license
#pragma once #include <glm/glm.hpp> #include <glm/gtc/quaternion.hpp> #include "GlobalDefinitions.h" namespace Break { namespace Graphics { /** * \brief reperesents a transformation matrix of an object * \author Moustapha Saad */ class BREAK_API_EX Transform { protected: ///transformation matrix...
true
e7211c0756d4e0deade3ea3d51d3442294bf14b1
C++
KieranWebber/ROS-Instinct
/ros_instinct_core/include/ros_instinct_core/planner_utility.h
UTF-8
2,638
3
3
[ "MIT" ]
permissive
#pragma once #include <instinct/Instinct.h> #include <iosfwd> #include <sstream> /** * Static utility functions to aid with the operation of the Instinct Planner */ class PlannerUtility { private: /** * Basic alias for string startsWith * * @param line String to check against * @param star...
true
8f18f1ad8967635cd42da72caac0edf6a840dbdc
C++
Jinsab/Forest
/숫자 합치기.cpp
UTF-8
329
2.84375
3
[]
no_license
#include <stdio.h> int i, n, arr[1000], *p, sum, x=1, t=0; input() { p=arr; scanf("%d", &n); for(i=1; i<=n; i++) { scanf("%d", p+i); t++; } } process() { for(i=1; i<=n; i++) { sum += *(p+t)*x; x = x*10; t--; } } output() { printf("%d", sum); } main() { input(); process(); output(); ret...
true
15d71c44ea94218b953b78f1c2d9e63a597c2efd
C++
foxostro/PinkTopaz
/src/include/Renderer/OpenGL/CommandQueue.hpp
UTF-8
2,121
3.234375
3
[ "MIT" ]
permissive
// // CommandQueue.hpp // PinkTopaz // // Created by Andrew Fox on 2/24/17. // // #ifndef CommandQueue_hpp #define CommandQueue_hpp #include "Renderer/OpenGL/OpenGLException.hpp" #include <vector> #include <mutex> #include <thread> #include <string> #include <functional> #include <spdlog/spdlog.h> // Exception ...
true
3cb256512cfa67375e7fdc428411fe79bb07df91
C++
Raymenes/Rui_Zeng_Portfolio
/Tower_Defense/TowerDefense/Source/CannonTower.cpp
UTF-8
1,026
2.515625
3
[]
no_license
// // CannonTower.cpp // Game-mac // // Created by Rui Zeng on 10/3/15. // Copyright © 2015 Sanjay Madhav. All rights reserved. // #include "CannonTower.hpp" #include "Game.h" #include "Math.h" #include "CannonBall.hpp" IMPL_ACTOR(CannonTower, Tower); CannonTower::CannonTower(Game& game) :Tower(game) { auto ...
true
1084148d1d3112e144f072ce05df63593f80662b
C++
serge-sans-paille/pythran
/pythran/pythonic/numpy/atleast_3d.hpp
UTF-8
2,583
2.84375
3
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
#ifndef PYTHONIC_NUMPY_ATLEAST3D_HPP #define PYTHONIC_NUMPY_ATLEAST3D_HPP #include "pythonic/include/numpy/atleast_3d.hpp" #include "pythonic/numpy/asarray.hpp" PYTHONIC_NS_BEGIN namespace numpy { template <class T> typename std::enable_if< types::is_dtype<T>::value, types::ndarray<T, types::pshape<...
true
9b370d2c99df556e102778e48c92d0d49f8d96d0
C++
boulayb/-EPITECH-2-Plazza
/includes/Log.hpp
UTF-8
238
2.5625
3
[]
no_license
#ifndef LOG_HPP #define LOG_HPP #include <string> #include <fstream> class Log { public: Log(std::string const &pathToFile); ~Log(); void writeToFile(std::string const &line); private: std::fstream _file; }; #endif
true
31b234a0ce90130ddd8f328a88f5ed4810af057a
C++
bluddy/K3-Core
/runtime/cpp/dataspace/SortedDS.hpp
UTF-8
3,031
2.953125
3
[]
no_license
#include <set> #include <algorithm> namespace K3 { template <typename Elem> class SortedDS : public StlDS<Elem, std::multiset> { // Iterator Types typedef typename std::multiset<Elem>::iterator iterator_type; typedef typename std::multiset<Elem>::const_iterator const_iterator_type; public: SortedDS(Engin...
true
a5d30ad83be1ec16a5815ea1f2275e0257957cb3
C++
0x3337/iitu-contester
/problems/week-11/1105.cpp
UTF-8
324
3.046875
3
[]
no_license
#include <iostream> #include <algorithm> #include <string> using namespace std; int main() { string str; getline(cin, str); str.erase(unique(str.begin(), str.end()), str.end()); if(str[0] == ' ') str.erase(str.begin()); if(str[str.length() - 1] == ' ') str.erase(str.end() - 1); cout << str << '\n'; return ...
true
a7b6c645c076ccf24ae5ec25a7465e194b01d0c5
C++
vincentlai97/SP2-11
/Application/Source/MySceneInitCollisionBox.cpp
UTF-8
2,942
2.640625
3
[]
no_license
#include "MyScene.h" void MyScene::InitCollisionBox() { CollisionBox* collisionBox; //Exterior Hitbox collisionBox = new CollisionBox(Vector3(0, -0.5, 400), 1800, 1, 1800); //Bottom v.push_back(collisionBox); collisionBox = new CollisionBox(Vector3(0, 500, 1000), 200, 200, 200); //Front v.push_back(collisionBo...
true
bef7bb1dd0d1d4667756642ad74a2726a61911fb
C++
kberba/zoo-tycoon
/Penguin.hpp
UTF-8
1,013
3.28125
3
[]
no_license
/********************************************************************* ** Author: Karen Berba ** Date: 1/27/19 ** Description: Header for Penguin class Inherits from Animal class. Has a default constructor and a custom constructor that takes in an integer age. NOTES: - Penguin cost $1,000 - Penguins have 5 babies - ...
true
517c1d49ec62367e68425d461c5454146058b697
C++
phoenixGit228/cpp
/cpp_primer_plus_6th/chapter04/p4-13-1.cpp
UTF-8
839
3.421875
3
[]
no_license
// /////////////////////////////////////////////////////// // 名称: 4.13.cpp // 描述: // 日期: 2021-06-17 09:27:27 // /////////////////////////////////////////////////////// #include <iostream> #include <string> int main() { using namespace std; cout << "What is your fist name? "; const int ArSize = 8...
true
c22bc566af550399b4b1d7ef95ff1e8d61c1acbc
C++
hclife/code-base
/lang/cpp/vtable1.cpp
UTF-8
1,548
3.578125
4
[]
no_license
#include <iostream> #include <cstdio> typedef void (*fun_pointer)(void); using namespace std; class Test { public: Test() { cout<<"Test()."<<endl; } virtual void print() { cout<<"Test::Virtual void print1()."<<endl; } virtual void print2() { cout<<"Test::virtual void print2()."<<endl; } }; class TestDrive...
true
9ebcdb11275e185bc00031c774f4758c8e965faa
C++
baepiff/checkersLite
/CheckersLite/Game.cpp
UTF-8
1,620
3.171875
3
[]
no_license
#include "stdafx.h" #include "Game.h" Game::Game(void) { this->currentPlayerColor = PIECE_COLOR::BLACK; this->ended = false; this->view = ViewFactory::createView(VIEW_TYPE::CONSOLE_VIEW); this->io = IOFactory::createIO(IO_TYPE::CONSOLE_IO); this->blackPlayer = PlayerFactory::createPlayer(PLAYER_TYPE::COMPUTER, t...
true
55f12dc53937b03def1c62127757aef4c2809696
C++
Breush/lava
/examples/sill/vr-sandbox.cpp
UTF-8
3,454
2.859375
3
[ "MIT" ]
permissive
/** * Shows the different integrated meshes. */ #include "./ashe.hpp" using namespace lava; int main(void) { ashe::Application app; auto& engine = app.engine(); // Ground { auto& entity = engine.make<sill::Entity>(); auto& meshComponent = entity.make<sill::MeshComponent>(); ...
true
c57eab52a75c026ec63242b8fbd725f3c48d2ad5
C++
AVGP/wii-spaaace
/source/alien.cpp
UTF-8
1,533
2.59375
3
[ "MIT" ]
permissive
#include "alien.h" Alien::Alien(wsp::Image *img) { SetImage(img); DefineCollisionRectangle(28, 14, 42, 55); resetMotion(); resetPosition(); resetShotCountdown(); } void Alien::setShots(Shot **shots, unsigned int numberOfShots, bool isOwn) { if(isOwn) { ownShots = shots; numOwnShots = numberOfShots; } else ...
true
bfea5f9d3c1fa1b540ab5dee2d9b106136784df7
C++
AMarchionna/Metodos-TP2
/src/knn.cpp
UTF-8
1,673
3.0625
3
[]
no_license
#include <algorithm> //#include <chrono> #include <iostream> #include <vector> #include "knn.h" #include "time.h" using namespace std; KNNClassifier::KNNClassifier(unsigned int n_neighbors) { cout << "Clasificador inicializado con k=" << n_neighbors << "..." << endl; neighbors = n_neighbors; } void KNNClassifier:...
true
21cb1bb88d3609fc10fd65e77182b54bd5bf5552
C++
mbuszka/university_mia
/alfabet.cpp
UTF-8
588
2.75
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> char word[55]; int max (int *lis, int idx) { int t = 0; for (int i = 0; i < idx; i ++) { t = t < lis[i] ? lis[i] : t; } return t; } int main () { int r = scanf("%s", word); int n = strlen(word); int *lis = (int *) calloc(26, sizeof(int)); ...
true
c9345ecf3b927c4e5fabf6106870139cde944678
C++
LaurenRolan/Cpp
/TP4/include/Lanceur.h
UTF-8
359
2.796875
3
[]
no_license
/* Author: Lauren Sampaio * File: Lanceur.h */ #ifndef LANCEUR_H #define LANCEUR_H #include <iostream> #include "Obstacle.h" using namespace std; class Lanceur { private: Obstacle * _premier; public: Lanceur( Obstacle *premier ); Lanceur( ); ~Lanceur(); void lancer( int place ); void setPremier( Obstacle *pre...
true
18ddf5ba9dbf0a7edc272db651a494ecf071a3a7
C++
razmik1996/JustExercises
/AbstractEmployeePolimorph/AbstractEmployeePolimorph/Employee.h
UTF-8
521
3.140625
3
[]
no_license
#pragma once #ifndef EMPLOYEE_H #define EMPLOYEE_H #include <string> using std::string; class Employee { public: Employee(const string&, const string&, const string&); void setFirstName(const string&); string getFirstName() const; void setLastName(const string&); string getLastName() const; void setSSN(const...
true
ab9730a01cf3480429f87a57ed3b04483a7dbb69
C++
thirtiseven/projecteuler
/104.cc
UTF-8
898
2.75
3
[ "MIT" ]
permissive
#include <iostream> #include <algorithm> #include <string> const int maxn = 1e7; bool is_pandigital(int x) { std::string s = std::to_string(x); // std::cout << "int " << x << '\n'; std::sort(s.begin(), s.end()); if (s == "123456789") { return true; } return false; } int f_last[maxn]; long long f_first[maxn]; ...
true
676c50ddc7064fae76b9ba2cc51e70e67c7dc513
C++
ayyzenn/CL118_Programming-Fundamentals---Lab
/Lab_Tasks/6(2)/Question7.cpp
UTF-8
422
3.34375
3
[]
no_license
#include <iostream> using namespace std; int main() { int num1 = 0; int num2 = 0; int num3 = 0; //////////// cout<<"Enter three numbers!"<<endl; //////////// cout<<"Enter first number: "; cin>>num1; cout<<"Enter second number: "; cin>>num2; cout<<"Enter third...
true
25db4ac523807f00199026aca76163a677080b27
C++
ntornqvi/SailingBoat
/src/logger.cc
UTF-8
1,113
2.796875
3
[ "MIT" ]
permissive
#include <cstdio> #include <string> #include "../include/logger.h" #include "../include/io.h" Logger::Logger(std::string path) { file_path_ = path; remove(path.c_str()); } void Logger::LogData(Log packet) { log_.entry_id = packet.entry_id; log_.latitude = packet.latitude; log_.longitude = packet.longitude; ...
true
58f81175ba74a9b213ac05a606e2587b7688ba21
C++
tardate/LittleArduinoProjects
/playground/Audio/SimpleSamplePlayer/SimpleSamplePlayer.ino
UTF-8
1,200
2.625
3
[ "MIT" ]
permissive
/* Audio/SimpleSamplePlayer Playing short audio samples on an Arduino using some PWM tricks from the PCM library. For info and circuit diagrams see https://github.com/tardate/LittleArduinoProjects/tree/master/playground/Audio/SimpleSamplePlayer */ #include <PCM.h> /* include one (and only one) sample defini...
true
82a3b636fd77f0a6f83663c109a324946b227a63
C++
ken-pang/TeachingTools
/mindmap/mindbaseview.cpp
UTF-8
310
2.53125
3
[]
no_license
#include "mindbaseview.h" #include "mindnodeview.h" void MindBaseView::setParent(MindNodeView *parent) { parent_ = parent; } bool MindBaseView::hasParent(MindNodeView * parent) const { MindNodeView * p = parent_; while (p && p != parent) { p = p->parent_; } return p == parent; }
true
3d8136c42d2d561f3cff61c204b3594a032911f1
C++
cllx/Undergraduate-course
/数据结构/栈和队列/04+栈和队列/4-1/algo3-2.cpp
GB18030
1,171
3.75
4
[]
no_license
#include <stdio.h> #include <malloc.h> typedef char ElemType; typedef struct linknode { ElemType data; // struct linknode *next; //ָ } LiStack; void InitStack(LiStack *&s) //ʼջs { s=(LiStack *)malloc(sizeof(LiStack)); s->next=NULL; } void DestroyStack(LiStack *&s) //ջ { LiStack *p=s,*q=s->next; w...
true
bbddb284d952103fb3e2d763d34af8b84dc3e95d
C++
hl0071/cloudyclouds
/cloudyclouds/Camera.cpp
UTF-8
1,338
2.875
3
[]
no_license
#include "stdafx.h" #include "Camera.h" const float Camera::rotSpeed = 0.01f; const float Camera::moveSpeed = 16.0f; Camera::Camera() : lastMousePosX(0), lastMousePosY(0), rotX(0.0f), rotY(0.0f), cameraPosition(2.f) { } Camera::~Camera() { } void Camera::update(float timeSinceLastFrame) { int newMousePosX, ne...
true
08e8184e9ef1c6fc6709979406d6d5d9ace69f1f
C++
alisw/AliRoot
/TEvtGen/Tauola/TauolaHEPEVTParticle.cxx
UTF-8
7,904
2.78125
3
[]
permissive
#include "TauolaHEPEVTParticle.h" #include "TauolaLog.h" namespace Tauolapp { TauolaHEPEVTParticle::~TauolaHEPEVTParticle() { // Cleanup particles that do not belong to event for(unsigned int i=0;i<cache.size();i++) if(cache[i]->m_barcode<0) delete cache[i]; } TauolaHEPEVTParticle::TauolaHEPEVTParticl...
true
bdf2b9bf95e8f7cf38ff4d3315f8b2370511d788
C++
Altudy/solutionheejoon
/number_counting_project/strategy.cpp
UTF-8
9,678
2.859375
3
[]
no_license
#include <iostream> #include <vector> #include <math.h> #include "strategy.h" using namespace std; strategy::strategy() : target_num(0), target(NULL), rcv_num(0), snd_num(0), added(0), gap(0), chance(false) {} // constructor // 모든 값을 0으로 만든다. void strategy::readTarget(int num, int* ptrTarget) { target = ...
true
76cde7745b9832d6bd8dd4b1d334d86dc6f13cde
C++
deepakdpyqaz/competitiveprogramming
/pascaltriangle.cpp
UTF-8
756
3.953125
4
[]
no_license
/* Given an integer N, print Pascal Triangle upto N rows. Input Format Single integer N. Constraints N <= 10 Output Format Print pascal triangle. Sample Input 4 Sample Output 1 1 1 1 2 1 1 3 3 1 */ #include <iostream> using namespace std; int factorial(int n) { int i...
true
70415f7919c1a3e461c0047300d97e07f4c4c28a
C++
ibanknatoPrad/ferriswheel
/ferriswheel.cpp
UTF-8
11,693
2.5625
3
[]
no_license
/* * ferriswheel.cpp * * Implementation of a ferris wheel that rotates about its pivot. * Includes lighting. * * Author: Luke Lovett * Began: Tue Oct 30 17:09:04 EDT 2012 * * */ #include <GL/glut.h> #include <GL/glui.h> #include <math.h> #include "ferriswheel.h" /* constants */ #define PI 3.1415926535 #defin...
true
d11e83d7dff654ae9d8c656ef5f27693b155aad8
C++
Anik-Modak/CompetitiveProgramming
/OthersAll/Euclid's Extended Algorithm.cpp
UTF-8
476
3.640625
4
[]
no_license
#include <iostream> int xGCD(int a, int b, int &x, int &y) { if(b == 0) { x = 1; y = 0; return a; } int x1, y1, gcd ; gcd= xGCD(b, a % b, x1, y1); x = y1; y = x1 - (a / b) * y1; std::cout<<x<<" "<<y<<" "; return gcd; } int main() { int a = 10, b = 6, x, y, gcd...
true
ccd509147b007c57e3306b6da67b623b4868d5a3
C++
GitShou/FrameWork-NetWork-Client-
/TCPClient_03/C_CLManager.cpp
SHIFT_JIS
2,323
2.578125
3
[]
no_license
#include "C_CLManager.h" bool C_CLManager::FirstConnection(){ const int SIZE_IPINPUT = 15; // IPAhX͎̕Kvobt@TCY int sts; int ch; bool flg = true; char svIP[SIZE_IPINPUT]; sockaddr_in svAddr; LPHOSTENT lphe; IN_ADDR ip; // T[o[ printf("T[o[̐ݒJn\n"); printf("T[o[IPAhX͂ĂB"); scanf_s("%s", svIP, SIZE_IP...
true
3978117b5d9411bbd3837aa53d9acf3392381a15
C++
Kr31s/getWrecked
/PunchNetwork/PunchNetworkClient/mainClientTest.cpp
ISO-8859-1
2,639
2.625
3
[]
no_license
//#include "Inc_BWNetworking.h" //#include "Inc_SmartMacros.h" //#include "Inc_BWMath.h" // //#include <stdexcept> //#include <thread> //#include <chrono> // //void ClientMethod(); //void ServerMethod(); //unsigned int EncodeMessage(char identifier, char* messageArray); //void DecodeMessage(char* messageArray); // //bo...
true
9c208a4d75139503b95248c27565eec106504cb5
C++
herbyuan/OpenJudge_Code
/20181110红与黑.cpp
UTF-8
1,059
3.59375
4
[]
no_license
/* *程序名:红与黑 *作者:何卓远 *编制时间:2018-11-23 *功能:有一间长方形的房子,地上铺了红色、黑色两种颜色的正方形瓷砖。你站在其中一块黑色的瓷砖上,只能向相邻的四块瓷砖中的黑色瓷砖移动。请写一个程序,计算你总共能够到达多少块黑色的瓷砖。 */ #include <iostream> #include <cstring> using namespace std; char tiles[21][21]; int W, H; int move(int x, int y) { if (x < 0 || x >= H || y < 0 || y >= W) return 0; if (tiles[x][y] == ...
true
c8f2b3febee82de45367b385c230a45425b23c64
C++
likeweilikewei/Algorithm-Data-Structure-Implement
/动态规划/菲波那切数列/fibonacci.cpp
UTF-8
1,474
3.4375
3
[]
no_license
// 动态规划.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // /*斐波那契数列f(1)=1,f(2)=1*/ #include <iostream> #include<time.h> #include"recursion.h" #include"top_down_dynamic_programming.h" #include"down_top_dynamic_programming.h" using namespace std; int main() { //cpu1s运行的时钟周期数,1000表示一个时钟周期是1ms //cout << CLOCKS_PER_SEC << endl;;...
true
6828781f8aba75e6fb7acc63a198a8f7fd3eb300
C++
amplab/zipg
/core/include/bitmap.h
UTF-8
10,216
2.515625
3
[]
no_license
#ifndef BITMAP_H_ #define BITMAP_H_ #include <cstdint> #include <cassert> #include <cstddef> #include <cstdlib> #include <cstring> #include <iostream> namespace bitmap { #define GETBIT(n, i) ((n >> i) & 1UL) #define SETBIT(n, i) n = (n | (1UL << i)) #define CLRBIT(n, i) n = (n & ~(1UL << i)) #define BITS2B...
true
d9581eaee3692a436147ee5e8d0180f53151cae9
C++
marmysh/FDK
/FDK/LlCommon/PriceEntries.h
UTF-8
999
2.546875
3
[ "MIT" ]
permissive
#pragma once #include "PriceEntry.h" namespace FDK { class CPriceEntries { public: LLCOMMON_API CPriceEntries(); LLCOMMON_API CPriceEntries(const CPriceEntries& entries); LLCOMMON_API CPriceEntries& operator = (const CPriceEntries& entries); LLCOMMON_API ~CPriceEntries(); public: inline void Update(cons...
true
f8d04f54ecef569060ebda1e40d916381b23a911
C++
ananddasani/STL_C-Plus-Plus
/STACK/1_Stack_STL.cpp
UTF-8
1,058
4.375
4
[ "MIT" ]
permissive
/* Stacks are a type of container adaptors with LIFO(Last In First Out) type of working, where a new element is added at one end and (top) an element is removed from that end only. Stack uses an encapsulated object of either vector or deque (by default) or list (sequential container class) as its underlying contain...
true
32cd0200f6c9e57d72fca6b4795c729a7b9965ce
C++
Bodheem/ProjetIntegrateur3
/Client Lourd/Sources/DLL/Memento/Memento.h
UTF-8
1,138
2.9375
3
[]
no_license
////////////////////////////////////////////////////////////////////////////// /// @file Memento.h /// @author The Ballers /// @date 2015-02-25 /// @version 1.0 /// /// @ingroup Memento ////////////////////////////////////////////////////////////////////////////// #ifndef __MEMENTO_H__ #define __MEMENTO_H__ #include ...
true
b6c1a5862e62651e50d436e61ae7ce46376e936f
C++
jinho9317/Algorithm
/소문난 칠공주.cpp
UHC
1,626
3.0625
3
[]
no_license
#include<iostream> #include<queue> #include<cstring> using namespace std; char arr[5][6]; bool check[5][5], visit[5][5]; // check : ڸ, visit : Ȯ int result; int dy[] = { 1,-1,0,0 }; int dx[] = { 0,0,1,-1 }; queue<pair<int, int>> q; void go() { int cnt = 0; while (!q.empty()) { int y = q.front().first; ...
true
95092c357d76db40424533400e4ec4ed9322510a
C++
prasadnallani/LeetCodeProblems
/Medium/695-MaxAreaOfIsland.cpp
UTF-8
2,473
3.65625
4
[]
no_license
/* * Author: Raghavendra Mallela */ /* * LeetCode 695: Max Area Of Island * * You are given an m x n binary matrix grid. An island is a group of 1's * (representing land) connected 4-directionally (horizontal or vertical.) * You may assume all four edges of the grid are surrounded by water. * * The area of an...
true
016da8063909ae4174645ba00e3f4957c2f96083
C++
BelfordZ/cpsc3200
/awesome-o/acpc/2006/F.cc
UTF-8
1,334
2.953125
3
[]
no_license
#include <iostream> #include <algorithm> #include <queue> #include <cstdio> using namespace std; struct Range { int rook, lo, hi; }; #define MAX_ROOK 5000 Range xrange[MAX_ROOK], yrange[MAX_ROOK]; int x[MAX_ROOK], y[MAX_ROOK]; int n; bool operator<(const Range &a, const Range &b) { return a.lo < b.lo; } class...
true
f867166a446bea7d69bd19660665c9dc7de17232
C++
strinsberg/card-game-extravaganza
/include/RummyTable.h
UTF-8
1,403
3.59375
4
[]
no_license
#ifndef RUMMY_TABLE_H #define RUMMY_TABLE_H #include <vector> #include "Card.h" /** * Holds all melds and cards that have been played during a Rummy game. * * @author Steven Deutekom * @date Nov 29 2019 */ class RummyTable { public: RummyTable(); virtual ~RummyTable(); /** * Add a meld to the table....
true
ba7edbcc39781f495c70b3bf8862da03747df74b
C++
kirankhade/Programming-Practice
/Quicksort.cpp
UTF-8
763
3.1875
3
[]
no_license
#include<iostream> #include<stdlib.h> using namespace std; int a[10]={0,2,5,1,10,12,13,20,56,89}; int partition(int start,int end) { int i,j,pivot; pivot=i=start; j=end; if(i<j) { while(i<j) { while(a[i]<=a[pivot]) i++; while(a[j]>a[pivot]) j--; if(i<j) { int temp=a[i...
true
3f8e988685e2fb5d920776aff6baf8ed827b7f00
C++
TrevorNewey/cs1410-Inheritance
/employee.cpp
UTF-8
333
2.796875
3
[]
no_license
// // Created by WAHUGALA on 10/19/2017. // #include "employee.h" void employee::setData() { cout<<"\n Enter last name"; cin>>name; cin.ignore(); //Clears the buffer. cout<<"\nEnter ID Number: "; cin>>number; } void employee::getData() { cout<<"\n Name: "<<name; cout<<"\n IdNumber: ...
true
147e8dd690c5da3b78d420eee96d968154ff7162
C++
iridium-browser/iridium-browser
/buildtools/third_party/libc++/trunk/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array.pass.cpp
UTF-8
1,209
2.546875
3
[ "NCSA", "LLVM-exception", "MIT", "Apache-2.0", "BSD-3-Clause" ]
permissive
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
true
504d76328352b623de4a19590f1586ae28c1848f
C++
haferflocken/ConductorEngine
/Amp/collection/LinearBlockAllocator.h
UTF-8
6,031
3.359375
3
[]
no_license
#pragma once #include <collection/Vector.h> #include <unit/CountUnits.h> #include <cstdint> #include <mutex> namespace Collection { /** * An allocator that allows fixed size allocations. Implemented as a list of blocks of elements. * Allocations and frees are thread-safe by mutex. No other methods have guaranteed ...
true
6b05cdd6f586d193dc9bca2913b52fc81974bc1a
C++
CodingWD/course
/c/yaojianjiao/chapter02/bool.cpp
UTF-8
552
3.546875
4
[]
no_license
#include <iostream> using namespace std; // 定义全局bool型变量 bool b; int main() { // 定局部义bool型变量 bool c; // 不进行初始化,直接输出b cout<<"b= "<< b <<endl; cout<<"c= "<< c <<endl; // 获取bool型变量存储空间大小。 cout<< "bool 类型的存储空间大小是: " << sizeof(bool)<<" 字节 "<<endl; ...
true
c02f2ea304321f2b5ba26532687174d4a8c3aab6
C++
sajidazhar/Algorithms
/Dynamic Programming/number_of_ways_to_cover_distance.cpp
UTF-8
321
2.984375
3
[]
no_license
#include<iostream> using namespace std; int countways(int dist) { int count[dist+1]; count[0]=1,count[1]=1,count[2]=2; for(int i=3;i<=dist;i++) count[i]=count[i-1]+count[i-2]+count[i-3]; return count[dist]; } int main() { int dist=6; cout<<"total ways is : "<<countways(dist); return 0; }...
true
32d328aebaf5621ad474a283c34255a20950589e
C++
Jona2010/Lenguaje-de-programacion
/Lab 1/Par e impar.cpp
UTF-8
213
3.171875
3
[]
no_license
#include <iostream> using namespace std; int main() { int a; cout<<"Ingrese un valor:\n"; cin>>a; if(a%2==0) { cout<<a<<" es un numero par"<<endl; } else { cout<<a<<" es un numero impar"<<endl; } }
true
775d1757c6eaee36299bb9149e2bd0be6180efb1
C++
freezeeyes/ESP32-DevKitC_STUDY
/esp32_led_2/esp32_led_2.ino
UTF-8
567
3.0625
3
[]
no_license
#define HIGH (1) #define LOW (0) #define LED_PIN 22 int flag = HIGH; void setup() { // シリアル通信の通信速度を指定する Serial.begin(115200); // LED用のピンを出力モードに指定する pinMode(LED_PIN, OUTPUT); } void loop() { // LEDの出力値を切り替える flag = flag ? LOW : HIGH; // LED状態を送信する Serial.println(flag ? "LED ON" : "LED OFF"); //...
true
5b533b4f20a5e804bdfd263aae4e8398a18f7fe7
C++
Bartek-cloud/cwiczenia
/średnie_medium/AL_06_08 - Egzamin.cpp
UTF-8
1,190
2.640625
3
[]
no_license
// https://pl.spoj.com/problems/AL_06_08/ #include <bits/stdc++.h> using namespace std; const int max_s = 100000; int n; int times[max_s], memo[max_s]; /* 1 2 3 4 5 6 6 + solve(5) // 1 2 3 4 5 5 6 + solve(4) // 1 2 3 4 4 5 6 + solve(3) // 1 2 3 */ //group time + solve(reszty) int solve(int s) { if (s == -1){ ...
true
638fed1a67fea83b5aaca3caa58e4a41db682740
C++
ttykkala/recon
/utils/include/GLSLProgram.h
ISO-8859-1
1,980
2.546875
3
[ "Apache-2.0" ]
permissive
/* Copyright 2016 Tommi M. Tykkl 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 law or agreed to in writing, software ...
true
b42f529b01de3bf6ab3f992e87f4930916a733d8
C++
jmitch98/SolarSystem
/include/SolarSystem.h
UTF-8
1,239
2.640625
3
[]
no_license
#ifndef SOLARSYSTEM_H #define SOLARSYSTEM_H #include "OrbitalBody.h" #include "Renderer.h" #define AU 3.0f #define KM_TO_AU(km) (km * 2) / 16819000.0f namespace solarsystem { extern OrbitalBody* sun; extern OrbitalBody* earth; extern OrbitalBody* mercury; extern OrbitalBody* venus; extern OrbitalBody* mars; extern O...
true
c304b90e83b0d38bf7c8c64d52ed305afc2aee4c
C++
xrlrf/DataStructure
/栈和队列/ShareStack/src/ShareStack.cpp
UTF-8
1,535
3.671875
4
[]
no_license
#include "ShareStack.h" void InitStack(SqDoubleStack &S) // 初始化一个空栈S { S.top1 = -1; S.top2 = MaxSize; } bool StackEmpty(SqDoubleStack S,int stackNum) // 判断一个栈是否为空 { if(stackNum == 1 && S.top1 == -1) return true; else if(stackNum == 2 && S.top2 == MaxSize) return true; else ...
true
7e78594dedbe625d93356d3d706781c2ef52a946
C++
algo-gzua/AlgorithmGzua
/SW-Expert-Academy/d4/sw_1226/km/sw_1226.cpp
UHC
1,358
3.1875
3
[]
no_license
#include <iostream> #include <string> #include <stack> using namespace std; struct Node { int y; int x; }; int main(void) { int board[16][16]; bool visit[16][16] = { false, }; int direction[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}}; for (int t = 1; t <= 10; ++t) { int c; int start_x = 0, start_y = 0; ...
true
b71f54c9a1738fb987fe1823bbb16d26d2469c43
C++
skizophonic/Generic-C-API
/menus/AccountMenu.h
UTF-8
1,270
2.984375
3
[]
no_license
#pragma once #include "BaseMenu.h" #include "./models/Account.h" #include "AccountManagement.h" class AccountMenu : public BaseMenu { private: public: AccountMenu(BaseMenu* baseMenu) : BaseMenu(baseMenu) {} ~AccountMenu() {} void load() override { int choice{ 0 }; std::cin >> choice; switch (choice)...
true
34ea378e0674e66e97c536edf422c1891e391c6e
C++
chillylips76/cis201-examples
/loops/do_while/main.cpp
UTF-8
868
3.625
4
[]
no_license
#include<iostream> using namespace std; int main() { char response; do { cout << "Email (type 1)" << endl; cout << "Web Browser (type 2)" << endl; cout << "World Domination (type 3)" << endl; cout << "Quit (type q)" << endl; cout << ">>>"; cin >> response; if(res...
true
238e967bb7d7c726e3ee142e39b443d363a3e975
C++
ThomasDHZ/RPGGame
/Engine/Vec2.cpp
UTF-8
655
3.5
4
[]
no_license
#include "Vec2.h" Vec2::Vec2() { x = 0; y = 0; } Vec2::Vec2(int X, int Y) { x = X; y = Y; } Vec2::~Vec2() { } void Vec2::SetY(int Y) { y = Y; } void Vec2::SetX(int X) { x = X; } Vec2 Vec2::operator+(const Vec2& rhs) { Vec2 vec = Vec2(x + rhs.x, y + rhs.y); return vec; } Vec2 Vec2::operator-(const Vec2& r...
true