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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
595e67ad2874bc5047a45c63249d14cf75ceb51e | C++ | kmanghat/Kattis-Solutions | /permutationEncryption.cpp | UTF-8 | 914 | 2.9375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int roundUp(int numToround, int multiple)
{
int remainder = numToround % multiple;
if(remainder == 0)
return numToround;
return numToround + multiple -remainder;
}
int main()
{
int n;
while(cin>>n && n != 0)
{
vector<int> perm;
vector<string> msgholde... | true |
aaa944fbaa3cfab928db7c70d9c78faf565af37c | C++ | mzry1992/workspace | /OJ/CDOJ/POJ3608.cpp | GB18030 | 6,646 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const double eps = 1e-6;
struct Point
{
double x,y;
Point(){}
Point(double _x ,double _y)
{
x = _x;
y = _y;
}
Point(Point a,Point ... | true |
64a139a265bc98127cef423bfd29d3e266e444cc | C++ | InGen6400/Neural_Practice | /NeuralPractice/neuron.cpp | SHIFT_JIS | 768 | 2.828125 | 3 | [] | no_license | #include "stdafx.h"
#include "neuron.h"
#include <math.h>
#include <random>
void Neuron_New(Neuron *neuron, int count, int prevCount) {
neuron = (Neuron*)calloc(count + 1, sizeof(Neuron));
neuron->wheight = (double*)calloc(prevCount, sizeof(double));
}
void Neuron_Init(Neuron *neuron, int count, int prevCount) {... | true |
8749e08c5edb18b48b290d5201410461914829b0 | C++ | roche-emmanuel/singularity | /sources/wx/interface/wxApp.h | UTF-8 | 19,277 | 2.75 | 3 | [] | no_license | #ifndef _WX_APP_H_BASE_
#define _WX_APP_H_BASE_
enum
{
wxPRINT_WINDOWS = 1,
wxPRINT_POSTSCRIPT = 2
};
class wxAppConsole : public wxEvtHandler, public wxEventFilter
{
public:
// ctor and dtor
//wxAppConsole();
//virtual ~wxAppConsole();
// the virtual functions which may/must be overridden in... | true |
dd6b6a092b50623fc58d9236bd4f7d27df8a4bf0 | C++ | kartashowRoman/C-C-Qt-course | /HOMEWORK14/tictactoe.cpp | UTF-8 | 6,995 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <cstdlib>
#define PLAYER2 2
class Board {
public:
Board():board {" -"," -"," -"," -"," -"," -"," -"," -"," -",}{}
~Board(){}
std::string board[9];
};
//отображение игрового поля
class Display : public Board {
public:
Display(): mode(0){}
int ChooseGameMode... | true |
0ac7c44af1299e36b2d4330499203ded986cdb91 | C++ | psalire/Chat-Application | /src/class_user.cc | UTF-8 | 393 | 3.296875 | 3 | [] | no_license | #include "user.h"
void User::setName(const std::string user_name) {
/* Check if valid username */
if (!std::regex_match(user_name, std::regex("^[0-9a-z]+$", std::regex::icase))) {
std::cout << "Error: Invalid username \"" << user_name
<< "\". Username must consist only of [a-zA-... | true |
7df6abf186ce1bc0436db455f1a7d4756553133e | C++ | Shaurov05/OJ-problem-solving | /oddsum.cpp | UTF-8 | 382 | 2.609375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
scanf("%d", &t);
for(int i= 0 ;i<t ;i++){
int a,b, sum=0;
scanf("%d%d", &a,&b);
while(a<=b){
if(a%2!=0){
sum+= a;
}
a++;
}
... | true |
b7a3a4608272eb84f2ad3186ea04518aa13689fe | C++ | Argonnite/metagraph | /lib/Association.h | UTF-8 | 4,417 | 2.8125 | 3 | [] | no_license | #include "AssociationList.h"
#ifndef _Association_h
#define _Association_h 1
#ifdef __GNUG__
#pragma interface
#endif
/*******************************************************************
Copyright (c) 1997
Hewlett-Packard Company
Permission to use, copy, modify, distribute and sell this software and
its documenta... | true |
4b7bf0fe57a110d71ea103dbb7603116750f682d | C++ | jlgallego99/DesarrolloSoftware_DS | /Practica1/S2/src/componenteEquipo.cc | UTF-8 | 228 | 2.5625 | 3 | [] | no_license | #include "componenteEquipo.h"
componenteEquipo::componenteEquipo(int c, string n){
coste = c;
nombre = n;
}
int componenteEquipo::getCoste(){
return coste;
}
string componenteEquipo::getNombre(){
return nombre;
}
| true |
cd3da5a1399f5528fe2f41c1123075905560c2d7 | C++ | beneG/il2_test | /cockroach_simulator/Cockroach.h | UTF-8 | 6,638 | 2.796875 | 3 | [] | no_license | #pragma once
#include <Windows.h>
#include <cmath>
#include <complex>
#include <list>
#include <memory>
#include <string>
#include "Food.h"
#include "static_global_vars.h"
class Cockroach
{
public:
constexpr static const int DEFAULT_RADIUS = 10;
constexpr static const int MAX_RADIUS = 20;
... | true |
dd3b80fd19338e4bf1fc9ac717de6a451754466e | C++ | moonnesa/FYS3150-2020 | /Project3/solar_system_main.cpp | UTF-8 | 3,788 | 2.6875 | 3 | [] | no_license | #include "iostream"
#include "solvers.h"
#include <tuple>
using namespace std;
int main(int argc, char *argv[]){
double t = 10.0;
int n = 1000;
int N = n * int(t);
double h = 1. / double(n);
wanderer Earth(vec3(1,0,0), vec3(0,5,0), 0.0000003, "Earth");
/*wanderer Mercury(vec3( 3.4955360684609... | true |
edc10dedc1006963928187e2b75d66adb72a2dcd | C++ | AlexOpanasevych/lab_2_sem | /unit6/5.cpp | UTF-8 | 278 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
long mystrtol(char *p, char **end){
return strtol(p, end, 10);
}
int main() {
char * p = new char[10];
char *end;
cin.getline(p, 10);
cout << mystrtol(p, &end);
return 0;
} | true |
b557da6fb2ec4e401c0911b08d12539a900e325a | C++ | timzheng0804/Leetcode | /Inorder Successor in BST.cc | UTF-8 | 701 | 3.28125 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
void findSuccessor(TreeNode* root, int val, TreeNode* &next) {
if (!root) return;
... | true |
673b67eb4ab300a82ca56055bdc3f19517854b64 | C++ | IsRatJahan17/vs-code-c- | /vsCode c++/A_Very_Big_Sum.cpp | UTF-8 | 340 | 2.75 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,pos=0,neg=0,zer=0;
cin>>n;
int* arr= new int[n];
while(n--){
cin>>arr[n-1];
}
for(int i=0;i<n;i++){
if(arr[i]>0) ++pos;
else if(arr[i]<0) neg++;
else zer++;
}
cout<<pos<<neg<<zer;... | true |
62beb6d9cfb01fa06e9dab9011864c56111877f1 | C++ | open-goal/jak-project | /third-party/replxx/src/killring.hxx | UTF-8 | 1,651 | 2.984375 | 3 | [
"HPND-Markus-Kuhn",
"LicenseRef-scancode-unicode-mappings",
"BSD-3-Clause",
"GPL-1.0-or-later",
"ISC"
] | permissive | #ifndef REPLXX_KILLRING_HXX_INCLUDED
#define REPLXX_KILLRING_HXX_INCLUDED 1
#include <vector>
#include "unicodestring.hxx"
namespace replxx {
class KillRing {
static const int capacity = 10;
int size;
int index;
char indexToSlot[10];
std::vector<UnicodeString> theRing;
public:
enum action { actionOther, acti... | true |
9cc1f5a878e85a6cc8705d063e9f637d57e7f2ef | C++ | eitanshalev/Lion-King-Scar | /Lion King Scar/include/GameObject.h | UTF-8 | 1,022 | 2.890625 | 3 | [] | no_license | #pragma once
#include "Globals.h"
class GameObject {
public:
virtual void draw(sf::RenderWindow&) = 0;
GameObject(sf::Vector2f& location) : m_location(location), m_startingLocation(location){}
virtual void animation(float deltaTime) = 0;
virtual void update(float deltatime) = 0;
virtual void move(floa... | true |
f53f569fc3509c999058716e28f4a4e1a45d953d | C++ | dbuksbaum/FreeOrion | /FreeOrion/util/XMLObjectFactory.h | UTF-8 | 4,075 | 3.109375 | 3 | [] | no_license | // -*- C++ -*-
/* Copyright (C) 2006 T. Zachary Laine
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 2.1
of the License, or (at your option) any later version.
... | true |
d861f93030dca839b235e7cae0388c492e37bf86 | C++ | r4hu1s0n7/HarryPotter-Spells | /Diffindo.cpp | UTF-8 | 1,915 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <filesystem>
#include <queue>
#include <algorithm>
#include <fstream>
#include "cxxopts.hpp"
using namespace std;
using namespace cxxopts;
namespace fs = std::filesystem;
void parse(int argc, char* argv[], char& delimiter, int& field, vector<fs::path>& inputs) {
try {
cx... | true |
1eb4d9792d4d71f4d38b66172bc4ea40710977cf | C++ | rsguru/cs124 | /homework/example26EoF.cpp | UTF-8 | 430 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
main usingEoF(const char filename[])
{
ifstream fin(filename);
if (fin.fail())
{
cout << "Unable to open file " << filename endl;
return;
}
// get the data and display it on the screen
char test[256];
// keep reading as long as not at the end of ... | true |
11c8dcd1bf644143a14cfeddc247567539ccdef0 | C++ | daanvanhasselt/Triangle-Visuals | /TriangleReceiver v.0.9 copy/src/testApp.cpp | UTF-8 | 9,459 | 2.78125 | 3 | [] | no_license | #include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
maximumAreaThreshold = getMaximumTriangleArea()/5; // we'll use this value for determining which layers to enable
triangleReceiver.setup(3334); // setup trianglereceiver to listen on port 3334
... | true |
48d9e4e556fa8b1d06d05be985745761c8ceed5f | C++ | Neverous/codeforces | /188/a.cpp | UTF-8 | 218 | 2.59375 | 3 | [] | no_license | /* 2013
* Maciej Szeptuch
* II UWr
*/
#include <cstdio>
long long int n, p;
int main(void)
{
scanf("%I64d %I64d", &n, &p);
printf("%I64d\n", (p <= (n + 1) / 2) ? 2 * p - 1 : 2 * (p - (n + 1) / 2));
return 0;
}
| true |
72bd2c91bca53dced735ff099d18fad94a20b93b | C++ | dchao34/kde_cv | /data/weighted_down_sample.cc | UTF-8 | 1,394 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <algorithm>
#include <random>
#include "file_io_utils.h"
using namespace std;
// --------------------------------------------------------------------
// Input:
// File with one record per line, delimited with ",". One of the
// column entry s... | true |
d1eec354c8fb8c9186589e5af29590d4f41eb59a | C++ | junxzm1990/ASAN-- | /testcases/juliet_test_suite/testcases/CWE134_Uncontrolled_Format_String/s04/CWE134_Uncontrolled_Format_String__wchar_t_console_snprintf_84.h | UTF-8 | 1,856 | 2.890625 | 3 | [] | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE134_Uncontrolled_Format_String__wchar_t_console_snprintf_84.h
Label Definition File: CWE134_Uncontrolled_Format_String.label.xml
Template File: sources-sinks-84.tmpl.h
*/
/*
* @description
* CWE: 134 Uncontrolled Format String
* BadSource: console Read input f... | true |
726936f12a35f2865d3c44233ce81270a8a470a2 | C++ | watercannons/UCSB-CS16-Projects-and-Homework | /CS 16 HW/p5/HW5PrintASCIIPart2UNFINISHED.cpp | UTF-8 | 2,797 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
//argc is the number of words
//argv is a string of all the words, stored in array positions
bool ifOutputFile = false;
string fileName;
string outputFile;
if(argc <... | true |
8c8538fd6e5670f01974829a81e765fedad4520d | C++ | Mohit-121/Arjuna_files | /Arjuna 20-9-19/selling_idols.cpp | UTF-8 | 1,393 | 3.453125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int getAnswer(int* cost,int* sellingPrice,int numIdols,int levels,int initial){
if(numIdols==0){ //If we have no ideals left then return no of coins
return initial;
}
if(levels==0){
return INT_MIN; //If we have exhausted levels then retu... | true |
f6f080f0fef482e1facb766d872e537c78d762e2 | C++ | Mr-Poseidon/CFile | /C网/1163排队买票(递归).cpp | UTF-8 | 386 | 2.796875 | 3 | [] | no_license | #include<stdio.h>
int ans,na,ka;
void fun(int m,int n,int k)
{
if(ka>na)return;
if(m==0)
{
ans++;return;
}
for(int i=k;i>0;i--)
{
ka++;
fun(m-1,n,k-1);
ka--;
}
for(int i=n;i>0;i--)
{
na++;
fun(m-1,n-1,k);
na--;
}
return;
}
int main()
{
int m,n,k;
while(~scanf("%d%d%d",&m,&n,&k))
{
an... | true |
1a998ae8f4145134393188badc51d57c51a90598 | C++ | TomLeeLive/aras-p-dingus | /dingus/dingus/resource/StorageResourceBundle.h | UTF-8 | 4,202 | 2.734375 | 3 | [
"MIT"
] | permissive | // --------------------------------------------------------------------------
// Dingus project - a collection of subsystems for game/graphics applications
// --------------------------------------------------------------------------
#ifndef __STORAGE_RESOURCE_BUNDLE_H
#define __STORAGE_RESOURCE_BUNDLE_H
#incl... | true |
877ab93ecfa7711f78a1b9b898fe7ee50f62465b | C++ | DanielFHermanadez/Readme | /Trabajo#1/C++/Trabajo#5.cpp | UTF-8 | 247 | 2.9375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
double numero;
int n1;
cout<<"Inserte el numero que desea saber el 20%: " <<endl;
cin>>n1;
numero = n1*20/100;
cout<<"Su resultado es: " << numero <<endl;
}
| true |
96fe616c86ccc0719d7f48b7ee8743d3ca977d12 | C++ | gusenov/examples-cpp | /tpl/tpl-method-spec/main.cc | UTF-8 | 589 | 2.84375 | 3 | [
"MIT"
] | permissive | #include <cstdio>
#include <cstdlib>
#include "TPrimitiveStorage.h"
int main(int argc, const char* argv[]) {
IPrimitiveStorage* primitiveStorage = new TPrimitiveStorage();
char* charPointer = primitiveStorage->GetPointerOf<char>();
*charPointer = 'A';
printf("char = '%c'\n", primitiveStorage->GetRefOf... | true |
995d4a155cb2785072dd98936b636b386ba57da8 | C++ | jessicaione101/online-judge-solutions | /SPOJ/ELEICOES.cpp | UTF-8 | 507 | 2.90625 | 3 | [] | no_license | // http://br.spoj.com/problems/ELEICOES/
#include <iostream>
#include <map>
#include <utility>
#include <algorithm>
int main() {
int n;
std::cin >> n;
std::map<int, int> candidates;
int i;
for (int j = 0; j < n; ++j) {
std::cin >> i;
++candidates[i];
}
std::cout << (std::max_element(candidates... | true |
c256e319e21e12071345c08c5eb6427152cab179 | C++ | lemont037/URI | /Beginner/Average2.cpp | UTF-8 | 417 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
using std::cin,
std::cout,
std::endl,
std::fixed,
std::setprecision;
int main(int argc, char const *argv[])
{
double a, b, c, avg;
int wA = 2,
wB = 3,
wC = 5;
cin >> a
>> b
>> c;
avg = (a*wA + b*wB + c*wC)... | true |
dc2fb80d732b9be3be6d374287b904eb583a1b88 | C++ | markyang59/mkutility | /mkqueue.cpp | UTF-8 | 2,959 | 2.671875 | 3 | [] | no_license | #define WIN32_LEAN_AND_MEAN
#pragma once
#include "mkqueue.h"
#include "mkutil.h"
MKQ* mkq_create(int32_t sizemax)
{
MKQ* q = new MKQ;
q->sizemax = (sizemax == -1) ? MAXINT : sizemax;
q->sem_fill = ::CreateSemaphore(NULL, 0, q->sizemax, NULL);
q->sem_empty = ::CreateSemaphore(NULL, q->sizemax, q->sizemax, NULL)... | true |
49aaded524c902ae333986a1207b0ece709b4f74 | C++ | Amos-Q/Code | /2020_5_17/2020_5_17/test.cpp | GB18030 | 2,134 | 3.234375 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS 1
#include <vector>
#include <string>
using namespace std;
class AClass
{
public:
int num;
string name;
};
struct AStruct
{
int num;
string name;
};
void TestStruct()
{
//ʹ
AClass Ac;
vector<AClass> vc;
Ac.num = 10;
Ac.name = "name";
vc.push_back(Ac);
AClass d;
for (vector<A... | true |
4c5cc15e3317bc4494e174109a19e2428e2078f4 | C++ | Larzid/PRIME | /src/Skills.cpp | UTF-8 | 10,625 | 2.609375 | 3 | [] | no_license | /*******************************
Skill Management Code
each character has access to a variety of skills
********************************/
#include "Global.h"
#include "Util.h"
#include "Object.h"
#include "Hero.h"
#include "Interface.h"
int
shSkill::getValue () const
{
return mRanks + mBonus;
}
const char *
s... | true |
f839c60f32ef9a0e97fd82743546f06d9b409d58 | C++ | 257786/ProgramowanieObiektowe | /plik.cpp | UTF-8 | 2,746 | 2.9375 | 3 | [] | no_license | //
// plik.cpp
// ##5
//
// Created by yaroslav on 01/05/2021.
//
#include <iostream>
#include "plik.h"
#include "tablica.h"
using namespace std;
outPlik::outPlik(string path)
{
this->path = path;
open();
}
void outPlik::open()
{
plik.open(path);
}
void outPlik::close()
{
plik.close();
}
inPli... | true |
55bb088886cdf70b94e6dac80ca5d18496b21132 | C++ | miha53cevic/CPP | /RandomPracticeProjects/SimplePassOrFail.cpp | UTF-8 | 248 | 2.765625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main (){
int n;
cout << "Enter your score: ";
cin >> n;
if (n >= 50 && n < 80) cout << "\nPass!";
else if (n >=80) cout << "\nGreat Job";
else if (n <= 20) cout << "\nFail";
}
| true |
6782e44aac9930cd7fe8d393285056e3ef8ef5da | C++ | qinting513/Learning-QT | /2016 Plan/数据结构代码/第6章 树和二叉树/bo6-3.cpp | GB18030 | 4,774 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | // bo6-3.cpp (洢ṹc6-2.h)Ļ(18)㷨6.26.4
Status BiTreeEmpty(BiTree T)
{
if(T)
return FALSE;
else
return TRUE;
}
int BiTreeDepth(BiTree T)
{
int i,j;
if(!T)
return 0;
i=BiTreeDepth(T->lchild);
j=BiTreeDepth(T->rchild);
return i>j?i+1:j+1;
}
TElemType Root... | true |
72e3971d0fd7dc6e51f943e96e66d0c4014afd6c | C++ | codehz/mcpe-mods-dev | /src/uuid/main.cpp | UTF-8 | 3,018 | 2.671875 | 3 | [] | no_license | #include <string>
#include <sstream>
#include <climits>
#include <cstdio>
#include <ios>
#include <iomanip>
#include <minecraft/command/Command.h>
#include <minecraft/command/CommandMessage.h>
#include <minecraft/command/CommandOutput.h>
#include <minecraft/command/CommandParameterData.h>
#include <minecraft/command/C... | true |
d17c35ca1fd7f294121fa4c73590a5841a98aff8 | C++ | chaosfreak93/LotteryBot | /main.cpp | UTF-8 | 1,812 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <windows.h>
#include <thread>
using namespace std;
int claim = 1;
int maxTickets = 0;
int totalTickets = 0;
int klickPerSeconds = 1;
void StartBot() {
Sleep(50);
for (int i = 1; i <= maxTickets; i++) {
SetCursorPos(375, 275);
Sleep(1000 / klickPerSeconds);
... | true |
d5aff919e63198e3ffb5a623069ce339f7032742 | C++ | blizzaaard/lc2016 | /square_number.cpp | UTF-8 | 1,511 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <math.h>
using namespace std;
void print(const vector<int>& result)
{
for (int i = 0; i < result.size(); ++i) {
cout << result[i] << "^2";
if (i != result.size() - 1)
cout << '+';
}
cout << endl;
}
void helper(vector<int> *result,... | true |
a3e0bc5cc7a794ada8bfc41d9e3afc24ce87a519 | C++ | drewjbartlett/runescape-classic-dump | /eXemplar's-collection/exemplar/Apps 'n Bots/Apps 'n Bots/OCR/FOCRSource/src/KFC_KTL/suspendable.h | UTF-8 | 1,224 | 2.578125 | 3 | [] | no_license | #ifndef suspendable_h
#define suspendable_h
#include "basic_types.h"
#include "kfc_ktl_api.h"
// Activation suspension modes
#define ASM_NEVER (0)
#define ASM_ALWAYS (1)
#define ASM_DEFAULT (2) // ASM_ALWAYS for fullscreen, ASM_NEVER for windowed
// ------------
// Suspendable
// ------------
class ... | true |
4af3245ecbcad9c8d105058eb4d3af67adf64a39 | C++ | Bodo171/Sports-Tracker | /src/repository.cpp | UTF-8 | 4,091 | 3.109375 | 3 | [] | no_license | #include "repository.h"
static int emptyCallback(void* data, int argc, char** argv, char** azColName) {
return 0;
}
int getElementCallback(void* data, int argc, char** argv, char** azColName) {
Repository* myRepository=(Repository*) data;
myRepository->getEventFromDatabase(argc,argv,azColName);
return 0;
}
Reposi... | true |
6fe15e20f9672b38d7a73b019ae1c6eea6a1fc18 | C++ | pce913/Algorithm | /baekjoon/2141.cpp | UHC | 473 | 2.875 | 3 | [] | no_license | #include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
vector< pair<int, int> > a;
//߾Ӱ ãָ ȴ.
int main(){
int n;
long long sum = 0, s = 0;
scanf("%d",&n);
for (int i = 0; i < n; i++){
int x, y;
scanf("%d %d",&x,&y);
a.push_back({ x, y });
sum += y;
}
sort(a.begin(), a.end());
for (i... | true |
a5596f620e0e5fa3f1ffa77ae5ecdafe4cf266e7 | C++ | verdande2/CST136-Spring-12 | /inLab 6 pt II/main.cpp | WINDOWS-1252 | 427 | 2.890625 | 3 | [] | no_license | #include "Fraction.h"
int main(){
Fraction f1;
Fraction f2(2L, 0L);
Fraction f3(f2);
cout << f1 << endl;
cout << f2 << endl;
cout << f3 << endl;
f3 = f3 + Fraction(-5, 4);
f1 = f2 + f3;
cout << f1 << endl;
f1 = f2 - f3;
cout << f1 << endl;
f1 = f2 * f3;
cout << f1 << endl;
cout << (f1++)++ << endl; // W... | true |
14a60579b4bfc11c5f794b218d755f785202f458 | C++ | KORYUOH/koryuohproject-svn-server | /Additional_Class/Additional_Class/Koryuoh/Utility/ClassCheck/Utility.h | SHIFT_JIS | 1,028 | 2.84375 | 3 | [] | no_license | /**===File Commentary=======================================*/
/**
* @file Utility.h
*
* @brief [eB[wb_
*
* @author KORYUOH
*
* @date 2012/05/10
*/
/**===Include Guard========================================*/
#ifndef _UTILITY_H_
#define _UTILITY_H_
/**===File Include===============================... | true |
cd995565b2cfff9ecaa0f0e3e13061067999f673 | C++ | rAzoR8/SpvGenTwo | /dis/source/dis.cpp | UTF-8 | 2,274 | 2.515625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include "spvgentwo/Logger.h"
#include "spvgentwo/Module.h"
#include "spvgentwo/Grammar.h"
#include "common/HeapAllocator.h"
#include "common/BinaryFileWriter.h"
#include "common/BinaryFileReader.h"
#include "common/ConsoleLogger.h"
#include "common/ModulePrinter.h"
#include <cstring>
#include <cstdio>
using namespac... | true |
9cba421f702254ffe3c9ed876eb649360b0d77d7 | C++ | Shreyash-bit/Cpp-for-beginers | /tutorial20.cpp | UTF-8 | 556 | 3.15625 | 3 | [] | no_license | //============================================================================
// Name : tutorial20.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#includ... | true |
49ac5641f61a0b3bded9c439e50538588d76cf3f | C++ | ananevans/CarND-PID-Control-Project | /src/PID.cpp | UTF-8 | 908 | 2.890625 | 3 | [
"MIT"
] | permissive | #include "PID.h"
#include <iostream>
/**
*
* TODO: Complete the PID class. You may add any additional desired functions.
*/
PID::PID(double target) {
this->target = target;
reset_errors();
}
PID::~PID() {}
void PID::Init(double Kp_, double Ki_, double Kd_) {
/**
* TODO: Initialize PID coefficients (and e... | true |
4fa52a9a10231ddee82d02de4121225da541948f | C++ | tomault/inverted_penguin | /src/main/cpp/inverted_penguin/core/trie/detail/ByteTrieNode.hpp | UTF-8 | 2,736 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | #ifndef __INVERTEDPENGUIN__CORE__DETAIL__BYTETRIENODE_HPP__
#define __INVERTEDPENGUIN__CORE__DETAIL__BYTETRIENODE_HPP__
#include <inverted_penguin/core/detail/ByteTrieNodePosition.hpp>
#include <inverted_penguin/core/detail/ByteTrieBuilderKeyBuilder.hpp>
#include <limits>
#include <stdint.h>
namespace inverted_pengui... | true |
7fcc0c1ecd7059cf3f07525691297a5b879c26c8 | C++ | jmrCalvo/data-structure | /CLINVAR/include/enfermedad.h | UTF-8 | 3,920 | 3.4375 | 3 | [] | no_license | /**
@file TDA clinvar
**/
/*
* enfermedad.h
*
* Copyright (C) Juan F. Huete y Carlos Cano
*/
//**********************************************************************************************//
//**************Jose Manuel Rodríguez Calvo****************************************************//
//**********************... | true |
2355e932c1ec38a3a4e878e44401ae9ef5330001 | C++ | franhermani/argentum-taller | /client/sdl/exception.h | UTF-8 | 608 | 2.875 | 3 | [] | no_license | #ifndef SDL_EXCEPTION_H
#define SDL_EXCEPTION_H
#include <string>
#include <exception>
class SDLException : public std::exception {
std::string message;
public:
// Constructor
SDLException(const char *message, const char *sdl_error);
// Devuelve el mensaje de error
const char * what() const noexc... | true |
b60080148b0b979a6fc6ad853249549ada388a3b | C++ | bz866/Baruch-C-Certificate-HWs | /Level 6/Section 4.2b/Exercise 6/Stack.cpp | UTF-8 | 1,429 | 3.4375 | 3 | [] | no_license | #ifndef Stack_CPP
#define Stack_CPP
#include "Stack.hpp"
template <typename T, int size>
Stack<T, size>::Stack() : m_current(0), m_data(Array<T>(size)) {}
// template <typename T> // replaced by using an int value as template variable
// Stack<T, size>::Stack(int theSize) : m_current(theSize), m_data(Array<T>(theSiz... | true |
771ef9ecfb992341966164d80fde47c6c29eff58 | C++ | cuberite/cuberite | /src/Entities/Floater.h | UTF-8 | 1,041 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive |
#pragma once
#include "Entity.h"
// tolua_begin
class cFloater :
public cEntity
{
// tolua_end
using Super = cEntity;
public: // tolua_export
CLASS_PROTODEF(cFloater)
cFloater(Vector3d a_Pos, Vector3d a_Speed, UInt32 a_PlayerID, int a_CountDownTime);
virtual void SpawnOn(cClientHandle & a_Client) ove... | true |
9524f8c9482f3e9618a4ec1e5d9278dfcc9864d8 | C++ | Faton6/containers_ADT | /new_own_classes/main_new_integer.cpp | UTF-8 | 2,116 | 2.90625 | 3 | [] | no_license | #include <stdexcept>
#include <iostream>
#include <string>
#include <cstdint>
//#include "integer.h"
#include "new_integer.cpp"
int main()
{
Integer a(12345);
std::cout << "################################\n";
Integer b("100000000000000000");
std::cout << "b = " << b << '\n';
Integer c;
c =... | true |
366ab4ac1e11872bc693d280e4d93a9c16b6f85e | C++ | mbatc/atLib | /projects/atLib/source/Graphics/API/Interface/atRenderTarget.cpp | UTF-8 | 728 | 2.828125 | 3 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | #include "atRenderTarget.h"
void atRenderTarget::AttachColour(atTexture *pTexture, const int64_t &slot, const int64_t &layer)
{
DetachColour(slot);
Attachment att;
att.pTex = pTexture;
att.slot = slot;
att.mipLayer = layer;
m_color.push_back(att);
}
void atRenderTarget::AttachDepth(atTexture *pTexture)
{
... | true |
fda494fd499cdfb227a11836a0e835fc0323d84a | C++ | DeviNoles/Matrix-Manipulation-Utility | /src/matman.cpp | UTF-8 | 17,240 | 3.140625 | 3 | [] | no_license | /**
* File: matman.cpp
* Description: Simple matrix manipulation utility.
* Provides an interactive interface in which users have a variety
* of commands that manipulate matrices. Nothing too complicated.
* Author: Forgetful Employee
* Date: 2017-02-21
*/
#include <iomanip> /* setw */
#include... | true |
562e03822be59f88f3bbb83cdd885e6d6a005e2e | C++ | UnknownFreak/OneFlower | /Project/Object/IBaseComponent.hpp | UTF-8 | 1,098 | 2.71875 | 3 | [] | no_license | #ifndef IBaseComponent_HPP
#define IBaseComponent_HPP
#include "BaseComponent.hpp"
#include <Helpers/String.hpp>
#include <Helpers/Enum/ComponentType.hpp>
#include <Module/EngineModuleManager.hpp>
#include <Module/Logger/OneLogger.hpp>
namespace Component
{
template<typename>
class IBase : public Base
{
public:
... | true |
c28b5afdba9c0fbf16bdf14b9ff76ec152a4a751 | C++ | QuentinVecchio/ModelisationProject | /Client/Fonctions.h | UTF-8 | 1,308 | 3.28125 | 3 | [] | no_license | #pragma once
#include <vector>
#include "Etiquette.h"
using namespace std;
string enleveEspace(const string &s) {
string newS;
for (int i = 0; i < s.length(); i++) {
if (s[i] != ' ') {
newS += s[i];
}
}
return newS;
}
vector<string>* splitString(const string &chaine, const char &separateur... | true |
920812cc08325c062504961827d506e4bc6ff9ef | C++ | KimPopsong/Embedded_Systems_Class | /Test.cpp | UTF-8 | 2,819 | 2.609375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define LCD_D4 2
#define LCD_D5 3
#define LCD_D6 1
#define LCD_D7 4
#define LCD_RS 7
#define LCD_EN 0
#define BT0 23
#define BT1 12
#define BT2 13
#define BT3 10
#define BT4 14
#define BT5 21
#define BT6 11
#define BT7 22
#define BT8 26
#def... | true |
caff57c6b42cf5a12fb9f7fd6ad846ecb24285e8 | C++ | johnsebin97/Google_Kickstart-2020 | /Round B/bike_tour/Solution.cpp | UTF-8 | 562 | 3 | 3 | [] | no_license | #include <iostream>
using namespace std;
int solve() {
int H[3];
int N, c, p, pp, result = 0;
cin >> N;
for (auto i = 0; i < N; i++)
{
c = i%3;
cin >> H[c];
if (1 < i && H[pp] < H[p] && H[p] > H[c]) {
result++;
}
pp = p;
p = c;... | true |
5f4a5329f94d5add9d37647c618ecca6f0a48234 | C++ | davidjacobo/Competencias | /HackerRank/pairs.cpp | UTF-8 | 665 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
void capture(vector<int>& arr,set<int>& st,int& n,int& k) {
int t;
cin>>n>>k;
for(int i=0;i<n;++i) {
cin>>t;
arr.push_back(t);
st.insert(t);
}
sort(arr.begin(), arr.end());
}... | true |
54eb4675ad73a46e8573f29d1d21d56dc8640cee | C++ | Nanored4498/ACM-L3 | /TD7-ycoudert/ycoudert-821.cpp | UTF-8 | 888 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include<iomanip>
using namespace std;
int main() {
cout.tie(nullptr);
ios::sync_with_stdio(false);
cout << fixed << setprecision(3);
int m[101][101];
bool u[101];
vector<int> s;
int i, j, a, b, c;
double res;
while(cin >> a >> b) {
if(a == 0) return 0;
s.cle... | true |
4d4b8b4c6a9426048485c1d6e1d4cb6b57e24af3 | C++ | yasserelsaid/PaintForKids | /Actions/AddTriAction.cpp | UTF-8 | 1,476 | 2.890625 | 3 | [] | no_license | #include "AddTriAction.h"
#include "..\ApplicationManager.h"
#include "..\GUI\input.h"
#include "..\GUI\Output.h"
AddTriAction::AddTriAction(ApplicationManager * pApp):Action(pApp)
{}
void AddTriAction::ReadActionParameters()
{
//Get a Pointer to the Input / Output Interfaces
Output* pOut = pManager->GetOutpu... | true |
f3aa6d13d10b08ef0c4c23632cd10a743ecc7e6b | C++ | nedma/ShaderX | /X3/Section 4 - Image Space/4.6 Aras Pranckevicius/sourcecode/dingus/dingus/utils/Singleton.h | UTF-8 | 1,145 | 2.90625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | // --------------------------------------------------------------------------
// Dingus project - a collection of subsystems for game/graphics applications
// --------------------------------------------------------------------------
#ifndef __SINGLETON_H
#define __SINGLETON_H
namespace dingus {
template<ty... | true |
da5a9fac658ed76c0f5812830a7ab2b3cf200bf3 | C++ | felipesdias/Extractor-URI-Online-Judge | /URI-ES/PRINCIPIANTE/2029 - Honey Reservoir.cpp | UTF-8 | 455 | 2.65625 | 3 | [] | no_license | // Autor: Felipe Souza Dias <felipe.s.dias@outlook.com>
// Nome: Honey Reservoir
// Nível: %d
// Categoria: PRINCIPIANTE
// URL: https://www.urionlinejudge.com.br/judge/es/problems/view/2029
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double n, d;
while(cin >> n >> d) {
... | true |
1921a3f6777aacb0e88f24c311a1897ab788eb4b | C++ | advatrix/labs3sem | /astroid/astroidProg/Astroid.cpp | UTF-8 | 892 | 3.109375 | 3 | [] | no_license | #include <strstream>
#include "Astroid.h"
namespace astroid {
Astroid::Astroid() {
r = 1;
Ra = 4;
}
double Astroid::length(double t) const {
if (t > acos(-1) * 2) return length();
if (t < 0) return 0;
if (t < (acos(-1))/2) return 1.5 * Ra * sin(t) * sin(t);
if (t < acos(-1)) return length() / 4 + le... | true |
c6b76a9179d274abea557019fb781cd3dd6abd82 | C++ | btcup/sb-admin | /exams/2558/02204111/1/midterm/3_1_715_5620500764.cpp | UTF-8 | 1,699 | 3.0625 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int main()
{
int b,c;
char a;
cout<<"Are you member (Y or N) : ";
cin>>a;
if(a=='Y')
{
cout<<"How old are you? :";
cin>>b;
if(b<2)
{
cout<<"Normal price : ";
... | true |
1ebb03cb55645194bbef3df7e1e729a8a6d33f91 | C++ | kunal164107/GfG | /Tree/BinaryTree/Find n-th node of inorder traversal.cpp | UTF-8 | 806 | 3.671875 | 4 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
class node{
public:
int data;
node* left;
node* right;
};
node* getnewnode(int key){
node* newnode = new node();
newnode->data = key;
newnode->left = NULL;
newnode->right = NULL;
return newnode;
}
void inorder(node* root,int n);
int main(){
... | true |
e0fe649f88fe96e430266b2260bcd2281266d0fa | C++ | wwwgitcom/CORA | /Cora/TOnce.h | UTF-8 | 71,006 | 2.609375 | 3 | [] | no_license | #pragma once
template<typename T1>
__forceinline void ONCE(T1 &&t1)
{
t1();
}
template<typename T1, typename T2>
__forceinline void ONCE(T1 &&t1, T2 &&t2)
{
t1();
t2();
}
template<typename T1, typename T2, typename T3>
__forceinline void ONCE(T1 &&t1, T2 &&t2, T3 &&t3)
{
t1();
t2();
t3();
}
template<typ... | true |
aacdc5db117245dc81f8ab138ac62b2e3488c779 | C++ | veodev/av_training | /defcore/EventManager_Qt.cpp | UTF-8 | 3,413 | 2.75 | 3 | [] | no_license | #include <ctime>
#include <QDebug>
#include "EventManager_Qt.h"
cEventManager_Qt::cEventManager_Qt()
{
pthread_mutex_init(&_eventMutex, nullptr);
pthread_cond_init(&_eventCond, nullptr);
pthread_mutex_init(&_dataMutex, nullptr);
}
cEventManager_Qt::~cEventManager_Qt()
{
qDebug() << "Deleting EventMana... | true |
60f3f850da7008314470e7b47820772bce087c1b | C++ | hthuynh2/Sava | /include/ShortestPath.cpp | UTF-8 | 1,960 | 2.875 | 3 | [] | no_license | #include "App.h"
#include "Vertex.h"
#include "Graph.h"
class ShortestPathVertex: public Vertex<int, int, int>{
public:
ShortestPathVertex(){
source_id = 1;
}
void compute(vector<int>& msgs);
void init_vertex_val(){
*MutableValue() = INT_MAX;
}
private:
int source_id;
};
... | true |
73c385b6dbf844520eb9db4d800930566b1f3980 | C++ | dshnightmare/LeetCodeC | /src/RestoreIPAddress.cpp | UTF-8 | 1,147 | 3.265625 | 3 | [] | no_license | #include <vector>
#include <sstream>
#include <string>
using namespace std;
class Solution{
public:
vector<string> restoreIpAddresses(string s){
stringstream stream;
return generate(4, s, stream);
}
vector<string> generate(int n, string s, stringstream &stream){
vector<string> result;
if(s.length() < n ||... | true |
d32d06cfc2ccbbce551d51175d9caa270c26e84b | C++ | Karacapps22/BuddyMemoryAllocator | /final_code/Main.cpp | UTF-8 | 2,116 | 3.015625 | 3 | [] | no_license |
#include <stdlib.h>
#include <stdio.h>
#include "Ackerman.h"
#include "BuddyAllocator.h"
//#include "BuddyAllocator.cpp"
//#include "Ackerman.cpp"
#include <getopt.h>
void easytest(BuddyAllocator* ba){
ba->printlist();
cout << "allocating 1 byte" << endl;
char * mem = (char *) ba->alloc (1);
ba->pri... | true |
820672878580eb8c6df8be5aef971447d6c2be4d | C++ | gitter-badger/BoostTutorials | /Random/Random1/Source/main.cpp | UTF-8 | 2,777 | 2.921875 | 3 | [
"MIT"
] | permissive | /*
Copyright (c) 2015-2017 Xavier Leclercq
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, me... | true |
3859fa3e0501141d16313be2556ae2ace46a4e11 | C++ | DarthCoder117/RRDTP | /cpp/test/LocalStoreTest.cpp | UTF-8 | 674 | 3.046875 | 3 | [
"MIT"
] | permissive | #include <RRDTP/LocalStore.h>
#include <RRDTP/Entry.h>
#include <cassert>
int main()
{
rrdtp::LocalStore localStore;
//Test integer storage
/*rrdtp::Entry* entry = localStore.Create(-1, "test-int", rrdtp::EDT_INT);
assert(entry != NULL);
entry->Set<int>(123456789);
assert(entry->Get<int>() == 123456789);
//T... | true |
5a1023c8a23fd0115a7c9379d5eccac26cd27291 | C++ | smacdo/euler | /src/problems/problem_9.cpp | UTF-8 | 868 | 3.125 | 3 | [] | no_license | #include "projecteuler.h"
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
REGISTER_PROBLEM(9, "Find pythagorean triple a+b+c=1000")
void problem_9( const std::vector<std::string>& args )
{
bool bAnswer = false;
for ( int a = 1; a < 1000 && !bAnswer; ++a )
{
for ( int b =... | true |
18a01702f978fdca9dd6898e63f9e1f3f9ab8ba5 | C++ | bytemaster/fc | /include/fc/io/json.hpp | UTF-8 | 1,808 | 2.59375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <fc/variant.hpp>
namespace fc
{
class path;
class ostream;
class buffered_istream;
/**
* Provides interface for json serialization.
*
* json strings are always UTF8
*/
class json
{
public:
static ostream& to_stream( ostream& out, const fc::strin... | true |
45a665c51128b9ad5099ae181b5ae24092267fbf | C++ | lysiak-yevhenii/cpp | /Pointers_to_members/main.cpp | UTF-8 | 1,361 | 4.15625 | 4 | [] | no_license | #include <iostream>
using namespace std;
//Pointers to members allow to refer to nonstatic members of class objects.
//You can not use a pointer to member to point to a static class member
//because the address of a static member is not associated with any particular
//object. To point to a static class member, you mu... | true |
f5b7820e7cd0b6d678c6399fc68375e20e854339 | C++ | lioneltn/pos | /order.cpp | UTF-8 | 3,845 | 2.71875 | 3 | [] | no_license | #include "order.h"
#include "order.h"
#include <QDateTime>
#include <QSqlQuery>
#include <QtSql>
Order::Order()
{
OrderDetail *OD=new OrderDetail();
}
Order::Order(int id_client,int id_emp,int id_caisse)
{
TOTAL=0;
QSqlQuery query;
query.prepare("SELECT ID_COM+1 FROM COMMANDE_TMP WHERE ID_CLIENT=:idc");
query.bindV... | true |
39d4558bfb89368f5680f3901ac53259b0f30031 | C++ | Lruihao/c-code | /cpp/大二暑假/Dreamoon and WiFi.cpp | WINDOWS-1252 | 1,696 | 2.734375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
/*int main(){
int i,j,cnt=0;
long long c[11][11],sum=0,sum1=0;
for(i = 0; i < 11; i++){//
c[i][0] = 1;
c[i][i] = 1;
for(j = 1; j < i; j++)
c[i][j] = c[i-1][j] + c[i-1][j-1];
}
string a,b;
cin>>a>>b;
//cout<<a<... | true |
5849981b2301816df596577c6b8a61a515dba78c | C++ | jinrongsyb17/homework-space | /金泽俊/第五次作业-2017310345-金泽俊-17金融实验/8-4.cpp | UTF-8 | 447 | 3.53125 | 4 | [] | no_license | #include<iostream>
using namespace std;
class Counter
{public:
Counter(int i): i(i){};
~Counter() {};
void show(){cout<<i<<ends;};
friend Counter operator + (const Counter &o1, const Counter &o2);
private:
int i;
};
Counter operator + (const Counter &o1, const Counter &o2)
{return Counter (o1.i + o2.... | true |
b12a39a1b59cab5de7fd322d7dafae2386c3a31a | C++ | jonasla/icpc | /simulacros/TAP2016/j.cpp | UTF-8 | 636 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
#define forn(i,n) for(int i=0; i<(int)n; i++)
#define forsn(i,s,n) for(int i=int(s); i<(int)n; i++)
typedef long long tint;
int main()
{
tint n,l,c;
ios::sync_with_stdio(false);
cin.tie(NULL);
while (cin >> n >> l >... | true |
a5b34bfd330de9ab0450904df50a64ea4c527c6b | C++ | Cauahu/hihoCoder-training | /strcpy/strcpy.cpp | UTF-8 | 384 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <assert.h>
#include <string.h>
using namespace std;
char * strcpy_(char * dest, const char * src)
{
assert((dest != NULL) && (src != NULL));
char * address = dest;
while(*src != '\0')
*dest++ = *src;
return address;
}
int main()
{
char s[] = "123456789";
char d... | true |
a0fff75de7ec6680dfa56759474de3a07d498cb7 | C++ | Doresimon/my-ref | /snippet/sort/algorithm.sort.cpp | UTF-8 | 2,654 | 3.75 | 4 | [] | no_license | /**
* compared with js.array.sort()
*
* C++ sort function uses introsort which is a hybrid algorithm.
* Different implementations use different algorithms.
* The GNU Standard C++ library, for example,
* uses a 3-part hybrid sorting algorithm:
* introsort is performed first
* (introsort itself being a hybr... | true |
ae5a7953b08d91d2e4ed12d87c6797f60873b0d3 | C++ | tectronics/hapro | /Game2/Potion.cpp | UTF-8 | 1,885 | 2.5625 | 3 | [] | no_license | #include "Potion.h"
#include "Game.h"
#include "ObjectDatabase.h"
#include "StringLib.h"
#include "Renderer.h"
#include "Util.h"
#include "Level.h"
#include "Tile.h"
#include "Character.h"
Potion::Potion(PotionType type, int power) : ScrambledItem(GT_IT_POTION, TH_POTION_TYPE, g_objectDatabase->getScrambledPotionType(... | true |
e00089cd31ccfb44a93df09ad9394404ce27f3ad | C++ | Calipso341/C-my-begining- | /ClassWork/ClassWork 3.28.19/ClassWork 3.28.19/Source.cpp | UTF-8 | 2,816 | 3.375 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<Windows.h>
using namespace std;
struct Player {
string name;
string surname;
unsigned short age;
string position;
int price;
void ShowPerson() {
cout << "\n\n\tName: " << name << "\n\n\tSurname: " << surname << "\n\n\tAge: " << age << "\n\n\tPosition: " << pos... | true |
6727326109d6174e2eff19c0cb38837b31d43796 | C++ | leehosu/coding-test-cpp | /codeup/228.cpp | UHC | 377 | 2.609375 | 3 | [] | no_license | #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
double h, m;
cin >> h >> m;
double avg_m = (h-100) * 0.9;
double bmi = (m - avg_m) * 100 / avg_m ;
if(bmi <= 10) cout << "";
else if(bmi > 10 && bmi <= 20 ) cout <<"ü... | true |
bbda76f4420c1fb1b98ed127268d56ca0b61a68d | C++ | sayuree/leetcode-problems | /stack/1021.RemoveOutermostParentheses.cpp | UTF-8 | 593 | 3.359375 | 3 | [] | no_license | //O(n) time and O(n) space using Stack
//There is need to remove only outermost layer: No need to deal with nestedness
class Solution {
public:
string removeOuterParentheses(string S) {
stack<char> temp;
string res="";
for(char c:S){
if(c=='('){
if(temp.size()>0){
... | true |
cac7b7b7d2f37eb7dcbd4a3278027a2d8960277a | C++ | shailendra-singh-dev/ProgrammingChallenges | /Caribbean Online Judge COJ/2925 - Help with the Remote.cpp | UTF-8 | 302 | 2.75 | 3 | [] | no_license | #include <cstdio>
using namespace std;
int T, A, B, cont;
int main()
{
scanf("%d", &T);
while(T--)
{
cont = 0;
scanf("%d %d", &A, &B);
if(A == B) {printf("%d\n", 0); continue;}
while(A != B)
{
if(A < B) cont++, A++;
else A /= 2, cont++;
}
printf("%d\n", cont);
}
return 0;
} | true |
9c437e0faa25d886f675cc47b9f0db05a934e930 | C++ | Sahil12S/LeetCode | /Cplusplus/Union_Find/main.cpp | UTF-8 | 812 | 3.609375 | 4 | [] | no_license | #include "union_find.cpp"
int main()
{
// Let's have 8 nodes
// 1, 2, 3, 4, 5, 6, 7, 8
VVI pairs = {{1, 2}, {1, 3}, {2, 3}, {4, 3}, {5, 6}, {6, 7}};
UnionFind uf(8);
for (auto pair : pairs)
{
uf.unify(pair[0], pair[1]);
}
std::cout << "======================" << '\n';
std::... | true |
db778073fada4b4e7c672eecb6291519455de434 | C++ | Rory37/Classes | /classmusic.h | UTF-8 | 733 | 3.03125 | 3 | [] | no_license | #include "classparent.h" //sets up inheretence
class classmusic : public classparent {//sets up inheretence
public:
~classmusic(); //destructor
//Sets all the virtual methods (virtual lets it overide the parent class)
virtual void setArtist(char*); //function to set artist
virtual void setPublish(char*);//func... | true |
cd864bf650379dbfbcdd436bda5cccddedc575f5 | C++ | davidalain/RoboQuadrupede | /Sweep/Sweep.ino | UTF-8 | 3,179 | 2.59375 | 3 | [] | no_license | /* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
#define SERVO_ID 5
#define VERTICAL_ESQ_TRAS 0
#define LATERAL_DIAGONAL_PRINCIPAL 1
#define LATERAL_D... | true |
357878acace4a97a82fe2e3e391339a45b211c5b | C++ | HeroIsUseless/LeetCode | /20.cpp | UTF-8 | 1,075 | 3.609375 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
bool isValid(string s) {
int n = s.size();
char *stack = new char[n];
int s_n = 0;
for(int i=0; i<n; i++){
if(s[i] == '('){
stack[s_n++] = '(';
... | true |
5f5e4184ecff656dabd155ffef914a27d191623b | C++ | UnskilledLuck/RetroLED-old | /ledtest.ino | UTF-8 | 1,803 | 2.6875 | 3 | [] | no_license | #include <FastLED.h>
#define LED_PIN 2
#define NUM_LEDS 140
CRGB leds[NUM_LEDS];
void setup() {
Serial.begin(9600);
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
int currentPin = -1;
int ledCounter = 0;
int ledOn = 0;
while(true){
leds[ledOn] = CRGB(50,50,50);
// i... | true |
76169e8df4c888b77c9d55ca23f39bbdd5ba0cf4 | C++ | shiwenxiang/clucene | /src/CLucene/queryParser/MultiFieldQueryParser.h | UTF-8 | 3,107 | 2.609375 | 3 | [] | no_license | #ifndef MultiFieldQueryParser_H
#define MultiFieldQueryParser_H
#include "CLucene/StdHeader.h"
#include "CLucene/analysis/AnalysisHeader.h"
#include "CLucene/search/SearchHeader.h"
#include "QueryParser.h"
using namespace lucene::index;
using namespace lucene::util;
using namespace lucene::search;
using namespace luc... | true |
23e648a83f95d8261109f962d4fd6d197cd90803 | C++ | Chimnii/Algospot | /Problems/Programmers/Lv2.150368.cpp | UTF-8 | 1,419 | 3.21875 | 3 | [] | no_license | #include <string>
#include <vector>
using namespace std;
vector<int> calc_price(vector<int>& sales, const vector<vector<int>>& users, const vector<int>& emoticons)
{
int plus = 0, total_price = 0;
for (const vector<int>& user : users)
{
int buyable = user[0];
int plusable = user[1];
... | true |
2f48b172d50792df810b52fddfcee9a9e56c77f1 | C++ | CastBart/All-Projects | /Speed Souls Supreme/src/gui/GUI.cpp | UTF-8 | 10,003 | 3.046875 | 3 | [] | no_license | #include "gui\GUI.h"
/// <summary>
/// @brief Constructor of the GUI.
///
///
/// </summary>
/// <param name="controller">the controller to use</param>
/// <param name="checkboxTexture">texture to use for the checkbox</param>
GUI::GUI(std::shared_ptr<Xbox360Controller> controller, bool stripDraw)
: m_layoutNr(0)
,... | true |
e5246e38e834f632096a6b72e8b011703ba8b87a | C++ | NTUHEP-Tstar/ManagerUtils | /RootMgr/interface/HistMgr.hpp | UTF-8 | 1,956 | 2.53125 | 3 | [
"MIT"
] | permissive | /*******************************************************************************
*
* Filename : HistMgr
* Description : Class for Histogram management, uses Named class unque ID
* Author : Yi-Mu "Enoch" Chen [ ensc@hep1.phys.ntu.edu.tw ]
*
*********************************************************************... | true |
8fe5c7d82f338cc2ecb53cc40ee0bbf5e4d62e35 | C++ | 5dddddo/C-language | /자료구조/자구조HW1/linkedlist.cpp | UHC | 6,608 | 3.625 | 4 | [] | no_license | #include <iostream>
using namespace std;
#include <assert.h>
#include <malloc.h>
#include "linkedlist.h"
#include <string>
void create(LinkedList *lp)
{
lp->head = (Node *)calloc(1, sizeof(Node)); //Head Node
lp->tail = (Node *)calloc(1, sizeof(Node)); //Tail Node
lp->head->next = lp->tail; //Head next -> Tail pre... | true |
89ce36fc400518b69e1def555bdc8571609ee0af | C++ | Dzzirt/OOP | /Application/Application/ApplicationView.cpp | UTF-8 | 1,446 | 2.546875 | 3 | [] | no_license | #include "ApplicationView.h"
#include "iostream"
ApplicationView::ApplicationView()
{
m_workspace = std::make_shared<Workspace>(sf::Vector2f((WindowWidth - 640) / 2.f, 100), sf::Vector2f(640, 480));
m_toolbar = Toolbar(sf::Vector2f(0, 15), sf::Vector2f(float(WindowWidth), 40.f));
m_toolbar.AddButton(std::make_share... | true |