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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ff75d392e0f5548ef35eff9fea64ec52a5efa309 | C++ | WhiteRabbit-21/C-Exercise | /HM-23/B2-pointer.cpp | UTF-8 | 1,022 | 3.4375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
//2. Дано чотири цілочисельних змінних і невизначений вказівник. Направити вказівник на першу-ліпшу парну змінну і вивести значення вказівника або надати вказівнику значення nullptr та повідомити, що парних змінних немає.
int a, b, c, d;
cout << "Enter a" << en... | true |
a098cedb400d8df3cd5659291391e3b415ef967d | C++ | aiyi-wq/HaizeiOJ | /OJ-217.cpp | UTF-8 | 647 | 2.703125 | 3 | [] | no_license | /*************************************************************************
> File Name: OJ-217.cpp
> Author:
> Mail:
> Created Time: Tue 19 May 2020 10:35:51 AM CST
************************************************************************/
#include<iostream>
#include<algorithm>
using namespace std;
int num[10000... | true |
0c6d69b35e3462c58b7dda8e1afa63ebad283b3c | C++ | ddonix/sfjs2 | /1587/20214364_AC_0ms_0kB.cpp | UTF-8 | 1,350 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
int main()
{
int wh[12];
int a,b,c,i;
int a0,b0,c0;
while(scanf("%d", &wh[0]) != EOF)
{
for(i = 1; i < 12; i++)
scanf("%d", &wh[i]);
a = wh[0];
b = wh[1];
if ((a == wh[2] && b == wh[3]) || (a == wh[3] && b... | true |
515692163aecb55a8aad0d985b6a417486f2fbe1 | C++ | RPG-RAH/Bounding-Box-Collision-OpenGL | /Shader.h | UTF-8 | 2,275 | 2.828125 | 3 | [] | no_license | #include <string>
#include <sstream>
#include <fstream>
#include <GL/glew.h>
#include <glm/glm.hpp>
using namespace glm;
using namespace std;
class Shader
{
private :
GLuint vs,fs,program;
string vertexShaderData;
string fragmentShaderData;
string readShaderFile(string);
fstream file;
public :
Sh... | true |
2ac4edb51f9981f815947e962f5843bbdc0da5c6 | C++ | learnability/NASM | /main.cpp | UTF-8 | 1,202 | 3.953125 | 4 | [] | no_license | #include <iostream>
#include<stdlib.h>
#include <math.h>
using namespace std;
//function to check if an operator is valid
bool check(char op)
{
switch(op)
{
case '+': return true;
case '-':return true;
case '*':return true;
case '/':return true;
case 'l':return true;
case '%':return true;
case '^':re... | true |
bec142a203503f9633c926ead7681dea9354bbf1 | C++ | irenemengual/trabajo-informatica | /Inicio.cpp | WINDOWS-1250 | 5,785 | 2.5625 | 3 | [] | no_license | #include "Inicio.h"
Inicio::Inicio()
{
//La variable estado se inicializa a INICIO de juego
estado = INICIO;
contador = 0;
}
Inicio::~Inicio()
{
}
void Inicio::tecla(unsigned char key)
{
if (key == 'c') ETSIDI::stopMusica();
//if (key == 'c') ETSIDI::stopMusica();
if (estado == INICIO)
{
... | true |
fb0607e7fa8e670321b1be1411fd323360e8a37a | C++ | alexyuehuang/OOP_Projects | /Studio8/Studio8/Header.h | UTF-8 | 514 | 2.90625 | 3 | [] | no_license | #include <iostream>
using namespace std;
class Rect {
private: int length=1; const int parameter=1;
public:
int width=1;
Rect() :length(0), width(0), parameter(0)
{}
// Rect( Rect &n) :length(n.getlength()), width(n.getwidth()), parameter(0)
//{}
int getlength() {
return length;
}
int getwidth() {
return wi... | true |
9810bcd7b25869238d3ef0b3182f3bb133887486 | C++ | aashish-2096/practice-check | /DS/tree/levelTraversal.cpp | UTF-8 | 2,500 | 3.71875 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int data){
this->data = data;
this->left = nullptr;
this->right = nullptr;
}
};
class LevelOrderTraversal{
public:
Node *root;
LevelOrderTraversal(){
... | true |
8d9813fd5dbf7db7e72ddbb5f234c9eccf192a1f | C++ | meepzh/CIS563-FluidSolver | /src/geom/drawable.cpp | UTF-8 | 1,106 | 2.578125 | 3 | [
"WTFPL"
] | permissive | // Copyright 2016 Robert Zhou
//
// drawable.cpp
// MFluidSolver
#include "drawable.hpp"
Drawable::Drawable()
: vertexIndexArrBufferID(-1),
vertexColorArrBufferID(-1),
vertexPositionArrBufferID(-1) {
}
Drawable::~Drawable() {
if (vertexIndexArrBufferID != -1) glDeleteBuffers(1, &vertexIndexArrBu... | true |
ea74ee65a2d11687ffad228da8b1c676923431ae | C++ | MishkaSimakov/CRayTracing | /include/Color.h | UTF-8 | 1,222 | 2.9375 | 3 | [] | no_license | #pragma once
#ifndef RAYTRACING_COLOR_H
#define RAYTRACING_COLOR_H
#include "Math/Vec3.h"
#include "SFML/Graphics.hpp"
class Color {
public:
double r, g, b;
Color(double _value) : r(_value), g(_value), b(_value) {};
Color(vec3 v) : r(v.x), g(v.y), b(v.z) {};
Color(double _r, double _g, double _b) : ... | true |
d8cf80ec392cf3c1697e99b10b80ef7c34a8479c | C++ | JonathanXSG/MP_NN | /src/neural_network/feedForward.cpp | UTF-8 | 1,381 | 2.734375 | 3 | [] | no_license | #include "../../headers/NeuralNetwork.hpp"
void NeuralNetwork::feedForward() {
std::vector<double> *leftNeurons; // Matrix of neurons to the left
Matrix *leftWeights; // Matrix of weights between leftNeurons and next layer
for (unsigned i = 0; i < (this->topologySize - 1); i++) {
... | true |
918df9ebaa30544c5ddab8bdce98919a71b50161 | C++ | LyricZhao/DLMO | /pci-test.cpp | UTF-8 | 1,530 | 2.6875 | 3 | [] | no_license | #include <cuda_runtime.h>
#include <curand.h>
#include <iostream>
#include "timer.hpp"
#include "utils.hpp"
int main() {
auto bandwidth = [](size_t size, uint64_t time) {
double speed = static_cast<double>(size) / time * 1e9;
return speed / static_cast<double>(1u << 30u);
};
for (size_t s... | true |
c4fbe9248a80bae9f01f23f3c0f96fe8338d719e | C++ | hereandnowlive/Opengl | /assignment 3/index.cpp | UTF-8 | 610 | 3.234375 | 3 | [] | no_license | #include "index.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
index::index(){
//set values of the vector
this->x = 0;
this->y = 0;
this->z = 0;
}
//implementation of the normailze function
void index::normalize(index normal[], int i, int j,int indexsize){
norm = sqrt(pow((normal[i*indexsiz... | true |
6ad11660827c3bea4a24ccfa3ea98adf0c5959a3 | C++ | AcademySoftwareFoundation/openexr | /src/examples/generalInterfaceTiledExamples.cpp | UTF-8 | 3,391 | 2.578125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla"
] | permissive | //
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) Contributors to the OpenEXR Project.
//
//-----------------------------------------------------------------------------
//
// Code examples that show how class TiledInputFile and
// class TiledOutputFile can be used to read and write
// OpenEXR image files w... | true |
3f224083c4725127834d0fbbcfed6614d43f961a | C++ | Hjvf01/battle_city | /src/controllers/user_controller.cpp | UTF-8 | 2,546 | 2.90625 | 3 | [] | no_license | #include "controllers.h"
UserController::UserController(
UserTank *_tank,
QQuickView *_view,
BoardController *_board
) : QObject() {
tank = _tank;
view = _view;
board = _board;
root = view->rootObject();
bullets_factory = new BulletFactory(view->engine());
initTank();
}
UserCo... | true |
950d3a728564f53e85ce8a806443ca17ba434e82 | C++ | rpdunn77/Kitty-Pirateer | /hdr/Game.h | UTF-8 | 2,867 | 3.078125 | 3 | [] | no_license | //Edited by: Keenan Longair.
//Last update: 8:30PM February 8th, 2016.
//Purpose: Prototyping of the main "GameBoard" and its interface. This is implemented
//as a singleton and thus can only have one instance. Use the Game::getInstance() function
//to gain access to the instance.
//Version: 0.6
#ifndef GAME_H_
#defin... | true |
69ff0ebc05a7ff615d93a4403750a00d7ebcbcf8 | C++ | daidai21/Leetcode | /Algorithms/C++/520-Detect_Capital.cpp | UTF-8 | 989 | 3.3125 | 3 | [] | no_license | // Runtime: 0 ms, faster than 100.00% of C++ online submissions for Detect Capital.
// Memory Usage: 8.2 MB, less than 50.00% of C++ online submissions for Detect Capital.
class Solution {
public:
bool detectCapitalUse(string word) {
if (word.size() == 1)
return true;
int upper_nu... | true |
e941efa470ff2047c21e9345b58f65c4966dd348 | C++ | asad-shuvo/ACM | /Online Judge/Leetcode/90. Subsets II.cpp | UTF-8 | 777 | 2.765625 | 3 | [] | no_license | // class Solution {
// public:
// vector<vector<int>> subsetsWithDup(vector<int>& nums) {
// }
// };
class Solution {
public:
vector<vector<int> >ans;
map<vector<int>,int>mp;
vector<int>tmp;
int mx;
void G(vector<int>v,int val,int indx){
if(v.size()==mx)return;
v.... | true |
f8bcc97346fa8f8bef929032119cc674ef091eac | C++ | 2719896135/- | /NOIP-master/2007/escape/escape.cpp | UTF-8 | 698 | 3.203125 | 3 | [] | no_license | #include <stdio.h>
int FlashDistance (int curDist, int* magic);
int main ()
{
int magic, distance, time;
scanf ("%d", &magic);
scanf ("%d", &distance);
scanf ("%d", &time);
int flash = 0;
int run = 0;
for (int i = 1; i <= time; i ++) {
flash = FlashDistance (flash, &magic);
run += 1... | true |
af40065886883e01803a992ea80c60c502ee6f6a | C++ | ellynhan/algorithm | /Tree/treeTraversal.cpp | UTF-8 | 1,594 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
typedef struct Node{
char parent, left, right, me;
}node;
queue<char> preOrderAnswer;
queue<char> midOrderAnswer;
queue<char> postOrderAnswer;
node nodes[26];
void preOrder(node root){
preOrderAnswer.push(root.me);
if(root.left != '.'){
pr... | true |
b9d679b91bf080e45c8c437dacbad053621233f8 | C++ | Sookmyung-Algos/2021algos | /algos_assignment/3rd_grade/이가은_l2x3ge/1st_week/7576.cpp | UTF-8 | 1,065 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int M, N;
void bfs();
int v[1001][1001];
int time[1001][1001] = { 0, };
queue < pair<int, int>> q;
int dx[4] = { -1,1,0,0 };
int dy[4] = { 0,0,-1,1 };
int main() {
int max = 0;
cin >> M >> N;
for (int i = 0;i < N;i++) {
for (int j = 0;j ... | true |
afe521d081dc8f1904111c6d4412f710d36b21f3 | C++ | DavidKopalaCU/CSCI2270 | /BST/BST/BST.cpp | UTF-8 | 6,153 | 3.3125 | 3 | [] | no_license | //
// BST.cpp
// BST
//
// Created by David Kopala on 3/8/18.
// Copyright © 2018 davidkopala. All rights reserved.
//
#include "BST.hpp"
BST::BST()
{
root = nullptr;
height = -1;
}
BST::BST(int start)
{
root = new node(start, nullptr, nullptr, nullptr);
height = 0;
}
bool BST::priv_find(node *p... | true |
d8a89361525befad266337529d821d3a2a396a67 | C++ | redorav/hlslpp | /include/hlsl++_type_traits.h | UTF-8 | 2,256 | 2.75 | 3 | [
"MIT"
] | permissive | #pragma once
namespace hlslpp
{
template <bool Test, class T = void>
struct enable_if {};
template <class T>
struct enable_if<true, T>
{
typedef T type;
};
template <typename T> struct remove_cv { typedef T type; };
template <typename T> struct remove_cv<const T> { typedef T type; };
template <typename T>... | true |
ca8a548e8fb5fea4d21929df0612380c97987f6c | C++ | knightzf/review | /leetcode/allPossibleFullBinaryTrees/q3.cpp | UTF-8 | 1,038 | 3.296875 | 3 | [] | no_license | #include "header.h"
class Solution {
public:
vector<TreeNode*> allPossibleFBT(int N) {
vector<TreeNode*> res;
if(N == 1)
{
TreeNode* node = new TreeNode(0);
res.push_back(node);
}
else
{
for(int i = 1; i < N ... | true |
fd491b68dad586d9e3329f4d0eaaf904df0bb885 | C++ | Rahul-111/Competitivecode | /Hashing/hashexaple.cpp | UTF-8 | 431 | 3.140625 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
vector <string > hashtable[100];
void insert(string s,int i)
{
hashtable[i].push_back(s);
}
void search(int n)
{
cout<<hashtable[n][0]<<"\n";
}
int main()
{
int n;
cin>>n;
while(n--)
{
int i;
cin>>i;
string s;
cin>>s;
... | true |
be4ba5143b6ee9978e4d79f7a7754f36b7f6c043 | C++ | abalis3/forlorn-dryplace | /client/src/MenuTextBox.cpp | UTF-8 | 4,004 | 2.796875 | 3 | [] | no_license | #include "MenuTextBox.h"
#include "Util.h"
static const char BG_RECT_IMG_PATH[] = "MenuTextBox/background.png";
static const char MARVEL_FONT_PATH[] = "Fonts/Marvel-Regular.ttf";
static const int BASE_FONT_SIZE = 175;
static const float FONT_SIZE_SCALE = 0.8; /* pct of height of box for font height */
static const f... | true |
eed18c157a3cbbbf8ab5511652eb4b2019c2aab1 | C++ | tue-alga/CoordinatedSchematization | /include/SchematLib/MapSimplification/BboxFaceMerge.h | UTF-8 | 29,843 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | #ifndef SCHEMATLIB_MAPSIMPLIFICATION_BBOXFACEMERGE_H
#define SCHEMATLIB_MAPSIMPLIFICATION_BBOXFACEMERGE_H
#include "FaceMergeStrategies.h"
#include <CGAL/ch_graham_andrew.h>
#include <CGAL/convex_hull_traits_2.h>
#include <CGAL/min_quadrilateral_2.h>
namespace SchematLib::MapSimplification::FaceMergeApproach
{
cl... | true |
a91a05f0b62cbccf903cf77d0d1f05d7066fa1de | C++ | orazdow/SoundLib | /expr/lexer.cpp | UTF-8 | 5,843 | 3.109375 | 3 | [] | no_license |
#include "lexer.h"
/************* buffer ******************/
void alloc_buff(InputBuff* b, long len){
b->input = (char*)calloc(len, 1);
b->tokens = (char*)calloc(len, 1);
b->temp = (char*)calloc(VAR_LEN, 1);
b->len = len;
}
void realloc_buff(InputBuff* b, long len){
b->input = (char*)realloc(b->input, len);
... | true |
0d5792b30e2250394149e71f07cc3dde59d5f895 | C++ | necula/engine | /src/Resources/Shader.h | UTF-8 | 814 | 2.578125 | 3 | [] | no_license | #ifndef SHADER_H
#define SHADER_H
#include "../Common/Include/esUtil.h"
#include <stdlib.h>
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
typedef struct
{
char* uniformName;
int length;
float* values;
} uniform;
class CShader
{
public:
CShader(char *vertexShaderL... | true |
e627b738cfc5dd49564941cc0fdc9edf058f4f0d | C++ | Limitless-Rasul-Power/E-Commerce | /E-Commerce App/Client_Menu.h | UTF-8 | 6,077 | 2.90625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "DataBase.h"
namespace Client = ECommerce::Client;
void Client::Menu(App::DataBase* const& database)
{
std::string full_name;
std::cout << "Full Name: ";
getline(std::cin, full_name);
bool is_client_exist = false;
for (int i = 0; i < database->Get_database_notes()->Get_item_cou... | true |
4cf1dbae2c0e2ad7f6aeb6934b6ec02a47f5d645 | C++ | VigneshKumarKK/Data-Structure-training | /.vscode/tree/Binary_Search_tree/binary_srch_tree_delete.cpp | UTF-8 | 3,415 | 4 | 4 | [] | no_license | #include <iostream>
#include <stdlib.h>
using namespace std;
struct node
{
int data;
struct node *left;
struct node *right;
};
struct node* createNode(int newdata)
{
struct node* newnode;
newnode = (struct node*)malloc(sizeof(struct node));
newnode->data = newdata;
newnode->left = NULL;
newnode->right ... | true |
a35f4ed24724ad955c9babb4135359104ca08074 | C++ | lcglcglcg/code | /cpp_code/the_big_three/03多态/person.h | UTF-8 | 310 | 3.015625 | 3 | [] | no_license | class person
{
public:
person(const char *name, int age);
~person();
virtual void display()const;
protected:
char *name;
int age;
};
class student:public person
{
public:
student(const char *name, int age, int score);
~student();
virtual void display()const;
protected:
int score;
};
| true |
bdd02d69b2ce088652f2507c95d8f85a080f6bc0 | C++ | BekjanJuma/Competitive-Programming | /acm.timus.ru-old-solutions/p1087.cpp | UTF-8 | 653 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}
int main()
{
int A[10010];
int n, m, k[60];
cin >> n >> m;
for( int i=0; i<m; i++ )
cin >> k[i];
qsort( k, m, sizeof(int), compare);
for( int i=0;... | true |
95152ff4fb02f944ff1ebc5912d36cb59bef68d5 | C++ | jiujiangluck/PAT-Advanced-Level-Practise | /New Version/A1129.cpp | UTF-8 | 1,091 | 2.578125 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<vector>
#include<unordered_map>
#include<set>
#include<stack>
#include<queue>
#include<cctype>
#include<climits>
#include<algorithm>
#include<cmath>
#define _CRT_SECURE_NO_WARNINGS
#define inf INT_MAX
using namespace std;
typedef pair<int, int> pp;
vector<int> fre;
int n... | true |
1436c5ad712714a0888a537ca38f9fa87491acf8 | C++ | bbathe/Arduino | /contester-fpad-esp32/contester-fpad-esp32.ino | UTF-8 | 3,718 | 2.890625 | 3 | [
"MIT"
] | permissive | #include "esp_sleep.h"
#include <BleKeyboard.h>
/*
keypad mapping
keypad # -> character to send
3x4 keypad
01 02 03
04 05 06
07 08 09
10 11 12
*/
#define KEYPAD_KEY_COUNT 12
uint8_t keyLookup[KEYPAD_KEY_COUNT] = {
// 1st (top) row [01 02 03]
KEY_F1,
KEY_F2,
KEY_F3,
// ... | true |
a072d953b1f2731a45a62d6f1736ba4a6b03c578 | C++ | thulium-lab/thulium-main | /PyLab/remote_programs/arduino/arduino_shutter_WM_v0.1/arduino_shutter_WM_v0.1.ino | UTF-8 | 5,819 | 2.5625 | 3 | [] | no_license | // Developed by Artem Golovizin, LPI (FIAN). Based on arduino_shutters_v2.2.,
// Controlls shutters based on simple stepper motors in a logic way: 0 - only bias coil is on, 1 - both coils are on.
// Tipical resistences are 50-200 Ohm, the larger difference between bias and TTL resistence the larger rotation, tipical 1... | true |
75939e34a3405c47f3b7e9cceee4d002cbfa7691 | C++ | namanworld/LeetCode-Solutions-Time-Complexity-Optimized- | /1504. Count Submatrices With All Ones.cpp | UTF-8 | 758 | 2.53125 | 3 | [] | no_license | class Solution {
public:
int numSubmat(vector<vector<int>>& mat) {
int n = mat.size(), m = mat[0].size();
vector<vector<int> > arr(n, vector<int>(m, 0));
for(int i=0; i<n; i++){
int c = 0;
for(int j=m-1; j>=0; j--){
if(mat[i][j]) c++;
e... | true |
5932680022d1619e2ad79f8ada7d5a60c0e92cae | C++ | Song2012/C---Primer-exercise | /Ex4.18.cpp | WINDOWS-1256 | 687 | 2.546875 | 3 | [] | no_license | /*
* =====================================================================================
*
* Filename: Ex4.18.cpp
*
* Description:
*
* Version: 1.0
* Created: 2012/3/12 һ 0:21:03
* Revision: none
* Compiler: gcc
*
* Author: Python (),
* Company: ... | true |
f40005bcc095f93ef7979844969e2d9005f311f4 | C++ | vsapiens/Orientada_Objetos | /Orientada_Objetos/Video/Materia.h | UTF-8 | 774 | 3.21875 | 3 | [] | no_license | //
// Materia.h
// Orientada_Objetos
//
// Created by Erick González on 2/25/18.
// Copyright © 2018 Erick González. All rights reserved.
//
#ifndef Materia_h
#define Materia_h
class Materia
{
public:
//Constructor Default
Materia();
//Constructor con parametros
Materia(int idMateria, string ... | true |
6c1595b1e10e44cb76a414fa7519c1ea8ad386c7 | C++ | milon/UVa | /Volume-9/UVa_913.cpp | UTF-8 | 245 | 2.515625 | 3 | [] | no_license | //UVa Problem-913(Joana and the Odd Number)
//Accepted
//Running time: 0.008 sec
#include<iostream>
using namespace std;
int main(){
long long n,a;
while(cin>>n){
a=(1+n)*(n/2+1)/2;
a=a*2-1;
a=a*3-6;
cout<<a<<endl;
}
return 0;
}
| true |
98e4ce6fb9325a35878cfa306c203304d3c076d9 | C++ | PaigeG/Comp-Sci-2-2018 | /main9.cpp | UTF-8 | 1,114 | 3.421875 | 3 | [] | no_license | //Paige Gadapee
//Drive Code for Lab 9
//April 10, 2018
#include "lab9.h"
#include "savings.h"
#include "checking.h"
#include <iostream>
using namespace std;
int main()
{
//variables
double interest, amount, number;
cout << "Normal account : " << endl;
Account origin(50.0);
origin.getBalance();
o... | true |
cb12af7a8b0f785e90e958cd021ce8fae8a67356 | C++ | danielvallejo237/Advanced-Programming | /Uhunt_problems/Mathematics/UVA_10056_withp.cpp | UTF-8 | 547 | 2.5625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
double EPS=1e-9;
double prob(double p, double sujeto,int players)
{
return p*pow((1-p),sujeto-1)/(1.0-pow((1-p), players));
}
int main()
{
int testcases;
cin>>testcases;
while(testcases--)
{
double p;
int players;
int sujeto;... | true |
ec8887bef2a966a6c19fc2a23958c97121ffcb32 | C++ | yanmt311/MT_1 | /其他/Test/Test/Student.h | GB18030 | 629 | 2.96875 | 3 | [] | no_license | #ifndef STUDENT_H_INCLUDED
#define STUDENT_H_INCLUDED
class Student
{
private:
char Name[20]; //ѧ
double Chinese; //ijɼ
double Math; //ѧɼ
public:
double Average(); //ƽɼ
double Sum(); //ܷ
void Show(); //ӡϢ
//أβбͬأ
... | true |
b89a6b7321ed5abb0a145a7d4b6fa389965850b6 | C++ | Rescon/MI206 | /TP1/TP1_MI206/include/Image.hh | ISO-8859-2 | 6,029 | 2.65625 | 3 | [] | no_license | #ifndef _IMAGE_
#define _IMAGE_
#define NMAX 21
/************************************************************/
/* definitions de types */
/************************************************************/
template <class T> class Info;
struct Vecteur;
class Noyau;
class FIFO;... | true |
68b57dee5ba1db1087af1a2ad71544df8c0708db | C++ | lock19960613/SCL | /Daily/CPP/Leetcode847-访问所有节点的最短路径.h | UTF-8 | 918 | 2.8125 | 3 | [] | no_license | #include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int shortestPathLength(vector<vector<int>>& graph) {
typedef pair<int,int> PII;
int n = graph.size(),INF = 1e9;
vector<vector<int>> dp(1<<n,vector<int>(n,INF));
queue<PII> q;
for(int i = 0;... | true |
62b0438214bacc34046f82fafe459e7323e8bd3a | C++ | BOISSARD/WifiBot | /outputmanager.h | UTF-8 | 625 | 2.640625 | 3 | [] | no_license | #ifndef OUTPUTMANAGER_H
#define OUTPUTMANAGER_H
#include <QTextStream>
#include <iostream>
#include "direction.h"
#include "connexionmanager.h"
using namespace std;
class OutputManager
{
public:
OutputManager();
~OutputManager();
void setConnexionManager(ConnexionManager* connexion);
... | true |
935b7cbecf5f799f10e88ffd12df704b56ec7fcd | C++ | Riateche/ridual | /src/Directory_watcher.cpp | UTF-8 | 1,201 | 2.625 | 3 | [
"MIT",
"CC-BY-4.0",
"CC-BY-3.0"
] | permissive | #include "Directory_watcher.h"
#include <QDir>
#include <QDebug>
#include "Core.h"
#include "File_system_engine.h"
Directory_watcher::Directory_watcher(Core *c) :
QObject(0)
, Core_ally(c)
{
connect(&watcher, SIGNAL(directoryChanged(QString)), this, SIGNAL(directory_changed(QString)));
fs = core->get_file_syste... | true |
1729ffe3d5ca3f40c55e3546bbcc55a9ddd0194d | C++ | felixguendling/cista | /include/cista/memory_holder.h | UTF-8 | 969 | 2.734375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <variant>
#include "cista/buffer.h"
#include "cista/containers/unique_ptr.h"
#include "cista/mmap.h"
#include "cista/targets/buf.h"
namespace cista {
using memory_holder = std::variant<buf<mmap>, buffer, byte_buf>;
template <typename T>
struct wrapped {
wrapped(memory_holder ... | true |
b5e0484e1f122a10ac19c2a6eda1b7b675b9cf45 | C++ | BusHero/robotino_api2 | /common/lib/rec/robotino3/serialio/tag/HwVersion.h | UTF-8 | 1,608 | 2.53125 | 3 | [] | no_license | #ifndef _REC_ROBOTINO3_SERIALIO_TAG_HWVERSION_H_
#define _REC_ROBOTINO3_SERIALIO_TAG_HWVERSION_H_
#include "rec/robotino3/serialio/Tag.h"
#include "rec/robotino3/serialio/tag/HwVersionFwd.h"
namespace rec
{
namespace robotino3
{
namespace serialio
{
namespace tag
{
class HwVersion : public rec::roboti... | true |
219f03534deb66c4896053bcbfdc7fc6f78d332a | C++ | ntran273/traveltips | /src/gui/fbpastpost.cpp | UTF-8 | 7,037 | 2.59375 | 3 | [] | no_license | /*Copyright 2017 Paul Salvador Inventado
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, s... | true |
c7d04efdf4e56a867dc302fadc3c1af9244094d8 | C++ | selvabharathis/Arduino-Coding | /pir_sensor-led/pir_sensor-led.ino | UTF-8 | 638 | 2.59375 | 3 | [] | no_license | // S.Selvabharathi B.Tech IT Rajalakshmi Engineering College
// vcc->3v to 5v , gnd->gnd ,out->analog pin of microcontroller
//NOTE: pir has sensitivity adjustment,duration adjestment and trigger(non-repeating and repeating) if trigger is in repeat mode the led will blink on and off , so becarefull with all the c... | true |
c930977edb21c1344455bd5aa9f5eac93966be54 | C++ | RicoJia/Accelerated-C- | /Acc_C++_chap8/8_6.cpp | UTF-8 | 630 | 2.96875 | 3 | [] | no_license | //
// Created by rico on 7/19/19.
//
#include "8_6.h"
#include <iostream>
using std::cout;
using std::endl;
#include <map>
using std::map;
#include <utility>
using std::pair;
#include <string>
using std::string;
#include <list>
using std::list;
#include <algorithm>
using std::copy;
#include <iterator>
using std:... | true |
0eb7d66178f7a18bbfecf9e58c7471ff074050d4 | C++ | WhiZTiM/coliru | /Archive2/cd/07b4abe3e4aa35/main.cpp | UTF-8 | 544 | 2.6875 | 3 | [] | no_license | struct Traits {
template <typename T>
struct Foo {
typedef typename T::bar* type;
};
};
template <typename T>
class Bar
{
typedef int bar;
// need to make T::Foo<Bar> a friend somehow?
using my_friend=typename T::template Foo<Bar>;
friend my_friend;
typedef typena... | true |
d31eb49c265b7679594eedf5e9590d47ce2bd16f | C++ | LizaBelova/GGRPG | /elemental.cpp | UTF-8 | 2,736 | 3.109375 | 3 | [] | no_license | #include "elemental.h"
elemental::elemental()
{
set_name("Elemental");
set_hp(100);
set_max_hp(100);
set_def(130);
set_atk(85);
set_max_atk(85);
set_mana(0);
for(int i=0;i<8;i++){
status[i]=false;
status_cont[i]=0;
}
}
elemental::~elemental()
{
... | true |
9fbeb01d2537ac90848c3104a6e7fe02cdd4113b | C++ | codebaard/GLSLPathTracer | /glPathTracer/include/Framebuffer.h | UTF-8 | 1,666 | 2.625 | 3 | [] | no_license | /*
The purpose for this class is handle the framebuffer state and data within openGL.
Every Instance represents a single framebuffer with a arbitrary settings and purposes.
written by Julius Neudecker
v0.1 30.07.2020 - created.
v0.2 31.07.2020 - Added Functionality for fetching Compute Shader Buffer
*/
#ifndef FRAMEB... | true |
1253f83be6cef36d2f3070e0b290d225bdc97258 | C++ | Merisho/comprog | /algotester/anniversary-7/c.cpp | UTF-8 | 789 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g;
vector<bool> v;
int dfs(int x) {
v[x] = true;
int k = 1;
for (int i = 0; i < g[x].size(); ++i) {
int to = g[x][i];
if (!v[to]) {
k += dfs(to);
}
}
return k;
}
int main() {
int n, m;
cin >> n >> m;
v = vector<bool>(n, false);
g ... | true |
0769a148714917f7ae1811f62d067cf9d83a32ce | C++ | SubhamGupta007/Dynamic-Programming | /Kushagra Shekhawat/Day 6/29. Page Faults in LRU.cpp | UTF-8 | 2,054 | 3.1875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int PageFaults(int pages[],int N,int C);
void pushPageBack(deque<int> &dq,
unordered_map<int,int> &ump,int page);
void RemovePageAndAddNew(deque<int> &dq,
unordered_map<int,int> &ump,int page);
int main()
{
int T;
cin>>T;
while(T--){
int N,C;
cin>>N;
int... | true |
7607215bf78264dd795ee6957e5fa15868653c55 | C++ | MaximumEndurance/Algo-17 | /Practise/3-Jul-Prac/LCA_in_BT.cpp | UTF-8 | 895 | 3.515625 | 4 | [] | no_license | #include "tree.h"
bool search(Node* root, int val) {
if(!root) return 0;
if(root->data == val)
return 1;
return (search(root->left, val) || search(root->right, val));
}
Node* LCA_in_BT(Node* root, Node* n1, Node* n2) {
if(!root) return NULL;
bool onLeft1 = search(root->left, n1->data);
bool onRight1 = sear... | true |
0dc6657cfb3940dfec49d320fce59373d9bde342 | C++ | tanmaythaakur/fs_elite | /Elite_2.0/ABDValue.cpp | UTF-8 | 2,182 | 3.6875 | 4 | [] | no_license | /*
Sumanth has an idea to calculate the ABD value of a string.
An ABD value is defined as the absolute diffrence between
the most occurance count of a charcter and the least occurance count
of another character in the given string.
Sumanth is given a string S,
He wants to find out, the sum of ABD values of all the s... | true |
c5fbe66d193df87d13ee3354f766d25f993b125f | C++ | AmgCoder/DSA-CP | /Array/Nuts and Bolts Problem/solution.cpp | UTF-8 | 2,148 | 4.28125 | 4 | [
"MIT"
] | permissive | // C++ program to solve nut and bolt
// problem using Quick Sort.
#include <iostream>
using namespace std;
// Method to print the array
void printArray(char arr[])
{
for(int i = 0; i < 6; i++)
{
cout << " " << arr[i];
}
cout << "\n";
}
// Similar to standard partition method.
// Here we pas... | true |
7f31ecbac666bcfcf80aca2bf3301d8e7b6289eb | C++ | Mahmoudnaoum/Banker | /banker.cpp | UTF-8 | 7,252 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <conio.h>
using namespace std;
void safety_state_fun(vector< vector<int> >allocation, vector< vector<int> >max, vector<int> available);
void request_state_fun(vector< vector<int> >allocation, vector< vector<int> >max, vector<int> available);
int mai... | true |
85c55ad0c2d23abf23dd50b1f1e2f77ce58773e4 | C++ | a1mond/password-manager | /User/User.cpp | UTF-8 | 915 | 3.296875 | 3 | [] | no_license | #include <vector>
#include <string>
#include <iostream>
#include "User.h"
using namespace std;
User::User(const string& l, const string& p) {
login = l;
pass = p;
}
void User::printPasswords() {
if (!getPasswords().empty()) {
for (const auto &elem : passwords) {
... | true |
3f79c4dcec258086537a4180aee83e96825d25a8 | C++ | TangGSen/OpenglStudyV1 | /openglstudyv2/src/main/cpp/SkyBox.cpp | UTF-8 | 4,888 | 2.859375 | 3 | [] | no_license | //
// Created by Administrator on 2017/10/15.
//
#include "SkyBox.h"
void SkyBox::init(const char *imageDir){
vertexBuffer =new VertexBuffer[6];
sShader = new SShader[6];
initFront(imageDir);
initBack( imageDir);
initLeft(imageDir);
initRight(imageDir);
initTop(imageDir);
initBottom(im... | true |
fc3834e7cb8128474d5e87042ef68070bbbf06ba | C++ | Micha70/E3DC-Control-Display | /framebuffer.h | UTF-8 | 5,905 | 2.71875 | 3 | [] | no_license | /*
Copyright (C) 2017, Richard e Collins.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This progr... | true |
ef09795080b067389a5a160ce1c58b487c092f6b | C++ | MultivacX/leetcode2020 | /algorithms/medium/1262. Greatest Sum Divisible by Three.h | UTF-8 | 2,638 | 3.453125 | 3 | [
"MIT"
] | permissive | // 1262. Greatest Sum Divisible by Three
// Runtime: 48 ms, faster than 90.75% of C++ online submissions for Greatest Sum Divisible by Three.
// Memory Usage: 11.6 MB, less than 100.00% of C++ online submissions for Greatest Sum Divisible by Three.
class Solution {
public:
int maxSumDivThree(vector<int>& nums) {
... | true |
5cd7aa8b91e0f3faae174b277ecbb2b1a71819fe | C++ | VanzaA/Jueces-online | /Resoluciones/TheDepartmentofRedundancyDepartment.cpp | UTF-8 | 574 | 2.75 | 3 | [
"MIT"
] | permissive | // https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=425
#include <iostream>
#include <map>
#include <queue>
using namespace std;
int main(int argc, char *argv[]){
map<int, int> mapa;
queue<int> cola;
int n;
while (cin >> n){
if(mapa.find(n) ... | true |
4d52cbbe2c560047e8d9645b502b69072c4dc26c | C++ | karikera/ken | /KR3/data/map.cpp | UTF-8 | 914 | 2.640625 | 3 | [] | no_license | #include "stdafx.h"
#include "map.h"
using namespace kr;
size_t std::hash<kr::_pri_::MapKeyData>::operator ()(const kr::_pri_::MapKeyData& key) const noexcept
{
return kr::mem::hash(key.m_buffer, key.m_size);
}
bool _pri_::MapKeyData::operator ==(const MapKeyData& other) const noexcept
{
if (m_size != other.m_size... | true |
2d6dccd303ca69b8be29571d1b4994c2765bce29 | C++ | msk-repo01/genetic_algo | /src/examples/n_queen/nqueen_ga.h | UTF-8 | 2,993 | 3.234375 | 3 | [
"MIT"
] | permissive | /*
* nqueen_ga.h
* A simple Genetic Algorithm for N-QUEEN problem
*
* Created on: Dec 24, 2016
* Author: S.Khan
*/
#ifndef NQUEEN_GA_H_
#define NQUEEN_GA_H_
# include "ga.h"
using namespace std;
using namespace ga;
/**
* A SIMPLE GENETIC ALGORITHM FOR N-QUEEN PROBLEM (nqueen_genetic_al... | true |
d5e173b51631dd23383ee87192e2550d01739a25 | C++ | dieram3/competitive-programming-library | /include/cpl/graph/hopcroft_karp_maximum_matching.hpp | UTF-8 | 3,241 | 2.84375 | 3 | [
"BSL-1.0"
] | permissive | // Copyright Diego Ramirez 2015
// 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)
#ifndef CPL_GRAPH_HOPCROFT_KARP_MAXIMUM_MATCHING_HPP
#define CPL_GRAPH_HOPCROFT_KARP_MAXIMUM_MATCHING_HPP
#in... | true |
e887f3f453c2227cfdc80710b99764520cd30e8f | C++ | asonnino/hello-enclave | /App/App.cpp | UTF-8 | 2,091 | 2.84375 | 3 | [
"Unlicense"
] | permissive | #include <stdio.h>
#include <iostream>
#include "Enclave_u.h"
#include "sgx_urts.h"
#include "sgx_utils/sgx_utils.h"
/* Global EID shared by multiple threads */
sgx_enclave_id_t global_eid = 0;
// OCall implementations
void ocall_print(const char* str) {
printf("%s\n", str);
}
int main(int argc, char const *argv... | true |
103bf1baebd1745f5d0c47447b156ac0d2848abd | C++ | Saki-Zhang/LeetCode | /isValidSudoku.cpp | UTF-8 | 991 | 3.046875 | 3 | [] | no_license | // 36. Valid Sudoku
// https://leetcode.com/problems/valid-sudoku/
class Solution {
public:
bool isValidSudoku(vector<vector<char>>& board) {
unordered_set<char> rows[9];
unordered_set<char> cols[9];
unordered_set<char> boxes[9];
for(int i = 0;i < 9;i ++) {
for(... | true |
2be427a4a2a8ce13ae454d04481d7a29dbea4caa | C++ | Mistah-Skipp/Prog-2 | /Prob 2 &4/checkingActImp.cpp | UTF-8 | 1,314 | 2.78125 | 3 | [] | no_license | //checkingActImp
#include <iostream>
#include "checkingAct.h"
#include "bankAccount.h"
//Service Charge
void checking::setServiceCharge(double charge) {
srvChrg = charge;
}
double checking::getServiceCharge() const {
return srvChrg;
}
//Minimum Balance
void checking::setMinBalance(double minBal) {
minimum = minBal... | true |
da1887ecabc8a0077c037d5df9fbfa44685b71ff | C++ | andrewduong77/cse1325 | /Lecture Code/Lecture 4 code/class_example.cpp | UTF-8 | 1,705 | 4.09375 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Date {
public:
Date(int y, int m, int d)
{
year = y;
month = m;
day = d;
}
void add_day(int num)
{
day += num;
}
void add_day();
int get_year();
int get_month();
int get_day(... | true |
7f892cbe79dcb54857aad44031ac9bff8165ae5a | C++ | NeymarL/SeedCup2016 | /loop.cpp | UTF-8 | 4,095 | 3.15625 | 3 | [] | no_license | /**
* 处理循环结构代码
*/
#include "headers.h"
/**
* 处理循环结构
*/
void do_loop()
{
string expression = "";
string expression1 = "";
string expression2 = "";
string expression3 = "";
Code* blockbegin = IP;
Code* blockend = match_bracket();
if (IP->code.find("for") == 0) {
//处理for循环头部
... | true |
b4cad28d4931a69f77820f030a53cc70004dad21 | C++ | DanielKrawisz/data | /include/data/net/websocket.hpp | UTF-8 | 3,459 | 2.5625 | 3 | [] | no_license | // Copyright (c) 2022-2023 Daniel Krawisz
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef DATA_NET_WEBSOCKET
#define DATA_NET_WEBSOCKET
#include <data/net/URL.hpp>
#include <data/net/HTTP.hpp>
#include <data/net/asio/se... | true |
d57610380a4d1f06006222004dba089e6638fc0f | C++ | bielprze/JiMP2 | /Roz 15/15_16.cpp | UTF-8 | 570 | 3.484375 | 3 | [] | no_license | //: C15:VirtualsInDestructors.cpp
// Virtual calls inside destructors
#include <iostream>
using namespace std;
class Base {
public:
virtual ~Base() {
cout << "Base1()\n";
f();
}
virtual void f() { cout << "Base::f()\n"; }
};
class Derived : public Base {
public:
~Derived()... | true |
263db73cb08812d2cd76a26422f9088dde70f6f3 | C++ | peter9378/acmicpc_stepbystep | /using_string/2675.cpp | UHC | 458 | 3.140625 | 3 | [] | no_license | /**
* baekjoon_stepbystep
* No. 2675 ڿ ݺ
* @author peter9378
* @date 2018.02.12
*/
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
int main()
{
int test_case;
cin >> test_case;
for (int T = 0; T < test_case; T++)
{
int R;
string S, result = "";
cin >> R >> S;
for (int i = ... | true |
9aa0f76b9a4ddc78a83362a306f453442d2ae2f4 | C++ | efficient/cicada-exp-sigmod2017-ermia | /dbcore/sm-log-offset.h | UTF-8 | 3,633 | 3.046875 | 3 | [
"MIT"
] | permissive | // -*- mode:c++ -*-
#ifndef __SM_LOG_OFFSET_H
#define __SM_LOG_OFFSET_H
#include "sm-log-file.h"
/* The LSN generator of the log.
When allocating a log block, a thread must acquire an LSN offset
and then map it to a corresponding location on disk as a separate
step. The benefit is that the monotonic part of... | true |
f56e94ed33ea6d10e097a10244fa48a3ff8219c1 | C++ | DanB91/GBEmuOld | /src/Emulator/opcodes_inline.h | UTF-8 | 5,862 | 3.09375 | 3 | [] | no_license | #ifndef OPCODES_INLINE_H
#define OPCODES_INLINE_H
#include "CPU.h"
using namespace GBEmu;
inline void CPU::setFlag(Flag flag){
F |= static_cast<byte>(flag);
}
inline void CPU::clearFlag(Flag flag){
F &= ~static_cast<byte>(flag);
}
inline bool CPU::isFlagSet(Flag flag){
return (F & static_cast<byte>(flag... | true |
2a9f0fbbb45c9c9cf1be9d488aaf98f7a76611c8 | C++ | robinhoode/ILoveYouTron | /src/TriangulatedCylinder.h | UTF-8 | 876 | 2.609375 | 3 | [] | no_license | #ifndef _TRIANGULATED_CYLINDER
#define _TRIANGULATED_CYLINDER
#include "ofMath.h"
#include "ofMain.h"
#include "ofConstants.h"
#include "ThreeDShape.h"
class TriangulatedCylinder : ThreeDShape {
public:
double angleY, angleZ, angleStep;
double standardShapeHeight, shapeHeight, levelShape;
double iterationSize... | true |
d37c147583421bb5107d49d66799739c28b44134 | C++ | adityanjr/code-DS-ALGO | /HackerBlocks/Divide and Conquer/Help rahul to search/main.cpp | UTF-8 | 733 | 2.984375 | 3 | [
"MIT"
] | permissive | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll binarysearch(ll arr[], ll start, ll end, ll search){
if(start<=end){
ll mid = start + (end-start)/2;
if(arr[mid]==search)
return mid;
if(arr[mid]<=arr[end]){
if(search>arr[mid] && search<=arr[end])
return binarysearch(arr,mid... | true |
46ee80e6d9ae5305b060f77a6540ec9342d3145f | C++ | JJYDXFS/Compiler_exp | /exp2/NFA.h | GB18030 | 1,385 | 3.3125 | 3 | [] | no_license | #pragma once
#include <iostream>
// н㱣һάбУͨ±
typedef int NType;
typedef char InfoType;
typedef struct NFA { // NFA
int start; // ʼ
int end; //
}NFA;
class Edge //
{
public:
int NodeIndex; // յ±
Edge *nextedge; // һڱ
InfoType info; // תȡַ
Edge() {
NodeIndex = 0;
nextedge = NULL;
info = '\0';
}
Edge(const... | true |
5b07b20763e2f1c669a3dbe1e1b393bde21b2709 | C++ | CaoHoaiTan/HCMUTE | /Kỹ thuật lập trình - Programming Techniques/C5/DayConTang.cpp | UTF-8 | 733 | 2.671875 | 3 | [] | no_license | #include <stdio.h>
#define SIZE 100
#define oo 100000
void nhap(int A[], int &n);
void QHD(int A[], int n, int L[], int T[]);
void TruyVet(int A[], int n, int L[], int T[]);
int main(){
int A[SIZE]={0}, L[SIZE]={0}, T[SIZE]={0}, n;
nhap(A,n);
QHD(A,n,L,T);
printf("%d\n",L[0]);
TruyVet(A,n,L,T);
return 0;
}
voi... | true |
262bea37997af3706cd749bc6a117fecf824a1fa | C++ | verto4599/LeetCode | /Array/1431. Kids With the Greatest Number of Candies.cpp | UTF-8 | 466 | 2.90625 | 3 | [] | no_license | vector<bool> kidsWithCandies(vector<int>& candies, int extraCandies) {
int maxCandies=-1;
vector<bool> check;
for(int i=0;i<candies.size();i++)
maxCandies=max(maxCandies,candies[i]);
for(int i=0;i<candies.size();i++){
if(candies[i] + extraCandies >= maxCa... | true |
a4591c7019790f79f83d4f9665d315dd659baa04 | C++ | Siddharth-Babbar/Pepcoding | /PepcodingSept_19/Lec_008/Matrix1.cpp | UTF-8 | 645 | 3.328125 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
void input(vector<vector<int>> & arr)
{
for(int i=0; i<arr.size();i++)
{
for(int j=0;j<arr[0].size();j++)
{
cin>>arr[i][j];
}
}
}
void display(vector<vector<int>> & arr)
{
for(vector<int> ar:arr)
... | true |
4b978d1602a6e5dbb0f4e219057ea2d9fde155bb | C++ | nithish642k/binary-tree | /40)check if given tree is height balanced.cpp | UTF-8 | 1,090 | 3.421875 | 3 | [] | no_license | /* Number of nodes on the longest path between any two leaf nodes */
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left,*right;
Node(int data)
{
this->data=data;
left=right=NULL;
}
};
int check(struct Node *node)
{
if(node==NULL)
return 0;
if(... | true |
8a89e99a641d57ab65b88c2114bc81bb119c17c4 | C++ | Minhan93/Financial-Computing-With-C- | /HW5/HW5_1c.cpp | UTF-8 | 2,167 | 2.875 | 3 | [] | no_license | //
// main.cpp
// hw5
//
// Created by Li M on 15/10/5.
// Copyright (c) 2015年 Li M. All rights reserved.
//
#include<cstdlib>
#include<ctime>
#include<stdio.h>
#include<math.h>
#include<iostream>
using namespace std;
int main()
{
srand( static_cast<unsigned int>(time(NULL)));
const double T=1,S0=100,r=0.0... | true |
7442d0445e57ad20bc00bb04b4f46ffb9c5a39d0 | C++ | anshishazhudeou/uwaterlooCourses | /2019Winter/cs349/02.gui/examples/xlib/null.min.cpp | UTF-8 | 628 | 3.28125 | 3 | [] | no_license | /*
CS 349 Code Examples: X Windows and XLib
null Creates and destroys a display (a good first test to see
if X Windows is working).
- - - - - - - - - - - - - - - - - - - - - -
See associated makefile for compiling instructions
*/
#include <cstdlib>
#include <iostream>
#include <X11/Xlib.... | true |
26d6d428a1e12ae344825ca31e6028a2e9321be7 | C++ | SeyoungJeon/Algorithmus2 | /BaekJoon/Project1/17136.cpp | UHC | 1,491 | 3.234375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int map[10][10];
int color[5] = { 5,5,5,5,5 };
int ans = 101,result;
void func(int row, int col) {
// 1~10 Ȯ
if (col == 10) {
func(row+1, 0);
return;
}
// Ȯ
if (row == 10) {
// ּҵǴ
if (result < ans) {
ans = result;
}
return;
}
// ̸ ʿ䰡 ĭ
i... | true |
038dd7257474a63f865afa61dfe8b1943db779ed | C++ | atyuwen/string_dictionary | /src/libcsd_test.cpp | UTF-8 | 3,253 | 2.734375 | 3 | [
"MIT"
] | permissive |
#define _CRT_SECURE_NO_WARNINGS
#include "libcsd_test.h"
#include <iostream>
#include <memory>
#include <StringDictionary.h>
#include <iterators/IteratorDictStringPlain.h>
void test_libcsd(const std::vector<std::string>& strs)
{
std::vector<std::string> sorted_strs = strs;
std::sort(sorted_strs.begin(), sorted_st... | true |
04aee2c73340c7b11587f586f0226de8b972bfd6 | C++ | BryanCaceresChacon/Practica-de-Laboratorio3 | /Ejercicio2/Ejercicio2/Ejercicio2.cpp | UTF-8 | 595 | 3.234375 | 3 | [] | no_license | // Ejercicio2.cpp : Este archivo contiene la función "main". La ejecución del programa comienza y termina ahí.
//
#include <iostream>
using namespace std;
//EJERCICIO2
int main()
{
int cont = 0;
int n = 0;
cout << "Ingrese un numero:";
cin >> n;
for (int i = 1; i <= n; i++) {
if (i %... | true |
dd737833bae1e12d8c82c7a705cd1d80cefe8821 | C++ | Alcaro/russian-malware | /arlib/string.h | UTF-8 | 26,918 | 2.734375 | 3 | [] | no_license | #pragma once
#include "global.h"
#include "array.h"
#include "hash.h"
#include <string.h>
// define my own ctype, because table lookup is faster than libc call that probably ends up in a table lookup anyways,
// and so I can define weird whitespace (\f\v) to not space (several Arlib modules require that, better centr... | true |
7a27bf00d9916bb14e671acce9b3f68d395ae74a | C++ | velazqua/competitive-programming | /online-judges/UVa/10650/10650.cpp | UTF-8 | 2,083 | 2.609375 | 3 | [] | no_license | /* Alex Velazquez
* Start: Sun Mar 11 19:29:02 EDT 2012
* End :
*/
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <qu... | true |
4ab8dbc5631830b0d29c6ebfefce2163a3a76c0f | C++ | alexweav/BackpropFramework | /spike/Main.cpp | UTF-8 | 2,805 | 2.78125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include "Core/ExecutionContext.h"
#include "Core/IDifferentiableExecutor.h"
#include "Operations/Arithmetic.h"
#include "Operations/Value.h"
#include "Evaluation/LazyEvaluator.h"
#include "Utils/Dictionary.h"
#include "Data/Datatypes.h"
#include "Data/Initializers/Ones.h"
#include "Data/Initialize... | true |
c4e18b9b722f9857bff90251b5d676db430e6307 | C++ | maxbader/transitbuddy | /transitbuddy_human_publisher/include/mpedplus/CellDefinition.h | UTF-8 | 1,005 | 2.734375 | 3 | [
"BSD-2-Clause"
] | permissive | #pragma once
#include <string>
#include <vector>
using namespace std;
namespace mped {
class CellDefinition {
private:
long id;
long rows;
long columns;
double width;
double height;
vector<double> origin;
public:
__declspec(dllexport) CellDefinition();
__declspec(dllexport) ~... | true |
ec1f474709276c90fe4df629bb0906fd94ccb9da | C++ | dreamsComeTrue/agaLang | /include/agaASTFunctionCall.h | UTF-8 | 1,276 | 2.84375 | 3 | [] | no_license | #ifndef _AGA_ASTFUNCTIONCALL_H_
#define _AGA_ASTFUNCTIONCALL_H_
#include <vector>
#include "agaASTNode.h"
namespace aga
{
class agaASTFunctionCall : public agaASTNode
{
public:
agaASTFunctionCall (std::shared_ptr<agaASTNode> &parentNode) : agaASTNode (FunctionCallNode, parentNode) {}
v... | true |
c272ca93b1caccbd6f6216e450516e76faf28664 | C++ | TMRGZ/Practicas-Fundamentos-de-la-Programacion-UMA | /Apuntes/Recursividad/RecursividadParejas.cpp | UTF-8 | 396 | 3.328125 | 3 | [] | no_license | #include<iostream>
using namespace std;
unsigned parejas (unsigned n){
unsigned res;
if(n<=2){
res = 1;
}else{
res = parejas(n-1)+parejas(n-2);
}
return res;
}
int main(){
unsigned n, resultado;
cout << "introduce: ";
cin >> n;
resultado = p... | true |
05bae5006127352df91e9b78d5d435591762c205 | C++ | Amere/CompetetiveProgramming-Problems-Library | /Dhaka 2015 Asia Regionals/cOUNTINGwEEKend.cpp | UTF-8 | 1,716 | 2.625 | 3 | [] | no_license | #include <map>
#include <set>
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cmath>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <bitset>
using namespace std;
int INF... | true |
b1f37890f074341308b6ad0f1c1e383d9bb44170 | C++ | SignorMercurio/Gluttonous-Snake | /Snake.cpp | UTF-8 | 5,452 | 2.75 | 3 | [] | no_license | #include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
#define N 28
#define UP 72
#define DOWN 80
#define LEFT 75
#define RIGHT 77
using namespace std;
typedef struct{int x, y;}point;
point snake[400], food, next_head;//next_head pos of head
char game_map[N][N];
int head, tail;
int lv, len, i... | true |
f222a56b5cd95ecc7cc553efd81743c81448c315 | C++ | Digital-Monk/OpenTESArena | /OpenTESArena/src/World/LevelInstance.cpp | UTF-8 | 3,297 | 2.71875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include "LevelInstance.h"
#include "components/debug/Debug.h"
void LevelInstance::init()
{
this->changedVoxels.clear();
this->voxelInsts.clear();
}
Int3 LevelInstance::makeVoxelCoord(WEInt x, int y, SNInt z)
{
return Int3(x, y, z);
}
LevelInstance::ChangedVoxel *LevelInstance::findVoxel(WEInt x, int y, SNInt z)... | true |