uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
bed838f6-aeb8-49b8-b065-2df963338cb9 | Park-MinJe/codetree-TILs | 240401/n의 배수/multiple-of-n.cpp | #include <iostream>
using namespace std;
int n;
int main() {
cin>> n;
for(int i = 1; i < 200.0/n; ++i){
int nextN = n * i;
cout<<n * i<<" ";
if(nextN % 10 ==0) break;
}
return 0;
} | ALGO | 0.999741 | 3.165742 |
046749bf-bc2e-4beb-a9c4-542e5930f3d4 | Joker-Magician/C- | 蓝桥杯_1/练习算法/vector动态数组定义与使用.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<vector>
#include<iostream>
using namespace std;
int main() {
//动态数组的定义与基本操作
vector<int> a;
a.push_back(10);//添加元素10
a.push_back(20);
a.push_back(30);
//定义二维数组
vector<vector<int>> mat(100, vector<int>(666, -1));//构造初始100行,初始666列的二维数组,初值为-1
//输出vector中的所有元素
cout << "I... | ALGO | 0.896392 | 3.747071 |
801941c9-6ebd-431c-a6f2-514f33c283e1 | Kristoff-starling/OJ-Programmes | HDU/[HDU6406]Taotao Picks Apples.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define LB long double
#define ull unsigned long long
#define x first
#define y second
#define pb push_back
#define pf push_front
#define mp make_pair
#define Pair pair<int,int>
#define pLL pair<LL,LL>
#define pii pair<double,double>
const int INF=2e9... | ALGO | 0.999909 | 4.09394 |
f5fdf3d1-1676-4faa-a3f9-fc465063514f | KLichtenauer/ractrack_opt | construction_heur/InitPathUtils.cpp | //
// Created by Privati on 23.04.25.
//
#include "InitPathUtils.h"
#include "Track.h"
vector<Coord> InitPathUtils::initPath(Track &t) {
// Clearance maps each tile to a number defining how far its away from grass.
deque<Coord> qClearance;
vector<vector<int> > clearance(t.height(), vector<int>(t.width(),... | ALGO | 0.999682 | 4.527587 |
d67df864-9396-4f14-a8ea-2e9e10cc38e7 | nxphuc/LeetCode | algorithms/0148-sort-list.cpp | // Title: Sort List
// Source: https://leetcode.com/problems/sort-list
// Difficulty: Medium
// Tags: Linked List, Two Pointers, Divide and Conquer, Sorting, Merge Sort
// Author: nxphuc
// Time Complexity: O(NlogN)
// Space Complexity: O(logN)
// Note:
/**
* Given the head of a linked list, return the list after so... | ALGO | 0.999998 | 6.824442 |
676f8bc2-1cdb-42d8-bca8-454c7301063e | iNiKe/boost | libs/numeric/odeint/examples/mtl/implicit_euler_mtl.cpp | #include <iostream>
#include <fstream>
#include <utility>
#include "time.h"
#include <boost/numeric/odeint.hpp>
#include <boost/phoenix/phoenix.hpp>
#include <boost/numeric/mtl/mtl.hpp>
#include <boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp>
using namespace std;
using namespace boost::numeric::odeint;
... | ALGO | 0.996374 | 4.987206 |
35c8f603-e3f0-4233-b4a2-4e6ac3d07c98 | oxygen-hunter/Flashboom | data/leetcode_cpp/minesweeper.cpp | // Time: O(m * n)
// Space: O(m + n)
// dfs
class Solution {
public:
vector<vector<char>> updateBoard(vector<vector<char>>& board, vector<int>& click) {
if (board[click[0]][click[1]] == 'M') {
board[click[0]][click[1]] = 'X';
return board;
}
vector<pair<int, int>> ... | ALGO | 0.998937 | 5.121017 |
887c8c12-8782-4a14-9498-33853f0b53a8 | nckuasrlab/QOPS | qcor-pgo/examples/hubbard/hubbard_dimer.cpp | // hubbard_dimer_ex.cpp
using FO = FermionOperator;
// define factorized UCC ansatz using exp_i_theta
__qpu__ void ansatz(qreg q, std::vector<double> x, std::vector<FO> ops, int order, int layer) {
// prepare reference state |1010> (qubit map: 0↑,1↑,0↓,1↓ -> 0,1,2,3)
X(q[0]);
X(q[2]);
// define a few different... | ALGO | 0.999669 | 4.533271 |
4580cae5-9f1e-441a-8b3f-f31fb3be528f | ishandutta2007/codeforces | estinka/normal/1382/A.cpp | // ConsoleApplication2.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <queue>
typedef long long ll;
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0)... | ALGO | 0.99998 | 3.612739 |
188845e0-ec8b-4102-ad35-f5ce278656ac | Ricardiam/liretok1 | graph/depth_first_search_with_stack.cpp | /**
*
* @file
* @brief [Depth First Search Algorithm using Stack
* (Depth First Search Algorithm)](https://en.wikipedia.org/wiki/Depth-first_search)
*
* @author [Ayaan Khan](http://github.com/ayaankhan98)
* @author [Saurav Uppoor](https://github.com/sauravUppoor)
*
* @details
* Depth First Search also quoted ... | ALGO | 0.999987 | 6.27193 |
24e8b005-08bf-4696-bb01-92ab279601f3 | deepfabric/vectodb | faiss/utils/extra_distances.cpp | // -*- c++ -*-
#include <faiss/utils/distances.h>
#include <cmath>
#include <omp.h>
#include <faiss/utils/utils.h>
#include <faiss/impl/FaissAssert.h>
#include <faiss/impl/AuxIndexStructures.h>
namespace faiss {
/***************************************************************************
* Distance functions (oth... | ALGO | 0.997585 | 7.359833 |
1fcf647f-900c-48ef-b95d-09c18acf8b3e | bersilin-robert1609/robert_cp | Accepted/B_Elementary_Particles.cpp | #include<bits/stdc++.h>
using namespace std;
#define long long int
#define endl "\n"
const int MOD = 1e9+7;
void solve()
{
int n;
cin>>n;
vector<pair<int, int>> particles(n);
for(int i=0; i<n; i++){
cin>>particles[i].first;
particles[i].second = i;
}
sort(particles.begin(), ... | ALGO | 0.999901 | 5.162231 |
061301f9-811b-4cb2-9f81-f1f31fcd82f0 | phidiaLam/GAMES | GAMES202_Homework_S2021/homework2/prt/ext/eigen/doc/snippets/Triangular_solve.cpp | Matrix3d m = Matrix3d::Zero();
m.triangularView<Eigen::Upper>().setOnes();
cout << "Here is the matrix m:\n" << m << endl;
Matrix3d n = Matrix3d::Ones();
n.triangularView<Eigen::Lower>() *= 2;
cout << "Here is the matrix n:\n" << n << endl;
cout << "And now here is m.inverse()*n, taking advantage of the fact that"
... | ALGO | 0.999405 | 3.70449 |
fc2060c9-3885-4d53-a91b-a5c68607163d | wowskii/Projet2048 | jeu2048/fichiers-jeu-complet/jeuSFML.cpp | #include "../modele.hpp"
#include <iostream>
#include <vector>
#include <SFML/Graphics.hpp>
#include <chrono>
#include <thread>
using namespace std;
using namespace sf;
using Plateau = vector<vector<int>>;
int main()
{
srand(static_cast<unsigned int>(time(0))); // pour le fonctionnement du générateur de nombres a... | ALGO | 0.968978 | 3.734935 |
c974e0b6-a722-435f-bad5-acabd59063b2 | ijyapu/Sokoban-Game | Sokoban.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <SFML/Graphics.hpp>
#include "Sokoban.hpp"
/* This file contains the implementation of the Sokoban game logic.
It defines the behavior of the game objects such as the player, crates, walls, and targets.
The code in... | TOOL | 0.95085 | 7.180858 |
d3b7a90e-4f35-4079-b1e7-1d804e230f50 | shribadiger/CPPStudy | Old/naraytree.cpp | /* Program to print the level based nodes from the tree */
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct Node
{
public:
int val;
vector<struct Node *> children;
Node() {}
Node(int _val)
{
val = _val;
}
Node(int _val, vector<struct Node *> _childr... | ALGO | 0.99995 | 5.477027 |
291ea4f0-ced7-425b-9ffb-a379d2d07951 | madhavkr1506/CPP--PRACTICE_QUESTIONS | Matrix_multiply.cpp | // write c++ program to multiply two matrices :
#include<iostream>
using namespace std;
int main(){
int a[10][10],b[10][10],res[10][10],r1,c1,r2,c2,i,j,k;
cout<<"enter rows and column for first matrix : ";
cin>>r1;
cin>>c1;
cout<<"enter rows and column for second matrix : ";
cin>>r2;
cin>... | ALGO | 0.999625 | 3.318576 |
30b8bb58-f294-4881-b4d7-99dab543b126 | AarzooArora/cpp-programs | recursion.cpp | //add a range of numbers by adding 2 numbers
#include<iostream>
using namespace std;
int sum(int k){
if(k>0){
return k +sum (k-1);
}else{return 0;}
}
int main(){
int result=sum(10);
cout<<result;
return 0;
} | ALGO | 0.996186 | 3.700974 |
9af4cd1a-e48c-4dc7-bf2e-b5c2d2831920 | noahberg/Noah-Bergman | hw3/src/boolevaluator.cpp | #include <map>
#include <iostream>
#include <fstream>
#include <string>
#include <cctype>
#include <cstdlib>
#include "../lib/stackint.h"
using namespace std;
const int AND = -1;
const int OR = -2;
const int NOT = -3;
const int LEFT_PAREN = -4;
const int RIGHT_PAREN = -5;
const int BAD_SUBF = -10;
const int EMPTY_SU... | ALGO | 0.994439 | 4.339938 |
6426472f-68b9-4e63-9859-033d29fc6be8 | llynv/CP-files | K.cpp | /*
Code by: linvg
Created: 2025.05.25 08:44:50
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
string to_upper(string a) { for (int i = 0;i < (int)a.size();++i) if (a[i] >= 'a' && a[i] <= 'z') a[i] -= 'a' - 'A'; return ... | ALGO | 0.999993 | 3.965886 |
8ed867b9-60a4-4f6e-992b-a2d5efa9a0e2 | silverneko/pbrt-rendering | src/shapes/heightfield2.cpp | // shapes/heightfield2.cpp*
#include "stdafx.h"
#include "shapes/heightfield2.h"
#include "shapes/trianglemesh.h"
#include "paramset.h"
// Heightfield Method Definitions
Heightfield2::Heightfield2(const Transform *o2w, const Transform *w2o,
bool ro, int x, int y, const float *zs)
: Shape(o2w, w2o, ro) {
... | TOOL | 0.97665 | 7.454923 |
f448baa6-c381-46d8-9d96-2ce934c2b289 | Andrezzz9/StackOverMemes | 3rdparty/opencv/samples/cpp/grabcut.cpp | #include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace std;
using namespace cv;
static void help(char** argv)
{
cout << "\nThis program demonstrates GrabCut segmentation -- select an object in a region\n"
"and then grabcut wi... | ALGO | 0.924144 | 5.414489 |
3697041e-26d1-4d33-bd57-db51616d976e | juarezpaulino/coderemite | problemsets/USACO/CHAPTER 2/Secao 2.3/concom.cpp | /**
*
* Author: Juarez Paulino(coderemite)
* Email: <EMAIL>
*
*/
/*
ID: juarezp1
PROG: concom
LANG: C++
*/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include... | ALGO | 0.999886 | 3.744127 |
03347ff8-e4ca-4be5-844b-0ed3b2f42b16 | InvalidNamee/OJ-AC-Repository-for-UPC | AC_code/跟随唐克练编程基础系列/3883_选择结构/20_U_三人行必有我师焉.cpp | #include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int mx = 0;
for (int i = 0; i < 3; ++i) {
int t;
scanf("%d", &t);
mx = max(mx, t);
}
printf("%d\n", mx);
return 0;
}
/**************************************************************
Pro... | ALGO | 0.994898 | 3.690459 |
e269bb13-1592-4c2d-b150-2a97a2898c6c | Acasune/Atcoder | abc161_c.cpp | #include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long
//----***型定義***----
using ll = long long;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
typedef long double lb;
// typedef vector<int,vector<int>> vvec;
typedef long double ld;
typedef pair<int,int> P;
//----***Li... | ALGO | 0.999894 | 3.516308 |
5288365a-d5d6-422b-8ddd-d460e0231655 | uwe77/dancing_point_cloud | catkin_ws/src/hand_eye_calibration/src/static_cam_calibration.cpp | #include <fstream>
#include <boost/filesystem.hpp>
#include <ros/ros.h>
#include <ros/package.h>
#include <tf/transform_listener.h>
#include <geometry_msgs/Pose.h>
#include <sensor_msgs/JointState.h>
/*
* Hand-eye automatically calibration, collecting data process
* Note: Remember to broadcast \fake_tcp\ frame, th... | DATA | 0.88559 | 4.120406 |
41893d63-daf7-4596-85d7-365d429e7347 | vivekkushwaha373/collection-of-all-Cpp-codes-part-3 | DFSingrap.cpp | #include<iostream>
#include<vector>
#include<stack>
// #include<list>
using namespace std;
// It is depth first search
DFS(int visited[],int n,vector<int>adj[])
{
visited[n]=1;
cout<<n<<" ";
for(auto i : adj[n] )
if(!visited[i])
{
DFS(visited,i,adj);
}
}
// We have learnt in depth first ser... | ALGO | 0.999985 | 5.302374 |
bac27e4c-19a5-4eea-a8b2-da0d7de18847 | ousttrue/onibi | bulletdemos/HeightFieldFluidDemo/BulletHfFluid/btHfFluidBuoyantConvexShape.cpp | #include <stdio.h>
#include "LinearMath/btAabbUtil2.h"
#include "BulletCollision/CollisionShapes/btConvexShape.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
#incl... | ALGO | 0.950735 | 7.013577 |
7d2e5532-1485-4650-9e2a-13b00ba0ce7c | AbhJ/some-cp-files-3 | leetcode/48.cpp | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
int n = matrix.size();
for (int i = 0; i < n; i++) {
for (int j = 0; j <= i; j++){
swap (matrix[i][j], matrix[j][i]);
}
}
for (int i = 0; i < n; i++) {
for (int j ... | ALGO | 0.999989 | 6.338395 |
0a959412-e543-48d6-acfc-f33fb379a68d | Kyle-Perry/Kattis-Solutions | Bard.cpp | #include <vector>
#include <iostream>
#include <unordered_set>
//#include <bits/stdc++.h>
using namespace std;
vector<unordered_set<int>> villagers;
vector<int> attending;
int main() {
int n, e, a, p;
bool bPresent;
cin >> n >> e;
villagers.assign(n, {});
for (int i = 0; i < e; i++) {
cin >> a;
bPresent = f... | ALGO | 0.999694 | 3.559603 |
1b5e92a1-8092-4599-9978-64e1a0cb4a00 | ishandutta2007/codeforces | kotatsugame/normal/1266/F.cpp | #include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
int N;
vector<pair<int,int> >G[5<<17];
pair<int,int>diameter_dfs(int u,int p)
{
pair<int,int>ans(0,u);
for(const pair<int,int>&e:G[u])
{
if(e.first!=p)
{
pair<int,int>q=diameter_dfs(e.first,u);
q.first++;
ans=max(an... | ALGO | 0.999494 | 3.881069 |
8943a0b6-ec63-45b9-98d2-73a58fd42997 | Rito-492/Luogu | T588725.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL N = 2e2 + 1;
LL n, m, k, a[N], b[N], c[N], ans = 0;
int main () {
cin >> n >> m >> k;
for (int i = 1; i <= n; i++)
cin >> a[i];
for (int i = 1; i <= m; i++)
cin >> b[i];
for (int i = 1; i <= k; i++)
... | ALGO | 0.999979 | 3.903979 |
58809454-6fd0-40b5-ae85-cbfcdd4c3df9 | ishandutta2007/codeforces | krijgertje/normal/333/C.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <climits>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.999221 | 3.31735 |
fa585682-f73f-4ce9-961e-8a4527cdbc67 | amir-hosen7/Dynamic-Programming | String/LeetCode/2707. Extra Characters in a String (substring and dictionary).cpp | class Solution {
public:
int dp[55];
unordered_map<string, bool> mark;
int solve(int idx, int n, string& s) {
if (idx >= n) return 0;
if (dp[idx] != -1) return dp[idx];
int res = 1 + solve(idx + 1, n, s); //skip this char
for (int i = 1; (idx + i) <= n; i++) {
... | ALGO | 0.999817 | 5.853305 |
369bd033-c41c-40c4-b1d7-2dec836b59f1 | TI-1050/code | opentrains/6299/j.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = __int128;
const int N = 2e5 + 10;
const ll INF = 1e18;
int n, m, q, a[N];
struct SEG {
struct node {
//0 left
//1 right
//2 all
ll Max[3], sum;
node() {
Max[0] = Max[1] = Max[2] = sum = -INF;
}
node operator + (const node &other) const {
... | ALGO | 0.999943 | 4.160173 |
1c37ed82-4270-4ce5-9c50-ec17fbd6ec76 | sarvex/leetcode-c3 | solution/0500-0599/0538.Convert BST to Greater Tree/Solution.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.999988 | 5.982182 |
22a957c4-4bb4-4d3f-8be6-955aa25bd1b8 | hxzinh/VOI | RECTAREA/DynamicST.cpp | #include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
typedef long long ll;
struct Point {
ll x, y;
} top[100005], bot[100005];
struct data {
ll x, l, r, type;
};
struct Node {
ll cnt, len;
str... | ALGO | 0.989952 | 3.635214 |
f1507802-e157-491d-ab76-abacbe5dde9e | GreyRacoonDev/Anomaly | src/xrGame/xrServer_process_event_reject.cpp | #include "stdafx.h"
#include "xrserver.h"
#include "xrserver_objects.h"
bool xrServer::Process_event_reject(NET_Packet& P, const ClientID sender, const u32 time, const u16 id_parent,
const u16 id_entity, bool send_message)
{
// Parse message
CSE_Abstract* e_parent = game->get_enti... | WEB | 0.882023 | 4.790036 |
8f5f9691-0a18-4638-a51e-ca540bf215b8 | Ashwin-1709/competitive-programming | Graphs/lca_updated.cpp | const int LG = 18;
struct LCA {
vector<array<int, LG>> dp;
vector<int> tin, tout, depth;
int n, timer;
LCA(vector<vector<int>>& adj, int root = 0) : n(adj.size()) {
dp.resize(n);
tin.resize(n);
tout.resize(n);
depth.resize(n);
timer = 0;
dfs(adj,... | ALGO | 0.999789 | 4.588315 |
ec10b7bd-dee2-46e0-babe-e4961b0879c4 | royalnath/RYCN | src/bitcoinrpc.cpp | #include "init.h"
#include "util.h"
#include "sync.h"
#include "ui_interface.h"
#include "base58.h"
#include "bitcoinrpc.h"
#include "db.h"
#undef printf
#include <boost/asio.hpp>
#include <boost/asio/ip/v6_only.hpp>
#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost... | WEB | 0.945494 | 6.388438 |
a444fa1c-ace6-4afd-a578-58ea3a96e184 | nctu16028/LeetCode | Math/Medium/0062_Unique_Paths.cpp | #include <iostream>
using namespace std;
int uniquePaths(int m, int n)
{
// The answer is C(m-1+n-1, m-1) = C(m-1+n-1, n-1)
int ans = 1;
int N = min(m-1, n-1);
for (int i = 1; i <= N; i++)
{
ans *= ((m + n - 2) - i + 1);
ans /= i;
}
return ans;
}
int main()
{
int m, n;... | ALGO | 0.999967 | 5.83407 |
f6d6a3b7-33f3-4fb3-a887-126f49ce9747 | juthikaDash/DS | DynamicProgramming/55_Jump_Game.cpp | //https://leetcode.com/problems/jump-game/description/
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
bool canJump(vector<int>& nums) {
int max_reach =0;
for(int i=0; i<nums.size(); i++){
if(i+nums[i] > max_reach){
max_reach = nums[i]+i... | ALGO | 0.999961 | 5.787987 |
b03265a5-178c-48a7-b350-e5ff02c33926 | mikekks/PS | dp-bitmask/1311.cpp | #include <iostream>
#include <algorithm>
#include <math.h>
#include <queue>
#include <vector>
#include <cstring>
#include <map>
#define MAX 1<<19
#define INF 987654321
#define MOD 9901
using namespace std;
typedef long long ll;
int T;
int N, M;
int dp[21][1 << 21];
int Map[21][21];
ll ans;
int dfs(int idx, int vi... | ALGO | 0.999877 | 3.748277 |
dffb5b1d-b1b4-4266-9802-fa825fd85ba2 | miracl/core | cpp/fp4.cpp | /* CORE Fp^4 functions */
/* SU=m, m is Stack Usage (no lazy )*/
/* FP4 elements are of the form a+ib, where i is sqrt(-1+sqrt(-1)) */
#include "fp4_YYY.h"
using namespace XXX;
/* test x==0 ? */
/* SU= 8 */
int YYY::FP4_iszilch(FP4 *x)
{
return (FP2_iszilch(&(x->a)) & FP2_iszilch(&(x->b)));
}
/* test x==1 ? */... | ALGO | 0.994771 | 3.312694 |
7afb9235-33a3-47fe-8694-9f40ad32acd8 | nikarun/LeetCode-DSA-June | 33-search-in-rotated-sorted-array/search-in-rotated-sorted-array.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int n=nums.size();
if(n==0) return 0;
int start=0,end=n-1;
while(start<=end){
int mid=start+(end-start)/2;
if(nums[mid]==target) return mid;
else if(nums[mid]>=nums[start]){
... | ALGO | 0.999987 | 6.269222 |
91a79837-aedc-46cd-bc72-0290b0a11f7d | pcacjr/qt-creator | src/libs/3rdparty/botan/src/algo_factory/prov_weight.cpp | #include <botan/algo_cache.h>
namespace Botan {
/**
* Return a static provider weighing
*/
u32bit static_provider_weight(const std::string& prov_name)
{
/*
* Prefer asm over C++, but prefer anything over OpenSSL or GNU MP; to use
* them, set the provider explicitly for the algorithms you want
*/
if... | CONFIG | 0.928887 | 5.984963 |
4b4e598c-c273-437a-b2f4-4113ba193140 | artiam99/GeeksforGeeks | 10 Dynamic Programming/1 Basic Problems/20 Subset Sum is Equal to given Value.cpp | #include<bits/stdc++.h>
using namespace std;
bool isPresent(vector<int> &a,int n,int V)
{
bool dp[2][V+1];
for(int i=0;i<V+1;i++)
dp[0][i]=dp[1][i]=false;
dp[0][0]=true;
for(int i=0;i<n;i++)
{
for(int j=0;j<=V;j++)
{
if(i&1)
dp[0][j] = (j>=a[i]) ? dp[1][j-a[i]] : dp[1][j];
else
dp[1][j] ... | ALGO | 0.999942 | 4.786913 |
67d2652b-8b0f-47d2-ad2b-e2648256e668 | umlaeute/Gem | src/Pixes/pix_refraction.cpp | #include "Utils/PixPete.h"
#include "pix_refraction.h"
#include "Utils/Functions.h"
CPPEXTERN_NEW(pix_refraction);
/////////////////////////////////////////////////////////
//
// pix_refraction
//
/////////////////////////////////////////////////////////
// Constructor
//
/////////////////////////////////////////////... | TOOL | 0.963547 | 4.854194 |
48ac6011-44bd-455b-b008-75516140bfe4 | Noti404/PS | acmicpc/244__/24480.cpp | #include <vector>
#include <algorithm>
#include <queue>
#include <iostream>
#include <map>
#include <set>
#include <math.h>
#include <numeric>
#include <cassert>
#include <stack>
#include <cstring>
#include <climits>
typedef long long ll;
typedef unsigned long ull;
#define interface struct
#define zx3f 1061109567
ty... | ALGO | 0.99999 | 3.985816 |
071e6d9b-906d-4328-923c-d524f0d8a660 | Antonc3/Competitive-Programming | codeforces/practice/playoff.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(){
int n;
string s;
cin >> n;
cin >> s;
int k = count(s.begin(), s.end(), '1');
for (int x = 1 << k; x <= (1 << n) - (1 << (n - k)) + 1; ++x)
cout << x << ' ';
}
int main(){
int t = 1;
while(t--){
solve();
}
} | ALGO | 0.999856 | 4.048076 |
a565e99c-5591-47a9-991b-147258c0459c | lammps-qmdff/lammps-qmdff | lammps-modified/src/compute_improper.cpp | #include <mpi.h>
#include <string.h>
#include "compute_improper.h"
#include "update.h"
#include "force.h"
#include "improper_hybrid.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeImproper::ComputeImproper(LAMMPS *lmp, int narg, cha... | ALGO | 0.992727 | 6.046163 |
3be00c6d-f175-4f1a-8f9c-54cb653f67bc | Clixxzydev/FN-UnrealBuildver4.26 | Engine/Source/ThirdParty/PhysX3/APEX_1.4/shared/general/RenderDebug/src/ProcessRenderDebug.cpp | #include "ProcessRenderDebug.h"
#include "PsMemoryBuffer.h"
#include "PxBounds3.h"
#include "StreamIO.h"
#include "Hull2MeshEdges.h"
namespace RENDER_DEBUG
{
static float degToRad(const float a)
{
return static_cast<float>(0.01745329251994329547) * a;
}
static physx::PxQuat slerp(const float t, const physx::PxQu... | TOOL | 0.887632 | 4.07983 |
c1a70f3c-a694-447a-873c-6e96adfb183d | xhaktmchl/Algorithm_study | AlgorithmJobs/[알고리즘잡스 ch10 02 V] 공통 조상 찾기.cpp | #include <iostream>
#include <algorithm>
using namespace std;
/*
[알고리즘잡스 ch10 02 V] 공통 조상 찾기
풀이: 트리 탐색 -> 트리의 조상을 배열저장-> 재귀탐색
시간복잡도: O(log2(n))= log2(1000) = 10
*/
#define MAX 1010
int n,x,y,a,b;
int par[MAX];
int cnt[MAX];
// 트리 조상 탐색 재귀
void re(int node){
// 조상 방문
if(node != x && node != y) cnt[node]++;
// 가장... | ALGO | 0.999992 | 4.357791 |
06d69a5e-db2b-41e1-a353-1f6fe6af6bcf | ishandutta2007/codeforces | wzyyn/normal/1521/E.cpp | #include<bits/stdc++.h>
using namespace std;
int m,k,mx,a[100005];
int ans[805][805];
int id[100005];
bool check(int mid){
int A=mid-mid/2,B=mid/2;
if (m>A*A+A*B+B*A) return 0;
if (mx>A*A+A*B) return 0;
return 1;
}
priority_queue<pair<int,int> > Q;
bool cmp(int x,int y){
return a[x]>a[y];
}
void con(int n){
for ... | ALGO | 0.999949 | 3.132806 |
79f2689f-5bce-4f57-9cb5-43d46ed4c97c | manasdtrivedi/CP-Programs | Codeforces/638-Div2/1348B_AC.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t, n, k, noOfDistinctNumbers, a, i, j;
int freq[101];
int ans[101];
scanf("%d", &t);
while(t--){
noOfDistinctNumbers = 0;
for(i = 0; i <= 100; i++)
freq[i] = 0;
scanf("%d%d", &n, &k);
for(i = 0; i < n; i++){
scanf("%d", &... | ALGO | 0.999685 | 3.57483 |
a42f5b3d-a022-49e6-8977-af545c3f6d52 | mraicu/Matrix_Barcode | Generator.cpp | #include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <cstring>
using namespace std;
using namespace cv;
class Generator {
public:
int k, len;
bool m[100][100] = { {0},{0} }, bin_arr[500] = { 0 };
char date[100];
void ... | DATA | 0.971075 | 4.088626 |
428c8d4d-3c15-4c4b-9d61-5c228aa12830 | otavioon/COLA-2022-Tools | datasets/src/optz/codenet/4/p03201_s230280114.cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <queue>
using namespace std;
#define loop(i,N) for(ll (i)=0; (i)<(N);++(i))
struct TEMP_OMAZINAI_ { TEMP_OMAZINAI_() { std::ios::sync_... | ALGO | 0.999713 | 4.421324 |
6f521d62-7bc5-424f-9bbc-5230eef5354f | ValQer/cpp-basics | 05-arrays-1d/main.cpp | #include <iostream>
using namespace std;
void PrintArray(double *arr, const int kArraySize);
int FindIndexAbsMax(double *arr, const int kArraySize);
int FindFirstPosElemIndex(double *arr, const int kArraySize);
double ComputeSum(double *arr, int begin, const int kArraySize);
void SortArray(double *arr, double a, doub... | ALGO | 0.99991 | 4.357495 |
4736e4e7-130f-47d2-9f2d-b6350e294879 | wahidustoz/OpenGLDrawing | .localhistory/OpenGLPractice/1522008966$Source1.cpp | #include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <math.h>
#include<iostream>
#define PI 3.1415926535897932384626433832795
GLfloat n[6][3] = { /* Normals for the 6 faces of a cube. */
{ -1.0, 0.0, 0.0 },{ 0.0, 1.0, 0.0 },{ 1.0, 0.0, 0.0 },
{ 0.0, -1.0, 0.0 },{ 0.0, 0.0, 1.0 },{ 0.0, 0.0, -1.0 } }... | TOOL | 0.918966 | 4.089811 |
c685fed5-27db-4031-854a-9b009ee5b32a | kmjp/procon | yuki/2501-2600/2562.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.99973 | 3.563545 |
de45ae3c-81f7-4dc5-b412-77b5abf87abc | nju16szh/myleetcode | 2.两数相加.cpp | /*
* @lc app=leetcode.cn id=2 lang=cpp
*
* [2] 两数相加
*/
// @lc code=start
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(... | ALGO | 0.999926 | 6.686114 |
e0196270-df7f-45cc-940f-cacf4b8c43b9 | YokoLi0000/CS3334Homework | 746/746/main.cpp | #include <iostream>
#include <queue>
using namespace std;
int main() {
int N;
while (cin >> N) {
queue<int> customerQueue;
int serveTime = 0;
for (int i=0; i<N; i++) {
int A, O, L;
cin >> A >> O >> L;
if (N==1) {
serveTime = A;
... | ALGO | 0.999486 | 3.769177 |
a4ac2f12-4817-4afe-b9ab-d3a3c4fe61a5 | coolio986/Marlin_2.0.x_Anycubic_Chiron | Marlin/src/module/delta.cpp | /**
* delta.cpp
*/
#include "../inc/MarlinConfig.h"
#if ENABLED(DELTA)
#include "delta.h"
#include "motion.h"
// For homing:
#include "planner.h"
#include "endstops.h"
#include "../lcd/ultralcd.h"
#include "../Marlin.h"
#if HAS_BED_PROBE
#include "probe.h"
#endif
#if ENABLED(SENSORLESS_HOMING)
#include "../... | ALGO | 0.977874 | 6.981141 |
fd54de26-6410-44f3-b6ee-e612d8d74b11 | Nachiket-cmd/DSA-Practice | Arrays/validateSubsequence.cpp | /*Although this solution will use a bit of extra space, it is cleaner. We can simply use a queue and check its top iteratively by comparing it with array.
Finally, if the entire sub sequence would be present in array, the queue will be empty in the end. If the sub sequence is not present, the queue will not be empty.*... | ALGO | 0.999975 | 5.507717 |
10626586-a538-49a6-b0e6-1f6722ee0668 | Thomas-WebDev/CSS502Project4 | BinaryTree.cpp | // ----------------------------- BinaryTree.cpp ---------------------------------
// Author: Kevin Thomas Kehoe
// Course: CSS 502
// Creation Date: 02/27/2018
// Date of Last Modification: 03/13/2018
// -----------------------------------------------------------------------------
// Purpose: Implimentation of the met... | ALGO | 0.998154 | 5.210013 |
799a96e5-d390-4ee4-84ab-eef6b287d8fb | Algo-Goer/LeetCodeSolutions | 2022/0215_387.字符串中的第一个唯一字符.cpp | /*
* @lc app=leetcode.cn id=387 lang=cpp
*
* [387] 字符串中的第一个唯一字符
*/
// @lc code=start
// Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1.
/**
* 给定一个字符串s
* 找到它的第一个不重复的字符
* 并返回它的索引
* 如果不存在
* 则返回-1
*/
// unordered_map
class Solution {
public:
... | ALGO | 0.998891 | 5.986066 |
c427c857-b9bc-4547-9703-662fe3610eaf | netpipe/IrrlichtDemos | Physics/irrBullet/EMBullet/src/LinearMath/btPolarDecomposition.cpp | #include "btPolarDecomposition.h"
#include "btMinMax.h"
namespace
{
btScalar abs_column_sum(const btMatrix3x3& a, int i)
{
return btFabs(a[0][i]) + btFabs(a[1][i]) + btFabs(a[2][i]);
}
btScalar abs_row_sum(const btMatrix3x3& a, int i)
{
return btFabs(a[i][0]) + btFabs(a[i][1]) + btFabs(a[i][2]);
}... | ALGO | 0.999716 | 6.776482 |
412b3a58-8170-4870-9664-52fe75eebbc9 | mohi-nettari/data-structure-and-algoriths-and-some-coding-exercices-in-C- | Programming/Exercisem/armstrong number.cpp | #include<iostream>
#include<string>
#include<stdio.h>
#include<math.h>
#include<cstdlib>
using namespace std;
int main()
{
int x=0,c=0,i=0,d;
int sum;
cout<<"enter a number : ";
cin>>sum;
int num=sum;
int mum=sum;
/* if (num<10){
i=1;
}
else if (num>=10&&num<100){
i=2;
}
else if (num>=100&&num<1000){
i=3;
}
else if (n... | ALGO | 0.998641 | 3.668413 |
bce77f57-296f-4f17-a1a6-7b7fa5ec57bb | SeoeunY/2024-OOP-Mentoring | Hagyeong/Hagyeong/2-4.cpp | /*
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
void merge(int arr[], int tmp[], int start, int mid, int end)
{
for (int i = start;i < end+1;i++)
{
tmp[i] = arr[i]; //Add arr array value to tmp array
}
int ob = start; //one block (Front array of divided arrays)
int tb = mid + 1; //... | ALGO | 0.999984 | 4.172229 |
0b2c4b23-181a-4cfb-b5e8-6dad92c53aac | anishmehta24/cp | E_Negatives_and_Positives.cpp | #include <iostream>
#include <vector>
#include <map>
#include <math.h>
#include <algorithm>
#include <queue>
const int MOD = 1e9+7;
#define ll long long int
using namespace std;
int main() {
int t; cin >> t;
while(t--) {
int n; cin >> n;
vector<ll> a(n);
ll sum = 0;
ll c = 0;
... | ALGO | 0.999923 | 4.767953 |
996204fc-d674-4308-aa4b-294d06759c19 | Xushi8/Code | 2024/January/contest23/test.cpp | // 2024/01/24 16:47:43
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdint>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <functional>
#include <iomanip>
#include <cmath>
#include <stack>
#include <... | TOOL | 0.941468 | 3.821587 |
ae6b9325-f021-41c1-8351-43eb604cdad5 | mehrankamal/competitive-100 | traffic-lights.cpp | /*
* author: mkbaloch
* datetime: 2021-08-23 07:25:29
*/
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define deb(x) cerr << "[" << #x << ": " << x << "]" << endl;
using namespace std;
typedef long long ll;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifdef LOCAL
a... | ALGO | 0.999796 | 4.043484 |
33b57cb5-0492-4529-933e-7532cff6443e | Pranaydavath/LeetCode | 3005-count-elements-with-maximum-frequency/3005-count-elements-with-maximum-frequency.cpp | class Solution {
public:
int maxFrequencyElements(vector<int>& v) {
int n=v.size();
unordered_map<int,int>mp;
for(auto it:v)mp[it]++;
int mx=0;
for(auto it:mp){
if(mx<it.second){
mx=it.second;
}
}
int c=0;
for(au... | ALGO | 0.999915 | 5.742749 |
71cbb035-e06b-4b6c-960d-310bd4054741 | qbit-t/qbit | boost/libs/geometry/doc/src/examples/algorithms/union.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[union
//` Shows how to get a united geometry of two polygons
#include <iostream>
#include <vector>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <... | ALGO | 0.850213 | 6.625566 |
e4946c00-64c7-4b94-b273-eb942fe50fe9 | Thinking-builder/CSE-Courses | 2024Fall 大二上/信息安全数学基础/编程作业/2311819 王雨萌第一次编程作业/Eratosthenes.cpp | #include <iostream>
#include <vector>
/*
Eratosthenes-Sieve:
筛选质因数的方法
Version:1.0
Author:王雨萌
*/
using namespace std;
vector<int> prime;
bool is_prime[1000010];
void Eratosthenes(int n)
{
is_prime[0] = is_prime[1] = false;
for (int i = 2; i <= n; ++i)
is_prime[i] = true;
for (int i = 2; i <= n; ... | ALGO | 0.999908 | 4.170097 |
0f616630-f5d1-4fc3-a8a3-901696240996 | kuma0416/Git-Record | 2381.shifting-letters-ii.cpp | class Solution {
public:
string shiftingLetters(string s, vector<vector<int>>& shifts) {
int sLen = s.size();
int shLen = shifts.size();
vector<int> diff(sLen+1, 0);
for(int i=0; i<shLen; ++i){
int t=1;
if(shifts[i][2] == 0){
t = -1;
... | ALGO | 0.999951 | 6.393123 |
49977527-66e6-4867-93e2-03fd2b81c98f | zyin422/CPGrind | 100ProblemsSilver/52_BerryPicking.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define f first
#define s second
int INF;
signed main() {
IOS;
int n, k; cin >> n >> k;
vector<int> trees(n);
for... | ALGO | 0.999984 | 4.40132 |
90fde27c-bc34-46a5-8026-6d0235b7a207 | Harsh23Kashyap/LeetCode | 56-merge-intervals/56-merge-intervals.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals)
{
sort(intervals.begin(),intervals.end());
int begin;;
int end;
vector<vector <int>> ans;
vector <int> curr;
begin=intervals[0][0];
end=intervals[0][1];
curr.push_b... | ALGO | 0.999999 | 5.935088 |
08c79b41-b9a6-4f47-ae18-62924931e172 | Shamsullo/DS_Algorithm | DataStructure/Lab03/p12.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
main(){
int nAdjective; cin >> nAdjective;
int nNoun; cin >> nNoun;
vector<string> adjectives;
vector<string> nouns;
for(int i = 0; i < nAdjective; i++){
string temp; cin >> temp;
adjectives.push_back... | TOOL | 0.955555 | 4.972747 |
aca55157-f1ea-4d2d-a425-1de9fbaf8a03 | Aaronphilip2003/SSCD | lab3/allantemp/allantemp/lib/python3.12/site-packages/sklearn/svm/src/liblinear/tron.cpp | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "tron.h"
#ifndef min
template <class T> static inline T min(T x,T y) { return (x<y)?x:y; }
#endif
#ifndef max
template <class T> static inline T max(T x,T y) { return (x>y)?x:y; }
#endif
static void default_print(const char *buf)
{... | ALGO | 0.999665 | 5.847107 |
ba07f09c-f9f3-4d9f-a8ac-6b172c7be0e2 | netpipe/IrrlichtDemos | Physics/irrBullet/EMBullet/src/BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp | #include "btSoftRigidCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "btSoftBody.h"
#inc... | ALGO | 0.995098 | 4.0597 |
588c99a9-1096-417d-80ef-41bb7bae1fb6 | syf1913/AdventOfCode-2023 | day05/source/part02/main.cpp | #include <algorithm>
#include <array>
#include <chrono>
#include <cmath>
#include <fstream>
#include <iostream>
#include <set>
#include <sstream>
#include <string>
#include <vector>
int
main(int argc, char* argv[])
{
// 获取程序开始执行的时间点
auto start_time = std::chrono::high_resolution_clock::now();
std::string ... | ALGO | 0.980591 | 4.486036 |
3aa41944-0ea0-4406-a423-12cd424bf843 | nipun-sanjida/Problem-solving-from-computer-programming-by-subeen | src/Problem 29 . triangle lover .cpp | #include <stdio.h>
int main()
{
int testCase, i;
int base, height, triangle;
scanf("%d", &testCase);
for(i = 0; i <testCase; i++)
{
scanf("%d %d", &base, &height);
triangle = 2 * (1/2.0 * base * height);
//triangle = triangle * 2;
printf("Case %d: %d\n\n",i+1, trian... | ALGO | 0.998623 | 4.28361 |
629fb640-78c6-42af-97c1-fb3514d91aa8 | Shunsuiky0raku/Task2 | Priority Handling.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
struct WordNode {
std::string word;
WordNode* next;
WordNode(const std::string& w) : word(w), next(nullptr) {}
};
class WordList {
private:
WordNode* head;
public:
WordList() : head(nullptr) {}
void insert(const std... | TOOL | 0.998206 | 6.661217 |
7c225f96-9ca2-41e9-aab3-5a6fe631e39d | Thre4dripper/LeetCode | 1008-construct-binary-search-tree-from-preorder-traversal/1008-construct-binary-search-tree-from-preorder-traversal.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.999989 | 6.455663 |
8ab64b2c-0ae0-4a9e-9cd7-66e08f50b46b | Ilars/Solving_Quadratic_Equations | Source.cpp | #include <iostream>
#include <cmath>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
vector<float> readCoefs(string infile_path) {
ifstream fin(infile_path);
vector<float> coefs(3);
for (int i = 0; i < 3; i++) {
fin >> coefs[i];
}
return coefs;
}
float findDiscrim... | ALGO | 0.998786 | 4.914133 |
49d3b316-aeed-4ed7-98b0-4ad778edb275 | Ayushsaini20/100-Days-Of-Code | DAY 49- Squares of a Sorted Array/Solution.cpp | class Solution {
public:
vector<int> sortedSquares(vector<int>& nums) {
vector<int> t;
for (int i = 0; i < nums.size(); i++)
t.push_back(nums[i] * nums[i]); // Square each element.
sort(t.begin(), t.end()); // Sort the squared values.
return t... | ALGO | 0.999994 | 6.270849 |
91cd3dca-9e1e-4563-b9b9-56a2d64fc539 | jaygithub2010/MyCode | NewPracticeC++/DigitalNumbers.cpp | #include"stdafx.h"
//#include<map>
//#include<iostream>
//#include<string>
//using namespace std;
//int main()
//{
// map<char,string> digitCodes { {'0',"1110111"}, {'1',"0010010" },{'2',"1011101"},{ '3',"1011011" },{'4',"0111010"},{ '5',"1101011" },{ '6',"1101111" },
// { '7',"1010010" },{ '8',"1111111" },{ '9',"11110... | ALGO | 0.99992 | 3.36782 |
70c9f75a-75f9-4163-aaf1-5f6f5f87b55e | sarvex/leetcode-coffeescript | solution/0900-0999/0947.Most Stones Removed with Same Row or Column/Solution.cpp | class Solution {
public:
vector<int> p;
int removeStones(vector<vector<int>>& stones) {
int n = 10010;
p.resize(n << 1);
for (int i = 0; i < p.size(); ++i) p[i] = i;
for (auto& stone : stones) p[find(stone[0])] = find(stone[1] + n);
unordered_set<int> s;
for (aut... | ALGO | 0.999605 | 5.608943 |
7c98430c-a122-47f0-ae2b-180eecf785b4 | shivamxverma/DSA | Dyanamic Programming/Coin_Combinations_I.cpp | #include <bits/stdc++.h>
#define fastIO \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define repr(i, a, b) for (int i = (a); i >= (b); i--)
#define printyes cout << "YES\n";
#define printno cout << "NO\n";
#define space " "
using namespace... | ALGO | 0.999992 | 4.426199 |
9b08ad62-0c7a-4883-8d6f-3765458d03cc | kundan6930/coding_contest | cses problem set/Dynamic Programming/Dice_Combinations.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
ll mod=1e9+7;
vector<vector<ll>>ans1;
ll solve(ll n,vector<vector<ll>>&dp,int pos,vector<ll>&ans)
{
if(n<0 || pos>6)
{
return 0;
}
if(n==0)
{
ans1.push_back(ans);
return 1;
}
// if(dp[n][pos]!... | ALGO | 0.99997 | 4.482094 |
1717f14c-6fcd-4596-abc3-211dcbf19081 | iamkuntal2002/Atlassian-DSA | arranginCoins.cpp | #include <bits/stdc++.h>
using namespace std;
int arrangeCoins(int n)
{
long s = 0;
long e = n;
while (s <= e)
{
long mid = s + (e - s) / 2;
long a = mid * (mid + 1) / 2;
if (a == n)
{
return mid;
}
if (a <= n)
{
s = mid +... | ALGO | 0.999926 | 5.867625 |
5a528a91-aa38-412b-95d5-27bb38f7fdfc | AdilMemon78/ADIL-MEMON-391-FLUTTER-DRIVE | home_pre_flutter/firebase_login_page/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.998938 | 6.785645 |
b964b0c9-4e1f-40b5-a166-ad8dec342ed8 | DannyInBlack/AAST-CPC | graph_theory_3/shortest routes 2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll d[505][505];
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, q;
cin >> n >> m >> q;
memset(d, 0x3f, sizeof(d));
for(int i = 0; i < m; ++i){
int a, b, w;
cin >> a >> b >> w;
d[a][b] ... | ALGO | 0.999958 | 4.486609 |
b2282e09-fee6-49c9-a6e6-0551ca5b0911 | waghkailas/LB | arrayofnnumbers.cpp | // accept N numbers from user and perform the addition of that n numbers
#include<iostream>
using namespace std;
class Array
{
private:
int *Arr;
int isize;
public :
Array(int);
~Array();
void Accept();
void Display();
int Addition();
};
Array :: Array(int no)
{
cout<<"insid... | ALGO | 0.966307 | 3.549437 |
a0812e19-d732-4804-8b00-e39629d521a2 | NikitaEvs/quicksort | src/qsort.cpp | #include "qsort.h"
#include "generator.h"
template <class elementType>
class Comparator {
public:
bool operator() (elementType &left, elementType &right) {
return left < right;
}
};
void allTest() {
Comparator<int32_t> comparator;
for (int32_t numbers = STEP; numbers <= MAX_COUNT; numbers += STEP) {
... | ALGO | 0.994172 | 5.745829 |
c281f4d3-7dcf-45c4-96b4-42df9de8beb3 | mdmahamudmredha/Problem_Solving_C_and_Cpp | CodeForces/A.)Way Too Long Words.cpp | /*
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
string s[100];
for(int i=0; i<n; i++){
cin>>s[i];
}
cout<<"\n";
for(int i=0; i<n; i++){
if(s[i].size()>10){
int j;
int cnt=0;
for(j=0;j<s[i].size();j++ ){
... | ALGO | 0.99922 | 4.122897 |
29192e94-029a-40bc-9902-ff42b48aaa98 | sreedhr92/Leetcode-Submissions | codes/accepted_codes/Linked List Cycle_451421271.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle(ListNode *head) {
if(head==NULL)
return false;
unordered_map<ListNode*,int> hash;
... | ALGO | 0.999826 | 4.995417 |
b25057f0-a49d-479a-b10e-0598589b767d | moti9/iCode | cp/B_Indivisible.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
void solvehere()
{
int n;
cin >> n;
if (n == 1)
{
cout << n << "\n";
return;
}
if (n & 1)
{
cout << "-1\n";
return;
}
for (int i = 1; i <= n / 2; i++)
{
... | ALGO | 0.999782 | 4.956203 |
a5b54fd0-10dd-41b4-a0f6-42738c53ba75 | PhillipDiCarlo/The-Corruptor | ASRC Systems Simulation Driver/boost_1_74_0/libs/type_traits/examples/copy_example.cpp | #include <iostream>
#include <typeinfo>
#include <algorithm>
#include <iterator>
#include <memory>
#include <boost/test/included/prg_exec_monitor.hpp>
#include <boost/timer.hpp>
#include <boost/type_traits.hpp>
using std::cout;
using std::endl;
using std::cin;
namespace opt{
//
// opt::copy
// same semantics as std... | ALGO | 0.962766 | 5.917429 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.