uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f2fc54b3-077f-40e1-9f25-a7436d4f23ab | shivu47/100codes | primeFactors2.cpp | // find prime factors like input=36 output=[2,2,3,3] ,,,input=24 output=[2,2,2,3]like this
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cout<<"Enter a number";
cin>>n;
vector<int>primeFactors;
for (int i = 2; i <= n; i++)
{
while(n%i == 0) {
primeFactors.push_back(i);
n = n/i;
... | ALGO | 0.999817 | 5.21006 |
9d9e9997-57b1-4eb0-9b2d-6ffc8a7e07a7 | Natsu1270/Codes | cpp/binarySearch.cpp | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
void nhapmang(int a[], int n) {
for (int i = 0; i < n; i++) {
cin >> a[i];
}
}
int binarySearch2(int a[], int value,int n) {
int right = n-1;
cout << right << endl;
int left = 0;
int mid;
while (left < right) {
mid = left + (right ... | ALGO | 0.999904 | 4.630774 |
0370799a-4e59-403d-9a32-918e0cc5ed56 | Saurav-sanu/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.999991 | 6.513768 |
0ae3dcc9-ec31-4460-81c4-469d704b8d64 | kunyavskiy/competitive-programming-archive | codeforces.com/sponsored/Playrix/D.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>... | ALGO | 0.999879 | 3.757929 |
a8260183-736b-4859-b902-6099ae5f185c | sschw/aoc21 | day14.cpp | // AoC.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <string>
#include <sstream>
#include <map>
#include <fstream>
#include <vector>
using namespace std;
int main()
{
string target = "PHVCVBFHCVPFKBNHKNBO";
string rulesStr = "HK -> F|VN... | ALGO | 0.998906 | 4.784934 |
e3871842-d316-44de-9408-9d937d742b0c | Li-Shu14/.leetcode | 287.find-the-duplicate-number.cpp | /*
* @lc app=leetcode id=287 lang=cpp
*
* [287] Find the Duplicate Number
方法一:哈希表记录
执行用时 :
20 ms, 在所有 C++ 提交中击败了42.48%的用户
内存消耗 :
11 MB, 在所有 C++ 提交中击败了13.33%的用户
方法二:用set。
执行用时 :
56 ms, 在所有 C++ 提交中击败了5.77%的用户
内存消耗 :
12.8 MB, 在所有 C++ 提交中击败了6.67%的用户
真差劲啊······
方法三:
FLoyd算法。两阶段双指针法。(第一阶段快慢指针,第二阶段俩慢指针)
快慢指针题型说明:https:/... | ALGO | 0.999954 | 5.488273 |
c5b0af5d-7d95-4674-971f-1db7da1a110e | una1veritas/geoinfo | std_map_sample/src/std_map_sample.cpp | #include <iostream>
#include <map>
#include <unordered_map>
#include <cinttypes>
using namespace std;
typedef uint64_t uint64;
struct uint64pair {
uint64 first, second;
uint64pair(const uint64 & a, const uint64 & b) {
if ( a > b ) {
first = b;
second = a;
} else {
first = a;
second = b;
}
}
u... | TOOL | 0.930238 | 3.87886 |
d588f2bb-27b9-42bd-8680-11a323682f7f | khanhtran219/DSA | tinhP(n,k).cpp | #include<bits/stdc++.h>
using namespace std;
int mod = 1e9+7;
void P(int n,int k){
long long s = 1;
for(int i = n; i > n-k; i--){
s = (s*i) % mod;
}
cout <<s<<endl;
}
int main(){
int t;
cin >> t;
while(t--){
int n,k;
cin >> n>>k;
if(k>n) cout <<"0"<<endl;
else{
P(n,k);
}
}
return 0;
}
| ALGO | 0.999973 | 4.711554 |
6277ca8e-2856-4c87-8d9b-41cb8113c677 | lumunge/100-days-of-code | Datastructures/PracticeProblems/LeetCodeDSI-CPSolns/mergeSorted.cpp | #include<bits/stdc++.h>
/* PROBLEM STATEMENT:
* Given two sorted arrays and two integers. Merge array 2 into array 1 which is sorted in
* non-decreasing order, array 2 has a length of sum of m + n.
*
* Input: nums1 = [1, 2, 3, 0, 0, 0]
* nums2 = [2, 5, 6]
* m = 3
* n = 3
* Output: nums1 = ... | ALGO | 0.999998 | 6.191754 |
499a26a7-d7e1-4b77-8dae-799689dbe068 | yzengal/PrivacyComputingCourse | Lecture3_CRYPTO/caesar/caesar.cpp | #include <string>
#include <iostream>
#include <string>
#include <cctype> // 用于std::tolower和std::toupper
using namespace std;
// 凯撒密码加密函数
string CaesarCipherEncrypt(const string& plain_data, int shift) {
string encrypt_data;
for (size_t i=0,sz=plain_data.size(); i<sz; ++i) {
char ch = pl... | ALGO | 0.99766 | 5.204735 |
a1d878df-2cd1-4878-9498-bbe6120759a5 | MehulGarg22/Algo_Engineering | Program/Graph/Graph_CycleDirected.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <vector>
using namespace std;
bool iscycle(int src, vector<vector<int>> &adl, vector<bool> &vis, vector<int> stackk){
if(!vis[src]){
vis[src]=true;
stackk[src]=true;
for(auto i: adl[src]){
if(!vis[i] && iscycle(i, adl, vis, s... | ALGO | 0.999973 | 5.093942 |
417f9641-a778-4fd8-9007-ee6aa0df8fbc | KhalidUsman2024/Programming-Fundamentals-In-C-Plus-Plus | 3 Loops/80 prduct of the given numbers.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter A Number :";
cin>>n;
int product=1;
while(n!=0)
{
int ld=n%10;
n=n/10;
product*=ld; // sum+=ld = sum=sum+ld
}
cout<<product;
}
| ALGO | 0.999926 | 4.160327 |
8cc162e3-243e-417b-9e43-2d8b47201773 | LINxu233/Algorithm | LintCode/203. 线段树的修改.cpp | class Solution
{
public:
void modify(SegmentTreeNode *root, int index, int value)
{
if(!root)
return ;
if(root->start==root->end)
{
if(root->start==index)
root->max=value;
return ;
}
modify(root->le... | ALGO | 0.999965 | 4.984893 |
a506bc64-4def-48f6-b14d-9255e6ac97ba | EuiSeong-Moon/Algorithm | Baekjoon/전화번호목록.cpp | #include<iostream>
#include<unordered_map>
#include<string>
#include<algorithm>
#include <vector>
using namespace std;
bool cmp(string a, string b) {
return a.size() < b.size();
}
int main(void) {
int T;
cin >> T;
for (int test = 0; test < T; test++) {
int N;
string buf;
cin >> N;
unordered_map<string,int>... | ALGO | 0.99994 | 4.7799 |
1b1f9220-51c2-405f-a3ab-7e4a83d4db6c | fpolica91/Leetcode-challenges | sliding_window_pattern/min_window_subsequence.cpp | // 727. Minimum Window Subsequence
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
class Solution {
public:
string minWindow(string s1, string s2) {
// initialize both pointers to 0;
int ptr1 = 0;
int ptr2 = 0;
int longest_substring = INT_MAX;
string ans = "";
// while we ha... | ALGO | 0.999854 | 6.082752 |
3d1f6332-ff5a-4b07-ba5b-252ccdc62dd8 | ishandutta2007/codeforces | quang/normal/359/C.cpp | #include <bits/stdc++.h>
#define fi freopen("inp.txt", "r", stdin)
#define fo freopen("out.txt", "w", stdout)
using namespace std;
const int N = 100010, MOD = 1000000007;
int n, x;
long long sum;
long long Pow(long long a) {
long long res = 1;
for(long long j = 1ll * x; a; j = j * j % MOD) {
if(a % ... | ALGO | 0.999983 | 3.929196 |
bcdc4200-4637-4db2-8b7e-bbf71f0bcee2 | Suvrojyoti/APS-2020 | Codeforces_Submissions/1199C.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll n,i,j;
unsigned ll k;
cin>>n>>k;
ll arr[n+5],a[n+5];
map <ll,ll> m;
for(i=0;i<n;i++)
{
cin>>arr[i];
m[arr[i]]++;
}
k=8*k;
k=k/n;
if(k>=30)
{
cout<<"0";
exit(0);
}
k=pow(2,k);
if(m.size()... | ALGO | 0.999963 | 3.243183 |
58104508-315c-48a8-9cb9-4c6ec65d8f86 | Luicosas/Contest_Copy | persistant_seg.cpp | #include<bits/stdc++.h>
#include<functional>
using namespace std;
#define ll long long
#define rep(i, a, b) for(int i = a; i < b; i++)
#define pb push_back
#define pii pair<int,int>
struct Node {
int l, r;
Node *lc, *rc;
int sum;
Node(int lb, int rb){
l = lb; r = rb; sum = 0;
if(lb =... | ALGO | 0.999542 | 3.951521 |
4bde475b-5850-4c42-9ce8-a2c2bb943d19 | junrushao/ACM-Training-Tasks-2014 | 2014.07.15/Solutions/B.cpp | #include <cstdio>
#include <cstdlib>
#include <string>
#include <iostream>
using namespace std;
int flag, test;
string str;
void dfs(string now) {
if (flag) {
return;
}
//cout << now << endl;
int f[30] = {0};
if (now.size() == 0) {
flag = 1;
return;
}
int ss = now.size();
f[ss - 1] = 1;
for (int i =... | ALGO | 0.999717 | 3.875896 |
3e0b7866-6bda-4a38-9785-905e2534f0da | Lzyuuu/Cpp-Program | Chapter 5/Interest/Interest/main.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main() {
// initialization
double principle{1000.00}; // initial amount
double rate{0.05}; // interest rate
cout << setprecision(2) << fixed;
cout << "Original amount invested: " << principle << endl;
cout <<... | ALGO | 0.994699 | 5.215716 |
9b2afaf6-abdc-41c0-8fae-e2caef20d320 | ishandutta2007/codeforces | w0nsh/normal/811/B.cpp | #include <bits/stdc++.h>
#define FOR(i, n) for(int i = 0; i < (n); ++i)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define TRAV(i, n) for(auto &i : n)
#define SZ(x) (int)(x).size()
#define PR std::pair
#define MP std::make_pair
#define X first
#define Y second
typedef long long ll;
typedef std::pair<int, int> ... | ALGO | 0.999994 | 3.876338 |
c8b339dc-1096-4277-9ca5-0e165b7c69e7 | gitter-badger/DeathCore | dep/g3dlite/source/PrecomputedRandom.cpp | #include "G3D/PrecomputedRandom.h"
#include "G3D/System.h"
namespace G3D {
PrecomputedRandom::PrecomputedRandom(int dataSize, uint32 seed) :
Random((void*)NULL),
m_hemiUniform(NULL),
m_sphereBits(NULL),
m_modMask(dataSize - 1),
m_freeData(true) {
alwaysAssertM(isPow2(dataSize), "dataSize must be a power of... | ALGO | 0.962648 | 6.464469 |
b8a9fff4-e964-499b-964c-be73698b6795 | ClaireXie/edgeGuidedSDSP | funcs/ann/src/bd_search.cpp | #include "bd_tree.h" // bd-tree declarations
#include "kd_search.h" // kd-tree search declarations
//----------------------------------------------------------------------
// Approximate searching for bd-trees.
// See the file kd_search.cpp for general information on the
// approximate nearest neighbor searc... | ALGO | 0.999919 | 6.061532 |
275743b1-c525-4765-8b1a-6f5706015195 | ajunior/cp | uri/Cpp/1050.cpp | #include <iostream>
using namespace std;
int main() {
int ddd;
cin >> ddd;
switch (ddd) {
case 61:
cout << "Brasilia\n";
break;
case 71:
cout << "Salvador\n";
break;
case 11:
cout << "Sao Paulo\n";
break;
... | ALGO | 0.999191 | 5.342489 |
fe23b50e-cd9e-4e24-a61a-cba31c724e5f | jeongwwon/CodingTest | 1/트럭주차.cpp | #include<bits/stdc++.h>
using namespace std;
int A, B, C;
int a, b;
int sum=0;
int arr[104];
int main() {
cin >> A >> B >> C;
for (int i = 0; i < 3; i++) {
cin >> a >> b;
for (int j = a; j < b; j++) {
arr[j]++;
}
}
for (int j = 1; j < 100; j++) {
if (arr[j]) {
if (arr[j] == 1) {
sum += A;
}
... | ALGO | 0.999746 | 3.818362 |
53aaafff-ac8d-4095-bbde-8d01190f6483 | p-podsiadly/llvm-stm8 | clang/test/CodeCompletion/function-templates.cpp | namespace std {
template<typename RandomAccessIterator>
void sort(RandomAccessIterator first, RandomAccessIterator last);
template<class X, class Y>
X* dyn_cast(Y *Val);
}
class Foo {
public:
template<typename T> T &getAs();
};
template <typename T, typename U, typename V>
V doSomething(T t, const U &u, V ... | TOOL | 0.921194 | 6.202737 |
c8de216a-393d-4529-888e-131726119e8f | msa-iqbal/c-plus-plus-code-solutions | 06.0 (C++) Showing Multiplication table from given number.cpp | /// Showing Multiplication table from given number
#include <iostream>
using namespace std;
int main()
{
while(1){
int num, i;
cout<<"\n Enter the number for multiplication: ";
cin>>num;
cout<<endl;
/* -------- Iteration -------- */
for(i=... | ALGO | 0.982395 | 3.718502 |
bca009ab-7ea0-43e8-b3a6-a8cad649ed4c | LinuxUserGD/godot-opengl-4 | thirdparty/oidn/mkl-dnn/src/cpu/gemm_x8s8s32x_convolution.cpp | #include "c_types_map.hpp"
#include "utils.hpp"
#include "type_helpers.hpp"
#include "mkldnn_thread.hpp"
#include "math_utils.hpp"
#include "simple_q10n.hpp"
#include "gemm/gemm.hpp"
#include "gemm_x8s8s32x_convolution.hpp"
namespace mkldnn {
namespace impl {
namespace cpu {
using namespace mkldnn::impl::utils;
usi... | ALGO | 0.990239 | 7.128073 |
f0e4970c-3649-42fa-a265-25fbf31fbbc2 | williamwaterson/protolayer | evaluators/src/protolayer/evaluators/EdgeRadialsEvaluator.cpp | #include "EdgeRadialsEvaluator.h"
namespace protolayer
{
namespace evaluators
{
EdgeRadialsEvaluator::EdgeRadialsEvaluator(FaceNormalsEvaluator& faceNormalsEvaluator,
EdgeDirectionsEvaluator& edgeDirectionsEvaluator) :
_faceNormalsEvaluator(&faceNormalsEvaluator),
_edge... | ALGO | 0.939097 | 6.3132 |
a8c99f1e-750f-4515-8d21-87a549c8d4cb | akarazeev/Algorithms-at-MIPT | 3sem-AlgoGraphs/src/MaxFlow.cpp | #include "../include/MaxFlow.hpp"
MaxFlow::MaxFlow(int n): data_(TableOfPairs (n,
std::vector<std::pair<double, double> >
(n,std::pair<double, double> ()))) {
}
void MaxFlow::AddEdge(int from, int to, double cap, double cost) {... | ALGO | 0.995415 | 4.599323 |
a2f30df8-df6d-4e6a-8ea5-86509df4d19f | xtreme-coding/hacktoberfest-2022 | GeeksforGeeks/Swap_kth_elements.cpp | /*
* कर्मणये वाधिकारस्ते मां फलेषु कदाचन ।
* मां कर्मफलहेतुर्भू: मांते संङगोस्त्वकर्मणि ॥
*/
#include <bits/stdc++.h>
using namespace std;
#define bug(...) __f (#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template ... | ALGO | 0.99998 | 4.032177 |
0f3d9241-c417-4f50-9d6d-9a4c653d96d2 | khanadilgithub/GFG_DSA | Tree/PrintNodeAtKdistance.cpp | #include<iostream>
#include<math.h>
using namespace std;
struct Node
{
int m_data;
Node* m_left;
Node* m_right;
Node(int val)
{
m_data=val;
m_left=NULL;
m_right=NULL;
}
};
void printKdistance(Node* root, int k)
{
if(root==NULL) return;
if(k==0)
{
co... | ALGO | 0.999885 | 3.868486 |
3d151ae5-6f7e-48dd-8400-30f2a41e04f2 | 134ARG/csctest | src/odd-even-sort.cpp | #include <algorithm>
#include <cstddef>
#include <cstdint>
#include <odd-even-sort.hpp>
#include <mpi.h>
#include <pthread.h>
#include <iostream>
#include <vector>
#define USED_PROC_TAG 6
#define DATA_SIZE_TAG 5
#define SEND_BACK_TAG 4
#define SIZE_TAG 3
#define INIT_DATA_TAG 2
#define EVEN_SEND 1
#define ODD_SEND 0
... | ALGO | 0.999867 | 4.305071 |
bea79d4c-d585-48d0-b6d3-7d62aef5b626 | ShawnTSH1229/XEngine | ThirdParty/boost_1_78_0/libs/geometry/test/algorithms/distance/distance_se_geo_ar_ar.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Unit Test
#ifndef BOOST_TEST_MODULE
#define BOOST_TEST_MODULE test_distance_geographic_areal_areal
#endif
#include <boost/test/included/unit_test.hpp>
#include "test_distance_geo_common.hpp"
#include "test_empty_geometry.hpp"
template <typename Point, typenam... | TEST | 0.954253 | 7.720117 |
4112d441-de12-4166-90bf-0ec2f18a3d05 | hoshi524/hokudai-hitachi2017-2 | src/bad/b.cpp | #include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
class Timer {
public:
void restart();
double getElapsed();
Timer();
private:
static double rdtsc_per_sec_inv;
double getTimeOfDay();
unsigned long long int getCycle();
double start_time;
unsigned long long int start_clock;
};
dou... | ALGO | 0.999862 | 4.172286 |
d0ec459e-7d78-454e-9971-f628c0685d2e | SimonMaracine/checkers-engine | engine/checkers_engine/src/evaluation.cpp | #include "evaluation.hpp"
#include <algorithm>
#include <array>
namespace evaluation {
template<Eval M>
static constexpr auto positioning_king() noexcept {
return std::array<Eval, 32> {
M, M, M, M,
M, 0, 0, 0,
0, 1, 1, M,
M, 1, 1, 0,
0, 1, 1,... | ALGO | 0.999354 | 6.338924 |
4a791f91-d390-4d3c-807c-09ba9ffabb81 | hongbo-yao/MagTFs | contrib/eigen/bench/product_threshold.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
#define END 9
template<int S> struct map_size { enum { ret = S }; };
template<> struct map_size<10> { enum { ret = 20 }; };
template<> struct map_size<11> { enum { ret = 50 }; };
template<> struct ... | TOOL | 0.908588 | 5.102006 |
edcf9435-c4a0-4a8c-9f61-f2ad9f17d9d6 | nardo0905/CS-Uni-Course-Git | 221216 Pract/task1.cpp | #include <iostream>
#include <cstring>
void deleteWhitespaces(char* str) {
int len = strlen(str);
int count = 0;
for (int i = 0; i < len - 1; i++) {
if (str[i] == ' ' || str[i] == '\t' || str[i] == '\n') {
continue;
}
str[count++] = str[i];
}
}
int ma... | TOOL | 0.926807 | 5.138321 |
2abfc776-972b-4f6e-ac06-9826ee6831ea | adityarajsingh11/DSA | Adi DSA/Linked list in C++/Circular Linked List/detectLoop_3_method.cpp | #include<iostream>
#include<vector>
using namespace std;
class Node{
public:
int data;
Node *next;
// constructor to initialiazed value
Node(int value){
data=value;
next = NULL;
}
};
Node* CreateLinkedlist(int arr[],int index,int size){
// Base case: if index reaches the ... | ALGO | 0.999711 | 5.318975 |
d8a54a4e-232e-48fe-837b-6025627b2356 | tamimahmed11/ProblemSolving | A_Twins.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int>tk(n);
int total = 0;
for (int i = 0; i < n; i++) {
cin >>tk[i];
total=total+tk[i];
}
sort(tk.rbegin(),tk.rend());
int sum= 0;
int cnt = 0;
for (int i = 0; i < n; i++)... | ALGO | 0.999941 | 3.918041 |
05717fd6-9d08-4dc8-baba-24e1f4f2b639 | AJAMEY77/gfg_potd | subarray_Sum.cpp | //Given an unsorted array A of size N that contains only positive integers, find a continuous sub-array that adds to a given number S and return the left and right index(1-based indexing) of that subarray.
//
//In case of multiple subarrays, return the subarray indexes which come first on moving from left to right.
//
... | ALGO | 0.999927 | 5.53464 |
28c0cced-f854-45d5-be65-960b16f3792f | ishandutta2007/codeforces | sexpert/normal/1056/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e6 + 3;
const ll MOD = 1e9 + 7;
vector<ll> bases = {37};
vector<vector<ll>> rhash;
string s, t;
ll modpow(ll a, ll b)
{
if(b < 0)
b += (MOD - 1);
if(b == 0)
return 1;
if(b % 2)
return (a * modpow(... | ALGO | 0.999965 | 4.730974 |
cf7581a0-a89c-4a8a-a3c4-98cd3538cc92 | jsrv07/Applied-problem-solving-in-CP | Shreshtha_24b1033/week4/minm_no_of_days_to_make_m_bouquets.cpp | class Solution {
public:
bool isPoss(vector<int>& bloomDay, int m, int k, int day){
int tot=0;
for(int i=0;i<bloomDay.size();i++){
int cnt=0;
while(i<bloomDay.size() && cnt<k && bloomDay[i]<=day){
cnt++;i++;
}
if(cnt==k){
... | ALGO | 0.999998 | 5.926693 |
6f120f9a-bdf7-4d9e-bbbc-e5aeafdb8fc0 | rexlitheking/bitcoin-froking | src/bech32.cpp | #include <bech32.h>
namespace
{
typedef std::vector<uint8_t> data;
/** The Bech32 character set for encoding. */
const char* CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
/** The Bech32 character set for decoding. */
const int8_t CHARSET_REV[128] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -... | ALGO | 0.998263 | 7.480745 |
856cd280-d375-467d-9436-f56a34fb4fd9 | ikbuibui/rg | examples/fib.cpp | #include <rg.hpp>
#include <chrono>
#include <cinttypes>
#include <cstdio>
static size_t thread_count = std::thread::hardware_concurrency() / 2;
static size_t const iter_count = 1;
inline auto fib(size_t n) -> rg::Task<size_t>
{
if(n < 2)
{
co_return n;
}
auto a = co_await rg::dispatch_task<... | ALGO | 0.995659 | 5.81529 |
2bf43e4f-7701-43e3-a730-36bd301f3e24 | kkafar/algo | algorytmy/cpp/zamiana-bez-buff.cpp | #include <iostream>
int main()
{
int a, b;
std::cin >> a >> b;
std::cout << "(a, b) == (" << a << ", " << b << ")\n";
a = a + b;
b = a - b;
a = a - b;
std::cout << "(a, b) == (" << a << ", " << b << ")\n";
return 0;
}
| ALGO | 0.999183 | 4.70797 |
313b930e-f5b9-4258-befd-4a2036cce149 | bhaavya215/DAA | floyd.cpp | #include <iostream>
#include <vector>
using namespace std;
const int INF = 99999; // A large number representing infinity
void floydWarshall(vector<vector<int>>& graph, int V) {
vector<vector<int>> dist = graph; // Copy original graph
// Main Floyd-Warshall logic
for (int k = 0; k < V; k++) {
for... | ALGO | 0.999954 | 5.374351 |
414f2840-3b24-4703-8787-72740f4376f8 | devangi2000/Data-Structures-Algorithms-Handbook | Dynamic Programming/FrogJump403.cpp | // A frog is crossing a river. The river is divided into some number of units, and at each unit, there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.
// Given a list of stones' positions (in units) in sorted ascending order, determine if the frog can cross the river by... | ALGO | 0.99997 | 6.183424 |
6d316f29-ab78-41b7-bc49-3462deaa572f | bravefishing/PythonCompiler | FangyuA8-resubmit/TableEntry.cpp | #include "LexicalAnalyzer.h"
#include "TableEntry.h"
#include <string>
#include <streambuf>
#include <iostream>
#include <stdlib.h>
#include <cstring>
//using namespace std;
SymbolTable::SymbolTable()
{//initialzation empty Table
int i=0;//used to loop the table
while (i<PRIME){
Table[i]=NULL;
i++;
}
}
int Sy... | ALGO | 0.893114 | 3.272342 |
8d34a31d-3fdf-44b8-b66b-00131b8fc284 | raincross7/code-similarity | codes/train_code/problem320/problem320_152.cpp | #include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1000000007;
typedef long long ll;
typedef unsigned long long ull;
#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)
// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
uint64_t temp;
whi... | ALGO | 0.99993 | 4.255119 |
c467f50b-682a-4bf5-8474-91e748d841c9 | hunggiao/Embedded-Interview | 16. Unit Test/Tam_Giac/tamgiac/tamgiac.cpp | #include "pch.h"
#include "tamgiac.hpp"
string determineTriangleType(double x1, double y1, double x2, double y2, double x3, double y3) {
double side1 = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
double side2 = sqrt(pow(x3 - x2, 2) + pow(y3 - y2, 2));
double side3 = sqrt(pow(x1 - x3, 2) + pow(y1 - y3, 2));
... | ALGO | 0.968012 | 5.523052 |
9c3b7011-8747-4d02-adc9-557e29d94d78 | Samarth7212/SE | Sem-4/DSAL/DSAL_Assignment7.cpp | /*
Samarth Kamble
21142 (F1-Batch)
Assignment-7
Date of completion: 12/05/22
Problem Statement:
You have a business with several offices; you want to lease phone lines to connect them up with each other; and the phone
company charges different amounts of money to connect different pairs of ... | ALGO | 0.99954 | 3.970494 |
6d4aa9eb-401d-45e6-b4c7-66cb5073eaef | iammfarhan/counter_app_using_mobx | 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.998693 | 6.797273 |
efb759e8-0d70-4196-b88c-da3dbe29a9c7 | ChongXern/Leetcode | combinations.cpp | /**
* https://leetcode.com/problems/combinations/
* Backtracking
* Medium
*/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
void backtrack(vector<vector<int> >& combinations, vector<int>& currentCombo, int start, int k, int n){
if (k == 0) {
combinations.... | ALGO | 0.999977 | 5.943488 |
a3b4adc6-0703-4b2a-b607-a3b03e44d7c0 | candyrock10/candyrock10 | dsa/queue.cpp | #include<iostream>
#include<queue>
using namespace std;
int main()
{
queue<int> q; // creating a queue
q.push(11);
q.push(12);
q.push(5);
cout<<"size of queue is:"<<q.size()<<endl;
// q.size will tell the size of queue
q.pop(); // we cant mention which element to remove as it follows FIFO
... | ALGO | 0.873526 | 3.915302 |
9871fc74-bc77-4432-a243-807b7ef7c667 | Mel0ne/WoW_emu_legacy_stuff | Core scripts & patches/Script-Land/Blizzlike/ArcPro-ArcEmu/ArcPro/InstanceScripts/Naxxramas/boss_thaddius.cpp | #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "Player.h"
#include "naxxramas.h"
//Stalagg
enum StalaggYells
{
SAY_STAL_AGGRO = 0,
SAY_STAL_SLAY = 1,
SAY_STAL_DEATH = 2
};
enum StalagSpells
{
SPELL_POWERSURGE = 28134,
H_SPE... | TOOL | 0.860538 | 7.170774 |
aeff3498-a910-4ad2-aeab-dd67bf7ab3c0 | sivasai444/cryptography | CSA5154 10.cpp | #include <stdio.h>
#define GRID_SIZE 5
// Function to display the Playfair matrix
void displayPlayfairMatrix(char matrix[GRID_SIZE][GRID_SIZE]) {
printf("Playfair Matrix:\n");
for (int i = 0; i < GRID_SIZE; i++) {
for (int j = 0; j < GRID_SIZE; j++) {
printf("%c ", matrix[i][j]);
}... | ALGO | 0.966631 | 4.530123 |
7eca5ba5-9b72-4981-bc45-9fc02a2600f5 | shiva92/Contests | HackerRank/Oct/OpenBracketCodeSprint/FradulentSol.cpp | #include <iostream>
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <cstring>
#include <ctime>
#include <cassert>
using namespace std;
#define SZ(x) ((int)(x.size()))
#define FOR(i,n) for(int (i)=0;(i)<(n);++(i))
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++)
#define ... | ALGO | 0.99991 | 3.595029 |
78f77942-f50f-4069-809c-7b7110e4847f | furkankirac/cs409-2022-23-spring | week14-app5.cpp |
// multi threading, std::thread
// pre-emptive multitasking OS (even in a single core) with context switch
// NMI (non-maskable interrupt)
#include <iostream>
#include <thread>
void myThreadFunction() {
for (int i = 0; i < 5; ++i) {
std::cout << "Thread " << std::this_thread::get_id() << ": " << i << st... | TOOL | 0.889019 | 5.484046 |
c79b3649-b1ce-47ec-bf4a-80141bf5eb39 | jaimemin/programmers | 숫자 변환하기.cpp | #include <string>
#include <vector>
#include <set>
using namespace std;
int solution(int x, int y, int n) {
int answer = 0;
set<int> s;
s.insert(x);
while (!s.empty())
{
if (s.find(y) != s.end())
{
return answer;
}
set<int> s2;
... | ALGO | 0.999956 | 4.483104 |
01c7f4b1-84ca-4087-956c-d7f3a493b5f8 | KaleTEvans/DSandAlgorithmsInCPPSolutions | OOPIntro/TextBook_C_2_9.cpp | // Write a C++ program that can input any polynomial in standard algebraic notation and outputs the first derivative of that polynomial
// We will probably need to use a string input here, such as "4x^2 + 3x + 1", which would return "8x + 3"
#include <iostream>
#include <vector>
#include <string>
using namespace std... | ALGO | 0.999582 | 5.184379 |
aeb2d209-134f-488a-938b-311d95924ba4 | Abdullah-Niaz/Binary-Tree-Popular-Interview-Problems | 129. Sum Root to Leaf Numbers/main.cpp | #include <iostream>
using namespace std;
// 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 *r... | ALGO | 0.999958 | 7.032112 |
7368fea9-e158-4cef-b299-cfc68e9aab6c | teaNoPot/A2OJ_Ladder | A2OJ_level1/33_165A.cpp | /**
* A. Supercentral Point
*/
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(NULL);
using namespace std;
bool isSuperCentral(pair<int,int> v, vector<pair<int,int>> l) {
bool bot = false, top = false, lt = false, rt = false;
for(pair<int,int> p : l) {
if(p.first == v.firs... | ALGO | 0.999963 | 4.615644 |
e4a4cbb2-89ba-4a30-b1d1-16db8e5f5d69 | sadsad33/BaekJoon | 2828/main.cpp | // 2828
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
int n, m, appleNum, totalMoveCnt;
int targetX;
int main(void) {
scanf("%d%d\n%d", &n, &m, &appleNum);
int currentXLeft = 0, currentXRight = m - 1;
while (appleNum--) {
int x; scanf("%d", &x);
targetX = x - 1;
if (targetX >= curre... | ALGO | 0.999959 | 3.385237 |
03574da1-36fd-40b7-aa3e-81bd84dd3f43 | Shimanto9sqr/TLE_cp | 800/desorting.cpp | #include <bits/stdc++.h>
#include <string>
#include <vector>
#include <map>
using namespace std;
using ll = long long;
void solve(){
ll n;
cin>>n;
ll arr[n]; vector<ll> dif;
for(int i=0;i<n;i++){
cin>>arr[i];
if(i>0)dif.push_back(arr[i]-arr[i-1]);
}
auto op = min_element(dif.be... | ALGO | 0.999912 | 4.453558 |
5fb02b59-43d3-416e-a3bf-43b95d643643 | elben6exam/docker_raspberry_yolo | arm_docker/thirdparty/ComputeLibrary/tests/validation/reference/BoundingBoxTransform.cpp | #include "BoundingBoxTransform.h"
#include "arm_compute/core/Types.h"
#include "arm_compute/core/utils/misc/ShapeCalculator.h"
#include "arm_compute/core/utils/misc/Utility.h"
#include "tests/validation/Helpers.h"
namespace arm_compute
{
namespace test
{
namespace validation
{
namespace reference
{
template <typename... | ALGO | 0.928659 | 7.816878 |
c185e43b-25ac-4451-9d21-1b8e0a92ca42 | tejdeep9/coding-practice | recursion and dynamic programming/Longest Increasing Subsequence.cpp | #include <iostream>
#include <algorithm>
using namespace std;
//optimal subproblem LIS(i)= {1+max(LIS(j))} where for all j<i, return max(LIS[i)).
//Time Complexity: exponential.
int LIS_driver(int* arr, int n, int& lis)
{
//base case for the recursion
if(n == 0)
return 0;
int res; //store the ... | ALGO | 0.999973 | 4.927193 |
3b01fef0-6676-4aa7-b11c-2fb287f227c4 | priyanshu1019/LeetCode-Solutions | 1723-maximum-number-of-achievable-transfer-requests/maximum-number-of-achievable-transfer-requests.cpp | class Solution {
public:
int result = INT_MIN;
int m;
void solve(int idx , int count , int n , vector<int> &resultant , vector<vector<int>>&requests){
if( idx == m ){
int allZeros = true;
for(auto it:resultant){
if( it != 0){
allZe... | ALGO | 0.999974 | 6.030581 |
3d9f9d1d-63e8-4529-b50c-4816bea7a92e | sunxfancy/LLVM-IPRA | libcxx/test/std/algorithms/alg.modifying.operations/alg.fill/ranges.fill.pass.cpp | // <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
// template<class T, output_iterator<const T&> O, sentinel_for<O> S>
// constexpr O ranges::fill(O first, S last, const T& value);
// template<class T, output_range<const T&> R>
// constexpr borrowed_iterator... | TEST | 0.862085 | 7.543656 |
5974cb3d-334a-4082-9b3a-48057da6e22c | lukanzx/rpc-storage-cpp | src/raftCore/raft.cpp | #include "raft.h"
#include "config.h"
#include "util.h"
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <memory>
void Raft::AppendEntries1(const raftRpcProctoc::AppendEntriesArgs *args,
raftRpcProctoc::AppendEntriesReply *reply) {
std::lock_gua... | TOOL | 0.933313 | 5.120261 |
46cd2a72-b003-4409-b910-afc82459a651 | crisron-zz/SPOJ | cstreet.cpp | // Kruskal's algorithm
#include <iostream>
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
#define MAX 1000
using namespace std;
int rank[MAX + 2];
int parent[MAX + 2];
vector <pair <int, pair <int, int> > > adj;
void createGraph (int);
void addEdge (int, int, int);
void reset (int);
int... | ALGO | 0.999908 | 3.839502 |
a3721509-6aee-45ec-bc74-3c84ba5a0c15 | LuisFcarmo/UFG | TAP/semana06/02.cpp | #include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;
int meu_log (int numero, int base) {
int valor = 1, contador = 0;
while (valor <= numero) {
valor *= base;
contador++;
}
return contador;
}
int main () {
int numero;
int base;
... | ALGO | 0.999643 | 3.864388 |
ae524f11-1790-493c-818e-bec025010975 | Nobles3689/practice | 20240119_#1987_graph.cpp | //Beakjoon Online Judge #1987
#include <iostream>
#include <vector>
using namespace std;
struct Coord
{
int y = 0;
int x = 0;
bool operator==(Coord& other)
{
return x == other.x && y == other.y;
}
bool operator!=(Coord& other){
return !(*this == other);
}
Coord operator... | ALGO | 0.999964 | 4.211022 |
57f2b781-3b80-4b02-8f04-8a9dfa4b9834 | virendrakabra14/P2P-Network | solved/p4/tc4_0/files/client4/q1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, int> pii;
pii left(const vector<ll> &v, int l, int r)
{
if(v[l]<0)
return pii(v[l], l+1);
ll ans=v[l++];
while(v[l]>=0 && l<=r)
ans += v[l++];
return pii(ans,l);
}
pii right(const vector<ll> &v, int l, int r)
{
if(v[r]<0)... | ALGO | 0.999976 | 4.117383 |
9531605b-1e04-441c-8df6-7d8f19b82c43 | djadjaa/AISP23 | 6 skupovi i mape/najponavljanja.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int64_t n;
cin >> n;
set<int64_t> s;
int64_t x,maxnum=0;
while(n--){
cin >> x;
if(s.find(x)!=s.end()){
maxnum = max(maxnum,x);
}
s.insert(x);
}
if(maxnum==0)
cout << "nema\n";
... | ALGO | 0.999932 | 4.236106 |
69e799df-4b0f-4e82-840e-a81cdb404389 | DarshanGowda0/LC-Grind-FTE | 79-word-search/79-word-search.cpp | class Solution {
public:
bool recur(vector<vector<char>>& board, string& word, int i, int j, int n){
if (word.size() == n){
return true;
}
if (i < 0 || j < 0 || i >= board.size() || j >= board[0].size() || board[i][j] != word[n])
return false;
... | ALGO | 0.999716 | 6.205701 |
6f3f69bb-48a4-4df3-b0b4-7c97c2d86a6e | APGRoboCop/halflifeadmin | S-line/dlls/adminmod/users.cpp | #include <cstdint>
#include <cstring>
#ifndef _WIN32
# include <regex.h>
# include <crypt.h>
#else
# include "gnuregex.h"
# include "ufc_crypt.h"
#define stricmp _stricmp
#define strnicmp _strnicmp
#endif
#if (defined(USE_MYSQL) || defined(USE_PGSQL))
# ifdef USE_MYSQL
# include <mysql.h>
# include <errmsg... | TOOL | 0.939268 | 4.306568 |
b116c483-a862-4b40-9bfc-f4798a9e8b4c | a6cenna/osninfor | codeforces/999/2061c.cpp | // author: sofwant || a6cenna
// created at (date)
// suffering leaves suffering leaves.
#include <bits/stdc++.h>
using namespace std;
#define suffering_leaves_suffering_leaves ios::sync_with_stdio(false); cin.tie(nullptr);
#define ll long long
#define pll pair<ll, ll>
#define pii pair<int, int>
#define fs first
#def... | ALGO | 0.999957 | 4.87602 |
e04eded1-8fc2-47a5-b3f0-a61b36550969 | Kurorororo/HDAStar | source/single/state.cpp | #include <iostream>
#include <vector>
#include "state.h"
using namespace std;
vector< vector<uint8_t> >State::h_table = ManhattanDist::calculate(16, 4);
State::State() {
tiles = 0;
blank = 0;
h = 0;
g = 0;
}
State::State(const State &s) {
tiles = s.tiles;
blank = s.blank;
h = s.h;
g = s.g;
}
State* ... | ALGO | 0.999443 | 4.65089 |
859d4036-b180-4651-a95a-d9218c3e0b0f | gcoronelc/UC-2021-20-15795 | Semana03/Semana3Programa1.cpp | /*
* Desarrollar un programa que sume 2 numeros si son positivos.
*/
#include<iostream>
using namespace std;
int main( )
{
// Configuracin
setlocale(LC_CTYPE,"Spanish");
// Variables
int a, b; // Variables para los 2 nmeros
int c; // Variable es para la suma
// Lectura de datos
cout<<"Ingrese valor de p... | ALGO | 0.997687 | 3.883267 |
c59decb9-d3ce-4a1a-8b36-039f8e830b25 | andro2601/small-eq | Source/PluginProcessor.cpp | /*
==============================================================================
This file contains the basic framework code for a JUCE plugin processor.
==============================================================================
*/
#include "PluginProcessor.h"
#include "PluginEditor.h"
//==============... | ALGO | 0.956783 | 5.415978 |
b778624a-5f91-4ba7-a7b0-e1211e732a48 | sqs/openssl | crypto/ripemd/asm/rips.cpp | //
// gettsc.inl
//
// gives access to the Pentium's (secret) cycle counter
//
// This software was written by Leonard Janke (<EMAIL>)
// in 1996-7 and is entered, by him, into the public domain.
#if defined(__WATCOMC__)
void GetTSC(unsigned long&);
#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [ed... | TOOL | 0.887969 | 4.080586 |
ff4776f0-e9ac-4c57-9645-53a2c2b8fc40 | anthhhoG/Programacion-1 | ejerciciosCap5/ej5,20.cpp | #include <iostream>
using namespace std;
int main() {
cout << "Triples de Pitagoras (lado1, lado2, hipotenusa) no mayores a 500:" << endl;
for (int lado1 = 1; lado1 <= 500; ++lado1) {
for (int lado2 = 1; lado2 <= 500; ++lado2) {
for (int hipotenusa = 1; hipotenusa <= 500; ++hipotenusa) {
... | ALGO | 0.999301 | 4.094285 |
aba27193-7ae2-4d35-9924-c8a9aa024d26 | huchuanlu/16_8 | interp2.cpp | #include "mex.h"
#include <math.h>
//#include "cvbase/cvimage.h"
#define ARR(A,r,c,nr,nc) (((r)<0 || (r)>=(nr) || (c)<0 || (c)>=(nc))? 0 : (A)[(c)*(nr)+(r)])
inline double interp(double *img, int w, int h, double x, double y)
{
register int x0 = (int) x, y0 = (int) y, x1 = x0+1, y1 = y0+1;
register double rx0 =... | ALGO | 0.993291 | 4.715799 |
0c5c0b01-7a41-46b4-9bee-5fea804d31e5 | viganesh123/Devil1 | 5 dictBST.cpp | #include <iostream>
#include <map>
using namespace std;
map<string, string> dictionary;
void AddKeyword() {
string word, meaning;
cout << "Enter keyword: ";
cin >> word;
cout << "Enter meaning: ";
cin >> meaning;
dictionary[word] = meaning;
cout << "Keyword added successfully.\n";
}
void ... | ALGO | 0.999858 | 5.842369 |
33c1be35-ef1a-4f91-9dbe-95c8acfd9162 | 1laurelverma/DSA-Solutions | data_encyption_standard.cpp | // Including dependancies
#include <iostream>
#include <string>
using namespace std;
// Array to hold the 16 keys
string round_keys[16];
// Function to do a circular left shift by 1
string shift_left_once(string key_chunk){
string shifted="";
for(int i = 1; i < 28; i++){
shifted += key_chunk... | ALGO | 0.999848 | 4.100714 |
787f6e8d-1711-4d64-ae33-016c291e0590 | chelseamanzano/CMPM-265-Particle-System | SinusoidalBehavior.cpp | #include "SinusoidalBehavior.h"
float SinusoidalBehavior::behavior_at_time(float minValue, float changeValue, float currLifetime, float maxLifetime) {
return -changeValue * cosf(currLifetime/maxLifetime * (M_PI/2)) + changeValue + minValue;
} | ALGO | 0.988138 | 5.326866 |
1442eeed-7f2b-4650-9db0-b375a9562137 | hwk0911/Algorithm | Chapter 10. Find prime number [FIN]/BOJ 1978 소수 찾기.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main() {
cin.tie(NULL);
ios::sync_with_stdio(false);
int T, num, count = 0;
bool prime[1001];
prime[0] = false;
prime[1] = false;
for (int i = 2; i < 1001; i++) {
prime[i] = true;
}
for (int i = 2; i < sqrt(1001) + 1; i++) {
if (prime[i] =... | ALGO | 0.999789 | 4.674405 |
039e84ab-af8a-4758-a9f4-b2fa34132814 | PRADUMN-2020/Data-Structures-and-Algorithms | Graphs/Dijkstra_Algorithm.cpp | #include<bits/stdc++.h>
using namespace std;
#define inf 100000
void dijkstra(vector<int>&visited,vector<int>&dist,vector<pair<int,int>>cal[],int s,int n) // Time:O(n^2) here n is the no of vertices.
{
visited[s]=1;
dist[s]=0;
for(int i=0;i<cal[s].size();i++)
{
dist[cal[s][i].first]=cal[s][i].second;
}... | ALGO | 0.999965 | 4.898284 |
960f038b-1711-44be-bf14-58a731a1f195 | equetzal/competitiveProgramming | Contest/ESCOM_BASICOSA2019/a.cpp | //CF ProblemSet 347A - Difference Row
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
vector<int> v(n);
for(auto &x:v)cin >> x;
sort(v.begin(), v.end());
cout << v[n-1] << " ";
for(int i=1; i<(n-1); i++)
cout << v[i] << " ";
cout << v[0] << endl;
return 0;
}
| ALGO | 0.999955 | 3.090242 |
3d553990-17fe-436d-8687-0617d67c0959 | khanhtranngoccva/USTH-Cryptography | main.cpp | #include <iostream>
class CipherStateMachine {
bool bufX[19] = {};
bool bufY[22] = {};
bool bufZ[23] = {};
static void _shiftRight(bool* buf, int len) {
for (int i = len - 2; i >= 0; i--) {
buf[i + 1] = buf[i];
}
}
static bool _majority(bool x, bool y, bool z) {
... | ALGO | 0.999902 | 4.550754 |
3da49074-13e5-4e44-b137-ef2198bc4c00 | llf755109778/leetcode | 2022-03-25/leetcode_0406B1.cpp | ////
//// Created by 75510 on 2022/3/25.
////
//
//#include "bits/stdc++.h"
//using namespace std;
///*********
// * 假设有打乱顺序的一群人站成一个队列,数组 people 表示队列中一些人的属性(不一定按顺序)。
// * 每个 people[i] = [hi, ki] 表示第 i 个人的身高为 hi ,前面 正好 有 ki 个身高大于或等于 hi 的人。
// * 请你重新构造并返回输入数组people 所表示的队列。
// * 返回的队列应该格式化为数组 queue ,其中 queue[j] = [hj, kj]... | ALGO | 0.999943 | 5.307015 |
1c3ac1bd-4b41-4c2f-ae06-36b752b1efc6 | SkyLoaderr/xray-last-days | xray/utils/xrLC_Light/xrDeflectoL_Direct.cpp | #include "stdafx.h"
//#include "build.h"
//#include "std_classes.h"
#include "xrThread.h"
#include "xrdeflector.h"
#include "xrlc_globaldata.h"
#include "light_point.h"
#include "xrface.h"
#include "net_task.h"
extern void Jitter_Select (Fvector2* &Jitter, u32& Jcount);
void CDeflector::L_Direct_Edge (CDB::COLLIDER* D... | ALGO | 0.897274 | 3.375323 |
540e5d16-4714-4b70-bd5d-b81804fad19e | plqt/atCPC | C++/過去問/167C.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long
int main(){
int n,m,x,ans=10000000;
cin >> n >> m >> x;
vector<int> cost(n);
vector<vector<int>> a(n,vector<int>(m));
rep(i,n){
cin >> cost[i];
rep(j,m)
cin >> a[i][j... | ALGO | 0.999938 | 3.862602 |
039dd128-0267-41b4-8f6a-5b0e8557eb4b | Subhash1998/Data-Structures | subarray with given sum(array containing negative values also).cpp | #include <bits/stdc++.h>
using namespace std;
int subarray(int a[],int n,int k)
{
int i,sum=0,ans=0;
unordered_map<int,int > m;
for(i=0;i<n;i++)
{
sum+=a[i];
if(sum==k)
ans++;
if(m.find(sum-k)!=m.end())
ans+=m[sum-k];
m[... | ALGO | 0.999901 | 5.053945 |
fedf5ac3-8c2c-4e37-91b9-93d604cdc9d1 | amishaSahu1/dsa-LC-gfg- | 0463-island-perimeter/0463-island-perimeter.cpp | class Solution {
public:
int islandPerimeter(vector<vector<int>>& grid) {
int ans=0;
int n=grid.size();
int m=grid[0].size();
for(int row=0;row<n;row++){
for(int col=0;col<m;col++){
if(grid[row][col]){
int left=(col==0 ? 1: grid[row][col-1] ... | ALGO | 0.999926 | 6.142042 |
7967bc35-da00-40e1-84ee-e9deb83a492d | Jeevan-04/15_Jeevan_23_27_sem-1_CPP_100_Hackathon | 10_largest_of_three.cpp | #include <iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"Enter the First number: ";
cin>> a;
cout<<"Enter the Second number: ";
cin>> b;
cout<< "Enter the Third number: ";
cin>> c;
if (a>b && a>c)
{
cout<< a << " is greatest among all i.e.(" << b << " and ... | ALGO | 0.996877 | 3.664642 |
b574ec71-1824-4358-86fb-d5635251871b | thecsapprentice/SBSS_Public | src/lib/SIMD_Optimized_Kernels/Tests/Muscle_Tension/StreamTest.cpp |
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <sys/time.h>
#include "KernelCommon.h"
struct NEOHOOKEAN_TAG;
struct COROTATED_TAG;
#include "Muscle_Tension.h"
#define NUM_TRIALS 1000000
template < class T > T Get_Random (const T a = (T) - 1., const T b = (T) 1.)
{
return ((b - a) * (T) rand ()... | TOOL | 0.913716 | 4.652259 |
891acadc-f121-444b-9e9c-71c306efbe7e | necatiergin/TEMPLATES | ctad/ctad_12.cpp | #include <vector>
template<typename... Args>
auto make_vector(const Args&... elems) {
return std::vector{ elems... };
}
int main()
{
std::vector<int> v{ 1, 2, 3 };
auto x1 = make_vector(v, v); // vector<vector<int>>
auto x2 = make_vector(v); // vector<int> or vector<vector<int>> ?
}
//Currently, different compil... | TOOL | 0.985446 | 5.856308 |
41ed0127-b10c-427a-ad3b-91d2ca24d0b8 | SayandeepB9/Codeforces | 1919C.cpp | #pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")
// #pragma GCC target("avx2,sse4.2,bmi,bmi2,popcnt,lzcnt")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define pb push_back
#define int ll
#define mod ... | ALGO | 0.996088 | 5.026269 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.