uuid stringlengths 36 36 | repo_name stringlengths 5 133 | relative_path stringlengths 3 3.76k | content stringlengths 282 4.03M | category stringclasses 6
values | algo_rel_score float32 0.9 1 | quality_score float32 3 8.13 | source_meta dict |
|---|---|---|---|---|---|---|---|
7758fece-e6a3-488e-bfcb-3d172041d3dc | whitehatcat-JE/13DTCWork | Jayden_Everest_103.1-Practical/Task3/Task3/Task3.cpp | // Section A - Task 3 - <NAME>
// Includes
#include <iostream>
#include <string>
// Using declarations
using std::cout;
using std::cin;
using std::endl;
using std::string;
// Fills a given 3x3 integer matrix with user inputs
void fillMatrix(float matrix[3][3]) {
for (int row = 0; row < 3; row++) {
for (int... | ALGO | 0.987312 | 5.29902 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2021-02-10T22:48:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5bb66e5b61d... |
92048414-4cc0-458b-97f8-88b256c81565 | Pranto210102/Algorithm-Analysis- | mergesort.cpp | #include <iostream>
using namespace std;
void merge(int* arr, int* left, int* right, int left_size, int right_size) {
int i = 0, j = 0, k = 0;
while (i < left_size && j < right_size) {
if (left[i] <= right[j]) {
arr[k++] = left[i++];
} else {
arr[k++] = right[j++];
... | ALGO | 0.999995 | 5.757179 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-01-15T18:24:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96ea65651c9... |
9c946029-8059-463e-869b-81106d8d848d | Kyuhyun-Cho/data-structure-lab-hw-kmu | Hw7_Kruskal.cpp | /***********************************************************************************************************************
* Name: 조규현
* Student ID: 20191669
* Program: Hw#7
* Description: Kruskal 알고리즘을 활용하여 원하는 결과값을 출력한다.
* Algorithm: 1. 한번에 한 간선씩 최소비용 신장트리를 구축한다.
2. 최소비용 신장트리에 포함될 간선을 비용의 크기 순으로 선택한다.
... | ALGO | 0.999922 | 5.040993 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-01-13T12:09:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7aed2740ed... |
6052da73-6d36-45b0-bfb7-def3b95bfab5 | 1468362286/Algorithm | CodeForces/1154E/19629169_AC_265ms_7108kB.cpp | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <math.h>
#include <vector>
#include <utility>
using namespace std;
const int maxn = 200010;
const int inf = 0x3fffffff;
typedef _int64 ll;
int max(i... | ALGO | 0.999997 | 3.210847 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-06-09T06:05:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2edeeb37b... |
02e27e2c-7f63-4b1e-9443-fac0688f2c25 | niravnb/InterviewBit | 9. Backtracking/Combinations.cpp | /*
Given two integers n and k, return all possible combinations of k numbers out of 1 2 3 ... n.
Make sure the combinations are sorted.
To elaborate,
Within every entry, elements should be sorted. [1, 4] is a valid entry while [4, 1] is not.
Entries should be sorted within themselves.
Example :
If n = 4 and k = 2, a... | ALGO | 0.999992 | 6.710065 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-10-20T13:01:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "958da3f24a... |
fe4a0040-be94-4d1c-b895-19312b31e54a | UpsilonKoan/wireless-communication-simulation-with-Itpp | chpt6/prg6_9.cpp | #include <itpp/itcomm.h>
using namespace itpp;
using namespace std;
int main()
{
RNG_reset(12345);//随机数种子
const int no_symbols = 5; //符号个数
const double N0 = 0.05;//噪声功率谱密度
{
cout << endl << "4-PAM(real)" << endl;
PAM pam(4);
int bps = round_i(pam.bits_per_symbol());//每符号比特个数
bvec tx_bits = randb(... | ALGO | 0.990861 | 4.282298 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-11-15T02:44:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aeee0a65431e... |
92c01693-cef6-426b-af50-2276fba751e8 | RemiixSp/Algorithms- | Algo/Algo4Lab/mainwindow.cpp | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include "QElapsedTimer"
QString output;
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
double fRand(double fMin, double fMax)
{
double f = (do... | ALGO | 0.939544 | 4.956522 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-12-23T21:06:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cfb3dc417673... |
7c7c6c3f-8130-4680-9833-f370d48bf3f1 | Moongss/ps | Baekjoon/2636.cpp | #include <iostream>
#include <queue>
#include <cstring>
#define INSIDE_AIR 0
#define CHEESE 1
#define OUTSIDE_AIR 2
#define TO_CHANGE_AIR 3
int N, M;
int arr[102][102];
bool visit[102][102];
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
void printCheese() {
for (int i = 1; i <= N; i++) {
for (int j = 1... | ALGO | 0.999943 | 3.791311 | {
"github_metadata": {
"branch": "master",
"commit_count": 553,
"repo_created_at": "2023-09-05T09:21:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75471c6c... |
bf68b1c9-0924-45c1-9147-90758db440d1 | pawelsalawa/sqlitestudio | SQLiteStudio3/coreSQLiteStudio/common/utils.h | #ifndef UTILS_H
#define UTILS_H
#include "coreSQLiteStudio_global.h"
#include <functional>
#include <QList>
#include <QMutableListIterator>
#include <QSet>
#include <QChar>
#include <QStringList>
#include <QFileInfo>
#include <functional>
#include <QVariant>
#include <QDataStream>
class QStringConverter;
class QStrin... | TOOL | 0.929621 | 5.361494 | {
"github_metadata": {
"branch": "master",
"commit_count": 9933,
"repo_created_at": "2018-01-11T15:53:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6034,
"forks": 626,
"issues": 578,
"pull_requests": 1
},
"file_meta": {
"content_id": "... |
82e28601-af97-4dc1-9462-91d02326ee20 | kraused/maci-code | md/lammps/src/lammpsPairLJCutWeighted.hh |
// vi: tabstop=4:expandtab
// vi: tabstop=4
#ifndef MD_LAMMPS_SRC_LAMMPS_PAIR_LJ_CUT_WEIGHTED_HH_INCLUDED
#define MD_LAMMPS_SRC_LAMMPS_PAIR_LJ_CUT_WEIGHTED_HH_INCLUDED 1
#include "lammps.h"
#include "pair.h"
/// Forward declare NeighList
namespace LAMMPS_NS {
class NeighList;
}
namespace lammps {
/// Pa... | ALGO | 0.998157 | 6.262469 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2013-05-16T17:31:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c277c0f4... |
d4803e83-3e40-44bd-85b8-84051275088e | luckykelfor/RMMarkerDetection | include/GetDistanceOf2linesIn3D.h | #include <math.h>
//用于求解两条空间直线的最近距离,以及他们最近的两点坐标
//author @VShawn
//url:http://www.cnblogs.com/singlex/p/6091659.html
//ver:2016.11.22.0
class GetDistanceOf2linesIn3D
{
public:
//输入直线A的两个点,以便获得A的方程
void SetLineA(double A1x, double A1y, double A1z, double A2x, double A2y, double A2z)
{
a1_x = A1x;
a1_y = A1y;
a... | ALGO | 0.999598 | 4.767668 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-03-19T13:52:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2165c4c0bb... |
66e7924a-8a0c-4811-98ec-867e15c20294 | LiquanLuo/algorithms | chapter3_tree/maximumDepthofBinaryTree.cpp | /**
QUESTION:
104. Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the
longest path from the root node down to the farthest leaf node.
Note: A leaf is a node with no children.
Example:
Given binary tree [3,9,20,null,null,15,7],
3
/ \
... | ALGO | 0.999897 | 5.513652 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2019-12-13T06:22:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56598a387... |
66257f37-f79e-422a-8e15-ddec8b3295c1 | rohitjadon101/DSA-Practice | c++ Language/Queue/First_nonRepeatingElement_inString_Queue.cpp | #include<iostream>
#include<unordered_map>
#include<map>
#include<queue>
using namespace std;
//Class ke concept se solve kiya hai normally function banakar bhi kiya ja sakta hai
//Neeche bala question different hi question hai jisme repeated character ki jagah # print hoga
class solution{
public:
string Fnonre... | ALGO | 0.999893 | 3.919119 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-22T15:46:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a18a60d6b5f... |
7333852c-f3b6-4c17-8e77-3b86725d5c2c | repos-cl/NumCSE | Assignments/PolishedCodes/FunctionApproximation/LoopInterpolation/template/hermloceval.hpp | #pragma once
///////////////////////////////////////////////////////////////////////////
/// Demonstration code for lecture "Numerical Methods for CSE" @ ETH Zurich
/// (C) 2019 SAM, D-MATH
/// Author(s): <NAME>
/// Repository: https://gitlab.math.ethz.ch/NumCSE/NumCSE/
/// Do not remove this header.
/////////////////... | ALGO | 0.988773 | 6.367459 | {
"github_metadata": {
"branch": "master",
"commit_count": 2989,
"repo_created_at": "2023-04-15T08:46:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "116ebd5... |
ee425fc3-db5d-4b1b-bae1-8971fabb125a | wangx1996/Range-Image-based-segementation | range_image_cluster.cpp | /*MIT License
Copyright (c) 2020 WX96
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, merge, publish, distribute... | DATA | 0.910241 | 3.127409 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-05-09T15:30:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d06ef6... |
80127388-ada9-40d6-85ee-0d7a1bdfb12e | AmpleCoder/Leetcode-Solving | Counting/923. 3Sum With Multiplicity.cpp | /*
method-1) counting when we at index i we can figure out how many pairs starting from 0....(i-1) actually forming sum = target - a[i]
*/
class Solution {
public:
int threeSumMulti(vector<int>& arr, int target) {
int freq[301],i,size=arr.size(),lo,hi,mod=(int)1e9+7;
long long ans=0;
memset... | ALGO | 0.999971 | 5.798955 | {
"github_metadata": {
"branch": "master",
"commit_count": 245,
"repo_created_at": "2021-12-11T13:10:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f980e513... |
47844f6d-340f-488b-a221-0c85f23d93b4 | Dilivva/Inferkt | library/src/native/src/ggml-cpu/ops.cpp | #include "ops.h"
#include "ggml-cpu.h"
#include "ggml-impl.h"
#include "binary-ops.h"
#include "unary-ops.h"
#include "vec.h"
#include <float.h>
// ggml_compute_forward_dup
static void ggml_compute_forward_dup_same_cont(
const ggml_compute_params * params,
ggml_tensor * dst) {
const ggml_tensor... | ALGO | 0.959645 | 5.918962 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2025-02-06T09:26:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 20,
"forks": 1,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "00d7485b2... |
6f76b5f4-d317-458f-9dba-3cba7f5c7a79 | ishandutta2007/codeforces-c | cz_xuyixuan/normal/906/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define MAXN 25
#define INF 1e9
#define MAXS 10000005
template <typename T> void read(T &x) {
x = 0; int f = 1;
char c = getchar();
for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
x *= f;
}
template <typen... | ALGO | 0.999897 | 3.307912 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc5c26450e19... |
e710796b-6557-489e-aa12-4fcfda5357c4 | changmu/StructureAndAlgorithm | POJ/1125/13531758_AC_0MS_164K.cpp | #include <stdio.h>
#include <string.h>
#include <algorithm>
#define maxn 102
#define inf 0x3f3f3f3f
int map[maxn][maxn];
void getMap(int n) {
int i, j, k, u, v, dis;
memset(map, 0x3f, sizeof(map));
for(u = 1; u <= n; ++u) {
map[u][u] = 0;
scanf("%d", &k);
while(k--) {
... | ALGO | 0.999075 | 3.254231 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2015-02-08T13:48:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0866cb0bb... |
0a1031ef-9796-448d-8fbd-bc333fcf1a77 | aviralg/moogli | experiments/catmull_rom.cpp | inline void
catmull_rom_point( const osg::Vec3f & P0
, const osg::Vec3f & P1
, const osg::Vec3f & P2
, const osg::Vec3f & P3
, const osg::Vec3f & P10
, const osg::Vec3f & P21
, const osg::Vec3f & P32
,... | ALGO | 0.999596 | 4.871844 | {
"github_metadata": {
"branch": "geometry",
"commit_count": 36,
"repo_created_at": "2015-03-18T13:53:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "1fac3c6... |
f03bad9b-3ee8-4893-9c87-bb5619d46bd9 | sethsaps123/pokerGame | Desktop/swift projects : summer projects/pokerGame/pokerGame/player.cpp | //
// player.cpp
// pokerGame
//
// Created by <NAME> on 9/5/17.
// Copyright © 2017 <NAME>. All rights reserved.
//
#include "player.h"
#include <iostream>
#include <cassert>
#include "hand.h"
using namespace std;
//helper func for simple decision
string getDecision() {
string decision;
cin >> decision;... | ALGO | 0.929587 | 4.491199 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-08-22T13:45:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0411c204... |
4ca3a643-efc8-4eb6-b43b-1ddecdf49b84 | wesamhamad/Stack_Application | src/Evaluate.cpp | #include <string>
#include <iostream>
#include <cmath>
using namespace std;
struct node{
double info;
node* next;
};
class Stack {
private:
node *top;
public:
Stack(){top = NULL;}
bool isEmpty();
void push(double);
double pop();
double peak();
};
//Class Functions
bool Stack::isEmpty(... | ALGO | 0.998662 | 4.183741 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-05-12T08:50:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f65479d28f... |
e7211481-868e-4200-acbb-ba4290266773 | senlinuc/caffe_ocr | 3rdparty/include/openblas/lapacke.h | /*****************************************************************************
Copyright (c) 2010, Intel Corp.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source cod... | TOOL | 0.979322 | 5.617314 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2017-10-07T10:18:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1286,
"forks": 532,
"issues": 98,
"pull_requests": 1
},
"file_meta": {
"content_id": "72e... |
52292ea1-81e9-4b3c-ab12-7e0b96924d82 | MuhammadSawalhy/problem-solving | Codeforces/1864 - Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2)/F. Exotic Queries/main.cpp | // ﷽
// https://codeforces.com/contest/1864/problem/F
#include <bits/stdc++.h>
using namespace std;
#ifdef SAWALHY
#include "debug.hpp"
#else
#define debug(...) 0
#define debug_itr(...) 0
#define debug_bits(...) 0
#endif
#define ll long long
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#def... | ALGO | 0.999993 | 5.320305 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2022-09-16T05:33:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9776ce235a... |
31161e08-9fad-409e-b6e8-a02de45fcb6d | SammaelA/diff_procedural_generators | src/generation/metric.cpp | #include "metric.h"
#include "common_utils/utility.h"
//#define STB_IMAGE_IMPLEMENTATION
#include "third_party/stb_image.h"
#include "core/tree.h"
#include "tinyEngine/postfx.h"
unsigned char reference_raw[4*256*256];
double CompressionMetric::get(GrovePacked &g)
{
int origins = 0;
int instances = g.instancedBr... | ALGO | 0.948134 | 5.305573 | {
"github_metadata": {
"branch": "release/0.6-paper",
"commit_count": 814,
"repo_created_at": "2023-07-27T19:37:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id"... |
7dc3047b-6884-4106-ba46-96164067bc89 | TheAlgorithms/C-Plus-Plus | others/easter.cpp | /*
* @file
* @brief Determines the [Date of
* Easter](https://en.wikipedia.org/wiki/Date_of_Easter) after 1582
*
* @details
* The date of Easter is determined in each year through a calculation known as
* "computus." Easter is celebrated on the first Sunday after the Paschal full
* moon, which is the first full... | ALGO | 0.998579 | 6.150094 | {
"github_metadata": {
"branch": "master",
"commit_count": 1738,
"repo_created_at": "2016-07-16T10:19:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 32391,
"forks": 7439,
"issues": 10,
"pull_requests": 23
},
"file_meta": {
"content_id": ... |
a4520623-7f84-4719-9bbf-b01fb8cf00ab | SSobol77/LeetCode-Solved | Cpp/229. Majority Element II.cpp | // 229. Majority Element II.
// Topic: Array, Hash Table, Sorting, Counting.
/*
### Task:
---
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times.
Example 1:
Input: nums = [3,2,3]
Output: [3]
Example 2:
Input: nums = [1]
Output: [1]
Example 3:
Input: nums = [1,2]
Output: [1,2]... | ALGO | 0.999996 | 7.137955 | {
"github_metadata": {
"branch": "main",
"commit_count": 269,
"repo_created_at": "2024-01-10T18:02:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "941f00e64d... |
fad74cab-8694-4d31-a740-348b0988e17a | NnmnsP/CnCpluplusClass2022 | Day 2/N2.cpp | #include <iostream>
using namespace std;
int main() {
int a0, a1, a2, a3;
cin >> a0 >> a1 >> a2 >> a3;
if (a0 <= a1 && a1 <= a2 && a2 <= a3) {
cout << 0;
} else if ((a0 <= a1 && a1 <= a3) || (a0 <= a2 && a2 <= a3) || (a1 <= a2 && a2 <= a3) || (a0 <= a1 && a1<= a2)){
cout << 1;
} el... | ALGO | 0.999919 | 3.81758 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-12-06T16:55:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6efc2011637... |
06af1c2d-d3be-41d3-95d9-e339dd4dd128 | ugurduzel/ODTU-METU | CENG213/the3/Article.cpp | #include "Article.h"
Article::Article( int table_size,int h1_param, int h2_param )
: table_size(table_size), h1_param(h1_param), h2_param(h2_param) {
n = 0;
table = new std::pair<std::string, int>[table_size];
std::pair<std::string, int> empty(EMPTY_KEY,EMPTY_INDEX);
for(int i=0; i<table_size; i++) {
table[... | ALGO | 0.982368 | 3.958777 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-08-22T09:31:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a69fe99dfb... |
c8df6245-9098-4bf3-9e31-ab880f5ec03b | Consensys/zsl-q | zsl-golang/zsl/snark/libsnark/src/common/data_structures/set_commitment.tcc | /** @file
*****************************************************************************
Implementation of a Merkle tree based set commitment scheme.
*****************************************************************************
* @author This file is part of libsnark, developed by SCIPR Lab
* and ... | ALGO | 0.947121 | 6.928301 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-10-17T04:27:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 73,
"forks": 33,
"issues": 2,
"pull_requests": 2
},
"file_meta": {
"content_id": "f8c746d36... |
3f223255-6f73-4d6a-9acb-f439b7e88511 | YttriumWillow/OI | Problems/P4145.cpp | // Problem: P4145 上帝造题的七分钟 2 / 花神游历各国
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P4145
// Memory Limit: 125 MB
// Time Limit: 1000 ms
// Created Time: 2023-05-04 20:07:43
#include <iostream>
#include <cmath>
#define i64 long long
#define reg register
#define bel(p) ((p - 1) / bl... | ALGO | 0.99987 | 4.934708 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2023-08-30T03:08:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb67ffc1b4f... |
d197107d-f975-4608-9451-6b9108abbe1f | elliotfiske/animation_grad | 1_asgn/src/main.cpp | #include <iostream>
#include <vector>
#include <random>
#define GLEW_STATIC
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include "GLSL.h"
#include "Program.h"
#include "MatrixStack.h"
#include <iostream>
#include <chrono>
using namespace std;
using namespace Eigen;
using namespace std::chrono;
float random_float(... | TOOL | 0.975959 | 5.243033 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2016-04-01T21:22:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "61722f17e... |
8f559b31-2def-483c-b0d3-4a64ed19c09b | dolyaAl/programming-autumn-2020-hw | 2020-10-16-hw5/task1/Source.cpp | #include<iostream>
#include<clocale>
#include<ctime>
#include"ArrayList.h"
using namespace std;
void printMenu()
{
cout << "+---------------------------------------------------------------+" << endl;
cout << "| МЕНЮ |" << endl;
cout << "+--------------------... | TOOL | 0.981166 | 3.819444 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-09-26T07:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34295f669... |
7c1fd9cb-eb32-4921-874f-600c5c40fb6f | opencv/opencv | modules/core/include/opencv2/core/optim.hpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | ALGO | 0.999762 | 6.992971 | {
"github_metadata": {
"branch": "4.x",
"commit_count": 35401,
"repo_created_at": "2012-07-19T09:40:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 83079,
"forks": 56217,
"issues": 2595,
"pull_requests": 138
},
"file_meta": {
"content_id"... |
5df1d07b-ccf0-45be-afd1-db2e3bab1f66 | rasesh1/Leetcode | Medium/1381 Design stack with Increment Operation.cpp | class CustomStack {
private:
vector<int> s;
int maxi;
int front;
int back;
public:
CustomStack(int maxSize) {
maxi = maxSize;
front = 0;
back = 0;
s.resize(maxSize);
}
void push(int x) {
if(back-front == maxi) return;
s[back+... | ALGO | 0.999785 | 5.822646 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2021-07-17T09:41:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "118b99541b2... |
cc4d4e6c-00bf-44d6-9fb1-e250725c4e1e | the-mahapurush/Data-Structure-Using-C-C- | 2 String/anagram.cpp | #include <iostream>
using namespace std;
// ANAGRAM : when two string or word of same length contains same letter in with equal occurance
// e.g EAT & TEA, chin & inch
void verify(int a[26])
{
int flag = 0;
for (int j = 0; j < 26; j++)
{
if (a[j] > 0)
{
cout << "Not anagram" << e... | ALGO | 0.999986 | 4.459266 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2021-05-01T06:33:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62c2f6f50... |
99d60c5f-5960-45c6-bcc0-6e80bf519b34 | Xilinx/Vitis_Libraries | security/L1/include/xf_security/vdf.hpp | /*
* Copyright 2019 Xilinx, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | TOOL | 0.958924 | 7.335947 | {
"github_metadata": {
"branch": "main",
"commit_count": 471,
"repo_created_at": "2019-09-23T19:13:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 988,
"forks": 381,
"issues": 0,
"pull_requests": 12
},
"file_meta": {
"content_id": "5d85ca... |
7bab4baf-763f-4bb0-a33a-cc294b5d1084 | gaoxifeng/Feature-Preserving-Octree-Hex-Meshing | extern/vcg/vcg/space/index/closest2d.h | /****************************************************************************
* VCGLib o o *
* Visual and Computer Graphics Library o o *
* _ O _ *
* Copyri... | ALGO | 0.999553 | 6.158614 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-06-18T01:40:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 66,
"forks": 24,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "d066fdc0... |
8a1dad29-8087-4fbb-b6bf-70f4bcdce3b6 | MichaelIbrahim-GaTech/AGV-Liveness | CondensedMultiGraph.cpp | #include "CondensedMultiGraph.h"
bool operator < (const CondensedMultiGraph& lhs, const CondensedMultiGraph& rhs)
{
return lhs.vertices.size() < rhs.vertices.size();
}
bool operator > (const CondensedMultiGraph& lhs, const CondensedMultiGraph& rhs)
{
return lhs.vertices.size() > rhs.vertices.size();
}
CondensedMul... | ALGO | 0.999052 | 3.877342 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-06-22T19:56:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6973b244... |
719bcf0b-d032-4701-a1e3-9e3a913596b2 | kunyeul1121/CSCI-103 | network2/Six Degrees of Kevin Bacon/network.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include "network.h"
using namespace std;
Network::Network()
{
}
Network::~Network()
{
}
int Network::read_friends(const char *file)
{
ifstream in_file(file);
if(!in_file.is_open())
{
return -1;
}
else
{
int n;
int id, year, ... | ALGO | 0.920633 | 3.722361 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2019-12-09T00:50:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50e90a1f1... |
2cd977ed-4c9b-4a12-8aaa-183fcf9d162c | RajaKunalPandit1/CodeForces_Questions | 489C - Given Length and Sum of Digits....cpp | Output Status:
By Rajakunalpandit, contest: Codeforces Round #277.5 (Div. 2), problem: (C) Given Length and Sum of Digits..., Accepted
// #include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <climits>
#include <cmath>
#include <algorithm>
#include <map>
#include <vector>
#include <unordered_set>
... | ALGO | 0.99997 | 4.117871 | {
"github_metadata": {
"branch": "main",
"commit_count": 188,
"repo_created_at": "2021-11-11T10:27:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ca66014b5... |
4eb2241c-08d2-4995-8e39-a70b0ad44564 | KingVinay/6Companies30days | Atlassian/CountWordsObtainedAfterAddingaLetter.cpp | #include<bits/stdc++.h>
using namespace std;
int getMask(string& s) {
int mask = 0;
for (char c : s)
mask ^= 1 << c - 'a';
return mask;
}
int wordCount(vector<string>& startWords, vector<string>& targetWords) {
int ans = 0;
unordered_set<int> seen;
fo... | ALGO | 0.999766 | 4.664932 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2025-01-02T06:33:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea8b19d1ace... |
74a2d5d8-c20a-4df1-875c-72c0a9a26adb | abhiXsliet/Solved-DSA-Problems | GFG POTD/012-November-2024/028-implement-atoi.cpp | // https://www.geeksforgeeks.org/problems/implement-atoi/1
//{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int myAtoi(char *s) {
string str = s;
int n = str.length();
long long result = 0;
bool isNegat... | ALGO | 0.98838 | 4.950107 | {
"github_metadata": {
"branch": "main",
"commit_count": 2156,
"repo_created_at": "2023-07-29T13:17:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d999a8573... |
bf476f31-8eec-43da-87c4-c40660eb170f | yuchiki/contest | warehouse/abc77/C.cpp | #include <bits/stdc++.h>
#ifdef YUCHIKIDEBUG
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FUNCTION__ << endl;
#else
#define dump(x) ;
#define debug(x) ;
#endif // YUCHIKIDEBUG
#define int long long
#define pb push_back... | ALGO | 0.999759 | 4.095345 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2017-11-04T17:22:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "312986055... |
a7c0cede-8485-4b23-92bf-548a6d1550d3 | AlaaAbuHantash/Competitive-Programming | UVA/11362 - Phone List.cpp | #include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
string s;
vector<vector<int> > adj;
void add() {
int cur = 0;
for (int i = 0; i < s.length(); i++) {
if (adj[cur][s[i] - '0'] == -1) {
adj.push_back(vector<int>(12, -1));
adj[cur][s... | ALGO | 0.999969 | 4.10905 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2018-04-10T11:13:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a8b0bf4... |
16e7b71e-3f18-4b9d-82af-382471110dfc | ishandutta2007/codeforces-s | sonechko/normal/2/A.cpp | #include<bits/stdc++.h>
using namespace std;
const long long MOD = 1e9+7;
const int N = 1004;
const int M = 10;
const string s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
#define mod % MOD
#define filesio(x) freopen(x ".in", "r", stdin); freopen(x ".out", "w", stdout)
#define filesds(x) freopen(x ".dat", "r", stdin); freopen(x "... | ALGO | 0.999929 | 3.145586 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e8f0cf3e79d... |
c93880dc-112b-4f86-a24d-5c0e71ce7788 | CesarMKT/Controle-de-Prensa-motos | prensa_motos__em_placa_BoxInPaper_Ver3_rev5/display.ino |
void displayN(unsigned long valor) { //exibe o numero na tela
lc.refreshSegments();
delay(1);
lc.clearMatrix(); //clear the matrix just to be sure there is nothing on it
byte digito = 0;
divisor = valor;
do {
unidade = divisor % 10;
lc.setDigit(0, digito, unidade , false);
divisor = divisor / 1... | TOOL | 0.923416 | 3.707861 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-03-24T19:48:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b58e08c81c... |
1205a4e2-841b-4791-a439-95bad19cc881 | santiagoAlvz/PortafolioTC1031 | Act2-3/src/main.cpp | /* Archivo principal del programa
* <NAME> <<EMAIL>>
* 15 de septiembre de 2021
*/
#include <iostream>
#include <fstream>
#include <string>
#include <chrono>
#include "Registro.h"
#include "Algoritmos.h"
#include "DoubleLinkedList.h"
using std::cout;
using std::cin;
using std::vector;
using std::endl;
int main()... | ALGO | 0.993123 | 4.993073 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-10-22T14:18:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1eb1f0c22874... |
bcd36cde-6c5a-481e-969a-3b8436b4c56e | OpenPTrack/open_ptrack | bayes/src/unsFlt.cpp | /*
* Bayes++ the Bayesian Filtering Library
* Copyright (c) 2002 <NAME>
* See accompanying Bayes++.htm for terms and conditions of use.
*
* $Id$
*/
/*
* Unscented Filter.
*/
#include "unsFlt.hpp"
#include "matSup.hpp"
#include "models.hpp"
#include <cmath>
/* Filter namespace */
namespace Bayesian_filter
{
... | ALGO | 0.996554 | 6.727598 | {
"github_metadata": {
"branch": "master",
"commit_count": 303,
"repo_created_at": "2013-12-06T19:18:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 321,
"forks": 108,
"issues": 44,
"pull_requests": 2
},
"file_meta": {
"content_id": "c730... |
3748be2d-77b1-4744-8993-6ccfd13b7f7f | atomickashyap/Problem-Set-DSA | Count the subarrays having product less than k - GFG/count-the-subarrays-having-product-less-than-k.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int countSubArrayProductLessThanK(const vector<int>& a, int n, long long k) {
if (k <= 1) {
return 0;
}
int count = 0;
int left = 0;
long pro... | ALGO | 0.999483 | 6.050147 | {
"github_metadata": {
"branch": "master",
"commit_count": 1377,
"repo_created_at": "2023-03-21T05:34:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9deac7f... |
6123adcc-1823-41f6-ba2a-51299928d12c | Takumi1122/data-structure-algorithm | AtCoder/ARC116/a.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
// 素因数分解したときの偶数(2)に注目
// 素数は2以外は全て奇数
// 2が0個 (n % 4 == 1 || n % 4 == 3) なら奇数が多い
// 2が1個 (n % 4 == 2) なら偶数と奇数が同じ数
// 2が2個以上 (n % 4 == 0) なら偶数が多... | ALGO | 0.999918 | 4.719688 | {
"github_metadata": {
"branch": "master",
"commit_count": 744,
"repo_created_at": "2019-12-11T14:37:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04483bcc... |
ed1d97ca-cf42-4a0b-bcb1-a274e10c5e8b | taimoorzaeem/codeforces | problemset/2002C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
void solve(int case_number) {
ll n;
cin >> n;
vector<ll> xs(n);
vector<ll> ys(n);
for (ll i = 0; i < n; i++) {
cin >> xs[i] >> ys[i];
}
ll s1, s2, t1, t2;
cin >> s1 >> s2 >> t1 >> t2;... | ALGO | 0.999665 | 4.710103 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2024-09-19T06:30:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89c0ca352... |
e752f4bc-6a99-4590-9ed6-5d1a951b562f | rboutaik/problem_solving | codeforces/Div4_898/E.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#define ll long long
using namespace std;
void solution()
{
ll n, x, w = 0, res = 1;
cin >> n >> x;
vector<int> v(n);
for (int i = 0; i < n ; i++)
{
cin >> v[i];
}
ll l = ... | ALGO | 0.999991 | 4.326495 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-07-17T00:49:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fc69dc5b910... |
2b3eada7-ae6a-4c54-8f80-e1c505bdf09e | mfranzil-unitn/unitn-prog1 | exercises/FUNCTIONS/restituzione_riferimento.cc | // Example 6.7, page 162
// Schaum's Outline of Programming with C++ by <NAME>
// Copyright McGraw-Hill, 1996
// EXTENDED BY <NAME> 08.11.2016
using namespace std;
#include <iostream>
int& max(int& x, int& y) // return type is reference to int
{
return (x > y ? x : y); // m and n are non-local references
}
... | ALGO | 0.971659 | 3.833905 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2018-09-04T16:51:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa1fb34e40... |
d1759cdc-4c4e-45ce-841c-59781f701818 | latou/CV1 | src/cv/task1b/main.cpp | #include <iostream>
#include <fstream>
#include <sys/stat.h>
#include <iomanip>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctime>
#include <math.h>
#include <sstream>
#include <algorithm>
#include <chrono>
#include <limits>
#include <map>
#include <math.h>
#include "open... | TOOL | 0.972648 | 4.245649 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-03-09T22:58:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46bae0a6f1... |
c9fe348e-26d3-4013-8ea0-11265ed8fcd9 | DangZhonghua/CodingPractice | 121.买卖股票的最佳时机.cpp | /*
* @lc app=leetcode.cn id=121 lang=cpp
*
* [121] 买卖股票的最佳时机
*
* https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/description/
*
* algorithms
* Easy (48.15%)
* Total Accepted: 30.2K
* Total Submissions: 62.7K
* Testcase Example: '[7,1,5,3,6,4]'
*
* 给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格。
*
... | ALGO | 0.999364 | 5.539825 | {
"github_metadata": {
"branch": "master",
"commit_count": 774,
"repo_created_at": "2018-02-26T08:48:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c379974... |
a3bb0bea-4c3e-4579-9122-43182da07cc1 | arthurherbout/crypto_code_detection | data/code-jam/files/1836486_Ixanezis_1485488_0_extracted_main.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdi... | ALGO | 0.998639 | 3.212684 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2019-09-20T18:35:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "6e8ea776... |
88be871e-dd21-46da-8bbb-7e71081a612e | alexandraback/datacollection | solutions_2705486_0/C++/parity/c.cpp | #include<sys/types.h>
#include<dirent.h>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<cmath>
#include<fstream>
#include<map>
#include<set>
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#defi... | ALGO | 0.999609 | 3.858955 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f7a96fae... |
c89197a0-f253-4f90-8e8e-7bd7db7abca3 | KJakuz/CVRPTWproblem | src/graph.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <fstream>
#include <chrono>
#include <iomanip>
#include <random>
#include "graph.h"
class Truck;
Parameters defaultParameters;
// tworzymy wektor obiektow ciezarowek
void Graph::init_trucks(Truck &truckinfo)
{
for (int i = 0; i <... | ALGO | 0.998834 | 3.531239 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-10-30T08:07:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf3be665a27... |
02153ac8-3c92-4ed8-a63a-00179340bb09 | mnaveenkumar2009/Competitive-Programming | Codechef/44 COOK113A/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int n, q, k;
vector <int> D(1, 1);
int a[100006], gc[100006], pos[100006], S;
unordered_map <int, int> X;
int W[5000];
int DP[5000];
int F(int num){
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >>... | ALGO | 0.999936 | 3.678967 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2017-08-05T15:52:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ec88336... |
311876bc-0a58-4e84-a04f-f4dbaa90779e | lh1705617/HerreraLaura_CSC5_40718 | Class_Lab/TruthTable/main.cpp | /*
* File: main.cpp
* Author: <NAME>*
* Created on January 13, 2015, 8:00 PM
* Purpose: In Class Assignment - Truth Table
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
//Function Prototypes
//Execution Begins Here!
int main(int argc, char** argv) {
/... | ALGO | 0.993191 | 4.120664 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2015-01-07T03:42:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20f49df92... |
ba027b57-3580-4154-8fb0-cd8b31f6ff90 | babypuma/leetcode | MostStonesRemovedWithSameRowOrColumn/most_stones_removed_with_same_row_or_column.h | /*
* Author : <NAME>
* Email : <EMAIL>
* Date : 2021/01/15
*
* Source : https://leetcode-cn.com/problems/most-stones-removed-with-same-row-or-column/
* Problem: Most Stones Removed with Same Row or Column
*
*/
#include <vector>
#include <unordered_map>
using std::vector;
using std::unordered_m... | ALGO | 0.997508 | 5.931471 | {
"github_metadata": {
"branch": "master",
"commit_count": 438,
"repo_created_at": "2014-10-20T08:18:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed544197... |
5194cc3d-e50a-4c8a-8211-6151ab892158 | bensteku/n-body-problem | src/body/body.hpp | #pragma once
#include <vector>
#include <immintrin.h>
#include <random>
#include <iostream>
#include <limits>
#include <thread>
#include <barrier>
#include <condition_variable>
#ifdef USE_CUDA
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
#endif
#include "../misc/util.hpp"
#include "../misc/settings... | ALGO | 0.997867 | 4.197968 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2024-06-04T06:33:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac103561c... |
d042be0f-d831-4c4b-85e7-dbd56a3c980f | roohom/Cream | Point_learn/case20.cpp | //
// Created by roohom on 19-6-22.
//
//二叉树深度优先遍历算法的非递归实现
#include <stdio.h>
#include <malloc.h>
#include <iostream>
using namespace std;
#define maxsize 15
typedef struct BTNode
{
char data;
struct BTNode *lchild;
struct BTNode *rchild;
}BTNode, *BTnode;
void Visit(BTNode *p)
{
cout<<p->data<<en... | ALGO | 0.999474 | 4.290339 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2018-10-31T12:38:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74b375bc2... |
e82504da-ebfa-4a08-8de8-7d154d09e29b | Jose-An608/Ejercicios-de-Funciones-II | Ejercicio4.cpp | /*Ejercicio 4: Cálculo de Raíces de una Ecuación Cuadrática: Crea un programa que calcule las raíces de una
ecuación cuadrática utilizando la fórmula general. Utiliza la función sqrt de la librería cmath para
calcular la raíz cuadrada. Solicita al usuario los coeficientes de la ecuación (a, b, c) y muestra las
raíces o... | ALGO | 0.994884 | 3.421012 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-06-21T03:12:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2557c42fa5e8... |
37f536ac-b3c7-4783-a4cb-a75c64f29916 | amz-2014/test | phi.cpp | //Author: <NAME>.
//OpenMP version
#include<stdio.h>
#include<omp.h>
#define numt 8000 //number of threads
omp_lock_t mylock;
int main()
{
unsigned int x;
unsigned int count[numt] = { 0 };
//printf("Please enter Input: ");
x = x | 0xffffffff;
//scanf("%u",&x);
int nthreads;
nthreads = omp_get_max_threads();
print... | ALGO | 0.999852 | 3.693159 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2014-03-07T14:20:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d88a3add25... |
87307858-dbc3-4b8d-bbe5-eeeefd2e2e21 | mattkjames7/MHDWaveHarmonics | MHDWaveHarmonics/__data/libwh/ArgSort.cc | #include "ArgSort.h"
/* Some "C" wrappers to allow python to call the functions easily*/
void SortArrayInt(int n, int *x, int *xs) {
SortArray(n,x,xs);
}
void SortArrayFlt(int n, float *x, float *xs) {
SortArray(n,x,xs);
}
void SortArrayDbl(int n, double *x, double *xs) {
SortArray(n,x,xs);
}
void ArgSortInt(int n... | ALGO | 0.999557 | 5.661086 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-11-26T13:48:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4714ee240... |
51e424ba-106f-4a81-b2eb-31b3b38ccdd9 | dongseoki/Studying-algorithms | FromACMRepo/dongseoki/Dijkstra Algorithm_Bellman Ford/Dijkstra Algorithm_Bellman Ford/tree_escape_15900.cpp |
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
//vector<vector<int> > arr(6, vector<int>(5, 0));
vector<vector<int> > trvec(500000); // index 0 사용.
vector<bool > visited(500000, false);
int N;
int result;
void dfs(int state, int sum) {
//visited[state] = ... | ALGO | 0.999995 | 4.565482 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2019-01-01T10:59:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd70361d... |
4e81fb4d-eb56-4976-8453-cd35e6b59907 | wavescholar/numerical_libraries | itpp/itpp-4.3.1/itpp/base/math/integration.h | /*!
* \file
* \brief Definition of numerical integration
* \author <NAME>
*
* -------------------------------------------------------------------------
*
* Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors)
*
* This file is part of IT++ - a C++ library of mathematical, signal
* processing,... | ALGO | 0.999637 | 6.203286 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2012-11-30T14:19:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "7deedd48... |
fdbeafac-7d10-4d3c-94fc-05d34f9a98a6 | dngus1683/codingTestStudy | 알고리즘/구현/leetcode/C++/16.cpp | // 3Sum Closet
// n개의 정수와 target 정수가 주어질 때, 3개의 정수의 합이 target에 가장 가까운 수를 구하라.
// 내 답안1
// 2 pointer를 사용.
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int threeSumClosest(vector<int>& nums, int target) {
int dist = 987654321;
int ans = 0;
sort(nums.... | ALGO | 0.999998 | 5.931986 | {
"github_metadata": {
"branch": "master",
"commit_count": 417,
"repo_created_at": "2022-07-05T09:26:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "166ea3dc... |
2b916540-e766-45f8-a040-bca9ad70b6d2 | ishandutta2007/codeforces-d | dreamoon_love_aa/normal/1089/M.cpp | /*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).be... | ALGO | 0.99985 | 3.430051 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "642d09c820f4... |
adbd98f7-4415-473c-b276-2ada8b7a52ba | Dedicate-labors/Cplusplus-Review | C++算法/LeetCode/蓝桥杯/3-1263.cpp | //#include<iostream>
//#include<vector>
//#include<string>
//using namespace std;
//
////打印X
//void PrintX(int PanW, int H, int W) {
// int start = 0, end = W - 1; //start是左边*开始位置,end是右边*结束位置
// int i = 0, j, flag = H/2 + 1;
// while (H--)
// {
// //每一层的涂刷
// for (i = 0; i < W; ++i) {
// if (i == start || i == (end... | ALGO | 0.999675 | 3.269777 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-09-16T12:01:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d857d6c02... |
d0298919-e80b-4d00-a51f-4c297c17962d | DevCoursePlanningContorl2FINALTEAM1/team1_ws | src/prediction/include/state_filters.hpp | #ifndef STATE_FILTERS_HPP
#define STATE_FILTERS_HPP
#include <Eigen/Dense>
#include <vector>
#include <functional>
#include <random>
#include <cmath>
#include <memory>
#include "state_models.hpp"
class ExtendedKalmanFilter {
public:
ExtendedKalmanFilter(int x_dim, int z_dim, std::shared_ptr<StateModel> model);
... | ALGO | 0.983023 | 6.105631 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-05-10T05:51:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73101af4459fd... |
3ad15619-9d72-4bf8-924d-8bcdea2f6638 | xjs-js/leetcode | 0884.Uncommon.Words.from.Two.Sentences/sol.cpp | class Solution {
public:
void split(string& str, unordered_map<string,int>& count) {
string c = " ";
size_t beg = 0;
size_t end = str.find(c);
while (end != string::npos) {
string token = str.substr(beg, end - beg);
if (token.size()) {
++count[... | ALGO | 0.999784 | 5.062921 | {
"github_metadata": {
"branch": "master",
"commit_count": 494,
"repo_created_at": "2017-04-23T12:31:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4c60b66... |
e4169b57-50f9-4281-9b30-dc96af6c4c8f | Ryoukiwei/Leetcode | 143 Reorder List.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution
{
public:
void reorderList(ListNode *head)
{
... | ALGO | 0.999997 | 6.073414 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2024-06-02T02:37:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d04a5aa... |
a00fc062-74a7-41a2-b656-9a0321cc5873 | ND252005/DSA | programming/tuan_4/bai_6.cpp |
#include <iostream>
using namespace std;
struct DNode
{
int info;
DNode *pNext, *pPrev;
};
struct DList
{
DNode *pHead, *pTail;
};
void init(DList &L){
L.pHead = L.pTail = nullptr;
}
DNode* get_node(int x) {
DNode *p = new DNode;
p->info = x;
p->pNext = p->pPrev = nullptr;
return p;
}
void... | ALGO | 0.999524 | 4.177265 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-10-10T17:32:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a29a35f5357... |
a9e0cfe4-ec7c-4249-a893-9758185fa628 | NekoMio/ACMcode | Codes/BZOJ/BZOJ_2480.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
#define int long long
inline int read()
{
int x=0,f=1;char ch=getchar();
while (ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while (ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
int pow_mod(i... | ALGO | 0.999993 | 4.468256 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2017-07-14T23:35:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "183fefa8... |
029859cd-650a-44f9-8868-8e0c818e06c4 | yousefsaad0/ALViS | thirdparty/ITK/include/ITK-5.1/itkCorrelationImageToImageMetricv4HelperThreader.h | /*=========================================================================
*
* Copyright NumFOCUS
*
* 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.or... | ALGO | 0.923772 | 7.020386 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-10-31T15:45:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ebe238782c... |
35e7e530-d641-4716-b5d8-d49e9ebfcd19 | SAMIUL98SIAM/C- | ALGO/COUNTING_SORT/COUNTING_SORT/Source.cpp |
///Counting Sort
#include<iostream>
using namespace std;
void print(int arr[], int n)
{
cout << "ARRAY: [ ";
for (int i = 1; i <= n; i++)
{
cout << arr[i] << " ";
}
cout << " ] " << endl;
}
int main()
{
int i, j, k = 0;
int *a , A_MAX ;
cout << "ENTER THE SIZE OF ARRAY:(A) ";
cin >> A_MAX;
a = new int... | ALGO | 0.99985 | 4.333009 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-06-21T18:33:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0988e78a77... |
2f0d5a48-1599-46ca-9b24-7f31364f819c | Tomki2258/Matrix-by-vector-OpenMP | main.cpp | #include <iostream>
#include <random>
#include <iomanip>
#include <omp.h>
// Liczbę wątków należy ustawić przez zmienną środowiskową:
// export OMP_NUM_THREADS=X
// Tutaj można zmienić rozmiar macierzy
// Wykonanie programu sekwencyjnego na serwerze z tymi danymi powinno trwać +5 minut
#define N 100000
#define M 1200... | ALGO | 0.999829 | 5.329797 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-05-12T20:00:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb231e7caf3... |
af40c61c-c4ef-48c7-b306-1a0fa6fcce2a | Arpitmurailya18/AJfiles-CP | BinaryPath.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long double lld;
typedef unsigned long long ull;
typedef long long ll;
typedef int in;
typedef char ch;
typedef float fl;
typedef double dou;
typedef string ss;
#define ub upper_bound
#define lb lower_bound
#define AJ(i,a,b) for(int i=a;i<b;i++)
#define test int t; ... | ALGO | 0.999993 | 4.133149 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-06-13T10:58:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "029feac999c... |
9a3408d1-87c0-48bb-b988-e96a3d1e4132 | hungt1/Competitive-Programming | CSES/Dynamic Programming/2181.cpp | /**
* author: hungt1
* created: 09-11-2021 20:38:18
**/
#include <bits/stdc++.h>
using namespace std;
#define long long long
#define db double
#define pii pair <int, int>
#define pll pair <long, long>
#define all(c) c.begin(), c.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie... | ALGO | 0.999993 | 4.252024 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2021-10-01T10:22:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f64a32e9e9... |
b8e8c129-da80-403e-9af0-92b7fb856b23 | kiejibi/kiejibilab13 | lab13_1.cpp | #include <iostream>
#include <cmath>
using namespace std;
void stat(const double[], int, double[]);
int main()
{
double A[] = {1.2, 3.5, 6.9, 7.8, 12.5, 0.5};
int N = sizeof(A) / sizeof(A[0]);
double B[6];
stat(A, N, B);
cout << "Arithmetic Mean = " << B[0];
cout << "\nStandard Deviation = " <... | ALGO | 0.999096 | 3.34847 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2024-01-02T07:02:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66cfba7bf... |
40625261-b96a-4690-8580-2b8d012d7b67 | Sjdeuek076/sfml_examples | Spirographe/src/Utility.cpp | #include "Utility.h"
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>
#include <cmath>
#include <iostream>
using namespace sf ;
using namespace std ;
Color colorInterpolation(Color initialColor, Color aimColor, float time, float timeSpent, float deltaTime)
{
Color color = initialCol... | TOOL | 0.945287 | 5.451616 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-02-16T00:16:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da54c2507d... |
8166f735-a4d3-415b-b4e8-ed4c987600ad | coldEr66/online-judge | CS/Constant Sum.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define RST(i,n) ... | ALGO | 0.999853 | 3.789312 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2018-04-07T03:54:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdfa270a1... |
f8e3b839-718e-4faf-9a40-322d8daac9e3 | yt0001/itachi_learning | thread_demo.cpp | /*version 1: 无锁
#include <thread>
#include <iostream>
int val = 0;
void* func(int val) {
for (int i = 0; i < 100000; ++i) {
val = val + 1;
}
return nullptr;
}
int main() {
std::thread thread_arr[10];
for (int i = 0; i < 10; ++i) {
thread_arr[i] = std::move(std::thread(func, 0));
... | ALGO | 0.93997 | 5.515041 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-09-18T03:27:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6064c28ea... |
1fee7c3a-a710-4d5d-83a4-d18ef428106b | ishandutta2007/codeforces-m | malfple/normal/269/B.cpp | #include <bits/stdc++.h>
#define YOU using
#define DONT namespace
#define SAY std
YOU DONT SAY;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef pair<int,ll> pil;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector... | ALGO | 0.999967 | 3.151405 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5542dfcb0523... |
cafe8162-02d2-42c5-b0ba-3a8d4742e7c8 | middleprince/AlgorithmNotes | chapter3/4-CP-DateAccumulation.cpp | #include<cstdio>
#include<cstring>
class Date
{
public:
friend void print(const Date &);
Date() = default;
Date(int yr, int mo, int da) : year(yr), month(mo), day(da) {}
~Date() = default;
int date_pp();
int date_accu(int);
private:
static const int year2days[13][2];
int year... | ALGO | 0.993865 | 4.437398 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2019-05-31T12:05:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4503719ee... |
e6d2efea-9cb7-4862-ab2f-0ff7c38f6274 | ktlpdlbr/Algorithms-Class-Projects | sort_heap/max_heapify.cpp | #include <stdio.h>
#include <cstdlib>
#include <chrono>
//problem with indexing... we start with 0 not 1
int parent(int i){
return i/2 ;
}
int left(int i){
return 2*i ;
}
int right(int i){
return (2*i)+1 ;
}
void max_heapify(int arr[], int i, int size){ //i is the node we want to max_heapify
int... | ALGO | 0.999525 | 4.144116 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-11-23T05:34:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8f9960b50d6... |
abdf3c5c-14f5-44f5-b22e-197dadeaf7c7 | Sampreeth2002/DSA | 2. Lucky Numbers - GFG/2.-lucky-numbers.cpp | // { Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User-function template for C++
// Complete the function
// n: Input n
// Return True if the given number is a lucky number else return False
class Solution{
public:
int counter = 2;
boo... | ALGO | 0.999725 | 5.068382 | {
"github_metadata": {
"branch": "main",
"commit_count": 274,
"repo_created_at": "2022-03-18T11:50:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37d2bd475e... |
1030a8c2-8d0c-436e-94f0-591b7c41f2b0 | kk-katayama/com_pro | Codeforce/Edufo090/Edufo090b.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if(a >... | ALGO | 0.999911 | 4.128923 | {
"github_metadata": {
"branch": "master",
"commit_count": 269,
"repo_created_at": "2019-08-06T00:33:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23e25ab2... |
18972544-55d9-448e-b11c-1408f7527671 | DevSaurabhGirme/DS_Algo | 2914_Minimum_Number_of_Changes_to_Make_Binary_String_Beautiful_I.cpp | // T.C = O(n) S.C = O(1)
class Solution {
public:
int minChanges(string s)
{
int n = s.length();
char ch = s[0];
int cnt = 0;
int changes = 0;
for(int i = 0; i < n; i++)
{
// same character found
if(s[i] == ch)
{
... | ALGO | 0.999971 | 5.362805 | {
"github_metadata": {
"branch": "master",
"commit_count": 599,
"repo_created_at": "2024-03-09T10:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7fbeabd... |
b553b31e-773e-4c7c-b3c1-461ca8d82b11 | CJSBinder-User/CJSBinder | experiment/correctness_efficiency/cjsbinder/CALCULATE_SUM_OF_ALL_NUMBERS_PRESENT_IN_A_STRING/CALCULATE_SUM_OF_ALL_NUMBERS_PRESENT_IN_A_STRING_GLUECODE.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include "include/libplatform/libplatform.h"
#include "include/v8.h"
#include "CQuesHeader.h"
using namespace v8;
void Print(const FunctionCallbackInfo<Value>& args){
v8::Isolate* isolate = args.GetIsolate();
v8::Str... | TOOL | 0.908859 | 3.829621 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-04-15T02:32:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "daddd56ef63... |
4708c67c-ab32-4fcd-97f0-86516b1dc937 | aeternalis1/Contest-problems | USACO/USACO-'18-C2-Gold-P2.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
typedef long long ll;
#define f first
#define s second
const ll mod = 1e9+7;
ll tree[2][MAXN];
void update(int i, int v, int q){
for (;i<MAXN;i+=i&-i) tree[q][i] += v;
}
ll query(int i, int q){
ll res = 0;
for (;i>0;i-=i&-i) res += t... | ALGO | 0.999992 | 3.725846 | {
"github_metadata": {
"branch": "master",
"commit_count": 419,
"repo_created_at": "2017-10-01T18:31:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "677819fe... |
c70e86e1-6948-43be-826f-8adee41692e9 | DemonRem/UnrealEngine3 | Development/External/FaceFX/FxStudio/Src/FxSegment2d.cpp | #include "stdwx.h"
#include "FxSegment2d.h"
namespace OC3Ent
{
namespace Face
{
FxSegment2d::FxSegment2d()
{
}
FxSegment2d::FxSegment2d( const FxVec2& start, const FxVec2& end )
: _start( start )
, _end( end )
{
}
FxSegment2d::FxSegment2d( const wxPoint& start, const wxPoint& end )
{
_start.x = start.x;
_start... | TOOL | 0.914695 | 5.723083 | {
"github_metadata": {
"branch": "2008",
"commit_count": 9,
"repo_created_at": "2018-11-19T21:55:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b94dccf523ba... |
859217a3-2df7-49e9-8320-f1d2ed81f62c | skygragon/Q.solution | leetcode/080.remove-duplicates-from-sorted-array-ii.cpp | /*
* [80] Remove Duplicates from Sorted Array II
*
* https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii
*
* Medium (35.15%)
* Total Accepted: 106774
* Total Submissions: 303745
* Testcase Example: '[]'
*
*
* Follow up for "Remove Duplicates":
* What if duplicates are allowed at most t... | ALGO | 0.999947 | 6.220007 | {
"github_metadata": {
"branch": "master",
"commit_count": 522,
"repo_created_at": "2017-03-02T02:05:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96aac5d... |
f1a57356-98cd-4cd1-b89c-68a3da0ec066 | udayatenneti/MPI | src/model.cpp |
#include "model.h"
#include "utils.h"
#include <cmath>
#include <iostream>
using std::array;
array<double, 2> eval_force_simple(const double * cell_rm, double cell_m, const double * body_pos, double body_m){
double RLIMIT = 0.03;
//double M = cell_m * body_m;
array<double, 2> f;
double dis... | ALGO | 0.998953 | 4.528203 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2021-11-30T13:45:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "054a5ba1a... |
971519bb-cd4e-4220-8674-810364869b84 | LLBlue/ENGR101-2017 | RobotRun.cpp | #include <stdio.h>
#include <time.h>
#include "E101.h"
#include "RobotFunction.h"
int main() {
init();
bool debug = false;
//Q1 open gate logic
gateSequence();
sleep1(1,0);
//Q2 follow line logic
char Q2 = 0;
while (Q2 == 0) {
double speedMultiplier = 0.95; //change this during testing
... | ALGO | 0.909551 | 3.235571 | {
"github_metadata": {
"branch": "master",
"commit_count": 430,
"repo_created_at": "2017-04-12T00:58:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7069b32c... |
f91e7ab8-3d05-41ff-a59b-922688328ef5 | realharshgautam/Leetcode | 863-sum-of-distances-in-tree/sum-of-distances-in-tree.cpp | class Solution {
private:
unordered_map<int, vector<int>> graph;
vector<int> count;
vector<int> res;
void dfs(int node, int parent) {
for (int child : graph[node]) {
if (child != parent) {
dfs(child, node);
count[node] += count[child];
... | ALGO | 0.999974 | 6.233768 | {
"github_metadata": {
"branch": "main",
"commit_count": 770,
"repo_created_at": "2024-03-19T01:18:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c13dde46d... |
bcba30fe-4fcb-4496-bce4-a2de602f38d6 | pibuxd/competitive-programming | MeetIT/SummerCamp2021/day4/noise.cpp | // author: Piotr "pibuxd" Bublik (https://github.com/pibuxd)
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
typedef long long ll;
ll n, k, ans;
vector<ll> a;
int main(){
fastio;
cin >> n >> k;
a.resize(n+1);
ans = 0;
for(ll i = 1; i <= n; ... | ALGO | 0.999975 | 3.623868 | {
"github_metadata": {
"branch": "master",
"commit_count": 409,
"repo_created_at": "2021-01-06T21:36:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0096827e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.