uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ab56cf9f-9d8e-4e29-85fe-8f45bb45d183 | faa678/coding | leetcode/e-m-h/easy/easy122.cpp | /*
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times).
Note: You may not engage in multiple transactions at the same tim... | ALGO | 0.999662 | 5.856095 |
f794e657-488c-49fc-a1e6-eca9e3ced50e | anshuman-dwivedi/leetcode-problem | 0044-wildcard-matching/0044-wildcard-matching.cpp | class Solution {
public:
bool isMatch(string s, string p) {
int m=s.length();
int n=p.length();
vector<vector<bool>>dp(n+1,vector<bool>(m+1,false));
dp[0][0]=true;
for(int j=1;j<=m;j++)
dp[0][j]=0;
for (int i=1;i<=n;i++)
{ bool flag=true;
for(i... | ALGO | 0.999958 | 5.122968 |
1afb9837-e925-46ad-8216-65c0d3ce13fe | manikanta2901/ubuntu | .history/random/answer_20210413113731.cpp | #include<stdio.h>
int main(){
int a[2][2], b[2][2], c[2][2], i, j;
int m1, m2, m3, m4 , m5, m6, m7;
printf("Enter the 4 elements of first matrix: ");
for(i = 0;i < 2; i++)
for(j = 0;j < 2; j++)
scanf("%d", &a[i][j]);
printf("Enter the 4 elements of second matrix: ");
for(i = 0; i < 2; i++)
... | ALGO | 0.999965 | 3.732565 |
2e0bfcc3-4fa6-4ec9-8a6e-a8d0f9eb56d8 | Spark-Devices/android_device_xiaomi_ginkgo | gps/utils/LocHeap.cpp | #include <LocHeap.h>
namespace loc_util {
class LocHeapNode {
friend class LocHeap;
// size of of the subtree, excluding self, 1 if no subtree
int mSize;
LocHeapNode* mLeft;
LocHeapNode* mRight;
LocRankable* mData;
public:
inline LocHeapNode(LocRankable& data) :
mSize(1), mLeft(NU... | ALGO | 0.998238 | 6.593742 |
aa921e3a-85f2-485a-9c33-96ce94a0d4f7 | 1184022880com/epibole | 10_(10.27)决策树/Assignment2/opencv-master/modules/dnn/src/tensorflow/tf_importer.cpp | /*
Implementation of Tensorflow models parser
*/
#include "../precomp.hpp"
#include <opencv2/core/utils/logger.defines.hpp>
#include <opencv2/dnn/shape_utils.hpp>
#undef CV_LOG_STRIP_LEVEL
#define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG + 1
#include <opencv2/core/utils/logger.hpp>
#ifdef HAVE_PROTOBUF
#include "tf_io.... | TOOL | 0.886916 | 6.66399 |
73a9ad92-c299-4587-90d4-ae3fb01c595b | Atipat-CMU/261453-Digital-Image-Processing-CA1 | tests/ca2/ca2.cpp | #include "../../include/dip.h"
using namespace std;
using namespace dip;
int eq_linear1(int x){
return 2*x;
}
int eq_equalize(int x, int Dmax){
return x*(255.0/Dmax);
}
int eq_offsetup(int x, int Dmax){
return x+(255-Dmax);
}
int eq_inverse(int x, int Dmax){
return Dmax-x;
}
int eq_boostup(int x, ... | ALGO | 0.897558 | 3.967981 |
361989f4-961d-4282-b78c-875cabc0e620 | yingling-group/lammps-mspin | examples/COUPLE/lammps_spparks/lmpspk.cpp | // lmpspk = umbrella driver to couple LAMMPS + SPPARKS
// for a strain-induced grain growth model
// Syntax: lmpspk Niter Ndelta Sfactor in.spparks
// Niter = # of outer iterations
// Ndelta = time to run MC in each iteration
// Sfactor = multiplier on strain effect
// in.sppar... | TOOL | 0.998534 | 5.376282 |
e952fe1a-fc9e-4532-bd4f-16370118a5f6 | sulav063/3rd-Sem-23081003 | Lab Reports NM/Lab 1/secantmethod.cpp | /*Write a program to solve non-linear equations using the Secant method. Your program should
read an initial guess from keyboard and display the followings if the solution is obtained:
a. Estimated root of the equation
b. Functional value at calculated root
c. Required number of iterations
*/
#include <iostream>
#incl... | ALGO | 0.999987 | 4.569449 |
9107c68e-59af-4092-8976-71e32f6dd4eb | 1417265678/wheeltec | src/navigation-melodic/global_planner/src/dijkstra.cpp | #include<global_planner/dijkstra.h>
#include <algorithm>
namespace global_planner {
DijkstraExpansion::DijkstraExpansion(PotentialCalculator* p_calc, int nx, int ny) :
Expander(p_calc, nx, ny), pending_(NULL), precise_(false) {
// priority buffers
buffer1_ = new int[PRIORITYBUFSIZE];
buffer2_ = new... | ALGO | 0.999856 | 5.773032 |
f6588e8b-76d1-4995-a788-3c399f800723 | Sunkaidao/PX4_SENSOR_1 | libraries/AC_AttitudeControl/ControlMonitor.cpp | #include "AC_AttitudeControl.h"
#include <AP_HAL/AP_HAL.h>
#include <AP_Math/AP_Math.h>
/*
code to monitor and report on the rate controllers, allowing for
notification of controller oscillation
*/
/*
update a RMS estimate of controller state
*/
void AC_AttitudeControl::control_monitor_filter_pid(float value,... | TOOL | 0.901805 | 5.197706 |
ccf0fb54-e37d-41cb-b993-57fcf33ca37a | HustDsy/LeetCode | 657. 机器人能否返回原点/657. 机器人能否返回原点/main.cpp | #include <iostream>
#include<string>
using namespace std;
class Solution {
public:
bool judgeCircle(string moves) {
int x=0;
int y=0;
for(int i=0;i<moves.length();i++){
char num=moves[i];
switch (num) {
case 'L':
y=y-1;
... | ALGO | 0.999853 | 5.316181 |
03713eaf-0c68-4de5-ba68-d1e99bfe03e8 | joaopa24/exerciciosAlg | RegistroSemana/q5.cpp | #include <iostream>
using namespace std;
struct kid {
string name;
string gift;
int goods;
int bads;
int dif;
};
int main(){
int n;
cin>>n;
kid v[n];
for(int i=0; i<n; i++){
cin>>v[i].name>>v[i].gift>>v[i].goods>>v[i].bads;
}
for(int i=0; i<n; i++){
... | ALGO | 0.997656 | 3.12184 |
af497f5f-f05c-45cd-b245-026ba381394a | Ph0en1xGSeek/ACM | LeetCode/sword2/037.cpp | class Solution {
public:
vector<int> asteroidCollision(vector<int>& asteroids) {
int size = asteroids.size();
vector<int> ans;
if (size == 0) {
return ans;
}
int pos = 0;
for (pos = 0; pos < size; ++pos) {
if (asteroids[pos] < 0) {
... | ALGO | 0.999984 | 5.845329 |
f3b8512b-1587-42bb-877c-d21e2f703d3b | helloobaby/llvm_msvc | llvm/tools/llvm-readtapi/llvm-readtapi.cpp | using namespace llvm;
using namespace MachO;
using namespace object;
#if !defined(PATH_MAX)
#define PATH_MAX 1024
#endif
namespace {
using namespace llvm::opt;
enum ID {
OPT_INVALID = 0, // This is not an option ID.
#define OPTION(...) LLVM_MAKE_OPT_ID(__VA_ARGS__),
#include "TapiOpts.inc"
#undef OPTION
};
#define... | TOOL | 0.946331 | 7.610412 |
b31911a9-c24b-421a-9592-dc2785e5f7bf | Mohit-Arya1211/Data-Structure-and-Algorithm | Linked List/LinkedList.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(int data){
this -> data = data;
this -> next = NULL;
}
};
void print(Node *head){
Node *temp = head;
while(temp != NULL){
cout<< temp -> data;
temp = temp -> next;
... | ALGO | 0.99889 | 4.503036 |
3d926387-8b31-4c8e-8f61-74dc024ac373 | XiangyangGouUNSW/TriangleCounting | STC_code/common_structure/count_join.cpp | #include<iostream>
#include<string>
#include<vector>
#include<map>
#include <math.h>
#include<algorithm>
using namespace std;
#ifndef B
#define B
template<typename T>
int count_join(vector<T> &s, vector<T> &d)
{
if (s.empty() || d.empty())
return 0;
int sum = 0;
if (s.size() > d.size())
{
std::sort(d.begin()... | ALGO | 0.999812 | 3.876746 |
51af22b6-641d-4c2d-b856-20ad12b3fc67 | God-father1/C-CC- | Array/circulararray.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
vector<int> a(n);
for(auto &it: a){
cin>>it;
}
rotate(a.begin(),a.end()-1,a.end());
for(int i=0;i<n;i++){
cout<<a[i]<<" ";
}
cout<<endl;
}
ret... | ALGO | 0.999729 | 4.041216 |
c672c447-a6ba-4a67-9a49-2268b46a48ab | iamxym/os-workbench | abstract-machine/apps/fceux/src/utils/md5.cpp | //Modified October 3, 2003, to remove testing code, and add include of "types.h".
//Added simple MD5 to ASCII string conversion function.
// -Xodnizel
#include "../types.h"
#include "md5.h"
#define GET_UINT32(n,b,i) \
{ \
(n) = ( (uint32) (b)[(i) + 3] << 24 ) \
| ( (uint32)... | ALGO | 0.894493 | 6.362564 |
c00ed76d-2d45-461e-a15e-b7c0be476d67 | Furqan-10/CS-88 | PF lab/Week 6/task2.cpp | #include<iostream>
using namespace std;
int parityAnalysis(int number);
main() {
int number;
cout<<"Enter a 3-digit number: ";
cin>> number;
int a = parityAnalysis(number);
cout<<a;
}
int parityAnalysis(int number){
int dig1,dig2,dig3,sum;
dig1= number%10;
number= number/10;
dig2= number%10;
num... | ALGO | 0.999719 | 3.790867 |
7669ff7f-67f4-4798-86fc-50f62fc12f87 | ishandutta2007/codeforces | cz_xuyixuan/normal/936/A.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
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 <typename T> void write(T x) {
if ... | ALGO | 0.999805 | 3.351129 |
0ae12f29-dcdf-4281-a020-0343214fc314 | yinsumirage/coding-daily | My New Code/06-2023summer/03-practice-mofan-8.20/p1447-energy-collect.cpp | #include<iostream>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 1e6 + 5;
int n,m,sum[N],cnt,phi[N],pri[N];
bool isnp[N];
inline ll read(){//read和cin不能同时处理字符
ll x=0,f=1;
char c=getchar();
while(c>'9'||c<'0'){
if(c=='-')f=-1;
c=getchar();
}
... | ALGO | 0.999987 | 3.803096 |
6925756f-f3c2-44fe-8d75-b1bb6652ff0e | Kashyap062004/GFG-POTD | December2024/11thDecember2024.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void mergeArrays(vector<int>& a, vector<int>& b) {
int i=a.size()-1,j=0;
while(i>=0 && j<b.size()){
if(a[i]>b[j]){
swap(a[i],b[j]);
i--;
... | ALGO | 0.999902 | 5.962321 |
a7bacf46-d83b-4968-8512-6ed117882ccc | ZainWajid775/DSA-Lab | tempCodeRunnerFile.cpp | #include <iostream>
using namespace std;
// Node class
class Node {
public:
int data;
int height;
Node* left;
Node* right;
Node(int val) : data(val), height(1), left(nullptr), right(nullptr) {}
};
// AVL Tree class
class AVLTree {
private:
// Get the height of a node
int getHeight(Node* n... | ALGO | 0.999935 | 6.470572 |
9cac5b62-7c0e-493f-96c4-01003170f100 | next-step-for-interview-prep/Daily-leetcode-problem_with_detailed_solutions | 160-8th_June-Continuous_subarray_sum/code.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
bool checkSubarraySum(std::vector<int>& numbers, int divisor) {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int currentSum = numbers[0];
int length = numbers... | ALGO | 0.998917 | 4.456086 |
d99ffec6-2652-4426-90e1-e20dda2c268f | wbzhang233/interviews_2020_fall | 3-pinduoduo/bagProblem.cpp | //
// Created by wbzhang on 2020/8/5.
//
#include <iostream>
#include <cstdio>
int max(int a, int b)//取最大值函数
{
return a > b ? a : b;
}
struct Thing
{
int w;
int v;
}list[101];
int dp[101][1001];
int main()
{
int s, n;//背包容量和物品总数
while (scanf("%d%d", &s, &n) != EOF)
{
for (int i = 1; ... | ALGO | 0.999885 | 4.144147 |
c143e3dc-e4be-4774-b2f6-65e9bf0f760f | ArdxWe/leetcode | medium/207-Course-Schedule.cpp | /* There are a total of numCourses courses you have to take, labeled from 0 to
* numCourses - 1. You are given an array prerequisites where prerequisites[i] =
* [ai, bi] indicates that you must take course bi first if you want to take
* course ai. For example, the pair [0, 1], indicates that to take course 0 you
* ... | ALGO | 0.994775 | 6.801408 |
d817420d-c958-42aa-a105-c6ba9c9ce23c | Shubh08am/Leetcode_DSA_Problems-Solutions | Subsets.cpp | //1st-
class Solution {
private:
void find_subset(int start_index,vector<int>&individual_subset,vector<vector<int>>&ans,vector<int>&nums){
//base case
if(start_index == nums.size()){
// we push individual_subset to our ans
// ex-> [1] pushed to ans
/... | ALGO | 0.999942 | 6.255758 |
9c7b17be-99fa-4071-96e0-50fc9650221c | raincross7/code-similarity | codes/train_code/problem227/problem227_402.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
long long a,b,i=1,num=0;
cin>>a>>b;
if(a<b)swap(a,b);
while(num<a*b){
num=a*i;
if(num%b==0){
cout<<num;
break;
}
i++;
}
return 0;
}
| ALGO | 0.999811 | 3.316194 |
02a897a1-253e-4c67-b8d1-bb07b8253cfb | harshalzilpe/Marvellous-LogicBuilding | program395.cpp | #include<iostream>
using namespace std;
double AdditionD(double no1, double no2)
{
double Ans = 0.0;
Ans = no1 + no2;
return Ans;
}
int main()
{
double dRet = 0.0;
dRet = AdditionD(11.7,10.2);
cout<<"Addition is : "<<dRet<<"\n";
return 0;
} | TOOL | 0.983337 | 4.208675 |
2a4886cf-16bb-41ae-9286-4734245ffd6f | Hadeer-Elsaeed/C-Plus-Plus | graph/topological_sort.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int n, m; // For number of Vertices (V) and number of edges (E)
vector<vector<int>> G;
vector<bool> visited;
vector<int> ans;
void dfs(int v) {
visited[v] = true;
for (int u : G[v]) {
if (!visited[u])
dfs(u);
... | ALGO | 0.999997 | 5.434087 |
290debd1-bd02-47e9-8914-3e53b269af3b | andyhebear/HappyQ-WowServer | Demo.Mmose.Misc/Zip/Cryptopp552/shark.cpp | // shark.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#ifdef WORD64_AVAILABLE
#include "shark.h"
#include "misc.h"
#include "modes.h"
#include "gf256.h"
NAMESPACE_BEGIN(CryptoPP)
static word64 SHARKTransform(word64 a)
{
static const byte iG[8][8] = {
0xe7, 0x30, 0x90, 0x85, 0xd0, 0x... | ALGO | 0.997881 | 7.645305 |
b69dac84-82a2-49dc-b995-85396a8dee63 | seyoung-Han-ouo/Baekjoon | 24000 - 24999/24092.cpp | #include <iostream>
using namespace std;
void quick_sort(int p, int r);
void swap(int i, int j);
void isSame();
int partition(int p, int r);
int N, cnt = 0;
int A[10001], B[10001];
// A[p..r] Ѵ.
void quick_sort(int p, int r) {
if (p < r) {
int q = partition(p, r); //
quick_sort(p, q - 1); /... | ALGO | 0.999979 | 4.287598 |
4007df28-1879-4c43-a42a-9caadb6a103e | saadiyaJ/quiz_app | 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.998784 | 6.761023 |
6e3a4e2f-0422-41db-a0a6-15b31fe6fdef | reven86/dreamfarmgdk | Source/third_party/boost_1_58_0/libs/graph/example/implicit_graph.cpp | #include <boost/concept/assert.hpp>
#include <boost/graph/adjacency_iterator.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/graph_concepts.hpp>
#include <boost/graph/properties.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boo... | ALGO | 0.999685 | 5.788437 |
4de0d5bc-358f-4f4e-8bf8-620d0aa47dc6 | VhahahaV/AlgorithmPactice | code/07_July/07-07/luogu_P1757.cpp | //
// Created by VhahahaV on 2024/7/7.
//
#include <bits/stdc++.h>
using namespace std;
int main(){
int m , n;
cin >> m >>n;
vector<vector<pair<int,int>>> parts(101);
for(int i = 1 ; i <= n ;i++){
int w,v,p;
cin>>w >> v >> p;
parts[p].emplace_back(w,v);
}
vector<int> d... | ALGO | 0.999922 | 4.645892 |
e66e418b-c438-491c-ae46-a4490f67a626 | Arshelle9912/Competitive-Programming | graphs/Leetcode_2290.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> dx = {1, 0, -1, 0};
vector<int> dy = {0, -1, 0, 1};
int minimumObstacles(vector<vector<int>>& grid) {
priority_queue<pair<int, pair<int, int>>, vector<pair<int, pair<int, int>>>, greater<pair<int, pair<int, int>>>> pq;
int n = grid.size();
int m = gr... | ALGO | 0.999938 | 5.357977 |
567be248-0354-4566-88a0-0874586e8bee | khayrulz/programming | codeforce/code962c.cpp | #include<bits/stdc++.h>
using namespace std;
long long power(int n)
{
long long sum = 1;
while(n--)
{
sum *= 10;
}
return sum;
}
int findM(long long x, int lev)
{
cout << x << endl;
lev++;
int mn = 100000, k = log10(x)+1;
long long n, dv, m, tmp;
for(int i = 1; i <= k;... | ALGO | 0.999709 | 3.703212 |
ebf5dab2-18c1-4cfb-a0e0-83b886754b42 | Tiphereth-A/CP-lib | test/library-checker-polynomial/exp_of_formal_power_series.mints-s30.poly_nttmod-pntt.test.cpp | #define AUTO_GENERATED
#define PROBLEM "https://judge.yosupo.jp/problem/exp_of_formal_power_series"
#include "../../include/io/fastin.hpp"
#include "../../include/io/fastout.hpp"
#include "../../include/poly/exp_fps.hpp"
using namespace tifa_libs;
CEXP u32 MOD = 998244353;
#include "../../include/math/mint.hpp"
#inc... | ALGO | 0.999212 | 4.430811 |
79af9271-b600-4657-a390-7667044233b7 | yuzhendi/HaizeiOJ | 536.cpp | /*************************************************************************
> File Name: 536.cpp
> Author:
> Mail:
> Created Time: 2020年03月18日 星期三 18时45分49秒
************************************************************************/
#include<iostream>
using namespace std;
int n, m, mmax, ans;
char mmap[105][105];
... | ALGO | 0.999924 | 3.876785 |
d097e4bb-5624-472d-b97f-82185a67e642 | hhuangae/liggghts-src | pair_coul_wolf.cpp | /* ----------------------------------------------------------------------
Contributing author: Yongfeng Zhang (INL), <EMAIL>
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_coul_wolf.h"
#include ... | ALGO | 0.999318 | 6.252485 |
8d8f7d44-e81d-462c-b041-e553591aa38d | mohak-borole/GFG-potd | Difficulty: Hard/Alien Dictionary/alien-dictionary.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class graph {
public:
int V;
list<int> *adj;
// Constructor to initialize the graph
graph(int V) {
this->V = V;
adj = new list<in... | ALGO | 0.999918 | 5.8454 |
1d92f6f2-3506-4d56-b2b0-31a356424068 | anugoyal998/dsa_parteek_narang | Data Structures & Algorithms, Level-up for Coding Interviews/binary_tree/morris_traversal.cpp | #include "bits/stdc++.h"
using namespace std;
class node{
public:
int data;
node* left;
node* right;
node(int d){
data = d;
left = right = NULL;
}
};
vector<int> morris_traversal_inorder(node* root){
vector<int> ans;
node* cur = root;
while(cur){
if(!cur->left)... | ALGO | 0.999994 | 5.340867 |
4cd151a3-e91c-4b93-9ea0-fc2c63cf107c | Labo9527/Learn_In_Sysu | 算法分析与设计/第五次习题集/TeamRanking.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
struct node {
int a;
int b;
node(int c = 0, int d = 0) :a(c), b(d) {};
};
int n;
string book[110];
int distance(string nums) {
int res = 0;
for (int i = 0; i < n; i++) {
int pos[5];
for (int j = 0; j < book[i].le... | ALGO | 0.999975 | 4.906269 |
f1f59947-2c5b-4867-8820-8b181d137293 | Aronyo27/CodeForces | 110A_Nearly_Lucky_Number.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
int count1=0,count2=0;
string line;
cin>>line;
for (int i = 0; i <line.size(); i++)
{
if (line[i]=='7' || line[i]=='4')
{
count1++;
}
else
count2++;
}
if (count1... | ALGO | 0.999833 | 3.28911 |
f1105ec9-9f7e-45a0-be88-c4a79a024e35 | tharanijpt/codechef | DAY_39/FLOORS.cpp | //https://www.codechef.com/problems/FLOORS
#include <iostream>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int chefroom, chefinaroom;
cin >> chefroom >> chefinaroom;
int cheffloor = (chefroom + 9) / 10;
int chefinafloor = (chefinaroom + 9) / 10;
... | ALGO | 0.999745 | 4.828931 |
f435c38e-ac19-4316-b520-41d798689681 | Weirvict/Algorithm_Projects | C++/Proj2/CS4412Pj2Weir.cpp | # include <iostream>
#include <algorithm>
#include <list>
using namespace std;
/**
*
* @author Victoria Weir
* @class CS4412
* @date 9-21-23
* @details Project 2 - Hashing
*
*/
// Forward declarations
class Address; // Encapsulates the street number, street name, city, state, and zip code.
class AreaCode; // R... | ALGO | 0.976474 | 5.769411 |
2487638e-33d3-440e-a99e-c52c10522ab5 | AishwaryaAnand0/DAA | daa que 35.cpp | #include <stdio.h>
#include <stdbool.h>
#define V 4
bool isSafe(int v, int graph[V][V], int color[], int c) {
for (int i = 0; i < V; i++)
if (graph[v][i] && c == color[i]) return false;
return true;
}
bool graphColoringUtil(int graph[V][V], int m, int color[], int v) {
if (v == V) return true;
... | ALGO | 0.999965 | 5.627985 |
75a67550-2d16-4a0a-91b8-a66ccdbb378b | ishandutta2007/codeforces | cqxym/normal/1380/A.cpp | #include<stdio.h>
#define R register int
int pos[1001];
inline void Solve(){
int n,x,l=1,r;
scanf("%d",&n);
r=n;
for(R i=1;i<=n;i++){
scanf("%d",&x);
pos[x]=i;
}
for(R i=n;i!=0;i--){
if(pos[i]==l){
l++;
}else if(pos[i]==r){
r--;
}else{
printf("Yes\n%d %d %d\n",l,pos[i],r);
return;
}
}
pu... | ALGO | 0.999719 | 3.036552 |
e893fd20-01f5-41d3-9e7b-44911b7c7e8d | MohammadJamali/MazeMapping | mazemapper.cpp | #include "mazemapper.h"
vector<Maze> result;
vector<Maze> tiles;
void MazeMapper::solver(Maze maze)
{
if(isComplate(maze)) {
for (int i = 0; i < result.size(); i++)
if(maze == result.at(i))
return;
result.push_back(maze);
return;
}
for (unsigned int i = 0; i < tiles.size(); ++i)... | ALGO | 0.998986 | 5.443897 |
efcb6cd9-8107-4578-953b-4c2e10e1128d | arclab-hku/quadrotor_mpc_ | quadrotor_mpc/model/mpc_test.cpp | #include <math.h>
#include <acado_code_generation.hpp>
#include <acado_gnuplot.hpp>
#include <memory>
#include <acado_optimal_control.hpp>
USING_NAMESPACE_ACADO
int main(int argc, char * const argv[ ])
{
const bool CODE_GEN = true;
//
// Variables
//
DifferentialState p_x, p_y, p_z;
DifferentialState ... | ALGO | 0.99941 | 6.264718 |
9c5e7bc3-1724-48ad-a6a0-2b3bb15d0a32 | senoa95/turtle_drive | src/matlab_lane_detector_ROS/simulink_lane_keeping/estimate_lane_center_grt_rtw/estimate_lane_center.cpp | #include "estimate_lane_center.h"
#include "estimate_lane_center_private.h"
/* Model step function */
void estimate_lane_centerModelClass::step()
{
/* (no output/update code required) */
}
/* Model initialize function */
void estimate_lane_centerModelClass::initialize()
{
/* (no initialization code required) */
}... | ALGO | 0.993247 | 6.454839 |
14e8535f-ff82-4dd0-a48a-a87888388e81 | Shivani123-max-droid/DSA | 26-remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
if(nums.size()==0)
return 0;
int count=1;
for(int i=1;i<nums.size();i++){
if(nums[i]!=nums[i-1]){
nums[count]=nums[i];
count++;
}
}
return count;... | ALGO | 0.999947 | 6.142004 |
65521359-6764-47f7-92c9-5b0586c524f5 | Jackarain/avpn | third_party/boost/libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp | #include <iostream>
#include <map>
#include <string>
#include <fstream>
#ifndef M_PI //not there on windows
#define M_PI 3.1415927 //...
#endif
#include <boost/numeric/odeint.hpp>
using namespace std;
using namespace boost::numeric::odeint;
//[ two_dimensional_phase_lattice_definition
typedef boost::numeric::ublas:... | ALGO | 0.997841 | 5.227736 |
6381a560-e3c5-49b9-8e58-dded5bbb8c41 | MrMagnifico/pixel-art-upscaling | framework/third_party/eigen-3.4.0/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.96857 | 4.156673 |
e34bfecb-b689-40a0-9944-4762b264d5f7 | Superm4n97/competetive-programming | Codeforces vol 04/1405A.cpp | #include<bits/stdc++.h>
#define show(x) cout << #x << " : " << x << endl
#define ll long long int
using namespace std;
int main()
{
ll tc;
cin >> tc;
while(tc--){
ll n;
cin >> n;
vector < ll > v;
for (int i=0 ; i<n ; i++){
ll a;
... | ALGO | 0.999729 | 4.168955 |
87690f3f-5ac6-4e88-ba09-35c9419db55d | Sumanyu301/practise_Codes | 100_starter_programs/27.cpp | // Description
// You are given a number, stored in a variable with the name num
// Find the sum of all even numbers greater than zero, and less than or equal to the value stored in num
// For example, if the value stored in num = 5, then all the even numbers smaller than or equal to 5, and greater than zero are
// 2
/... | ALGO | 0.999884 | 5.718345 |
7d78b55a-7ae7-496d-89dd-ab21525b2bdb | NotTahaAli/Programming-Fundamentals-Assignments | Assignment 3/23L-0954_problem_6.cpp | #include <iostream>
using namespace std;
int main() {
int rows = 0;
cout << "Enter Rows: ";
cin >> rows;
for (int i = rows; i > 0; i--)
{
char c = 'A';
for (int j = 0; j < i; j++)
{
cout << c << " ";
c++;
}
for (int j = 0; j < 2*(rows... | ALGO | 0.999275 | 3.964983 |
7b64584d-6a26-49b1-93b3-4c88b9b7c83c | kalin11/itmo.algorithms | second_block/Yandex/Shop.cpp | #include <iostream>
#include <algorithm>
int main(){
int n,k;
std::cin >> n >> k;
int a[n];
int ans = 0;
for (int i = 0; i < n; i++){
std::cin >> a[i];
}
std::sort(a, a + n, std::greater_equal<>());
for (int i = 0; i < n; i++){
if ((i + 1) % k != 0) ans += a[i];
}
... | ALGO | 0.999986 | 3.892457 |
3ca793d5-824e-4786-afdc-89d8c0c6392d | EAirPeter/2017Fall-Algo | hw1/p1.cpp | #include <cstring>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
size_t row, col;
vector<string> grd; // the original input
vector<pair<size_t, size_t>> bla; // the coordinate of black grids
vector<pair<size_t, size_t>> whi; // the coordinate of wh... | ALGO | 0.999931 | 5.388335 |
e97aea06-8da2-4755-b9ec-eb6bbb44040f | habib302/LeetCode-Solution | 0905. Sort Array By Parity 1.cpp | class Solution {
public:
vector<int> sortArrayByParity(vector<int>& nums) {
int n=nums.size();
//base case
if(n<2)
return nums;
int left=0,right=n-1;
while(left < right){
if(nums[left]%2==0){
... | ALGO | 0.999987 | 5.588996 |
a5e0a968-dd22-4000-b272-1faf3f636163 | AlexMapley/workstation | code/cplus/cplusplus_tuts/3.cpp | #include <iostream>
using namespace std;
const double pi = 3.14159;
const char newline = '\n';
int main () {
double r = 5.0;
double circle;
circle = 2 * pi * r;
cout << circle << newline;
}
| ALGO | 0.997719 | 4.557437 |
fed9c6fd-1c41-40bf-ad9e-40410a57690b | SAgarwal-24/algorithms | sorting/sort-list.cpp | #include "sorting.h"
#include "nodes.h"
/*
* Sort a linked list in O(n log n) time using constant space complexity.
Example 1:
Input: 4->2->1->3
Output: 1->2->3->4
Example 2:
Input: -1->5->3->4->0
Output: -1->0->3->4->5
*/
ListNode* sortList(ListNode* head) {
return {};
}
| ALGO | 0.999995 | 5.177614 |
0f23a346-caa7-4209-9e92-70ae9fa4a001 | KyLenMou/CF | Div. 4/Codeforces Round 817 (Div. 4)/C.cpp | #include<bits/stdc++.h>
#define x first
#define y second
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define endl '\n'
// #define int long long
#define ll long long
#define pq(x) priority_queue<x,vector<x>,greater<x>>
#define PQ(x) priority_queue<x>
using namespace std;
typedef pair<int,int> PII;
... | ALGO | 0.999859 | 4.700943 |
b421cc63-f060-48ce-8e51-49628806e4e2 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9006_1.cpp | #include <bits/stdc++.h>
using namespace std;
unsigned int dp[23333][133], n, p, q, as, f[133][133];
struct mat {
unsigned int s[133][133];
mat() {
for (unsigned int i = 0; i <= p; i++)
for (unsigned int j = 0; j <= p; j++) s[i][j] = 0;
}
} v[133], a;
mat mul(mat a, mat b) {
mat c;
for (unsigned int... | ALGO | 0.99993 | 3.548367 |
988807ed-0515-4cda-9295-5f1a11062c94 | Zero-Vec/cppACM | lanqiao/lanqiao_problem/3algorithmBase/weiyunsuan/lanqiao1331.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
unsigned int x;
cin >> x;
int cnt = 0;
while(x){
if(x&1)
cnt++;
x >>= 1;
}
cout << cnt;
}
int main()
{
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int t = 1;
//cin >> t;... | ALGO | 0.99997 | 4.81265 |
5f896c39-d05b-4191-81b1-200780ecd558 | emanueljuliano/Competitive_Programming | topics/ICPC_unicamp/dia_3/h.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
typedef pair<int, int> pii;
int M[1010][1010];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int n, w, h;
vector<pii>hot;
void bfs(){
queue < pii > q;
for(int i=0; i<hot.size(); i++){
q.push({hot[i].ff,... | ALGO | 0.999866 | 3.748518 |
90db4599-3448-42c6-be9b-1ecc449cded2 | AnjaliRaj05/GfG-Solution | School/Second Largest/second-largest.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
// Function returns the second
// largest elements
int print2largest(int arr[], int n) {
// code here
// int a=INT_MIN;
// int b=INT_MIN;
// // if(arr... | ALGO | 0.999883 | 5.387115 |
120af28f-71f1-4683-b7ff-d88db37e1a59 | aleung27/Competitive-Programming | CF1581-D2 (Contest 745)/B/solution.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define X real()
#define Y imag()
#define EPS 0.000000001
#define M_PI 3.14159265358979323846
#define CROSSPROD(a, b) (conj(a) * (b)).Y
#define DOTPROD(a, b) ((a).X * (b).X + (a).Y + (b).Y)
#define FASTIO ios::sync_wi... | ALGO | 0.999954 | 4.265244 |
07723995-6ea2-43d3-8ea8-bedf636d3572 | ajturner/spacecraft | src/test/testAttitudeIntegration.cpp | //////////////////////////////////////////////////////////////////////////////////////////////////
/*! \file testAttitudeIntegration.cpp
* \brief Sample of an attitude integration using components of the SSF.
* \author $Author: nilspace $
* \version $Revision: 1.6 $
* \date $Date: 2003/08/24 20:59:13 $
*////////... | ALGO | 0.953044 | 5.979208 |
9e9e73de-53bc-4c17-9de7-def1e65403e5 | chicio/HackerRank | CPP/RectangleArea.cpp | //
// RectangleArea.cpp
// HackerRank
//
// Created by Duroni Fabrizio on 25/08/16.
//
// https://www.hackerrank.com/challenges/rectangle-area
#include <iostream>
using namespace std;
class Rectangle {
protected:
int width;
int height;
public:
void display() {
cout << ... | TOOL | 0.85276 | 5.757092 |
57a0d502-916f-4a5e-a214-65e890d6288f | vakadamukesh/LeetCode | 2162-partition-array-into-two-arrays-to-minimize-sum-difference/2162-partition-array-into-two-arrays-to-minimize-sum-difference.cpp | class Solution {
public:
int minimumDifference(vector<int>& nums) {
int n=nums.size();
int N=n/2;
vector<vector<int>> left(N+1), right(N+1);
int sum=accumulate(nums.begin(),nums.end(),0);
for(int mask=0;mask<(1<<N);mask++)
{
int size=0;
int sum1=0,sum2=0;
fo... | ALGO | 0.999917 | 5.400844 |
b7b0d79d-f936-4f14-901e-f8cd7be9f174 | SU1JUN4KANG1/programming | PAT_test_yi/1064.cpp | #include <iostream>
#include <math.h>
#include <algorithm>
#include <memory.h>
using namespace std;
int main()
{
//std::ios::sync_with_stdio(false);
int inp_N =0;
cin >>inp_N;
string buf1;
int buf =0;
int oup_arr[50] ={0};
int oup_nu =0;
for(int i=0;i <inp_N;i++)
{
buf =0;
cin >>buf1;
for(int j=0;j ... | ALGO | 0.999544 | 3.748463 |
9b21cfc0-cc62-4b58-8fbc-e5406f525ab8 | krouser/C-learning | balancewithFriendFunction.cpp | #include <iostream>
class BankAccount
{
private:
double balance;
public:
BankAccount(double initialBalance) : balance(initialBalance) {}
friend double calculateTotalBalance(const BankAccount *accounts, int numAccounts);
};
double calculateTotalBalance(const BankAccount* accounts, int numAccounts)
{
... | ALGO | 0.99192 | 5.650578 |
e0487291-9dde-47f0-8ad1-7cf9e94e1608 | radhikaarajput/Competitive_Programming | Dynmaic Programming/516. Longest Palindromic Subsequence.cpp | class Solution {
public:
int longestCommonSubsequence(string text1, string text2)
{
// Code here
int n=text1.length();
int m=text2.length();
int dp[n+1][m+1];
for(int i=n;i>=0;i--)
{
for(int j=m;j>=0;j--)
{
//last row=0 //last col=0... | ALGO | 0.999996 | 6.707646 |
ba4bf926-046a-40e2-ab69-29e17b21d1f4 | celidos/programming-mipt-2015-2017 | year2/RAY_TRACING (copy06.04.2017)/raytracing/rt_geometry.cpp | #include "rt_geometry.h"
#include <iostream>
using std::cout;
using std::endl;
DDOUBLE dist(vector3d a, vector3d b) {
return (b - a).len();
}
DDOUBLE dist2(vector3d a, vector3d b) {
return (b - a).len2();
}
DDOUBLE distPointLine(vector3d p, vector3d a, vector3d b) {
return ((p - a) ^ (p - b)).len() / (... | ALGO | 0.997214 | 4.690093 |
e7d1fd59-1d8d-4421-923a-44cd4067c4cb | CSA0658-DA/DS-CSA0384 | Tree travarls.cpp | #include <stdio.h>
#include <stdlib.h>
struct node{
int data;
struct node *leftChild;
struct node *rightChild;
};
struct node *root = NULL;
void insert(int data )
{ struct node tempnode=( struct node) malloc (sizeof (struct node));
struct node *current;
struct node *parent;
}tempNode->data = data;... | ALGO | 0.999822 | 3.633553 |
4635be80-46b5-4fcf-84a7-d75043c6fadb | abhinavjain0809/Competitive_Programming | TopCoder/Programs/TireRotation.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | ALGO | 0.999829 | 4.257719 |
f29e4d59-1b0e-4e5a-801e-ca45235c7b13 | nikhil980/gfgcoding | Difficulty: Easy/Find the first node of loop in linked list/find-the-first-node-of-loop-in-linked-list.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
void printList(Node *node) {
while (node != NULL) {
cout << node->data << " ";
node = node->next;
}
cout << "\... | ALGO | 0.999439 | 5.272497 |
81d20eaa-b2d9-4367-ba74-3353eb71e576 | Andycode3759/competitions | 2023_Q1/YZOJ.C1359_1.2/C/C.cpp | // AC
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
struct Msg
{
char content[15];
int priority;
bool operator<(const Msg &another) const
{
return priority > another.priority;
}
};
priority_queue<Msg> msgQueue;
int main()
{
int n;
scanf("%d", &n);
fo... | ALGO | 0.997586 | 4.325446 |
5810cc89-15a3-432c-adcf-6851c46b608a | shuklaabhinavv/dsa-grind | 0040-combination-sum-ii/0040-combination-sum-ii.cpp | class Solution {
public:
vector<vector<int>> combinationSum2(vector<int>& candidates, int target) {
sort(candidates.begin(),candidates.end());
vector<vector<int>> ans;
vector<int>ds;
FindComb(0,target,candidates,ds,ans);
return ans;
}
void FindComb(int ind,int target,vecto... | ALGO | 0.999985 | 6.439398 |
9917dd39-f39c-463f-aa0b-2d6630dae8d3 | Rajbirsakib/Codeforces_Solution | 937A - Stair, Peak, or Neither.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long t,a,b,c;
cin>>t;
while(t--){
cin>>a>>b>>c;
if(a<b && b<c) cout<<"STAIR"<<endl;
else if(a<b && b>c) cout<<"PEAK"<<endl;
else cout<<"NONE"<<endl;
}
return 0;
}
| ALGO | 0.999931 | 3.865442 |
0762cbf0-fd2a-49ba-aeb2-cfe2dd824aea | hidoopos/cbf-ht | HashBasedFIB-backup.cpp |
#if NDN_HASH_BASED_FIB_DEBUG_ON
#define fib_debug(M, ...) printf(M, __VA_ARGS__)
#else
#define fib_debug(M, ...)
#endif //!NDN_HASH_BASED_FIB_DEBUG_ON
#include "NDN-HashBasedFIB.hpp"
int HashBasedFIB::lookup_times = 0;
int HashBasedFIB::no_matchs = 0;
//Ӧ"/s1/s2/s3/s4..."
ForwardInfo* HashBasedFIB::LPM_search(const... | ALGO | 0.998906 | 3.899067 |
8d8f1e2c-aa94-4bcf-9afc-c3a5111fc62c | sivaprakash1603/-CrackYourInternship | Linked List/remove-duplicates-from-sorted-list.cpp | class Solution {
public:
ListNode* deleteDuplicates(ListNode* head) {
if (!head) {
return nullptr;
}
ListNode* temp = head;
ListNode* temp2 = head->next;
int last = head->val;
while (temp2 != nullptr) { // while end of Linked list
... | ALGO | 0.999954 | 6.168612 |
952c1a1c-bbc4-45bf-875d-53d5e1ec7421 | hak2711/algorithm | BOJ/1000/1406_에디터2.cpp | #include <iostream>
#include <string>
#define MAX 1000001
using namespace std;
char dat[MAX];
int pre[MAX], nxt[MAX];
int unused = 1;
void insert(int addr, char ch)
{
int cur = nxt[addr];
dat[unused] = ch;
nxt[unused] = cur;
pre[unused] = addr;
if (cur != -1)
pre[cur] = unused;
nxt[addr] = unused;
... | ALGO | 0.999919 | 4.003588 |
f87f9f8f-2ef5-4614-af2f-0ea991d3c881 | Aakash623/s_rocks_music_intern_proj | 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.998733 | 6.76775 |
70687be4-e6f9-4947-a1d4-d31db2ec5efb | cagongman/Algorithm | 프로그래머스/2/87946. 피로도/피로도.cpp | #include <string>
#include <vector>
using namespace std;
int answer = 0;
bool check[8];
void dp (int cnt, int k, vector<vector<int>> dungeons)
{
if(answer < cnt) answer = cnt;
for(int i =0;i<dungeons.size(); i++)
{
if(check[i] == false && dungeons[i][0] <= k)
{
check[i] =... | ALGO | 0.999346 | 4.713084 |
3ff78e93-170f-4c61-9bde-c24e2ae3bdc9 | YoungWook0533/moma-mppi | mppi_royalpanda/src/nodes/input_to_controller_effort_custom.cpp | #include <pinocchio/fwd.hpp>
#include <pinocchio/algorithm/compute-all-terms.hpp>
#include <pinocchio/parsers/urdf.hpp>
#include <ros/ros.h>
#include <geometry_msgs/Twist.h>
#include <std_msgs/Float64MultiArray.h>
#include <std_msgs/Float32MultiArray.h>
#include <sensor_msgs/JointState.h>
#include <control_toolbox/pid... | ALGO | 0.991606 | 7.646639 |
2ee78c2e-f424-4836-8a77-c8c30b977414 | Deepak-192004/OBJECT-ORIENTED-PROGRAMMING-WITH-CPP | EASY 17.cpp | #include <iostream>
using namespace std;
class DivisibleByNine {
public:
DivisibleByNine() : count(0), sum(0) {
findDivisibleNumbers();
calculateSum();
}
~DivisibleByNine() {
cout << "Number of integers divisible by 9 between 100 and 200: " << count << endl;
cout << "Sum of... | ALGO | 0.993315 | 5.227054 |
1d836bcb-c13d-4dd1-9dcd-69c383944fbd | Keerthan04/DSA-Solved | 0368-largest-divisible-subset/0368-largest-divisible-subset.cpp | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
int n=nums.size();
vector<int> dp(n,1);
vector<int> hash(n,1);
sort(nums.begin(),nums.end());
for(int i=0; i<=n-1; i++){
hash[i] = i; // initializing with current index
... | ALGO | 0.999997 | 5.616995 |
1ac170b9-6c13-490d-bdba-47ca328945a3 | ayahamadaahmed/C-Programming | Bubble-Sort.cpp | #include <iostream>
using namespace std;
class Bubble_Sort
{
private:
int size;
int *array;
public:
Bubble_Sort(int n)
{
size = n;
array = new int [size];
}
void read ()
{
cout << "PLZ Enter\t" << size << "\tElements";
for (int i = 0; i < size; i++)
{
ci... | ALGO | 0.999308 | 3.954238 |
10cde34c-7be1-4753-b038-c7513bb25db6 | CarlosDaniel111/competitive-programming | ICPC/LatinAmerica/Regional/2011 ICPC Latin America Regional Contest/K.cpp | #include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define eb emplace_back
#define ENDL '\n'
#define FOR(x, n) for (long long x = 0; x < (long long)n; x++)
#define FOR1(x, n) for (long long x = 1; x <= (long long)n; x++)
#define FORR(x, n) for (long long x = n - 1; x >= 0; x--)
#define FORR1(x, n) for (long lo... | ALGO | 0.999825 | 3.394078 |
6c09213a-23ef-4cc3-9c9d-b73412abb6eb | Faramita2/Algorithm | 151 Reverse Words in a String/151 Reverse Words in a String.cpp | #include <iostream>
#include <cassert>
#include <algorithm>
using namespace std;
class Solution {
public:
string reverseWords_(string s) {
removeExtraSpaces(s);
reverse(s.begin(), s.end());
reverseEachWord(s);
return s;
}
string reverseWords(string s) {
int size = s.size();
int k = 0;
int d = 0;
f... | ALGO | 0.999909 | 5.893126 |
4556bc7c-e72c-48e5-a847-d0e7daa7623c | a1i3nj03/a1_min3r | scrypt.cpp | #ifdef WIN32
#include <ppl.h>
using namespace Concurrency;
#else
#include <omp.h>
#endif
#include "miner.h"
#include "scrypt/salsa_kernel.h"
#include "scrypt/sha256.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <emmintrin.h>
#ifndef __APPLE__
#include <malloc.h>
#endif
#include <new>
#if _... | ALGO | 0.991776 | 5.60461 |
c0d93fdd-0777-4892-b23c-84ec974d0cf5 | wencanluo/LeetCode | CodeLeet/TrappingRainWater.cpp | /*Trapping Rain WaterMar 10 '123546 / 8836
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
For example,
Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6.
The above elevation map is represented by array [0,1,0,2,1,0,1,3,2,... | ALGO | 0.999917 | 6.567564 |
29c10ba7-11ed-4b70-b545-9cd6ac8b0f66 | gisbi-kim/mixRobust_distributed_mapper | cpp/src/distributed_mapper/map_drawer.cpp | //
// Created by Siukeung on 19-5-11.
//
#include "distributed_mapper/map_drawer.h"
namespace distributed_mapper{
void MapDrawer::readColors() {
for(size_t i = 0; i < 49; i++){
Point3 singleColor(color_pattren[3*i]/(float)255, color_pattren[3*i+1]/(float)255, color_pattren[3*i+2]/(float)255);
... | TOOL | 0.858231 | 4.414784 |
d90cf56f-2d6d-4eda-ac9b-535893d34335 | mansi1309/GeeksForGeeks | Difficulty: Medium/Smallest number/smallest-number.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
string smallestNumber(int s, int d) {
// code here
int n = 1;
for(int i =1; i<d; i++){
n*=10;
}
... | ALGO | 0.999655 | 6.287258 |
ba646c6b-ade0-4378-a22e-4f6ac7fc80df | vivekgupta2017/Coding-Challenges | C++ Basic Progs/Prim's Algorithm/Prims Array.CPP | //Non Indented Code
#include<iostream>
#include<string.h>
using namespace std;
class Prims{
char city[10][20];
int g[10][10];
int v,e;
struct dist{
int start,end,cost;
}dist[10];
public:
Prims(int x, int y){
v=x; e=y;
for(int i=0; i<v; i++)
for(int j=0; j<v; j++)
g[i][j]=0;
}
void createGraph();
vo... | ALGO | 0.962108 | 3.294564 |
ea2a6437-0b41-47f4-8c78-c6811ef4da53 | NKlyd/chess | GameModel.cpp | #include <utility>
#include <stdlib.h>
#include <time.h>
#include "GameModel.h"
GameModel::GameModel()
{
}
void GameModel::startGame(GameType type)
{
gameType = type;
gameMapVec.clear();
for (int i = 0; i < kBoardSizeNum; i++)
{
std::vector<int> lineBoard;
for (int j = 0; j < kBoardSi... | TOOL | 0.86615 | 4.667132 |
23351be1-bdc0-40a3-93aa-21bd96fb7a03 | PagalavanPagal66/Leetcode_Solutions | Reversing the equation - GFG/reversing-the-equation.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
string reverseEqn (string s)
{
int i=0;
int n=s.size();
stack<string> st;
while(i<n)
{
if(s[i]>='0' && s[i]<='9')
{
... | ALGO | 0.999392 | 6.531291 |
ef824546-3127-4c1e-a8ff-66565f70b06b | ChanglinZhou/oj-problems | army/buaa/1063.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <sstream>
using namespace std;
void solve(double a, double b, double c)
{
double key = b * b - 4 * a * c;
if (key < 0)
cout << "no answer!" << endl;
else
{
cout.precision(2);
cout << fixed << (-b - sqrt(key)) / (2 * a) << endl;
}
}
void solve(... | ALGO | 0.990297 | 3.661353 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.