uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f8dd42bb-391f-4f57-9372-f4967f9774c3 | hashiryo/Library | test/atcoder/abc179_e.test.cpp | // competitive-verifier: IGNORE
// competitive-verifier: PROBLEM https://atcoder.jp/contests/abc179/tasks/abc179_e
// competitive-verifier: TLE 0.5
// competitive-verifier: MLE 64
#include <iostream>
#include "src/Misc/Period.hpp"
using namespace std;
signed main() {
cin.tie(0);
ios::sync_with_stdio(0);
long long N,... | ALGO | 0.999903 | 4.166942 |
4b346608-15fb-47a4-987d-6ceb5701dc8d | sidikone/vision_project | initial_release/src/histogram.cpp | #include "histogram.h"
#include <iostream>
using namespace cv;
using namespace std;
using namespace matplot;
HistoGram::HistoGram(Mat &imag_in){
_image = imag_in;
}
void HistoGram::compute_x_histogram(){
float step = (*(range+1) - *(range) -1)/numbins;
for (float idx = *(range); idx < *(range+1)-1; idx+... | ALGO | 0.936517 | 4.480301 |
a30a179b-1cab-4d81-829e-34d50064032a | tgminh/CTDL-GT | bt(2)_11_04.cpp | #include <iostream>
#include <math.h>
#include <vector>
using namespace std;
int PrimeCheck(int n) {//kiem tra SNT
int count = 0;
for (int i = 2; i <= n; i++)
if (n % i == 0) count++;
if (count == 1) return 1;
else return 0;
}
int BlumCheck(int n) { //Kiem tra so Blum
int count = 1;
f... | ALGO | 0.999841 | 4.52319 |
eeec14d2-5b40-4ab5-af44-43a88ceab6db | HanXiao68/base-skill | algorithm/algorithm/leetcode_406 根据身高重建队列.cpp | //
// leetcode_406 根据身高重建队列.cpp
// algorithm
//
// Created by 韩霄 on 2021/10/27.
//
class Solution {
public:
vector<vector<int>> reconstructQueue(vector<vector<int>>& people) {
sort(people.begin(), people.end(),
//重点在让写正则。
[](const vector<int>& a, const vector<int>& b) {
... | ALGO | 0.999997 | 5.865977 |
fe544072-aafe-4824-a59f-842f616b3fa2 | Mayuresh-NG/placement | DSAsolutions/solved/chocolatedistribution.cpp | // C++ Implementation of the Quick Sort Algorithm.
#include <iostream>
using namespace std;
int partition(int arr[], int start, int end)
{
int pivot = arr[start];
int count = 0;
for (int i = start + 1; i <= end; i++) {
if (arr[i] <= pivot)
count++;
}
// Giving pivot element its correct position
int pivot... | ALGO | 0.999995 | 5.1475 |
a1b5bfcd-e36b-48ae-bdc9-b02550a244cd | yuyangh/LeetCode | 174. Dungeon Game.cpp | #include "LeetCodeLib.h"
/*
* @lc app=leetcode id=174 lang=cpp
*
* [174] Dungeon Game
*
* https://leetcode.com/problems/dungeon-game/description/
*
* algorithms
* Hard (27.06%)
* Likes: 677
* Dislikes: 16
* Total Accepted: 66.1K
* Total Submissions: 243.7K
* Testcase Example: '[[-2,-3,3],[-5,-10,1]... | ALGO | 0.999875 | 6.179018 |
25594016-2ac7-4a71-ac71-df95c09ed238 | JohnVlBetter/LeetCode | LCP 67. 装饰树.cpp | /*
* @lc app=leetcode.cn id=LCP 67 lang=cpp
*
* [LCP 67] 装饰树
*/
// @lc code=start
class Solution {
public:
TreeNode* expandBinaryTree(TreeNode* root) {
dfs(root);
return root;
}
void dfs(TreeNode* node){
if(node == nullptr) return;
if(node->left){
node->left... | ALGO | 0.999661 | 6.905498 |
51db159d-b5d6-4c83-a14a-94e074c7a9ca | kartikeyaGUPTA45/C-Plus-Plus-Programming-Language | Array ADT/Set Function.cpp | # include<iostream>
using namespace std;
struct Array{
int A[10];
int size;
int length;
};
void Display(struct Array arr)
{
int i;
for (i=0;i<arr.length;i++)
{
cout<<arr.A[i]<<" ";
}
}
void Set(struct Array *arr,int index,int x)
{
if(index>=0 && index<arr->length)
arr->A... | TOOL | 0.958866 | 3.919117 |
33128b7d-0aa9-444e-b139-f45bf4fb6155 | ViniciuszFerreira/Estrutura-Dados2 | lista calcular/lista calcular/main.cpp | #include <iostream>
using namespace std;
// Definição da estrutura do nó da lista circular
struct Node {
int dado; // Dado do nó
Node* proximo; // Ponteiro para o próximo nó
};
// Função para criar um novo nó com o dado fornecido
Node* criarNo(int dado) {
Node* novoNo = new Node;
novoNo->dado = ... | ALGO | 0.999627 | 6.477599 |
8ce8e69b-6338-4587-9dcc-d2cc6adea0d2 | dishhaa03/Striver-CP-sheet- | Basic question/15_546-A.cpp | # include <bits/stdc++.h>
using namespace std;
int main()
{
long long k,n,w; cin >>k>>n>>w;
long long ans = w*(w+1)*k/2;
if(ans - n < 0){
cout << "0"<<endl;
return 0;
}
cout << ans-n << endl;
return 0;
} | ALGO | 0.999983 | 3.664232 |
49f1c868-a740-4028-a850-d5e91eff9e7e | SepehrGanji/LeetCode-Solutions | Solutions/1160-letter-tile-possibilities/solution.cpp | class Solution {
public:
set<string> ans;
void backtrack(vector<int>& count, string& so_far, int n) {
if (so_far.length() == n) {
return;
}
for (int i = 0; i < 26; i++) {
if (count[i] > 0) {
count[i]--;
char c = 'A' + i;
... | ALGO | 0.999907 | 7.146868 |
e19a243e-f1ea-49f3-8ecb-90c030701563 | serna37/sandbox | work/85.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> dx = {0, 1, 0, -1};
vector<int> dy = {1, 0, -1, 0};
string enemy = "v>^<";
string white = ".SG";
int main() {
int H, W;
cin >> H >> W;
int sy, sx, gy, gx;
vector<vector<char>> A(H, vector<char>(W));
for (int i = 0; i < H; i++) {
for (... | ALGO | 0.999982 | 3.986757 |
e561c276-e409-408c-af91-875209f25a0d | ishandutta2007/codeforces | alpha_q/normal/891/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 5005;
const int MOD = 1e9 + 7;
struct polynomial {
int deg;
ll coeff[N];
polynomial () {
deg = 0;
memset(coeff, 0, sizeof coeff);
}
};
ll bigMod (ll a, int e) {
ll r = 1;
while (e) {
if (e & 1) r = (r * ... | ALGO | 0.999995 | 4.595615 |
59a73722-02bb-4b0e-ae21-c3deedc8cf90 | vipinsharma84/DS | ReverseLL/ReverseLL.cpp | // { Driver Code Starts
//Initial Template for C++
// C program to find n'th Node in linked list
#include <stdio.h>
#include <stdlib.h>
#include<iostream>
using namespace std;
/* Link list Node */
struct Node {
int data;
struct Node *next;
Node(int x)
{
data = x;
next = NULL;
}
};
... | ALGO | 0.99969 | 5.706092 |
9437d8a3-0bb6-4bd9-a8e2-65740bf2d251 | TechXplorerFR/cpp-trees-management | src/binary_tree.cpp | #include "binary_tree.hpp"
Node *createNode(int data, int index)
{
Node *newNode = new Node();
newNode->data = data;
newNode->index = index;
newNode->leftChild = nullptr;
newNode->rightChild = nullptr;
return newNode;
}
void insertBST(Node *&root, int data, int index)
{
if (root == nullptr... | ALGO | 0.999457 | 4.975123 |
c19a374f-8b3a-49f4-8f2c-6f4b85b96cc0 | AmrARaouf/algorithm-detection | graph-source-code/230-D/12317878.cpp | //Language: GNU C++11
#include <bits/stdc++.h>
using namespace std;
struct state {
int u, c;
state(int u, int c) :
u(u), c(c) {
}
bool operator<(const state&e) const {
return e.c < c;
}
};
const int N = 1e5;
vector<state> g[N];
vector<int> in[N];
int n, m, cost[N];
bool vis[N];
int Dijkstra(int src, int t... | ALGO | 0.999899 | 4.319497 |
3fecc3c9-d7ff-4c4b-b28b-12d14d0029ad | ishandutta2007/codeforces | rubikun/normal/788/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define ... | ALGO | 0.999951 | 4.009532 |
953ab229-9f6e-45aa-8c6c-8f3beb3aba52 | OlexHorn/ABP | Lab4/lab4.cpp | #include <iostream>
using namespace std;
enum Movement {
LEFT,
DOWN,
RIGHT,
UP
};
int main() {
int n = 9;
int arr[9][9];
int number = 1;
int i = 4;
int j = 4;
int step = 1;
int iteration = 0;
Movement move = LEFT;
arr[i][j] = number;
do {
switch (move) {
case LEFT:
... | ALGO | 0.999892 | 4.404342 |
f301e72f-1eff-4ba8-88af-3a1415b8ceb0 | haptork/AnuVikar | src/main.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
#include <clipp.h>
#include <cluster2features.hpp>
#include <helper.hpp>
#include <logger.hpp>
#include <printJson.hpp>
#include <reader.hpp>
#include <infoReader.hpp>
auto getConfig(int argc, char *argv[]) {
using ... | DATA | 0.874837 | 5.080917 |
a3418c87-8a73-4b95-935e-e590968020d7 | Edouard-ZHOU-fr/Outils_VA | cc_blackbox/main.cpp | #include <iostream>
#include <filesystem>
#include <string>
#include <sstream>
#include <ctime>
#include <limits> // utiliser pour chercher les max du dossier
#include <cmath>
#include <fstream>
#include <json.hpp>
namespace fs = std::filesystem;
using json = nlohmann::json;
// 将字符串 "2025-03-05-10-28-34" 转换为 `std... | TOOL | 0.90853 | 4.171836 |
f2224057-71c3-432b-80e1-5f4a39e8a0b0 | openjdkgit/jfx-sandbox | modules/javafx.web/src/main/native/Source/JavaScriptCore/b3/B3FixSSA.cpp | #include "config.h"
#include "B3FixSSA.h"
#if ENABLE(B3_JIT)
#include "B3BreakCriticalEdges.h"
#include "B3InsertionSetInlines.h"
#include "B3PhaseScope.h"
#include "B3ProcedureInlines.h"
#include "B3SSACalculator.h"
#include "B3UpsilonValue.h"
#include "B3ValueInlines.h"
#include "B3Variable.h"
#include "B3VariableL... | ALGO | 0.871415 | 7.933894 |
a7ba693b-9acd-453d-a241-a22b3d09b955 | maybeabhishek/CodingChallenges | HackerRanK/InterviewPrepChallenges/Fradulent-activity-notification/fardu.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
int getTwiceMedian( vector<int> &A, vector<int> &count,int d)
{
vector<int> countfreq(count);
for(int i=1; i< countfreq.size(); i++)// O(1);
{
countfreq[i] += countfreq[i-1];
}
int median;
int a = 0;
... | ALGO | 0.999862 | 4.821037 |
c217c17d-67ad-4676-b35d-05bf3dfb4946 | kmatheussen/radium | pluginhost/JuceLibraryCode/modules_old4/juce_box2d/box2d/Dynamics/b2ContactManager.cpp | #include "b2ContactManager.h"
#include "b2Body.h"
#include "b2Fixture.h"
#include "b2WorldCallbacks.h"
#include "Contacts/b2Contact.h"
b2ContactFilter b2_defaultFilter;
b2ContactListener b2_defaultListener;
b2ContactManager::b2ContactManager()
{
m_contactList = NULL;
m_contactCount = 0;
m_contactFilter = &b2_defau... | ALGO | 0.961969 | 6.771621 |
7bce50cf-88cf-4bfc-a48f-dbde917ab35a | 1exx/xray-1 | 3rd party/nvtt/src/nvimage/ColorBlock.cpp | // This code is in the public domain -- <EMAIL>
#include <nvmath/Box.h>
#include <nvimage/ColorBlock.h>
#include <nvimage/Image.h>
using namespace nv;
namespace {
// Get approximate luminance.
inline static uint colorLuminance(Color32 c)
{
return c.r + c.g + c.b;
}
// Get the euclidean distance between th... | TOOL | 0.903026 | 3.769066 |
f6df501c-291b-4cb4-9541-299954a01d10 | AleBerta311/NumericalSimulation | Code/NewDistributions/random.cpp | /****************************************************************
*****************************************************************
_/ _/ _/_/_/ _/ Numerical Simulation Laboratory
_/_/ _/ _/ _/ Physics Department
_/ _/_/ _/ _/ Universita' degli Studi di Milano
_/ _/ ... | TOOL | 0.944186 | 4.600738 |
720084e7-48d7-4903-8f34-dbba7d9a579d | 1pccx/Homework | homework/src/HeapSort.cpp | // 堆積排序
void heapify(vector<int>& arr, int n, int i) {
int largest = i;
int l = 2 * i + 1;
int r = 2 * i + 2;
if (l < n && arr[l] > arr[largest]) largest = l;
if (r < n && arr[r] > arr[largest]) largest = r;
if (largest != i) {
swap(arr[i], arr[largest]);
heapify(arr, n, larges... | ALGO | 0.999934 | 5.132104 |
f2a4ac93-f135-440b-92f9-db9bb403c9a9 | hpfem/hermes-legacy | hermes2d/examples/euler/forward-step-implicit/main.cpp | #define HERMES_REPORT_INFO
#define HERMES_REPORT_FILE "application.log"
#include "hermes2d.h"
using namespace Teuchos;
using namespace RefinementSelectors;
// This example solves the compressible Euler equations using the JFNK
// method implemented in the NOX package of the Trilinos library.
//
// Equations: Compress... | ALGO | 0.999876 | 4.463456 |
b4ff7010-6dea-461c-b2e4-2d25f7f20916 | NatanGarcias/Competitive-Programming | Codeforces/GYM/4 Estrelas/2015 German Collegiate Programming Contest (GCPC 15) + POI 10-T3 - 100753/E.cpp | #include<bits/stdc++.h>
using namespace std;
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << "{"; for (typename vector<T>::const_iterator vi = v.begin(); vi != v.end(); ++vi) { if (vi != v.begin()) os << ", "; os << *vi; } os << "}"; return os; }
template<typename A, typename B> ostre... | ALGO | 0.999951 | 4.201138 |
959879be-a97c-477b-a2ba-044ca26fb0b3 | codingtest-challenge/Algorithm | dongyeong/baekjoon/2023.10/SteppingStones_22871.cpp | #include <iostream>
#include <queue>
using namespace std;
int calc(int a, int b) {
if (a > b) return 1 + a - b;
else 1 + b - a;
}
int main()
{
int N;
cin >> N;
int* arr = new int[N];
for (int i = 0; i < N; i++) {
cin >> arr[i];
e
}
delete[] arr;
return 0;
} | ALGO | 0.999627 | 3.759312 |
34fe3b99-1302-49e8-be97-c7a1ebb9f65b | lwxwl/CodePractise | C++/03_08.cpp | #include <iostream>
using namespace std;
bool palindrome(char *str)
{
int n = strlen(str);
for (int i = 0; i < n/2; i++) {
if (str[i] != str[n-i-1])
return false;
return true;
}
}
int main()
{
char s1[100];
cin >> s1;
if (palindrome(s1)) {
cout << "yes" << e... | ALGO | 0.999948 | 4.745336 |
adcb903b-0f44-43ad-ac28-f2b4017d62c6 | yoylanta/OS-labs-bsu | Lab4/c++98/receiver.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <Windows.h>
const int msg_len = 20;
const char* sender_exe = "sender.exe";
const char* binary_ext= ".bin";
HANDLE Start_Process(char* args)
{
STARTUPINFO startupinfo;
PROCESS_INFORMATION processinfo;
ZeroMemory(&startupinfo, sizeof(STARTUP... | TOOL | 0.95212 | 3.536852 |
1ad89e96-127b-4da8-9e82-e5e4409fb7c1 | SouravKundu119/LeetCode-Solutions | 17-letter-combinations-of-a-phone-number/17-letter-combinations-of-a-phone-number.cpp | class Solution {
public:
vector<string> letterCombinations(string digits) {
vector<string> ans;
if(digits.length()==0)return ans;
string res="";
int index=0;
string vec[10] = {"", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
helper(ans,digit... | ALGO | 0.999972 | 6.895011 |
9710f001-6d8f-4e8a-aaee-70c169a8c80f | b2389085/src | gnu/llvm/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp | #include "llvm/Transforms/Utils/BypassSlowDivision.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Derive... | ALGO | 0.987014 | 7.944864 |
fbaa66fd-d134-4cfe-87e0-923f8a87b9da | ZainAsif767/Computer-Graphics | LAB03/DinoInvertTiles/dinoInvertTiles.cpp | // Lab3
#include <gl/glut.h>
#include <iostream>
#include <fstream>
#include <math.h>
using std::cout;
using std::fstream;
using std::ios;
const int screenWidth = 650; // width of screen window in pixels
const int screenHeight = 450; // height of screen window in pixels
double rotate_x = 0.5;
void drawPolyLineFile... | TOOL | 0.908008 | 3.991111 |
63ceafdc-19e5-42f6-9732-0ed6b7cde192 | julia-majkowska/Rzeczy-na-uczelnie | licencjat/gen_pruf.cpp | #include<bits/stdc++.h>
using namespace std;
int pruf[1000001];
int zlicz[1000001];
int ojciec[1000001];
vector<int> lista[1000001];
void make_graph(seed, n){
srand(seed);
int zap =1 + rand()%1000001;
int n =3 + rand()%101;
for(int i = 1; i<= n-2; i++){
pruf[i] = 1 + rand()%n;
... | ALGO | 0.992905 | 3.20383 |
0945e7bf-0f67-4900-ae23-52fedb94c358 | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/strmatch/kmp/test/8b163a5e-b3ba-4715-997c-2a46e6968526.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream fin("strmatch.in");
ofstream fout("strmatch.out");
const int nmax = 4000005;
string a, b;
int n, m, pi[nmax];
int main(){
fin >> a >> b;
n = a.size();
m = b.size();
a += '#';
for (int i = 0; i < m; ++i){
a += b[i];
}
... | ALGO | 0.999899 | 3.720602 |
b53d4d87-c46d-4689-9c3a-7b26b4199648 | SLIIT-FacultyOfComputing/tutorial-02b-IT21809224 | tute03.cpp | /*Exercise 3 - Repeatition
Convert the C program given below which calculates the Factorial of a number that you input from the keyboard to a C++ program.
Please Note that the input command in C++ is std::cin. This is a representation of the Keyboard.*/
/*#include <stdio.h>
int main()
{
int no;
long fac;
... | ALGO | 0.999592 | 3.891808 |
3744b4b3-af47-4a3f-8192-4b21bab2c5fb | ishandutta2007/codeforces | izban/normal/1198/C.cpp | #include <bits/stdc++.h>
#ifdef HOME
#define db(x) cerr << #x << " = " << x << endl
#define db3(x, y, z) cerr << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", " << z << ")" << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl
#define dbv(a) ce... | ALGO | 0.999707 | 4.306644 |
c0088492-8a7f-4a4a-a86a-205f856bc017 | Ritikchaurasia4/DSA | LinkedList/node.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int val){ // constructor
data = val;
next = NULL;
}
};
// insert at Head....
void insertAtHead(node* &head , int val){
node* n = new node(val);
n->next = head;
head = n;
}
// Inse... | ALGO | 0.999674 | 3.755131 |
9dc76d01-88ec-468d-b370-6a31a113efa9 | keyvchan/solutions | src/easy/67/main.cpp | #include <algorithm>
#include <string>
class Solution {
public:
std::string addBinary(std::string a, std::string b) {
// create a string view
auto a_view = std::string_view(a);
auto b_view = std::string_view(b);
// from back to front
auto a_it = a_view.rbegin();
auto b_it = b_view.rbegin();
... | ALGO | 0.99991 | 7.174199 |
337c6fb8-3f99-4f24-b904-5ff7e341adb1 | JamelD/COP3363 | Homework4/monty.cpp | /*
Name: Jamel Douglas
Date: 9/6/2018
Section: 7
Assignment: Homework 4
Due Date: 10/21/18
About this project: Monty hall problem
Assumptions: User will enter in a valid door choice when asked if they want to switch
Only numbers (not characters) will be entered by the user
All work below has been performed by Ja... | ALGO | 0.997166 | 6.25546 |
53b6cdb9-23c5-4ddc-a493-4c22dde16bcf | 13662279/vnpy202106 | vnpy/api/nh/generator/md/nh_md_source_switch.cpp | case ONFRONTCONNECTED:
{
this->processFrontConnected(&task);
break;
}
case ONFRONTDISCONNECTED:
{
this->processFrontDisConnected(&task);
break;
}
case ONHEARTBEATWARNING:
{
this->processHeartBeatWarning(&task);
break;
}
case ONRSPERROR:
{
this->processRspError(&task);
break;
}
case ONRTNMARKETDATA:
{
this-... | WEB | 0.939 | 4.576883 |
571a25c6-61f0-4f40-909e-d5de8ee65b85 | rpng/vicon2gt | src/gtsam/MeasBased_ViconPoseTimeoffsetFactor.cpp | #include "MeasBased_ViconPoseTimeoffsetFactor.h"
using namespace std;
using namespace gtsam;
gtsam::Vector MeasBased_ViconPoseTimeoffsetFactor::evaluateError(const JPLNavState &state, const JPLQuaternion &q_BtoI,
const Vector3 &p_BinI, const Vector1 &t_... | ALGO | 0.983048 | 6.882133 |
0e64483a-fcfe-4bdc-bca6-1a868cbeff0f | lucas-campagna/VRFEM | src/Numerical.cpp |
#include <Vector.h>
#include <Element.h>
#include <vector>
#include <cmath>
using namespace std;
double integrate2d(double (*fun)(double,double),Element *domain, int nx, int ny){
/*
Calcula integral da funcao parametro "fun" em um dominio especificado por "domain".
Implementado apenas para triangulos, domain deve... | ALGO | 0.999863 | 5.206527 |
46e78f54-2151-4fc0-a8d6-a1fffc4d2eed | roboeireann/RoboEireannCodeRelease | Src/Modules/Perception/Scanlines/ScanGridProvider.cpp | /**
* The file declares a module that provides the description of a grid for scanning
* the image. The grid resolution adapts to the camera perspective.
* @author Thomas Röfer
*/
#include "ScanGridProvider.h"
#include "Tools/Math/Projection.h"
#include "Tools/Math/Transformation.h"
#include <algorithm>
MAKE_MODUL... | TOOL | 0.874919 | 6.734964 |
eadc2879-6b59-4205-96e5-ae6166156d72 | chongin12/Problem_Solving | scpc2022/round1/A.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
struct node {
ll p,val;
node(ll p, ll val):p(p),val(val){}
};
int main(){
ios::sync_with_stdio(0); cin.tie(0);
int T; cin>>T;
for(int t=1; t<=T; ++t){
int N; cin>>N;
vector<node> v;
vector<node> ori;
f... | ALGO | 0.99972 | 3.846575 |
93b290ee-9656-41c9-9562-a5e942f0b4f6 | 113bommy/LogicalErrorFixCodeT5 | LogicalErrorFix_metric/CodeT5_LineNumber_cpp_gold/Problem_94_CorrectCode_487.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, k;
int a[12];
long long fastpow(long long a, long long b) {
long long sum = 1;
while (b) {
if (b & 1) sum *= a;
a *= a;
b >>= 1;
}
return sum;
}
int main() {
int t;
cin >> t;
while (t--) {
cin >> n >> k;
long long sum = 0;
... | ALGO | 0.999384 | 3.845035 |
08dec00d-9a24-497e-9a88-41a9602af060 | Ank9472/dsa-practise | STL/B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
long long n, q;
cin >> n >> q;
vector<long long> V(n);
// Input array elements
for (int i = 0; i < n; i++) {
cin >> V[i];
}
sort(V.begin(), V.end());
while (q--) {
string S... | ALGO | 0.999916 | 5.205647 |
724ab24e-1cb5-4add-9028-8435a78292a4 | Bitazar/Fourier | main.cpp | #include <MPGL/MPGL.hpp>
#include <iostream>
#include <vector>
#include <memory>
#include <complex>
#include <algorithm>
#include <math.h>
#include <numbers>
#include <FourierImages/Fourier.hpp>
#include <FourierImages/FourierDrawer.hpp>
using namespace std::literals;
class Canva : public mpgl::Drawable2D,
... | TOOL | 0.875272 | 5.296401 |
93db93a7-66ae-47a0-a68e-e136aafb4c0f | Rebellion-OS/packages_inputmethods_LatinIME | native/jni/src/dictionary/utils/trie_map.cpp | #include "dictionary/utils/trie_map.h"
#include "dictionary/utils/dict_file_writing_utils.h"
namespace latinime {
const int TrieMap::INVALID_INDEX = -1;
const int TrieMap::FIELD0_SIZE = 4;
const int TrieMap::FIELD1_SIZE = 3;
const int TrieMap::ENTRY_SIZE = FIELD0_SIZE + FIELD1_SIZE;
const uint32_t TrieMap::VALUE_FLA... | ALGO | 0.963396 | 6.853276 |
55227c19-cac8-4729-ab28-dd844fd82110 | NemuNemuNyanko/algorism_practice | algobook2/EX_5_3_AtcoderTypicalDP_A.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
// vector<vector<long long> > dp(3, vector<long long>(4,0));
// vector<vector<vector<long long> > > dp(3, vector<vector<long long> >(4, vector<long long>(5,0)) );
... | ALGO | 0.999972 | 3.774541 |
0482ec55-7e96-4ac6-823b-31a598f7f8c6 | Hensi200524/SE-MYWORK | module3/19-7/payroll_inheritance2.cpp | //payroll system using with inheritance 2
#include <iostream>
using namespace std;
// Base Class
class Employee
{
protected:
int empID;
string name;
string department;
string joiningDate;
public:
Employee(int id, string n, string dept, string joinDate)
{
empID = i... | TOOL | 0.904341 | 3.793077 |
989eba4f-fbf6-41d4-8436-d091d6d11f89 | freshie9098/Striver_sde_sheet | Day 1: Arrays/Sort an array of 0’s 1’s 2’s.cpp | void sort012(int *nums, int n)
{
int i = 0 , j = 0 , k = n -1;
while(j<=k){
if(nums[j]==1)j++;
else if(nums[j]==2){
swap(nums[j],nums[k--]);
}
else{
swap(nums[j++],nums[i++]);
}
}
}
| ALGO | 0.999954 | 4.805895 |
0719a610-1ecc-47ac-9a2c-f706014fbae0 | Mac-Ho-Do-Khang/MyCpp | 3-month Kit/Week5/dynamicArray.cpp | // https://www.hackerrank.com/challenges/three-month-preparation-kit-dynamic-array/problem?isFullScreen=true&h_l=interview&playlist_slugs%5B%5D=preparation-kits&playlist_slugs%5B%5D=three-month-preparation-kit&playlist_slugs%5B%5D=three-month-week-five
#include <bits/stdc++.h>
using namespace std;
string ltrim(const ... | ALGO | 0.999901 | 5.303628 |
bc2588ef-e863-4cbd-8224-615d13298982 | ThuyHang511/cpp | T12_ToanTuTrongClass/Source.cpp | #include<iostream>
#include<string>
using namespace std;
class SoPhuc {
private:
int thuc, ao;
public:
friend istream& operator >> (istream& in, SoPhuc& a);
friend ostream& operator << (ostream& out, SoPhuc& a);
SoPhuc operator + (SoPhuc a); // cach 1
friend SoPhuc operator - (SoPhuc a, SoPhuc b); // cach 2
// ... | ALGO | 0.999496 | 3.590954 |
417249bc-d953-47e0-b2ad-74d21ec6bc85 | occasumlux/MarkovSolver | eigen3/doc/examples/make_circulant2.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
// [circulant_func]
template<class ArgType>
class circulant_functor {
const ArgType &m_vec;
public:
circulant_functor(const ArgType& arg) : m_vec(arg) {}
const typename ArgType::Scalar& operator() (Index row, Index col) const {
Index index = ... | ALGO | 0.999653 | 5.569832 |
0aab5b0d-e0d6-4238-b14c-92f8e3cd217e | Aazen45v/C-Plus-Plus-Practice | ReversalOfCharacter.cpp | #include <iostream>
#include <string>
using namespace std;
int length(char name[]){
int count = 0;
int i=0;
while(name[i] != '\0'){
count++;
i++;
}
return count;
}
void reverse(char name[]){
int i=0;
int n=length(name);
int j=n-1;
while(i<=j){
swap(name[i],name[j]);
i++;
j--;
}... | ALGO | 0.997885 | 4.388655 |
d159d2d0-1f40-4d3b-9f4f-5f24a54488a7 | mohitoi29/Assessment | 0051-n-queens/0051-n-queens.cpp | class Solution {
private:
// bool fill(int col,int row,vector<string>& board,int n){
// int duprow=row;
// int dupcol=col;
// while(row>=0 && col>=0){
// if(board[row][col]=='Q') return false;
// row--;
// col--;
// }
// row=duprow;
... | ALGO | 0.999864 | 5.684785 |
d389569f-5ad6-4a12-b5ca-32d96b8ae416 | shsaish006/DSA | 88-merge-sorted-array/merge-sorted-array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
for(int j=0,i=m;j<n;j++){
nums1[i]=nums2[j];
i++;
}
sort(nums1.begin(),nums1.end());
}
}; | ALGO | 0.999967 | 5.36491 |
2f0cc693-196e-4993-a1da-13c488e2d1f6 | SoraKotori/KMeans | KMeans/KMeans.cpp | #include <chrono>
#include <iterator>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <functional>
#include <random>
#include <vector>
#include <numeric>
#include <utility>
auto SquareOfDifference = [](auto&& Left, auto&& Right)
{
return (std::forward<decltype(Left)>(Left) - std::forward<decltype(R... | ALGO | 0.999642 | 3.991972 |
40df0210-108f-459f-9584-8982c1b321f3 | prodius7/Trial | arrays_largest_element_efficient_Approach.cpp | #include<bits/stdc++.h>
using namespace std;
//Efficient approach
int getLargest(int arr[], int n)
{
int res=0;
for(int i=0; i<n; i++){
if(arr[i]>arr[res]){
res=i;
}
}
return res;
}
int main(){
int arr[]={5,10,20, 90};
int n= sizeof(arr)/sizeof(arr[0]);
cout<<getLargest(arr, 4);
return 0... | ALGO | 0.999639 | 4.013976 |
2ce28bf1-8831-4385-86e5-b22ee73d379d | Altu-Bitu-5/Altu-Bitu-YangGahyeon | 01_정렬_맵_셋/19636.cpp | #include <iostream>
#include <tuple>
#include <cmath>
using namespace std;
tuple<int, int, int> diet(int w0, int i0, int i, int a, int d, int t) { //요요 시뮬레이션 함수
// w: 몸무게, m: 기초대사량
int w1 = w0, m1 = i0; // 기초대사량 변화 고려 X
int w2 = w0, m2 = i0; // 기초대사량 변화 고려 O
while (d--) {
// 체중 변화 계산: 체중 += 일... | ALGO | 0.999696 | 4.038517 |
cb59328a-bce7-445b-a92d-b216801f2d40 | YC5413/YC | 250602/atari_box_c(2).cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
///==================
/// 共用定義與工具
///==================
// 激活函式:ReLU
static inline float relu(float x) {
return x > 0.0f ? x : 0.0f;
}
// 申請一維浮點陣列
static float* malloc_f(int n) {
float* p = (float*)malloc(sizeof(float) * n);
if ... | ALGO | 0.993314 | 4.04893 |
1c9e0a86-6617-4b67-9af3-4ce239ce016e | PandiKabilesh2006/CS1006T---Data-Structures | Lab 12 - Graph ADT - Adjacency List and Matrix/Adjacency_list.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Graph {
int V;
vector<vector<int>> adj;
public:
Graph(int vertices);
void insertEdge(int u, int v);
void deleteEdge(int u, int v);
void searchEdge(int u, int v);
void displayGraph();
};
// Constructor
Gr... | ALGO | 0.994375 | 6.387283 |
aad5030b-b916-43a9-bf41-2ef989e0e637 | montymi/Capstone | flutter/capstone_m2/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.997966 | 6.76073 |
d4dd3bc2-8ab9-4525-bb21-c4114d3a1082 | dev-sabbir/SolvedProblems | accepted/10678.cpp | #include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
int tCase,nCase;
double a,b,i,j,ans,pi=acos(0.0);
scanf("%d",&tCase);
for(nCase=1;nCase<=tCase;nCase++)
{
scanf("%lf%lf",&i,&j);
a=j/2;
b=i/2;
ans=sqrt((a*a)-(b*b));
ans=2*a*pi*ans;
... | ALGO | 0.999821 | 3.665146 |
6eb38934-1d50-4f55-864b-dd35d964b03a | hirakuuuu/kyopro | ABC/155/e.cpp | #include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define rrep(i, a, n) for(int i = a; i >= n; i--)
#define inr(l, x, r) (l <= x && x < r)
#define ll long long
#define ld long double
// using mint = modint1000000007;
// u... | ALGO | 0.999936 | 5.172534 |
f5886248-3bb0-430a-a14d-9e390bd842ed | BGCoinDev/bgcoin | src/rpc/mining.cpp | #include <bgcoin-build-config.h> // IWYU pragma: keep
#include <chain.h>
#include <chainparams.h>
#include <chainparamsbase.h>
#include <common/system.h>
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <consensus/merkle.h>
#include <consensus/params.h>
#include <consensus/validation.h>
#include... | WEB | 0.98329 | 4.80179 |
97ce0ffc-087d-4c6e-8562-6151ab89b081 | plasmatic1/dmoj-solutions | cpp/cco14p2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 0x3f3f3f3f;
struct ed{
int i, v, w, s; // s = shutdown cost
};
struct edd{
int v, w;
bool operator<(const edd &o) const{
return w > o.w;
}
};
struct shut{
int d, s;
shut(int d0, int s0) : d(d0), s(s0){}
shut() : d((int)I... | ALGO | 0.999618 | 4.479189 |
8d80039a-91e3-4db0-aa4f-7e877bf8c76a | poraodonando/C_plus_plus | Exercicios/77_quadradodiferenca_diferencaquadrado.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main (){
float num_a, num_b, qdf, ddq;
printf("Digite o valor A: ");
scanf("%f", &num_a);
printf("Digite o valor B: ");
scanf("%f", &num_b);
qdf = pow((num_a - num_b), 2 ) ;
ddq = pow(num_a,2) - pow(num_b,2); //num_b^2;
printf("Quadrado da d... | ALGO | 0.999208 | 3.934155 |
73ecf7b7-2a42-4e9e-8183-fbb06213da34 | danielyc0304/Code | HackerEarth/Data Structures/Arrays/1-D/Bela Jornada/bela_jornada.cpp | /*
Problem:
https://www.hackerearth.com/practice/data-structures/arrays/1-d/practice-problems/algorithm/beautiful-journey-1/
Title: Bela Jornada
Time: 2024-04-23 14:40:25 Add
*/
#include <iostream>
using namespace std;
int main() {
int N;
scanf("%d", &N);
int A[N + 1];
A[0] = 0;
for (int i = 1; i... | ALGO | 0.999657 | 3.932445 |
cf70b629-5d31-4794-84c7-faf14bd74a53 | PrathamSahani/LeetCode | Easy/Maximum Diamonds/maximum-diamonds.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
long long maxDiamonds(int A[], int N, int K) { priority_queue<int>pq;
for(int i=0;i<N;i++){
pq.push(A[i]);
}
long long int ans=0;
... | ALGO | 0.999773 | 5.405234 |
b02ebf9a-fb81-4127-98f3-56e6cb1d63a9 | anupammaurya6767/DSA_ | 0104-maximum-depth-of-binary-tree/0104-maximum-depth-of-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999519 | 6.337663 |
8a6e25f8-bf33-4452-a59a-51220c29fb33 | sKAR04/CP-Practice | Codeforces/602/602B.cpp | /*
#####################################################
# I will win.. maybe not immediately but definitely #
#####################################################
*/
#include <bits/stdc++.h>
using namespace std;
//Optimizations
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC ta... | ALGO | 0.999929 | 4.168084 |
eb7dc203-0b43-4f31-bfac-7448e91fc4e1 | PavanRaj26/LeetCode | July2021/AllTopologicalSorts.cpp | vector<int> adj[V];
void recur(int V,vector<int> &inDeg, vector<int> &res) {
bool allVis = false;
for (int i = 0; i < V; i++) {
if (!vis[i] && inDeg[i] == 0) {
allVis = true;
res.push_back(i);
vector<int>::iterator it = adj[i].begin();
for (; it!=adj[i].end(); it++) {
int x = (*it);
inDeg[x... | ALGO | 0.999948 | 4.910499 |
1a19dc07-a925-4df0-a2d9-2f44f14210a5 | hriteshMaikap/Operating-Systems | Scheduling Algorithms/priority-preemptive.cpp | #include <bits/stdc++.h>
using namespace std;
typedef struct {
string processId;
int at;
int bt;
int ct = -1;
int tat = -1;
int wt = -1;
int priority;
} processes;
int main() {
int numProcess;
cout << "Enter the number of processes: ";
cin >> numProcess;
vector<processes> p... | ALGO | 0.999992 | 4.963579 |
2f8cab27-9e18-4cd6-a2df-1818e38f025d | sinancimen/multiagent_pathfinding | multiagent_pathfinding_ui/coopAStar.cpp | #include "mainwindow.h"
#include "helpers.h"
std::vector<int> MainWindow::coopAStar_Solver(robot* robot_considered)
{
map* MapClone = new map(Map);
std::set<tile*> neighbour_tiles = MapClone->getGraph().out_neighbors(robot_considered->getTile());
std::vector<int> results;
for (tile* Tile : neighbo... | ALGO | 0.999586 | 3.324102 |
d453871f-3e6a-4b23-807b-1b1534d07a80 | adithya-adee/DSA | Striver/Binary Search/easy/find-upper-bound.cpp |
class Solution
{
public:
pair<int, int> getFloorAndCeil(vector<int> &nums, int target)
{
int n = nums.size();
int left = 0, right = n - 1;
int floor = -1, ceil = -1;
while (left <= right)
{
int mid = left + (right - left) / 2;
if (nums[mid] == t... | ALGO | 0.999926 | 6.454592 |
35dbfc3d-8ae1-4237-bdc6-9bafeec76a85 | JUANFT11/Programacion-Paralela-2020-0 | Laboratorio_05/prog07.1_MatrizxVector/src/MatrizxVector_Multi.cpp | /*
* MatrizxVector_Multi.cpp
*
* Created on: 28 ene. 2020
* Author: laboratorio-fisi
*/
/* File: mpi_mat_vect_mult.c
*
* Purpose: Implement parallel matrix-vector multiplication using
* one-dimensional arrays to store the vectors and the
* matrix. Vectors use block distribution... | ALGO | 0.999617 | 4.35734 |
f314df4d-5354-45c2-a91a-9cbd1b5941af | Orangensaft/aocpp | 2021/day2.cpp | //
// Created by NicolasMeisberger on 02.12.2021.
//
#include <string>
#include <vector>
#include <iostream>
#include "day2.h"
#include "../utils.h"
using namespace std;
struct position{
int horizontal;
int depth;
int aim;
};
void update_position(string *line, position *p){
vector<string> parts = sp... | ALGO | 0.966095 | 5.392468 |
5552881c-4b98-4edc-ab02-c6ebdb67a2a6 | Rorna/Algorithm | BOJ/가장 긴 감소하는 부분 수열.cpp | // BOJ 11722
// https://www.acmicpc.net/problem/11722
#include <bits/stdc++.h>
using namespace std;
int d[1001]; //a[i]에서 끝나는 가장 긴 감소하는 부분 수열의 길이
int a[1001];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin>>n;
for(int i=1; i<=n; i++) cin>>a[i];
for(int i=1; i<=n; i++)
{
... | ALGO | 0.999959 | 4.678339 |
6f3c68fc-d7c6-431f-b62e-45af9d73648b | chinmayajha/Code | normalcp.cpp | #include "bits/stdc++.h"
using namespace std;
#define int long long
// #include "debug.hpp"
signed main() {
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int t = 1;
// cin >> t;
while (t--) {
int n; cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) cin >> a... | ALGO | 0.998994 | 4.047392 |
33e5c710-c3c2-49da-91be-dd77673c5d52 | hylTianMeng/PreCode | c++/codeforces/CF776div3/A.cpp | #include<bits/stdc++.h>
#define mset(a,b) memset((a),(b),sizeof((a)))
#define rep(i,l,r) for(int i=(l);i<=(r);i++)
#define dec(i,l,r) for(int i=(r);i>=(l);i--)
#define inc(a,b) (((a)+(b))>=mod?(a)+(b)-mod:(a)+(b))
#define sub(a,b) (((a)-(b))<0?(a)-(b)+mod:(a)-(b))
#define mul(a,b) 1ll*(a)*(b)%mod
#define sgn(a) (((a)&1... | ALGO | 0.999911 | 3.920524 |
4e534e05-0d1a-4bdf-ac87-542f9e47eb15 | Cadiducho/UGR-Metodologia-Programacion | Practica6/Skyline/src/Skyline.cpp | #include "Skyline.h"
#include <iostream>
using namespace std;
Skyline::Skyline() {
this->PideMemoria(0);
}
Skyline::Skyline(const Skyline& otra) {
this->PideMemoria(otra.num);
this->Copia(otra);
}
Skyline::Skyline(double & abcisaInicio, double & abcisaFinal, double & altura) {
if (altura > 0) {
this->PideMemo... | ALGO | 0.938706 | 3.853091 |
7de23480-a11f-4af5-be2c-7ceb4cdf8002 | tudzct/hw_ltnc | week5/bai5.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
int main() {
int q; cin >> q;
set<int> s;
while(q--){
int x, y;
cin >> y >> x;
if(y == 1) s.insert(x);
else if(y == 2){
... | ALGO | 0.999921 | 4.974248 |
31c42f95-a6b8-4f3b-be24-c1820f2cc50c | nikhilishwarkulal/graph_analytics | example/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998831 | 6.761023 |
d0006faf-2b5d-4e43-9c57-7e52f2678cc1 | TheKarthur/Linguagem-C | Ponteiros/Calcular Frequência ou Período.cpp | #include <stdio.h>
#include <stdlib.h>
#define cls system("cls")
int sinal(float * frequencia, float * periodo, int * contador)
{
*contador=0;
if(*frequencia==0){
*contador+=1;
}
if(*periodo==0){
*contador+=1;
}
if(*contador!=1){
return -1;
}
if(*frequencia==... | ALGO | 0.937281 | 3.431487 |
c2c48196-ca26-4d8a-8c19-e16f6b202fab | aleafall/DS-A | leetcode/lc0008.cpp | //
// Created by aleafall on 16-10-23.
//
#include <iostream>
#include <string>
using namespace std;
class Solution {
public:
int myAtoi(string str) {
if (str.empty()) {
return 0;
}
long long ans=0;
int flag=1;
while (str.size()&&str[0]==' ') {
str.... | ALGO | 0.991691 | 4.138545 |
3b60d325-b7b0-4efe-be15-3fb9080ddd33 | hi2p-perim/lightmetrica-v2 | plugin/renderer_inversemap/renderer_invmap_mmltinvmapfixed.cpp | #include "mltutils.h"
#include "multiplexeddensity.h"
LM_NAMESPACE_BEGIN
enum class MMLTInvmapFixed_Strategy : int
{
// Path space mutations
BidirFixed = (int)(MLTStrategy::BidirFixed),
Bidir = (int)(MLTStrategy::Bidir),
Lens = (int)(MLTStrategy::Lens),
Caustic = ... | ALGO | 0.968436 | 5.748126 |
05fd9c65-4a1a-47ef-b845-5482d2ef70ae | Mayuri13/My_Leetcode_Solution | 0932-monotonic-array/0932-monotonic-array.cpp | class Solution {
public:
bool desc(vector<int>&nums){
for(int i=1; i<nums.size(); i++){
if(nums[i]>nums[i-1]) return false;
}
return true;
}
bool incr(vector<int>&nums){
for(int i=1; i<nums.size(); i++){
if(nums[i]<nums[i-1]) return false;
}
return true;
... | ALGO | 0.999973 | 6.217325 |
1b050883-30d3-430f-9253-f142423f7c92 | Anxi77/.Algorithms | BaaarkingDog/0x13/solutions/2143.cpp | // Authored by : qhsl1213
// Co-authored by : -
// http://boj.kr/2b3bddae4e384ecb94bcd3437f3514ba
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll arr1[1001], arr2[1001];
ll dp1[1001], dp2[1001];
vector<ll> vec1, vec2;
ll cnt;
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
int T, N, ... | ALGO | 0.999978 | 4.380314 |
fdf6e19b-a55a-4083-bf88-3bc0496f12bc | CamronStaley/LibraryManager | bookContainer.cpp | #include "bookContainer.h"
#include <iostream>
#include "book.h"
//---------------------------------------------------------------------------
//Default constructor
//creates empty tree
BookContainer::BookContainer() {
root = nullptr;
}
//---------------------------------------------------------------------------... | TOOL | 0.995763 | 4.04946 |
a920d160-9f87-4921-9ee3-dd7eba506922 | shivamkasaudhan/150-Days-of-Code | linearsearchin2darray.cpp | #include <iostream>
using namespace std;
bool ispresent(int arr[][4],int target, int n, int m){
for(int n=0;n<3;n++){
for (int m = 0; m < 4; m++)
{
if(arr[n][m]==target){
cout<<n<<" "<<m<<endl;
return true;
}
}
}
return... | ALGO | 0.997909 | 4.515299 |
81c555cc-154b-4da2-93b6-784a814c1ce3 | ishandutta2007/codeforces | hollwoq_pelw/normal/1419/E.cpp | /*
/+==================================================+\
//+--------------------------------------------------+\\
|.|\\...>>>>>>> Hollwo_Pelw(ass) 's code <<<<<<<...//|.|
\\+--------------------------------------------------+//
\+==================================================+/
*/
#include <bits/stdc++.h>
using ... | ALGO | 0.999907 | 4.518472 |
670604af-7c26-4fd1-a69a-34e09f350f79 | Farhad-Rahimi-KLIE/Apna-Collage-DSA-in-C-- | 25 STL (Standard Template Library)/Stack.cpp | #include<iostream>
#include<stack>
using namespace std;
// Stack - last in first out
int main()
{
stack<int> s;
s.push(1);
s.push(2);
s.push(3);
// Deleting top element
s.pop();
// Accessing the top element
cout << s.top();
// while (!s.empty())
// {
// cout<<s... | ALGO | 0.961046 | 3.870714 |
c4414174-d05e-4347-a21c-8b2e9d8ecbf5 | Rajan-sust/DataStructure | BST/main.cpp | #include <iostream>
template<typename T>
struct node{
T data;
node *left, *right;
node(T data): data(data), left(nullptr), right(nullptr){}
};
template<typename T>
class tree{
private:
node<T> *root;
void preorder(node<T> *current){
if(current == nullptr)
return;
std::cout<<current->data<<'\n';
preor... | ALGO | 0.999932 | 5.06523 |
26b4c3c7-29b4-4d44-a24e-110eb7247d65 | sharan1/Parallel_Computing_Codes | Assignment4/4-6/4-6.cpp | /*
PC Assignment 4 Q6
Author: Sharan Girdhani(800960333)
Associated Plots: plot46_1.png in the plots folder
Associated Data: out46_1.dat in the data folder
The plots generated can be a bit confusing. Please refer to the data file in case needed.
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#incl... | ALGO | 0.999853 | 4.458047 |
f70ce981-5196-4277-93c0-74b7a8cfcd95 | armanhossen-dev/AlgorithmsLabTask_CSE214 | Day1/strings/string10.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> getAllSubstrings(const string& s) {
vector<string> result;
int n = s.length();
for (int len = 1; len <= n; ++len) {
for (int i = 0; i <= n - len; ++i) {
result.push_back(s.substr(i, len));
... | ALGO | 0.999678 | 5.361552 |
51879795-7237-4b65-994f-3dc25e57d8cf | MakinoRuki/Codeforces | R898/1873H.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <random>
#include <ctime>
#define N 200002
#define M 100
#define eps 1e-7
using namespace std;
typedef long long ll;
const ll ... | ALGO | 0.999961 | 4.504475 |
41e45ad9-28c5-4839-be6e-f8dd5ba00293 | gregorburger/SAGA-GIS | src/saga_core/saga_api/mat_spline.cpp | //---------------------------------------------------------
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
#include "mat_tool... | TOOL | 0.991023 | 4.475334 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.