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
d96da599145c7032ddab96424db6911bf4ecb98e
C++
Newbie-W/ProgrammerAlgorithmInterview
/01 链表/11 如何判断两个单链表(无环)是否相交/题目/3.cpp
UTF-8
2,238
3.671875
4
[]
no_license
/* 单链表相交指的是两个链表存在完全重合的部分(两链表 从中间某个位置到最终是一样的)。要求判断两个链表是否相交,如果相交,那么找出相交处的结点。 思路步骤: 如果两个链表相交,那么两个链表从相交点到链表结束都是相同的结点,必然是Y字形,所以判断两个链表的最后一个结点是不是相同即可。即, (1)先遍历一个链表,直到尾部; (2)再遍历另外一个链表,如果也可以走到同样的结尾点,则两个链表相交 (3)若相交,记下两个链表的长度n1、n2; (4)再遍历一次,长链表结点先出发前进|n1-n2|步,之后两个链表同时前进,每次一步,相遇的第一点即为两个链表相交的第一个点<br> 时间复杂度 O(n1+n2)( 假设这两个链表长度分别为...
true
cbf76efabcb9c90c3bb08035dd399d4684432d3f
C++
wertkh32/MetalKitten
/perfmon.h
UTF-8
773
2.84375
3
[]
no_license
#pragma once #include <windows.h> typedef struct { LARGE_INTEGER start; LARGE_INTEGER stop; } stopWatch; class perfmon { stopWatch timer; LARGE_INTEGER frequency; float LIToMSecs( LARGE_INTEGER & L) { return ((float)L.QuadPart /(float)frequency.QuadPart) * 1000 ; } public: perfmon(void) { ...
true
c25fa7cf4e16a219c726a89d6acae66347c07f7f
C++
hausp/falk
/include/ast/declaration.hpp
UTF-8
786
2.84375
3
[]
no_license
#ifndef AST_DECLARATION_HPP #define AST_DECLARATION_HPP #include "node.hpp" namespace ast { // Captures behavior of declarations. // Basically, constructs a node with any data and // add other node as subnode. // Does not allow operations and provides a explicit // method to extract the node. ...
true
58b5ef60a4e9c46bb9efb99ee30e7f7368771ad0
C++
Jeffrey-W23/AIE-Assignment-GameProject
/project2D/GameState.h
UTF-8
3,303
3.03125
3
[ "MIT" ]
permissive
// #include, using, etc #pragma once #include "State.h" #include "Texture.h" class ObjectPool; //-------------------------------------------------------------------------------------- // GameState object. Inheritance from State. //-------------------------------------------------------------------------------------- ...
true
d0eeb617abddf013320b2e07d0c89df442bc1400
C++
punisher21maximum/Data-structures
/LinkList_Stack_Queue/count_nodes.cpp
UTF-8
3,154
3.578125
4
[]
no_license
#include<stdio.h> #include<stdlib.h> struct Node { int data; struct Node * next; }; void display(struct Node * head) { struct Node * temp; temp = head; printf("\n"); while(temp) { printf("%d ", temp->data); temp=temp->next; } } void insert(struct Node ** head, int data, int insert_in...
true
a43d0017014b556b1bc4cb47d811d7a1c073d724
C++
MasterGeneiJin/ProjectEuler
/ProjectEuler/Euler_42.cpp
UTF-8
340
2.65625
3
[]
no_license
#include "Euler.h" int Euler::CodedTriangleNumbers() { std::vector<std::string> names = EulerUtility::openWordFile("E:\\Euler Resources\\Euler 42.txt"); int count = 0; for (std::string name : names) { int total = 0; for (char n : name) total += n - 64; if (EulerUtility::isTriangle(total)) ++count; ...
true
3e50c6aab16de415f1760af4474d5be7ea403cfd
C++
marsp0/Starfighter
/src/Grid.cpp
UTF-8
2,556
3.109375
3
[]
no_license
#include "Grid.hpp" #include <set> Grid::Grid() : m_objects(10, std::vector<Cell>()) { // The grid is composed of a vector of vectors // it is a 10 x 10. 80px wide and 60px high for (int i=0 ; i < 10 ; i++) { for (int j = 0; j < 10 ; j++) { m_objects[i].push_back(Cell...
true
8c1743e112d2f73aee3a8c8122f82a73004717e3
C++
Brilliantrocks/leetcodelib
/72.编辑距离.cpp
UTF-8
2,891
3.25
3
[]
no_license
/* * @lc app=leetcode.cn id=72 lang=cpp * * [72] 编辑距离 */ // @lc code=start #include <string> #include <vector> using namespace std; class Solution { public: int minDistance(string word1, string word2) { int m = word1.size(), n =word2.size(); vector<vector<int>> dp(m+1,vector<int>(n+1,0)); ...
true
08d52e05cadfb89c31085a887e67ffa5eb3f6c7f
C++
dawsbot/dataStructures
/hangman_project/SOLOYOLO/code/hangman.hpp
UTF-8
2,182
3.390625
3
[]
no_license
/*=================================================================================== Author: Dawson Botsford Student ID: 102003505 *I was the one who talked to you about splitting off from my group because I did not believe the project was big enough for a group of 5 people. So here goes nothing solo-style! ...
true
d51fbb5b885b13317c3579385f2debb2b661254a
C++
lilelr/LeecodeProblemsSolutionsByC-
/dp/create_maximum_number_321.cpp
UTF-8
5,991
3.46875
3
[]
no_license
// // Created by YuXiao on 5/14/18. //https://leetcode.com/problems/create-maximum-number/description/ // https://leetcode.com/problems/create-maximum-number/discuss/77300/C++-DP+greedy-Solution-should-be-easy-to-understand #include <string> #include <iostream> #include <vector> #include <cstdio> using namespace std; ...
true
a2fffbb578aeee2c3a63b54183aad1a8d5d3f7b4
C++
wanttobeno/gb
/gb_ini_test/gb_ini_test.cpp
GB18030
1,588
2.71875
3
[ "LicenseRef-scancode-public-domain" ]
permissive
/* test_ini_handler Ӧʼշ1Ϊڵֵ½ж name=QQ version=8.0.16954.0 [license] name=Copyright (C) 1999-2015 Tencent. All Rights Reserved [author] name=Tencent */ #define GB_INI_CPP #define GB_INI_IMPLEMENTATION #include "gb_ini.h" #include <stdio.h> #include <stdlib.h> struct Library { char const *name; int versi...
true
08529bb71e784dfc74f1257139c6651f56942fb0
C++
RonanQuill96/Portfolio
/Ray Tracing/Ray Tracing/ImageData.h
UTF-8
1,433
3.40625
3
[]
no_license
#pragma once #include "Vector3.h" #include <algorithm> #include <filesystem> #include <fstream> #include <iostream> #include <mutex> template<size_t width, size_t height> class ImageData { public: void Write(Vector3 item, size_t x, size_t y) { std::lock_guard<std::mutex> lockguard(mutex); data[y][x] = item; ...
true
68e89ac65632011e20e8c973de3789366013ed3c
C++
soumaya-nheri/Smart-parental-monitoring-system-2A28
/electromenager.cpp
UTF-8
5,362
2.9375
3
[]
no_license
#include "electromenager.h" #include <QSqlQuery> #include <QDebug> #include <QtDebug> #include <QObject> electromenager::electromenager() { matricule_machine=0; type_machine=""; etat_machine=0; emplacement_machine=""; } electromenager::electromenager(int matricule_machine, QString type_machine, int etat_machine, QStr...
true
c452f9c0b6a6cfe0a9f3432695a7f9fece8bc421
C++
piratjocke/Project-Flight-School
/ProjectFlightSchool/ProjectFlightSchool/Game.cpp
UTF-8
3,475
2.796875
3
[]
no_license
#include "Game.h" /////////////////////////////////////////////////////////////////////////////// // PRIVATE /////////////////////////////////////////////////////////////////////////////// void Game::ServerInit( std::string port ) { if( !mServerIsActive ) { mServer = new Server(); if ( mServer->Initiali...
true
1dcc2627e92db955ed4e8d3573b3b79e2f751382
C++
themathgeek13/OpenGLPractice
/checkpoints/4_blending.cpp
UTF-8
1,475
2.84375
3
[]
no_license
// // Created by rohan on 8/15/20. // #include <string> #include <sstream> #include <functional> #include <iostream> #include <GLFW/glfw3.h> #include <glm/vec3.hpp> #include <glm/matrix.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> #include "GraphicsManager.hpp" #include "Mesh.hpp" v...
true
469a7f5cf3ed33f3f1da449c50066caf5619518a
C++
zzcym/NEUQ-ACM-Solution
/week2/李轩屹/7-3 归并排序.cpp
UTF-8
785
2.65625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; const int maxn=1e5+10; void merge(int *a,int l,int r){ if(l==r) return; else if(l==r-1){ int temp; if(a[l]>a[r]) temp=a[l],a[l]=a[r],a[r]=temp; return ; } else{ int mid=(l+r)/2; merge(a,l,mid); merge(a,mid+1,r); int p=l,q=mid+1,b[m...
true
f2dbd8f0357a87be20a0e730cf552485ce8132b8
C++
RMoraffah/hippo-postgresql
/src/include/izenelib/include/util/driver/Request.h
UTF-8
2,622
2.6875
3
[ "Apache-2.0", "PostgreSQL" ]
permissive
#ifndef IZENELIB_DRIVER_REQUEST_H #define IZENELIB_DRIVER_REQUEST_H /** * @file izenelib/driver/Request.h * @author Ian Yang * @date Created <2010-06-10 14:37:01> */ #include "Value.h" #include "RestrictedObjectValue.h" #include "Keys.h" #include <string> namespace izenelib { namespace driver { class Request : p...
true
4096df244383ba57b0845e3154e87854f77da647
C++
sandeepshiven/cpp-practice
/Tree/Binary Tree/Count Nodes in a Complete Binary Tree/myBetter.cpp
UTF-8
1,332
3.3125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; #define null NULL class Node{ public: int key; Node *left; Node *right; Node(int k){ key = k; left = right = null; } }; int isComplete(Node *root){ if(root == null){ return 0; } in...
true
2fa3ba3aa952d06b4a43dce85c5c8162fa166c75
C++
alexthorne90/msc_robot_arm
/src/ldc1614.h
UTF-8
2,746
2.796875
3
[ "MIT" ]
permissive
/** * @file ldc1614.h * @author Alex Thorne * @version 1.0 */ #ifndef LDC1614_H #define LDC1614_H #include <Arduino.h> #include <Wire.h> class Ldc1614 { public: Ldc1614(); //Functionality void AttachComms(void); uint8_t WriteReg(uint8_t reg, uint16_t value); uint16_...
true
d132b9727401389cf5aa825a284fd05d34b3a951
C++
TristinL/C-plus-plus
/double_int_function.cpp
UTF-8
243
3.453125
3
[]
no_license
// Double integer function #include<iostream> int doublenumber (int); int main(){ int x; std::cout<<"Enter a number: "; std::cin>>x; doublenumber(x); } int doublenumber(int a){ a = a*2; std::cout<<a<<std::endl; }
true
1550c112286bed54dfb3b7f7a86f213ba146475a
C++
khaled3ttia/openmp-accessors
/examples/vec_add_base.cpp
UTF-8
798
2.796875
3
[ "MIT" ]
permissive
#include <random> #include <iostream> #include <omp.h> #include "utils.h" constexpr int NROWS = 1; constexpr int NCOLS = 10; int main(){ int* a = new int[NROWS * NCOLS]; int* b = new int[NROWS * NCOLS]; int* c = new int[NROWS * NCOLS]; generateIntMatrix(NROWS, NCOLS, 0.7, a); std::cout << "A...
true
45b5e87ae6b09784d6d17c1f4120135b8b69151b
C++
pfaltynek/advent-of-code-2017-cpp
/day12/main.cpp
UTF-8
3,290
2.734375
3
[]
no_license
#include <fstream> #include <iostream> #include <map> #include <regex> #include <vector> #define TEST 0 std::regex line_template("^(\\d+) <-> (\\d+)(, \\d+)*$"); std::regex parts_template("^(\\d+) <-> (.+)$"); std::vector<int> Split(std::string to_split, const std::string &delimiter) { std::vector<int> result; siz...
true
88b738ac411d19eef51e74b2f611b326a9b64852
C++
alex-torregrosa/TheGame
/newDijkstra.cc
UTF-8
1,603
2.53125
3
[]
no_license
#include "Player.hh" // Search comparisons enum cmpSearch { CMP_CITY, CMP_ENEMY }; pair<Dir, Dir> dijkstra(const Pos& pos, cmpSearch ct, const Unit& u) { intMat prices(rows(), intV(cols(), -1)); posMat parents(rows(), posV(cols())); boolMat visited(rows(), boolV(cols(), false)); PosPQ pq; pq.push(dPos(pos, 0...
true
3b94613a964b18d688200059388d6d9eb81294ad
C++
iAmtheSystem/hopfenlicht
/Fade/Fade.ino
UTF-8
4,360
3.234375
3
[]
no_license
const int LED1 = 11; const int LED2 = 10; const int LED3 = 9; const int LED4 = 6; const int SPEEDFAKTOR = 1; // Setting up the system void setup() { pinMode(LED1, OUTPUT); pinMode(LED2, OUTPUT); pinMode(LED3, OUTPUT); pinMode(LED4, OUTPUT); Serial.begin(9600); // to communicate with the PC } void allLights(...
true
f5cec1d2b51cd56a8b90d515f81481a0e52fe484
C++
PetricaP/Renderel
/include/Transform.hpp
UTF-8
1,278
2.796875
3
[ "MIT" ]
permissive
#ifndef TRANSFORM_HPP #define TRANSFORM_HPP #include "math/Mat4.hpp" #include "math/Quaternion.hpp" #include "math/Vec3.hpp" namespace renderel { template <typename T = float> class Transform { private: math::Vec3<T> m_Position; math::Quaternion<T> m_Rotation; math::Vec3<T> m_Scale; public: Transform(const ...
true
35d3096fdce4c3ae2b9af228f10d5b36c7b7b17d
C++
SergiuPalc/IEPPROJ
/Server/outputpin.cpp
UTF-8
703
2.640625
3
[]
no_license
#include "outputpin.h" #include "bcm2835.h" #include "Pin.h" OutputPin::~OutputPin(void) { } void OutputPin::settoPin(uint8_t level) { if (level) bcm2835_gpio_set(level); else bcm2835_gpio_clr(level); } OutputPin::OutputPin(int id, int direction) :Pin(id, direction) { //set pin as output in register. we ma...
true
195753e566c6ec6457676d89dd79d3e952d0d29f
C++
dvpashnev/RestaurantWinAPI
/RestaurantWinAPI_1_2/Dish.cpp
UTF-8
5,735
3
3
[]
no_license
#include"header.h" Dish::Dish(const wstring& title /*= "N/A"*/, double price /*= 0.0*/, int portion /*= 0*/, TypeDish type /*= COLD*/, TimeDay tDD /*= MORNING*/, const wstring& description /*= "N/A"*/, const wstring& picPath /*= "N/A"*/, int num /*= 1*/) : title_(title), price_(price), portion_(portion)...
true
60cfea530cd3336322e4ce7cc1db053b14264bbb
C++
MikePopoloski/slang
/include/slang/util/Iterator.h
UTF-8
16,941
3.15625
3
[ "MIT" ]
permissive
//------------------------------------------------------------------------------ //! @file Iterator.h //! @brief Helper classes for working with iterators // // SPDX-FileCopyrightText: Michael Popoloski // SPDX-License-Identifier: MIT //------------------------------------------------------------------------------ #pra...
true
2e26cbdca2a13d541fc0b63b8961111a4e688461
C++
matheusmso/code
/uri/1068.cpp
UTF-8
653
2.84375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main(){ stack<char> s; char c; bool bad = false; do { c = getchar(); if (c == '(') s.push(c); if (c == ')') { if (s.size() > 0 && s.top() == '(') s.pop(); else ...
true
28c36c020ac7d7596dea87110d40ccbba45062e0
C++
Andreskammerath/Competitive_Programming
/UVa judge/Uva11450.cpp
UTF-8
1,484
3.046875
3
[]
no_license
#include <bits/stdc++.h> #include <iostream> using namespace std; int minimo(int a,int b) { int min = a; if(b < a) min = b; return min; } int shop(int money, int C, map<pair<int,int>,int> &my_map, vector<vector<int> > &v, int i, int j) { int min = 0;//numer to return map<pair<int,int>,int>:: iterator ...
true
7d63bb036a4788fc6ce36e9a452738432905ef0a
C++
NCCA/FilesAndParsing
/FileIO/ReadLine.cpp
UTF-8
610
3.125
3
[]
no_license
#include <iostream> #include <fstream> #include <string> #include <cstdlib> int main(int argc, char *argv[]) { if (argc <=1) { std::cout <<"Usage FileRead [filename] \n"; exit(EXIT_FAILURE); } std::fstream fileIn; fileIn.open(argv[1],std::ios::in); if (!fileIn.is_open()) { std::cout <<"File : "<<argv[1]...
true
56af9ded47d4b333c1b82824736daf6be1747850
C++
artiumdominus/hierarchical-heavy-hitters
/tratador_redutor.cpp
UTF-8
2,380
2.71875
3
[]
no_license
/* Trata um arquivo gerado por tcpdump filtrando as linhas que se encaixam no padrao: IP x.y.z.w.v > m.n.o.p.q: tcp s e as resumindo para o padrao: x.y.z.w m.n.o.p s Assim gerando uma entrada formatada para o algoritimo Overlap_Offline. */ #include <iostream> #include <fstream> #include <string> #include <string.h> #i...
true
8f7e4aba24e05e4e33406a190dd253ef6f2f1e1c
C++
omar-mohamed/OnlineJudges-solutions
/UVA-problems/Hello Recursion.cpp
UTF-8
412
3.125
3
[]
no_license
//#include<iostream> //using namespace std; //int arr[105]; //int Summation(int length) //{ // if(length==0) // return 0; // else // return arr[length-1]+Summation(length-1); //} // //int main() //{ // int cases,length; // cin>>cases; // for(int i=1;i<=cases;i++) // { // cin>>length; // for(int j=0;j<length;j++) //...
true
823ed603965aa42f862a66199139feee52e0ee5f
C++
Canopius/School-Tasks
/OtherCode/Input Validation/Input Validation/Source.cpp
UTF-8
897
3.515625
4
[]
no_license
#include <iostream> #include <string> class Response { public: int age; std::string name; std::string emailAddress; }; bool checkAge(int age) { if (age < 16 || age > 100) { std::cout << std::endl << "Age is not within the valid range!"; return true; } else { return fals...
true
4143ac8d374266c811bf8a4b61f55ae6836b8206
C++
Ezibenroc/satsolver
/src/structures/graph.h
UTF-8
571
2.9375
3
[ "MIT" ]
permissive
#ifndef STRUCTURES_GRAPH_H #define STRUCTURES_GRAPH_H #include <set> namespace graphsolver { class Graph { private: int nodes_count; int *values; std::set<int> **adjacency; public: Graph(int nodes_count, int default_value); Graph(const Graph&); Graph& operator...
true
1b0c5efe0d8ecf178f9fe3fac5f4d52d8ce788a7
C++
yzhaiustc/PP-CNN
/pp_cnn/src/cnn/conv2d.hpp
UTF-8
1,351
2.546875
3
[ "Apache-2.0" ]
permissive
#pragma once #include "layer.hpp" using std::size_t; const string CONV2D_CLASS_NAME = "Conv2D"; class Conv2D : public Layer { public: Conv2D(const string& name, const size_t& in_height, const size_t& in_width, const size_t& in_channels, const size_t& filter_size, const size_t& filter_height, con...
true
f98dba85872daa599ad8af3be5d6b8fde6d5681f
C++
38609/cpp_lab_3
/player.cpp
UTF-8
1,070
3.59375
4
[]
no_license
#include <iostream> #include <vector> #include "player.h" Player::Player(string firstName, string lastName, int growth, vector<string> skills) { this->firstName = firstName; this->lastName = lastName; this->growth = growth; this->skills = skills; } string Player::getFirstName() { return this->firs...
true
ab60b2930c98affbd35553082cf2f3966535162f
C++
anchor-huang/Snapmaker2-DialMeshLeveling
/arduino_dial_indictor_reader/src/main.cpp
UTF-8
3,475
2.640625
3
[]
no_license
#include <Arduino.h> #include <Wire.h> /* I2C Bus Slave */ #define I2C_ADDRESS 0x32 #define READ_SENSOR_CMD 0x01 #define INVALID_CMD 0x00 /* Hardware pins */ const uint8_t ledPin = 13; // the number of the LED pin const uint8_t clkPin = 10; const uint8_t dataPin = 8; const uint8_t readyPin = 1; /* Cons...
true
9b0e71484820800aacf46385dc18d99e82f3ae26
C++
jameskkk/BlueScreenOfDeath
/BlueScreenOfDeath/BlueScreenOfDeath.cpp
UTF-8
2,327
2.75
3
[]
no_license
// BlueScreenOfDeath.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <Windows.h> #include <winternl.h> #include <iostream> #include <cstdlib> #pragma comment(lib, "ntdll.lib") using namespace std; EXTERN_C NTSTATUS NTAPI RtlAdjustPrivilege(ULONG, BOOLEAN, BOOLEAN, PBOOLEAN...
true
b3ac5bfd2e66cb89df854e35d77e26c82f594240
C++
JoeAltmaier/Odyssey
/Odyssey/SSAPI_Server/ManagedObjects/StorageElement.h
UTF-8
1,817
2.609375
3
[]
no_license
//****************************************************************************** // FILE: StorageElement.cpp // // PURPOSE: Implements the class that will serve as an bastract base class // for storage elements in the O2K that can be used for creation // of other storage elements. //*********************...
true
a24f40bf30ae18f8f6ca478accd6c561a696a0c9
C++
jaronho/sdk
/base/cxx/algorithm/algorithm/sm3/sm3.h
UTF-8
2,789
2.859375
3
[]
no_license
#pragma once #ifdef __cplusplus namespace algorithm { extern "C" { #endif /** * @brief SM3 context structure */ typedef struct { unsigned long total[2]; /* number of bytes processed */ unsigned long state[8]; /* intermediate digest state */ unsigned char buf...
true
5641c41a74b0597c2a34e86a7c178da47b5f351e
C++
bhusingh/C--Programs
/C--Programs/linkedListAltrev.cpp
UTF-8
576
3.578125
4
[]
no_license
#include<iostream> using namespace std; struct node { int data; struct node *link; }; void addAtBeg(struct node **head,int data) { struct node *temp = new node; temp->data = data; temp->link = *head; *head = temp; } void printList(struct node *head) { while(head) { cout<<head->data<<endl; head = head->link;...
true
62fd9ced6abbb24d65b1473e6370dc19d8455df3
C++
isac322/BOJ
/8932/8932.cpp
UTF-8
510
2.578125
3
[ "MIT" ]
permissive
#include <cstdio> #include <cmath> using namespace std; const double a[] = {9.23076, 1.84523, 56.0211, 4.99087, 0.188807, 15.9803, 0.11193}; const double b[] = {26.7, 75, 1.5, 42.5, 210, 3.8, 254}; const double c[] = {1.835, 1.348, 1.05, 1.81, 1.41, 1.04, 1.88}; int main() { int n, tmp; scanf("%d", &n); for (int...
true
735bc655710f87ead4d855514bd648586c3aa411
C++
manofmountain/LeetCode
/147_InsertionSortList.cpp
UTF-8
831
3.1875
3
[]
no_license
//28.3% /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* insertionSortList(ListNode* head) { if(!head || !head -> next) return head; ListNod...
true
cdeb9ab24cd21a06a3c43cf870c810d2073cf4f2
C++
ZachHirst-HighSchoolCodingClasses/Chapter-4-5
/RomanNumeralTranslator/RomanNumeralTranslator/Source.cpp
UTF-8
1,156
3.53125
4
[]
no_license
// Author Zach Hirst // 4/11/18 // Hawkeye Challenge Problem #include<iostream> int main() { //variables int V = 5; int X = 10; int I = 1; double numI; double numX; double numV; double total; //user input std::cout << " Welcome to the Roman Numeral translator \n What can I translate for you today? " << st...
true
2a3b45b51be09350f203e7c780f16d0a414642ad
C++
hvariant/hackerrank
/cpp/lc-tree-zigzag/main.cpp
UTF-8
1,641
3.5625
4
[]
no_license
#define CATCH_CONFIG_FAST_COMPILE #define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> #include <vector> #include <queue> namespace { struct TreeNode { int val; TreeNode *left{nullptr}; TreeNode *right{nullptr}; TreeNode(int x) : val(x) {} }; } class Solution { public: std::vector<std::vector...
true
4df9ada5680c8095b5757abaef2261c0971eb0b4
C++
f-nely/estrutura-dados-estacio
/estrutura_dados/pilha_exemplo_01.cpp
UTF-8
1,337
3.65625
4
[]
no_license
#include <iostream> #define TAM 2 using namespace std; void empilhar(int p[], int &t, int v); int desempilha(int p[], int &t, int &v); void acessoTopo(int p[], int &t); void exibirElementos(int p[]); int main() { int pilha[TAM], topo = -1, val, resp; for (int i = 0; i < TAM; i++) { cout << "Digit...
true
da5b7eedd7fa2651a3aa62f5885534a782af04cb
C++
msanchezzg/UVaOnlineJudge
/12000-12999/12750/keepRafaAtChelsea_12750.cpp
UTF-8
515
2.8125
3
[]
no_license
#include <iostream> using namespace std; int main(){ int cases, games, cont, loseCont; char result; bool out; cin >> cases; for(int i=1; i<=cases; i++) { cin >> games; cont = 0; loseCont = 0; out = false; for(int j=0; j<games; j++) { cin >> result; if (out) continue; cont++; if (result !...
true
443c9bd8bc76d1ff8bc8770d87e2bb2a48ff5d90
C++
DylanGuedes/uva-problems
/627.cpp
UTF-8
2,009
2.9375
3
[]
no_license
#include <iostream> #include <vector> #include <sstream> #include <queue> #include <cstring> using namespace std; #define FOR(i, j, k) for(int i=j; i < k; ++i) #define MEMSET(i) memset(i, 0, sizeof i) vector<int> graph[325]; int father[325]; int visited[325]; void print_fathers(int idx) { if (father[idx] == idx...
true
d1eef005bf7598d632bb6ebf6b485adec456df88
C++
vvancak/ir
/follower/motor.cpp
UTF-8
429
2.96875
3
[]
no_license
#include "motor.hpp" Motor::Motor(int max_update) { _max_update = max_update; _current_speed = 0; } void Motor::set_speed(int percentage) { int diff = percentage - _current_speed; if (diff > _max_update) diff = _max_update; if (diff < -_max_update) diff = -_max_update; _current_speed += diff;...
true
87c3924075ea08fa79183d4b05b135104e24e133
C++
Shada/Wanshift
/StortSpelprojekt/NonaNode.h
UTF-8
2,078
2.6875
3
[]
no_license
#pragma once #include "CullingNode.h" //#include "PlayerContainer.h" //#include "TerrainContainer.h" #define QUADSIZE 20 #define CHUNKSIZE 256 #define TINYSPLITTING 15 //the amount of sub-chunks per axis in a small chunk (eg, 15 means there are 15x15 sub-chunks in the chunk) #define MEDIUMSPLITTING 3 //the amount of s...
true
ce8b9eb4904215e465198ce1eda7b798d621ef01
C++
skilincer/C-Alistirma
/5.soru.cpp
ISO-8859-9
436
2.90625
3
[]
no_license
#include<stdio.h> #include<conio.h> main(){ int x, *isaret; x = 10; isaret = &x; printf("x in degeri = %d\n",x); // bunlar bilgilendirme amal printf("x in adresi = %x\n",isaret); // pointer mantg burdan incelenebilir. printf("x in deeri = %d\n",*isaret); printf("x in adresi = %x\n",&x); int dizi[]={2,3,1,5...
true
96348c122c5a1d86f1e0256adc3b49979bef1193
C++
TakuyaKimura/Leetcode
/283 Move Zeroes/283.cpp
UTF-8
658
3.765625
4
[]
no_license
/* Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, given nums = [0, 1, 0, 3, 12], after calling your function, nums should be [1, 3, 12, 0, 0]. Note: You must do this in-place without making a copy of the array. Minim...
true
6df7ee2b2e037ce2b97f7457b6cacc785f71fa52
C++
face4/AOJ
/Volume05/0567.cpp
UTF-8
572
2.953125
3
[]
no_license
#include<iostream> #include<algorithm> using namespace std; int main(){ int n, a, b, c; cin >> n >> a >> b >> c; int topping[n]; for(int i = 0; i < n; i++) cin >> topping[i]; sort(topping, topping+n); reverse(topping, topping+n); int cal = c, cost = a; for(int i = 0; i < n; i++){ ...
true
f39fa834bda1320540fed7b1b7e94f9b7da4f1ca
C++
dimitarkole/CPlusPlusTasks
/C++/skola/sum.cpp
UTF-8
239
2.703125
3
[]
no_license
#include<iostream> using namespace std; int main() { int ch1,ch2,ch3; cin>>ch1>>ch2>>ch3; if((ch1==ch2)&&(ch1==ch3)) cout<<ch1<<ch2<<ch3; else if(ch2==ch3)cout<<ch1<<ch2<<ch3<<ch1; else cout<<ch1<<ch2<<ch3<<ch2<<ch1; }
true
afc8a351affa53f8f520e92f3ac10bda3f6eec4a
C++
AbeleMM/Algorithmic-Problems
/School/Clasa a VIII-a/Ianuarie 2014/porumb1/main.cpp
UTF-8
535
2.75
3
[ "MIT" ]
permissive
#include <iostream> #include <fstream> using namespace std; ifstream in("porumb1.in"); ofstream out("porumb1.out"); int nr,n,nra,x,ult,nt; int main() { in>>n>>x; nr=n; nra=0; ult=1; nt=1; if(n%2==0) out<<n/2<<"\n"; else out<<n/2+1<<"\n"; while(nr>0) { nr...
true
b5789fbbed59e7627440a46c9a8a5452c9289374
C++
thuynh02/relationGame
/src/ofCharacter.cpp
UTF-8
5,217
2.9375
3
[]
no_license
// // ofCharacter.cpp // relationGame // // Created by Emrys on 6/20/14. // #include "ofCharacter.h" #define PROBTIME 5 // Default Constructor - Used to create a character ofCharacter::ofCharacter( string name, string introduction, string bodyPath, string basePath, string eyesPath, string hairPath, string shoesPat...
true
c81cb568581abd5b9cdaa1a0aa6cc3855d915c1b
C++
habrade/epics-wb
/src/ewbbridge/EWBBridge.h
UTF-8
2,069
3.09375
3
[]
no_license
/* * EWBBridge.h * * Created on: Jun 15, 2015 * Author: Benoit Rat (benoit<AT>sevensols.com) */ #ifndef EWBBRIDGE_H_ #define EWBBRIDGE_H_ #include <stdlib.h> #include <stdint.h> #include <string> /** * Polymorphic & abstract class memory bridge to a EWB device. * * The inherited class: * - must over...
true
d2a07b2ce067caa324115b4c13f412cdd336e50c
C++
derekzhang79/Algorithm-Training
/C/decoding.cpp
UTF-8
1,445
2.875
3
[]
no_license
#include<stdio.h> #include<string.h> int readchar(){ for(;;){ int ch = getchar(); if(ch != '\n' && ch !='\r') return ch;//一直读取到非换行符为止 } } int readint(int c){ int v = 0; while(c--) v = v * 2 + readchar() - '0'; return v; } int code[8][1<<8]; void printcodes(){ for(int len=1;l...
true
2ad7ce88ebe4857d03ca689db2030f82b242c61d
C++
NewLewis/LeetCode
/leetcode328.cpp
UTF-8
712
3.15625
3
[]
no_license
#include <iostream> #include "MyList.h" using namespace std; class Solution { public: ListNode* oddEvenList(ListNode* head) { if(!head || !head->next) return head; ListNode *L1 = NULL,*L2 = NULL; ListNode *P = head,*res1,*res2; int k = 1; while(P){ if(k%2 ...
true
2481cc297cbc34636fc6b52c4580bf1be2e259ff
C++
AlexTahiata/Apprendre_Cpp
/TPPolymorphisme/segment.cpp
UTF-8
840
3.15625
3
[]
no_license
#include "segment.h" Segment::Segment(int _numero, int _vitesse, const double _longueur, const double _angle): Element(_numero, _vitesse), longueur(_longueur), angle(_angle) { } void Segment::Afficher() { cout << "SEGMENT L = " << longueur; cout << " " << "A = " << angle; cout << " " <<...
true
0333c3272e874c943939193115c3945e1326f46e
C++
TamoghnaChattop/EE-569---Digital-Image-Processing
/Project 3/Source Code_EE_569_Hw_Assignment_3_8541324935_Chattopadhyay/HW3Prob1b.cpp
UTF-8
10,396
3.03125
3
[]
no_license
// EE569 Homework Assignment #3 // Date: March 7, 20018 // Name: Tamoghna Chattopadhyay // ID: 8541324935 // email: tchattop@usc.edu #include <stdio.h> #include <iostream> #include <fstream> #include <math.h> #include <algorithm> #include <stdlib.h> #include <time.h> class image { p...
true
0d0d8d1af1e8eba69e480cd98398a2990b98bd67
C++
shudipta/competitve-programming
/online-judges/leetcode/289.game-of-life.cpp
UTF-8
1,144
2.765625
3
[]
no_license
/* * @lc app=leetcode id=289 lang=cpp * * [289] Game of Life */ // @lc code=start class Solution { int R[8] = {-1, -1, -1, 0, 1, 1, 1, 0}; int C[8] = {-1, 0, 1, 1, 1, 0, -1, -1}; public: void gameOfLife(vector<vector<int>>& board) { int n = board.size(); int m = board[0].size(); ...
true
b8d4997c616927b4a62111009f13869a9b6dd349
C++
IgnacioAlmeida/DatalogInterpreter
/Relation.cpp
UTF-8
6,450
2.921875
3
[]
no_license
// // Created by Ignacio R. de Almeida on 5/22/21. // #include "Relation.h" std::string Relation::ToString() { std::string output; for (const Tuple& t : rows){ std::vector<std::string> values = t.GetValues(); for(unsigned int i = 0; i < header.GetAttributes().size(); i++){ if(i !...
true
ab6f1a8b2ccf0982e299edf69c397d93cf0601e5
C++
trushton/advancedGraphics
/Final/src/ps_update_tech.cpp
UTF-8
2,112
2.625
3
[]
no_license
// // Created by trushton on 7/28/15. // #include "ps_update_tech.h" PSUpdate::PSUpdate() { } void PSUpdate::init(){ //load and compile shaders loadShaders(); //link all shaders together initShaderProgram(); //get the variables from the shaders initShaderLocations(); //create the VAO ...
true
1f16cb5e89d975a844a2c38db1acffaaa3c2f364
C++
VolodymyrIvanov/Udacity-Path-Planning-Project
/src/car.cpp
UTF-8
1,878
3.109375
3
[]
no_license
/* * car.cpp * * Created on: 15.01.2018 * Author: VIvanov */ #include "car.h" Car::Car():Car(0.0, 0.0, 0.0) { } Car::Car(double s, double speed, double d) { init(s, speed, d); this->avg_steps = COSTS_AVERAGE_STEPS; this->target_lane = -1; } Car::~Car() { } void Car::init(double s, double speed, do...
true
e7fa63d331a6141cd740a2302d627c725052795e
C++
cs09g/AVL
/AVL.cpp
UHC
3,583
3.375
3
[]
no_license
// Զ inorder // Ʈ̵ , ȸ ʿ 쿡 ȸ (LL LR RR RL) ǥ. #include <iostream> #include <string> #define KEYTYPE string using namespace std; class Node{ public: KEYTYPE k; Node *left, *right; }; typedef Node Node; enum R_type{ LL, LR, RR, RL }; KEYTYPE in[] = { "k", "o", "m", "i", "n", "u", "v", "e", "r", "s", "t", "y", "c", ...
true
0b5e2de3851ada1486fee593954a7d758c255f55
C++
hjaremko/asciinem
/src/server/domain/weapon.cpp
UTF-8
882
2.796875
3
[ "MIT" ]
permissive
#include "server/domain/weapon.hpp" #include "server/domain/player.hpp" #include <utility> namespace asciinem::server::domain { weapon::weapon( std::string name, double value, int level, int attack ) : item( std::move( name ), value, level ), attack_( attack ) { } auto weapon::get_attack() const -> int { re...
true
4c537f4f604802654d06671d4ba1b7a34ed2261d
C++
harouwu/Mini-OS
/code/threads/threadtest.cc
UTF-8
12,021
3.078125
3
[ "MIT-Modern-Variant" ]
permissive
// threadtest.cc // Simple test case for the threads assignment. // // Create two threads, and have them context switch // back and forth between themselves by calling Thread::Yield, // to illustratethe inner workings of the thread system. // // Copyright (c) 1992-1993 The Regents of the University of California. // ...
true
2780c761cb03ed5eaacc0679944c8cd1ed9e20f8
C++
boyplus/competitive-programming
/codeforces/max.cpp
UTF-8
374
2.625
3
[]
no_license
#include <cstdio> #include <algorithm> using namespace std; int arr[100000]; int main(){ int n,k; scanf("%d %d",&n,&k); for(int i=0;i<n;i++){ scanf("%d",&arr[i]); } sort(arr,arr+n); int min = 2e9,c=0; for(int i=k-1;i<n;i++){ int temp = arr[i] - arr[c]; //printf("in %d %d\n",i,c); if(temp < min){ min =...
true
36f4a1214d48b85c7e60f203e90410f0a4a3eca7
C++
AnastasiyaNovikovaa/Laba-4.1
/Laba 4.1/Main.cpp
UTF-8
3,182
3.390625
3
[]
no_license
//#include "pch.h" #include <iostream> #include "LinkedList.h" #include "LinkedList.cpp" int main() { setlocale(LC_ALL, "Russian"); cout << "Hello! Laboratory work #1 \n"; cout << "by Novikova Anastasiya 7302\n"; cout << "You are welcome!"; cout << endl; LinkedList<int> lst; lst.push_back(4); lst.push_back(...
true
41174b1d6a2757de1c3263b5cfde5063647dce6b
C++
Ezibenroc/satsolver
/src/structures/formula.h
UTF-8
8,339
2.703125
3
[ "MIT" ]
permissive
#ifndef STRUCTURES_FORMULA_H #define STRUCTURES_FORMULA_H #include <vector> #include <string> #include <memory> #include <stack> #include <unordered_set> #include "solvers/abstract_assistant.h" #include "structures/clause.h" #include "structures/affectation.h" #include "structures/deductions.h" #include "structures/C...
true
ddc8b3443858902a4e1e8522b5cc31bfa2f2034e
C++
ronee12/Uva-Solutions
/rtable10195.cpp
UTF-8
379
2.84375
3
[]
no_license
#include<stdio.h> #include<math.h> int main() { double r,s,p,a,b,c; while(scanf("%lf%lf%lf",&a,&b,&c)!=EOF) { if(a!=0&&b!=0&&c!=0) { s=(a+b+c)/2; if(a<=s&&b<=s&&c<=s) { p=s*(s-a)*(s-b)*(s-c); r=sqrt(p)/s; printf("The radius of the round table is: %.3lf\n",r); } } else printf("The...
true
5cc6b30d9207cd480edac6c53fe5d74c7e3bd432
C++
FrankenRom/android_frameworks_base
/tools/aapt2/java/AnnotationProcessor.h
UTF-8
2,132
2.546875
3
[ "LicenseRef-scancode-unicode", "Apache-2.0" ]
permissive
/* * Copyright (C) 2015 The Android Open Source Project * * 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 app...
true
52294f7658b768392814afbcbd00be2140a08c9f
C++
zhaishuai/ERASuffixTree
/tree/iterators/TreeNodeNodeIterator.hpp
UTF-8
1,059
2.875
3
[]
no_license
#pragma once #include <iterator> #include "../TreeNodeAccessor.hpp" #include "../TreeEdgeAccessor.hpp" #include "TreeNodeEdgeIterator.hpp" class TreeNodeNodeIterator : public std::iterator<std::forward_iterator_tag, TreeNode*> { public: TreeNodeNodeIterator(const TreeNodeNodeIterator& it) : edgeIt(...
true
272c0bc40311fac2bc6b68cbf6dd2729530bae85
C++
sinisaabramovic/cpp_ogl
/RegocFX/source/window/Window.cpp
UTF-8
4,015
2.5625
3
[]
no_license
// // Window.cpp // RegocFX // // Created by Sinisa Abramovic on 04/09/2018. // Copyright © 2018 Sinisa Abramovic. All rights reserved. // #include "Window.hpp" Window::Window(const GLint &windowWidth, const GLint &windowHeight) : width(windowWidth), height(windowHeight), mouseFirstMoved(true) { xChange = 0....
true
3c2e115183913bd0c83881c5d5b5aa859cc9e97b
C++
VetalosUA-KR/WDP
/do-1-kolosa/recursion/WDI.cpp
KOI8-R
640
3.125
3
[]
no_license
#include<iostream> /// using namespace std; int fun_1_1(int n) { if(n == 0) return 3; else return 3 * fun_1_1(n-1) + 2; } int fun_1_2(int n) { if(n == 1) return -5; else return (fun_1_2(n-1)*2)-1; } int fun_1_3(int n) { if(n == 0) return 11; else return (fun_1_3(n-1)+1)/n; } int fun_1_...
true
d884a03c564541436fc7bde8a9f1f6fdf06ad288
C++
eayvali/ROS_projects
/Chase_a_Ball/catkin_ws/src/ball_chaser/src/process_image.cpp
UTF-8
3,711
3.125
3
[ "MIT" ]
permissive
#include "ros/ros.h" #include "ball_chaser/DriveToTarget.h" #include <sensor_msgs/Image.h> // Define a global client that can request services ros::ServiceClient client; // This function calls the command_robot service to drive the robot in the specified direction void drive_robot(float lin_x, float ang_z) { // R...
true
62d98a120f2119edcd2d513e773ee6674377bcdb
C++
SumitNagpal94/MCA
/C++/CollegeCodes/learn_conversion1.cpp
UTF-8
367
3.390625
3
[]
no_license
#include<iostream> using namespace std; class B { public: int a,b; void display() { cout<<"a is "<<a<<" and b is "<<b; } }; class A { int a,b; public: A(int x,int y) { a=x; b=y; } operator B() { B x; x.a=a; x.b=b; return x; } }; int main() { B b; A...
true
76e5385c694cb34943869970e53c3bd58dff32ae
C++
taivop/eth-algolab
/chunks/cgal/elementary/predicates.cpp
UTF-8
1,991
3.125
3
[]
no_license
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <iostream> using namespace std; typedef CGAL::Exact_predicates_inexact_constructions_kernel K; int main() { cout << "CGAL PREDICATES" << endl; // Documentation under 'Global kernel functions': http://doc.cgal.org/latest/Kernel_23/group__kern...
true
301e1e929d9f4c0356446bfc5f6acd8ec91430d0
C++
3s1d/fanet-base
/Src/fanet/frame/fname.cpp
UTF-8
716
2.609375
3
[]
no_license
/* * fname.cpp * * Created on: Sep 21, 2018 * Author: sid */ #include <string.h> #include "fname.h" int16_t FanetFrameName::serialize(uint8_t*& buffer) { const char *name = "todo"; /* prepare storage */ if(payload != nullptr) delete [] payload; payloadLength = strlen(name); payload = new uint8_t[p...
true
cac9f5e931a481ea37723f5b8ccc64b239046b57
C++
nhitran-tuni/programming2
/student/02/mean/main.cpp
UTF-8
687
3.96875
4
[]
no_license
#include <iostream> using namespace std; void mean ( int count_number) { int i = 1; float sum = 0.0; while ( i < count_number + 1) { cout << "Input " << i << ". number: "; float num; cin >> num; sum = sum + num; i ++; } if (count_number <= 0) { cout << "Cannot count mean value from...
true
f140beded94c12b7e6630beb7090164ff97c9b96
C++
Ckins/Learning-Notes
/leetcode/681.cpp
UTF-8
1,547
3
3
[]
no_license
class Solution { public: string nextClosestTime(string time) { int delta = 1440; unordered_set<char> s; for (auto c:time) { if (c != ':') s.insert(c); } string res = time; dfs(time, time, delta, 0, s, res); return res; } void dfs(strin...
true
1618d69c3b93444f8e2e7ab4b6e55410c2f0539f
C++
Aniket1102/Maze-King
/Main.cpp
UTF-8
772
3.0625
3
[]
no_license
// // Main.cpp // // CS 115 Assignment // // #include <string> #include <iostream> #include <fstream> #include "Direction.h" #include "Game.h" using namespace std; int main() { char newPosition; Game game("map5.txt"); do { game.printDescription(); cout <<"Next?"; ...
true
3955102b6722e9333a440e0267b5d2a8e198968c
C++
jamesu/xtal-language
/src/xtal/xtal_ch.h
UTF-8
1,070
3.03125
3
[ "Zlib", "MIT" ]
permissive
/** \file src/xtal/xtal_ch.h * \brief src/xtal/xtal_ch.h */ #ifndef XTAL_CH_H_INCLUDE_GUARD #define XTAL_CH_H_INCLUDE_GUARD #pragma once namespace xtal{ uint_t edit_distance(const void* data1, uint_t size1, const void* data2, uint_t size2); /** * \brief マルチバイト文字を組み立てるためのユーティリティクラス */ class ChMaker{...
true
e6a37ec4b955ed855d5ed7f0d83cb99b6ed32c92
C++
onewordstudios/sweetspace
/cugl/lib/2d/CUSlider.cpp
UTF-8
19,029
2.625
3
[]
no_license
// // CUSlider.cpp // Cornell University Game Library (CUGL) // // This module provides support for a slider, which allows the user to drag // a knob to select a value. The slider can be spartan (a circle on a line), // or it can have custom images. // // The slider can track its own state, relieving you of ha...
true
c5e787a6c4e7da89019cbd4ffc69ec0fb33d2f93
C++
robbykraft/Face
/src/SceneManager.cpp
UTF-8
3,343
2.546875
3
[]
no_license
// // SceneManager.cpp // sceneSwitcher // // Created by Robby on 5/6/16. // // #include "SceneManager.h" #include "appConstants.h" #include "ConicsScene.h" #include "hypercubeScene.h" #include "CirclesScene.h" #include "ArcsScene.h" #define NUM_SCENES 3 //------------------------------------------------------...
true
f4bdf33fd69677c00067d1ca2882081e614f6a4a
C++
Roshan2121/C-files
/Object Oriented Programming in C++/Class1.cpp
UTF-8
670
4.1875
4
[]
no_license
/* Defifnig a Class and its object. Initializing the objects of a class and how to use them. */ #include<iostream> using namespace std; class Practice { public: int age; string name; long salary; void printer() { cout<<"A preson with name "<<name<<" is aged "<<age<<" and earns a salar...
true
01580002a6c66e9088d1ca2e8fcf5179e740932c
C++
wenmingxing1/offer_code_for_github
/21_MinInStack.cpp
UTF-8
524
2.875
3
[]
no_license
class Solution { public: std::stack<int> stack_data, min_data; void push(int value) { stack_data.push(value); if (min_data.empty()) min_data.push(value); if (value < min_data.top()){ min_data.push(value); } else { min_data.push(min_dat...
true
6dcc9cd7683f50a10fa0e1fd6e1beeb69ca3228d
C++
pedro-esteves-pinto/mcbridge
/src/main.cpp
UTF-8
5,728
2.671875
3
[ "MIT" ]
permissive
#include "client/Client.h" #include "client/ClientConfig.h" #include "common/common.h" #include "server/Server.h" #include "test/Test.h" #include <CLI11/CLI11.hpp> #include <iostream> #include <string> #include <vector> using namespace mcbridge; uint32_t resolve_interface_ip(std::string const &interface_name) { a...
true
f7c26948cd219085a38076886227f36962acc67c
C++
Dies1rae/PYTHON
/lexer.h
UTF-8
12,338
2.9375
3
[]
no_license
#pragma once #include <iosfwd> #include <optional> #include <sstream> #include <stdexcept> #include <string> #include <variant> #include <vector> #include <algorithm> namespace parse { namespace token_type { struct Number { int value; }; struct Id { std::string va...
true
0905700d4796d83ebe2130059e992bfd31540a9a
C++
taruvar-mittal/DSA-Solutions
/Graphs/reorder paths to make all cities reach to city 0.cpp
UTF-8
2,363
3.5
4
[]
no_license
/* Leetcode 1466. Reorder Routes to Make All Paths Lead to the City Zero ques:- There are n cities numbered from 0 to n - 1 and n - 1 roads such that there is only one way to travel between two different cities (this network form a tree). Last year, The ministry of transport decided to orient the roads in one direction...
true
642ba8de72aa499f3e8e60b73236c44b8cf2c6c3
C++
LeeJehwan/Baekjoon-Online-Judge
/code/01212_8진수 2진수.cpp14.cpp
UTF-8
491
2.9375
3
[]
no_license
#include <iostream> using namespace std; char arr[340000]; char *str[] = { "000","001","010","011","100","101","110","111" }; char *str2[] = { "0","1","10","11","100","101","110","111" }; void solve(int len) { int num; for (int i = 0; i < len; i++) { num = arr[i]-48; if (i == 0) { cout << str2[num]; conti...
true
6b2aa883ae42719fe222befdfd84436a7a0e9fa0
C++
grtwall/kigs
/framework/Core/Sources/CoreItem.cpp
UTF-8
9,149
2.546875
3
[ "MIT" ]
permissive
#include "PrecompiledHeaders.h" #include "CoreItem.h" #include "CoreVector.h" #include "CoreMap.h" #include "maCoreItem.h" #include <type_traits> CoreItemSP CoreItemIteratorBase::operator*() const { if (mPos == 0) { return mAttachedCoreItem; } return CoreItemSP(nullptr); } CoreItemIteratorBase& CoreItemIterato...
true
331f405107770a01df8872ed783c73d098929999
C++
seokwoongchoi/angelscript-homework
/Framework/Math/Vector4.h
UTF-8
836
3.28125
3
[]
no_license
#pragma once class Vector4 final { public: Vector4() : x(0.0f), y(0.0f), z(0.0f), w(0.0f) {} Vector4(const float& x, const float& y, const float& z, const float& w) : x(x), y(y), z(z), w(w) {} Vector4(const Vector4& rhs) : x(rhs.x), y(rhs.y), z(rhs.z), w(rhs.w) {} Vector4(const float& f) : x(f), y(f), z(f)...
true
324ca0a05486b22a2457de058705a01415a35a2a
C++
whycoding126/zircon
/system/ulib/perftest/include/perftest/perftest.h
UTF-8
4,308
2.984375
3
[ "BSD-3-Clause", "MIT" ]
permissive
// Copyright 2018 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. #pragma once #include <stdint.h> #include <fbl/function.h> #include <perftest/results.h> // This is a library for writing performance tests. It support...
true
84aa6de0f636a05bae8ad7f20732de2da230631e
C++
warycat/uva
/488/488.cpp
UTF-8
479
2.9375
3
[]
no_license
#include <cstdio> #include <iostream> using namespace std; void printWave(int h) { int i; int j; for(i=1;i<=h;i++){ for(j=0;j<i;j++) printf("%d",i); printf("\n"); } for(i=h-1;i>=1;i--){ for(j=0;j<i;j++) printf("%d",i); printf("\n"); } } int main() { int n; scanf("%d",&n); int i; for(i=0;i<n;i...
true
5e4fc85b147e99deb53c964f46006fb946d79b98
C++
YufeiHu/CS130-Software-Engineering
/src/proxy_handler.cc
UTF-8
4,082
2.796875
3
[ "MIT" ]
permissive
// // Author: JMAC // ~~~~~~~~~~~~ // #include "proxy_handler.h" std::unique_ptr<RequestHandler> ProxyHandler::create(const ConfigOptions* options) { std::unique_ptr<RequestHandler> proxy_handler(new ProxyHandler(options)); return proxy_handler; } std::unique_ptr<Reply> ProxyHandler::HandleRequest(const Request&...
true
ca47d5d32038839313cec58de5be61c021b79b03
C++
ravikiranc07/PGJQP_RAVIKIRAN
/assignment 3/palindrome.cpp
UTF-8
592
3.5625
4
[]
no_license
#include<iostream> using namespace std; class Palindrome { int rev=0,rem,num,n; public : void display() { cout<<"enter the number"; cin>>num; n=num; while(num>0) { rem=num%10; rev=rev*10+rem; num=num/10; } ...
true
c3cd13c77eb97f35187ce03ff88655c14305339a
C++
zxkyjimmy/zerojudge
/d368.cpp
UTF-8
323
2.5625
3
[]
no_license
#include <iostream> using namespace std; class chess { public: uint64_t P, N, B, R, Q, K; uint64_t p, n, b, r, q, k; uint64_t e; char str[65]; void read() { for(int i = 0; i < 64; i++) { cin >> str[i]; } } }; int main() { return 0; ...
true