uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4636424e-59ac-4c9f-8baa-53b54f5fa49d | sherecho/my_algorithm_demos | AG_Zuo/links.cpp | #include <cmath>
#include <cstddef>
#include <cstdlib>
#include<iostream>
#include <ostream>
#include<stack>
#include"time.h"
#include "stdlib.h"
#include <set>
#include<cmath>
using namespace std;
/*快慢指针
-单链表:求链表中点1奇数个返回唯一中点,2偶数个返回上中点,3偶数个返回下中点 4奇数个返回中点前一个
- 给定一个单链表头节点head ,请判断该链表是否为回文结构
-用容器的方法(笔试用):用栈
-该原链表方... | ALGO | 0.999667 | 4.107705 |
177d3405-f945-48e8-943c-a6763347fb84 | krahets/hello-algo | codes/cpp/chapter_heap/heap.cpp | /**
* File: heap.cpp
* Created Time: 2023-01-19
* Author: LoneRanger(<EMAIL>)
*/
#include "../utils/common.hpp"
void testPush(priority_queue<int> &heap, int val) {
heap.push(val); // 元素入堆
cout << "\n元素 " << val << " 入堆后" << endl;
printHeap(heap);
}
void testPop(priority_queue<int> &heap) {
int va... | ALGO | 0.991251 | 4.766076 |
6def5403-5306-47a8-8177-4ce4eee877c2 | amit839/Interview-Problems | Leetcode/Medium/1219.cpp | // Link to the problem statement : https://leetcode.com/problems/path-with-maximum-gold/
int dr[] = {0, -1, 0, 1};
int dc[] = {-1, 0, 1, 0};
int ans;
class Solution {
public:
void go(int i, int j, int& n, int& m, vector<vector<int>>& grid, vector<vector<bool>>& visited, int tans){
ans = max(ans, tan... | ALGO | 0.999861 | 6.463669 |
19b154b0-cf05-495d-b423-76297f6dbf47 | ShreyasV7/Leetcode-Problems | 1679-max-number-of-k-sum-pairs/1679-max-number-of-k-sum-pairs.cpp | class Solution {
public:
int maxOperations(vector<int>& nums, int k) {
int n = nums.size() ;
map<int,int>mp ;
int cnt = 0 ;
for(int i=0;i<n;i++){
if(mp[k-nums[i]] > 0 ){
mp[k-nums[i]]-=1;
cnt++ ;
... | ALGO | 0.999954 | 6.17172 |
12b92942-d904-4c1c-b0a1-7020ed113feb | juanmaarg6/FP | practicas/practicas_2ª_matricula/entrega_ejercicios_sesion_5/II_Aprox_PI_Madhava.cpp | /*
Relacin de ejercicios 2
Ejercicio 52: Programa que calcula una aproximacin del nmero PI usando
el desarrollo de Taylor de la funcin arcotangente evaluada
en ( 1 / raiz(3) ). Dicho desarrollo fue calculado por
el matemtico indio Madhava.
Entradas: Tope de la sumatoria (tope),
... | ALGO | 0.999966 | 4.33849 |
5f7aae09-e626-4c09-85ed-490022469c87 | SadmanHafizShuvo21/codeforces | Floyd_Warshall_Algorithm.cpp | #include <bits/stdc++.h>
using namespace std;
#define V 4
#define INF 99999
void printSolution(int dist[][V])
{
cout << "The following matrix shows the shortest "
"distances"
" between every pair of vertices \n";
for (int i = 0; i < V; i++) {
for (int j = 0; j < V; j++) {
... | ALGO | 0.999943 | 3.969166 |
32c42d00-6f05-4817-97e2-0863fabf291d | ultraji/nowcoder | huawei/0091.cpp | // 0091.201301 JAVA 题目2-3级
#include <iostream>
using namespace std;
int f(int n, int m)
{
if(n == 0&& m == 0) return 0;
else if(n == 0) return 1;
else if(m == 0) return 1;
else return f(n-1, m) + f(n, m-1);
}
int main()
{
int n, m;
while(cin >> n >> m)
{
cout << f(n, m) << endl;
... | ALGO | 0.999971 | 4.59836 |
b331d43e-81fe-4ef9-8fc6-4833efa47664 | hfinkel/llvm-project-csp | libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp | // <vector>
// void resize(size_type sz, const value_type& x);
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
int main(int, char**)
{
{
std::vector<int> v(100);
v.resize(50, 1);
assert(v.size()... | TEST | 0.857106 | 6.38132 |
21bb07a8-8021-4fa5-a7c5-1f28a63dbbaf | duckdb/duckdb-swift | Sources/Cduckdb/duckdb/extension/icu/third_party/icu/common/ushape.cpp | #include "unicode/utypes.h"
#include "unicode/uchar.h"
#include "unicode/ustring.h"
#include "unicode/ushape.h"
#include "cmemory.h"
#include "putilimp.h"
#include "ustr_imp.h"
#include "ubidi_props.h"
#include "uassert.h"
/*
* This implementation is designed for 16-bit Unicode strings.
* The main assumption is that... | TOOL | 0.866021 | 6.567085 |
c5664869-f4cb-4764-bbca-58767f36cbbb | Modding-Zaibatsu/Pre-Unreal-4.14 | Engine/Source/ThirdParty/PhysX/PhysX_3.4/Source/GeomUtils/src/contact/GuContactConvexMesh.cpp | #include "GuConvexUtilsInternal.h"
#include "GuInternal.h"
#include "GuContactPolygonPolygon.h"
#include "GuConvexEdgeFlags.h"
#include "GuSeparatingAxes.h"
#include "GuContactMethodImpl.h"
#include "GuContactBuffer.h"
#include "GuMidphaseInterface.h"
#include "GuConvexHelper.h"
#include "GuTriangleCache.h"
#include "G... | ALGO | 0.996537 | 3.253559 |
1662935f-4165-428e-add8-ecfedfeed2d2 | kennyow/Games-in-C | Jogo da Velha/jogodavelha.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
using namespace std;
//Area of definition of the funtion headers
void menuInicial();
//Clean Screen
void limpaTela(){
system("cls");
}
//Starting the boardgame
void iniciaTabuleiro(char tabuleiro[3][3]){
//Navigate through all pos... | ALGO | 0.930537 | 4.07653 |
27a64d8a-1a81-438c-a9e1-747663190345 | vittorione94/ICP-Implementation | extern/nanogui/ext/eigen/doc/examples/tut_matrix_resize.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,5);
m.resize(4,3);
std::cout << "The matrix m is of size "
<< m.rows() << "x" << m.cols() << std::endl;
std::cout << "It has " << m.size() << " coefficients" << std::endl;
VectorXd v(2);
v.resize(5);
... | ALGO | 0.967462 | 3.874117 |
5fff8670-2a78-401a-83a2-b4b0b18db90a | samar-gupta/DSA_POTD | Leetcode/K Inverse Pairs Array.cpp | //Company Tags : Google
//Leetcode Link : https://leetcode.com/problems/k-inverse-pairs-array/
//Approach-1 (Reucr+Memo)
//T.C : O(n*k*n)
//S.C : O(n*k) for memo + Recursion call stack
class Solution {
public:
const int M = 1e9+7;
int t[1001][1001];
int solve(int n, int k) {
if(n == 0)
... | ALGO | 0.999995 | 6.502045 |
8c418489-3408-4682-9c40-02b7fb5fc0bb | tempure/algorithm-advance | OJ/acwing/第48场周赛/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define um unordered_map
#define pq priority_queue
#define sz(x) ((int)(x).size())
#define fi first
#define se second
#define endl '\n'
typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ull;
t... | ALGO | 0.999985 | 4.238378 |
b80045f1-8c7c-4f1d-8fc2-6b41ad8cf551 | EPFL-LAP/fpga24-more-ooo | experiments/benchmarks/gsum_many/src/gsum_many.cpp |
//------------------------------------------------------------------------
// Jianyi Cheng, DSS
// https://zenodo.org/record/3561115
//------------------------------------------------------------------------
#include <stdlib.h>
#include "gsum_many.h"
int gsum_many(in_float_t a[N], out_float_t c[N]) {
int i;
floa... | TEST | 0.99871 | 3.605842 |
16d08d2f-4634-4766-b6bb-5f86877756a8 | andrewei1316/OJSubmit | DATASOURCE_POJSubmit/1543/1543_20140812-152245_376K_16MS_AC.cpp | /*=============================================================================
# Author: He Shuwei
# Last modified: 2014-08-11 16:02
# Filename: b.cpp
# Description:
=============================================================================*/
#include <cstdio>
#include <cmath>
using namespace std;
int main(){
... | ALGO | 0.999643 | 3.608877 |
fffb14da-9e3e-4c3f-bddc-9b57680c4f5f | anmol-is-here/CODES | C++/DataStructure_Cpp/LinkedList/removeNodeFromEnd.cpp | /**
* Question -> Given the head of a linked list, remove the kth node from the end of the list and return its head.
*/
#include <iostream>
#include <vector>
// #include <string>
using namespace std;
class Node{
public:
int val;
Node* next;
Node(int data){
val = data;
next = NULL;
}
}... | ALGO | 0.999878 | 5.815153 |
da84e114-3e53-4f4a-9438-6e5027f3d967 | daipayan-bhowal/CPP-state-machine | state-machine-read-write.cpp | #include <bits/stdc++.h>
using namespace std;
int *ptr;
class StateMachine
{
public:
int signal;
void print ()
{ cout<< "print base class" <<endl; }
virtual void run ()
{ cout<< "show base class" <<endl; }
};
class Init_State:public StateMachine
{
public:
void print ()
... | TOOL | 0.967978 | 3.836004 |
62b4e627-7dd8-4587-a7fd-92e4f790c33e | ClearmanChen/uav-nerf-sim | src/RACER/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/performance/nr_rk4_lorenz.cpp | #include <boost/array.hpp>
#include "rk_performance_test_case.hpp"
#include "lorenz.hpp"
const size_t dim = 3;
typedef boost::array<double, dim> state_type;
template <class System, typename T, size_t dim>
void rk4_step(const System sys, boost::array<T, dim>& x, const double t,
const double dt) { // ... | ALGO | 0.98762 | 6.012225 |
b09c068a-079f-4406-986e-c3574501a835 | badampudimahesh2005/DSA_withCpp | strings/bits/bits_questions.cpp | #include<iostream>
using namespace std;
//write a pogram to check if given number is power of 2
bool isPower(int n){
// n && is because of Zero
return (n && !(n & (n-1)));
}
//write a program to check the number of ones in the given binary number
int numberofones(int n){
int count=0;
while(n){
n=n&n-1;... | ALGO | 0.998389 | 5.899081 |
fc0fbb76-ef69-454e-8f5f-3e29b3dda15f | ishandutta2007/codeforces | egor_bb/normal/543/D.cpp | #include <iostream>
#include <ctime>
#include <set>
#include <fstream>
#include <cstdio>
#include <stack>
#include <map>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <cassert>
#include <cmath>
#define pii pair <int, int>
#define pll pair<ll, ll>
#define mp make_pair
#define proble... | ALGO | 0.999844 | 3.624306 |
8cf52ba9-e51d-47d9-94fc-25d250224b9b | Langerygg/-2 | ТИ№2/ТИ№2.cpp | // ТИ№2.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include <vector>
#include <string>
using namespace std;
const bool cnst = 1, cnst2 = 0;
int main()
{
system("chcp 1251");
string in;
int buffleng;
cout << "Строка: ";
getline(cin, in);... | ALGO | 0.989877 | 3.358479 |
1f62c59d-abf3-4105-9f83-5949ac04fae4 | rajbs2018/Development-Repo-3 | Program188.cpp | #include<iostream>
using namespace std;
typedef unsigned int UINT;
/*
opt1 opt2 & | ^
1 0 0 1 1
0 1 0 1 1
1 1 1 1 0
0 1 0 0 0
iNo 0000 0000 1110 0100 1111 0100 1011 1010
iPos 6
iRet 0000 0000 1110 0100 1111 0100 1011 1010
*/
UINT ToggleBit(UINT iNo... | ALGO | 0.998716 | 5.038861 |
893d961d-30fe-4a51-8b1f-6cc5bcb74f60 | jeremykvlim/kattis | open/balancedcut.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
vector<int> A000071(27);
A000071[0] = 1;
A000071[1] = 2;
for (int i = 2; i < 27; i++) A000071[i] = A000071[i - 1] + A000071[i - 2] + 1;
int n, k;
cin >> n >> k;
int root = 0;... | ALGO | 0.999996 | 4.058288 |
56d494fe-c29e-458a-b2ee-adced5525da4 | Mahak-Codes/CP | Codeforces/C_Hard_Problem.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define mahak_codes \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr);
int32_t main()
{
mahak_codes
int t;
cin >> t;
while (t--)
{
int m, a, b, c;
cin >> m >> a >> ... | ALGO | 0.999896 | 4.33778 |
7fec272f-3a49-4fae-8c11-58a124050077 | Zishan-Alam/LeetCode | Stack/0084-largest-rectangle-in-histogram.cpp | class Solution {
public:
int largestRectangleArea(vector<int>& arr) {
int n = arr.size();
// Next Smaller Index (NSI) ka vector banate hain
vector<int> nsi(n, n);
stack<int> st;
st.push(n-1);
// NSI calculate karne ke liye backward traversal karte hain
for... | ALGO | 0.999928 | 6.8438 |
e292c049-92ce-4263-891c-380b57c2e09b | tcmmichaelb139/Competitive-Programming | Usaco/2019-2020/December/SilverP1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<double, double> pd;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vecto... | ALGO | 0.999544 | 3.331094 |
c11e2f09-fe54-436b-b3cb-a6ccb5d38843 | micklevast/daa | All_assignments/Ass-2/q1.cpp | // Q1) Given an array A[0…n-1] of n numbers containing repetition of some number. Given an algorithm for checking whether there are repeated
// element or not. Assume that we are not allowed to use additional space (i.e., we can use a few temporary variable, O(1) storage).
// ANS==>
// Algorithm:-->
// 1. Traverse th... | ALGO | 0.999865 | 4.578486 |
8616a2eb-10f8-49a0-b88d-019b71fbec64 | Ivan23BG/semestre-6-info | HAI605I-Donnees-multimedia/TP-Image/TP-note/egalisation.cpp | //
// Created by Ivan on 28/02/2024.
//
// eqm_pgm.cpp : calcule l'erreur quadratique moyenne entre deux images
#include <stdio.h>
#include "image_ppm.h"
#include <math.h>
int main(int argc, char *argv[]) {
char cNomImgLue[250], cNomImgEcrite[250];
int nH, nW, nTaille;
sscanf(argv[1], "%s", cNomImgLue);
... | ALGO | 0.974041 | 3.632283 |
8913c366-51ce-4e60-bc40-339a7af800c3 | Mr-Python-in-China/LuoguProblem | ARC177B.cpp | #include <bits/extc++.h>
using namespace std;
namespace pbds = __gnu_pbds;
using ui = unsigned int;
using uli = unsigned long long int;
using li = long long int;
int main(void) {
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
size_t n;
cin >> n;
vector<bool> d(n);
for (vector<bool>::referen... | ALGO | 0.999907 | 3.934927 |
baea139f-e76a-4297-b5a3-05f4ec776587 | vasanth3/Design-and-analysis-of-algorithms- | Selection sort.cpp | #include <stdio.h>
void selectionSort(int arr[], int size);
void swap(int *a, int *b);
void selectionSort(int arr[], int size)
{
int i, j;
for (i = 0 ; i < size;i++)
{
for (j = i ; j < size; j++)
{
if (arr[i] > arr[j])
swap(&arr[i], &arr[j]);
}
}
}
... | ALGO | 0.999884 | 3.97445 |
ae46930a-c24f-45ea-9da0-47300891ba37 | virtleo/lanqiao | 天梯赛/L1-79.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int>a(n,0);
for(int i=0;i<n;i++)
{
cin>>a[i];
}
sort(a.begin(),a.end());
int mi=count(a.begin(),a.end(),a[0]);
int ma=count(a.begin(),a.end(),a[n-1]);
printf("%d %d\n%d %d",a[0],mi,a[n-1],ma);
return 0;
}
| ALGO | 0.999651 | 3.00835 |
b61b04ca-eea5-44b8-9339-392739fe95d3 | jsambhav5/LeetCode | 662_MaximumWidthOfBinaryTree/MaximumWidthOfBinaryTree.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.999819 | 6.050521 |
a9d8c2aa-996d-41d4-aa3a-2b599a389c14 | zjukk/LeetCode-is-my-son | 98-ValidateBinarySearchTree.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <limits>
#include <stack>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
//错误。。不能保证大于左子树上的所有值或者小于右子树上的所有值
class Solution1 {
public:
bool isVal... | ALGO | 0.999973 | 5.368435 |
1ab0c35a-9253-46ba-8260-8d10c361a846 | isac322/BOJ | 9295/9295.cpp11.cpp | #include <cstdio>
int main() {
int n, a, b;
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%d%d", &a, &b);
printf("Case %d: %d\n", i, a + b);
}
} | ALGO | 0.990325 | 4.230955 |
e18503c8-7476-4f00-9779-82eafe09398e | raincross7/code-similarity | codes/train_code/problem351/problem351_424.cpp | #include<bits/stdc++.h>
using namespace std;
using p=pair<int,int>;
#define int long long
#define rep(i,N) for(int i=0;i<N;i++)
signed main(){
char A,B;
cin>>A>>B;
int AA=A-'A';
int BB=B-'B';
if(A>B)cout<<">"<<endl;
else if(A<B)cout<<"<"<<endl;
else cout<<"="<<endl;
return 0;
} | ALGO | 0.99999 | 3.588136 |
036330d2-ff70-4fc3-9f57-720382e79250 | uttkarsh2406/Competitive | Learn/one to two/Basic Problems/turn_it.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
ll tt;
cin>>tt;
while (tt--)
{
/* code */
int a,b,c,d;
c... | ALGO | 0.997461 | 3.965493 |
62a27028-98d9-4d23-a8fe-00c452fe9c27 | KAISER1997/REBELLION-1 | extendedEuclid.cpp | //used to find one integral soln for(x,y) in ax+by=1
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int x1;
int x2;
int yl;
int y2;
void Euclid(int a,int b)
{
if(b!=1)
{
Euclid(b,a%b);
if(a%b==1)
{
x1=a;
yl=b;
x2=1;
y2=-1*(a/b);
cout<<x1<<" "<<x2<<" "<<yl<<" "<<y2<<endl;
}
else
{
int c=x2... | ALGO | 0.999933 | 3.675156 |
f8b3562f-3a89-40f6-b7cb-c64be4a7b74e | michael-galpin/k-and-r | cpp/Primes.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
class Sieve{
int max;
int *nums;
int num_primes;
public:
Sieve(int max);
int* primes();
bool is_prime(int n);
};
Sieve::Sieve(int max){
this->max = max;
nums = new int[max-1];
num_primes = 0;
int i;
for (i = 0; i < max-1; i++){
nums[i] = i + 2;... | ALGO | 0.999369 | 4.360901 |
cf7746fd-48a7-4e53-b8a3-93f9fa4273e9 | VasilyevEvgeny/algorithmic_foundation | 10_sorting/06_assignments/11/11.cpp | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#define VERBOSE false
enum class PointType {
START,
END,
POINT,
};
std::ostream& operator << (std::ostream& os, const std::vector<std::pair<int, PointType>>& v) {
os << "[ ";
for (int i = 0; i < v.size(); ++i) {
os ... | ALGO | 0.999941 | 4.359574 |
5dc986ab-2a5b-4d8c-bdbc-7865c82f726c | JuncoDH/CompetitiveProgramming | implementations/range_query/square_root/mo.cpp | // You can use it when you can extend / shrink interval by 1 element.
// O((Q + N) sqrt(N)), is sqrt decomposition.
class Query {
static constexpr int BLOCK = 170; // sqrt(n) + -;
public:
int l = 0, r = 0, id = 0;
Query() = default;
Query(int const _l, int const _r, int const _id) {
l = _l; ... | ALGO | 0.999882 | 5.334147 |
52db874d-e52c-4018-9a86-46236d29d464 | ShahidKhan18/DSA_LB-Paid- | Recursion/Revision/factorial.cpp | #include<bits/stdc++.h>
using namespace std;
int fact(int n){
if(n<=1)
return 1;
return n* fact(n-1);
}
int main()
{
int n;
cout<<"Enter number : ";
cin>>n;
cout<<"Factorial of number "<<n<<" : "<<fact(n)<<endl;
return 0;
} | ALGO | 0.999883 | 3.944912 |
26eedb4d-60f7-4ba9-875d-11b093c93035 | OneBitPython/Codeforces | E_Edge_Reverse.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(c) c.begin(), c.end()
#define endl "\n"
const double PI=3.141592653589;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsig... | ALGO | 0.999858 | 5.367297 |
1e0593bc-1603-46c1-a50d-b8e69e4bfb74 | boddicheg/competitive | leetcode/600-699/633_sum_of_square_numbers.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
#define watch(x) std::cout << (#x) << " is " << (x) << std::endl
template<typename T>
void print(const T &container)
{
std::cout << "[ ";
for (const auto &e : container)
std::cout << e << " ";
std::co... | ALGO | 0.999822 | 5.090077 |
38942eab-ef34-40dd-a34a-338ef3e812b6 | agul/contest-tasks | caide_archive/2016-02-14/cf626C/submission.cpp | #pragma comment(linker, "/STACK:66777216")
#include <cstdio>
#pragma warning(disable : 4996)
#include <algorithm>
#include <array>
#include <cstdlib>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <utility... | ALGO | 0.999813 | 4.404924 |
6effc083-3d3d-4bde-bc57-d2aff577ebde | Nikita12112002/Placement_Preparation_Module | Tree/Binary_Tree/Min_depth.cpp | class Solution {
public:
int minDepth(TreeNode* root) {
if(root==NULL)
return 0;
int left = minDepth(root->right);
int right = minDepth(root->left);
if(left==0 || right==0) // this is to handle skewed tree. check sample ex -2
{
... | ALGO | 0.999809 | 6.823556 |
2eced57f-e2c5-4a11-bc54-8aaf19c74a06 | NishhanttGautam/Competitive-Coding | Hashing/LinearProbing.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> linearProbing( int hashSize,int arr[],int sizeOfArray);
int main() {
int t;
cin>>t;
while(t--)
{
int hashSize;
cin>>hashSize;
int sizeOfArray;
cin>>sizeOfArray;
int arr[sizeOfArray];
for(int i=0;i<sizeOfArray;i++)
cin>... | ALGO | 0.999949 | 4.915831 |
35ef682c-707e-465e-adbc-3d7df0b3746d | WenzeJin/DataStructureOJ | archive/lab10-2.cpp | #include<map>
#include<set>
#include<iostream>
using namespace std;
class UnionSet {
unordered_map<int, int> parent;
int size_max;
public:
UnionSet(): parent(),size_max(0) {}
void add(int x) {
parent[x] = -1;
if(0 - parent[x] > size_max) {
size_max = 0 - parent[x];
... | ALGO | 0.999954 | 5.162208 |
5108e3d3-a766-41e4-9b10-c496166d46bc | pawan8979/Leetcode | 0383-ransom-note/0383-ransom-note.cpp | //OPTIMIZED
class Solution {
public:
bool canConstruct(string ransomNote, string magazine) {
int dict[26]={0};
for(auto letter:magazine){
dict[letter-97]++;
}
for(auto letter:ransomNote){
if(dict[letter-97]==0)
return false;
else
... | ALGO | 0.999927 | 6.324734 |
19ed9932-f128-42ba-8b46-3d87d782e288 | k-pypin/GA_Labs1_3 | Code.cpp | //
// Created by Trojan on 27.09.2017.
//
#include "Code.h"
int Code::L = 5;
std::ostream &operator<<(std::ostream &os, const Code &code) {
int x = code.decNum;
std::string s;
while(x && s.size() < Code::L)
{
if(x % 2)
{
s.insert(s.begin(),'1');
} else
{
... | ALGO | 0.997509 | 4.059292 |
bd789913-64f5-4194-b637-0b59d8865e3c | TURBO70/LeetCode-Solutions | 1544-make-the-string-great/1544-make-the-string-great.cpp | class Solution {
public:
std::string makeGood(std::string s) {
std::stack<char> stack;
for (char c : s) {
if (!stack.empty() && std::abs(c - stack.top()) == 32) {
stack.pop();
} else {
stack.push(c);
}
}
... | ALGO | 0.999803 | 6.784617 |
36458083-b323-421a-900c-4eb65e744af8 | TheenashManimaran/Leetcode | 3950-maximum-k-to-sort-a-permutation/3950-maximum-k-to-sort-a-permutation.cpp | class Solution {
public:
int sortPermutation(vector<int>& nums) {
int n = nums.size();
int ans;
int flag = 0;
for(int i=0;i<n;i++){
if(!flag && i != nums[i]){
flag = 1;
ans = nums[i];
}
else if(flag && i !=... | ALGO | 0.999995 | 5.717754 |
4ac86e81-ac7a-4c2c-9bf0-ec280840aeab | BeatrizHanae/AED | 2 - Lista e pilhas/pilha_exemplo.cpp | #include <iostream>
#include <stack> // inclui biblioteca para a pilha
#include <string>
using namespace std;
int main(){
stack<string> cartas;
cartas.push("Rei de Copas");
cartas.push("Coringa");
cartas.push("Rei de Espadas");
cartas.push("7 de Copas");
cout << "tamanho da pilha: " << cartas.size() << en... | ALGO | 0.941934 | 4.681984 |
1758ed07-3d5e-45ed-8624-8444fe86532c | joshualass/CP | Solutions/OJ/Kattis/worstweatherever.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const ll MOD = 1e9 + 7;
template<typename T>
std::ostream& operator<<(std::ostream& os, const vector<T> v) {
for(auto &x : v) os << x << " ";
return os;
}
template<typename T>
struct Tree {
static constexpr T base ... | ALGO | 0.99999 | 5.126333 |
b10ce1b6-b0cb-4cd1-9e8e-01e7c587edad | shuvookd/CodeForces | 734A.Anton_and_Danik.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int game, countA = 0, countB = 0;
string result;
cin>>game;
for(int i = 0; i<game; i++)
{
cin>> result;
if(result[i] == 'A')
{
countA++;
}
else
countB++;
}
if(countA>co... | ALGO | 0.999913 | 4.1828 |
ba7ae9af-62cb-4175-9fdc-706f235adad0 | koba-e964/contest | yukicoder/438.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include ... | ALGO | 0.999838 | 3.401672 |
b993f386-089b-4fa7-9cab-aa5dc6e855cd | SloanPC/ZeroClient | src/deps/cryptopp/donna_sse.cpp | // donna_sse.cpp - written and placed in public domain by Jeffrey Walton
// This is a integration of Andrew Moon's public domain code.
// Also see https://github.com/floodyberry/curve25519-donna.
// This is a integration of Andrew Moon's public domain code. The port was
// clean, but it... | ALGO | 0.996251 | 7.171588 |
e49949d3-ece1-45d4-ba16-1aa26667d55c | gabriel-candeia/Competitive-Programming-Solutions | Codeforces/[GYM] - The 15th Jilin Provincial Collegiate Programming Contest/K.cpp | #include <bits/stdc++.h>
using namespace std;
#define mod ll(1e9+7)
#define maxn ll(2e5+10)
typedef long long int ll;
ll fat[maxn], inv[maxn];
ll binpow(ll a, ll e){
ll ans = 1;
while(e){
if(e&1) ans = (ans*a)%mod;
a = (a*a)%mod;
e >>= 1;
}
return ans;
}
ll invC(ll num){
return bi... | ALGO | 0.999944 | 4.742727 |
04151727-6780-4004-ac57-3f2348b44615 | kkkHoon/algorithm_study | Simple_Problem/Cain Calendar.cpp |
#include "stdafx.h"
#include <cstdio>
using namespace std;
int main()
{
int test_case, M, N, X, Y, Z, k1, k2;
scanf("%d", &test_case);
for (int i = 1; i <= test_case; i++)
{
scanf("%d %d %d %d", &M, &N, &X, &Y);
//find max_Z
int max_Z = 0;
k1 = 1, k2 = 1;
while (M * k1 != N * k2) {
if (M * k1 < N ... | ALGO | 0.999658 | 3.178515 |
9964bc85-d160-48a1-868e-a966a235b131 | demxyuanli/wxcoin | src/optimizer/OptimizedGeometryCache.cpp | #include "OptimizedGeometryCache.h"
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <OpenCASCADE/BRepPrimAPI_MakeBox.hxx>
#include <OpenCASCADE/BRepPrimAPI_MakeSphere.hxx>
#include <OpenCASCADE/BRepPrimAPI_MakeCylinder.hxx>
#include <OpenCASCADE/BRepPrimAPI_MakeCone.hxx>
#include <OpenCASCADE/BRepPr... | TOOL | 0.997736 | 7.947114 |
c3bc3680-913b-4e16-bc78-a1b2aaadec41 | Kavin1421/Leetcode-Solution | 1700-1799/1751.Maximum Number of Events That Can Be Attended II/Solution2.cpp | class Solution {
public:
int maxValue(vector<vector<int>>& events, int k) {
sort(events.begin(), events.end(), [](const auto& a, const auto& b) { return a[1] < b[1]; });
int n = events.size();
int f[n + 1][k + 1];
memset(f, 0, sizeof(f));
for (int i = 1; i <= n; ++i) {
... | ALGO | 0.99975 | 5.994727 |
48e32351-ac94-4bb8-aeda-2257abe76474 | iliyian/LuoguOJ | Problems/P2831/main.cpp | // date: 2024-04-09 15:13:09
// tag: map浮点键精度问题
#include <bits/stdc++.h>
#define int long long
using namespace std;
void solve() {
int n, m;
cin >> n >> m;
vector<double> x(n), y(n);
for (int i = 0; i < n; i++) {
cin >> x[i] >> y[i];
}
auto get = [&](int i, int j) {
double x1 = x[i], y1 = y[i], x2... | ALGO | 0.999864 | 5.612668 |
0d56031d-22af-4fbe-b8c2-e570d8958dad | ishandutta2007/codeforces | ivan100sic/normal/1737/C.cpp | // Retired?
#include <bits/stdc++.h>
using namespace std;
namespace R = ranges;
auto ra(auto x, auto y) { return R::iota_view(x, y); }
using ll = long long;
using ull = long unsigned long;
using ld = double long;
int main() {
ios::sync_with_stdio(!cin.tie(0));
int t;
cin >> t;
while (t--) {
... | ALGO | 0.999831 | 4.205997 |
cdeb0180-7d6c-417a-aa3c-94ecd2112e2c | ammarhakim/gkeyll1 | proto/LcPoissonBracketCanonical3D.cpp | /**
* @file LcPoissonBracketCanonical3D.cpp
*
* @brief
*/
// config stuff
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
// lucee includes
#include <LcPoissonBracketCanonical3D.h>
namespace Lucee
{
const char *PoissonBracketCanonical3D::id = "Canonical3D";
PoissonBracketCanonical3D::PoissonBracketCanonic... | ALGO | 0.991761 | 6.400228 |
3086c3d5-f3e0-4b23-8205-6bc182a0f90f | Abhishek222747/dsa | Recursion and Backtracking/Find the string in Grid.cpp | Given a 2D grid of n*m of characters and a word, find all occurrences of given word in grid.
A word can be matched in all 8 directions at any point. Word is said to be found in a direction
if all characters match in this direction (not in zig-zag form). The 8 directions are,
horizontally left, horizontally right, vert... | ALGO | 0.999744 | 5.728665 |
c7e7c585-351b-4191-b51e-689ef70000c6 | pradeepcredenceid/tabasco_external_skia | src/gpu/GrProcOptInfo.cpp | #include "GrProcOptInfo.h"
#include "GrGeometryProcessor.h"
#include "batches/GrDrawBatch.h"
void GrProcOptInfo::calcWithInitialValues(const GrFragmentProcessor * const processors[],
int cnt,
GrColor startColor,
... | TOOL | 0.914241 | 6.747068 |
c90c7b4b-f71d-428a-b39b-ab73d4a37ccd | KilverSaid/Progra1 | Calculadora de áreas de figuras geométricas.cpp | #include <iostream>
#include <cmath>
using namespace std;
double calcularAreaTriangulo(double base, double altura) {
return (base * altura) / 2;
}
double calcularAreaCuadrado(double lado) {
return lado * lado;
}
double calcularAreaRectangulo(double base, double altura) {
return base * altura;
}
double c... | TOOL | 0.95332 | 4.815935 |
7cbd57b7-7858-4f91-8e12-e6b4b00bfe5b | victormendezdasilva/tarea4 | MaterialesTarea4 (antigua)/tarea4/src/colaDePrioridad.cpp | /* 4862558 */
#include "../include/cadena.h"
#include "../include/info.h"
#include "../include/utils.h"
#include "../include/colaDePrioridad.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct nodoCP *TNodoCP;
struct nodoCP {
TNodoCP siguiente, anterior;
nat elem;
double prioridad;
};
... | ALGO | 0.999834 | 4.694305 |
75cf9e7b-155f-4f3f-8224-395a4508a61c | Alua-Buyesh/ADS2024 | ADS3/ADS3h.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int M, N;
cin >> M >> N;
vector<int> blockSizes(M);
vector<int> prefixSum(M);
// Read block sizes and calculate prefix sums
for (int i = 0; i < M; ++i) {
cin >> blockSizes[i];
prefixSum[i] = blockSizes... | ALGO | 0.999987 | 5.595043 |
773c8a14-37e9-4a75-b00e-db9d3413d2b4 | mostfamhmd/Talky-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.9988 | 6.76073 |
04c3f3ad-4f33-4825-ade7-ba15540155a8 | deepaksing/CSES | dynamic/6.Grid_Paths.cpp | #include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define endl "\n... | ALGO | 0.999982 | 4.595751 |
0300ab25-8460-473e-93a9-de059b33dd3d | NandiSoham/Leetcode-POTD-Daily-Coding-Challenge | Year 2025/03_March/day28_2503. Maximum Number of Points From Grid Queries.cpp | // Problem Link -> https://leetcode.com/problems/maximum-number-of-points-from-grid-queries/
class Solution {
public:
vector<vector<int>> directions = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
vector<int> maxPoints(vector<vector<int>>& grid, vector<int>& queries) {
int rows = grid.size();
int cols =... | ALGO | 0.999927 | 6.5613 |
0bdc5a60-108d-4d3b-b42b-7b7db8cfae35 | truongngoctuan/lv2007tm | Source Code/IterativeClosestPoint/IterativeClosestPoint/MyAlign.cpp | #include "MyAlign.h"
#include <Windows.h>
#include <time.h>
#include <fstream>
using namespace std;
MyAlign::MyAlign(void)
{
editAlignPlugin.meshTree.clear();
}
MyAlign::~MyAlign(void)
{
}
bool MyAlign::AddNode(std::string strFile, std::string strName)
{
MeshModel *pModel = new MeshModel();
int mask = 0;
bool op... | TOOL | 0.889827 | 3.72007 |
54d2bcf6-53a2-4d2f-93c1-21a2095e83b2 | Ries0703/applied-algorithm-hust | appliedAlgoHust/src/main/java/CumulativeMatrix.cpp | #pragma GCC optimize("O2")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FOD(i, a, b) for (int i = (a); i >= (b); i--)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define Ries0703 signed main()
#define... | ALGO | 0.999377 | 4.26575 |
66702136-f335-4664-a02b-9b5442f82d5f | BAPPAYNE/Algorithms_Problems | Custom/Sorting/merge_Sort.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<int> merge_Sorted_Arr(vector<int> &arr1,vector<int> &arr2){
int size = arr1.size() + arr2.size() - 1;
vector<int> ans(size);
int i = 0 ;
while(i < size){
if(arr1[i] < arr2[i]){
ans[i] = arr1[i];
}else{
... | ALGO | 0.999993 | 4.50315 |
1df2670f-826c-421a-845d-6eee9426146b | famorcia/modern_cpp_examples | c++20/02_concepts/main.cpp | #include <iostream>
template<typename T>
concept integral = std::is_integral_v<T>;
template<typename T>
concept unsigned_integral = std::is_integral_v<T> && !std::is_signed_v<T>;
template<integral T>
T sum(T a, T b){
return a+b;
}
template<typename T>
requires unsigned_integral<T>
T product(T a, T b){
return a*b;... | ALGO | 0.950523 | 4.60973 |
b8f70312-8791-42bb-bb99-ed1f30973ece | HarshithBorundia/CS_F222_Discrete_Math_Assignment_2 | Q8.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
bool dfs(int node,vector<vector<int>>adj,vector<int>&vis,vector<int>&temp,int parent){
vis[node] = 1;
temp.push_back(node);
for(auto it:adj[node]){
if(!vis[it]){
if(dfs(it,adj,vis,temp,node)==true) return true;
}
... | ALGO | 0.999992 | 4.392996 |
71aeda2b-31a4-49fd-99a7-d0956e47f0ea | Abhi24001/Placement-Preparation-Module | Day 14 : Stack and Queue Part-II/LFU Cache.cpp | class LFUCache {
public:
int Capacity, minFrequency = 0, currentSize = 0;
unordered_map<int, list<int>>frequencyList;
unordered_map<int, list<int>::iterator>keyNode;
unordered_map<int, pair<int, int>>frequency;
LFUCache(int capacity) {
Capacity = capacity;
minFrequency = 0, currentS... | ALGO | 0.999017 | 6.264174 |
8b6fbc61-9e9c-4308-8b22-00b2393f5078 | wiwiho/ideograph_advantage | DataStructure/Convex1D1D.cpp | template<class T>
struct DynamicHull {
struct seg { int x, l, r; };
T f; int C; deque<seg> dq; // range: 1~C
explicit DynamicHull(T _f, int _C): f(_f), C(_C) {}
// max t s.t. f(x, t) >= f(y, t), x < y, maintain max
int intersect(int x, int y) {
int l = 0, r = C + 1;
while (l + 1 < r) {
int mid =... | ALGO | 0.999919 | 4.666152 |
42d88c88-9d06-4865-ac33-87967073ae72 | sashandilya/Competitive-Programming-1 | Cpp/codechef/infiniteinput.cpp | #include<bits/stdc++.h>
#define ll long long int
#define loop(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define rep(i,n) for(int (i)=0;(i)<n;(i)++)
#define bp 1000000007
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).e... | ALGO | 0.998353 | 4.01071 |
90aa0952-8c62-4ae1-a403-a1befdbc63df | AhmedHani/Online-Judges-Problems-SourceCode | UVa/10910 - Marks Distribution.cpp | //#include <cstdlib>
#include <stdio.h>
#include <string.h>
//#include <string>
//#include <iostream>
//#include <map>
//#include <algorithm>
//#include <functional>
#define Max 75 + 5
#define INF 1000000000
//#define INT_MAX 2147483647
//#define FOR(i, N) for( int i = 0 ; i < N ; i++ )
#define FOR1e(i, N) for( int i =... | ALGO | 0.99495 | 3.294736 |
cb4d84f7-d761-40a8-9ef8-46721bbc8518 | yangzhengxing/pbrt-v1 | volumes/volumegrid.cpp | // volumegrid.cpp*
#include "volume.h"
// VolumeGrid Declarations
class VolumeGrid : public DensityRegion {
public:
// VolumeGrid Public Methods
VolumeGrid(const Spectrum &sa, const Spectrum &ss, float gg,
const Spectrum &emit, const BBox &e, const Transform &v2w,
int nx, int ny, int nz, const float *d);
~Vol... | ALGO | 0.962807 | 7.719887 |
ae0dd96c-e786-4d9c-a25e-58dff79577ab | HiQiang/CPP-Note | vector容器/初识vector.cpp | #include<vector>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void myPrint(int val)
{
cout << val << endl;
}
void test01()
{
//创建了一个vector容器,数组
vector<int> v;
//向容器中插入数据
v.push_back(10);
v.push_back(20);
v.push_back(30);
v.push_back(40);
//通过迭代器访问容器中的数据
//第一种遍历
/*vector<int>:... | ALGO | 0.920705 | 3.625035 |
5243df64-6095-424c-bdd0-95595b22dbb9 | byjus-ankur-6174/DSA | array/searching and sorting problems/find_pair_with_difference_k.cpp | #include<bits/stdc++.h>
using namespace std;
bool findPair(int arr[], int n, int diff){
sort(arr, arr + n);
for(int i = 0; i < n; ++i)
if(binary_search(arr + i + 1, arr + n, arr[i] + diff))
return true;
return false;
}
// https://practice.geeksforgeeks.org/proble... | ALGO | 0.999977 | 5.121973 |
3bc952b2-2783-46b0-8ccb-d6543d440d92 | helloobaby/llvm_msvc | llvm/utils/TableGen/DAGISelEmitter.cpp | #include "CodeGenDAGPatterns.h"
#include "CodeGenInstruction.h"
#include "CodeGenTarget.h"
#include "DAGISelMatcher.h"
#include "llvm/Support/Debug.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
using namespace llvm;
#define DEBUG_TYPE "dag-isel-emitter"
namespace {
/// DAGISelEmitter... | TOOL | 0.974269 | 7.950758 |
dae71c67-eebe-47f1-b957-dad93815ccc8 | goodstudyqaq/ACM | codeforces/2100-2199/2117/tmp.cpp | #line 1 "H2.cpp"
#include <bits/stdc++.h>
#line 3 "/Users/guoshen/code/library2/structure/segment-tree/dynamic-segment-tree.hpp"
using namespace std;
/*
struct Info {
// 默认值
Info(int len) {}
static Info merge(const Info& left_info, const Info& right_info, int l, int r) {
return Info();
}
... | ALGO | 0.999961 | 4.551174 |
c8264158-585c-41f5-a97e-d4ab36694fc2 | amolmishra23/leetcode_solutions | decode-ways/decode-ways.cpp | class Solution {
public:
int numDecodings(string s) {
int n = s.size();
vector<int> mem(n+1, -1);
mem[n] = 1;
return n == 0 ? 0: solve(0, s, mem);
}
int solve(int i, string &s, vector<int> &mem) {
// Either we are at end of string, or we have already computed it
... | ALGO | 0.999686 | 5.769639 |
5448668c-e7cd-4c0a-8ef4-52ce83d2657d | Minot1/3D-Game-with-OpenGL | common/objloader.cpp | #include <vector>
#include <stdio.h>
#include <string>
#include <cstring>
#include <glm/glm.hpp>
#include "objloader.hpp"
// Very, VERY simple OBJ loader.
// Here is a short list of features a real function would provide :
// - Binary files. Reading a model should be just a few memcpy's away, not parsing a file at ... | TOOL | 0.937376 | 4.801904 |
7fb03e5b-41d6-421d-a4b6-a8ca208174c6 | poke19962008/Competitive-Coding | CodeForces/825C.cpp | #include <algorithm>
#include <iostream>
#include <stdio.h>
#include <stdio.h>
#include <math.h>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
using namespace std;
#define EPS 1e-9
#define INF 1e15+9
#define MOD 1000000007
#define MAXN 1000006
#def... | ALGO | 0.99979 | 3.457982 |
2dbdd6be-8651-4eaa-aba9-b3568c6f3c98 | ishandutta2007/codeforces | nigus/normal/1619/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, b, a) for(int i = b - 1; i >= a; i--)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll>... | ALGO | 0.999368 | 4.040426 |
4820ee40-53bd-4129-9a53-be79f293d590 | ArtMasl/FSR_MSU | Prac_4sem/KS/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <fstream>
#include <sstream>
#include "Solver.h"
using namespace std;
int main() {
int i, k, p, n, w_max, sum=0;
vector<int> v, w, ans_ind;
vector<vector<int>> V;
string s1, s2, filename;
ifstream f_in;
cout<<"Inse... | ALGO | 0.999523 | 3.143498 |
92f42ed3-79aa-4db5-bdc2-c95cb3bed11a | ABI-Software/ICMA | CPP/CAPBasedSpeckleTracking/src/TimeVaryingSmoother.cpp | #include "TimeVaryingSmoother.h"
TimeVaryingSmoother::TimeVaryingSmoother(std::string fVector, double smoothing, bool fixApex) {
frameVector = fVector;
numberOfTimeSamples = 0;
rho = smoothing;
this->fixApex = fixApex;
numbasis = 100;
std::vector<std::string> stimepoints;
boost::split(stimepoints, frameVector, ... | ALGO | 0.894103 | 3.364812 |
17d91351-0aaf-4fcf-93ae-f6b52687f33b | shiridikumar/kmer_counting | lock.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <ctime>
#include <pthread.h>
#include <stdlib.h>
#include <omp.h>
#include <unistd.h>
using namespace std;
string DNA_sequence;
map<string, int> kmer1;
map<string, int> kmer;
vector<string> strings;
map<string, pthread_spinlock_t> kmerlocks;
int k = 6;
void *threa... | ALGO | 0.997389 | 3.812086 |
0416e6a4-fee2-4768-a57a-5b1290ab1652 | TIFitis/BPI--llvm | libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/binary_transform.pass.cpp | // <algorithm>
// template<InputIterator InIter1, InputIterator InIter2, class OutIter,
// Callable<auto, const InIter1::value_type&, const InIter2::value_type&> BinaryOp>
// requires OutputIterator<OutIter, BinaryOp::result_type> && CopyConstructible<BinaryOp>
// constexpr OutIter // constexpr after C... | TEST | 0.988466 | 6.919359 |
261ab8fa-524f-4a67-a75d-26913bb474b1 | zzctommy/public-source-code | 码库/CF985F Isomorphic Strings.cpp | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mkp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define sz(v) (int)v.size()
typedef long long LL;
typedef double db;
template<class T>bool ckmax(T&x,T y){return x<y?x=y,1:0;}
template<class T>bool ckmin(T&x,T y){return x>y?x=y,1:... | ALGO | 0.999996 | 3.595892 |
ca33ca4c-a062-4bc4-a5d5-bc977d9a0ebd | pikatanpu/programming-fundamentals | 05Percabangan/kondisi.cpp | #include <cstdio>
int main() {
int x;
scanf("%d", &x);
if(x > 0) {
if(x % 2 == 0) {
printf("positif dan genap\n");
} else {
printf("positif dan ganjil\n");
}
} else if(x == 0) {
printf("nol\n");
} else {
printf("negatif\n");
}
}
| ALGO | 0.999855 | 3.88876 |
cc8e0268-aa6d-4911-8ba3-06791636f8c7 | bajiSuan/GAMES202 | homework2/prt/ext/eigen/unsupported/doc/examples/MatrixPower_optimal.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
Matrix4cd A = Matrix4cd::Random();
MatrixPower<Matrix4cd> Apow(A);
std::cout << "The matrix A is:\n" << A << "\n\n"
"A^3.1 is:\n" << Apow(3.1) << "\n\n"
"A^3.3 is:\n" << Apow(3.3) << "\n\n"
... | ALGO | 0.99828 | 3.396939 |
4be5419c-8703-418a-9f22-19444e4157ef | Premkumar981/DSA_Daily_Problems | push pop display exit operations.cpp | #include <iostream>
#include <stack>
using namespace std;
int main() {
stack<int> stk;
while (true) {
int choice;
cin >> choice;
switch (choice) {
case 1: // Push
int value;
cin >> value;
stk.push(value);
brea... | ALGO | 0.98774 | 5.594073 |
b690cb16-fad2-46b5-a22a-aa4f89e5ca9c | hookfat/DS_project2 | graph.cpp | #include "p2.h"
#include <iostream>
#include <fstream>
using namespace std;
void graph::readmap()
{
ifstream in;
in.open("floor.data");
in >> x >> y >> battery;
road = new char*[x];
for(int i = 0; i < x; ++i) {
road[i] = new char[y];
}
bfs_map = new int*[x];
for(int i = 0; i < ... | ALGO | 0.975646 | 3.079389 |
b2cbc859-4a06-40be-90ff-8486baff28aa | Soloman-IT/aisd | hw/7-hw/task_2.cpp | #include <iostream>
#include "bin_s.h"
bool Check(const int mas[3][3], int num, int len_str, int len_stolb)
{
for (int i = 0; i < len_str; i++)
{
if (Bin_Search_ts_2(mas[i], num, len_stolb))
return 1;
}
return 0;
}
int main()
{
int mas[3][3] =
{
{1,3,4},
{6,8,10},
{45,67,68}
};
if (Check(mas, 1... | ALGO | 0.956659 | 4.112998 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.