uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7a2a3c39-7ffd-4a74-b1f2-ed75678ec122 | himanshudubey7/Programming | B_The_Picky_Cat.cpp | //author: Ghostyy :D
# include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
ll mod = 1000000007;
//--------------------------------------------------------------------------------------------------
//binary exponentiation
int exp(int base,i... | ALGO | 0.999814 | 4.334468 |
4ab23d52-c613-4c32-a92a-68e192957f55 | reefcash/reefcash | src/masternode-sync.cpp | #include "activemasternode.h"
#include "checkpoints.h"
#include "governance.h"
#include "main.h"
#include "masternode.h"
#include "masternode-payments.h"
#include "masternode-sync.h"
#include "masternodeman.h"
#include "netfulfilledman.h"
#include "spork.h"
#include "util.h"
class CMasternodeSync;
CMasternodeSync mast... | TOOL | 0.863738 | 4.649731 |
b97b6548-f5a5-49b3-b3c3-603021b48c02 | Himanshi-200/Cpp_Programming | Function/Power.cpp | #include<iostream>
using namespace std;
int power(){
int a, b;
cin>>a>>b;
int ans=1;
for(int i=1; i<=b; i++){
ans=ans*a;
}
return ans;
}
int main()
{
int ans = power();
cout<<"The Answer is :- "<<ans<<endl;
return 0;
} | ALGO | 0.999838 | 4.998953 |
6350e2fb-0547-4455-b904-6c98256a8f6e | asthor24/prime-sort | src/strings/selection_cpu.cpp | #include "../algos/selection_cpu.h"
#include <iostream>
#include <string>
#include <vector>
#include "../datatypes/my_string.cpp"
#include "../utils/cpu_tests.h"
#include "../utils/free_arrays.h"
#include "../utils/read_input.h"
using namespace std;
int main() {
vector<vector<my_string*>> arrays = read_input<my_st... | ALGO | 0.99888 | 4.777502 |
76552f54-fa3b-4dc9-80ca-5eaba2f1d793 | madukm/undergrad-usp | sem5/labAlg/aula11-ex1.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
const ll n_max = 1e5+5;
const ll inf = 1e16;
vector<pll> g[n_max];
vector<ll> dist(n_max, inf), visited(n_max, 0);
void dijkstra(){
priority_queue< pll, vector<pll>, greater<pll> > pq;
dist[1]... | ALGO | 0.999983 | 4.377564 |
84871c7c-323d-4dcf-b92a-78140e8b5b35 | arshomashohag/UVA- | 101 - The Blocks Problem.cpp | #include<cstdio>
#include<utility>
#include<iostream>
#include<cstring>
#define lld long long int
using namespace std;
lld n,i,j,k,a1,a2;
char s[20],s1[10],s2[10];
int pos[26][3];
int cur[27][27];
int size_ar[27]={1};
void move_a_onto_b(lld a, lld b)
{
int pres_pos,prev_pos,i,j,temp,pres_pos_b;
pres_pos=p... | ALGO | 0.968378 | 3.500459 |
8458b7d6-58a9-44aa-92af-3a9ec9e3fdee | Hal9k-dk/3D-Printere | ultimaker_hal9k/ultimaker_hal9k/vector_3.cpp | #include <math.h>
#include "Marlin.h"
#ifdef ENABLE_AUTO_BED_LEVELING
#include "vector_3.h"
vector_3::vector_3() : x(0), y(0), z(0) { }
vector_3::vector_3(float x_, float y_, float z_) : x(x_), y(y_), z(z_) { }
vector_3 vector_3::cross(vector_3 left, vector_3 right)
{
return vector_3(left.y * right.z - left.z * ri... | TOOL | 0.869699 | 5.613548 |
e8159e1f-a617-4a87-8711-0fd7fbcc8121 | alvesouza/TG_Code | Genes_helpers/Genes_helpers.cpp | //
// Created by pedro on 12/06/2021.
//
#include "Genes_helpers.h"
namespace Genes_helpers {
void mutation(boost::dynamic_bitset<> &a, uint rate){
for (boost::dynamic_bitset<>::size_type i = 0, size = a.size(); i < size; ++i) {
a[i] ^= (rand()%100000 < rate);
}
}
template<cl... | ALGO | 0.986431 | 4.478312 |
9e3977f5-a58e-4681-a08d-5ad3abe736f5 | dubeyKartikay/SafeC | llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp | #include "lib/FileAnalysis.h"
#include "lib/GraphBuilder.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/SpecialCaseList.h"
#include <cstdlib>
using namespace llvm;
using namespace llvm::object... | TOOL | 0.864502 | 6.972804 |
4a653ed8-31d4-411d-abb3-79e3da80da60 | trimmergrom/SBD_121_Base | table_mul/table_mul.cpp | #include <iostream>
using namespace std;
int main()
{
int a = 1;
int b = 1;
do
{
for (a = 1; a < 11; a++)
{
cout << a << " * " << b << " = " << a * b << "\n";
if (a == 10) { cout << "\n"; }
}
b += 1;
} while (b < 11);
}
| ALGO | 0.99665 | 3.840189 |
bb38353d-a802-4c34-abe5-b97cc6d0fb92 | SWAGATSWAROOP/LeetCode | 1514-Path-with-Maximum-Probability.cpp | class Solution {
public:
double maxProbability(int n, vector<vector<int>>& edges, vector<double>& succProb, int start_node, int end_node) {
vector<double> maxProb(n, 0.0);
maxProb[start_node] = 1.0;
for (int i = 0; i < n - 1; ++i) {
bool updated = false;
for (int j =... | ALGO | 0.99997 | 6.314734 |
17149a7d-48f5-4a00-9c72-b9f31c24301a | Caoyuewin/NowCoder | Day_25/数根.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
while (cin >> s) {
int sum = 0;
do {
sum = 0;
for (unsigned int i = 0; i < s.size(); i++) {
sum += (s[i] - '0');
}
int i = 0;
int tmp = sum;
for (i = 0; tmp; i++) {
s[i] = ... | ALGO | 0.999904 | 5.297139 |
b4ae7e91-c285-4581-b17a-82d60bf8b663 | HKUST-Aerial-Robotics/SLIM | modules/vector_map.cpp | #include "vector_map.h"
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/prim_minimum_spanning_tree.hpp>
namespace SLIM {
using namespace boost;
uint32_t LineLM::factory_id_ = 0;
uint32_t SurfaceLM::factory_id_ = 0;
uint32_t Block::factory_id_ = 0;
uint32_t VectorMap::factory_id_ = 0;
bool VectorMa... | TOOL | 0.942908 | 3.32447 |
ee5228da-7ecf-4ed2-b73d-466396b42c80 | ctk0418/data_static | src/4/57-4.cpp | #include <windows.h>
#include <math.h>
#include <stdio.h>
#include <malloc.h>
double dividewangxx=(double)32767*(double)32767*(double)32767;
#include <c:\\simulated_book\\include_dll\\DLL_function_type.cpp>
double uniform_simulated(double alpha,double beta)
{
double tep1,tep=0,dividewangx;
again:
tep1=((doub... | ALGO | 0.999727 | 3.612242 |
b6491cd5-84be-43b4-b5e9-f141dbe050f4 | darrylteo/cp4-solutions | 8 More Advanced Topics/5. Problem Decomposition/b. Two Components - BSTA and Other, Harder/catandmice.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
double dist[16][16], memo[1 << 16][16], latest[16], pows[16], distToFirst[16];
double fac, spd;
bool ok() {
for (int i = 0; i < (1 << n); ++i) for (int j = 0; j < n; ++j) memo[i][j] = 1e9;
for (int i = 0; i < n; ++i) {
double time = distToFirst[i] ... | ALGO | 0.999965 | 4.506774 |
e3623f32-1c82-49a4-be18-3f02fd49371c | abdelnaby1/problem_solving | medium/queue/topKWordsFrequenct.cpp | #include <vector>
#include <queue>
#include <unordered_map>
#include <iostream>
#include <algorithm>
using namespace std;
class Solution
{
public:
static bool cmp(const pair<int, string> &a, const pair<int, string> &b)
{
if (a.first == b.first)
{
return a.second < b.second;
}... | ALGO | 0.999992 | 5.542346 |
026c53f2-f5bc-4ae2-b17d-5850604cfbf9 | xyb7910/cpp_fire | atcoder/BeginnerContest381/d.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
int findMax1122(const vector<int>& A) {
int maxLen = 0;
int n = A.size();
for (int start = 0; start < n; ++start) {
unordered_map<int, int> count;
int len = 0;
bool isValid = t... | ALGO | 0.999502 | 4.811299 |
30bd763a-d3b1-478f-92d0-5236a8aa1f5f | sarvex/leetcode-c-- | solution/2300-2399/2310.Sum of Numbers With Units Digit K/Solution.cpp | class Solution {
public:
int minimumNumbers(int num, int k) {
if (num == 0) return 0;
for (int i = 1; i <= num; ++i) {
int t = num - k * i;
if (t >= 0 && t % 10 == 0) return i;
}
return -1;
}
}; | ALGO | 0.999798 | 5.073513 |
ceadd234-bfa8-490d-b2c6-ddc20772500f | HebaBakry/social_media_app_firestore | 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 |
25fc80ce-a3da-4607-a777-4fed8e59bad1 | sahilkhan03/CF-Solutions | codeforces/1151/C.cpp | /* ___ |\ /| ____ ____ ____ ____
| | /\ / \ | | | \ / | /\ | \ | \ | | \
|_____| /__\ \____ |_____| | \/ | /__\ |____/ |____/ |__ |____/
| | / \ \ | | | | / \ | | | | \
... | ALGO | 0.999955 | 3.897007 |
d75f4445-b907-4769-b76f-a6cb7d7c6e79 | fcjdgmrvwm/ORB_SLAM2_ADDUP | Thirdparty/g2o/g2o/core/sparse_optimizer.cpp | #include "sparse_optimizer.h"
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <iterator>
#include <cassert>
#include <algorithm>
#include "estimate_propagator.h"
#include "optimization_algorithm.h"
#include "batch_stats.h"
#include "hyper_graph_action.h"
#include "robust_kernel.h"
#include "../st... | ALGO | 0.999674 | 6.979606 |
57186a03-93ae-4929-a39e-a1a4daaaaa60 | eirikhanasand/Algmet | 1.cpp | /**
* Note:
*
* 1a. Skipped, seemed unnecesarry.
* 1b. Created a function that takes the new size, creates a new vector using a
* temporary vector while copying. The new vector is initialized with 0s or a
* value of your choice. Data is pointed to the new vector, and the old vector
* is deleted. Tested using s... | ALGO | 0.960698 | 3.955053 |
08086b45-485e-4932-8eeb-e9b42d28be38 | oceanumeric/cs106 | week0/c1e10.cpp | #include <iostream>
int main() {
int n = 0;
std::cout << "Enter a number: ";
std::cin >> n;
while (n != 1) {
if (n%2 == 0) {
std::cout << n << " is even, so I divide it by 2 and get ";
n = n/2;
std::cout << n << std::endl;
} else {
... | ALGO | 0.999669 | 5.235491 |
cb989962-2734-46d0-82d4-7e3e9776a1f3 | bhushankirve/C_CPP_JAVA | 201to263/Program225.cpp | #include<iostream>
using namespace std;
typedef struct node
{
int data;
struct node *next;
}NODE, *PNODE, **PPNODE;
class SinglyLL
{
private:
PNODE first;
int size;
public:
SinglyLL();
void InsertFirst(int);
void InsertLast(int);
void InsertAtPos(int , int);
void DeleteFirst()... | ALGO | 0.999188 | 4.282891 |
903b3814-62a2-4da1-8a90-df56f548e15b | psycoder69/codeforces | 1993B.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
const int MOD = 1e9 + 7;
int main()
{
ios_base :: sync_with_stdio (false);
cin.tie (NULL);
cout.tie (NULL);
int t, n;
cin >> t;
while (t --)
{
cin >> n;
vector <int> nums(n);
long long int ma... | ALGO | 0.999843 | 4.881094 |
9d258be8-9693-4a0a-b9f8-9f8ec132852a | ishandutta2007/codeforces | kude/normal/1547/G.cpp | #include<bits/stdc++.h>
#include <algorithm>
#include <cassert>
#include <vector>
#include <algorithm>
#include <utility>
#include <vector>
#include <algorithm>
#include <utility>
#include <vector>
namespace atcoder {
namespace internal {
template <class E> struct csr {
std::vector<int> start;
std::vector<... | ALGO | 0.999945 | 5.318336 |
b77cda14-1047-497a-8960-559d8bb489b1 | npistel/bachelors-thesis | src/main.cpp | #include <iostream>
#include <array>
#include <algorithm>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <fstream>
#include <string>
#include <random>
#include <limits>
#include <opencv2/imgproc.hpp>
#include "DisjointSetForest.hpp"
#include "Puzzle.hpp"
#include "State.hpp"
constexpr int m = 30;... | ALGO | 0.999762 | 4.384855 |
e07482ee-cba3-423a-beb2-50e0e118c770 | RevengeOS/android_frameworks_av | media/libeffects/lvm/lib/Common/src/Mac3s_Sat_32x16.cpp | /**********************************************************************************
INCLUDE FILES
***********************************************************************************/
#include "VectorArithmetic.h"
#include "LVM_Macros.h"
/*****************************************************************************... | ALGO | 0.987938 | 5.079106 |
cf181620-2c3c-429c-ab14-0fdfea9c2e34 | richelbilderbeek/KalmanFilterer | standardkalmanfilter.cpp |
#include "standardkalmanfilter.h"
#include <boost/numeric/conversion/cast.hpp>
#include "matrix.h"
ribi::kalman::StandardKalmanFilter::StandardKalmanFilter(
const boost::shared_ptr<StandardKalmanFilterCalculationElements>& calculation,
const boost::shared_ptr<const KalmanFilterParameters>& parameters
)
: K... | ALGO | 0.991022 | 7.186837 |
8386ee17-881f-4d5c-a73e-1ef8a2311e41 | muqsith/google-cpp | src/next-steps/ptrrefs.cpp | #include <iostream>
using namespace std;
void DoIt(int &foo, int goo);
int main()
{
int *foo, *goo;
foo = new int;
*foo = 1;
goo = new int;
*goo = 3;
*foo = *goo + 3;
foo = goo;
*goo = 5;
*foo = *goo + *foo;
DoIt(*foo, *goo);
cout << (*foo) << endl;
int x = 10, y = 20... | ALGO | 0.981602 | 4.356726 |
1ee6f2fa-73c7-4997-b087-bf0acf0a8f94 | ishandutta2007/codeforces | superpear/normal/259/A.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <set>
#include <algorithm>
#include <map>
#include <bitset>
#include <vector>
#include <queue>
#include <stack>
#include <utility>
#include <functional>
#include <sstream>
#include <list>
#include <complex>
#define ma... | ALGO | 0.998781 | 3.355441 |
7ca1597b-7ef7-44c1-9367-a140cec6e411 | EliazarNoaLlas/ProgramacionCompetitiva | ICPC/I.cpp | #include <iostream>
#include <vector>
using namespace std;
const int MAXN = 100;
int r, c;
int grid[MAXN][MAXN];
bool visited[MAXN][MAXN];
int directions[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
bool valid(int x, int y) {
return (x >= 0 && x < r && y >= 0 && y < c);
}
int dfs(int x, int y, int step) {
vis... | ALGO | 0.999546 | 4.714036 |
9aedb885-10bc-4271-b715-3f1181247014 | ejajkhan/CodeForces_Solve | 490A_Team_Olympiad.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
vector<int> a,b,c;
cin>>n;
for(int i=0;i<n;i++)
{
int temp;
cin>>temp;
if(temp==1){a.push_back(i+1);}
if(temp==2){b.push_back(i+1);}
if(temp==3){c.push_back(i+1);}
}
int result=min(a.siz... | ALGO | 0.999959 | 3.368992 |
842e25cb-8281-4b29-aa0b-fe405df8b76c | rehmeee/Linear-DSA-Problems | String Problems/length_of_last_word.cpp | #include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
using namespace std;
int lengthOfLastWord(string s) {
int l = 0 , r = s.length()-1, len = 0;
if(s[r] == ' '){
while(s[r] == ' ') r--;
}
while(r>=l){
if(s[r] != ' ') {
len+... | ALGO | 0.999328 | 3.837888 |
e1c1ce6f-3ade-4c3d-8ea0-912d186bbdb5 | krishna9809/DSA-with-cpp | Day012/2D-Array/1st.cpp | // 2d Array basics
#include<iostream>
using namespace std;
int main()
{
// Delare
// int arr[3][3];
// cout<<"Enter the element of 2d Array: "<<endl;
// //Input
// for(int i = 0;i <3;i++){
// for(int j = 0; j<3;j++){
// cin>>arr[i][j];
// }
// }
// //Output
... | ALGO | 0.946619 | 3.865381 |
5132d944-4d5e-4e6c-ae57-43f0b4109008 | Baodeptraii/Algorithm | Algorithm/Tổng cặp số nhỏ hơn.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
long long n, m;
cin >> n >> m;
long long a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a, a + n);
long long cnt = 0;
long long left = 0, right = n - 1;
while (left < right) {
if (... | ALGO | 0.999995 | 4.715856 |
5133994c-9bc0-4239-886e-5018a8bd7dbc | fossabot/deplug | plugkit/src/filter_thread_pool.cpp | #include "filter_thread_pool.hpp"
#include "filter_thread.hpp"
#include "variant.hpp"
#include <map>
#include <uv.h>
namespace plugkit {
class FilterThreadPool::Private {
public:
Private(const std::string &body, const Variant &options,
const FrameStorePtr &store, const Callback &callback);
~Private();
... | TOOL | 0.908786 | 6.225479 |
4ba985b6-67d5-4ba9-b12e-d146a39e9fdd | haoel/leetcode | algorithms/cpp/distinctSubsequences/distinctSubsequences.cpp | // Source : https://oj.leetcode.com/problems/distinct-subsequences/
// Author : Hao Chen
// Date : 2014-07-06
/*****************************************************************************************************
*
* Given a string S and a string T, count the number of distinct subsequences of S which equals T.
... | ALGO | 0.999948 | 5.961 |
c5dc36b5-48ab-41a7-adff-8b8d2fb98c6e | Mayank9mare/Codeforces | 702div3/a.cpp | // .-""""-.
// / j \
// :.d; ;
// $P :
// .m._ $$ :
// dSMMSSSss.__$b. __ :
// :MMSMMSSSMMMSS$$b $P ;
// SMMMSMMSMMMSSS$$$$ :b
// dSMMMSMMMMMMSSMM$$b.dP ... | ALGO | 0.999668 | 4.493818 |
9e2400f3-30e0-4392-8723-8001c1278eb1 | the-shoaib2/Sector-2.0 | Algorithms/Greedy/Knapsack_problem.cpp | #include <bits/stdc++.h>
using namespace std;
int Profit[105];
int Weights[105];
long long int knapsack(int idx, int WT_left) {
// Base cases
if (WT_left == 0 ||idx < 0)
return 0;
// If the weight of the current exceeds the remaining capacity, skip it
long long int ans = knapsack(idx - 1, WT_... | ALGO | 0.999995 | 4.791373 |
df23edc8-e876-433a-af80-0454c5bbd14d | TRNDWC/DSA_PTIT | DSA08016.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool ktra(vector<long> A, vector<long> B)
{
for (int i = 0; i < 10; i++)
if (A[i] != B[i])
return false;
return true;
}
vector<long> quay1(vector<long> A)
{
long tmp = A[0];
A[0] = A[3];
A[3] = A[7];
A[7] = A... | ALGO | 0.999876 | 3.663944 |
28e92efc-9ef5-4af6-bffd-0ed4197b2ab8 | Ed-Ko/LeetCode | 1354. Construct_Target_Array_With_Multiple_Sums/solution.cpp | class Solution {
public:
bool isPossible(vector<int>& target) {
long sum = 0;
priority_queue<int> pq;
for(int i = 0 ; i < target.size() ; i++){
pq.push(target[i]);
sum += target[i];
}
while(pq.top() != 1){
... | ALGO | 0.999946 | 5.071094 |
e9887140-48e1-4659-bac8-f6b4b997aabd | raincross7/code-similarity | codes/train_code/problem042/problem042_353.cpp | #include <iostream>
#include <vector>
using namespace std;
int n, m;
vector<vector<int>> graph;
int cnt = 0;
vector<bool> seen;
void dfs (int now) {
for (int next: graph[now]) {
if (seen[next]) continue;
else {
seen[next] = true;
dfs(next);
seen[next] = false;
... | ALGO | 0.999829 | 5.019247 |
ccb14188-b000-488d-afe8-03e828e38e93 | HexHive/Sourcerer | libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/pstl.replace_copy.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: libcpp-has-no-incomplete-pstl
// template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T>
// ForwardIterator2
// replace_copy(ExecutionPolicy&& exec,
// ForwardIterator1 first, ForwardIterator1 last,
// ... | TEST | 0.883385 | 6.408719 |
45047a8a-30f5-4ccc-bd98-461aa9f744ee | agumatt/trabajoAdelantadoCC6908 | MonaEngine/thirdParty/bullet3-2.88/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp | #include "btMultiBodyDynamicsWorld.h"
#include "btMultiBodyConstraintSolver.h"
#include "btMultiBody.h"
#include "btMultiBodyLinkCollider.h"
#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
#include "LinearMath/btQuickprof.h"
#include "btMultiBodyConstraint.h"
#include "LinearMath/btIDebugDraw.h... | TOOL | 0.974513 | 5.187418 |
5b154d51-4f14-4306-aa8b-bba2335ecfff | prajapatiniranjan/cpp-notes | 16-aug/qtn8.cpp | /*
Write a program to accept two floating point numbers from user.
And perform multiplication and division on the numbers.
Display the result on console.
*/
#include <iostream>
using namespace std;
int main()
{
cout << "Enter any decimal Number 1"
"\n";
float number1;
cin >> number1;
cout ... | ALGO | 0.986556 | 3.935436 |
47d171a0-1667-403d-8127-ba0c3033d227 | PedroDariva36/Desktop | Beecrowd/2122/a.cpp | #include <bits/stdc++.h>
#include <vector>
#define ll long long
#define ull unsigned long long
#define pll pair<ll,ll>
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
using namespace std;
int main (int argc, char *argv[]){
cin.tie(0)->sync_with... | ALGO | 0.999637 | 3.138751 |
9e083c4f-6401-4111-b183-e7ab5787279e | raincross7/code-similarity | codes/train_code/problem081/problem081_165.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
#include <vector>
#include <stack>
#include <algorithm>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const int MOD = pow(10,9) + 7;
ll modpow(ll a, ll b, ll mod = MOD) {
ll res = 1;
for (a %= mod; b; a = a * a % ... | ALGO | 0.999923 | 4.077051 |
d46bcf2c-a132-42f4-8892-70e5aba2752d | Pumzow/Software-University | CPP/OOP/Homeworks/Polymorphism/Duplicates/DuplicatesMain.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <list>
#include "Company.h"
#include "RemoveDuplicates.h"
int main() {
using namespace std;
cin.sync_with_stdio(false);
cout.sync_with_stdio(false);
list<Company*> companies;
string line;
Company* lastCompany = nullptr;
while (getline(cin, li... | TOOL | 0.955796 | 4.309744 |
a37f7b64-94a0-4b5a-aa93-6e4252ec5711 | rico2290/ProjetoCG | face.cpp | #include "face.h"
#include "operacoes.h"
#include "transformacoes.h"
Face::Face()
{
}
Face::Face(Point _P1, Point _P2, Point _P3){
this->P1=&_P1;
this->P2=&_P2;
this->P3=&_P3;
this->atNormal();
}
Face::Face(Point *_P1, Point *_P2, Point *_P3, Material *_M){
this->P1=_P1;
this->P2=_P2;
this... | ALGO | 0.98418 | 4.1909 |
088c2cb6-b925-4ea8-b631-b03051b973db | DAD609/OOP_C | lab_4/lab_4/lab_4.cpp | #include <iostream>
#include <initializer_list>
template<typename T>
struct Node {
T data;
Node* next;
Node* prev;
};
template <typename T>
class StackBasedOnBidirectionalCyclicLinkedList {
private:
Node<T>* top;
int size;
public:
StackBasedOnBidirectionalCyclicLinkedList();
StackBasedOnB... | ALGO | 0.892436 | 6.463605 |
91b2830e-7a38-4a77-a291-d11ac0bd1212 | ademeyer/GoogleSolution | MaximumSubarray/MaximumSubarray.cpp | // MaximumSubarray.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
int maxSubArray(vector<int>& nums)
{
int maxSub = nums[0];
int curSub = 0;
for (auto n : num... | ALGO | 0.999384 | 5.951981 |
20bf88dd-5a2e-4ea9-b525-b03e28a2672b | him0727/Online-Judge-Solutions | SPOJ/ARMY.cpp | #include <bits/stdc++.h>
using namespace std;
int t;
int main() {
scanf("%d", &t);
while (t--) {
int ng, nm, cg, cm;
multiset<int> g;
multiset<int> m;
scanf("%d %d", &ng, &nm);
for (int i = 0; i < ng; i++) {
scanf("%d", &cg);
g.insert(cg);
}
for (int i = 0; i < nm; i++)... | ALGO | 0.999487 | 3.59144 |
5f2bd4e7-e92a-4936-b86e-d06ca548c970 | bruceli-rw0/udacity-cpp | 5_neural_network/src/mnist.cpp | #include <iostream>
#include <memory>
#include <algorithm>
#include "FeedForward.h"
#include "Datasets.h"
#include "Layers.h"
using std::cout;
using std::endl;
Matrix normalize(Matrix image);
int main()
{
string folder = "../fashion-mnist/";
auto data = getImage1D(folder + "train-images-idx3-ubyte");
auto... | DATA | 0.91804 | 4.311182 |
8aa65836-9323-40ff-a0e2-2f0629443573 | kuanarshubham/DSA | 06.LinkedList/03/02.cpp | // reverse a LL
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
class Node{
public:
int value;
Node*nxt;
Node(int val){
this->value = val;
this->nxt = NULL;
}
};
Node *reverseLL(Node*head){
Node *curr=head, *prev=NULL, *next;
while(curr!=NULL){
... | ALGO | 0.999629 | 4.548877 |
147075ff-f109-4a2d-995b-1f5192c5b680 | sinian666/code_41_25 | cpp_副本12/chapter_stack_and_queue/array_queue.cpp | /**
* File: array_queue.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 基于环形数组实现的队列 */
class ArrayQueue {
private:
int *nums; // 用于存储队列元素的数组
int front; // 队首指针,指向队首元素
int queSize; // 队列长度
int queCapacity; // 队列容量
public:
Arra... | ALGO | 0.995493 | 5.57649 |
c789a11b-c84b-4e84-97b5-6128473e4e24 | vtandon1204/DSA-Sheet | 13. Binary Trees/Medium/06ZigZagTraversal.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int val;
Node* left;
Node* right;
};
vector<vector<int>> zigzagLevelOrder(Node *root)
{
vector<vector<int>> ans;
if (!root)
{
return ans;
}
queue<Node *> q;
q.push(root);
bool leftToRight = true;
while (!q.... | ALGO | 0.999998 | 5.460648 |
93050ebd-2199-4132-8601-a9d5f1338928 | phamthainb/c-ptit | contest-final-c++/largernumber3.cpp | //large number 3
#include<bits/stdc++.h>
using namespace std;
void nhan(string x, string y){
vector<int> temp(1000001, 0);
int max = x.size() + y.size();
for(int i = y.size() - 1; i >= 0; i--){
for(int j = x.size() - 1; j >= 0; j--){
temp[i + j + 1] += (y[i] - '0')*(x[j] - '0');
}
}
// cong lai
int nho ... | ALGO | 0.999846 | 4.677221 |
34b14824-731e-4f61-bf56-7f384c04d6dc | ankitmohapatra966/LeetCode_Daily_solution | 1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance.cpp | #include <vector>
#include <limits>
#include <algorithm>
using namespace std;
class Solution {
public:
int findTheCity(int n, vector<vector<int>>& edges, int distanceThreshold) {
// Initialize the distance matrix with infinity
vector<vector<int>> dist(n, vector<int>(n, numeric_limits<int>::max()))... | ALGO | 0.999988 | 6.915649 |
9210b15b-0360-4316-95cb-0155473cf82c | Mitesh12ehd/DSA | 3. Arrays/q13_3_sum.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<unordered_map>
using namespace std;
//read notes
//leetcode 15
//3Sum
//brute force
vector<vector<int>> threeSum(vector<int>& nums) {
set<vector<int>> st;
for(int i=0; i<nums.size(); i++){
for(int j= i+1; j<nums.size(); j++... | ALGO | 0.998492 | 5.317994 |
76a9c31c-afa7-45c6-8a16-6a82b3bbdeae | psychogeekir/MAC-POSTS | src/minami/dta_gradient_utls.cpp | #include "dta_gradient_utls.h"
#include "limits.h"
#include "path.h"
namespace MNM_DTA_GRADIENT {
TFlt get_link_inflow(MNM_Dlink *link,
TFlt start_time, TFlt end_time) {
if (link == nullptr) {
throw std::runtime_error("Error, get_link_inflow link is null");
}
... | ALGO | 0.993238 | 5.461812 |
bdaa28c1-3ef4-45e3-bae3-32c00b5936a4 | readex-eu/readex-apps | production_apps/BEM4I/LaplaceSteklovPoincareOperator.cpp | /*!
* @file LaplaceSteklovPoincareOperator.cpp
* @author Jan Zapletal
* @author Michal Merta
* @date November 24, 2014
*/
#ifdef LAPLACESTEKLOVPOINCAREOPERATOR_H
namespace bem4i {
template<class LO, class SC>
LaplaceSteklovPoincareOperator<LO, SC>::LaplaceSteklovPoincareOperator( ) {
}
template<class ... | ALGO | 0.978924 | 5.265582 |
d41e6af0-a3a9-4f72-814f-60d49f9829b4 | gabrielgcma/pppCpp | cap5/8.cpp | #include <iostream>
#include "std_lib_facilities.h"
void firstN (vector<int> nums, int n)
{
if(n > nums.size()) error("Number of integers passed is out of range!");
int sum = 0;
for(int i=0; i<n; ++i)
{
sum += nums[i];
}
cout << "The sum of the first "<< n <<" elements is: " << su... | ALGO | 0.971664 | 6.145102 |
e62e79ee-60c8-4333-887c-675c95767c23 | nikolaimatni/SelfDrivingCar | src/Eigen-3.3/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.951104 | 5.099652 |
ed68ab1f-d277-43db-a71f-84e06a71c7ae | rohan8789/Languages | C++/chapter03/practice/07_practice.cpp | //hollow triangles
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int i, j;
for(i = 1; i<=n; i++)
{
for(j = 1; j<=i; j++)
{
if(i == n || j==1||i==j)
{
cout<<"x";
}
else
{
... | ALGO | 0.999906 | 3.260142 |
d3468484-02c8-48d0-a788-5bb973f2b2c9 | touhid91/lc.msft | 1.arrays.and.strings/1.6.reverse.words.in.a.string.II.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
void reverseWords(vector<char>& s) {
int n = s.size(), l = 0, r = n - 1;
while (l < r) {
swap(s[l++], s[r--]);
}
l = r = 0;
int b, e;
while (r < n) {
while (r < n && s[r] == ' ') ++r;
b = r;
wh... | ALGO | 0.999831 | 5.799573 |
c1bf981f-88c3-4905-9b24-b16a50f713bb | ddangcong80/codetree-TILs | 231225/문자열 출력하기/print-string.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for(int i = 0; i < n; i++) {
cout << "LeebrosCode" << endl;
}
return 0;
} | ALGO | 0.981302 | 3.128274 |
518b39a5-3c12-41ab-ac7f-16a32dc9f9d3 | RohanMatre/DSA | Stack_span.cpp | // Stock Span Problem(V.V.V. IMP)
#include <iostream>
#include <stack>
using namespace std;
// Stock Span Problem
void stockSpan(int prices[], int n, int span[])
{
stack<int> s; // Idices of the Days -O(N) -->Push and Pop Each Element Only once
s.push(0);
span[0] = 1;
// Loop for Rest of the Days
... | ALGO | 0.999954 | 5.629954 |
f11610a4-4c66-4f06-a628-e2bae0257730 | neel-kumar/cpp | usaco/meeting_socho.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, x;
vector<array<int, 2>> g[100010];
bool check(int cm) {
deque<array<int, 2>> q;
q.push_back(array<int,2>({1, 0}));
bool vis[n+1]; for(int i = 1; i <= n; i++) vis[i] = false;
while(!q.empty()) {
auto curr = q.front(); q.pop_front();
int v = curr[0], d = ... | ALGO | 0.999971 | 5.681177 |
712e40f1-3fe5-4a70-9bf9-7efa14196b17 | okuraofvegetable/AtCoder | atcoder.jp/abc190/abc190_d/Main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define eps 1e-9
#define INF 2000000000 // 2e9
#define LLINF 2000000000000000000ll // 2e18 (llmax:9e18)
#define all(x) (x).begin(), (x).end()
#define sq(x) ((x) * (x))
#define rep(i, x) for (int i = 0; i < (in... | ALGO | 0.9998 | 4.959258 |
b0871ed1-cc65-4b06-ac5f-c171583dffad | denis-gubar/Leetcode | all/1925. Count Square Sum Triples.cpp | class Solution {
public:
int countTriples(int n) {
int result = 0;
for (int a = 1; a <= n; ++a)
for (int b = 1; b <= n; ++b)
{
int c = sqrt(1.0 * a * a + b * b + 0.1);
if (c * c == a * a + b * b && c <= n)
++result;
}
return result;
}
}; | ALGO | 0.999749 | 4.864656 |
40702891-5935-412c-bc20-90841224bcea | ishandutta2007/codeforces | yp155136/normal/1017/B.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <utility>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cassert>
#include <iomanip>
#include <bitset>
using namespace std;
typedef lo... | ALGO | 0.999932 | 3.489226 |
335475b3-5ad2-4e35-a472-f337fc3d8f5d | FullteaR/CompetitiveProgramming | AtCoder/ABC140/C.cpp | #include <iostream>
using namespace std;
int main(void){
int N;
cin>>N;
long B[N];
for(int i=0;i<N-1;i++){
cin>>B[i];
}
B[N-1]=100010;
long retval=0;
for(int i=1;i<N;i++){
retval+=min(B[i],B[i-1]);
}
retval+=B[0];
cout<<retval<<endl;
return 0;
}
| ALGO | 0.99994 | 3.338282 |
41eb582d-a451-4062-866b-941030609c87 | heavenMOJANG/ICPC | programmes_C_Cpp/Codeforces/CF1929/B.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int inf=0x7fffffff;
void solve(){
int n,k;cin>>n>>k;
if((n+(n-2))*2>=k) cout<<(k+1)/2<<"\n";
else{
int ans=2*n-2;
k-=4*n-4;
... | ALGO | 0.999827 | 4.191153 |
cd7aac32-c109-4f32-bca0-4b0618c904dd | millaker/MiGPU-llvm-project | libc/src/stdbit/stdc_leading_ones_uc.cpp | #include "src/stdbit/stdc_leading_ones_uc.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(unsigned, stdc_leading_ones_uc, (unsigned char value)) {
return static_cast<unsigned>(cpp::countl_one(value))... | ALGO | 0.934289 | 6.508655 |
53ccacc2-ab1a-4d31-b299-c04ffe4f23cd | MarlonStingelin/Grafo-de-Iris-TEG | Códigos Etapa A/gerarGrafoIris.cpp | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
typedef struct Vertice {
int id;
double sepal_length;
double sepal_width;
double petal_length;
double petal_width;
struct Vertice* proximo;
} Vertice;
typedef struct Aresta {
int idAlvo;
struct Arest... | ALGO | 0.998754 | 5.888904 |
aa1cd14e-9fde-4eae-a25a-66c16f8b1f73 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_7986_4.cpp | #include <bits/stdc++.h>
using namespace std;
void Open() {
freopen("Input.txt", "r", stdin);
freopen("Output.txt", "w", stdout);
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
void madesetprobblem() {}
int a, n, m, *x, *y;
long long dp[2001][2001];
long long ans(int c, int s) {
... | ALGO | 0.999853 | 3.722256 |
46d21dbf-a115-4a72-8c37-7886341c6a3e | ssumachai/CS170 | Assignment #1 - Eight Tile Puzzle/src/test-cases.cpp | #include "../include/problem.h"
#include "../include/solutionalgorithms.h"
int main(){
std::vector<int> test_case = {};
problem* currnode;
std::vector<problem*> solutionpath;
int buf;
bool test_select, algo_select = false;
std::cout << "Welcome to Chai and Nikki's Test Case Solver!\nBoard pre... | ALGO | 0.999317 | 5.102779 |
cc7a88ea-7fb2-4095-878d-92113528ab37 | NextThread/450-dsa | bst/LCA_of_two_node.cpp | class Solution
{
public:
TreeNode *lowestCommonAncestor(TreeNode *root, TreeNode *p, TreeNode *q)
{
if (!root || root == p || root == q)
return root;
TreeNode *left = lowestCommonAncestor(root->left, p, q);
TreeNode *right = lowestCommonAncestor(root->right, p, q);
re... | ALGO | 0.999965 | 6.1757 |
37050af4-54a4-454a-bc14-fcef178db2d0 | YOUSSEFLJ9/learn-programming-in-CPP | problem solving Lv2/problem #36.c.cpp | #include <iostream>
using namespace std;
int ReadNumber(string message)
{
int Number;
do {
cout << message << "\n";
cin >> Number;
} while (Number != 0 && Number != 1);
return Number;
}
int fillarry (int arry[100])
{
int i = 1;
int Arrylength = 0;
do
{
cout << "please enter a Number : " << endl;
... | TOOL | 0.979337 | 3.851176 |
49ba99a0-dfaa-46f7-9346-72488d18580d | ttacon/tesseract | cube/word_size_model.cpp | #include <math.h>
#include <string>
#include <vector>
#include "word_size_model.h"
#include "cube_utils.h"
namespace tesseract {
WordSizeModel::WordSizeModel(CharSet * char_set, bool contextual) {
char_set_ = char_set;
contextual_ = contextual;
}
WordSizeModel::~WordSizeModel() {
for (int fnt = 0; fnt < font_p... | ALGO | 0.960644 | 6.561449 |
b2bb31f9-5c26-485a-b019-66a4b0e0aa76 | WorkingXXX/FluidSimulation | FluidSimulation/Collision.cpp |
#include "Collision.h"
/* CollisionTriangle */
bool CollisionTriangle::create_triangle(const Vector3d & a, const Vector3d & b, const Vector3d & c) {
// غϵĵ㣬ʧ
if (a == b || b == c || c == a) {
cout << "Error : Fail to create CollisionTriangle" << endl;
cout << "Caused by : Existing coincident points" << endl... | ALGO | 0.997172 | 4.288377 |
7780652d-1e13-4afc-a751-a4da2c6e1d72 | munafmd9849/GeeksForGeeks | Difficulty: Medium/Count distinct elements in every window/count-distinct-elements-in-every-window.cpp | class Solution {
public:
vector<int> countDistinct(vector<int> &arr, int k) {
// code here.
int n=arr.size();
vector<int> ans;
unordered_map<int ,int> um;
for(int i=0;i<k;i++){
um[arr[i]]++;
}
ans.push_back(um.size());
int s=0,e=k;
... | ALGO | 0.999875 | 5.677923 |
abde9cf0-c7eb-4396-808b-9f36b167de06 | TriumphHu/XDOJ | XDU数据结构题/xdoj系列/xdoj319.cpp | #include<iostream>
#include<string>
using namespace std;
typedef struct TreeNode* BinTree;
struct TreeNode
{
int data;
int sum;
BinTree left;
BinTree right;
};
BinTree createTree();
BinTree mergeIntTree(int *ar1, int *ar2, int len);
int FindInt(int* ar,int num);
BinTree sumTree(BinTree BT);
void MidOrderTraversal(B... | ALGO | 0.999957 | 3.102988 |
e5ac64ce-c0b5-49dc-baf3-468e2c316301 | sebastianripa/varena1 | codeforces B. Polycarp Writes a String from Memory/main.cpp | #include <iostream>
using namespace std;
bool v[30];
void vreset()
{
int i;
for(i = 1; i <= 29; i++)
v[i] = 0;
}
int main()
{
int t, i, j, cnt, nrl = 0;
char c, l;
cin >> t;
cin.get(c);
for(j = 1; j <= t; j++)
{
vreset();
nrl = 0;
while(cin.get(l) && l... | ALGO | 0.999201 | 3.155304 |
14bda5c1-b5b2-448d-9ab9-6681fd4ed8e7 | chiragmishra03/LeetCode-DSA | 0746-min-cost-climbing-stairs/0746-min-cost-climbing-stairs.cpp | class Solution {
public:
int f(vector<int> a, int i, vector<int>&dp){
if(i<=1) return dp[i] = a[i];
if(dp[i]!=-1) return dp[i];
int pick = f(a, i-1, dp);
int nonpick = f(a, i-2, dp);
return dp[i] = a[i] + min(pick, nonpick);
}
int minCostClimbingStairs(vector<int... | ALGO | 0.999922 | 5.821594 |
2ded54d1-f7fe-4948-b8c7-fa5279429ceb | Prakashsaw/COTD-1 | COTD-Prog-on-vscode/CODT-PR-01(01/01/COTD-PR-30.cpp | class Solution {
public:
bool isIsomorphic(string s, string t) {
int n1,n2;
n1 = s.size(), n2 = t.size();
if(n1 != n2)
return false;
int i;
int h1[256]={0}, h2[256]={0};
for(i=0;i<n1;i++)
{
if(!h1[s[i]] && !h2[t[i]])
{
... | ALGO | 0.999973 | 6.162846 |
880043e6-ef64-46b8-935f-b29f6117dbe5 | sarahab23/codechef_questions | chefandsnackdown.cpp | #include<iostream>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--)
{
int N;
cin>>N;
if((N==2010)||(N==2015)||(N==2016)||(N==2017)||(N==2019))
cout<<"HOSTED"<<endl;
else
cout<<"NOT HOSTED"<<endl;
}
return 0;
}
| ALGO | 0.99708 | 3.915099 |
d84534f1-44d2-4e3f-8c4d-ba13bff17ba8 | sachin6377Tyagi/leetsubmission | 1302-delete-characters-to-make-fancy-string/delete-characters-to-make-fancy-string.cpp | class Solution {
public:
string makeFancyString(string s) {
string ans="";
int cnt=1;
ans+=s[0];
for(int i=1;i<s.size();++i){
if(s[i]==s[i-1])cnt++;
else cnt=1;
if(cnt<=2)ans+=s[i];
}
return ans;
}
}; | ALGO | 0.999983 | 5.721467 |
37db86d2-e3c0-4c06-b839-f7cfe9f74672 | mzhasan00/DataStructure-Cpp | Mid-Term/Question-8.cpp | #include<bits/stdc++.h>
using namespace std;
//Linked List Creator Class:
class Node
{
public:
int value;
Node *Next;
//Constractor Creation;
Node(int val)
{
value = val;
Next = NULL;
}
};
//Display Linked List:
void display(Node *n)
{
while(n != NULL)
{
cout<... | ALGO | 0.999921 | 3.002366 |
d53b63f8-1ec4-4719-8952-33967eb97100 | AhJo53589/leetcode-cn | problems/compare-version-numbers/SOLUTION.cpp |
//////////////////////////////////////////////////////////////////////////
class Solution {
public:
int compareVersion(string version1, string version2) {
auto v1 = getVer(version1);
auto v2 = getVer(version2);
return (v1 == v2) ? 0 : (v1 < v2) ? -1 : 1;
}
vector<int> getVer(string... | ALGO | 0.999747 | 5.524866 |
e04d68f0-cf82-4d2a-aa6f-df24a8d3a3a5 | cicuvc/LLVM-LA32R | libcxx/test/std/containers/associative/set/find.pass.cpp | // <set>
// class set
// iterator find(const key_type& k);
// const_iterator find(const key_type& k) const;
#include <set>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.h"
int main(int, char**)
{
{
typedef int V;
typedef std::set<int> M;
... | TEST | 0.872126 | 4.237936 |
42cf4781-fd0c-42c3-abec-3cb966ee2d34 | u-wyh/luogu-code | P6601.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1e9 + 7;
// ݺ a^b % MOD
int power(int a, int b) {
int ans = 1;
a = a % MOD;
while (b > 0) {
if (b & 1) {
ans = (ans * a) % MOD;
}
a = (a * a) % MOD;
b >>= 1;
}
return ans;
... | ALGO | 0.99997 | 4.540467 |
7f0a51b2-b575-4788-8f84-6e30f7aeb02c | arefinthecybersec/Blind-75-and-Neetcode-Problems-Solve | 0001-two-sum/0001-two-sum.cpp | //Expected T.C = O(n) - for array
//Expected S.C = O(n) - for map
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int, int> map;
for(int i = 0; i < nums.size(); i++) {
int ans = target - nums[i];
if(map.find(ans) != map.end()) {
... | ALGO | 0.99991 | 6.441386 |
1163032f-d3fa-4ca5-9aa3-494033d07295 | jeong011010/baekjoon | C++ 배우기 (51~100)/2576.cpp | #include<iostream>
using namespace std;
int main() {
int n,min=99,sum=0;
for (int i = 0; i < 7; i++) {
cin >> n;
if (n % 2 == 1) {
sum += n;
if (n < min)
min = n;
}
}
if (sum == 0)
cout << -1;
else
cout << sum << '\n' << min;
return 0;
} | ALGO | 0.999842 | 3.252059 |
9207baaa-de8d-4c19-aa86-c754907c6ac4 | yledoare/ydfs | wubi/src/7z/CPP/7zip/UI/Common/EnumDirItems.cpp | // EnumDirItems.cpp
#include "StdAfx.h"
#include "Common/StringConvert.h"
#include "Common/Wildcard.h"
#include "Common/MyCom.h"
#include "EnumDirItems.h"
using namespace NWindows;
using namespace NFile;
using namespace NName;
void AddDirFileInfo(
const UString &prefix, // prefix for logical path
co... | TOOL | 0.896051 | 6.495276 |
ef4ef5bb-1e15-4b1a-8553-fe1800a59511 | tianhaoo/leetcode_cpp | company_questions/banxin2.cpp | //
// Created by Tiana on 2022/10/24.
//
#include "../utils.h"
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <cli... | ALGO | 0.999612 | 3.622019 |
13873595-f931-418e-b741-70c1c2a45ff8 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/August/smallestKmp_20200809142826.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999974 | 4.108327 |
a36d33d1-5d71-48b5-8f1d-a5c10ce6a952 | Artgerto/INTUIT | Структуры и алгоритмы компьютерной обработки данных/L1/ConsoleApplication3.cpp |
#include "stdafx.h"
#include<locale.h>
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
double a,b,c,n,m,d;
cout << " d ax2 + bx + c = 0 mx + n = 0 ." << "\n";
cout << "a = "; cin >> a;
cout << "b = "; cin >> b;
cout << "c = "; cin >> c;
cout << "m = "; cin >> m;
... | ALGO | 0.998788 | 3.49999 |
b6f4e692-de3e-4c0b-802c-66d4e2737239 | XiaoxiZheng/Cel-Shading | src/libigl/libigl-master/tutorial/204_Gradient/main.cpp | #include <igl/avg_edge_length.h>
#include <igl/barycenter.h>
#include <igl/grad.h>
#include <igl/jet.h>
#include <igl/readDMAT.h>
#include <igl/readOFF.h>
#include <igl/viewer/Viewer.h>
#include <iostream>
#include "tutorial_shared_path.h"
int main(int argc, char *argv[])
{
using namespace Eigen;
using namespace ... | ALGO | 0.911181 | 5.877332 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.