uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d1223da5-fb06-4788-8234-dc0cc2e06750 | nkadekar/CS010B | Labs/5/main.cpp | //include any standard libraries needed
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
// - Passes in an array along with the size of the array.
// - Returns the mean of all values stored in the array.
double mean(const double array[], int arraySize);
// - Passes in an array, the si... | TOOL | 0.982958 | 5.697724 |
715b64da-775e-40a4-817c-661d23e8b3a6 | jatinnandal/Leetcode-Questions | Copy List with Random Pointer.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
Node* next;
Node* random;
Node(int _val) {
val = _val;
next = NULL;
random = NULL;
}
};
*/
class Solution {
unordered_map<Node*,Node*> mp;
public:
Node* copyRandomList(Node* head) {
if(head == NU... | ALGO | 0.999704 | 5.5228 |
9b1ddfdd-c80c-4cda-bdac-b03240a45305 | roadev/IPOO_Criptografia | Criptografia.cpp | /* Autor: Hecho por Juan David Roa Valencia y Jhonatan David Vanegas Arrieta
* Fecha de creación: 22/09/14
* Versión: 0.6
*
* Nombre del archivo: Criptografia.cpp
* Responsabilidad:
* Colaboración:
*/
#include "Criptografia.h"
#include <iostream>
using namespace std;
Criptografia::Criptografia()
{
numero=... | TOOL | 0.935295 | 3.683517 |
29b65cc0-2cba-4b4c-86b7-7b3f36397d01 | nos8160/PlayingWithCPlusPlus | practise/increment.cpp | #include<iostream>
using namespace std;
int main(){
int i = 0;
//int j = i++;
cout<<i++<<" " <<++i<<endl;
}
| ALGO | 0.998439 | 3.417601 |
0114a638-4552-4d3b-9f3a-ca40750ffe0d | ishandutta2007/codeforces | potassium/normal/612/A.cpp | #pragma GCC optimize ("O3", "unroll-loops")
// #pragma GCC target ("avx2")
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define disti... | ALGO | 0.999756 | 3.732845 |
2cfa3a08-1f1d-4b02-9ed1-1705d852b504 | Tiphereth-A/CP-lib | test/library-checker-polynomial/multipoint_evaluation.mintd-d31.poly_anymod-pmtt.test.cpp | #define AUTO_GENERATED
#define PROBLEM "https://judge.yosupo.jp/problem/multipoint_evaluation"
#include "../../include/io/fastin.hpp"
#include "../../include/io/fastout.hpp"
#include "../../include/poly/mpe_fps.hpp"
using namespace tifa_libs;
CEXP u32 MOD = 998244353;
#include "../../include/math/mint.hpp"
#include ... | ALGO | 0.998968 | 4.136015 |
8e6b3559-9641-47d5-9eb3-56ea0f0f3338 | Arup-Paul8509/MySirG_DSA_With_Cpp_Assignments | 10_Assignment_10_More_on_Stack/Polish Notation/Infix_to_Postfix.cpp | #include "Stack.cpp"
int checkPrecedence(char op)
{
if(op=='^')
return 3;
else if(op=='/' || op=='*')
return 2;
else if(op=='+' || op=='-')
return 1;
else
return -1;
}
string infixToPostfix(string Q)
{
string P;
Stack s(10);
s.push('(');
Q=Q+')';
// co... | ALGO | 0.99989 | 4.784182 |
51447e6d-31bc-4efe-9d30-d250c6235318 | cassiusxp/message-app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
6249cb7c-2b59-4174-8f17-daadca35b1fe | JacksoonHayes/PRJ703_robot | libraries/ESP32-CAM_PRJ703_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/logical_common.cpp | #include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/binary_function.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/op_macros.h"
#include "edge-impulse-sdk/tensorfl... | TOOL | 0.949485 | 7.605009 |
de27f013-75da-4722-a00c-653a0e919fdf | hirakuuuu/kyopro | library/geometry/凸包.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define rrep(i, a, n) for(int i = a; i >= n; i--)
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
// constexpr ll MOD = 1000000007;
constexpr ll MOD = 998244353;
constexpr int IINF = 1001001001;
conste... | ALGO | 0.999951 | 5.623798 |
27561694-03cc-4da5-be11-fbe0d59eab40 | Suhanip/August-Leetcoding-Challenge | day_01.cpp | /*PROBLEM STATEMENT:
Given a word, you need to judge whether the usage of capitals in it is right or not.
We define the usage of capitals in a word to be right when one of the following cases holds:
*All letters in this word are capitals, like "USA".
*All letters in this word are not capitals, like "leetcode"... | ALGO | 0.999934 | 6.048911 |
a7fab83a-1d30-4210-b2b4-1edd15d6d4d1 | judy5050/algorithmStudy | infrun_67.cpp | //
// infrun_67.cpp
// algo
//
// Created by 박효정 on 2021/04/14.
//
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int map[30][30],ch[30],n,cost=2147000000;
void dfs(int v,int sum){
int i;
if(v==n){
if(sum<cost) cost=sum;
}else{
for(i=1;i<=n;i++){
... | ALGO | 0.999813 | 4.083076 |
46b77b19-bfc1-47df-b91b-b6f0a891b3a6 | Brayzen403/UVa | 12015.cpp | //////////////////////////////////////////////////////////////////////
//
//Braden Harrelson : Google is Feeling Lucky : 12015 : Brayzen
//
//Data structure required : Vectors, String.
//
//Tricks of the trade :
//
/////////////////////////////////////////////////////////////////////
#include<iostream>
#include<string... | ALGO | 0.999335 | 4.296305 |
9d13ed28-b11a-438d-8ad8-2b1b5524cad5 | Sookmyung-Algos/2023algos | algos_assignment/이에나_njs07081/fall/week5/5670.cpp | const int INF = 2000000000;
using namespace std;
typedef long long int ll;
struct Trie {
Trie *node[SIZE];
int alpa_cnt;
bool is_finish, is_child;
Trie() {
fill(node, node + SIZE, nullptr);
alpa_cnt = 0; is_finish = is_child = false;
}
~Trie() {
for (int i = 0; i < SIZE; i++) {
if (node[i])
dele... | ALGO | 0.998616 | 4.468944 |
9004e456-f3de-4dfe-a472-e041724e6e52 | HarshitVerma1/Competitive_Coding_Study_Material | CSES-Problem-master/sas/cses-23.cpp | #include <iostream>
#define MAX(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#include <set>
using namespace std;
const long long int INF = 1e18;
int main()
{
#ifdef OFFLINE
freopen("input.txt","r",stdin);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,k;
cin >> n >> k;
in... | ALGO | 0.999996 | 4.210331 |
b003522d-7e8a-490b-8830-035c2f96c824 | zhouhuaman/dgt | 3rdparty/tvm/3rdparty/HalideIR/src/arithmetic/Interval.cpp | #include "Interval.h"
#include "ir/IROperator.h"
#include "ir/IREquality.h"
namespace HalideIR {
namespace Internal {
// This is called repeatedly by bounds inference and the solver to
// build large expressions, so we want to simplify eagerly to avoid
// monster expressions.
Expr Interval::make_max(Expr a, Expr b) {... | TOOL | 0.958048 | 7.439634 |
0549dbae-d58a-4057-90cf-7f0277410288 | nisargasle3012/DSA_CODES | 6_MERGE_SORT.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int merge(vector<int>&input, int s, int e)
{
int mid = (s+e)/2;
int len1 = mid - s + 1;
int len2 = e - mid;
vector<int>first(len1);
vector<int>second(len2);
int k = s;
for(int i = 0 ;i<len1; i++)
{
first[i] = in... | ALGO | 0.999897 | 4.005073 |
42176c66-b928-4710-8f7e-ad9d835cbcea | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10840_6.cpp | #include <bits/stdc++.h>
using namespace std;
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
return "(" + to_string(p.fi... | ALGO | 0.999955 | 3.829468 |
358055d3-5eeb-428a-aac9-5a54386196aa | The-No-Hands-company/RudeBase3D | third_party/libigl/libigl-2.5.0/tutorial/901_VectorFieldSmoothing/main.cpp | #include <igl/read_triangle_mesh.h>
#include <igl/parula.h>
#include <igl/remove_unreferenced.h>
#include <igl/opengl/glfw/Viewer.h>
#include <igl/per_face_normals.h>
#include <igl/orient_halfedges.h>
#include <igl/cr_vector_laplacian.h>
#include <igl/cr_vector_mass.h>
#include <igl/edge_midpoints.h>
#include <igl/edge... | ALGO | 0.984657 | 6.594921 |
58b0600f-16dc-436f-b28d-48e9b622c3a9 | tehrengruber/reactive-transport-cuda | ext/magma-2.5.0/src/zgetrf_m.cpp | /*
-- MAGMA (version 2.5.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date January 2019
@precisions normal z -> s d c
*/
#include <cuda_runtime.h>
#include "magma_internal.h"
#include "magma_timer.h"
//#include "../testing/flops.... | ALGO | 0.998661 | 5.800284 |
e9f7a717-d6ee-4826-b015-08fb0e532096 | davidfvaquero/mood_tracker | 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 |
666a5e64-9ea2-4674-b792-a23d5a36b5ed | ishandutta2007/codeforces | turmax/normal/1444/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
vector <int> rasl(int x)
{
vector <int> v;
if(x==1) return v;
for(int i=2;i*i<=x;++i)
{
if(x%i==0)
{
v=rasl(x/i);
v.push_back(i);
return v;
}
}
v.push_back(x);
ret... | ALGO | 0.999982 | 4.778353 |
24a8b51a-168b-4e42-a5b4-4f1aa2d1e277 | kondratenkoMary/MyKitty | First course/Sharov/Osnovy/Ci/quest25/20/main.cpp | #include <iostream>
#include "rus_io.h"
#include "conio2.h"
using namespace std;
int main()
{
setRusLocale(); //
textcolor(WHITE); // -
int n,i,k=1,a,ma;
cout << "\n n ";cin>>n;
cout << "\n ";cin>>a;
ma=a;
for (i=2;i<=n;i++)
{
cout<<"\n ";cin>>a;
if (a>ma)
{... | ALGO | 0.998859 | 3.203188 |
f65dd8e4-d2ca-4808-ad29-28ec5767261d | Mohula-Prasath/DSA | LAB-10/duplicate.cpp | //This program is used to display the max number of elements in the array such that all elements are distinct
#include <cstdio>
class duplicate{
private:
int count=0;
public:
int remove(int array[],int size);
void display(int array[],int size);
};
int main(){
duplicate d1;
int t... | ALGO | 0.99976 | 4.268635 |
2966447b-ba1c-4227-89a1-7d6e34c4268d | sarvex/leetcode-clojure | solution/1700-1799/1798.Maximum Number of Consecutive Values You Can Make/Solution.cpp | class Solution {
public:
int getMaximumConsecutive(vector<int>& coins) {
sort(coins.begin(), coins.end());
int ans = 1;
for (int& v : coins) {
if (v > ans) break;
ans += v;
}
return ans;
}
}; | ALGO | 0.999976 | 5.689985 |
22196551-75b5-4f16-94fc-82a1275e06d1 | chapuni/llvm-project-legacy | libcxx/test/std/numerics/rand/rand.predef/knuth_b.pass.cpp | // <random>
// typedef shuffle_order_engine<minstd_rand0, 256> knuth_b;
#include <random>
#include <cassert>
int main()
{
std::knuth_b e;
e.discard(9999);
assert(e() == 1112339016u);
}
| ALGO | 0.948716 | 4.460696 |
6ebebfe6-5b5f-47af-8720-13da48185a40 | koosaga/olympiad | ICPC/Japan/jagautumn13_c.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, k, v, t;
int a[17], b[17];
int adj[305][305];
int dp[16][1<<16];
int f(int pos, int msk){
if(msk == 0) return adj[a[pos]][v];
if(~dp[pos][msk]) return dp[pos][msk];
int ret = 1e9;
for(int i=0; i<k; i++){
if((msk >> i) & 1){
ret = min(ret, adj[a[pos]][a[... | ALGO | 0.999824 | 4.186612 |
2f9f4cad-dd0c-40c6-b94e-cb94b0c1c9b7 | kevintamakuwala/Algorithms | Dp/NthTribonacciNumber.cpp | /*
Problem Link: https://leetcode.com/problems/n-th-tribonacci-number/
The Tribonacci sequence Tn is defined as follows:
T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >= 0.
Given n, return the value of Tn.
*/
#include <bits/stdc++.h>
using namespace std;
vector<int> dp(38, -1);
class Solu... | ALGO | 0.999983 | 6.426607 |
d49388ed-8528-4821-971f-756a89254c8a | vijay-pankaj/Leet_Code_Problem_Solving | 415-add-strings/add-strings.cpp | class Solution {
public:
string addStrings(string num1, string num2) {
string str="";
int carry=0;
int i=num1.length()-1,j=num2.length()-1;
while(i>=0||j>=0||carry){
int digit1 = (i>=0)?num1[i--]-'0':0;
int digit2 = (j>=0)?num2[j--]-'0':0;
int sum=... | ALGO | 0.999916 | 6.734571 |
966eba36-0cc3-4eda-9e2c-8027389485ce | uday18git/DSA | c++/10.5 binary search/intermediate/bs7.cpp | // peak element
// we have to give index of peak element
// peak element means it should be greater than both its neighbours
// only one enough
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> nums = {5, 10, 20, 30, 10};
int low = 0;
int high = nums.size() - 1;
int n = nums.size() ... | ALGO | 0.999966 | 5.223194 |
2bbe2c4e-c890-48a6-957d-3bcb0878569f | bartuakyurek/Coulomb_Energy_Minimizer | Coulomb-Energy-Minimizer/include/igl/marching_tets.cpp | #include "marching_tets.h"
#include <unordered_map>
#include <vector>
#include <utility>
#include <cstdint>
#include <iostream>
template <typename DerivedTV,
typename DerivedTT,
typename DerivedS,
typename DerivedSV,
typename DerivedSF,
typename DerivedJ,
ty... | ALGO | 0.999442 | 6.21566 |
2b91e2f3-343c-4ef0-bf88-61e3dca790a0 | warikand/warikan | tests/Difficulty/Difficulty.cpp | #include <cstddef>
#include <cstdint>
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include "CryptoNoteConfig.h"
#include "CryptoNoteCore/Difficulty.h"
#include "CryptoNoteCore/Currency.h"
#include "Logging/ConsoleLogger.h"
using namespace std;
int main(int argc, char *argv[]) {
... | TOOL | 0.900329 | 5.38595 |
33b65064-1163-4e5e-97e4-c8185ba9b123 | Aznad-Maruf/CPP | CPP Functions/Others/Separating_strings_with_istringstream.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string st;
getline(cin,st);
istringstream is(st);
while(is>>st){
cout<<st<<endl;
}
}
| ALGO | 0.912906 | 3.113284 |
7adedd0f-e92a-41ea-9f23-471ca72454ac | 3AceShowHand/algorithms-cpp | array/rotateArrayMin.cpp | //
// Created by Edison King on 2020/2/23.
//
#include <vector>
#include <iostream>
using namespace std;
int minArray(const vector<int>& nums) {
int lo = 0, hi = nums.size() - 1;
while (lo < hi) {
int mid = lo + (hi - lo) / 2;
if (nums[mid] > nums[hi]) {
lo = mid + 1;
} el... | ALGO | 0.999972 | 5.730827 |
c96250b2-61ab-4fb3-a06f-7e9bdca59669 | lucasxia01/Competitive-Programming-Problems | Codeforces/Global Round 9/Global Round 9/C.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stdlib.h>
#include <time.h>
#include <complex>
#include <iterator>
#include <regex>
#include <fstream>
#include <utility>
#include <vector>
#include <string>
#include <cstring>
#include <stack>... | ALGO | 0.999826 | 4.61125 |
81106d2b-e843-4655-9abe-37f64f7367be | Monstrofil/bigworld-2.0 | lib/math/ema.cpp | #include "pch.hpp"
#include "ema.hpp"
#include <math.h>
/**
* This method calculates a bias required to give the most recent samples the
* desired weighting.
*
* For example, if numSamples is 60 and weighting is 0.95, using the resulting
* bias in an EMA means that the latest 60 samples account for 95% of the
... | ALGO | 0.974479 | 6.125948 |
bc41cdce-626c-4d65-8872-86fdcb2e90ae | ahmadsheikhveisi/CodingProblems | Codility/Task13-Ladder/solution.cpp | // OVERFLOW SOLUTION
/*******************************************************************/
// you can use includes, for example:
#include <algorithm>
// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;
vector<int> solution(vector<int> &A, vector<int> &B) {
// writ... | ALGO | 0.99999 | 5.080643 |
6fc3032a-5e51-42e0-9f65-e83671945e72 | boennecd/mixprobit | src/qmc.cpp | #include "sobol.h"
#include "qmc.h"
#include <Rmath.h>
#include "arma-wrap.h"
#include "welfords.h"
#include <array>
#include "qnorm.h"
namespace qmc {
qmc_approx_output approx(
base_integrand const &func, bool const is_adaptive, size_t const n_max,
arma::ivec const &seeds, double const releps){
/* checks */... | ALGO | 0.999848 | 6.30569 |
e6718638-dd1c-4939-8090-0cdb71618325 | BoldBigflank/arctic-fling | modev/libs/cocos2dx/platform/tizen/CCImage.cpp | #include <string.h>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <fontconfig/fontconfig.h>
#include "platform/CCFileUtils.h"
#include "platform/CCPlatformMacros.h"
#define __CC_PLATFORM_IMAGE_CPP__
#include "platform/CCImageCommon_cpp.h"
#include "platform/CCImage.h"
#include "... | TOOL | 0.919551 | 5.198707 |
9ad28cdf-d47b-4d18-99c8-1bc09db3700d | hugary1995/FragCount | eigen/bench/sparse_lu.cpp |
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out
#define EIGEN_SUPERLU_SUPPORT
#define EIGEN_UMFPACK_SUPPORT
#include <Eigen/Sparse>
#define NOGMM
#define NOMTL
#ifndef SIZE
#define SIZE 10
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifnd... | ALGO | 0.996355 | 4.187482 |
ac42cb37-83c7-49cc-9134-a2c08a28704c | anshgandhiii/videoAppTest | testing/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.998096 | 6.76775 |
0a4b1517-3e4e-4e6d-9708-a72ee9a6c9ee | sashedher/codec | Interview_bit/Arrays/Max_contigious_subArray.cpp | // https://www.interviewbit.com/problems/max-sum-contiguous-subarray/
#include<iostream>
#include<string.h>
#include<bits/stdc++.h>
using namespace std;
int maxSubArray(const vector<int>& A) {
int n=A.size();
int maxsum=INT_MIN;
int currsum=0;
for(int i=0;i<n;i++){
currsum=currsum+A[i];
... | ALGO | 0.999885 | 4.925957 |
8f165427-fa77-43be-aafd-ffbe65ec6554 | EluvK/PTA | AdvanceLevel _C++/1004 Counting Leaves (30).cpp | #include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
vector<int> kid[110];
int res[110],mx=0;
void dfs(int s,int lv){
if(kid[s].empty()){
res[lv]++;
mx=max(mx,lv);
}else{
for(int i=0;i<kid[s].size();i++)
dfs(kid[s][i],lv+1);
}
}
int main(){
// ... | ALGO | 0.999914 | 3.711448 |
a267112f-ed60-48fa-a2d3-fae7b447e63c | AST-TheCoder/CP-Solutions | CodeForces/GNU C++17/1407D | Discrete Centrifugal Jumps/92378089.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define Max 10000000000000000
template <typename T>
using ordered_... | ALGO | 0.999898 | 3.333574 |
99a0713c-5a24-42e9-9eb2-d3a6d82a2ae8 | narayandabu/My-Cpp-Code | My_POTD/diiferenceofsum.cpp | #include <bits/stdc++.h>
#define el endl;
using namespace std;
int differenceOfSum(vector<int>& nums){
int size=nums.size();
int digitsum{0};
int sum{0};
for (int i = 0; i < size; i++){
int temp=nums[i];
sum+=nums[i];
digitsum+=nums[i]%10;
... | ALGO | 0.99978 | 5.718275 |
6257e92a-6654-4c9a-a33e-92dbfd2dc523 | Shahbaz898414/Code_Cheff | Pratice/Chef and Mover.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define Time cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
#define pb push_back
#define mp make_pair
#define line cout << endl;
#define ff first
#define ss second
#define vi vector<int>
#define no ... | ALGO | 0.999488 | 3.987791 |
08303970-7760-45bb-82a6-cf6bbe35f780 | OmaerAlam/Number-Theory | numbertheory_2.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int const mx=1e5+123;
vector<int>divisors[mx];
int main(){
optimize();
int lim=10;
for(int i=1;i<=lim;i++){
for(int j=i;j<=lim;j+=i){
divisors[j].pus... | ALGO | 0.997539 | 3.821419 |
f140b566-dd50-41b2-82f6-3b570d8c3cc9 | gkaindl/Community-mdnsResponder | mdns-patched/mDNSWindows/DLLX/DNSSD.cpp | // DNSSD.cpp : Implementation of CDNSSD
#include "stdafx.h"
#include "DNSSD.h"
#include "DNSSDService.h"
#include "TXTRecord.h"
#include <dns_sd.h>
#include <CommonServices.h>
#include <DebugServices.h>
#include "StringServices.h"
// CDNSSD
STDMETHODIMP CDNSSD::Browse(DNSSDFlags flags, ULONG ifIndex, BSTR regtype, B... | TOOL | 0.902552 | 6.017622 |
6307bb09-ddb7-4382-951a-001d93afd3ab | BanSheeGun/Learning | Algorithm/Homework/3/B.cpp | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
int a[30], b[30];
int i, t;
int main() {
a[0] = 1;
b[0] = 0;
scanf("%d", &t);
for (i = 1; i <= t; ++i) {
a[i] = b[i-1] + a[i-1];
b... | ALGO | 0.999677 | 3.295598 |
eab3d864-90e7-4d75-ae9b-053ff9e127ba | qzysw123456/ACM_ICPC_Template | jag2015/solutions-001461/a.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*---------------*/
/* Parenthesis 4 */
/* Darsein AC */
/*---------------*/
#include<iostream>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef ... | ALGO | 0.999845 | 3.889242 |
13e5020b-abfd-4c7e-9762-59d803b8f68c | architg-5501/Competitive-Programming | CSES/implementation/1931C.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve(vector<ll>&vec){
ll n = vec.size();
ll i = 0;
ll j = 0;
ll start = 0;
ll end = 0;
ll cnt = 1;
while(j<n){
while(i<j && vec[i]!=vec[j]){
i++;
}
if(j-i+1 >cnt){
cnt = j-i+1;
end = j;
start = i;
}
j++;
}
cout<<"... | ALGO | 0.999898 | 4.132723 |
8430dd27-f181-4b1b-81ea-840c48b36324 | palilo815/ps | baekjoon/20000/20003.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("in", "r", stdin);
freopen("out", "w", stdout);
#endif
ll N, x, y;
cin >> N >> x >> y;
ll tmp = gcd(x, y);
x /= tmp, y /= tmp;
for (ll ... | ALGO | 0.999983 | 4.575119 |
79a02328-07cf-4353-bf95-7e853325cd76 | mihabor2002/EVM | k_sredn_yadr.cpp | #include "k_sredn_yadr.h"
//211-Borovikov-Mikhail-2021
void k_sredn_yadr::funk(Field* ThisField, int k, int p)
{
std::vector <Point> centr;
for (int i = 0; i < k; i++)
{
centr.push_back((*ThisField).Pointarr[i * ((*ThisField).numb_Point / k)]);
}
for (int i = 0; i < (*ThisField).numb_Point; ... | ALGO | 0.999531 | 3.094519 |
89615e69-78dd-49b8-b2c0-5c423b15029a | jaanvi02/Placement_Preparation_Module | PascalTriangle.cpp.cpp | #include <bits/stdc++.h>
using namespace std;
// pascal's triangle
vector<vector<int>> generate(int n) {
vector<vector<int>>r(n);
for(int i=0;i<n;i++){
r[i].resize(i+1);
r[i][0]=r[i][i]=1;
for(int j=1;j<i;j++){
r[i][j]=r[i-1][j-1]+r[i-1][j];
... | ALGO | 0.999954 | 3.822137 |
71795575-9116-4a1d-980c-35802f4586f9 | lancelote/stepic_programming_intro_cplusplus | src/module1/digits_sum/digits_sum.cpp | /**
* Сумма цифр трехзначного числа
*
* Дано целое трехзначное число. Найдите сумму его цифр.
*
* Формат входных данных
* На вход дается число от 100 до 999.
*
* Формат выходных данных
* Выведите одно целое число - ответ на задачу.
*/
#include <iostream>
using namespace std;
int main() {
int nu... | ALGO | 0.999477 | 5.771787 |
26079eb1-3685-46c9-aaac-e50abe08111e | tsgao/CyPlanner | libs/qwt/qwt_compass_rose.cpp | #include <math.h>
#include <qpainter.h>
#include "qwt_math.h"
#include "qwt_painter.h"
#include "qwt_compass_rose.h"
static QPoint cutPoint(QPoint p11, QPoint p12, QPoint p21, QPoint p22)
{
double dx1 = p12.x() - p11.x();
double dy1 = p12.y() - p11.y();
double dx2 = p22.x() - p21.x();
double dy2 = p22.... | TOOL | 0.943791 | 6.268599 |
41dc429a-2ad3-4968-81a7-621ecc947be9 | WayneWei228/Algorithm | Category/Topo/001.cpp | #include <cstdio>
#include <unordered_map>
#include <vector>
#include <string>
using namespace std;
char Buffer[80];
struct Solution {
int N;
vector<vector<int>> Out;
unordered_map<string, int> mtn;
vector<int> Visited;
int MapToNumber(const string& s) {
return mtn.emplace(s, mtn.size()).... | ALGO | 0.996905 | 4.827254 |
fd3c1c8d-cd80-4fdc-b63a-23f7e53b5c38 | Amylo-jh/baekjoon | Temp_Contest/1464-1.cpp | #include <iostream>
using namespace std;
int main()
{
int h_lo, h_hi, s_lo, s_hi, v_lo, v_hi;
int r, g, b;
cin >> h_lo >> h_hi >> s_lo >> s_hi >> v_lo >> v_hi;
cin >> r >> g >> b;
double h, s, v;
v = max({r, g, b});
s = 255 * (v - min({r, g, b})) / v;
if(v == r)
{
h =... | ALGO | 0.994805 | 4.074834 |
c550b1d1-b434-45aa-add6-b7c9402840ec | ishandutta2007/codeforces | yuukakazami/normal/809/A.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef double db;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define mp make_pair
#define fi first
#define se second
#define per(i,a,n) for (int i=int(n)-1;i>=(a);i--)
#define pb push_back
using namespace std;
const int md = int(1e9) + 7;
ll mypow(ll a,ll e){
if(e==0) retu... | ALGO | 0.999992 | 3.913122 |
dc9c4ef6-0c34-4e03-8245-798d98dec47e | LroseC/OI | Luogu/P4383/std.cpp | // luogu-judger-enable-o2
#include<cstdio>
#include<algorithm>
using namespace std;const int N=3*1e5+10;typedef long long ll;
int v[2*N];int x[2*N];int ct;int al[N];ll val[2*N];bool book[N];int n;int k;
inline void add(int u,int V,ll va){v[++ct]=V;x[ct]=al[u];al[u]=ct;val[ct]=va;}
struct data//dp的结构体
{
ll v;int k;... | ALGO | 0.999984 | 4.03841 |
480132ec-0338-4e76-932a-b63c4b8fd665 | philomathtanya/Data-Structrue-and-Algorithm | first and last element index.cpp | class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
int s=-1,e=-1;
vector<int>p;
for(int i=0;i<nums.size();i++)
{
if(nums[i]==target)
{
e=i;
}
if(s==-1)
{
... | ALGO | 0.999934 | 6.567178 |
6f369f31-ae91-4d03-8a3f-61daefe381c7 | samkitshah1262/CMCP | BS/adda.cpp | #include <bits/stdc++.h>
using namespace std;
struct node{
int data;
node*l;
node*r;
};
node* create(int val){
node*nn=new node();
nn->data=val;
nn->l=nn->r=NULL;
//cout<<"s"<<' ';
return nn;
}
node* insert(node* root, int val){
if((root)==NULL){
return create(val);
}... | ALGO | 0.999956 | 4.122984 |
b5952950-280d-4b69-9f2e-2f3a874729a3 | Davjot/DSA-Practice | LeetCode/49_Group_Anagrams.cpp | class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
unordered_map <string, vector<string>> mp;
for(auto x : strs){
string word = x;
sort(word.begin(), word.end());
mp[word].push_back(x);
}
vector <vector<string>>... | ALGO | 0.999997 | 6.48256 |
c9498769-7036-4b1c-b195-16ed04182ca6 | junkoda/mock_zeldovich | mock/lpt.cpp | //
// Lagrangian Perturbation Theory
//
// Generates random Gaussian pertubation using 2LPT
//
#include <iostream>
#include <cmath>
#include <cassert>
#include <gsl/gsl_rng.h>
#include "comm.h"
#include "msg.h"
#include "mem.h"
#include "config.h"
#include "cosmology.h"
#include "power.h"
#include "particle.h"
#inclu... | ALGO | 0.992603 | 4.51786 |
c45240cd-caea-419e-9f62-ed48469878d6 | TheKaushikGoswami/College-Work | Semester 4/CPP - DSA/Practical/04.cpp | // Valid Anagram
#include <bits/stdc++.h>
using namespace std;
bool isValidAnagram(string s, string t){
if (s.length() != t.length()){
return false;
}
map<char, int> m1;
map<char, int> m2;
for(auto i : s){
m1[i]++;
}
for(auto j : t){
m2[j]++;
}
return m1... | ALGO | 0.999996 | 5.660703 |
2cf0e6f6-7ac6-44ef-bd40-e70ea153e931 | TaghridTahani/DSA_with_C- | Dynamic Array/input_take.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int>v(n);
for(int i=0; i<n; i++)
{
cin>>v[i];
}
for(int i:v)
{
cout<<i<<" ";
}
/*
int n;
cin>>n;
vector<int>v;
for(int i=0; i<n; i++)
{
int x;
... | ALGO | 0.997883 | 3.676316 |
c0e77690-8477-4dff-8cac-9227ddd96024 | YiyanWang/algorithm-notebook | leetcode/0201-0250/236. Lowest Common Ancestor of a Binary Tree/depth_first_search_iteratively.cpp | #include <stack>
using namespace std;
// https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/
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(... | ALGO | 0.999988 | 6.407699 |
7b57626f-db3d-4ddb-a8f9-958abfcfece8 | kamalsubedicoder/Cpp-codes | Template fnmain.cpp | #include <iostream>
using namespace std;
template<class T, class S>
T fun(T a, S b)
{
if (a>b)
return a,b;
else
return b;
}
int main()
{
cout<<fun(4,4)<<endl;
cout<<fun(5,9)<<endl;
cout<<fun('z', 'a')<<endl;
cout<<fun(5.223,6.14252)<<endl;
return 0;
}
| ALGO | 0.989131 | 4.063673 |
81a3727e-02fb-4038-85d7-605baaa71b2c | CuuvuivevaSoixam/code | CodePTIT - CPP/CP01006.cpp | // https://code.ptit.edu.vn/student/question/CP01006
// DÃY CON LIÊN TIẾP
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
void TestCase()
{
int n;
cin >> n;
long long a[n];
long long maxx = -1e9;
for (int i = 0; i < n; ++i)
{
cin >> a[i];
maxx = max(maxx, a[i]);... | ALGO | 0.999802 | 4.841333 |
3bae0631-280f-4707-ab74-d0db19378cff | ProtonAOSP-lavender/android_frameworks_av | media/codecs/mp3dec/src/pvmp3_getbits.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_getbits.cpp
Date: 09/21/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
------------------------... | ALGO | 0.9938 | 6.069658 |
c91efabe-a9a2-4e0b-a11c-eae1e967bf3f | Bhagatsakshi/Swapping_methods | using_array&class.cpp | #include <iostream>
using namespace std;
class swapping{
private:
int a;
public:
swapping(int a) {
this->a= a;
}
void swap(swapping &obj) {
int temp[1];
temp[0] = this->a;
this->a= obj.a;
obj.a = temp[0];
}
void print() {
cout << "a = " << a << endl;
}
};
int main() {
swapping ob... | ALGO | 0.984296 | 4.590917 |
eaf62a90-a95e-4650-95f9-bb9b8f2740d6 | serghei/kde3-kdelibs | kjs/lookup.cpp | // -*- c-basic-offset: 2 -*-
#include <stdio.h>
#include <string.h>
#include "lookup.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
using namespace KJS;
static bool keysMatch(const UChar *c, unsigned len, const char *s)
{
for(unsigned i = 0; i != len; i++, c++, s++)
if(c->uc != (unsigned char)*s)
... | TOOL | 0.870118 | 5.927123 |
6eb6c538-b06b-42b4-86a5-2d7a14e86e09 | ml1150258/CSC_CIS_5 | Lab/Work022224/LabGasOptimizationSolution_Step3/main.cpp | /*
* File: main.cpp
* Author: Dr. Mark E. Lehr
* Created on Feb 20th, 2024, 12:06 PM
* Purpose: Lab Gas Optimization Solution
*/
//System Libraries
#include <iostream> //Input-Ouput Library
using namespace std;
//User Libraries
//Global Constants - Math,Physics,Chemistry,Conversions
const char PERCENT=100;... | ALGO | 0.986855 | 4.275763 |
72ae7c0c-0718-443d-a73f-1ea6fd0d9f85 | houtaru/code | VNOI Training/Hải Dương/2017.10.24/Code/METRO.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, m;
int depth[N], root[22][N];
vector <int> adj[N];
void load() {
scanf("%d%d", &n, &m);
for (int i = 1; i < n; ++i) {
int u, v; scanf("%d%d", &u, &v);
adj[u].push_back(v);
adj[v].push_back(u);
}
}
void d... | ALGO | 0.999997 | 4.777725 |
ee4a852b-79e3-459e-a2e5-a6ca0365316b | DetegiCE/baekjoon-ps | 24000s/24061.cpp | #include<bits/stdc++.h>
using namespace std;
int n, k;
int a[500005];
int tmp[500005];
int cnt;
void merge(int p, int q, int r) {
int i = p;
int j = q+1;
int t = 1;
while(i <= q && j <= r) {
if(a[i] <= a[j]) {
tmp[t++] = a[i++];
}
else {
tmp[t++] = a[j++... | ALGO | 0.999998 | 3.811557 |
9b4996c1-b0ae-45d0-8a8d-268219dd8dd4 | Feroz455/DATA-STRUCTURE-By-Seymour-Lipschutz | Tree/Tree.cpp | #include <iostream>
#include <ctime>
#include <queue>
using namespace std;
struct TreeNode
{
int DATA;
TreeNode *lchild, *rchild;
};
TreeNode *NewNode(int DATA)
{
TreeNode *node = new TreeNode;
node->DATA = DATA;
node->lchild = node->rchild = nullptr;
return node;
}
void INSERT(TreeNode **root, ... | ALGO | 0.999988 | 3.91607 |
3028b813-c290-473d-9e7d-60bf3db4ab6f | yanlifeng/DailyExercise | DOJ451.cpp | #include <cstdio>
#include <iostream>
#define maxn 200010
using namespace std;
int n,m,num,head[maxn],val[maxn],dep[maxn];
int fa[maxn][30],sm[maxn][30];
struct edge{
int pre,v;
}e[maxn*2];
void addEdge(int u,int v){
num++;
e[num].v=v;
e[num].pre=head[u];
head[u]=num;
}
void Dfs(int now,int from,int... | ALGO | 0.999994 | 4.569341 |
472e731d-97a8-4064-99a7-18e96ddd6141 | zhupailiangx/opencv4.8 | 3rdparty/carotene/src/median_filter.cpp | #include "common.hpp"
/*
* The code here is based on the code in
* <http://ndevilla.free.fr/median/median/src/optmed.c>, which is in public domain.
* See also <http://ndevilla.free.fr/median/median/index.html>.
*/
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
uint8x16_t getLeftReplicate(uint8x16_... | ALGO | 0.9991 | 6.723718 |
0a661cc2-d873-4db6-b233-46d5a57160a8 | rds1983/SealangSharp | 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.869421 | 6.995798 |
6d3514f4-daf9-4c2b-9247-25010e122994 | duttaANI/AL_Lab | Interview Bit/Backtracking/Combination Sum II.cpp | // My
int n;
unordered_map<string,int> mp;
void solve(int s, int cur_sum, int B, vector<int> temp, vector< vector<int> >& ans, const vector<int>& A){
// cout << cur_sum << " cur_sum \n";
if( cur_sum == B ){
string str = "";
for(int i=0;i<temp.size();++i){
str += to_string(temp... | ALGO | 0.99994 | 4.970077 |
93f5ea03-5c77-4eb1-bb32-443f62e665ad | Shankaracharya86/Basic | printday.cpp | #include <iostream>
using namespace std;
int main()
{
int day;
cout<<"Enter day:";
cin>>day;
if(day==1){
cout<<"Sunday"<<endl;
}
else if(day==2){
cout<<"Monday";
}
else if(day==3){
cout<<"Tuesday";
}
else if(day==4){
cout<<"Wednesday";
}
el... | ALGO | 0.999081 | 3.319639 |
d314a6c3-e9e7-4878-9393-90502cc9a9e8 | FarmerJohnLYH/shareOI | JZOJ/2019.1.28/5839.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#define oo 2139062143
#define fo(i,x,y) for (ll i=(x);i<=(y);++i)
using namespace std;
typedef long long ll;
const int N=10001000,M=22,mo=1000000007;
int n,m;
int u[M],v[M];
int f[N],du[N],qu[M*2],sz[N];
int ge[N],g0,q0;
ll ans,jc[N];
ll qsm(ll x,ll y)
{
ll rt=1... | ALGO | 0.999935 | 4.019004 |
6d62ea06-e3ff-4bf8-857b-408761e61c00 | black-shadows/LeetCode-Topicwise-Solutions | C++/put-boxes-into-the-warehouse-ii.cpp | // Time: O(nlogn)
// Space: O(1)
class Solution {
public:
int maxBoxesInWarehouse(vector<int>& boxes, vector<int>& warehouse) {
sort(rbegin(boxes), rend(boxes));
int left = 0, right = size(warehouse) - 1;
for (const auto& h : boxes) {
if (h <= warehouse[left]) {
... | ALGO | 0.999979 | 6.096276 |
e8d712b4-c382-426c-b272-9bb5be36ceb6 | sarvex/leetcode-lisp | solution/1800-1899/1827.Minimum Operations to Make the Array Increasing/Solution.cpp | class Solution {
public:
int minOperations(vector<int>& nums) {
int ans = 0, mx = 0;
for (int& v : nums) {
ans += max(0, mx + 1 - v);
mx = max(mx + 1, v);
}
return ans;
}
}; | ALGO | 0.999989 | 6.196163 |
7db02f48-9f9f-43c4-a4fc-6bdd1bf4a3c3 | AhnafTChowdhury/problemSolving | CF/rccwupc.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
if(n-k-1<k) cout<<-1<<endl;
else
{
int t;
cout<<n*k<<endl;
for(int i=1;i<=n;i++)
{
for(int j=1; j <= k;j++)
{
t = i + j;
if(t>n) t -= ... | ALGO | 0.999872 | 3.58392 |
e477264b-e41f-4da2-a262-e31435660c66 | phanakata/programmable-matter | phase-transitions/analysis/Get_f_relToNeighbour/puckers/analyze.cpp | #include <stdio.h>
#include <math.h>
#include <stdarg.h>
#include <stdlib.h>
#include "stdint.h"
#include "variables.h"
#include "analyze.h"
/* Average spin */
double avg_spins()
{
double slider_pos=0, min=1000, max=-1000, xx=0;
double total_spins=0;
double spin;
int cnt_spins=0;
int pbc, edgex=spx-2, ... | ALGO | 0.998852 | 4.4289 |
8914fc15-0180-4e01-b1a7-1f6d562aa109 | GTeplov/teplov_g_k | 0935b.cpp | #include <iostream>
int main() {
int n = 0;
std::string path = "";
int x = 0;
int y = 0;
int c = 0;
int prev = 0; // previous kingdom flag
int now = 0; // current kingdom flag
std::cin >> n;
std::cin >> path;
for (int i = 0; i < n; i++) {
if (path[i] == 'U')
... | ALGO | 0.999883 | 4.387441 |
48c06695-288d-4ac3-ba52-cd00b0c5fc86 | alex4825/Work_Tasks | Задача 1/Brackets/Brackets/Brackets.cpp | #include <iostream>
int main() {
while (true) {
std::cout << "\nEnter an arithmetic expression:\n";
std::string str;
std::cin >> str;
int uncorrect = 0, find = 0;
for (int i = 0; i < str.length(); i++) {
//т.к. начальной всегда является скобка '(', то поиск и отсчёт начинаем с неё
if (str[i] == '(') ... | ALGO | 0.996621 | 4.187408 |
8b7037b3-61ff-444e-8b14-909fa15fed98 | cikadev/competitive-programming | archive/URIOnlineJudge/1074.cpp | #include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
while (N--)
{
long int X;
cin >> X;
if (X < 0 && X % 2 == 0)
cout << "EVEN NEGATIVE\n";
else if (X > 0 && X % 2 == 0)
cout << "EVEN POSITIVE\n";
else if (X < 0 && X % 2 != 0)
cout << "ODD NEGATIVE\n";
else if (X > 0 && X %... | ALGO | 0.998504 | 4.14889 |
b26d6b0a-2af5-4f58-9b56-3fd49a99144e | AyoubElleuch/Competitive-Programming-Solutions | CCC '11 J5 - Unfriend.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()
#define fi first
#define se second
#define inf 1000000000
#define NIL -1;
#define sz(x) (ll)x.size()
#define boost() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
t... | ALGO | 0.999771 | 3.495353 |
3b54ce6a-d9ff-491b-878d-1a70bd771585 | hagish/love-native-android | jni/love/src/modules/physics/box2d/Source/Dynamics/Contacts/b2PolyAndCircleContact.cpp | #include "b2PolyAndCircleContact.h"
#include "../b2Body.h"
#include "../b2WorldCallbacks.h"
#include "../../Common/b2BlockAllocator.h"
#include <new>
#include <string.h>
b2Contact* b2PolyAndCircleContact::Create(b2Shape* shape1, b2Shape* shape2, b2BlockAllocator* allocator)
{
void* mem = allocator->Allocate(sizeof(b... | ALGO | 0.99331 | 7.618815 |
67b6663d-20d8-48ad-94a8-36f5b77c831d | leedohun/Softeer | 스마트 물류.cpp | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int N, K;
string map;
bool visit[20005] = {0,};
int ans = 0;
int main(int argc, char** argv) {
cin >> N >> K;
cin >> map;
for(int i = 0; i < N; i++){
if(map[i] == 'P'){
int j... | ALGO | 0.999454 | 3.753638 |
e603cd64-f7b2-4856-b20b-ba8f11470198 | andre-wojtowicz/tsql-checker | antlr-src/atn/LL1Analyzer.cpp | #include "atn/RuleStopState.h"
#include "atn/Transition.h"
#include "atn/RuleTransition.h"
#include "atn/SingletonPredictionContext.h"
#include "atn/AbstractPredicateTransition.h"
#include "atn/WildcardTransition.h"
#include "atn/NotSetTransition.h"
#include "misc/IntervalSet.h"
#include "atn/ATNConfig.h"
#include "atn... | ALGO | 0.990236 | 5.332627 |
0d4b2ace-91d1-4b2a-96d5-33b56a0517eb | felipethome/coding-interview-solutions | src/cpp/bst-successor/bst.cpp | /*
* Given a BST and a value V, find the successor of this value. Don't use
* recursion.
*
* Time complexity: O(logN), where N is the number of nodes.
*
* Explanation: use two BST nodes, one to traverse the tree and another one to
* keep the successor. If the node you are current in has a value larger than
* th... | ALGO | 0.999992 | 6.013433 |
ebff5c29-2f59-43ca-a8cf-226e84f7d4c1 | KailashKumar28/CP | codeforces/805 div 3/B.cpp | #include <bits/stdc++.h>
using namespace std;
/* int countdistinctchar(string s){
unordered_set<char> m;
for (int i=0; i< s.length(); i++){
m.insert(s[i]);
}
return m.size();
} */
int threeletter(string s){
int count = 0;
int i = 0;
while(i<(s.size()-1)){
for (int j= i+1; j... | ALGO | 0.999937 | 5.076428 |
8d8f21b4-0e44-4c37-93c5-358be40ed130 | intwocave/algorithm_training | BOJ/1753_.cpp | /*
* BOJ 1753
*/
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <limits>
using namespace std;
int main(void) {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// 1 ≤ V ≤ 20,000, 1 ≤ E ≤ 300,000
int V, E, K; cin >> V >> E >> K;
// adjacent no... | ALGO | 0.999969 | 4.709775 |
581d886a-8223-4d62-9e39-6c97df97f5d5 | jeremyburgesstm/physicsinvaders | ExternalLibs/Eigen/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp | MatrixXd A = MatrixXd::Random(6,6);
cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
EigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
complex<double> l... | ALGO | 0.999338 | 3.093769 |
e024a193-d7fa-4a11-af34-965ba655422a | abdulwahid0173/DSA | C++/SumOfDigit.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter the number:"<<endl;
cin>>n;
int lastDigit=0;
int sum=0;
while(n>0){
lastDigit=n%10;
sum+=lastDigit;
n/=10;
}
cout<<sum;
} | ALGO | 0.999831 | 4.192765 |
2c43c11a-b46a-4c83-8ca3-792ddff55bc4 | SudeepSusling/CPP-Assignment | OOP_Assignment/Loop/lastprime.cpp | #include <iostream>
using namespace std;
bool isPrime(int num) {
if (num <= 1) {
return false;
}
for (int i = 2; i * i <= num; ++i) {
if (num % i == 0) {
return false;
}
}
return true;
}
int main() {
int num;
cout << "Enter a number to find the last pri... | ALGO | 0.999952 | 5.31144 |
9a974c2a-b6ff-4aeb-b71f-2c64a0e57622 | Thehepta/HideApk | heptalinker/src/main/cpp/hideload/ziparchive/base/file.cpp | #include "android-base/file.h"
#include <errno.h>
#include <fcntl.h>
#include <ftw.h>
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <memory>
#include <mutex>
#include <string>
#include <ve... | TOOL | 0.864279 | 7.47162 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.