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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c2f5f1b0fc1ebc244d009cda2793f6c5045b5398 | C++ | sajalagrawal/BugFreeCodes | /GeeksforGeeks/Largest square formed in a matrix.cpp | UTF-8 | 940 | 2.53125 | 3 | [] | no_license | //https://practice.geeksforgeeks.org/problems/largest-square-formed-in-a-matrix/0
//https://www.geeksforgeeks.org/maximum-size-sub-matrix-with-all-1s-in-a-binary-matrix/
//Author- Sajal Agrawal
//sajal.agrawal1997@gmail.com
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000... | true |
ab8867544602d7e891aba98769804bf4acbe1b02 | C++ | ldematte/projectC | /Operand.h | UTF-8 | 4,756 | 2.796875 | 3 | [] | no_license |
#ifndef _OPERAND_H_INCLUDED_
#define _OPERAND_H_INCLUDED_
#include <iostream>
#include <stdio.h>
#include <string>
#include "common.h"
//cambia se siamo nel compilatore o nella vm
#ifdef COMPILER_ENVIRONMENT
#define STRING_TABLE StringTable::GetSingleton()
#else
#include "VirtualMachine/RTStringTable.h"
#def... | true |
69df2ed4cd6372a028a716e9bf749d8b541b62de | C++ | WesleyMatthews/Hour-of-CPP | /Conditions/Conditions.cpp | UTF-8 | 798 | 4.5 | 4 | [] | no_license | #include <iostream>
int main()
{
// Creates a double with a value of 3.5
// Doubles are like integers, but with decimal points
double x = 3.5;
// Runs the below code "block" if x > 1
if (x > 1)
{
std::cout << "x > 1\n";
}
// If x == 1 (if x is equal to 1), then this code will r... | true |
8a8f9e6ddb64b42d891545b1685328a6c5e93e0d | C++ | jlochman/JForex | /DataController/GenericDataController.h | UTF-8 | 1,054 | 2.609375 | 3 | [] | no_license | /*
* GenericDataController.h
*
* Created on: Jun 22, 2015
* Author: jlochman
*/
#include <vector>
#include "TTree.h"
using namespace std;
#ifndef DATACONTROLLER_GENERICDATACONTROLLER_H_
#define DATACONTROLLER_GENERICDATACONTROLLER_H_
class GenericDataController {
public:
GenericDataController(string br... | true |
711470260118cdac22e7fae267fd40546f218f42 | C++ | BlinkDrink/Introduction-To-Programming | /05-Loops/Exercise1_PP.cpp | UTF-8 | 622 | 3.5 | 4 | [] | no_license | #include <iostream>
using std::cin;
using std::cout;
using std::endl;
/*
Да се напише програма, която въвежда цяло положително число n и печата правоъгълен триъгълник от звездички с размер n.
Пример:
Вход: 1
Изход: *
Вход: 3
Изход:
*
* *
* * *
*/
void printTriangle(int n)
{
for (int row = 0; row <= n; row++)
... | true |
4da5072ec353c8c0c9a9f58f09886e96ab6a8923 | C++ | baodijun/pixel | /contrib/simd/ndk-hello-neon/src/helloneon.cpp | UTF-8 | 5,949 | 2.53125 | 3 | [
"MIT"
] | permissive | /*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | true |
dd8bcbb591443c3de03a587fc02d5281123c75c9 | C++ | Garrybest/coding-interviews | /src/q36.cpp | UTF-8 | 933 | 3.078125 | 3 | [] | no_license | /*
* 二叉搜索树与双向链表
* @Author: garryfang
* @Date: 2019-09-05 13:08:52
* @Last Modified by: garryfang
* @Last Modified time: 2019-09-05 13:14:42
*/
#include <utility>
#include "BinaryTreeNode.h"
std::pair<BinaryTreeNode *, BinaryTreeNode *> convertCore(BinaryTreeNode *root)
{
if (!root)
return {nullptr... | true |
61cd4cff149897eaf2d65af4792e8bd31b8c9669 | C++ | setsmdeveloper/SETSM | /grid.cpp | UTF-8 | 1,715 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | #include "grid_types.hpp"
template <typename GridType, typename IterType>
Grid<GridType, IterType>::Grid(INDEX width, INDEX height, GridPoint *points[], std::size_t num_points)
{
this->grid = new GridType(width, height, points, num_points);
}
template <typename GridType, typename IterType>
Grid<GridType, IterType>::... | true |
f891004bbf1dcc5929ae58326fbb52690cba0b8f | C++ | acgtun/gpu-perm | /mpi-perm/option.cpp | UTF-8 | 3,168 | 2.640625 | 3 | [] | no_license | #include "option.h"
void PrintSynopsis() {
printf(
"The input command is incorrect. please reference the following command. \n "
"./MPImapping [reference file or index file] [reads file]\n");
}
int GetStrVal(int argc, char** argv, const char* str, string & strVal) {
for (int i = 1; i < argc; i++) {
... | true |
693863103d6f0d799db248723548e7bd328368bf | C++ | ngoral/improc | /Week 1/Task 1/change_levels.cpp | UTF-8 | 1,789 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <stdexcept>
#include <string>
#include "improc.h"
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
static const unsigned STD_LEVELS_NUMBER = 256;
std::string getImageName(int argc, char** argv)
{
return (argc > 2) ? argv[2] : "no_signal.png";
}
bool isPowerOfTwo(unsigned n... | true |
a1ce263cd3bd4632166df9888c7d4d0e0562e32e | C++ | wupsi/PP1_2021_Spring | /2018/Midterm, V1/I.cpp | UTF-8 | 372 | 2.765625 | 3 | [] | no_license | // Rightmost set bit
// Перевод в двоичное число
#include <iostream>
using namespace std;
int main(){
int num = 0, ans = 0, d = 1, cnt = 0;
cin >> num;
while(num){
ans += (num % 2) * d;
num /= 2;
d *= 10;
}
while(ans % 10 == 0){
cnt++;
ans /=... | true |
40dd2268deb7ad653ae219c31feadba6f47d0c40 | C++ | alexander-hamme/Tadpole-Tracker-Cpp | /src/util/circular_buffer.h | UTF-8 | 1,112 | 3.4375 | 3 | [] | no_license | //
// Created by alex on 2/7/19.
//
#ifndef SPROJ_CPP_CIRCULARBUFFER_H
#define SPROJ_CPP_CIRCULARBUFFER_H
#endif
#include <vector>
using namespace std;
typedef struct {
int x;
int y;
} Point;
class CircularBuffer {
public:
// explicit CircularBuffer(int cap) // initialize vector with capacity
// : capacity... | true |
9ac728457ab0f49e97507aca5ae84a75cd6303e3 | C++ | sumsuddin/micro-service | /source/request_handlers/request_handler.cpp | UTF-8 | 2,500 | 2.890625 | 3 | [
"MIT"
] | permissive |
#include "request_handler.h"
RequestHandler::RequestHandler(const std::string service_name, const std::string service_version) {
RequestHandler::service_name = service_name;
RequestHandler::service_version = service_version;
}
void RequestHandler::handle_get_request(http_request &message) {
auto path = r... | true |
dcac9fdabf34fce66ce48b080563ff19b0ca8fec | C++ | Allowed/Protheus | /src/Core/Networking/CConnection.cpp | UTF-8 | 528 | 2.609375 | 3 | [] | no_license | #include "CConnection.h"
using namespace Pro;
using namespace Networking;
CBuffer CConnection::recv(){
const auto buffer = inputStack.front();
inputStack.pop();
return move(buffer);
}
void CConnection::send(CBuffer& _buffer){
// clones the buffer to be sent
CBuffer buf(_buffer);
mutex.lock();
outputStack.push... | true |
db41369fe806aef487b5218aa5e54bf94c951a3c | C++ | vadiraj89/CodingPratice | /Test/src/Scheduler.cpp | UTF-8 | 1,007 | 2.875 | 3 | [] | no_license | #include "Scheduler.h"
#include "Job.h"
#include <bits/stdc++.h>
using namespace std;
Scheduler::Scheduler(int t)
{
this->threads = t;
for(int i=0;i<t;i++){
queue<Job *> q ;
this->thread_queue.push_back(q);
}
}
Scheduler::~Scheduler()
{
//dtor
}
//virtual vector<pair<int,Job *>> Schedu... | true |
136e0817575a039a5ce1de382f9fa3d06f2e3d1a | C++ | sdimosik/spbspu-labs-2020-904-4 | /maksimova.anastasia/A3/main.cpp | UTF-8 | 1,980 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <stdexcept>
#include <string>
#include <memory>
#include "rectangle.hpp"
#include "circle.hpp"
#include "composite-shape.hpp"
int main()
{
try
{
maksimova::Rectangle rec(2, 3, {1, 1});
maksimova::Rectangle rec0(13, 53, {2, 3});
maksimova::Circle circ(3, {6, 6});
maksimo... | true |
d0cb722577b95fbdbe7b785f164732a70a8c043f | C++ | dingfen/SoftwareWordList | /Project1/GUI/src/WordGraph.cpp | UTF-8 | 3,999 | 3.25 | 3 | [] | no_license | #include "WordGraph.h"
#include <fstream>
#include <cctype>
#include <algorithm>
#include <cstdlib>
unordered_map<string, bool> parseLine(string line)
{
size_t pos;
string alpha("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
unordered_map<string, bool> ret;
pos = line.find_first_not_of(alpha... | true |
b4930062f0b67213866e6a2df5a516884f4a6dcd | C++ | blacksea3/leetcode | /cpp/leetcode/598. range-addition-ii.cpp | GB18030 | 350 | 2.953125 | 3 | [] | no_license | #include "public.h"
//4ms, 100%
//opsСa b ij˻
class Solution {
public:
int maxCount(int m, int n, vector<vector<int>>& ops) {
if (ops.empty()) return m * n;
int mina = INT_MAX;
int minb = INT_MAX;
for (auto& op : ops)
{
mina = min(mina, op[0]);
minb = min(minb, op[1]);
}
return mina * minb;
}
... | true |
ba990824b423f8f10853026e678d4584c56c056b | C++ | qiaohaijun/my-leetcode | /solution_pool/345-reverse-vowels-of-a-string/solution.cc | UTF-8 | 701 | 3.5 | 4 | [] | no_license | class Solution {
public:
bool isVowel(char s){
if(s=='a'|| s=='o'|| s=='e'|| s=='i'|| s=='u'){
return true;
}
if(s=='A'|| s=='O'|| s=='E'|| s=='I'|| s=='U'){
return true;
}
return false;
}
string reverseVowels(string s) {
if(s.size()<=1){
return ... | true |
3e2b09403432da8442c97e2ed8f6d5d0c5504aa1 | C++ | sajantanand/CSC112 | /Examples/structTest.cpp | UTF-8 | 1,076 | 4.125 | 4 | [] | no_license | //Testing passing of structs with pointers
#include <iostream>
using namespace std;
struct Test
{
int *ptr1;
int *ptr2;
//Test(int x, int y);
Test(int x, int y)
{
cout << "reached constructor" << endl;
ptr1 = new (nothrow) int(x);
ptr2 = new (nothrow) int(x);
cout << "creating struct with address " <<... | true |
ab52d516180c98ac0cec419ee7d970375d2eea40 | C++ | harshithkrpt/cpp | /cpp_prog_lang_book/6_types_and_declarations/6.2.3.1_signed_unsigned_chars.cpp | UTF-8 | 771 | 3.578125 | 4 | [] | no_license | #include<iostream>
using namespace std;
void f(char c,signed char sc,unsigned char uc){
/* char *pc = &uc; // error
signed char * psc = pc; // error
unsigned char *puc = pc; // error
psc = pus;
*/
}
// assigning too large values to signed values is undefined
void g(char c,signed char sc,unsigned char uc)
{
c =... | true |
da586afeb46b9eaf20e7338b6f34be183f9bcee4 | C++ | DopaminaInTheVein/ItLightens | /Engine/app_modules/gui/gui_utils.h | UTF-8 | 2,207 | 3.015625 | 3 | [] | no_license | #ifndef INC_MODULE_GUI_UTILS_H_
#define INC_MODULE_GUI_UTILS_H_
struct RectNormalized {
float x; float y;
float sx; float sy;
RectNormalized(float _x, float _y, float _sx, float _sy) :
x(_x), y(_y), sx(_sx), sy(_sy) {
assert(_x <= 1.f);
assert(_y <= 1.f);
assert(_sx <= 1.f);
assert(_sy <= 1.f);... | true |
14c168d06cf891719258c84976f14f42214a38ef | C++ | mtboswell/mtboswell-auvc2 | /src/sal/drivers/old/camera/v4l2libex.cpp | UTF-8 | 1,796 | 2.6875 | 3 | [] | no_license | #include "v4l2lib.cpp"
static void
usage (FILE * fp,
int argc,
char ** argv)
{
fprintf (fp,
"Usage: %s [options]\n\n"
"Options:\n"
"-d | --device name Video device name [/dev/video]\n"
"-h | --help Print this messa... | true |
3e25a0f8b0406671643097277e1dc3cca36fc55a | C++ | kidrigger/N-Body-Simulator | /quad.hpp | UTF-8 | 1,001 | 2.734375 | 3 | [] | no_license | //
// quad.hpp
// nbody_bh
//
// Created by Anish Bhobe on 6/29/17.
// Copyright © 2017 Anish Bhobe. All rights reserved.
//
#ifndef quad_h
#define quad_h
#include "Eigen/Core"
using Eigen::Vector3d;
namespace Celestial {
class Quad {
public:
// Center of the quad
Vector3d center;
... | true |
b0404bab5bbe3cf26a88ba5bc7c045522dabcdab | C++ | Lazer7/Platform-Game | /src/Map.cpp | UTF-8 | 1,512 | 3.0625 | 3 | [] | no_license | #include "Map.h"
#include <iostream>
using namespace std;
/**
Map deconstructor
*/
Map::~Map(){
//dtor
SDL_DestroyTexture(this->spriteSheetTexture);
spriteSheetTexture=NULL;
}
/**
Initalizes the map with image
*/
void Map:: init(const char* spriteMap){
setTexture(spriteMap);
}
/**
Sets Map i... | true |
ba139ba26abfffed9685cf1424b6602ffb2f207a | C++ | dogePrince/oj | /poj/4145/4145.cpp | UTF-8 | 1,020 | 2.53125 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<algorithm>
using namespace std;
int n, k;
int R[1000], C[1000];
double Y[1000];
int check(double v) {
for (int i = 0; i < n; i++) {
Y[i] = R[i] - v * C[i];
}
double sum = 0;
sort(Y, Y + n);
for (int i = k; i < n; i++) {
sum += Y[i];
... | true |
6428c42f43fea3832fa24b983815a7b9f9d32384 | C++ | 543877815/algorithm | /leetcode周赛/6180. Smallest Even Multiple.cpp | UTF-8 | 264 | 2.953125 | 3 | [] | no_license | class Solution {
public:
int gcb(int a, int b)
{
int c = 0;
while(c = a % b)
{
a = b;
b = c;
}
return b;
}
int smallestEvenMultiple(int n) {
return n * 2 / gcb(n, 2);
}
}; | true |
a2ec4ccb0adb906b247629956442f796304548d7 | C++ | XuZhichao1998/SegmentTree-kuangbin | /POJ_2528_poster/poj2528_min.cpp | UTF-8 | 6,049 | 3.375 | 3 | [] | no_license | /*
POJ 2528
Authon: XuZhichao
2021.2.8 18.29
*/
// 线段树维护区间最小值。
// 我们规定原来不贴海报的颜色为0,第i张海报的颜色为i(1<=i<=n)
// 我们将询问离散化。原来不相邻的点离散化后也至少要隔开一个单元(差值>=2),因为这样可以保证不会把原来下放露出的海报完全遮挡
// 如果倒序处理海报。那么在贴每张海报的时候,关心的问题仅仅是当前区间还有没有空白的单元。如果有空白的单元,表示是后面海报没有遮挡的单元。我们直
// 接查询区级最小值,如果最小值M为0,则说明还有空白的地方。
// 查询之后如果M为0,我们答案就+1 然后我们进行更新。把这张海报覆盖的范围全部涂色... | true |
37052f3ebff3148fb531debb3f051bc433f6b69a | C++ | adityadev31/OOPS_cpp | /oops/8_static_data_members/2.cpp | UTF-8 | 622 | 3.59375 | 4 | [] | no_license | #include<iostream>
using namespace std;
class Shopkeeping{
private:
static int sno;
int *array, size;
public:
void incSerial(){ ++sno; }
void add_items(int a){
size = a;
array = new int[size];
for(int i=0; i<size; i++){
cout<<"Enter item-"<<i+1<<"\t";
cin>>array[i];
i... | true |
4daa59037e7c57c60d259eef348940606d9fb163 | C++ | abhinaba-fbr/CP_utilities | /Heap/MinHeap.hpp | UTF-8 | 2,720 | 3.90625 | 4 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
/* create a MinHeap -
MinHeap mh; O(1)
MinHeap mh(vector<int>); O(n)
MinHeap mh=vector<int>; O(n)
mh.createheapFromVector(vector<int>); // use this only if not initialized O(n)
inserting elements
mh.insert(int); O(l... | true |
e9fdfe0e7f01e0aa86cb50cb4aba70e17069addd | C++ | d-pettersson/Raytracer | /apps/silhouette/silhouette.cpp | UTF-8 | 1,346 | 2.546875 | 3 | [] | no_license | #include "include/canvas.h"
#include "include/ray.h"
#include "include/tuple.h"
#include "include/sphere.h"
#include "include/intersection.h"
double wallZ = 10;
double wallSize = 7.0;
int canvasPixels = 100;
double pixelSize = wallSize / canvasPixels;
double half = wallSize / 2;
int main() {
auto rayOrigin = ray... | true |
b934a33f9d8e459ad8d43160d0bf3a3aaec2057b | C++ | Jobbobeun/DZ_METER | /DZ_METER.ino | UTF-8 | 3,566 | 3.09375 | 3 | [] | no_license |
// I/O positions
#define switch_1 2
#define switch_2 3
#define switch_3 4
#define motor_pin_1 7
#define motor_pin_2 8
#define motor_speed_pin 6
#define switch_trigger 5
#define flashing_light 9
// default values
#define homing_speed 255
#define motor_speed_1 255
#define flashing_light_time 300000
// global variabels... | true |
ebbe261f841b0a462f13cdddf16d0b97a1a8c9fb | C++ | amitpingale92/PG-DAC-C-Plus-Plus | /13.TemplateLibrary/StandardTemplateLibrary/2.Adapters/priorityqueuetest.cpp | UTF-8 | 525 | 2.765625 | 3 | [
"MIT"
] | permissive | #include "interval.h"
#include <iostream>
#include <queue>
#include <vector>
#include <functional>
#include <utility>
using namespace std;
using rel_ops::operator>;
int main(void)
{
priority_queue<Interval> store;
//priority_queue<Interval, vector<Interval>, greater<Interval> > store;
store.push(Interval(7, 41));
... | true |
674cdde380a3d87a5a5ed079d41a146c55ef5bef | C++ | zhiwuba/LocalSearch | /src/search_http_server.cpp | GB18030 | 4,418 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "search_http_server.h"
#include "search_query.h"
char dec_to_char(int n)
{
if ( 0<=n&&n<=9 )
{
return char('0'+n);
}
else if ( 10<=n&&n<=15 )
{
return char('A'+n-10);
}
else
{
return char(0);
}
}
std::string url_encode(std::strin... | true |
4ff39be652b326f4da7025c4499bf3a5aa4a9d27 | C++ | SimplyCrash/A3_Derek_Tran | /Lab11/Lab11/MonsterFactory.cpp | UTF-8 | 879 | 3.140625 | 3 | [] | no_license | /**************************************************
Project: RPG Monsters 2.0
Lab Num: Week 11
Author: Cheryl Howard / Matt Butler
Purpose: MONSTER FACTORY Class file
**************************************************/
#include "MonsterFactory.h"
MonsterFactory* MonsterFactory::instance = nullptr;
MonsterFactor... | true |
dd4f2373b5b79a7a2f2727363cc9834e2eeef7e7 | C++ | stefanofiorentino/nothrow_calls_terminate | /main.cpp | UTF-8 | 284 | 3.296875 | 3 | [] | no_license | #include <iostream>
inline void throw_despite_noexcept_declaration() noexcept
{
throw std::exception{};
}
int main()
{
std::cout << "Hello, World!" << std::endl;
throw_despite_noexcept_declaration();
std::cout << "You'll Never be here!" << std::endl;
return 0;
} | true |
17ce77cca8f0eb9ae1670f62c0c8bfb925536d3b | C++ | HenryLinUCSB/cs16 | /lab08/headers.h | UTF-8 | 819 | 3.4375 | 3 | [] | no_license | #include <iostream>
using namespace std;
class AString {
// You will need to declare:
// 1. 2 constructors (see lab description for details)
// 2. Three (3) member functions (see lab description for details)
// called getAString, cleanUp, countLetters
// one of which is a accessor function, and 2 a... | true |
38b4a53fb0ef7fa9eb1bf7e98ff4f402363befc2 | C++ | m0vehyeon/Code-Up-Algorithm | /[기초-종합] 언제까지 더해야할까.cpp | UTF-8 | 199 | 2.515625 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int a;
int sum = 0;
int cnt=0;
scanf("%d", &a);
while (sum < a)
{
cnt ++;
sum = sum + cnt;
}
printf("%d\n", cnt);
return 0;
}
| true |
29a2322c0ddc753bf5b19ba72b2521f1fe9c9693 | C++ | AlissonJ/Roteiro-05 | /Data.cpp | UTF-8 | 934 | 3.59375 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Data{
private:
int dia;
int mes;
int ano;
public:
void setDia(int d){ //Dia
dia = d;
}
int getDia(){
return dia;
}
void setMes(int m){ //Mes
mes = m;
}
int getMes(){
return mes;
}
voi... | true |
67a769bb2dc62ab11dcdd8ce4b24d08cb41b0a76 | C++ | Kitware/vtk-examples | /src/Cxx/Visualization/CreateColorSeriesDemo.cxx | UTF-8 | 20,650 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | #include <vtkActor.h>
#include <vtkCellData.h>
#include <vtkColorSeries.h>
#include <vtkFloatArray.h>
#include <vtkLookupTable.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkPlaneSource.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInte... | true |
c2f94d0dc56275b80b470c2cf6e22b41573a2bc2 | C++ | avast/retdec | /src/bin2llvmir/optimizations/decoder/bbs.cpp | UTF-8 | 3,738 | 2.953125 | 3 | [
"MIT",
"Zlib",
"JSON",
"LicenseRef-scancode-unknown-license-reference",
"MPL-2.0",
"BSD-3-Clause",
"GPL-2.0-only",
"NCSA",
"WTFPL",
"BSL-1.0",
"LicenseRef-scancode-proprietary-license",
"Apache-2.0"
] | permissive | /**
* @file src/bin2llvmir/optimizations/decoder/bbs.cpp
* @brief Decode input binary into LLVM IR.
* @copyright (c) 2017 Avast Software, licensed under the MIT license
*/
#include "retdec/bin2llvmir/optimizations/decoder/decoder.h"
using namespace retdec::common;
namespace retdec {
namespace bin2llvmir {
/**
* \r... | true |
4c19eb042f8ed21c04e1c705f4d4d3c05f153233 | C++ | yscriuf/Certificate | /구구단1/구구단1/소스.cpp | UHC | 580 | 2.953125 | 3 | [] | no_license | #include <stdio.h>
int main(void)
{
int test_case;
int T;
setbuf(stdout, NULL);
scanf("%d", &T);
int arr[100];
for (int i = 0; i < 100; i++) { arr[i] = 0; }
for (int i = 1; i <= 9; i++)
{
for (int j = 1; j <= 9; j++)
arr[i * j] = 1;
}
for (test_case = 1; te... | true |
b2b6b5919ff8831fec70db0274881dcf36a016c6 | C++ | caihj/c11 | /main.cpp | UTF-8 | 353 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
map<string,string> a = {{"key1","value"}, {"key2","value2"}};
a.insert({{"a","b"},{"f","g"}});
a["c"]="d";
a["42343"]="43242";
for(auto k : a) {
cout << k.first << ":" << k.second... | true |
f4df55a915d129a02d42c4bee44e59bd8e52fabe | C++ | coreydlucas/CIT242-Work | /Project 7/MemoryAddress3/MemoryAddress3.cpp | UTF-8 | 604 | 3.609375 | 4 | [] | no_license | //You Do It MemoryAddress3 pg.209~
#include<iostream>
using namespace std;
int main()
{
int firstNum, secondNum;
const int SIZE = 6;
int nums[SIZE] = { 12, 23, 34, 45, 56, 67 };
int x;
cout << "Enter first number ";
cin >> firstNum;
cout << "Enter second number ";
cin >> secondNum;
cout << "The numbers are ... | true |
6ecbb210821c4ddc388652c245294522a20a481d | C++ | ajfabian/3N1M4-Team-Reference | /code/geometry/vantage.cpp | UTF-8 | 3,412 | 3.125 | 3 | [] | no_license | /* Vantage-PointTree
- Arbol metrico para encontrar los puntos mas ceranos a uno dado.
- El ejemplo usa distancia euclidiana, pero (en teoria) funciona con
todas las metricas.
- Tiempo Esperado: Build: O(n lg n). Query: O(lg n).
*/
typedef double type;
struct pt{
type x, y;
bool operator < (const ... | true |
6b63f7ae305ada3c507a2a76cdbb3d683140efb7 | C++ | razvanalex/City-Procedural-Generation | /Source/Laboratoare/Homework3/Camera.cpp | UTF-8 | 2,807 | 3.0625 | 3 | [
"MIT"
] | permissive | #include "Camera.h"
Camera::Camera()
{
position = glm::vec3(0, 2, 5);
forward = glm::vec3(0, 0, -1);
up = glm::vec3(0, 1, 0);
right = glm::vec3(1, 0, 0);
distanceToTarget = 2;
}
Camera::Camera(const glm::vec3 &position, const glm::vec3 ¢er, const glm::vec3 &up)
{
distanceToTarget = 1;
Set(position, cente... | true |
26b799edeca839b504ebb8162c2255fba3d33a08 | C++ | foxness/simple-starcraft | /SimpleStarcraft/entitybase.h | UTF-8 | 387 | 2.78125 | 3 | [] | no_license | #pragma once
#include "vector.h"
#include "gameobject.h"
class EntityBase : public GameObject
{
protected:
Vector position;
EntityBase(const Vector& position_);
public:
const Vector& getPosition() const;
int getId() const;
bool operator==(const EntityBase& other) const;
bool operator!=(const Enti... | true |
3abad0dd64b1e668750748397c077b2ffcb35528 | C++ | WhiZTiM/coliru | /Archive2/81/dbc4be3ee778d5/main.cpp | UTF-8 | 193 | 2.59375 | 3 | [] | no_license | #include <atomic>
std::atomic<int> bar;
template <typename T>
T Dummy(const std::atomic<T>& val) { return T(); }
auto foo() -> decltype(Dummy(bar))
{
return bar++;
}
int main()
{
} | true |
521360a8771c1804ff28414c33563e3b1b68d61b | C++ | FahJulian/Sonic | /Sonic/src/Sonic/Scene/ECS/ComponentRegistry.cpp | UTF-8 | 2,521 | 2.640625 | 3 | [] | no_license | #include "ComponentRegistry.h"
using namespace Sonic;
Entity ComponentRegistry::AddEntity()
{
return m_NextEntity++;
}
Entity ComponentRegistry::AddEntity(EntityGroup group)
{
Entity entity = m_NextEntity++;
m_EntityGroups[group].push_back(entity);
return entity;
}
EntityGroup ComponentRegistry::AddEntityGroup... | true |
9b27d8f7bd8f287a64f96ee828db80e8f2392734 | C++ | DatTestBench/Benchine | /Benchine/BenchineCore/Components/ScoreComponent.h | UTF-8 | 442 | 2.640625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Components/BaseComponent.h"
class ScoreComponent final : public BaseComponent
{
public:
ScoreComponent();
virtual ~ScoreComponent() override = default;
DEL_ROF(ScoreComponent)
[[nodiscard]] constexpr auto GetScore() const noexcept-> uint32_t { return m_Score; }
void AddScore... | true |
911fce726b8286e4835c07860b57887d55781802 | C++ | KaufmanLabJILA/Chimera-Control-Master | /Chimera/NiawgWaiter.cpp | UTF-8 | 3,490 | 2.8125 | 3 | [] | no_license | #pragma once
#include "stdafx.h"
#include "NiawgWaiter.h"
/*
* This function is called to wait on the NIAWG until it finishes. It will eventually send messages to other threads
* to indicate when it finishes. If the niawg finishes before programming does, it starts outputting the default
* waveform in order... | true |
89edb133525e15b13ade716bba866ffe17075fb0 | C++ | ubc333/library | /include/cpen333/process/impl/semaphore_guard.h | UTF-8 | 1,226 | 3.375 | 3 | [
"MIT"
] | permissive | /**
* @file
* @brief Semaphore guard, similar to std::lock_guard
*/
#ifndef CPEN333_PROCESS_SEMAPHORE_GUARD_H
#define CPEN333_PROCESS_SEMAPHORE_GUARD_H
namespace cpen333 {
namespace process {
/**
* @brief Semaphore guard, similar to std::lock_guard
*
* Protects a semaphore's wait/notify using RAII ... | true |
e72978d4087b23251244474d4d6be2096216d604 | C++ | MarcoGrimaldo/DSD | /Practica7/c-string.cpp | UTF-8 | 1,392 | 3.25 | 3 | [] | no_license | #include <time.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
char* stringAleatorio() {
char letras[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
static char string[3];
for(int i = 0; i < 3; i++) {
int rand_l = rand() % 25;
string[i] = letras[rand_l];
}
string[3] = ' ';
static char prueba[] = "IPN ";... | true |
ce1f1d9f16cd8b2990950673add3201ebbc69bf9 | C++ | TColon830/OrderFinder | /main.cpp | UTF-8 | 2,375 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>
//TColon
//Short program to find the order of an element
using namespace std;
int modulo(int a,int b,int n){
long long x=1,y=a;
while(b > 0){
if(b%2 == 1){
x=(x*y)%n;
}
y = (y... | true |
9cddf6b36528e2b680c273e1401279c736e38159 | C++ | CyroPCJr/OmegaEngine | /Framework/AI/Inc/ArriveBehaviour.h | UTF-8 | 511 | 2.578125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "SteeringBehavior.h"
namespace Omega::AI
{
class ArriveBehaviour :public SteeringBehavior
{
public:
virtual ~ArriveBehaviour() = default;
Omega::Math::Vector2 Calculate(AI::Agent& agent) override;
Omega::Math::Vector2 Arrive(const AI::Agent& agent, const Omega::Math::Vector... | true |
9f771db46bdcb0ac9a3d1eca0eb3d5d0be5eb6f0 | C++ | harmboschloo/CocaProject | /cocaUtils/source/LogStringComponent.cpp | UTF-8 | 882 | 2.546875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | #include "LogStringComponent.h"
#include <coca/INode.h>
#include <coca/attributes.h>
LogStringComponent::LogStringComponent()
{
}
LogStringComponent::~LogStringComponent()
{
}
bool LogStringComponent::init( coca::INode& node )
{
node.addAttribute( "prefix", coca::createInputOutputAttribute<std::string>(
... | true |
c8539a22a995a4559d8f8387750d840656a876c5 | C++ | robmcrosby/FelixEngine | /FelixEngine/FelixEngine/Systems/Events/EventListenerSet.h | UTF-8 | 1,516 | 2.75 | 3 | [] | no_license | //
// EventListenerSet.h
// FelixEngine
//
// Created by Robert Crosby on 9/12/17.
// Copyright © 2017 Robert Crosby. All rights reserved.
//
#ifndef EventListenerSet_h
#define EventListenerSet_h
#include "Event.h"
namespace fx {
/** Contains and manages Event Listeners */
class EventListenerSet {
priva... | true |
f04b14ee9eebfbd27cfea06c0889e7f8e40e0e4b | C++ | pankaj799/cpp_bucket | /pointClass.cpp | UTF-8 | 505 | 3.484375 | 3 | [] | no_license | #include<iostream>
using namespace std;
class pInClass{
int a;
int *p;
public:
void get(){
cout<<"Enter number \n";
cin>>a;
}
void put(){
cout<<a<<endl;
}
};
class pClass{
public:
int a;
};
int main()
{
class pInClass ob,*p;
cout<<"Pointer To Class :"<<endl;
p=&ob;
ob.get();
p->pu... | true |
e8f3017cde091115fdabc875a075cc6c5740baf6 | C++ | sravankumarpothuraju/A-star | /Astarsearch.hpp | UTF-8 | 614 | 2.9375 | 3 | [] | no_license | //AStar Search.hpp
#pragma once
#include <ctime>
class AStar
{
public:
int a[3][3] = { 0 };
int goal[3][3] = { 0 };
int i, j; //counters
//cost so far, heuristic cost and total cost (f = g + h)
int g, h, f = 0;
AStar *parent;
AStar() {} //Constructor
~AStar() {} //Destructo... | true |
f2583790a91b082cdc5076272ce8ccf69eeeebdf | C++ | Symphonym/Brainless | /Brainless/Brainless/EditorGridMode.cpp | UTF-8 | 11,666 | 2.609375 | 3 | [] | no_license | #include "EditorGridMode.h"
#include "Constants.h"
#include "Utility.h"
#include "Renderer.h"
#include "ResourceLoader.h"
#include "Constants.h"
#include <fstream>
#include <sstream>
#include <iostream>
EditorGridMode::EditorGridMode(TileMap &tilemap)
:
m_tilemap(tilemap),
m_autotilingEnabled(false),
m_currentTile(sf... | true |
50ff75901fc926fea0b8c1131e73278fb4460f7f | C++ | Hopson97/City-Game | /Editor/Source/App.h | UTF-8 | 1,375 | 2.65625 | 3 | [] | no_license | #ifndef APP_H
#define APP_H
#include <SFML/Graphics.hpp>
#include <vector>
#include "Mouse.h"
enum class Mode
{
Water,
Collision,
Ground
};
enum class State
{
None,
Rectangle
};
class App
{
public:
App ( const std::string& texturePath );
void run();
private:
... | true |
2a688d48dfc5e5cc25b66379a9e1a5e9532bbae7 | C++ | mbfilho/icpc | /Questoes UVA ACM/408 - Uniform Generator.cpp | UTF-8 | 393 | 3.140625 | 3 | [] | no_license | #include <cstdio>
int gcd( int a, int b ){
int mod;
while( b ){
mod = a % b;
a = b;
b = mod;
}
return a;
}
int main(){
int step, mod;
while( scanf( "%d %d", &step, &mod ) != EOF ){
if( gcd( step, mod ) == 1 ){
printf( "%10d%10d Good Choice\n", step, mod );
}else
pri... | true |
91f10b12897e72d98364df6b9b922f53b76dbe5c | C++ | VISWESWARAN1998/Academia | /Zoho Interview Questions/Real Interview Questions Conducted on 01.12.2018/VISWESWARAN_CSE/question_four.cpp | UTF-8 | 1,953 | 3.859375 | 4 | [] | no_license | // SWAMI KARUPPASWAMI THUNNAI
#include<iostream>
#include<string>
#include<set>
#include<map>
class sorter
{
private:
std::multiset<int> sorted_elements;
std::map<int, unsigned int> sorted_elements_with_count;
public:
void add(int element);
void add_counts();
void display();
};
void sorter::add(int element)
{
... | true |
7f2f202cc5531ac799c2a79beba1c22ecc8c072c | C++ | radii-dev/ps_study | /BaekJoon/KOI/KOI2018/Drawarrow/Drawarrow.cpp | UTF-8 | 1,662 | 3.34375 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
using namespace std;
struct dot {
int location;
int color;
};
int makeArrow(vector<int>* dots, int targetLocation) {
if (dots->at(targetLocation) == -1)
return 0;
else {
int len = 0;
int tmploc[2] = { targetLocation - len, targetLocation + len };
bool findArrow = fal... | true |
723fe2c0b0df721df8178d9e95779ac910828376 | C++ | tliu526/ireg_CA | /Graph.tpp | UTF-8 | 3,149 | 3.546875 | 4 | [] | no_license | /*
Implementing the adjacency list graph.
(c) 2015 Tony Liu.
*/
#include <iostream>
using namespace std;
template<class T, class D>
T Graph<T,D>::add_vertex(T label, D data) {
if(dict.count(label) == 0) { //we need to add the vertex to the graph
Vertex v(label, data);
dict[label] = v;
}
return label;... | true |
48fa4a9c28ef06c36ca851e1f7af4e800f6e9e2e | C++ | jencmart/bi-aps | /Verilog/aps/assemblyHexCompiler/main.cpp | UTF-8 | 11,029 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <map>
#include <bitset>
using namespace std;
class UnknownOperand
{
string m_op;
public:
explicit UnknownOperand( string & op) : m_op(op) {}
friend ostream &operator<<(ostream &os, const UnknownOperand &operand) {
... | true |
2adc2a569b6c22a26b18f8ca54d9b0181a3af630 | C++ | MinByeongChan/myMBC | /Codingtest/Baekjoon/1699_AddOfExponentiation.cpp | UTF-8 | 620 | 3.25 | 3 | [] | no_license | #include <iostream>
#define MAX 100001
using namespace std;
//sdad제곱 함수
int EXPO(int a){
return a*a;
}
//최솟값 함수
int MIN(int a, int b){
return a>b ? b : a;
}
int dp[MAX];
// 동전 2문제와 동일하게 접근
int main(int argc, char** argv) {
//변수 선언
int N; // 어떤 자연수
//INPUT
cin >> N;
if(N < 1) return -1;
dp[0] = 0;
... | true |
e2dc2c267faa5f53d8b24717bd3b428e45285481 | C++ | Junber/LD-38 | /Enemy_types.cpp | UTF-8 | 2,218 | 2.90625 | 3 | [] | no_license | // stage 1
{
Enemy_type* e = new Enemy_type;
e->arms=0;
e->blood_per_arm=0;
e->strenght_per_arm=3;
e->blood=5;
e->tex="Armless Degenerate";
e->number = 3;
e->min_radius = 1;
e->max_radius = 10;
e->arm_name = "";
e->explosion_radius = 7;
enemy_types.push_back(e);
sta... | true |
5deed633949ae31348379e1bfbf790a58520433f | C++ | rajpratyush/Hacktober-CP-contributions | /SPOJ_LIST/Range_Sum.cpp | UTF-8 | 919 | 2.6875 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
#define ll long long
ll bit[1000005]={0};
ll n;
//writing code for moving in backward dir^ storing in reverse order
void update(ll i, ll val){
while(i>0){
bit[i]+=val;
i=i-(i&(-i));//from i to 0 index where sum will get added
}
}
//calculates sum f... | true |
266c53ba50a195e44df96a68d5af9908c407eebe | C++ | Sevzera/aeds1-cefet | /jogoDasCaixas.cpp | UTF-8 | 3,669 | 3.234375 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <string.h>
#include <fstream>
using namespace std;
int main()
{
// Le o nome do arquivo
string nome;
cout << "Digite o nome do arquivo de entrada: ";
cin >> nome;
// Abre o arquivo e atribui todo seu conteudo a... | true |
b288562208086e71d0c8d899b9edde97115ef37a | C++ | bjornpostema/fluid-survival-tool | /src/model/GeometryHelper.cpp | UTF-8 | 10,605 | 2.75 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* GeometryHelper.cpp
*
* Created on: Mar 6, 2013
* Author: hamed
*/
#include "GeometryHelper.h"
namespace model {
Polygon* GeometryHelper::reform(Polygon* poly, Interval interval) {
return NULL;
}
RegionState GeometryHelper::getTimeAndDirection(DtrmEvent* dtrmRegion,Formula* formula, double& t, Direc... | true |
5730dd46c28c1d65a1a8b21492c7e8efc6210fe2 | C++ | MughalUsama/Data-Structures-and-Algorithms | /Lab 4/Project2/Project2/main.cpp | UTF-8 | 1,227 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include "myStack.h"
#include "myStack.cpp"
Stack<int> sort(const Stack<int>& s)
{
Stack<int> newStack;
int * tempData = new int[s.getNoOfElements()];
newStack = s;
for (int i = 0; i < s.getNoOfElements(); i++)
{
tempData[i] = newStack.top();
newStack.pop();
}
for (int i = 0; i < s.get... | true |
0d681e4b1ba1306e9d860427ad2df4a08e884300 | C++ | jrouwe/JoltPhysics | /Jolt/Geometry/Ellipse.h | UTF-8 | 2,569 | 3.15625 | 3 | [
"MIT"
] | permissive | // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
// SPDX-License-Identifier: MIT
#pragma once
#include <Jolt/Math/Float2.h>
JPH_NAMESPACE_BEGIN
/// Ellipse centered around the origin
/// @see https://en.wikipedia.org/wiki/Ellipse
class Ellipse
{
public:
J... | true |
8542c9805ca7fc4beecdc6a6219ce40a65f9f6f3 | C++ | ghulamghousdev/Data-Structures-CPP | /cQueue/cQueue/cStack.cpp | UTF-8 | 2,397 | 4.125 | 4 | [] | no_license | /*
Implementation file for cStack class
*/
#include "cStack.h"
#include <iostream>
using namespace std;
/*
Default constructor of STACK class to make top data member of STACK class NULL
*/
cStack::cStack() :top(NULL) {}
/*
Parameterized Constructor
*/
cStack::cStack(cNode *&ptr) : top(ptr) {
top->nextNode = NULL;
... | true |
56a3ef838fde10ce728f664448e9659ab8245640 | C++ | Ric-27/TETRIC | /logic.cpp | UTF-8 | 9,733 | 2.546875 | 3 | [] | no_license | #include "logic.hpp"
#include <iostream>
Logic::Logic(int argX, int argY){
coorZero.setX(argX/2 - 1);
coorZero.setY(amount_of_pixels - 1);
colorMatrix.resize(argX * argY);
logicMatrix.resize(argX * argY);
nextMatrix.resize(6*4);
logicX = argX;
logicY = argY;
score = 0;
level ... | true |
44453872d1d04f92538f4330599ffe3c308e391c | C++ | mochammadfawwaz/Program-Kreativitas-Mahasiswa | /0.3_-_Sensor_PH/0.3_-_Sensor_PH.ino | UTF-8 | 712 | 2.515625 | 3 | [] | no_license | const int ph_Pin = A0;
float Po = 0;
float pH_step;
int nilai_analog_PH;
double TeganganPH;
// kalibrasi
float PH4 = 0.85;
float PH7 = 1.78;
float PH9 = 2.67;
void setup() {
// put your setup code here, to run once:
pinMode(ph_Pin, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to ru... | true |
ec00ced64e6d9ebfee27a1832964fb80c50f324e | C++ | aoibird/pc | /cpc/exercise3-5_droppingtests.cpp | UTF-8 | 979 | 2.53125 | 3 | [
"MIT"
] | permissive | // POJ 2976
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const double ERR = 0.00001;
const int MAXN = 1000+10;
PII T[MAXN];
double S[MAXN];
int N, K;
bool can(do... | true |
aa3a308b16abafc25a095ca512fe17314a0b721a | C++ | aureus5/CPPproject | /AirplaneSensorCPPproject/Signal.h | UTF-8 | 383 | 2.890625 | 3 | [] | no_license | #ifndef PROJECT2_SIGNAL_H
#define PROJECT2_SIGNAL_H
#include "Time.h"
namespace Project2
{
class Signal
{
public:
Signal(double valueOffset, Time &timeOffset);
virtual double getVoltageAtTime(Time &t) const=0;
protected:
double getVoltageOffset() const;
Time getTimeOffset() const;
private:... | true |
37641abe1787e1d3403a83112a5b462eb508c637 | C++ | irina-suslova/Lab_3 | /Lab_3/complex.h | UTF-8 | 2,756 | 3.515625 | 4 | [] | no_license | #ifndef COMPLEX_H
#define COMPLEX_H
#include<iostream>
#include<cmath>
class Complex {
private:
double Re;
double Im;
public:
Complex(double Re = 0.0, double Im = 0.0) {
this->Re = Re;
this->Im = Im;
}
Complex(const Complex& z) {
this->Re = z.Re;
this->Im = z.Im;
... | true |
8d1811d47076a229e0edc279178e4ed806899d1b | C++ | yosoufe/CarND-PID-Control-Project | /src/PID.cpp | UTF-8 | 1,932 | 2.609375 | 3 | [
"MIT"
] | permissive | #include "PID.h"
using namespace std;
/*
* TODO: Complete the PID class.
*/
PID::PID() {
#ifdef WITH_GNUPLOT
error_file = std::fopen("error","w");
std::fclose(error_file);
control_terms_file = std::fopen("control_terms","w");
std::fclose(control_terms_file);
gp_ = popen("gnuplot -persist" , "w");
#endif
}
PI... | true |
9f5d48da23c166382fc40507ca6597b6c1071c89 | C++ | EmonZaman/UVA | /465 - Overflow.cpp | UTF-8 | 579 | 2.578125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
double a,b;
char c;
while(1)
{
char s[2000000];
gets(s);
puts(s);
sscanf(s,"%lf %c %lf", &a, &c, &b);
// cout<<a<<" "<<c<<" "<<b<<endl;
if(a>2147483647)
pu... | true |
b987377eeec00fb5a150fb54030669bafc16c507 | C++ | savannadodson/3013-Algorithms-Dodson | /Assignments/P02/main.cpp | UTF-8 | 10,053 | 3.296875 | 3 | [] | no_license | /*****************************************************************************
*
* GOT HELP FROM A TUTOR
*
* Author: Savanna Dodson
* Email: smdodson1105@my.msutexas.edu
* Label: P02
* Title: Processing in Linear Time
* Course: 3013 algorithims
* Semester: Spring 2021... | true |
9f9305849a05d57898491455833266caba333d5f | C++ | EthanCYQ/OJ | /hdu2141.cpp | GB18030 | 1,452 | 2.96875 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int a[505], b[505], c[505];
int value[505*505];
int l, m, n, s, index;
int cnt=0;
bool c_binary_search(int v)
{
int l=0, r=index-1;
while(l <= r)
{
int m = (l+r)/2;
if(value[m]<v)
l = m + 1;
el... | true |
4e45800be15476c1d1a01b8a518ab5d675c75b67 | C++ | ljz/encryption_system | /me - 副本 (6)/RSAKeyPairDLG.cpp | GB18030 | 17,541 | 2.640625 | 3 | [] | no_license | // RSAKeyPairDLG.cpp : ʵļ
//
#include "stdafx.h"
#include "me.h"
#include "RSAKeyPairDLG.h"
// CRSAKeyPairDLG Ի
IMPLEMENT_DYNAMIC(CRSAKeyPairDLG, CDialog)
CRSAKeyPairDLG::CRSAKeyPairDLG(CWnd* pParent /*=NULL*/)
: CDialog(CRSAKeyPairDLG::IDD, pParent)
, m_strPublicKey(_T(""))
, m_strPrivateKey(_T(""))
{
//SKLEN... | true |
4b4858f94a841559824020c946b3704a5b063b68 | C++ | jiteshsingla1999/Competitive_code | /Backtracking/candle_distribution.cpp | UTF-8 | 719 | 2.953125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int func(int * arr, int n)
{
for(int m=0;m<n;m++)
{
int temp1 = arr[m];
int temp2 = arr[n-1];
int diff = temp2-temp1;
if(diff>temp1)
{
continue;
}
else
{
return temp1;
}
}
}
int main() {
// Write y... | true |
276c2e7d038abe5edc64cb2d789ff5931141c1f9 | C++ | joaopaulocastilho/aBNT-Codes | /URI/URI2547-NINJA.cpp | UTF-8 | 258 | 2.5625 | 3 | [] | no_license | #include <stdio.h>
int main(void){
int n, x, amin, amax, ans;
while(scanf("%d %d %d", &n, &amin, &amax) != EOF){
for(ans = 0; n; n--){
scanf("%d", &x);
if(x >= amin && x <= amax) ans++;
}
printf("%d\n", ans);
}
return 0;
}
| true |
4969e33e5e3f73eb216d001139924367b3ab9b42 | C++ | isberg1/Project-C_plusplus-IMT1082-group-35 | /STATISTIKK.H | UTF-8 | 652 | 2.5625 | 3 | [] | no_license | #if !defined(__STATISTIKK_H)
#define __STATISTIKK_H
#include"CONST.H"
#include"FUNKSJONER.H"
class Statisikk
{
protected:
int sistebrukt; // Teller.
char nasjonsForkort[MAXNASJONER + 1][NASJONLEN +1]; // Array med nasjonsforkortelser.
public:
Statisikk(); // Constructor, nullst... | true |
a4ec9acffefa3f1d6595d809f2d9c106e6a67ea5 | C++ | bowcharn/leetcode | /lt_022_generate_parentheses.cpp | UTF-8 | 2,577 | 4.03125 | 4 | [] | no_license | /*
Given n pairs of parentheses, write a function to generate all combinations of
well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()(())", "()()()"
注:函数parens利用了bit pattern , 简直好的不得了
A bit pattern like:
10101100
Can be intepreted as:
()()(())
The func... | true |
ab88928bfeabfa0373ee8cb40cdb8650fb69e60b | C++ | htiek/cs106b-lecture-demos | /Lecture 08/SierpinskiCarpet/SierpinskiCarpet.cpp | UTF-8 | 4,173 | 3.453125 | 3 | [] | no_license | /*
* File: SierpinskiCarpet.cpp
* ---------------
* A program that draws the Sierpinski Carpet fractal.
*/
#define COUNT_SQUARES
#include <iostream>
#include <string>
#include "gwindow.h"
#include "gobjects.h"
#include "gthread.h"
using namespace std;
/* Draws a square in the window, given the coordin... | true |
1b74ed08214c52a01769a718831d5f435beaa351 | C++ | sailesh2/CompetitiveCode | /2017/cf410D1.cpp | UTF-8 | 1,508 | 2.515625 | 3 | [] | no_license | #include<stdio.h>
#include<iostream>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
bool fun(int a,int b){
return a>b;
}
int main(){
int n;
cin>>n;
int arr[n],brr[n];
long long int sum[n],sa=0,sb=0;
map<long long int,vector<int> > mp;
map<long lo... | true |
dc0ab2f3ba1091dd033fc29e9698d1aace6a1723 | C++ | QtWorks/cosnetaViewer | /RoomManager/roommanager.cpp | UTF-8 | 2,753 | 2.734375 | 3 | [] | no_license | // Qt
#include <QDebug>
// Application
#include "roommanager.h"
#include "room.h"
// Constructor
RoomManager::RoomManager(QObject *parent) : QAbstractListModel(parent),
m_iCurrentRoomIndex(0)
{
// Add first room
for (int i=0; i<5; i++)
addRoom();
}
// Startup
bool RoomManager::startup()
{
ret... | true |
97b2503b314b05bc698840e3301b69f34bf1b8ef | C++ | zhangrongzhao/CPlusPlusTemplates | /src/C++.Templates/Part.4/Chapter.21/Tuple/Tuple.h | WINDOWS-1252 | 2,860 | 2.671875 | 3 | [] | no_license | #include "../stdafx.h"
#ifndef TUPLE_H
#define TUPLE_H
#include "../Traits/typeop.h"
#include "../Duo/Duo.h"
#include "../Duo/Duo2.h"
#include "../Duo/DuoValue.h"
class NullT{};
template<typename P1,
typename P2=NullT,
typename P3=NullT,
typename P4=NullT,
typename P5=NullT>
class Tuple:public Duo<P... | true |
13cd0853a79ba21a1c147218d72f5014a54e83c4 | C++ | sarguments/OOP_Shooting_Suomi | /shooting_Suomi/shooting_Suomi/Player.cpp | UHC | 960 | 2.71875 | 3 | [] | no_license | #include "stdafx.h"
#include "Base.h"
#include "Player.h"
#include "Scene.h"
#include "GameScene.h"
CPlayer::CPlayer(CGameScene* pScene)
{
_pGameScene = pScene;
// ÷̾ ʱȭ
_x = dfSCREEN_WIDTH / 2;
_y = dfSCREEN_HEIGHT - 5;
_type = eObjType::Player;
}
CPlayer::~CPlayer()
{
}
void CPlayer::Action()
{
KeyProcess(... | true |
ac23bf0bdad27d1f4f60c000e96b9148e4f6b8af | C++ | nneesshh/mytoolkit | /src_vc141/core/SimpleCalendar.cpp | UTF-8 | 3,510 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | //------------------------------------------------------------------------------
// SimpleCalendar.cpp
// (C) 2016 n.lee
//------------------------------------------------------------------------------
#include "SimpleCalendar.h"
//------------------------------------------------------------------------------
... | true |
c06be716c28d9b0a3b8b955330218022b4104310 | C++ | JimouChen/algorithm-competition-training | /course/CPPLearning/exp/exp3/task33.cpp | GB18030 | 770 | 3.921875 | 4 | [
"MIT"
] | permissive | # include <iostream>
using namespace std;
class Student {
private:
double score;
static double total;
static int count;
public:
void scoreTotal(double s);
static int person();
static double average();
};
double Student::total = 0;
int Student::count = 0;
void Student::scoreTotal(double s) {
... | true |
c56f78615e9b19cfc027f5f4d86feaa1607cf089 | C++ | PiasTanmoy/Codeforces | /codeforces 445B.cpp | UTF-8 | 821 | 2.65625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int n, m;
int mat[55][55];
unsigned long long int dan=1;
vector<int> G[55];
int visited[55];
int counter=0;
void input()
{
cin>>n>>m;
int x,y;
for(int i=0; i<m; i++){
cin>>x>>y;
mat[x][y]=1;
mat[y][x]=1;
G[x].pu... | true |
b12649e97a19c17744813118f03fd56de84bf596 | C++ | JJJVic/ps6 | /baxter_moves_library/include/baxter_moves_library/my_interesting_moves.h | UTF-8 | 1,156 | 2.59375 | 3 | [] | no_license | /* Copyright 2015 YQJ */
#ifndef MY_INTERESTING_MOVES_H
#define MY_INTERESTING_MOVES_H
#include <ros/ros.h>
#include <Eigen/Eigen>
#include <Eigen/Dense>
#include <Eigen/Geometry>
#include <Eigen/Eigenvalues>
typedef Eigen::Matrix<double, 7, 1> Vectorq7x1;
class InterestingMoves
{
public:
ros::NodeHandle nh... | true |
85ee7d4748051783d53c40c51dd8b6be187c91be | C++ | jeremy1357/Zombie-Onslaught | /SE_Game_Project/SoundDelegate.h | UTF-8 | 743 | 2.5625 | 3 | [] | no_license | #pragma once
#include <string>
#include <map>
#include <SDL/SDL_mixer.h>
#include <vector>
struct AudioFile {
AudioFile(const std::string& name, Mix_Chunk* audioData) {
this->name = name;
this->audioData = audioData;
}
std::string name;
Mix_Chunk* audioData;
int channel = -1;
};
class SoundDelegate
{
public:... | true |
749ae675cb86ce125059ef48f382a272c33795d3 | C++ | longlt2/GLESFrameWork | /NewTrainingFramework/Game/Physic/Circle.cpp | UTF-8 | 1,954 | 3.0625 | 3 | [] | no_license | #include "Circle.h"
#include "Physic.h"
#include "VideoDriver.h"
Circle::Circle() : Object()
{
m_radius = 0;
type = OBJECT_TYPE_CIRCLE;
}
Circle::Circle( int radius )
{
m_radius = radius;
type = OBJECT_TYPE_CIRCLE;
}
Circle::Circle( int x, int y, int radius ) : Object( x, y, 0 , glm::vec2( 0,0 ) )
{
... | true |
b29d20f1fdf802ec8986722ece4db87cc721533a | C++ | LewisBray/TetrisAI | /src/tetris.h | UTF-8 | 1,298 | 2.625 | 3 | [] | no_license | #ifndef TETRIS_H
#define TETRIS_H
#include "colour.h"
#include "maths.h"
#include "types.h"
namespace Tetris {
struct Tetrimino {
struct Blocks {
static constexpr i32 COUNT = 4;
Coordinates top_left_coordinates[COUNT];
};
enum Type { T = 0, L = 1, RL = 2, S = 3, Z = 4... | true |