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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6019714c9372febf53a744db3298e4a47718aee5 | C++ | amarzial/project-euler-Cpp | /prob/prob41.cpp | UTF-8 | 256 | 2.6875 | 3 | [] | no_license | #include "utils.hpp"
#include <iostream>
namespace prob41 {
int Start() {
for (auto i = 7654321; i > 1235; i -= 2) {
if (utils::is_pandigital(i) and utils::is_prime(i)) {
std::cout << i << std::endl;
return 0;
}
}
return 0;
}
}
| true |
3c7d66ee65cfbf7e12f6f0cb4cd251ff3a6a33d1 | C++ | Stef997/3060_phase_2 | /deposit/deposit.cpp | UTF-8 | 5,494 | 4.0625 | 4 | [] | no_license | /*
* Deposit transaction class. Takes the address of a user
* and adds a value to the account class associated with
* the user using the named 'deposit' class with
* supplementary functions intended to check for correct
* inputs.
*
*/
#include "deposit.h"
/*
* This method takes an admin user object. It then p... | true |
2e4ca3b73d06e3ad699ac43d2b67d722d29c0c70 | C++ | tuogy/usaco-solutions | /milk3.cc | UTF-8 | 1,106 | 2.6875 | 3 | [] | no_license | /*
USER: guobich1
TASK: milk3
LANG: C++
*/
#ifndef __clang__
#include <bits/stdc++.h>
#endif
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
bool vis[21*21*21];
bool visC[21];
int A, B, C;
int hash3(int a, int b, int c) {
return a * 21 * 21 + b * 21 + c;
}
vo... | true |
b9390db4dedd4a4c87504ed1c68996bedac8bdd3 | C++ | sureshmangs/Code | /competitive programming/leetcode/1365. How Many Numbers Are Smaller Than the Current Number.cpp | UTF-8 | 1,793 | 3.484375 | 3 | [
"MIT"
] | permissive | Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number of valid j's such that j != i and nums[j] < nums[i].
Return the answer in an array.
Example 1:
Input: nums = [8,1,2,2,3]
Output: [4,0,1,1,3]
Explanation:
For num... | true |
e483e1288274fd430e4ab9cb2a4fefe9284eaad7 | C++ | rosen90/GitHub | /Projects/Kostadin/21. Class String and String Stream Processing/1/Rot13.cpp | UTF-8 | 725 | 3.28125 | 3 | [] | no_license | //============================================================================
// Name : Rot13.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <io... | true |
cc3640b695317861d2f8cd1d1dc2346db90004d4 | C++ | vprover/vampire | /Lib/FreshnessGuard.hpp | UTF-8 | 1,073 | 2.5625 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* This file is part of the source code of the software program
* Vampire. It is protected by applicable
* copyright laws.
*
* This source code is distributed under the licence found here
* https://vprover.github.io/license.html
* and in the source directory
*/
/**
* @file FreshnessGuard.hpp
* Defines class... | true |
d98fe6f2d0116f64f075a59c8a3ecfd2aa7b314f | C++ | Adjuvo/SenseGlove-API | /Core/SGCoreCpp/incl/ThumperCmd.h | UTF-8 | 1,224 | 2.65625 | 3 | [
"MIT"
] | permissive | // ----------------------------------------------------------------------------------
// Thumper command
// @author: Max Lammers
// ----------------------------------------------------------------------------------
#pragma once
#include "SGCore.h"
namespace SGCore
{
namespace Haptics
{
class SGCORE_API ThumperCm... | true |
4e2c3a5f751fb22953e70a3a14abbecd865c54c9 | C++ | Murphster4DK/CSC120WEEK4 | /while/main.cpp | UTF-8 | 836 | 3.03125 | 3 | [] | no_license | #include <iostream>
using namespace std ;
int main() {
int account, balance, totalCharge, totalCredit, creditLimit;
char cont = 'h';
while (cont != '1') {
cout << "Account number: ";
cin >> account;
cout << "Balance: ";
cin >> balance;
cout << "Total Charges: ";
... | true |
442e4adbdf47c0e576b8ad5e65b5ea240934d0bd | C++ | lleaff/Cpptests | /acccpp/stdstringTests.cpp | UTF-8 | 174 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <string>
int main()
{
std::string yolo = "Yolo";
std::string banga = yolo + ", banga" + '!';
std::cout << banga << std::endl;
return 0;
}
| true |
8681c8cf93adfb7e21d929c323df1e71f668e63f | C++ | hashr25/DataStructures | /Assignments/BinaryTreeSearch/src/TreeNode.cpp | UTF-8 | 137 | 2.609375 | 3 | [] | no_license | #include "TreeNode.h"
TreeNode::TreeNode(int value)
{
this -> value = value;
leftChild = NULL;
rightChild = NULL;
}
| true |
c3ff1df2ee0f754b13147ff0fb57cfb9daf55bd7 | C++ | nopanderer/ps | /bf/1963.cc | UTF-8 | 1,071 | 2.953125 | 3 | [] | no_license | /**
* 소수 경로
* 1963
*/
#include <iostream>
#include <queue>
#include <algorithm>
#include <string>
using namespace std;
int T,A,B;
int c[10000];
bool prime[10000];
int change(int num,int i,int j){
if(i==0 && j==0) return -1;
string s = to_string(num);
s[i] = j+'0';
return stoi(s);
}
int main(){
for(int i=2;... | true |
a1b1452f8f26ff332376394d95c1223e32b75aae | C++ | Gfast2/ABArbeit | /_2014_5_29_Final_01/processCommand.ino | UTF-8 | 9,673 | 2.765625 | 3 | [] | no_license |
//------------------------------------------------------------------------------
void releaseMotor(int num){
switch(num){
case 0: digitalWrite(ORIG_X_ENABLE_PIN,HIGH); break;//TODO: try out if this pin get low will disable the motors
case 1: digitalWrite(ORIG_Y_ENABLE_PIN,HIGH); break;
case 2: digitalW... | true |
93e2dceba300fac7412e38270ab31cc73dbaa374 | C++ | GohEK/Assignment-CGP- | /GameAssignment/Player.cpp | UTF-8 | 2,602 | 2.6875 | 3 | [] | no_license | #include "Player.h"
#include "GGraphic.h"
#include "GInput.h"
Player::Player()
{
sprite = NULL;
texture = NULL;
}
Player::~Player()
{
sprite->Release();
sprite = NULL;
texture->Release();
texture = NULL;
}
void Player::init()
{
D3DXCreateSprite(GGraphic::getInstance()->d3dDevice, &sprite);
D3DXCreateTexture... | true |
e0440bc2ef475e241e8d230bdf57c148abc8f245 | C++ | kitschpatrol/Cinder-Zmq | /samples/ImagePublisher/src/ImagePublisherApp.cpp | UTF-8 | 2,118 | 2.609375 | 3 | [] | no_license | #include "cinder/Log.h"
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/ip/Resize.h"
#include "ofxZmq.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class ImagePublisherApp : public App {
public:
void setup() override;
void mouseDown(M... | true |
fe50977347b79177599b15ca1dd61f6136ed5914 | C++ | GJP1106/C-_Study | /C++笔记/第四章/4-4/4-4/ca.h | GB18030 | 633 | 3.09375 | 3 | [] | no_license | #ifndef _CA_H__
#define __CA_H__
template <typename C>
class A { //ͨ
public:
template <typename T2>
A(T2 v1, T2 v2);
//A(T2 v1, T2 v2) { //캯ҲԼģ壬ģCûйϵ
//}
template <typename T>
void myft(T tmpt) { //Աģ
cout << tmpt << endl;
}
void myftpt() {}
C m_ic;
};
template <typename C> //ȸģб
template <typename ... | true |
61be197448d45e19936b18325c2285f1bf322902 | C++ | SlaveWilson/leetcode | /solved/easy/1450. Number of Students Doing Homework at a Given Time/main.cpp | UTF-8 | 570 | 3.4375 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
int busyStudent(vector<int> &startTime, vector<int> &endTime, int queryTime)
{
int count = 0;
for (int i = 0; i < startTime.size(); i++)
{
if (queryTime >= startTime[i] && queryTime <= endTime[i])
count++;... | true |
133054f13aa39a3eb216411a356a7ec4e3c64b7a | C++ | mehrta/monotone-polygon-decomposition | /source code/PolygonDecomposition/trapezoidal_decomposition.h | UTF-8 | 5,473 | 2.96875 | 3 | [] | no_license | #pragma once
#include "simple_polygon.h"
namespace pd
{
enum QueryStructureNodeType { QSNT_X, QSNT_Y, QSNT_TRAPEZOID };
struct Trapezoid
{
int id;
pd::Point top_left, top_right, bottom_left, bottom_right; // vertices of the trapezoid
int top_left_trap, top_right_trap, bottom_left_trap, bottom_right_trap; /... | true |
09321707ef3ca543d21af236223e02df8419517d | C++ | Paynekk/Learning_c_plus_plus | /fundamentos/15_tipos_estructurados/4_ como_se_copian_tablas_y_tuplas.cpp/0_copia_de_tablas_y_tuplas.cpp | UTF-8 | 349 | 3.125 | 3 | [] | no_license | #include <iostream>
using namespace std;
typedef double TresReales[3];
struct Grupito{
int a;
bool b;
char c;
};
int main(){
TresReales R = {0.5, 1.0, 2.0};
TresReales S;
Grupito G = {1, false, 'S'};
Grupito H;
H = G;// struct si que se puede hacer
// S = R en array no se puede hacer
for(int i =... | true |
56e5776a2293602295687f4bce90cdbe5aac9142 | C++ | LoA-Xyh/TSinghua_C-Basic | /C2语言基础/C2-3实心菱形/2-3实心菱形/源.cpp | WINDOWS-1252 | 722 | 3.140625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int floor = 0;
cin >> floor;
for (int sFloor = floor-1; sFloor >= 0; sFloor--) {
for (int fSpace = 1; fSpace <= sFloor; fSpace++) {
cout << " ";
}
for (int sign = 2 * (floor - sFloor) -1; sign > 0;sign--) {
cout << "*";
}
for (int bSpace = 1; bS... | true |
ff65a6ae4b44181ac6c3a1e6a300fbcfdfb1641c | C++ | Hansimov/cs-notes | /leetcode/0300_v2.cpp | UTF-8 | 2,212 | 3.21875 | 3 | [] | no_license | /*
- [LeetCode] Longest Increasing Subsequence 最长递增子序列 - Grandyang - 博客园
https://www.cnblogs.com/grandyang/p/4938187.html
- algorithm - How to determine the longest increasing subsequence using dynamic programming? - Stack Overflow
https://stackoverflow.com/questions/2631726/how-to-determine-the-longest-incre... | true |
446a1824ae78e0f40ae8633ee50cc3ca97c28dc8 | C++ | mickey9910326/Homework | /DataStructure/HW5/Queue.cpp | UTF-8 | 915 | 3.453125 | 3 | [] | no_license | #include "Queue.h"
template<typename ItemType>
Queue<ItemType>::Queue(int max){
maxQueue = max;
top = -1;
item = new ItemType[maxQueue];
}
template<typename ItemType>
bool Queue<ItemType>::IsEmpty() const{
return (top == -1);
}
template<typename ItemType>
bool Queue<ItemType>::IsFull() const{
ret... | true |
3b2e0d17d8f556ce3d59e89cb53c473aa6de8c1e | C++ | ChesssFish/DS | /AVL/AVL/AVL.h | GB18030 | 1,320 | 3.28125 | 3 | [] | no_license | /*-----------------------------------------------
ļAVL.h
AVLĽڵ㡣
˰汾ʵBSTĹ
ҪkeyTypeʵֱȽ븳ֵ
-----------------------------------------------*/
#pragma once
template<typename keyType = int>class AVL;
template<typename keyType = int>
class AVLnode
{
public:
AVLnode();
AVLnode(const keyType& key);
~AVLnode();
AVLnode& o... | true |
0dbba4a3b2efd8bf6765f83b89bf0a6d4fc2631f | C++ | FefuIR/Tasks | /hash/hash.h | UTF-8 | 509 | 2.671875 | 3 | [] | no_license | #ifndef HASH_HASH_H
#define HASH_HASH_H
#include <string>
using namespace std;
struct Rec {
string fio;
unsigned int number = 0;
unsigned short int status = 0;
};
class HashEntry {
private:
unsigned int size;
Rec *table;
int HashFunction1(int number);
bool Review(Rec R);
int HashFunc... | true |
baeba65510587e50b7c4558c4404075ba5eac3e8 | C++ | SebastianDang/OpenGL | /Extra/MatrixTransform.h | UTF-8 | 507 | 2.84375 | 3 | [] | no_license | #pragma once
#ifndef MATRIX_TRANSFORM_H
#define MATRIX_TRANSFORM_H
#include "Window.h"
#include "Group.h"
/* MatrixTransform should store a 4x4 transformation matrix M which is multiplied with matrix C, which is passed to the draw method. */
class MatrixTransform : public Group
{
private:
public:
//Const... | true |
fcddedb527b09ca6ef7b683ad75a48a799a68a3b | C++ | rishabhkukreja30/DSA-questions | /Greedy Algorithms/Load_Balancing .cpp | UTF-8 | 851 | 2.703125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main() {
#ifndef ONLINE_JUDGEs
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int arr[9000];
int n, i, t, diff;
cin>>t;
while(t--) {
//take input current test case
int max_load = 0, load = 0;
cin>>n;
//stop taking inp... | true |
8e83a70852cefede68e6e198126adbac08506d48 | C++ | nheyr08/OOP-Lab6-Linked-list | /LinkedList.cpp | WINDOWS-1250 | 2,913 | 4.0625 | 4 | [] | no_license | #include"LinkedList.h"
LinkedList::LinkedList()
{
//Constructor
Head = NULL;
}
void LinkedList::Push_back(int x)
{
//TODO : Insert a node to the end of the linked list, the nodes value is x.
ListNode*temp = new ListNode;
temp->data = x;
temp->next = NULL;
ListNode *ptr = Head;
if (Head == NULL)... | true |
07cda2deed625432ea78277f9a365a33b64e65fc | C++ | fanxinglanyu/AcceleratedC | /Unit3/3.cpp | UTF-8 | 733 | 3.484375 | 3 | [] | no_license | //3
#include<iostream>
#include<string>
#include<vector>
using std::string; using std::endl;
using std::cout; using std::cin;
using std::vector;
int main(int argc, char const *argv[])
{
cout << "Please enter word:";
vector<string> word;
vector<int> count;
typedef vector<string>::size_type vec_sz;
strin... | true |
fc0e711504b26895eddbd937ce96ce6df0811f3d | C++ | veteran12/leetcode_veteran | /PlusOne.cpp | UTF-8 | 481 | 3 | 3 | [] | no_license | class Solution {
public:
vector<int> plusOne(vector<int> &digits) {
int len = digits.size();
int carry = 0;
vector<int> res;
digits[len-1] += 1;
for(int i=len-1; i>=0; i--) {
res.push_back((carry + digits[i]) % 10);
carry = (carry + digits[i])... | true |
0d7f26177241748eb1aaa3cd7fbb081afea71682 | C++ | codingFreak-Adisin/Av-Automation-V1 | /RFID_Sensor_Powered_by_Arduino_Uno.ino | UTF-8 | 3,562 | 3.015625 | 3 | [] | no_license | #include <SPI.h>
#include <RFID.h>
#include <Servo.h>
RFID rfid(10, 9); //D10:pin of tag reader SDA. D9:pin of tag reader RST
unsigned char status;
unsigned char str[MAX_LEN]; //MAX_LEN is 16: size of the array
String accessGranted [2] = {"29010156614"}; //RFID serial numbers to grant access to
i... | true |
5b8290b6c6c638df23b41a15f83eaaa21e2e7c77 | C++ | redrumrobot/unvanquished-engine | /src/Core/Terminal.cpp | UTF-8 | 11,451 | 2.5625 | 3 | [] | no_license | //@@COPYRIGHT@@
// NCurses/PDCurses-based terminal
static bool cursesOn = false;
// Basic print function for when not using curses
static void BasicPrint(printLevel_t level, const char *msg)
{
char buffer[MAX_PRINTMSG];
// Appropriate prefix for the error level
switch (level) {
case PRINT_ERROR:
strcpy(buffer... | true |
dfea35364fa2f58db13d7792b4795f0a3b93654f | C++ | Danicast-c/Cache_Coherence | /delay_control.cpp | UTF-8 | 983 | 3.140625 | 3 | [] | no_license | //
// Created by Daniel Castro on 9/14/19.
//
#include <iostream>
#include "delay_control.h"
delay_control::delay_control(core *c1, core *c2, core *c3, core *c4, queue_control *my_queue) {
core_1 = c1;
core_2 = c2;
core_3 = c3;
core_4 = c4;
queues = my_queue;
}
void delay_control::read_delay_queu... | true |
a9e1fbc41d42e99b2415430668a74962045bae4e | C++ | Lexkane/Cpp | /Shops/ShopApp.cpp | UTF-8 | 4,197 | 3.125 | 3 | [] | no_license | // ShopApp.cpp : main project file.
#pragma once
//include "stdafx.h"
#include"Product.h"
#include"Shop.h"
#include <vector>
#include <string>
using namespace std;
void shop_input()
{
int check = 1;
Shop shop;
vector <Shop> shoplist;
cout <<" Please Input Name ShopNumber" << endl;
do
{
ci... | true |
71b369a953c3b773c4a62b88467b20c263afb04e | C++ | wyxmails/MyCode | /1_leetcode/linkListCycle.cpp | UTF-8 | 610 | 3.734375 | 4 | [] | no_license | /*
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle... | true |
d5c0b0f4c628e445ca1f1cfaa632c96e9a9f4937 | C++ | ajithcnambiar/cpp-condition-variable | /zeroevenodd.h | UTF-8 | 1,490 | 3.53125 | 4 | [] | no_license | #ifndef _ZERO_EVEN_ODD_H_
#define _ZERO_EVEN_ODD_H_
#include <functional>
#include <condition_variable>
#include <mutex>
#include <iostream>
class ZeroOddEven{
// input integer, generates until n
int n;
// counter counts upto n
int counter;
// condition variable, helps to realize unblock a thread un... | true |
0a648ea6cee8cb0f5eec3c1f222e11e608d45f45 | C++ | Jrende/Hondo | /src/gfx/Octree.hpp | UTF-8 | 1,592 | 2.9375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <array>
#include <memory>
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <unordered_set>
#include <vector>
#include "AABB.hpp"
#include "Entity.hpp"
#include "Frustum.hpp"
class Octree {
friend class DebugRenderer;
friend class Test;
private:
void add_point(int entity_id, con... | true |
75ad9a23cb7d57b6e0d56f0a4690c3606a6d6221 | C++ | IohannRabeson/lexy | /include/lexy/dsl/production.hpp | UTF-8 | 4,894 | 2.578125 | 3 | [
"BSL-1.0"
] | permissive | // Copyright (C) 2020-2021 Jonathan Müller <jonathanmueller.dev@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.
#ifndef LEXY_DSL_PRODUCTION_HPP_INCLUDED
#define LEXY_DSL_PRODUCTION_HPP_INCLUDED
#include <lexy/dsl/base.hpp>
#include ... | true |
fbc05f41f02980b7c152bbf068d19ff8ddd832fd | C++ | betinag/Matrix | /matrix.h | UTF-8 | 1,800 | 3.40625 | 3 | [] | no_license | #include <cstddef>
#include <vector>
const double MATRIX_DEFAULT_VALUE = 0.0;
class Matrix
{
public:
typedef std::vector<double>::size_type size_type;
Matrix();
Matrix(size_type, size_type, double = MATRIX_DEFAULT_VALUE);
Matrix(const std::vector<double>&);
Matrix(const std::vector<std::vector<do... | true |
fa6152dd052933f0f443fee8fff28c923ff19d95 | C++ | seub/Harmony | /h2triangle.cpp | UTF-8 | 4,030 | 2.875 | 3 | [] | no_license | #include "h2triangle.h"
#include "h2polygon.h"
#include "h2isometry.h"
H2Triangle::H2Triangle()
{
}
H2Triangle::H2Triangle(const H2Point &a, const H2Point &b, const H2Point &c): a(a), b(b), c(c)
{
}
void H2Triangle::getPoints(H2Point &a, H2Point &b, H2Point &c) const
{
a = this->a;
b = this->b;
c = this-... | true |
ed0d2642ca5f254f08b3bf4e0141f0abd87a27cb | C++ | DELFIN-GO/plot | /plot_test/main.cpp | UTF-8 | 1,089 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
//const double M_PI=3.14159265358979323846;
double f(double x){
return x*x/100;
}
double g(double x){
return x*x*4*3.14*3.14*(375.1+376.1);
}
double h(double x){
return x*10.2*9.82*pow(pow(0.003/x,2)+pow(0.1/10.2,2),0.5);
}
int main()
{
freopen("inpu... | true |
39ffdb8ca26f38b5cab79265ed3d1f1f612a6ef6 | C++ | Anshika-Srivastava/Important-ques-by-seniors | /Binary Tree Zigzag Level Order Traversal.cpp | UTF-8 | 1,274 | 3.5625 | 4 | [] | no_license | //Using BFS
//Data Structure used: Queue
class Solution {
public:
vector<vector<int>> zigzagLevelOrder(TreeNode* root) {
vector<vector<int>> ans;
//corner case
if(root==NULL)
return ans;
queue<TreeNode*> q;
bool dir=1;//1-left to right, 0-right to left
q.p... | true |
3c3a4ac81910280571108ba034095879a2e939ea | C++ | frandibar/pacman3d | /client/Player.cpp | UTF-8 | 3,876 | 2.59375 | 3 | [] | no_license | #include "Player.h"
#include "SDLHelpers.h"
#include "lib/debug.h"
#include <iostream>
#include <string>
const double Player::RADIUS = 0.5;
// constructor
Player::Player(unsigned int playerId, tRole role) : _id(playerId), _role(role), _score(0), _name(""),
_glText... | true |
22770a6059ffa59d897417a1883efac734c03069 | C++ | weirenw/Database-System-Implementation | /project 4-1/a3/SortedFile.h | UTF-8 | 2,048 | 2.65625 | 3 | [] | no_license | #ifndef SORTED_FILE_H_
#define SORTED_FILE_H_
#include <string>
#include "GenericDBFile.h"
#include "Pipe.h"
#include "BigQ.h"
class SortedFile: public GenericDBFile{
static const size_t PIPE_BUFFER_SIZE = PIPE_SIZE;
public:
enum Mode{READ, WRITE, UNKNOWN} mode;
SortedFile(): sortOrder(NULL), runLength(0), inPipe... | true |
f2f5d6da9cf511a91dd119ade9ec610ae6ab9bc5 | C++ | mikevo/uibk-acc | /mcc/tac/src/float_literal.cpp | UTF-8 | 313 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "mcc/tac/float_literal.h"
namespace mcc {
namespace tac {
FloatLiteral::FloatLiteral(float value, Scope::ptr_t scope)
: Operand(Type::FLOAT, scope), value(value) {}
bool FloatLiteral::isLeaf() const { return true; }
std::string FloatLiteral::getValue() const { return std::to_string(value); }
}
} | true |
5c623b4779db5505376bbf4a03a997b4dd486f04 | C++ | xuau34/competitive-programming | /PCCA2017s/Day4/J.cpp | UTF-8 | 909 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <utility>
#include <algorithm>
using namespace std;
int T, N, M, Q;
pair<long long, pair<long long, long long> > arr[40005];
void ini(void){
scanf("%d", &N);
for(int i = 0; i < N; ++i){
scanf("%lld %lld %lld", &arr[i].first, &arr[i].second.first, &arr[i].second.second);
}
sort(a... | true |
e929d947412056f6880773216487221a2ac4ce82 | C++ | lvcargnini/zircon | /system/core/devmgr/bootfs.h | UTF-8 | 2,065 | 2.53125 | 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 <zircon/boot/bootdata.h>
#include <zircon/types.h>
#include <zircon/compiler.h>
#include <stdint.h>
#include <fbl/algorithm.h>
#inc... | true |
45fb05ea27cbe947e5b5e72bc4b7c57a54f5000e | C++ | zonasse/Algorithm | /normal problems/tree/distance_of_two.cpp | GB18030 | 1,871 | 3.625 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct tNode{
int data;
tNode *left;
tNode *right;
tNode(int x):data(x),left(NULL),right(NULL){}
};
class Solution{
public:
/*
* ˼·t1t2Ϊancestor,dis(t1,t2) = dis(root,t1)+dis(root,t2)-2*dis(root,ancestor)
*/
int distance_of_two(tNode *root,... | true |
179808ebfa6b0ea557d643d0bea894060a296167 | C++ | shivarao96/MineCraft-Clone | /src/mesh/mesh.h | UTF-8 | 450 | 2.875 | 3 | [] | no_license | #pragma once
/*
* Mesh class representing the DS with following data:
* 1. vertexPositions: position in 3D world
* 2. textureCoordinates: texture for the vertex side.
* 3. indices: to represents the correct index without having duplicate vertices
*/
#include <vector>
class Mesh {
public:
std::vector<float> vertexPo... | true |
dfbafc8d4d1ef3301a8b72bbed57b028ff3e7037 | C++ | DEGoodmanWilson/statlerbot | /beep_boop_persist.h | UTF-8 | 2,688 | 3.03125 | 3 | [] | no_license | //
// Created by D.E. Goodman-Wilson on 8/9/16.
//
#pragma once
// There are far more clever ways to do this. I'd like to use the subscript operator with a custom member class
// so you could use this just like a hash map. But, hey, that can come later.
#include <string>
#include <map>
#include <cpr/cpr.h>
#include ... | true |
f27e4ffb2573904f14ec855cc4627f9fcb4eb1ac | C++ | Shimmen/Prospect | /src/UniformValue.h | UTF-8 | 1,863 | 2.96875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #pragma once
#include <glad/glad.h>
#include <glm/glm.hpp>
namespace prospect
{
namespace internal
{
template<typename T>
void PerformUniformUpdate(GLuint program, GLint location, T value)
{
assert(false);
}
template <>
inline void PerformUniformUpdate(GLuint program, GLint location, int value)
{
... | true |
26af4cf853b1bd83eea7ae39b287d3baaab01853 | C++ | Pentagon03/competitive-programming | /codeforces/Codeforces Round #432/2B.cc | UTF-8 | 553 | 2.84375 | 3 | [] | no_license | #include <cstdio>
using int64 = long long;
int64 dis(int64 x1, int64 y1, int64 x2, int64 y2) {
return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}
bool coline(int64 x1, int64 y1, int64 x2, int64 y2, int64 x3, int64 y3) {
return (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1) == 0;
}
int main() {
int64 x1, y... | true |
a594d874f94b45889c05f991674fa9b03669ee75 | C++ | unball/ieee-very-small-2012 | /software/vision/output_data.h | UTF-8 | 805 | 2.6875 | 3 | [] | no_license | #ifndef OUTPUT_DATA_H
#define OUTPUT_DATA_H
#include "opencv2/opencv.hpp"
using namespace cv;
#include "tracker.h"
class OutputData
{
public:
OutputData();
~OutputData();
bool Update(Tracker& tracker, float scale = 4.0);
Point2f team_pos[3];
double team_orientation[3];
Point2f oppon... | true |
bcf757cb5165c7bbe886e82dab5a7195fa8dd8dd | C++ | von6yka/Arcanoid-3D | /Engine/Render/GLShadowMapGenerator.cpp | UTF-8 | 6,514 | 2.53125 | 3 | [] | no_license | #include "Engine/pch.h"
#include <sstream>
#include "Engine/Render/GLShadowMapGenerator.h"
#include "Engine/Render/GLShaderProperties.h"
#include "Engine/Render/GLMesh.h"
#include "Engine/Scene/Scene.h"
#include "Engine/Scene/SceneObject.h"
#include "Engine/Resource/Mesh.h"
#include "Engine/Resource/ResourceStorage... | true |
2e59af6e73b1b8aa2a8ce10f82f1e8965cddded0 | C++ | milczarekIT/agila | /app/Document/SaleDocument/DocumentFK.cpp | UTF-8 | 2,055 | 2.71875 | 3 | [] | no_license | #include "DocumentFK.h"
DocumentFK::DocumentFK()
{
this->documentDate = QDate::currentDate();
this->documentType = "FK";
}
DocumentFK::DocumentFK(Invoice fv)
{
this->fv = fv;
this->copyInvoiceData();
}
void DocumentFK::setInvoice(Invoice fv)
{
this->fv = fv;
}
Invoice DocumentFK::getInvoice()
{
... | true |
b7ce53df80ea68db17e7ca8e178f8907de34d680 | C++ | beejeke/cya-ull | /p1-cya/clase_protagonista.cpp | WINDOWS-1250 | 2,143 | 2.75 | 3 | [] | no_license | #include <iostream>
#include "clase_protagonista.hpp"
using namespace std;
Hero::Hero(unsigned x, unsigned y,int vida): //Pasa los parmetros del personaje
x_(x),y_(y),vida_(vida) //Parmetros de coordenadas y vida
{
amuleto_=false;
}
void Hero::move_character(char** mapa){ //Movimiento del personaje
... | true |
3c60af2e130c14d55d1bb5db10747723de62e2ba | C++ | cpillion/AdvancedComputerGraphics | /hw08/hw08viewer.cpp | UTF-8 | 2,062 | 2.515625 | 3 | [] | no_license | //
// Hw08viewer Widget
//
#include <QComboBox>
#include <QLabel>
#include <QGridLayout>
#include "hw08viewer.h"
//
// Constructor
//
Hw08viewer::Hw08viewer()
{
// Set window title
setWindowTitle(tr("Hw08: Textures for Data Storage (by Chris Pillion)"));
// Create new OpenGL widget
ogl = new Hw08open... | true |
eb98e74e203b46882ca827259f8b30c94d901669 | C++ | linxinwNeo/CS162 | /labs/lab4/Player.cpp | UTF-8 | 5,545 | 3.65625 | 4 | [] | no_license | #include "Player.h"
using namespace std;
//constructors
Player::Player() {
this->hand = Hand();
this->books = NULL;
this->n_books = 0;
}
Player::Player(Hand hand, int* books, int n_books) {
this->books = books;
this->n_books = n_books;
this->hand = hand;
}
//copy constructor
Player::Player(const... | true |
dc67f412c8898c8e4e9afa555b7b7aa3ff360973 | C++ | alexandraback/datacollection | /solutions_5690574640250880_1/C++/Jubanka/mine.cpp | UTF-8 | 3,348 | 2.875 | 3 | [] | no_license | #include <iostream>
using namespace std;
#define MIN(x, y) ( ((x) < (y)) ? (x) : (y))
#define MAX(x, y) ( ((x) > (y)) ? (x) : (y))
char board[50][50], tmpb[50][50];
int R, C, M;
inline bool blocked(int x, int y)
{
if (x >= C || y >= R || x < 0 || y < 0) return true;
return (board[y][x] == '*');
}
void print(ostr... | true |
73484bef06a281bab63c434dec1dd3bf517a4705 | C++ | Sophistt/Draftcode | /C++/C-plus-learn/practice/作业5/Screen.cpp | UTF-8 | 587 | 3.28125 | 3 | [
"MIT"
] | permissive | #include "Screen.h"
#include <cstdlib>
Screen* Screen::instance = 0;
void Screen::exitWhenInvalidScreen(int width, int height){
if( width <= 0 || width > 1000 || height <=0 || height > 1000 ){
std::cout << "invalid screen size";
exit(0);
}
}
Screen* Screen::getInstance(int width, int height){
if (Screen::inst... | true |
33cfea0a12434b49ac69ad17b6c75238c78861db | C++ | sharmaashish/emory-cci-fast-ia-gsoc | /fastIA-master/src/segment/opencl/utils/ocl_utils.cpp | UTF-8 | 3,115 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | #include "ocl_utils.h"
#include <iostream>
void oclSimpleInit(cl_device_type type,
cl::Context& context, std::vector<cl::Device>& devices)
{
try{
std::vector<cl::Platform> platforms;
cl_int err = CL_SUCCESS;
cl::Platform::get(&platforms);
if (!platforms.size()... | true |
2a7b698b66f85d1f8bf04b0e5f25a16cc4fa06ba | C++ | Farrius/cp | /codeforces/educational_91/as.cpp | UTF-8 | 466 | 2.59375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int t;
cin >> t;
while(t--){
int n;
cin >> n;
int a[n];
for(int i = 0; i < n; i++){
cin >> a[i];
}
bool ok = false;
for(int i = 2; i < n; i++){
if(ok) break;
if(a[i] < a[i - 1] && a[i - 1] > a[i - 2]){
cout ... | true |
074ba1cc8d7e5584de26e97c24fd2a60611715db | C++ | prakharss/Mind-Blowing-Approaches-and-Code | /BST/Distance between Nodes of BST.cpp | UTF-8 | 1,734 | 3.734375 | 4 | [] | no_license | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
/*
O(H) S(1)
It is assumed that both keys exists in the tree (that's why not checking if(root!=NULL))
*/
//Iterative solution
int... | true |
14fe8d2ff2b0a5d2d6b22c10c443fc3f5fb90bca | C++ | ravi-kr-singh/CSES_Competitive_Programming | /Dynamic Programming/14_increasing_subsequence.cpp | UTF-8 | 1,132 | 3.53125 | 4 | [] | no_license | /*
Time limit: 1.00 s Memory limit: 512 MB
You are given an array containing n integers. Your task is to determine the longest increasing subsequence in the array, i.e., the longest subsequence where every element is larger than the previous one.
A subsequence is a sequence that can be derived from the array by deleti... | true |
4045b3316497a5ad421575e36461e03300629000 | C++ | jcao02/Problems | /done/MAXWOODS.cpp | UTF-8 | 1,355 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#define MAX 200
int rows, cols;
char map[MAX+1][MAX+1];
int dp[MAX + 2];
int solve() {
if (map[0][0] == '#') {
return 0;
}
dp[1] = 0;
int maxWoods = 0;
for (int r = 0; r < rows; ++r) {
if (r % 2 == 0) {
for (int c = 0; c < cols... | true |
2b98bc1202bc95951c06ae4d58a59fde3e2ceb6b | C++ | edison-caldwell/SchoolWork | /2017SPRING/CSCI313/project/checkOut.cpp | UTF-8 | 4,896 | 2.84375 | 3 | [] | no_license | /*
* This application ends a reservation and creates a bill for the guest.
* Compile Line: c++ -o checkOut checkOut.cpp $(mysql_config --libs)
*/
#include "/usr/include/mysql/mysql.h"
#include <iostream>
#include <string>
#include <sstream>
#include <cstdlib>
using namespace std;
const string DB = "teamF";
const str... | true |
bd181e862876e0e359fb70984bcce0d7f8cfb873 | C++ | zossem/D001_Ulamek_Zwykly | /D001_ulamek_zwykly/ulamek_zwykly.cpp | UTF-8 | 11,470 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include "ulamek_zwykly.h"
using namespace std;
cUlamekZwykly::cUlamekZwykly(long long int Calosci, long long int Licznik, long long int Mianownik)
{
m_Calosci=Calosci;
m_Licznik=Licznik;
while(Mianownik==0)
{
cout<<"Nie dziel przez zero i podaj inny mianow... | true |
91585a3904e935b320de4d57f8e7726b706b1617 | C++ | eXceediDeaL/OI | /Problems/POJ/模拟/1002.cpp | UTF-8 | 900 | 3 | 3 | [] | no_license | /*
487-3279
题意:给你一些由大写字母、数字、和'-'组成的字符串,并给出大写字母各自对应的数字。求出转换为数字后重复的次数。
分析:模拟,注意转数字
*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<set>
#include<map>
#include<cctype>
using namespace std;
int num[]={2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,0,7,7,8,8,8,9,9,9};
map<int, int> s;
char buf[128];
int main(){
int t;
... | true |
8782eebdd8b8a8389746a611da4db991294c77f9 | C++ | 3ICE/Programming-2017 | /weekly-assignment-02/main.cpp | UTF-8 | 1,424 | 3.609375 | 4 | [] | no_license | #include <iostream>
#include <iomanip>
using namespace std;
class Clock {
public:
Clock(int hour, int minute);
void print() const;
int difference(Clock o);
private:
int hours_;
int minutes_;
};
int main() {
int min, hour;
cout<<"Please type in an hour: ";
cin>>... | true |
80dfb4688a9811899b8f70aa16c443a94e2ddc68 | C++ | ccdxc/logSurvey | /data/crawl/git/new_hunk_2025.cpp | UTF-8 | 157 | 2.6875 | 3 | [] | no_license | static int write_buffer(int fd, const void *buf, size_t len)
{
if (write_in_full(fd, buf, len) < 0)
return error_errno("file write error");
return 0;
}
| true |
d1e12acf7288b4b9161d780db4e152a4cc01f25c | C++ | nikitablack/animation | /Headers/MeshAsciiParser.h | UTF-8 | 13,735 | 2.734375 | 3 | [] | no_license | #pragma once
#include <string>
#include <regex>
#include <fstream>
#include <DirectXMath.h>
#include <vector>
#include <cassert>
using namespace std;
using namespace DirectX;
namespace detail
{
char* memblock{ new char[4] };
}
using namespace detail;
struct Bone
{
int32_t parent;
string name;
XMFLOAT3 pos;
};
... | true |
76582b164425b9476dc64d58db0cb17d2b5fa5ed | C++ | thar/Klondike | /models/Game.cpp | UTF-8 | 607 | 2.546875 | 3 | [] | no_license | #include "Game.h"
#include "KlondikeCommandShopBuilder.h"
Game::Game(GameDeck gameDeck)
: gameBoard_(gameDeck.getSuitsNames(), gameDeck.getPile()), score_(0),
gameCommandShop_(KlondikeCommandShopBuilder::createCommandShop(gameBoard_, score_))
{
}
std::shared_ptr<KlondikeCommand> Game::getCommand(uns... | true |
d2e2c594b6ec78dde39809012f2de1d5d1483010 | C++ | amoghkashyap/STL_cplusplus | /STLMay/algorithms/algorithm_8.cpp | UTF-8 | 1,763 | 3.046875 | 3 | [] | no_license | //============================================================================
// Name : STLMay.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include<vec... | true |
90852c54745825598fd1d5ad5a68a6cbf06eeb7c | C++ | SimoV8/Jobs-Scheduler | /src/Resource.h | UTF-8 | 907 | 2.640625 | 3 | [] | no_license | //
// Created by Simone on 22/02/2016.
//
#ifndef JOBSSCHEDULER_RESOURCE_H
#define JOBSSCHEDULER_RESOURCE_H
#include <unordered_map>
using namespace std;
class Resource {
private:
int availability;
unordered_map<int, int> usedResources;
public:
Resource(int availability);
int findStartTimeAvailableR... | true |
02ee6c53cd3ce5395d387eaf532d51f706835279 | C++ | wwildey/voxel | /src/game/Item.h | UTF-8 | 555 | 2.796875 | 3 | [] | no_license | /**
* Voxel Engine
*
* (c) Joshua Farr <j.wgasa@gmail.com>
*
*/
#pragma once
/**
* A game item
*/
class Item
{
public:
typedef enum
{
WEARABLE_TYPE_FEET,
WEARABLE_TYPE_LEGS,
WEARABLE_TYPE_HEAD,
WEARABLE_TYPE_CHEST
} WearableType;
typedef enum
{
ITEM_TYPE_ORE,
ITEM_TYPE_PLANT,
I... | true |
1c731f9f44a4c70df056921e3b039e3884d6ecc5 | C++ | CristianERAU/PSP | /ethernetswitch.hpp | UTF-8 | 1,613 | 2.625 | 3 | [] | no_license | ///////////////////////////////
// CS225 Spring 2016 //////////
// Cristian Garcia ////////////
///////////////////////////////
///////////////////////////////
#ifndef ETHERNETSWITCH_HPP_
#define ETHERNETSWITCH_HPP_
// Include Directives /////////
#include <iostream>
#include <string>
#include "packetswitch.hpp"
using... | true |
e88a2a62e4eac972c60907484d63797a6de04bd0 | C++ | epitacioneto/UFPB | /LP1/roteiro6/questao1/Relogio.cpp | UTF-8 | 1,282 | 2.90625 | 3 | [] | no_license | //
// Created by epitacio on 19/09/17.
//
#include "Relogio.h"
Relogio::Relogio() {
}
Relogio::~Relogio() {
}
void Relogio::setHorario(int hora, int minuto, int segundo) {
this->hora = hora;
this->minuto = minuto;
this->segundo = segundo;
}
int Relogio::getHora() {
return hora;
}
int Relogio::ge... | true |
b524b6341faea69a1ce619b758e425bbeb893d14 | C++ | parinphatw/CPlusPlus | /Grader/ds01_most/ds01_most/main.cpp | UTF-8 | 650 | 2.921875 | 3 | [] | no_license | //
// main.cpp
// ds01_most
//
// Created by Ryu Lunoz on 29/8/2562 BE.
// Copyright © 2562 Ryu Lunoz. All rights reserved.
//
#include <iostream>
#include <map>
using namespace std;
int main() {
// insert code here...
int num;
cin >> num;
map<string, int> container;
for (int i = 0; i < num; i... | true |
a73d99ad8f5545d2350c9792e557c2646e97026b | C++ | feiqiu/repository-of-projects | /Win32/typename/main.cpp | UTF-8 | 1,150 | 2.640625 | 3 | [] | no_license |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <crtdbg.h>
inline void EnableMemLeakCheck()
{
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
}
template<typename T>
class Typename{
public:
static const char* get(){ return T::getTypeN... | true |
2b38f513890d2fd625ae3024b3b73f59735cfed8 | C++ | picasso250/leetcode | /4.Median of Two Sorted Arrays.cpp | UTF-8 | 684 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <array>
#include <string>
using namespace std;
class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
long s=0;
int c=0;
for (int i : nums1) {
s += i;
c++;
}
for (int i : nu... | true |
0d66fb8942fc988494918c630076ee6af835639a | C++ | BamdaXP/SimpleRaytracing | /SimpleRaytracing/src/Random.hpp | UTF-8 | 384 | 2.71875 | 3 | [] | no_license | #pragma once
#include <random>
class Random
{
public:
static float FRandom();
static float FRandom(float a, float b);
static int IRandom();
static int IRandom(int a,int b);
static void SetSeed(uint32_t seed);
private:
static std::default_random_engine s_Engine;
static std::uniform_int_distribution<int> s_IntDis... | true |
2328be1f257f17b029bf3e09683c2542bd3b5f79 | C++ | hongwei7/LeetcodePractice | /129.求根到叶子节点数字之和.cpp | UTF-8 | 993 | 3 | 3 | [] | no_license | // @before-stub-for-debug-begin
#include <vector>
#include <string>
#include "commoncppproblem129.h"
using namespace std;
// @before-stub-for-debug-end
/*
* @lc app=leetcode.cn id=129 lang=cpp
*
* [129] 求根到叶子节点数字之和
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val... | true |
f2c41058db6c679af36426865172e067f77928b9 | C++ | himchawla/networkingSide | /spaceInvaders/level.cpp | UTF-8 | 2,521 | 2.640625 | 3 | [] | no_license | //
// Bachelor of Software Engineering
// Media Design School
// Auckland
// New Zealand
//
// (c) 2019 Media Design School
//
// File Name : level.cpp
// Description : Implemntation for level class
// Author : Himanshu Chawla
// Mail : Himanshu.Cha8420@mediadesign.mail.nz
//
//... | true |
cc74e8bce2a8ff579b052686bb9b62e75aa74568 | C++ | MasonSu/leetcode | /swordCode/05_PrintListFromTailToHead.cpp | UTF-8 | 1,064 | 3.890625 | 4 | [] | no_license | /**
*
* 输入一个链表,从尾到头打印链表每个节点的值。
*
*/
#include <iostream>
#include <vector>
#include <stack>
using std::vector;
using std::stack;
struct ListNode {
int val;
ListNode *next;
ListNode(int x): val(x), next(nullptr) {}
};
/* 如果不能修改输入的话,就不能翻转链表 */
/*class Solution {
public:
vector<int> printListFromTailToHead(... | true |
9ee55a8467cff3dcf49c01f6320f0184dd705bca | C++ | maurime2/Buckey-C-Tutorials | /C++/Buckey Tutorials/45. Buckey - Member Initializers/Sally.cpp | UTF-8 | 427 | 2.890625 | 3 | [] | no_license | /*
* File: Sally.cpp
* Author: Dell
*
* Created on August 31, 2015, 9:04 AM
*/
#include "Sally.h"
#include <iostream>
using namespace std;
Sally::Sally(int a, int b)
: regVar(a), //List for Member Initializers
constVar(b) //For Constant Variables.
{
}
void Sally::print()... | true |
91b300280c67fb30841ed842b813f200110f946f | C++ | zmdyemwp/w10 | /legecy_tools/BitFontCreatorX/BitFontCreatorX/BoldNumFont/backup/BoldNumUtil.cpp | UTF-8 | 2,010 | 2.828125 | 3 | [] | no_license |
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "BoldNumTable.h"
const static int space_width = 6;
/*
letter set: 0x21 - 0x3f (from "!" to "?")
For the bold numbers with height 10: set the value of parameter "size": 0
For the bold numbers with height 17: set the value of parameter "size": 1
... | true |
0863379253d67907e7c6fc3d6524fe134b2a474d | C++ | LauraDiosan-CS/lab8-11-polimorfism-JacquelineK01 | /Lab08-10-live+tema/Lab08/RepositoryFileTxt.cpp | UTF-8 | 2,854 | 2.515625 | 3 | [] | no_license | #include "RepositoryFileTxt.h"
/*
RepositoryFileTxt::RepositoryFileTxt()
{
strcpy(this->airplaneTripsFileName, " ");
strcpy(this->busTripsFileName, " ");
strcpy(this->writeFileName, " ");
this->textOrCSV = 0;
}
RepositoryFileTxt::~RepositoryFileTxt()
{
}
void RepositoryFileTxt::loadBusTripsFromFil... | true |
d87f9e5a4ef8ae0c68b648790c04b2c9447203ad | C++ | johnnydevriese/wsu_comp_sci | /cpts_122/pa6_VS/pa6_VS/main.cpp | UTF-8 | 3,634 | 3.15625 | 3 | [
"MIT"
] | permissive | /*******************************************************************************************
* Programmer: Johnny Minor *
* Class: CptS 122, Spring 2015; Lab Section 04 *
* Programming Assignment: Program... | true |
3082ce3779e212db29bea7ee3a10d4741b83f7bb | C++ | nya3jp/icpc | /camp/2008russia/src/upsolving/journey.cpp | UTF-8 | 1,962 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <complex>
#include <cstdio>
#include <cmath>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)(n); i++)
#define ALLOF(c) (c).begin(), (c).end()
#define PROBLEM_NAME "journey"
#define MOD 1000000009
typedef int** matrix_t;
matrix_t new_matrix(int n) {
... | true |
08a122df86db9a124c43248b0249dee24d7fcb1e | C++ | tl3shi/cpp_hello_world | /morethan1address.cpp | UTF-8 | 363 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
class Base
{
public:
int a;
double x;
char xx;
};
class Derived: public Base
{
public:
int b;
};
int main()
{
Derived d;
d.b = 1;
Base* b = &d;
Derived* d2 = &d;
cout << b << endl;
cout << d2 << endl;
printf("%p",... | true |
0191769457bd1774ee665ffc80510a6e1aca5c39 | C++ | MartinChan3/CyComputerNote | /LeetCode/001TwoSum.cpp | GB18030 | 1,131 | 3.375 | 3 | [] | no_license | #include <vector>
#include <unordered_map>
#include <iostream>
using namespace std;
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int, int> m; //ʹmapҪԭΪʱΪO(n)
vector<int> res;
for (int i = 0; i < nums.size(); ++i) {
m[nums[i]] = i; //ֵ-ֵķʽ
}
for (i... | true |
cdb4924eb24181c0a2a4594476e49ef40d0a4061 | C++ | matthiasds/sdl_racegame | /components/SdlDebugComponent.h | UTF-8 | 1,250 | 2.578125 | 3 | [] | no_license | /*
* SdlDebugComponent.h
*
* Created on: 10-may.-2015
* Author: Matthias
*/
#ifndef SDLDEBUGCOMPONENT_H_
#define SDLDEBUGCOMPONENT_H_
#include <iostream>
class SdlDebugComponent : public IComponent {
public:
SdlDebugComponent(Au_2Drenderer::Renderer* renderer, std::string fontPa... | true |
7fbae9a83d7b226183c15ee3bcf7cc583c0031c6 | C++ | abhisehekkumr/DP | /coinChangeProblem.cpp | UTF-8 | 1,187 | 3.546875 | 4 | [] | no_license | /*
You are given an infinite supply of coins of each of denominations D = {D0, D1, D2, D3, ...... Dn-1}.
You need to figure out the total number of ways W, in which you can make change for Value V using coins of denominations D.
Note : Return 0, if change isn't possible.
*/
#include<bits/stdc++.h>
using namespace std... | true |
1f3a579c2be486a16ed840e166b116e129e79567 | C++ | ama0115/Hw06 | /untitled1/src/main/cpp/Queue.h | UTF-8 | 595 | 2.90625 | 3 | [] | no_license | /**
*CSC232 Data Structures
*Missouri State University
*
**@file Queue.hp
* @author Austin Alvidrez<ama0115@live.missouristate.edu>
* @brief Header of Queue
*/
#ifndef HW06_QUEUE_H
#define HW06_QUEUE_H
#include "Node.h"
template <class ItemType>
class Queue {
private:
int star... | true |
21ef831936dcd349e35fa66c4d890f33c2881779 | C++ | MoritzD/LegoLab | /uart.cpp | ISO-8859-3 | 1,879 | 2.703125 | 3 | [] | no_license | /*
* uart.cpp
*
* Created on: 01.06.2016
* Author: Berkay
*/
//#include "uart.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
int main() {
int uart0_filestream = -1;
uart0_filestream = open("/de... | true |
9b1e03645cdd713adf4244db2bac2cc13b641e4e | C++ | tinwoon/baekjoon_algorithm | /Algorithm_code/2580_x.cpp | UHC | 3,284 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
std::vector< std::vector<int> >map(9,std::vector<int>(9));
std::vector< std::vector<int> >blank_data;
//Ʈŷ
//dfs ߴٴ ǹ̰ ùٸ .
std::vector<int> Enable_num(std::vector<int> v) {//, , 簢 ȿ ش ǥ
std::vector<int> number = { 1,2,3,4,5,6,7,8,9 };
for (int... | true |
8e7f68e2f32eccf02216a46f5e283a0601277699 | C++ | GaryZ700/CPSC350_Assignment5 | /student_record.h | UTF-8 | 655 | 2.875 | 3 | [] | no_license | /* Gary Zeri
ID: 2321569
zeri@chapman.edu
CPSC 250-02
Assignment 5: Building a Database with Binary Search Trees
*/
#ifndef STUDENT_RECORD_H_
#define STUDENT_RECORD_H_
#include "serialization_helper.h"
#include "database_record.h"
using namespace std;
class StudentRecord : DatabaseRecord{
friend class Databas... | true |
c2654bb792ce7c37441e6e9ee2b0b8a5ac2bd5f9 | C++ | RyanMoss96/Generic-Linked-List | /Templates/Templates.cpp | UTF-8 | 616 | 3.0625 | 3 | [] | no_license | // Templates.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "LinkedList.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
LinkedList<string>* myList = new LinkedList<string>;
myList->pushFront("a");
myList->pushFront("b");
myList->pushFron... | true |
8f2c0db689b7e21820a49ad40b7370a469aaf08a | C++ | qls152/CPP-design-parttern | /command-pattern/remote_control_test.cc | UTF-8 | 1,275 | 2.578125 | 3 | [] | no_license | #include "command/garge_door_command.h"
#include "command/garge_door_off_command.h"
#include "command/light_command.h"
#include "command/lightoff_command.h"
#include "slot/normal_garge_door.h"
#include "slot/normal_light.h"
#include "control/remote_control.h"
int main() {
RemoteControl remote_control;
auto garge... | true |
f17245f7c4de96acac4ed5ddb0ada8bd945aab6f | C++ | sungindra/codingame-solutions | /multiplayer/coders_strike_back/wood_1_league.cpp | UTF-8 | 1,106 | 3.046875 | 3 | [] | no_license | #include <cstdlib>
#include <cstdio>
#include <cstring>
int main() {
// game loop
while (1) {
int x;
int y;
int nextCheckpointX; // x position of the next check point
int nextCheckpointY; // y position of the next check point
int nextCheckpointDist; // distance to the n... | true |
f121debdd0536e6f862b03883509fa26611dd55e | C++ | Markay12/cardCounting | /src/Cards.cpp | UTF-8 | 1,184 | 3.46875 | 3 | [] | no_license | #include "Cards.h"
#include <cstddef>
#include <cstdlib>
#include <ctime>
//give random card value
Cards::Cards()
{
srand(time(NULL));
this->val = rand() % 13 + 1;
this->suit = rand() % 4 + 1;
}
//give card new values
void Cards::setCard()
{
this->val = rand() % 13 + 1;
this->suit = rand() % 4 + 1;
}
char... | true |
fd6822e526c0d1083057fd0abc482e20176fb891 | C++ | Subzero-10/leetcode | /130.surrounded-regions.cpp | UTF-8 | 2,007 | 2.90625 | 3 | [] | no_license | /*
* @lc app=leetcode id=130 lang=cpp
*
* [130] Surrounded Regions
*/
// @lc code=start
class Solution {
public:
void solve(vector<vector<char>>& board) {
int rlen = board.size();
if (rlen == 0)
{
return;
}
int clen = board[0].size();
if (clen == 0)
... | true |