uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
51f4e1c4-7ba9-44aa-a96c-a23c9d43b08b | hjwdzh/Manifold | 3rd/igl/copyleft/quadprog.cpp | #include "quadprog.h"
#include <vector>
#include <Eigen/Dense>
IGL_INLINE bool igl::copyleft::quadprog(
const Eigen::MatrixXd & G,
const Eigen::VectorXd & g0,
const Eigen::MatrixXd & CE,
const Eigen::VectorXd & ce0,
const Eigen::MatrixXd & CI,
const Eigen::VectorXd & ci0,
Eigen::VectorXd& x)
{
... | ALGO | 0.999975 | 6.006529 |
e14d2148-4ae4-4bd7-98f7-37fe927c0c9d | Azivast/1DV533 | Practical Applications 4/Part B/Task1.cpp | //------------------------------------------------------------------------------
// File: Task1.cpp
// Summary: Reverses and stores a c-string
// Version: 1
// Author: Olle Astré
//------------------------------------------------------------------------------
// Log: 2021-12-18 Created by Olle.
//
//----------------... | ALGO | 0.966195 | 4.865849 |
6df04369-b90b-4cca-bf2b-0580a644e237 | javagovindsharma/leetscode | solution/0100-0199/0144.Binary Tree Preorder Traversal/Solution3.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.999999 | 6.368781 |
3a2778c4-0f8b-4fd1-b134-62bf1da3760d | brightskiesinc/Reverse_Time_Migration | libs/SeismicOperations/src/components/primitive/independents/boundary-managers/SpongeBoundaryManager.cpp | #include <iostream>
#include <cmath>
#include <bs/base/api/cpp/BSBase.hpp>
#include <operations/components/independents/concrete/boundary-managers/SpongeBoundaryManager.hpp>
#include <operations/configurations/MapKeys.h>
#include <operations/components/independents/concrete/boundary-managers/extensions/HomogenousExte... | ALGO | 0.974845 | 6.023818 |
b2d7289a-fe73-4e86-b8df-723fed38fa44 | Sanskar31/CodeForces-Solutions | EqualRectangles.cpp | /*
Author: Sanskar Agarwal
Nick: sanskaragarwal
Birla Institute Of Technology, Mesra
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F(i,a,b) for(ll i = (ll)(a); i <= (ll)(b); i++)
#define RF(i,a,b) for(ll i... | ALGO | 0.999885 | 3.929303 |
cfaf2477-5fc5-4e9f-8de9-1a2005b78570 | HardwareBug/testGA | temp.cpp | #define EIGEN_NO_DEBUG
#define EIGEN_DONT_VECTORIZE
#define EIGEN_DONT_PARALLELIZE
#define EIGEN_MPL2_ONLY
#include "Eigen/Dense"
#include <vector>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <math.h>
#include <time.h>
#include <random>
#include <optional>
#include <time.h>
//std::random_devi... | ALGO | 0.999646 | 3.32883 |
fa94d5d2-6214-4716-924a-47806164d8b6 | MinotiMondal/todoApp | 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 |
3213a2b1-7604-4076-9915-5257cf7a7b39 | izlyforever/cf | contest/1453/b/b.cpp | #include <bits/stdc++.h>
#define watch(x) std::cout << (#x) << " is " << (x) << std::endl
using LL = long long;
int main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
int cas = 1;
std::cin >> cas;
while (cas--) {
int n;
std::cin >> n;
std::vector<int> a(n), b;
for (auto& x : a) std::cin >>... | ALGO | 0.999832 | 4.649695 |
7110495d-42f7-4242-b1f1-f69299aacd74 | Sahilamin219/Interview-Prepration | goldman/mygraph.cpp | #include<bits/stdc++.h>//adjecent list
using namespace std;
//for edge directed
void oneway(vector <int> adj[], int a, int b){//a is source and b is destination
adj[a].push_back(b);
}
//if not edge directed
void join(vector <int> adj[], int a, int b){
adj[a].push_back(b);
adj[b].push_back(a);
}
//weighted ... | ALGO | 0.999939 | 4.503161 |
830f1323-d7ca-4ca1-b852-f7b93c38c7b0 | lcultx/fork-om3d | 3DObjectManipulation/3rdparty/pbrt/accelerators/bvh.cpp | // accelerators/bvh.cpp*
#include "stdafx.h"
#include "accelerators/bvh.h"
#include "probes.h"
#include "paramset.h"
// BVHAccel Local Declarations
struct BVHPrimitiveInfo {
BVHPrimitiveInfo() { }
BVHPrimitiveInfo(int pn, const BBox &b)
: primitiveNumber(pn), bounds(b) {
centroid = .5f * b.pMin... | ALGO | 0.999839 | 7.161611 |
72cef589-fb0c-48be-9c68-0c8b2d479e04 | JiaZe-Chong/LeetCode | 0143-reorder-list/0143-reorder-list.cpp | /**
* 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(x), next(next) {}
* };
*/
class Solution {
public:
void reorderList(List... | ALGO | 0.999993 | 5.732812 |
cc56b9f7-3148-4c2a-b4da-24b0fe1ce386 | asad-shuvo/ACM | Online Judge/HackerRank/Circular Array Rotation.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
// Complete the circularArrayRotation function below.
vector<int> circularArrayRotation(vector<int> a, int k, vector<int> queries) {
k=k%a.size();
int k1=a.size()-k;
vector<int>v;
for(int i=k1;i<a.size();i++){
v.push_back(a[i]);
... | ALGO | 0.999874 | 3.870532 |
b9f531b5-3b1b-480c-807f-5dcb041c174a | CarolinaMoura/oi | APIO/2019/street_lamps.cpp | /*
APIO 2019 - Street Lamps (Street Lamps)
*/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimization ("O2")
#define lp(i,a,b) for(int i = a; i < b; i++)
#define pb push_back
#define sz(x) (int)(x.size())
#define a... | ALGO | 0.99933 | 4.121937 |
8231e416-c774-4353-bbe4-8488f489502e | Garciat/competitive | leetcode/rotate-image.cpp | // https://leetcode.com/problems/rotate-image/
class Solution {
struct Pos { int i, j; };
public:
void rotate(vector<vector<int>>& m) {
// for every k-th layer:
for (int k = 0; k < m.size() / 2; ++k) {
// it has n*n size:
int n = m.size() - k * 2;
// apply our 'spiral' rotatin... | ALGO | 0.99995 | 6.57894 |
e41f4508-c317-47c1-b2d4-69d21c32c2e1 | RQuispeC/CPproblemsSolved | Longest Common Pattern.cpp | #include<iostream>
#include<cstring>
#define MAX 125
using namespace std;
int letrasA[MAX];
int letrasB[MAX];
int main()
{
int tested;
cin>>tested;
while(tested--)
{
memset(letrasA, 0, sizeof letrasA);
memset(letrasB, 0, sizeof letrasB);
string a, b;
cin>>a>>b;
for(int i=0;i<a.size();i++)
letrasA[a[i]]... | ALGO | 0.999952 | 4.280454 |
fa7db1cc-8fe4-445c-b37a-f3455ad1069d | lijiayu0725/IntroductionToAlgorithms | insertion_sort.cpp | //
// Created by Nick on 2018/10/9.
//
#include <iostream>
#include <vector>
using namespace std;
void swap(int &a, int &b) {
int temp = a;
a = b;
b = temp;
}
void insertion_sort(vector<int> &A) {
for(int i = 1; i < A.size(); i++) {
int key = A[i];
int j = i - 1;
while(j >= 0 &... | ALGO | 0.999925 | 5.673373 |
b6fbf089-87c4-48e8-a5d8-15979dc07262 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/arc064/A/4401675.cpp | #include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
typedef unsigned int uint;
using namespace std;
int main() {
int n;
ll x;
cin >> n >> x;
... | ALGO | 0.999961 | 4.30321 |
f1d272a5-4f59-4c57-8cb2-eda28f91d4a4 | sarvex/leetcode-ksh | solution/0100-0199/0174.Dungeon Game/Solution.cpp | class Solution {
public:
int calculateMinimumHP(vector<vector<int>>& dungeon) {
int m = dungeon.size(), n = dungeon[0].size();
int dp[m + 1][n + 1];
memset(dp, 0x3f, sizeof dp);
dp[m][n - 1] = dp[m - 1][n] = 1;
for (int i = m - 1; ~i; --i) {
for (int j = n - 1; ~j... | ALGO | 0.999783 | 6.070071 |
f27c9b86-1c80-4fbd-8ff0-216558912393 | omnibor/llvm-omnibor | llvm-project/clang-tools-extra/clang-move/HelperDeclRefGraph.cpp | #include "HelperDeclRefGraph.h"
#include "Move.h"
#include "clang/AST/Decl.h"
#include "llvm/Support/Debug.h"
#include <vector>
#define DEBUG_TYPE "clang-move"
namespace clang {
namespace move {
void HelperDeclRefGraph::print(raw_ostream &OS) const {
OS << " --- Call graph Dump --- \n";
for (auto I = DeclMap.beg... | TOOL | 0.873258 | 7.772337 |
92283063-c416-4742-850f-0cb1bd8511b4 | Tayeb-Ahmed-TAS/CPP | Introduction of C++/Class & Object/STL/Map/update_map.cpp | #include <iostream>
#include <map>
using namespace std;
template <class t1, class t2>
void display(map<t1, t2> &m) {
cout << endl << "Displaying map: " << endl;
typename map<t1, t2>::iterator it;
for (it = m.begin(); it != m.end(); it++) {
cout << it->first << "\t" << it->second << endl;
}
}
int main... | TOOL | 0.962087 | 5.294658 |
d5be3f16-8499-4e38-b41a-f8564164c65b | TodorokiKohei/atcoder | 2022_03/26/abc245b.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define all(x) (x).begin(),(x).end() // 昇順ソート
#define rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#d... | ALGO | 0.999819 | 3.893907 |
19f119f3-ceab-46ea-9a65-33f2cc151784 | Philaserpher/compression_algorithm | Old/decompress.cpp | #include <string>
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
string decompress(string original_str)
{
string output_str = "";
char previous_character = original_str[0];
bool number_found = false;
char last_letter = original_str[0];
int string_length = original_s... | TOOL | 0.93088 | 3.746732 |
3fabe49e-25b0-42e8-b149-7a8fd426f138 | MonstarCoder/MyAlgorithms | ch02/MaxSequenceSum.cpp | #include <iostream>
int main()//寻找一个数组中按顺序相加的最大和
{
int array1[5] = {-1, 0, 1, 2, 3};
int ThisSum = 0, MaxSum = 0;
for ( int i = 0; i != 5; ++i)
{
ThisSum += array1[i];
if (ThisSum > MaxSum)
MaxSum = ThisSum;
else if (ThisSum < 0)
ThisSum = 0;
}
... | ALGO | 0.999331 | 3.800027 |
7358ad8f-7ee2-4db0-9e1f-bf521084f954 | Janmansh/CompetitiveProgramming | Codeforces/Codeforces Round 656 Div. 3/B_Restore_the_Permutation_by_Merger/B_Restore_the_Permutation_by_Merger.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
long long t,a,b,c,n,i,j,m;
cin>>t;
while(t--){
cin>>n;
long long a[2*n],c[n],c1[n];
vector<long long>v;
for(i=0;i<n;i++)c[i]=0,c1[i]=0;
for(i=0;i<2*n;i++){cin>>a[i];c[a[i]-... | ALGO | 0.999958 | 3.807902 |
c81863ba-55c0-488e-b084-d6130bb7585b | antonvw/wex | src/stc/link.cpp | #include <boost/algorithm/string.hpp>
#include <boost/tokenizer.hpp>
#include <wex/stc/link.h>
#include <wex/stc/stc.h>
#include <wex/syntax/path-lexer.h>
#include <wex/ui/frame.h>
#include <wex/ui/item-vector.h>
#include <wx/app.h>
// prevent very long lines to be returned, e.g. by json config files,
// as that cause... | TOOL | 0.932071 | 6.642798 |
505f75e8-4938-4f73-9c02-834c52248c63 | kumarshikhardeep/Interviewbit-Solution | Bit Manipulation/Min XOR value.cpp | int Solution::findMinXor(vector<int> &A) {
sort(A.begin(),A.end());
int min=INT_MAX;
for(int i=0;i<A.size()-1;i++)
{
int t=A[i]^A[i+1];
if(t<min)
min=t;
}
return min;
}
| ALGO | 0.999974 | 4.846262 |
6794b1a1-93ee-4f25-a06c-080af54ada9b | Codetesing/SW-Expert-Academy | D3/EX-11736.cpp |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(int argc, char** argv)
{
int test_case;
int T;
cin >> T;
/*
Ʈ ̽ ־Ƿ, óմϴ.
*/
for (test_case = 1; test_case <= T; ++test_case)
{
int N;
cin >> N;
vector<int> v(N);
for (int i = 0; i < N; i++)
cin >> v[i]... | ALGO | 0.999379 | 3.963261 |
940f7748-ac5d-453e-a194-e392e48d1a0c | deepakasu67/leetcode | Old Leetcode/9. Rotting Oranges.cpp | #include<iostream>
#include <queue>
#include<vector>
using namespace std;
class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
queue<pair<int, int>> rotten;
int r = grid.size(), c = grid[0].size(), fresh = 0, t = 0;
for (int i = 0; i < r; ++i) {
for (int j = 0... | ALGO | 0.999877 | 5.906424 |
72dc93b7-eb92-4e88-af71-f6f3ce4d4729 | Drink7/LeetCode | 0066-plus-one/0066-plus-one-08-09-2025-02-07-40.cpp | class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
/*
// Brute Force (Runtime Error) (runtime error: signed integer overflow)
// Transform to int, plus 1, then transform back to int array
// TC: O(n)
// SC: O(n)
int n = digits.size();
long ans... | ALGO | 0.99989 | 6.841126 |
a1e191c6-8a37-4e75-a59d-070a7b77e069 | hv65616/Data-Structures-and-Algorithms | DP By Stiver/DP9.cpp | // Dp On Grids
// Leetcode - Cherry Pickup 2
#include <bits/stdc++.h>
using namespace std;
// Method-1 : Recursion
int findans1(int i, int j1, int j2, int m, int n, vector<vector<int>> &grid)
{
if (i >= m || j1 < 0 || j1 >= n || j2 < 0 || j2 >= n)
return -1e7;
if (i == m - 1)
{
if (j1 == j2)... | ALGO | 0.999985 | 5.591457 |
88a4cb32-d64d-422c-a35c-fee67137081c | replayan/Leetcode-Problems | Linked-List/2170-count-number-of-maximum-bitwise-or-subsets/count-number-of-maximum-bitwise-or-subsets.cpp | class Solution {
void dfs(const vector<int>& nums, int ind, int v, int& best, int& num) {
if (ind >= nums.size()) {
if (v > best) {
best = v;
num = 1;
} else if (v == best) {
++num;
}
return;
}
df... | ALGO | 0.999992 | 6.412574 |
5e7e80bc-64a9-49d9-bb53-564e1a1bfd43 | ziennaa/dsa | ICPC algo queen practice/E. Bitwise sum.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
int T;
cin >> T;
while(T--){
int N;
cin >> N;
ll even = 0;
for(int i = 0; i < N; i++){
int a;
cin >> a;
if ((a & 1) == 0)
even++;
}
... | ALGO | 0.999779 | 5.12333 |
c5a4dce2-1b88-4a47-b2db-3b9c973c450a | Juegos-ASADOS/El-Horno | ElHorno/dependencies/Bullet/Src/examples/MultiBody/MultiDofDemo.cpp | #include "MultiDofDemo.h"
#include "../OpenGLWindow/SimpleOpenGL3App.h"
#include "btBulletDynamicsCommon.h"
#include "BulletDynamics/MLCPSolvers/btDantzigSolver.h"
#include "BulletDynamics/MLCPSolvers/btLemkeSolver.h"
#include "BulletDynamics/MLCPSolvers/btSolveProjectedGaussSeidel.h"
#include "BulletDynamics/Feather... | ALGO | 0.955634 | 6.421885 |
a655547c-9fa2-47b5-9558-e24dfe477c81 | nohyoonko/Algorithm-Study | Programmers/kthNumber.cpp | /*
* Programmers - Kth Number
* Sort Lv.1
* 2020.08.18
*/
#include <iostream>
#include <vector>
#include <algorithm> //sort()
using namespace std;
vector<int> solution(vector<int> array, vector<vector<int>> commands) {
vector<int> answer;
int start, end, nth;
for (int i = 0; i < commands.size(); i++) {
... | ALGO | 0.999977 | 5.512862 |
41b192b4-791d-4897-b883-346859cb95f3 | lx709/REOBench | Segmentation/mmdet/ops/box_iou_rotated/src/box_iou_rotated_cpu.cpp | template <typename T>
void box_iou_rotated_cpu_kernel(
const at::Tensor& boxes1,
const at::Tensor& boxes2,
const bool iou_or_iof,
at::Tensor& ious) {
auto num_boxes1 = boxes1.size(0);
auto num_boxes2 = boxes2.size(0);
for (int i = 0; i < num_boxes1; i++) {
for (int j = 0; j < num_boxes2; j++)... | ALGO | 0.99417 | 6.745844 |
18f6c576-c990-4178-9352-522fcea748c1 | rudra4365/Algorithmic-toolbox | week5_dynamic_programming1/3_edit_distance/edit_distance.cpp | #include <iostream>
#include <string>
using std::string;
int edit_distance(const string &str1, const string &str2) {
//write your code here
return 0;
}
int main() {
string str1;
string str2;
std::cin >> str1 >> str2;
std::cout << edit_distance(str1, str2) << std::endl;
return 0;
}
| ALGO | 0.999991 | 4.876193 |
ef6b534d-09ae-4d4f-bf89-c407fabcdd2e | wondol2/ps | problems/baekjoon/10844.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#define debug(x)
#endif
int N;
long long dp[101][10];
long long sol(int n, int num){
// if(n == 0) return 0;
if(n == 1) return 1;
long long &ret = dp[n][num];
if(ret != -1) return ret;
ret = 0;
if... | ALGO | 0.999668 | 4.818769 |
b9ed4f36-5a5b-4b46-af9b-852b3f7c3939 | TawhidShakil/Algorithm_LabTest | quick.cpp | #include<bits/stdc++.h>
using namespace std;
int partition_arry(int arr[], int start, int end){
int pivot = arr[end];
int partitionIndex = start;
for(int i=start; i<end; i++){
if(arr[i]<= pivot){
swap(arr[i], arr[partitionIndex]);
partitionIndex++;
}
}
swap(ar... | ALGO | 0.999971 | 5.388216 |
1326276b-494e-4445-bff1-b50deb426c75 | ZyyGitHub/cplusplus | arrList/arrList/main.cpp | #include <iostream>
#include "arrList.h"
using namespace std;
int main()
{
arrList<int> array1(10);
for (int i = 0; i < 10; i++)
{
array1.apendArr(rand()%100 +1);
}
array1.showArr();
arrList<int> array2(10);
for (int i = 0; i < 10; i++)
{
array2.apendArr(i);
}
array2.showArr();
array2.deleteArr(3);
a... | TOOL | 0.855785 | 3.639664 |
a006b3d9-dfd3-4833-a0f3-62118a245bbe | antonpk1/stackfish | www/app/services/algo_rag_data/data_structure/mos_with_updates.cpp | #include <bits/stdc++.h>
using namespace std;
struct query {
int l, r, index, t;
};
struct update_query {
int pos, value, prev;
};
struct data_structure {
int m[26];
int cnt;
data_structure() : m{}, cnt{0} {}
void add(int x) {
if (m[x]++ == 0)
++cnt;
}
void rem... | ALGO | 0.99996 | 4.804825 |
6aebd445-7202-428f-bdcc-c275a5265571 | VVVVVan/CSC2520_final | libigl/include/igl/triangle/scaf.cpp | #include "scaf.h"
#include "triangulate.h"
#include <Eigen/Dense>
#include <Eigen/IterativeLinearSolvers>
#include <Eigen/Sparse>
#include <Eigen/SparseCholesky>
#include <Eigen/SparseQR>
#include "../PI.h"
#include "../Timer.h"
#include "../boundary_loop.h"
#include "../cat.h"
#include "../doublearea.h"
#include "../... | ALGO | 0.999087 | 4.123697 |
358eb818-b258-4bbe-b865-2d3b801d1777 | hoangmanhkhiem/Data-Structure-And-Algorithms | algorithms/phi.cpp | // To find positive integers below n that are relatively prime
// i.e. 36 = 2^3 * 3^2, Phi(36) = 36 * (1 - 1/2)* (1 - 1/3) = 12
int phi (int n) {
if ( n == 1 )
return 0;
int output = n;
if ( n % 2 == 0 ) {
output -= (output / 2);
while ( n % 2 == 0 )
n /= 2;
}
... | ALGO | 0.999973 | 5.564115 |
26281fcb-4d39-4315-bc8d-c02bfbe73bda | Lunaris-AOSP/frameworks_av | media/module/codecs/amrnb/enc/src/qgain475.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/qgain475.c
Funtions: MR475_quant_store_results
MR475_update_unq_pred
MR475_gain_quant
------------------------------------------------------------------------------
MODULE DESCRIP... | ALGO | 0.976606 | 5.330545 |
d031950e-9548-4166-b486-8bd80f8bdb34 | manish-raw/Hacker-Rank-Solutions | C++/var-sized-array.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, q, size, value, which, index;
cin >> n >> q;
vector<vector<int>> nvec;
for (int i = 0; i < n; ++i){
cin >> size;
vector<int> ivec;
for (int j = 0; j < size; ... | ALGO | 0.999765 | 3.446117 |
97881f6f-ea08-4dfa-906c-97c981656bac | techySPHINX/Cpp_Learning_DSA | dynamic_problems/my_practice/minimum_complete_project.cpp | #include <iostream>
#include <vector>
#include <climits>
#include <queue>
using namespace std;
struct Edge {
int to;
int cost;
};
int minCostToCompleteProject(int n, vector<pair<int, pair<int, int>>>& edges) {
vector<vector<Edge>> graph(n);
vector<int> inDegree(n, 0);
for (const auto& edge :... | ALGO | 0.999973 | 6.415021 |
ae5af05d-abb1-454f-8043-18c6c8911875 | tkfkadlsi/Portfolio | BAEKJOON/SILVER 4/2164(카드2).cpp | #include <iostream>
#include <queue>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
queue<int> qint;
cin >> n;
for (int i = 1; i <= n; i++)
{
qint.push(i);
}
while (qint.size() > 1)
{
qint.pop();
int i = qint.front();
qint.pop();
qint.push(i);
}
cout << qi... | ALGO | 0.999875 | 3.481739 |
c02074aa-db35-45cb-8072-6d3d23a430de | pmp-library/pmp-library | src/pmp/io/read_stl.cpp | #include "pmp/io/read_stl.h"
#include "pmp/io/helpers.h"
#include <limits>
#include <map>
namespace pmp {
// comparison operator for vec3
struct CompareVec3
{
bool operator()(const vec3& v0, const vec3& v1) const
{
if (fabs(v0[0] - v1[0]) <= eps_)
{
if (fabs(v0[1] - v1[1]) <= eps... | TOOL | 0.886162 | 6.927356 |
eb6320a7-174a-46c8-b062-95c208d87f22 | DyhaCreator/programming_tasks | tinkoff/perebor/b.cpp | #include <iostream>
#include <vector>
#define ll long long
using namespace std;
int z;
void rec(int n, vector<int>a) {
if (n == 0) {
for (auto x : a)
cout << x;
cout << endl;
return;
}
a.push_back(0);
rec(n - 1, a);
for (int i = 0; i < z; i++) {
a[a.size... | ALGO | 0.999555 | 3.294661 |
8a21bbf7-6b70-4122-8e7b-731d70efbe56 | fwdzh/cp_code | Codeforces/2123/A.cpp | // 你醒来,发现自己回到了大一……
// 这一次,你下定决心:要成为 Candidate Master。
#include<bits/stdc++.h>
using namespace std;
// created: 2025-07-05 17:58:17
void solve(){
int n;
cin >> n;
if(n % 4 == 0) cout << "Bob\n";
else cout << "Alice\n";
}
int main(){
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
... | ALGO | 0.999713 | 4.066907 |
cb64b74f-e8d6-4af4-990d-b36a9fa2b6f7 | Nakib-Arman/CSE318---ArtificialIntelligence | 3.ChainReaction/.history/main_20250610083732.cpp | #include <bits/stdc++.h>
using namespace std;
class Cell {
int orb_num;
int critical_mass;
char color;
public:
Cell() {
this->orb_num = 0;
this->color = 'W';
this->critical_mass = 4;
}
// Cell(int orb_num, char color) {
// this->orb_num = orb_num;
// t... | ALGO | 0.998852 | 4.802503 |
4991fc00-f6b3-4ad5-9614-683a6b5f7d93 | aditiagarwal30/Data-Structures-Algorithms | Leetcode/Jump Game III.cpp | class Solution {
public:
bool canReach(vector<int>& arr, int start) {
unordered_map<int,vector<int>> mp;
for(int i=0;i<arr.size();i++){
mp[i].push_back(i+arr[i]);
mp[i].push_back(i-arr[i]);
}
vector<int> vis(arr.size(),0);
vis[start]=1;
queue<... | ALGO | 0.999992 | 5.436756 |
a786e8f8-2032-47dd-ba6f-3497b1f63f18 | hmahajan99/InterviewBit-Solutions | Math/Adhoc/FizzBuzz.cpp | // Given a positive integer A, return an array of strings with all the integers from 1 to N.
// But for multiples of 3 the array should have “Fizz” instead of the number.
// For the multiples of 5, the array should have “Buzz” instead of the number.
// For numbers which are multiple of 3 and 5 both, the array should ha... | ALGO | 0.999246 | 5.561082 |
5523672b-4259-43fa-b8b2-f0ad872c985d | mrreda1/problem-solving | codeforces/ACPCTeams.cpp | #include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define make_unique(x) sort(all(x)), x.erase(unique(all(x)), x.end())
using namespace std;
template <typename T> T nxt();
template <typename T> class is_iterable {
public:
template <typename U>
static auto test(U... | ALGO | 0.999744 | 4.587578 |
17d052cf-b5d1-4408-ba94-de34db0812b6 | bansalmukul-cse/LeetCode-Codes | 947. Most Stones Removed with Same Row or Column.cpp | class Solution {
public:
int n;
vector<int>vis;
void dfs(int idx,vector<vector<int>> &stones){
vis[idx] = 1;
for(int i=0;i<n;i++){
if(vis[i]) continue;
if(stones[idx][0] == stones[i][0] || stones[idx][1] == stones[i][1]){
dfs(i,stones);
}
... | ALGO | 0.99993 | 5.489225 |
e93f56b6-739f-4c10-b14b-1a1acf42ceb2 | Roma321/matrix-lab | openMP.cpp | #include "omp.h"
#include <iostream>
#include <chrono>
template <
class result_t = std::chrono::milliseconds,
class clock_t = std::chrono::steady_clock,
class duration_t = std::chrono::milliseconds>
auto since(std::chrono::time_point<clock_t, duration_t> const &start)
{
return std::chrono::duration_cast<r... | ALGO | 0.99421 | 4.461352 |
260d0d9e-7d4a-4b94-a61d-a14f674d87fc | ishandutta2007/codeforces | enanimant/normal/1616/B.cpp | /*
* author: ADMathNoob
* created: 12/29/21 10:35:14
* problem: https://codeforces.com/contest/1616/problem/B
*/
/*
Comments about problem:
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int tt;
cin >> tt;
while (tt--) {
int n;
string s;
... | ALGO | 0.999992 | 4.494251 |
05d6fe7a-75fc-4da6-940b-78fb30622ca0 | gavinspet/sde_loop | 01-dsa/binary_tree/height.cpp | #include "common.h"
#include <bits/stdc++.h>
using namespace std;
// method-1 : height of a binary tree - recursive
int height_1(node *root) {
if (root == NULL)
return 0;
return (1 + max(height_1(root->left), height_1(root->right)));
}
// method-1 : height of a binary tree - iterative
int height_2(node *root... | ALGO | 0.999873 | 5.937147 |
0029f4d6-db3f-4aae-a86c-1bee69ed0cec | SaiSrujanReddyP/GFG-POTD | 25-04-2025.cpp | class Solution {
public:
int majorityElement(vector<int>& arr) {
int candidate = -1, count = 0;
for (int num : arr) {
if (count == 0) {
candidate = num;
count = 1;
} else if (num == candidate) {
count++;
} else {
... | ALGO | 0.999961 | 5.525568 |
76db1c2a-29c3-4cc4-93e7-79897bc6c660 | kelvindk/Video-Stabilization | boost_1_42_0/libs/graph/example/topo-sort-with-sgb.cpp | int
main()
{
using namespace boost;
const int n_vertices = 7;
Graph *sgb_g = gb_new_graph(n_vertices);
const char *tasks[] = {
"pick up kids from school",
"buy groceries (and snacks)",
"get cash at ATM",
"drop off kids at soccer practice",
"cook dinner",
"pick up kids from soccer",
... | ALGO | 0.998979 | 5.115013 |
541eac44-2169-4054-8306-f6949a55c804 | Iftekhar-Ahamed/Code | C_Select_Mul.cpp | /***
** Bismillahir Rahmanir Rahim
** ALLAHU AKBAR
**
** Author: Iftekhar Ahamed Siddiquee
** Bangladesh University of Business and Technology,
** Dept. of CSE.
***/
#include <bits/stdc++.h>
using namespace std;
#define read freopen("0_input.txt", "r", stdin)
#define write freopen("0_outp... | ALGO | 0.999956 | 4.778572 |
362bb345-5e9e-49ce-b2c4-6dc3de8593b6 | kunljha/LeetCode | 318-maximum-product-of-word-lengths/318-maximum-product-of-word-lengths.cpp | class Solution {
public:
int maxProduct(vector<string>& words) {
int n = words.size();
int maxProd = 0, currProd = 0;
vector<bitset<26>> chars(n); // array of bitsets which will store bitset of every string from words-array
for(int i = 0; i < n; i++) {
f... | ALGO | 0.999958 | 6.007997 |
634df45f-56cb-46fe-a22d-ca8fdd0b8bcf | gsp2886/CPP_Assignments | Assignment 25/Q8.cpp | /*
8. Define a class Rectangle and define an instance member function to find the area of the
rectangle
*/
#include<iostream>
using namespace std;
class Rectangle
{
int length,breadth,Area;
public:
Rectangle(int l,int b)
{
length=l;
breadth=b;
}
void AreaRect()
{
Area=l... | TOOL | 0.853251 | 4.689051 |
d4e9d147-1ea6-4550-83c7-5687119ebbf9 | venkat2392/cpp | referencefun.cpp | #include<iostream>
using namespace std;
int function(int &a,int &b)
{
a=a+a;
b=b+b;
}
int main()
{
cout<<"before reference function calling:"<<endl;
int a=5,b=10;
cout<<"a="<<a<<endl<<"b="<<b<<endl;
cout<<"after reference function calling:"<<endl;
function(a,b);
cout<<"a="<<a<<endl<<"b="<<b<<endl;
}
| ALGO | 0.986226 | 4.561973 |
23da6170-e9c5-4bc1-935e-a1ea2b080653 | siddhesh-desai/kickgo | 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.998859 | 6.785645 |
49d65ad3-4e07-4900-bac7-e27be79e5f3e | bluewhitesheen/Leetcode | assign-cookies/Accepted/1-1-2024, 2_28_26 PM/Solution.cpp | // https://leetcode.com/problems/assign-cookies
class Solution {
public:
int findContentChildren(vector<int>& g, vector<int>& s) {
sort(g.begin(), g.end());
sort(s.begin(), s.end());
int ans = 0, j = 0, gn = g.size(), sn = s.size();
for(int i = 0; i < sn; i++){
if(j >= g... | ALGO | 0.99994 | 6.085996 |
868a060b-0775-4b63-9449-c05e434ca005 | saraali13/OS | Lab 2/Post Lab/Q2/Q2.cpp | #include <iostream>
#include <cstdlib>
#include <fstream>
#include <algorithm>
using namespace std;
int findMissing(int arr[], int n)
{
int max = *max_element(arr, arr + n); // Find max number in the list
int min = *min_element(arr, arr + n); // Find min number in the list
// Correct formula for expected ... | ALGO | 0.995749 | 4.692992 |
90438529-44aa-40d4-b802-79627f2ff3a0 | trinhminhtriet/leetcode | solutions/1600-1699/1666.change-the-root-of-a-binary-tree/Solution.cpp | /*
// Definition for a Node->
class Node {
public:
int val;
Node* left;
Node* right;
Node* parent;
};
*/
class Solution {
public:
Node* flipBinaryTree(Node* root, Node* leaf) {
Node* cur = leaf;
Node* p = cur->parent;
while (cur != root) {
Node* gp = p->parent;
... | ALGO | 0.999979 | 6.307551 |
da741804-04ac-42d5-b01c-c8d5a9131821 | Sai2307l/LeetCode | 3773-minimum-pair-removal-to-sort-array-i/minimum-pair-removal-to-sort-array-i.cpp | class Solution {
public:
bool isNondecreasing(vector<int>& nums){
for(int i=1;i<nums.size();i++){
if(nums[i]<nums[i-1]){
return false;
}
}
return true;
}
int minimumPairRemoval(vector<int>& nums) {
int ops=0;
while(!isNondecreas... | ALGO | 0.999941 | 5.867821 |
1b2ea8ff-97cb-4312-9d3d-640bfd4c4b91 | n01e0/pRETzel_logic | libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp | // <algorithm>
// template<LessThanComparable T>
// pair<const T&, const T&>
// minmax(const T& a, const T& b);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
template <class T>
void
test(const T& a, const T& b, const T& x, const T& y)
{
std::pair<const T&, const T&> p = std::minmax(a, b);... | TEST | 0.967119 | 5.790234 |
2c53f3f0-37e9-4e1a-96ac-0b99a434466f | lumunge/100-days-of-code | Algorithms/ArrayAlgorithms/KadanesAlgorithm/CpSolns/maxLenPosProd-1567.cpp | // Leetcode #1567 - Maximum length of subarray with positive product
#include<iostream>
#include<vector>
using std::max; using std::vector;
using std::cout; using std::endl;
class Solution{
public:
int maxLen(vector<int>& nums){
int n = nums.size();
int maxLen = 0, neg = 0;
... | ALGO | 0.999981 | 5.930907 |
0e5a8669-b7d9-4e8e-84d7-d8cbdc6e978d | jerryxu20/kattis | pizza.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
int grid[100][100];
int main() {
int T; cin >> T;
while(T--) {
int m, n; cin >> m >> n;
vector<pi> X, Y;
int sm = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
c... | ALGO | 0.999778 | 5.315706 |
29578085-f7a9-4093-9654-7c3c8af25b54 | sarvex/leetcode-shakespeare | solution/2500-2599/2540.Minimum Common Value/Solution.cpp | class Solution {
public:
int getCommon(vector<int>& nums1, vector<int>& nums2) {
int m = nums1.size(), n = nums2.size();
for (int i = 0, j = 0; i < m && j < n;) {
if (nums1[i] == nums2[j]) {
return nums1[i];
}
if (nums1[i] < nums2[j]) {
... | ALGO | 0.999996 | 5.537623 |
312f333b-45c1-4c67-b875-0e172bf05332 | runlnr/solid-octo-sniffle | Codeforces/515C - Drazil And Factorial.cpp |
#include <bits/stdc++.h>
#define ss second
#define ff first
#define endl "\n"
#define sp ' '
#define pback push_back
using namespace std;
typedef long long ll; typedef string str;
//chetmeorroiroiorr
str check(char p) {
string s;
s += p;
if(p == '4') return "322";
if(p == '6') return "53";
if(p ... | ALGO | 0.999751 | 5.067582 |
c433d4dd-2358-4b36-97d1-b8b497163e9e | Rhithick02/C-code | Misc/Codeforces/1383C1.cpp | #include<bits/stdc++.h>
using namespace std;
#define lli long long
#define For(i,a,n) for(int i=(a);i<n;i++)
#define vi vector<int>
#define vil vector<long long>
#define asc(x) x.begin(),x.end()
#define des(x) x.rbegin(),x.rend()
#define pb push_back
#define pa pair<int,int>
#define pal pair<long long,long long>
#defin... | ALGO | 0.999969 | 3.357018 |
b6c1e0a9-dd64-491a-a640-f274148bde9f | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6065_3.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int i, j, k, m, n, l, ans;
int v[6000];
int s[6000];
int a[6000];
while (scanf("%d", &n) != EOF) {
memset(v, 0, sizeof(v));
for (i = 1; i <= n; i++) {
scanf("%d", &a[i]);
v[a[i]] = 1;
}
ans = 0;
k = 0;
for (i = 1; i... | ALGO | 0.999822 | 3.420497 |
694fde12-a86e-4865-bb3a-0ff8dd5fa078 | nvorderryy/FOSE_Lab9 | main-project/sort.cpp | #include "sort.h"
#include <algorithm>
#include <cstring>
using namespace std;
void insertion_sort(internet_protocol* array[], int size, int (*compare)(const internet_protocol*, const internet_protocol*))
{
for (int i = 1; i < size; i++)
{
internet_protocol* key = array[i];
int j = i - 1;
... | ALGO | 0.999792 | 4.692953 |
0fa4e7eb-c656-4cc8-ada2-8365ebad8d49 | spirali/aislinn | tests/complex/heatflow/compute.cpp |
#include "compute.h"
#include <time.h>
#include <inttypes.h>
void compute_new_values(DoubleMatrix &matrix, double *top_row, double *bottom_row)
{
int x = matrix.get_size_x();
int y = matrix.get_size_y();
for(int j = 1; j < y - 1; j++) {
for(int i = 1; i < x - 1; i++) {
matrix.set(i, j,
(matrix.get(i, j... | ALGO | 0.999838 | 3.89536 |
5b638334-cde7-40bc-b828-d66d8dadcf06 | manavtore/Leethub | 173-binary-search-tree-iterator/binary-search-tree-iterator.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.999903 | 6.330169 |
f6446ef9-d206-4530-96cf-13fcdfbeefcf | Anubhav12345678/competitive-programming | survival.cpp | // C++ program to find the minimum days on which
// you need to buy food from the shop so that you
// can survive the next S days
#include <bits/stdc++.h>
using namespace std;
// function to find the minimum days
void survival(int S, int N, int M)
{
// If we can not buy at least a week
// supply of food du... | ALGO | 0.999947 | 3.794868 |
fcc93970-153e-4ae5-becc-9570f4c38cbf | sulemanrai/GeeksforGeeks | Data Structures/arrays/max_product.cpp | #include<iostream>
#include <vector>
#include <algorithm>
using namespace std;
int max_product(vector<int> v1, vector<int> v2)
{
int ans = 0;
int minimum = INT_MAX;
int maximum = INT_MIN;
for(int i = 0; i < v1.size(); i++)
{
maximum = max(maximum, v1[i]);
}
for (int i = 0; i < v2.size(); i++)
{
minimum =... | ALGO | 0.999831 | 3.825692 |
53809178-92ab-46df-ba80-51ac2146ef0e | HG-IMMORTALS/SDE-SHEET | SDE-SHEET-main/057_Valid Sudoku.cpp | // Time complexity -> O(9 ^ K)
// Space complexity -> O(K)
bool isSafe(int row, int col, int curr, int matrix[9][9])
{
for(int i = 0; i < 9; ++i)
{
if(matrix[i][col] == curr)
return false;
if(matrix[row][i] == curr)
return false;
if(matrix[3*(row/3) + i/3][3*(col... | ALGO | 0.99979 | 6.18043 |
a2f88d9a-72b6-499c-a040-12042a0054ce | afsanamim04/Codeforces_Solution | Turtle and an Infinite Sequence.cpp | #include <iostream>
using namespace std;
// Function to find the value of a_n after m seconds
int computeValue(int n, int m) {
// If no time has passed, return the initial value
if (m == 0) return n;
// If m > 0, the result after enough time can be derived from the bitwise OR pattern
int result = n;
... | ALGO | 0.999989 | 6.178549 |
a2b4e655-3474-42b5-b46e-c6e852f1a7e7 | smadi0x86/Hallucina | obfuscator-llvm/libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.pconst/eval_param.pass.cpp | // <random>
// template<class RealType = double>
// class piecewise_constant_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <random>
#include <algorithm>
#include <vector>
#include <iterator>
#include <numeric>
#include <cassert>
#include <cstddef>
#include ... | TEST | 0.909322 | 5.434157 |
06e7f56f-162b-4a0c-9341-6a8604f3af19 | syedpeera/DSA-Problem-Solving | Max sum path in two arrays - GFG/max-sum-path-in-two-arrays.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int max_path_sum(int A[], int B[], int n1, int n2)
{
int sum1 = 0;
int sum2 = 0;
int i = 0, j = 0;
int result = 0;
while(i < n1 && j < n2){
i... | ALGO | 0.999974 | 5.180374 |
f5761c04-4544-4269-848b-c3ff5560da42 | fee1ng/Leetcode | 字符串/字符串的排列.cpp | class Solution {
public:
//
//ֻneedеַżwindowsУmatch
bool checkInclusion(string s1, string s2) {
unordered_map<char,int> windows;
unordered_map<char,int> need;
for(auto c:s1)
{
need[c]++;
}
int left=0,right=0;
int size=s2.size();
int... | ALGO | 0.99996 | 5.99781 |
2ec443ef-665e-4ea1-8949-f7f1ce6df4ed | timothygao8710/Competitive-Programming | atcoder/abc129/B.cpp | //@timothyg
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define f first
#define s second
int main(){
ios_base::sync_with_stdio(false); cin.tie(0);
int N, sum = 0, ret = 1000000; cin >> N;
vector<int> nums(N);
for(int i =0; ... | ALGO | 0.99992 | 3.908728 |
372ade94-365f-4239-bed0-03c1dd818fb8 | Mokuroh54/Comp_Prog | Codeforces/1501-2000/1801-1900/1841-1850/1842/1842_C_Tenzing_and_Balls.cpp | /*
___
(o,o)
< . >
--"-"---
Rowlet is orz
_ _ _
>(.)__ >(.)__ >(.)__
(___/ (___/ (___/
I am dum duck
*/
#include <bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define pb push_back
#define ll long long
#define ld long double
#define ull unsigned ll
#define endl "\n"
#define... | ALGO | 0.999001 | 4.850224 |
c218da33-8958-4ce3-9b3c-855ca0456bce | davidinouye/lpmrf | mexcode/eigen/unsupported/doc/examples/MatrixExponential.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(3,3);
A << 0, -pi/4, 0,
pi/4, 0, 0,
0, 0, 0;
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix exponential ... | ALGO | 0.999765 | 3.706936 |
991c0c45-6946-4e80-ba29-0aa5f05c82bd | vladiant/ImageDeblurring | Samples/Giro/giro_parse_calc_kernel_03/main.cpp | /*
* Simple program to perform
* integration of gyro data
* and calculate the kernel
* by direct reading of the file
* adding rolling shutter correction
*
* Code taken from parsergyro.cpp program
*/
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/core/mat.hpp>
#include <opencv2/highgui/h... | ALGO | 0.899297 | 4.111333 |
c4109468-04cb-4bd3-9bbf-e688700b42e6 | lyh-source/Multi-scale-Anisotropic-Rough-Surface-MARS-Algorithm | include/igl/hessian.cpp | #include "hessian.h"
#include <vector>
#include "grad.h"
#include "igl/doublearea.h"
#include "igl/repdiag.h"
template <typename DerivedV, typename DerivedF, typename Scalar>
IGL_INLINE void igl::hessian(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::Mat... | ALGO | 0.999111 | 6.122248 |
e6e7c954-cbe4-48cf-867d-8e634bedf21b | ohnoanywayshehe/Competitive-Coding | CodeChef/CodeChef-Algomaniac/SUBMEDIA.cpp | #include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define ld long double
#define pb push_back
#define pii pair<ll, ll>
#define vi vector<ll>
#define mp make_pair
#define ms1(dp) memset(dp, -1, sizeof(dp));
#define ms0(dp) memset(dp, 0, sizeof(dp));
#define minheap int, vector<int>, greater... | ALGO | 0.999996 | 3.11576 |
0a006500-c56a-444a-8baa-7d1c52f16444 | ishandutta2007/codeforces | rafi22/normal/1341/C.cpp | #include <bits/stdc++.h>
using namespace std;
int pref[200007];
bool is[200007];
int main()
{
int t;
cin>>t;
for(int i=0;i<t;i++)
{
int n,k;
cin>>n;
int tab[n+3];
int pos[n+3];
int r[n+3];
int maxi=1;
for(int i=1;i<=n;i++) cin>>tab[i];
fo... | ALGO | 0.999954 | 3.644988 |
9e04d700-ab36-49cb-84d4-4d451acbd476 | daniel-buhaianu/admitere-info | 2019/compute.cpp | int compute(int a)
{
// rezolv cerinta a)
int na=0;
for (int ca=a; ca; na++, ca/=10)
if (ca%10 == 0) return -1;
if (na < 4) return -1;
// rezolv cerinta b)
int n=0, m=0;
for (int pn=1, pm=1, ca=a, i=na; i >= 1; i--)
{
if (i%2)
{
n += ca%10 * pn;
pn *= 10;
}
else
{
... | ALGO | 0.999146 | 3.335979 |
71243362-9ded-4be0-943c-a6a7cd13b7a4 | Arthur-St-06/SapiensParametricHeadReconstruction | flame-fitting/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
ArrayXXf a(2,2);
a << 1,2,
3,4;
cout << "(a > 0).all() = " << (a > 0).all() << endl;
cout << "(a > 0).any() = " << (a > 0).any() << endl;
cout << "(a > 0).count() = " << (a > 0).count() << endl... | ALGO | 0.964827 | 3.835741 |
d2d325c7-b30e-4fd4-8e80-1b314e6782f1 | TimTam725/Atcoder | Usefull/tapple.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,i;
cin>>n;
vector<pair<pair<string,int>,int>> a(n);
for(i=0;i<n;i++){
string str;
int l;
cin>>str>>l;
a.at(i).first.first=str;
a.at(i).first.second=-l;
a.at(i).second=i+1;
}
//配列aの最初の要素でsortし、同じ場合は次の要素で比較
//3つ以上の情報を保持できる ... | ALGO | 0.999213 | 3.318257 |
5071e9b3-0a79-4c15-9e4e-94ceb26f6eab | kmjp/procon | srm/811-850/817/Gym.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#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 ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#defin... | ALGO | 0.99965 | 4.177413 |
a6c47095-e9d1-434b-82d4-cc5e47c4dec4 | lizr2004/Coding | rqnoj/677.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
int dp[1086][1086];
// jing 13
int A,n,B;
int ans=-1;
int jing,mei,b13;
char* tran[] = {"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};
char* tran2[] = {"ling","yi","liang","san","si","wu","liu","qi","ba","jiu"};
void translate(int ans)
{
int... | ALGO | 0.998476 | 3.283145 |
6a06d417-be5e-4c8a-9d9f-7a0f99d53b19 | Esheta10/GeeksForGeeks-Solutions | Difficulty: Easy/Strings Rotations of Each Other/strings-rotations-of-each-other.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to check if two strings are rotations of each other or not.
bool areRotations(string &s1, string &s2) {
// Your code here
string str = "";
str += s1;
str += s2;... | ALGO | 0.999597 | 6.249005 |
32959097-ebf7-48c6-b489-a22ccff69bec | snlw/Codeforces | A/1312A.cpp |
#include<iostream>
using namespace std;
int main(){
int t;
cin >> t;
while (t--){
int n, m;
cin >> n >> m;
bool yesno = false;
if (n % m == 0){
yesno = true;
}
cout << (yesno ? "YES":"NO") << endl;
}
return 0;
}
| ALGO | 0.999687 | 5.490733 |
c44c6a30-37a2-4bb1-b241-37f09c9d59d7 | goldenpython/Contests | UVA/p13187v0.cpp | /*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... | ALGO | 0.996695 | 5.47422 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.