uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
824ee074-08f2-4331-9f68-e7cb9a048480 | ishandutta2007/codeforces | kirill22/normal/1746/C.cpp | #include "bits/stdc++.h"
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const s... | ALGO | 0.999968 | 4.345164 |
7a66e4bb-7f72-42e0-a5f0-4777a47c43af | ku-leuven-msec/not-quite-write-experiments | softbound-attack/softboundcets-llvm-clang34/lib/Analysis/ScalarEvolutionNormalization.cpp | #include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Analysis/ScalarEvolutionNormalization.h"
using namespace llvm;
/// IVUseShouldUsePostIncValue - We have discovered a "User" of an IV expression
/// and now we need to decide wh... | ALGO | 0.95734 | 7.877316 |
a25c38c3-dd13-4e3f-82f8-f6020d9d9f32 | Sumanth-NR/CompetitiveProgramming | Algo/tests/test_sparse_table.cpp | #include <SparseTable.hpp>
#include <cassert>
#include <iostream>
#include <numeric>
int main() {
constexpr int n = 5;
std::vector<int> v(n);
std::iota(v.begin(), v.end(), 1);
SparseTable<int> st(v, SparseTable<int>::max);
for (int l = 0; l < n; l++) {
for (int r = l; r < n; r++) {
assert(st.query(l, r) == ... | TEST | 0.894834 | 6.178697 |
f201ac92-bb24-4a6e-af34-be2c805e8cb3 | Aoxi-git/Cementor | pkg/dem/LubricationWithPotential.cpp | // 2019 © William Chèvremont <<EMAIL>>
#include "LubricationWithPotential.hpp"
#include <boost/python/call_method.hpp>
namespace yade {
YADE_PLUGIN((Law2_ScGeom_PotentialLubricationPhys)(GenericPotential)(CundallStrackPotential)(CundallStrackAdhesivePotential)(LinExponentialPotential))
bool Law2_ScGeom_PotentialLub... | ALGO | 0.998117 | 5.664346 |
868f67e8-4710-4b54-bd97-5893ffb3600f | Bungmint/competitiveprogramming | contest/cses/exponentiation.cpp | //#pragma GCC optimize("O3")
//#pragma GCC target("sse4")
#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;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_... | ALGO | 0.999716 | 5.420756 |
c1f40dd2-35a9-4ed1-a1bf-adfec0d03ec3 | JhuoAnLi/Algorithm | MCSS/LCSS_dp&knapsack.cpp | #include <bits/stdc++.h>
#define min 0xc0c0c0c0
using namespace std;
int sto[10][10];
int MCSS(int[], int, int);
int MCSS_dp(int[], int);
int LCSS_dp(string, string);
void print_LCSS(string, string, int, int);
int knapsack(int[], int[], int, int);
int main()
{
int a[9] = {-2, 1, -3, 4, -1, 2, 1, -5, 4};
string... | ALGO | 0.999926 | 3.365293 |
62540bb8-ded5-4b57-8783-7cc6479ec68b | baixun2307/asd | solution/0000-0099/0040.Combination Sum II/Solution.cpp | class Solution {
public:
vector<vector<int>> combinationSum2(vector<int>& candidates, int target) {
sort(candidates.begin(), candidates.end());
vector<vector<int>> ans;
vector<int> t;
function<void(int, int)> dfs = [&](int i, int s) {
if (s == 0) {
ans.emp... | ALGO | 0.999993 | 6.627903 |
cc559dc6-904f-4d12-9eda-dc77683d22f3 | jarus9350/leetmycodes | 3372-longest-strictly-increasing-or-strictly-decreasing-subarray/longest-strictly-increasing-or-strictly-decreasing-subarray.cpp | class Solution {
public:
int longestMonotonicSubarray(vector<int>& nums) {
int n = nums.size();
int l = 0;
int h = 0;
int longestIncreasing = 0;
int longestDecreasing = 0;
vector<int> vec;
vector<int> dec;
while (h < n) {
if (... | ALGO | 0.999826 | 5.954886 |
11f9e315-2156-468d-8e81-f9658f013492 | muhammad-hasannn/cp_lab_sp25 | Lab 08 - 1 D Array/task02.cpp | /*Write a C++ program to search an element entered by user from array and display the searched element and its location.*/
#include<iostream>
using namespace std;
int main(){
int size = 0;
int target = 0;
bool found = false;
cout << "Enter the no. of elements in array: ";
cin >> size;
... | ALGO | 0.999092 | 4.939909 |
7003e31a-2744-41ce-8bae-7df7cb39aa0d | pepe2pow/Pepe2.0 | src/rpc/blockchain.cpp | #include <rpc/blockchain.h>
#include <amount.h>
#include <blockfilter.h>
#include <chain.h>
#include <chainparams.h>
#include <coins.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <hash.h>
#include <index/blockfilterindex.h>
#include <node/coinstats.h>
#include <node/context.h>
#include <node/utxo_... | WEB | 0.932271 | 7.243001 |
2e884de0-64fc-46e9-b9c9-5a51fe606f64 | genkinanodesu/competitive | AtCoder/exawizards2019/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> Pii;
typedef vector<ll> Vi;
typedef vector<Vi> VVi;
const double EPS = (1e-7);
const ll INF =(1e13);
const double PI = (acos(-1));
const ll MOD = ll(1e9) + 7;
#define REP(i, n) for(ll i = 0; i < (ll)(n... | ALGO | 0.999979 | 4.270473 |
e00a94d8-f832-494f-82ff-17ded8a22be0 | mhmdzrkt34/CryptoCurrenciesUsd | 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.998799 | 6.776823 |
6b78ee82-860d-45aa-acff-ec0d019ec9d9 | Gineth88/InstinctQ | 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.998799 | 6.776823 |
cb1014e0-b6bd-4355-8289-9d3cd8a8933c | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/08/02/0.cpp | #include <map>
#include <set>
#include <cmath>
#include <queue>
#include <vector>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <ctime>
using namespace std;
typedef long long int64;
ty... | ALGO | 0.999844 | 3.676147 |
3bfd9df5-00e5-453d-9eb6-3012fe7cc5c1 | jarryzhang/TestCodeFromLab | string/add_binary.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
string a,b;
cin>>a>>b;
int plus = 0;
int fa,fb;
string c = "";
int i=a.size()-1;
int j=b.size()-1;
while(i>=0 || j>=0){
cout<<a[i]<<b[j]<<endl;
if(i>=0 && a[i]=='1') fa = 1;
else fa = 0;
if(j>=0 && b[j]=='1') fb = 1;
else fb = ... | ALGO | 0.999997 | 3.317114 |
9e6959d1-ebed-4dfd-9aea-77373f7de00b | ccssong/baekjoon | NM/15654.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int MAX = 10;
vector<int> arr;
bool visited[MAX];
int result[MAX] = {0,};
void find(int n, int m, int index){
if(index == m){
for(int i=0; i<m; i++){
printf("%d ", result[i]);
//cout << result[i]... | ALGO | 0.999983 | 3.360147 |
40fee8fc-9abb-409c-9407-d93fc845f188 | Prontent11/CP | A_Three_swimmers.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;cin>>t;
while(t--){
long long int p,a,b,c;
cin>>p>>a>>b>>c;
long long int A=a-p%a;
if(A==a)A=0;
long long int B=b-p%b;
if(B==b)B=0;
long long int C=c-p%c;
if(C==c)C=0;
long long int ans=min(A,min(B,C));
cout<<a... | ALGO | 0.999815 | 3.288755 |
2144b382-3af0-4a96-9455-ebe41489d579 | shahjalal-mahmud/Data-Structure | Linked List/LinkedList.cpp | #include <iostream>
using namespace std;
class linkedList
{
public:
int data;
linkedList *next;
linkedList(int data)
{
this->data = data;
this->next = nullptr;
}
};
void linkedListTraversal(linkedList *ptr)
{
while (ptr != nullptr)
{
cout << ptr->data << " ";
... | ALGO | 0.995578 | 4.654047 |
3db4606a-ce7e-40d0-97ea-69998cbe9dac | kushkumarkashyap7280/DSA | day_032/leetcode_2022.cpp | //2022. Convert 1D Array Into 2D Array
// You are given a 0-indexed 1-dimensional (1D) integer array original, and two integers, m and n. You are tasked with creating a 2-dimensional (2D) array with m rows and n columns using all the elements from original.
// The elements from indices 0 to n - 1 (inclusive) of orig... | ALGO | 0.999792 | 6.676241 |
469560a2-86db-4959-b02a-d890085c06c0 | jaebaek/SGX-Shield | llvm/lib/Support/DeltaAlgorithm.cpp | #include "llvm/ADT/DeltaAlgorithm.h"
#include <algorithm>
#include <iterator>
using namespace llvm;
DeltaAlgorithm::~DeltaAlgorithm() {
}
bool DeltaAlgorithm::GetTestResult(const changeset_ty &Changes) {
if (FailedTestsCache.count(Changes))
return false;
bool Result = ExecuteOneTest(Changes);
if (!Result)
... | TEST | 0.92651 | 7.018753 |
d95a7a57-4c7b-4bfc-94a3-7ddd01e0c7e4 | FreCap/telnet-boost | ext/boost_1_59_0/libs/numeric/ublas/doc/samples/matrix_slice.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
matrix_slice<matrix<double> > ms (m, slice (0, 1, 3), slice (0, 1, 3));
for (unsigned i = 0; i < ... | ALGO | 0.913614 | 3.251255 |
f8885b9a-7be7-41ff-921e-3cced2e03dd6 | Hasan-Saju/Competitive-Programming | Algorithm/Graph/BellmanFord.cpp | #include<bits/stdc++.h>
using namespace std;
struct edge
{
int u,v,w;
};
vector<edge>V;
int dis[105];
int n,m;
bool bellmanford(int s)
{
for(int i=1;i<=n;i++)
dis[i]=INT_MAX;
dis[s]=0;
for(int i=1;i<=n-1;i++)
{
for(int j=0;j<V.size();j++)
{
edge e=V[j];
... | ALGO | 0.99999 | 4.884662 |
ecc2e9c1-889c-41da-a3b6-6a81d4f65631 | NoobAgainC/sem3 | 12-queue.cpp | #include <iostream>
#define MAX 5
using namespace std;
class Queue
{
private:
int arr[MAX];
public:
int size = 0;
bool push(int);
bool pop();
void peek() {
cout << "First element of Queue is: " << arr[0] << endl;
}
bool isEmpty() {
if (size == 0) {
cout << "Que... | ALGO | 0.987296 | 4.361578 |
c80fe2f4-bb7b-4ef4-b43c-868df7c6b623 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_367_10.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1009;
int f[N][12][N / 2], n, d, mod;
int inv[N], fac[N];
inline void Plus(int &x, int y) { x = (x + y >= mod ? x + y - mod : x + y); }
inline int mins(int &x, int y) { return (x - y < 0 ? x - y + mod : x - y); }
void Init() {
inv[0] = inv[1] = fac[1] = 1;
... | ALGO | 0.999969 | 4.672312 |
3c4803f9-b95b-4a1c-ae00-6ab89dba3da1 | SeoHyungjun/Coding_Test | baekjun/solved.ac/level/bronze/bronze2/거리의 합/거리의합.cpp | #include <iostream>
#include <math.h>
using ll = long long;
int N;
ll map[10100];
int main() {
std::ios_base::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0);
std::cin >> N;
for (int i = 0; i < N; ++i) std::cin >> map[i];
ll answer = 0;
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; j++... | ALGO | 0.999834 | 3.972598 |
476f803b-3d4d-47c9-8195-8290ebf6e33d | TimTam725/Atcoder | ABC/c40/test.cpp | #include<bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef long l;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
const double PI=3.141... | ALGO | 0.999884 | 3.380597 |
e8b98d85-b024-4523-8616-318fe96eb371 | chaudharygitesh/geeksforgeeks | Basic/Searching an element in a sorted array/searching-an-element-in-a-sorted-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// Function to find element in sorted array
// arr: input array
// N: size of array
// K: element to be searche
int searchInSorted(int arr[], int N, int K)
{
// ... | ALGO | 0.999806 | 5.475062 |
80003565-ecb6-4c4f-9089-fad3f87a8ce3 | hey2022/oj.tsinglanit.cn | 10077.cpp | #include <iostream>
int main() {
int days, wage = 0, daily = 1, count = 0;
std::cin >> days;
for (int i = 0; i < days; ++i) {
++count;
wage += daily;
if (count == daily) {
++daily;
count = 0;
}
}
std::cout << wage << std::endl;
return 0;
}... | ALGO | 0.999887 | 3.544605 |
94cb9e96-ae0a-4d12-a503-1f018ccc414c | zhouweiti/Data-Structre-And-Algorithm | EDU/SuffixArray/P5/D.cpp | #include <iostream>
#include <cstring>
#include <vector>
using namespace std;
typedef long long LL;
const int N = 4e5 + 5;
int sa[N], rk[N], x[N], y[N], cnt[N];
int height[N];
int st[N][20];
vector<int> hs[N];
int fa[N], sz[N];
int n, m;
string s;
LL ans;
void get_sa() {
m = 'z';
for (int i = 1; i <= n; i... | ALGO | 0.999893 | 4.255435 |
8af14312-3c3c-429b-b2ac-9c64ca2fe98b | MaryKargar/Cpp | Multiplication Table Print in the Array.cpp |
# include <iostream.h>
# include <conio.h>
# include <math.h>
# include <stdlib.h>
# include <iomanip.h>
# include <dos.h>
void main(){
clrscr();
int a[10][10];
int i,j;
for (i=1;i<=10;i++) {
for (j=1;j<=10;j++){
a[i-1][j-1]=i*j;
cout<<setw(4)<<a[i-1][j-1];
}
cout<<endl<<endl;
}
getch(); | ALGO | 0.947771 | 3.026253 |
83aa8c24-b70a-48fc-a881-dcedf5e4c984 | buaaymh/eigen_demo | decompositions.cpp | #include <ctime>
#include <iostream>
#include <Eigen/Dense>
#include <Eigen/Eigenvalues>
using namespace std;
using namespace Eigen;
int main()
{
cout << "Dynamic matrix decompositions" << endl;
MatrixXf A(3,3);
A << 1, -3, 3, 3, -5, 3, 6, -6, 4;
cout << "Here is the matrix A:\n" << A << endl;
cout << "S... | ALGO | 0.999112 | 4.005816 |
6d0baeec-0fbf-49ce-93bd-197bda9a5596 | codeaholic-shub/ALGO-ADDICT | LEETCODE/C++/string-without-aaa-or-bbb.cpp | // Time: O(a + b)
// Space: O(1)
class Solution {
public:
string strWithout3a3b(int A, int B) {
string result;
bool put_A = false;
while (A || B) {
if (result.length() >= 2 &&
result.back() == result[result.length() - 2]) {
put_A = (result.back()... | ALGO | 0.99996 | 5.818985 |
5e25b161-30e1-4b3b-ba44-88398995aa83 | SnowyJune973/acm | Contest/Autumn16/RuoXiao1003/E.cpp | /*=============================================================================
Author: SnowyJune - <EMAIL>
QQ: 896512060
Last modified: 2016-10-07 19:10
Filename: E.cpp
=============================================================================*/
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <... | ALGO | 0.998869 | 4.137835 |
d3455f97-62cb-4c1b-8da7-07a201bed2bd | weehowe-z/Backup | ds/cpp/Ch8 Coin Game.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int getInput();
void printInfo();
void play();
int main()
{
printInfo();
play();
return 0;
}
int getInput()
{
int answer;
while (true){
cout<<"Head Side(0) or Tail Side(1)? ";
cin>>answer;
if ((answe... | ALGO | 0.996463 | 4.471134 |
05d22397-eb95-4ed8-82a0-137a1fa11113 | PMArkive/customentities | src/sdk_hack/basecombatcharacter.cpp | #include <basecombatcharacter.h>
class CTraceFilterNoCombatCharacters : public CTraceFilterSimple
{
public:
CTraceFilterNoCombatCharacters( const IHandleEntity *passentity = NULL, int collisionGroup = COLLISION_GROUP_NONE )
: CTraceFilterSimple( passentity, collisionGroup )
{
}
virtual bool ShouldHitEntity( IHa... | TOOL | 0.87573 | 6.949827 |
30e9f1f8-2651-48ad-814d-519e3fe50054 | ShreeniwasKolagal/DSAFromScratch | Arrays/Easy/moveZerosToEnd.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
? Time Complexity: O(2*N)
*/
void moveZeros(vector<int> arr, int n)
{
// To keep track of number of zeros
int nZero = 0;
// Temporary array to store non zeroes
vector<int> temp;
for (auto it : arr)
{
if (it != 0)
... | ALGO | 0.999875 | 5.492091 |
24862bac-2014-4f1c-bcef-47ef6c1db52b | Brandonmcgirl2/Freedomcoin | src/libmw/src/crypto/Bulletproofs.cpp | #include <mw/crypto/Bulletproofs.h>
#include "Context.h"
#include "ConversionUtil.h"
#include <caches/Cache.h>
#include <mw/exceptions/CryptoException.h>
#include <mw/util/VectorUtil.h>
static constexpr uint64_t MAX_WIDTH = 1 << 20;
static constexpr size_t SCRATCH_SPACE_SIZE = 256 * MAX_WIDTH;
static constexpr size_t... | TOOL | 0.957071 | 7.328607 |
af2b2852-578a-40d9-a317-fdefe4ed54e8 | aashima2693/c-DSA | REVISION 2/summ.cpp | //WAP to print sum of digits of a given number.
#include<iostream>
using namespace std;
int main(){
int num,sum=0;
cout<<"Enter the number:"<<endl;
cin>>num;
int digit;
while(num>0){
digit=num%10;
sum+=digit;
num/=10;
}
cout<<sum<<endl;
return 0;
}
| ALGO | 0.999229 | 4.143774 |
b91dc31f-42a7-4500-9aa5-b238e0c41518 | fengpingsh/Kinect2Grabber | pcd2vfh.cpp | #include <pcl/point_types.h>
#include <pcl/features/vfh.h>
#include <pcl/features/normal_3d.h>
#include <boost/thread/thread.hpp>
#include <pcl/common/common_headers.h>
#include <pcl/io/pcd_io.h>
#include <pcl/console/parse.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/features/vfh.h>
int main(int arg... | ALGO | 0.872047 | 5.02347 |
29d8e5f7-ba69-4c20-82e5-9667994736c5 | cartulary/stuffpack | ds/btree/btree.cpp | #include "btree.h"
#include <iostream>
BTREE_TEMPLATE BinaryTree<T>::BinaryTree(): numnodes(0), head(NULL)
{
}
BTREE_TEMPLATE void BinaryTree<T>::add(T data)
{
MultiNode<T>* newNode = new MultiNode<T>(2,data);
this->add(newNode);
++(this->numnodes);
return;
}
/*
This method preserves and children that the node ... | ALGO | 0.99811 | 5.400672 |
8f76e69e-211f-458b-b58f-e0e9635e15d2 | ishandutta2007/codeforces | conan1412yang99/normal/1264/A.cpp | #include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl
#define int ll
using namespa... | ALGO | 0.999928 | 3.756261 |
20285bc3-0424-4d28-8d0d-aa546435a63f | Mwako/deps | boost/libs/interprocess/example/doc_where_allocate.cpp | int main ()
{
using namespace boost::interprocess;
//Typedefs
typedef allocator<char, managed_shared_memory::segment_manager>
CharAllocator;
typedef basic_string<char, std::char_traits<char>, CharAllocator>
MyShmString;
typedef allocator<MyShmString, managed_shared_memory::segment_manager>
... | TOOL | 0.904914 | 3.572237 |
ab569dec-bc1d-447d-a15f-4e3536d0d017 | hanumanb/Trillions | packages/kokkos-kernels/src/impl/Kokkos_Blas1_MV_impl_sum.cpp | #include <Kokkos_Blas1_MV_impl_sum.hpp>
namespace KokkosBlas {
namespace Impl {
#ifdef KOKKOSKERNELS_BUILD_EXECUTION_SPACE_SERIAL
KOKKOSBLAS_IMPL_MV_SUM_RANK2_DEF( double, Kokkos::LayoutLeft, Kokkos::Serial, Kokkos::HostSpace )
#endif // KOKKOSKERNELS_BUILD_EXECUTION_SPACE_SERIAL
#ifdef KOKKOSKERNELS_BUILD_EXECU... | ALGO | 0.973755 | 6.445278 |
b220b379-b629-4aaa-9dd4-1ff55ff62f96 | jk-jung/problem-solving | codeforces/Educational Round 04x/R045_div2_A.cpp | #include <cstring>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <set>
#include <map>
#include <array>
#include <stack>
#include <queue>
#include <vector>
#include <numeric>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<i... | ALGO | 0.999792 | 3.639689 |
1d7a4b55-b84c-4682-9d12-26b436be4ec5 | theneuronarc/LeetCodeAlgorithms | src/dungeon_game.cpp | /*
https://leetcode.com/problems/dungeon-game/
*/
#define rev(x) -(x)
#define min(a,b) (a<b?a:b)
int calculateMinimumHP(int** dungeon, int dungeonRowSize, int dungeonColSize) {
int pathCost;
int increment = 0;;
for (int col = dungeonColSize - 1; col >= 0; col--) {
for (int row = dungeonRowSize - 1; row >= 0; row... | ALGO | 0.999579 | 6.026797 |
309de325-e9bb-48f5-9ea5-b9bc4479af09 | saikumar24info/collapsed_sidebar | 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 |
23024ca2-53d2-4cc6-89a2-4546cf7e8593 | flokxxy/FTN_SIIT | sim_4/parall/vz2_prim2_1.cpp | #include <stdio.h>
#include <float.h>
#include "tbb\tbb.h"
#include "tbb\parallel_reduce.h"
using namespace tbb;
//поиск индекса минимального значения
float Foo(float a) {
return a;
}
//TODO: Create a class called MinIndexFoo with constructors, operator() and the join method
//структура для парал нахождения миниму... | ALGO | 0.999938 | 4.33028 |
0a41aaaf-62db-476f-bfcc-bbc98a6a767a | srx-wr/algorithm | DP/背包问题/分组背包问题.cpp | #include<iostream>
#include<algorithm>
using namespace std;
const int N = 110;
int dp[N],v[N][N],w[N][N];
int s[N]; // s洢ǰжٸԪ
int n,m;
int main()
{
cin >> n >> m;
for(int i = 1; i <= n; i++)
{
cin >> s[i];
for(int j = 1; j <= s[i]; j++)
{
scanf("%d%d",&v[i][j],&w[i][j]); // i j ʾi j
}
}
for(int i =... | ALGO | 0.999984 | 3.523817 |
23dfc722-64e2-4fc2-821a-6f510efae220 | tpys/face-everthing | cpp_modules/detection/src/seeta/seeta_detector.cpp | #include "seeta_detector.h"
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "classifier/lab_boosted_classifier.h"
#include "classifier/surf_mlp.h"
#include "feat/lab_feature_map.h"
#include "feat/surf_feature_map.h"
#include "io/lab_boost_model_reader.h"
#include "io/surf_mlp_model_reade... | TOOL | 0.923737 | 6.077368 |
4eadd64d-f792-41ec-9575-2bb0560b07a2 | travisbrown/tesseract | ccstruct/otsuthr.cpp | #include <string.h>
#include "otsuthr.h"
namespace tesseract {
// Compute the Otsu threshold(s) for the given image rectangle, making one
// for each channel. Each channel is always one byte per pixel.
// Returns an array of threshold values and an array of hi_values, such
// that a pixel value >threshold[channel] is... | ALGO | 0.999321 | 7.447434 |
966e8514-6f5f-4613-9b72-43c86f192cb1 | Afinis/algorithm | CCF33 5文件夹合并.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 5e5+10;
ll n, m, fa[N], w[N];
unordered_map<ll, ll> mp[N];
ll dp = 0;
void dfs(ll x){
dp++;
if(x==1){
return;
}
dfs(fa[x]);
}
int main(){
scanf("%lld%lld", &n, &m);
for(int i = 2; i <= n; i++){
ll t;
scanf("%lld", &t);
fa[i... | ALGO | 0.999867 | 3.808946 |
97a965f4-cf4d-4f21-8a01-bff73e4eb44f | sherryshare/blaze-2.0 | blazemark/src/gmm/Complex3.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.999003 | 5.471574 |
eaf348ca-5dd9-4dcd-afce-5f77839d7efd | Shahbaz898414/CP-concept | level-3/Range Queries 1/Question/main.cpp | // #include <iostream>
// #include <bits/stdc++.h>
// bool isPrime(int n) {
// if (n <= 1) {
// return false;
// }
// if (n == 2) {
// return true;
// }
// if (n % 2 == 0) {
// return false;
// }
// for (int i = 3; i <= sqrt(n); i += 2) {
// if (n % i == 0) ... | ALGO | 0.999802 | 5.824668 |
41d7880e-9f6f-442d-8b14-99e9ab4c5a37 | cesar-avalos3/GEM5_ECE56500_FALL23 | src/systemc/tests/systemc/misc/synth/blast/blast3/blast3.cpp | /*****************************************************************************
blast3.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************... | TOOL | 0.974829 | 4.276901 |
2a367432-5c00-44e0-9dba-b1942d1d6064 | muhibarshad/Cpp-Data-Structures-and-Algorithms-An-In-Depth-Look | 01_Data Structures/Linear-Data-Structures/03_Linked List/Single-Linked-List/Codes/TodList_Project.cpp | /*Author :@muhib7353
Question:Write a c++ Program taht perform the following functionalities:
1.push()
2.pop()
3.shift()
4.unshift()
5.deleteMiddle()
6.insertMiddle()
7.displayReverse()
8.displayForward()
Note: Use the Concept of Single Linkdlist and make the menu driven to give user functionalities to enter todoList l... | ALGO | 0.98384 | 5.516062 |
911a22ba-7601-4211-90b6-440f2655a74b | Chimnii/Algospot | Problems/CaveMan.cpp | #include <stdio.h>
#include <algorithm>
namespace my
{
struct istream{};
istream cin;
inline bool is_num( char c ){ return ( c >= '0' && c <= '9' ); }
inline bool is_negative( char c ){ return c == '-'; }
inline istream& operator>>( istream& in, int& out )
{
char c; out = 0; bool neg = false;
while( c = get... | ALGO | 0.998713 | 4.206232 |
2a4fcacc-fff1-4155-beb9-a7d73fbec9ca | sayeed-rana/DevSkill-Problem-Solution- | Mobile Key.cpp | #include<iostream>
using namespace std;
int main()
{
int tc,m=1;
long long int i,num,j;
cin>>tc;
for(int f=0;f<tc;f++)
{
cin>>num;
cout<<"Case #"<<m<<":";
if(num%2==0)
{
i=num*3;
for(j=i;j>=i-2;j--)
{
cout<<" "<<j;
... | ALGO | 0.999848 | 3.87664 |
7f3c3bb1-4264-4daf-bfba-e535310fc2f1 | Flutter-labs-2024/RestaurantMenu | 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 |
aa0bc8d9-b9f6-4038-982d-9dd262b030c7 | TravisGurlik/aoc-solutions | 2021/Day 03/part2.cpp | /*
* This is one of those parts where you misread the instructions a couple times,
* then you have to make a few attempts as you make tiny changes that
* inexplicably give you different answers despite you thinking they should
* be identical.
* We actually save the values this time, then do separate loops fo... | ALGO | 0.999714 | 6.287538 |
ad86437c-c782-4641-83c2-85829bca6925 | toqeersheikh/Basic-Logic-Programs | sum_of_evenNumbers.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int i=2;
int sum=0;
while(i<=n)
{
sum=sum+i;
i=i+2;
}
cout<<"Sum is: "<<sum;
} | ALGO | 0.999752 | 3.961803 |
24494cbc-2f18-4361-8328-061679b08d75 | beef-erikson/CustomUnrealEngineRider | Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/openexr/OpenEXR/IlmImf/ImfRle.cpp | #include <string.h>
#include "ImfRle.h"
#include "ImfNamespace.h"
OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
namespace {
const int MIN_RUN_LENGTH = 3;
const int MAX_RUN_LENGTH = 127;
}
//
// Compress an array of bytes, using run-length encoding,
// and return the length of the compressed data.
//
int
rleCompress... | ALGO | 0.989749 | 5.188163 |
e04417af-ce72-4d3c-894b-2a42892e1e1a | MohitKau1010/myportfolio | 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 |
e8a0363c-e3ba-4ae7-9097-918c1607063e | klotte/boost | src/boost_1_44_0/libs/graph/example/edge-connectivity.cpp | namespace boost
{
template < typename Graph >
std::pair < typename graph_traits < Graph >::vertex_descriptor,
typename graph_traits < Graph >::degree_size_type >
min_degree_vertex(Graph & g)
{
typename graph_traits < Graph >::vertex_descriptor p;
typedef typename graph_traits < Graph >::degree_s... | ALGO | 0.999073 | 7.146661 |
852e25d6-a45b-4b66-bbc6-5d171a1239d4 | iadisharma/C-Programmes | halfpyramidusingno.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter N \n";
cin>>n;
for(int i=1; i<=n;i++){
for(int j=1; j<=i; j++){
cout<<i<<" ";
}
cout<<endl;
}
} | ALGO | 0.999753 | 3.795205 |
4540d18b-7012-40af-adda-8ad7ccfe046b | muhammadsirajdev/DSA-Repo | Queue/priority queue/usingstack.cpp | #include <iostream>
#include <stack>
class PriorityQueue {
private:
std::stack<int> stack1; // Main stack for incoming elements
std::stack<int> stack2; // Temporary stack to sort elements
public:
// Insert element into the priority queue
void push(int value) {
// Move elements from stack1 to s... | ALGO | 0.999886 | 6.741766 |
e829e005-9ae1-43c8-977f-2e60ff12ef23 | sylvainprigent/BioImageLib | BioImageLib/src/blMpp/blMppShapeRectangle.cpp | /// \file blMppShapeRectangle.cpp
/// \brief blMppShapeRectangle class
/// \author Sylvain Prigent (<EMAIL>)
/// \version 0.1
/// \date 2014
#include "blMppShapeRectangle.h"
#include "math.h"
#include <iostream>
#include <sstream>
#include <fstream>
blMppShapeRectangle::blMppShapeRectangle() : blMppShape2D(){
m_a... | TOOL | 0.920798 | 5.164049 |
eb4ea271-5371-47fa-9f3f-473dd55327d3 | srivastavaritik/DSA | 876-middle-of-the-linked-list/876-middle-of-the-linked-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:
ListNode* middleNode(... | ALGO | 0.999885 | 5.797458 |
da3279ac-1f96-4cc4-8a20-0368e7815576 | sevenalarm/Codeforces | cpp2/farz2/hendone.cpp | #include <iostream>
#include <string.h>
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int mx=0, ind = 0, x;
for (int i=0; i<n; i++) {
cin >> x;
if (x>mx) {
mx = x;
ind = i+1;
}
}
cout << ind;
} | ALGO | 0.999352 | 4.322354 |
ffbc7927-905f-4609-a350-7cb8abe6af0c | Kartavya-Shrivastav/LeetCode-Uploads | Day_206_3442_Maximum_Difference_Between_Even_and_Odd_Frequency_I.cpp | #include <bits/stdc++.h>
using namespace std;
// Class to find the maximum difference between the highest and lowest frequency of characters in a string
class Solution {
public:
// Function to find the maximum difference between the highest odd frequency
// and the lowest even frequency of characters in the s... | ALGO | 0.999864 | 5.43153 |
c839ca06-b934-472b-909d-8860fcf79712 | EvanJin4840/Algorithm-problem-solving | BOJ/A022_진형주_20250717.cpp | #include <iostream>
using namespace std;
int main(){
int N, temp, m = 0, y = 0;
cin >> N;
for (int i = 0; i < N; i++) {
cin >> temp;
y += (temp / 30 + 1) * 10;
m += (temp / 60 + 1) * 15;
}
if (m < y) cout << "M " << m;
else if (m > y) cout << "Y " << y;
else if (m == y) cout << "Y M " << m;
re... | ALGO | 0.998634 | 3.712245 |
989c5320-4227-44db-920d-73219800e264 | telgohry/Practice | Set the Odd Elements in a Dynamic Array to -1.cpp | #include <iostream>
void print_array(int *arr, int size){
for(int i = 0; i < size; i++){
std::cout << arr[i] << " ";
}
std::cout << "\n";
}
void read_array_elements(int *arr, int size){
for(int i = 0; i < size; i++){
std::cout << "Please enter element [" << i+1 << "]: ";
std::cin >> arr[i];
}
}
... | ALGO | 0.993571 | 5.244597 |
818b3c8e-cd0b-4810-850f-5bf38f8e0c18 | 2n25/infa-reports | infa__uravnenia/iteracia.cpp | #define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
using namespace std;
double f(double x);
double f_pr(double x);
int rec(double x0, double x1);
const int a = 0;
const int b = 1;
int counter = 0;
double x0, x1;
const double e = M_E;
const double E = 0.000001;
bool flag = 1;
int main()
{
setlocale(L... | ALGO | 0.99989 | 3.557676 |
97607752-5e34-4d39-86f1-f8aaf4bfd298 | gurmehakk20/OOPs-Assignment-Solutions | q12.cpp | #include<iostream>
using namespace std;
bool query(int n, int arr[]){
int a, k; cin >> a >> k;
int c = 0;
for (int i = 0; i < n; i++){
if (a % arr[i] == 0){
c++;
}
}
if (c >= k) return 1;
else return 0;
}
int main()
{
int n; cin >> n;
int arr[n];
f... | ALGO | 0.999884 | 3.978598 |
30e88f1b-efc3-49ee-bf36-c4b8e1409495 | WaykiChain/wicc-wasm-cdt | wasm_llvm/tools/clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp | #include "clang/Tooling/Refactoring/Rename/USRFindingAction.h"
#include "clang/AST/AST.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Basic/FileManager.h"
#include "clang/Frontend/CompilerInstance.h"
#include... | TOOL | 0.96976 | 7.718776 |
dfb54f9f-38b6-4220-9160-b90354e25dd9 | raghu-yemmanuru/code4fun | questions/careercup/string_permute.cpp | #include <iostream>
#include <vector>
#include <iterator>
using namespace std;
typedef vector<char> vc;
void permute(string s, string result) {
if (result.size()) {
cout << result << endl;
}
if (s.size() == 0) {
return;
}
for (int i = 0; i < s.size(); i++) {
if (i > 0 && ... | ALGO | 0.999971 | 5.302089 |
f5d4d724-8c26-4e54-a169-db131c84147a | Harshjdev/100DaysofDSA | Day17/range.cpp | vector<int> countFrequency(int n, int x, vector<int> &nums){
vector<int> ans(n, 0);
unordered_map<int, int> mp;
for(int i=0; i<n; i++){
mp[nums[i]-1]++;
}
for(int i=0; i<n; i++){
ans[i] = mp[i];
}
return ans;
} | ALGO | 0.999923 | 5.286908 |
82073b99-9aa1-4c6f-be0d-42037957507d | grendias/NANO-1 | nano/nano_node/daemon.cpp | #include <boost/property_tree/json_parser.hpp>
#include <fstream>
#include <iostream>
#include <nano/lib/utility.hpp>
#include <nano/nano_node/daemon.hpp>
#include <nano/node/daemonconfig.hpp>
#include <nano/node/ipc.hpp>
#include <nano/node/working.hpp>
void nano_daemon::daemon::run (boost::filesystem::path const & d... | TOOL | 0.862592 | 6.212917 |
70782960-46ae-4486-9370-7171ed1ab45c | CypherVault/ESE344-Archive | ESE344/hw4/HW4Q1.cpp | #include <vector>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <iostream>
using namespace std;
vector<vector<string>> displayTable(vector<vector<string>>& orders) {
set<string> foodItems;
map<int, map<string, int>> tableCounts;
// sort and index all contents, parsing sect... | ALGO | 0.9992 | 5.96001 |
31b1a5a2-9c1d-4074-8ce3-219f2fdc17f6 | overriden-sfdd/modern-cpp-sortsearch | g5/main.cpp | #include "sort_engine.hpp"
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <random>
#include <chrono>
#include <cassert>
template <class Sort>
void test_compare_sorts(std::string&& sort_name, std::vector<int> vec,
int l, int r, sort_comp_storage* cmp_struct, Sort sorting)... | ALGO | 0.946258 | 6.444316 |
6f964bfe-89df-4ee3-9116-a49b6e157716 | raad1masum/Competitive-Programming | Codeforces/1391B.cpp | #include <bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define FOR1(i,a,b) for (int i = a; i <= b; ++i)
#define SQ(a) a*a
typedef long long ll;
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.... | ALGO | 0.999869 | 4.167663 |
97d067c3-a2e9-4801-a7b4-1aa62b1bcf48 | finalyXG/web_usability | test/pmtk3-master/pmtksupportCopy/mplp-1.0/cmplp/muldim_arr.cpp | using namespace std;
#include "muldim_arr.h"
extern void print_int_vec(vector<int> v);
MulDimArr::MulDimArr(vector<int> & base_sizes)
{
m_base_sizes = base_sizes;
m_n_prodsize = 1;
for (int i=0; i<base_sizes.size(); i++)
m_n_prodsize*= base_sizes[i];
m_dat= new double[m_n_prodsize];
// Initialize array to ... | ALGO | 0.969945 | 4.33639 |
fb6d472e-cf51-4023-bd58-99fadfe29da9 | LihengGong/computer_graphics | ray_tracing/ext/eigen/bench/benchGeometry.cpp | #include <iostream>
#include <iomanip>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
#ifndef REPEAT
#define REPEAT 1000000
#endif
enum func_opt
{
TV,
TMATV,
TMATVMAT,
};
template <class res, class arg1, class arg2, int opt>
stru... | TEST | 0.895607 | 6.062908 |
338c9021-c8f7-4532-9028-efd5b2dea9c3 | Parthiv-MEV/SoC-CP | codeforces_2125D.cpp | #include<bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
long long power(long long a, long long b, long long mod){
long long res = 1;
while(b > 0){
if(b & 1) res = (res * a) % mod;
a = (a * a) % mod;
b >>= 1;
}
return res;
}
long long modInverse(long long ... | ALGO | 0.999857 | 4.546912 |
01d65cda-971a-49a5-bb32-bba157a97b09 | ByteBrewer1/CPP | CodeChef/STARTERS 86/Problem2.cpp | // AUTHOR :: RAHUL MISTRY
// DATE :: 20/04/2023
#include <bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i, n) for (i = 0; i < n; i++)
#define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define... | ALGO | 0.999878 | 3.97096 |
6d4a03c5-391a-49c5-bb67-383e61da2ad3 | Cuongyd196/judge-server | testsuite/bridged_interactor_custom_checker/tests/cpp_wa/seed2.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, const char *argv[]) {
cin.tie(0);
cin.sync_with_stdio(0);
for (int i = 1; i < 100; ++i)
cout << i << endl;
return 0;
}
| ALGO | 0.971005 | 3.389864 |
15623fc9-d40d-4baf-9c3b-8fb0b9d335ab | iodoyo16/algorithm_baekjoon | 1138.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int arr[15];
int ans[15];
int main() {
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%d", &arr[i]);
}
for (int i = 1; i <= n; i++) {
int cnt = 0;
int taller_num = arr[i];
for (int j = 0; j < n; j++) {
if (ans[j] == 0) {
cnt++;
if... | ALGO | 0.999994 | 3.431795 |
582a7fb8-4912-4cb0-891e-c36e82059e4d | ishandutta2007/codeforces | tabr/normal/1422/D.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
int sx, sy, fx, fy;
cin >> sx >> sy >> fx >> fy;
int ans = abs(sx - fx) + abs(sy - fy);
v... | ALGO | 0.99996 | 4.123499 |
03ec1783-40ef-44ec-915e-17db3299c44f | jisoochoi7561/imsi2 | .opencv/opencv/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp | /**
* @function moments_demo.cpp
* @brief Demo code to calculate moments
* @author OpenCV team
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <iomanip>
using namespace cv;
using namespace std;
Mat src_gray;
int thresh = 100;
RNG rng(... | ALGO | 0.984081 | 7.352239 |
c8ac84c3-3162-473a-ba77-3d16d83bc566 | CodeByAshuu/CipherSchools | Day53/Q2PerfromTask.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
int main() {
int n, searchNum;
cout << "Enter the number of elements: ";
cin >> n;
vector<int> numbers(n);
cout << "Enter the numbers: ";
for (int i = 0; i < n; ++i) {
cin >> numbers[i];
... | ALGO | 0.999788 | 5.469694 |
621ca773-1408-4bf9-b98d-f4e54abbd4f3 | wolfgruber/simulazione_numerica | LSN_04/main.cpp | /****************************************************************
*****************************************************************
_/ _/ _/_/_/ _/ Numerical Simulation Laboratory
_/_/ _/ _/ _/ Physics Department
_/ _/_/ _/ _/ Universita' degli Studi di Milano
_/ _/ ... | TOOL | 0.952378 | 3.201513 |
484546b1-6205-42fb-acd7-9466e092a0df | menaehab/Codeforces-Solutions | 0 - 1000 problems/Two Bags of Potatoes.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <iomanip>
#include <string>
#include <set>
#include <queue>
#define speedup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define el "\n"
#define all(arr) arr.begin(),... | ALGO | 0.999906 | 3.338145 |
d695c9f1-837e-4900-8ecb-aa3da047d71a | 13aba/Stock-Exchange-App | OrderBook.cpp | #include "OrderBook.h"
#include <map>
#include <algorithm>
OrderBook::OrderBook(std::string fileName){
orders = CSVReader::readCSV(fileName);
}
std::vector<std::string> OrderBook::getKnownProducts() {
std::vector<std::string> products;
std::map<std::string, bool> productMap;
for (OrderBookEntry& e : orders)
{
... | TOOL | 0.91168 | 5.142105 |
77022c71-173c-4ba6-a107-0087fb402d32 | ejiseok/problem-solving | Baekjoon/2675/2675.cpp | #include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t; cin >> t;
while (t--) {
int r;
string s;
cin >> r >> s;
for (int i = 0; i < s.length(); i++) {
for (int j = 0; j < r; j++) {
... | ALGO | 0.999712 | 4.416356 |
b3647aa2-8bcf-49a5-a5ab-07e0fdd01682 | KhushiGangopadhyay/DSA-leetcode-and-gfg | longest string chain.cpp | //problem link:https://leetcode.com/problems/longest-string-chain/
class Solution {
public:
int topDown(unordered_set<string>& s,string w,unordered_map<string,int>& visited){
if(w.size()==1){
if(s.find(w)!=s.end())return 1;
return 0;
}
int res=0;
for(int i=0;... | ALGO | 0.999989 | 5.970549 |
b6f63466-c05a-4b0f-9cf3-aac20b928374 | Jahjahhhh/codeforces | contests/167-2-EDU/B.cpp | #include <bits/stdc++.h>
// GOT FILTERED
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t; cin >> t;;
string a, b;
while(t--) {
cin >> a >> b;
unordered_set<char> s1, s2;
if(a.length() > b.length()) {
for(char c : a)
s1... | ALGO | 0.999983 | 5.049624 |
b3d3b99c-ba16-402c-94c8-1aad98b8b836 | SteamDB2/CSGO-Old2018- | hammer/dispmapimagefilter.cpp | //=============================================================================
//
// NOTE: the painting code in here needs to be cleaned up and a new algorithm
// is needed for handling valence greater than 4 cases (I am not too happy
// with the current one)
//
#include <stdafx.h>
#include "MapDisp.h"
#i... | TOOL | 0.885874 | 5.335695 |
d7ca1e80-d79c-4280-80e9-2ce0d3156c71 | nirvana369/UVA-problem-solved | 11917.cpp | /*
Hoang Linh
*/
#include <cstdlib>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <map>
#define fi "11917.inp"
#define fo "11917.out"
/**/
using namespace std;
/**/
void input()
{
int ntest,id,ns;
map<string, int > ... | ALGO | 0.99848 | 3.692353 |
fda36d6d-8295-4525-ba2d-3117db98ff31 | moshmode/AlgorithmC | dp/e1137.cpp | //
// Created by 22057 on 2021/11/2.
//
#include "e1137.h"
vector<vector<int>> multiply(vector<vector<int>> &a, vector<vector<int>> &b) {
vector<vector<int>> c(3, vector<int>(3));
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
c[i][j] = a[i][0] * b[0][j] + a[i][1] * b[1][j] + ... | ALGO | 0.999935 | 4.997644 |
f0bf8d6f-4c8e-488d-bb97-d7e502dfd464 | righthand0521/LeetCode | src/2194.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<string> cellsInRange(string s) {
vector<string> retVal;
// s.length == 5
// 'A' <= s[0] <= s[3] <= 'Z'
// '1' <= s[1] <= s[4] <= '9'
for (char row = s[0]; row... | ALGO | 0.946715 | 5.173875 |
883bfa18-d3b8-4a77-9155-7ed4222eb815 | kunzhou92/Monte-Carlo-Using-Rcpp | MCMC in Self-Avoiding Walk/CppCode.cpp | #include <Rcpp.h>
#include<cstdlib>
#include <time.h>
#include <math.h>
using namespace Rcpp;
NumericMatrix applet(NumericMatrix x, NumericMatrix y)
{
NumericMatrix result = NumericMatrix(x.nrow(), 1);
for(int i=0; i<x.nrow(); i++)
{
result(i, 0) = 0;
for(int j=0; j<x.ncol(); j++)
{
result(i, ... | ALGO | 0.999836 | 4.094555 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.