uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
707774a7-29e7-4b10-95b6-edb12e7dc8ef | raincross7/code-similarity | codes/train_code/problem399/problem399_60.cpp | #include<cstdio>
#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main(){
while(1)
{
int n;
cin>>n;
if(n==0)break;
int t = 1000 - n;
int a[] = {500, 100, 50, 10, 5, 1};
int cnt = 0;
for(int i=0;i<6;i++){
while(1){
if(t < a[i])break;
t -= a[i];
cnt+... | ALGO | 0.999719 | 3.748665 |
76617dec-e04c-4488-82b7-7b8559e66f53 | kyun1016/algorithm | sw expert academy/sw 7810 ์นํ์ด์ ์ง๋ฌธ.cpp | #include<iostream>
#include<string>
#include<vector>
#include<cstring>
#include<algorithm>
using namespace std;
int arr[500001];
int findH(int N) {
int max_num = 0;
for (int i = 1; i <= N; i++) {
if (arr[N - i] >= i)
max_num = i;
}
return max_num;
}
int main() {
ios_base::sync_with_stdio(0);
cin.ti... | ALGO | 0.999499 | 3.643254 |
28b2ac8f-1063-46d1-9090-59eeae2e72c6 | taaez/study | BAEKJOON/1406.cpp | /*
์ปค์ ์์น๋ฅผ ๊ธฐ์ค์ผ๋ก ์ผ์ชฝ ์คํ, ์ค๋ฅธ์ชฝ ์คํ์ผ๋ก ๊ตฌ๋ณํ๋ฉด ์ฌ์์ง
์๋ฅผ ๋ค์ด L ๋ช
๋ น์ด๊ฐ ๋์ค๋ฉด ์ผ์ชฝ ์คํ์ top์ ์ค๋ฅธ์ชฝ ์คํ์ผ๋ก pushํ๊ณ , ์ผ์ชฝ ์คํ์ pop ํ๋ฉด ์ปค์๊ฐ ์ผ์ชฝ์ผ๋ก ์ด๋ํ ๊ฒ
*/
#include <iostream>
#include <string>
#include <stack>
using namespace std;
int main ()
{
string str;
cin >> str;
stack <char> Left;
stack <char> Right;
for (int i=0; str[i]; i++... | ALGO | 0.999803 | 4.424881 |
4cd61d4c-fb3b-442e-a551-4d3864805094 | githubAmanKumar/DSA | 34-2dArray/6_2dVectors.cpp | #include<iostream>
#include<vector>
using namespace std;
// int maxDiagSum(int matrix[][4],int n){
// int Sum = 0;
// for(int i=0;i<n;i++){
// for(int j=0;j<n;j++){
// if(i==j){ // Primary diagonal
// Sum += matrix[j][i];
// } else if(j == n-1-i){ // Secondary diago... | ALGO | 0.999258 | 4.035189 |
a80f229a-478f-45b7-b1f1-db3bad6b374e | VladSaioc/oopsla-24-artifact | gcatch/tools/z3/src/ast/rewriter/value_sweep.cpp | #include "ast/for_each_expr.h"
#include "ast/ast_pp.h"
#include "ast/rewriter/value_sweep.h"
value_sweep::value_sweep(ast_manager& m):
m(m),
m_gen(m),
m_rec(m),
m_dt(m),
m_rewrite(m),
m_values(m),
m_args(m),
m_pinned(m),
m_rounds(10),
m_range(20),
m_qhead(0)
{}
void value_s... | ALGO | 0.995652 | 5.05687 |
66bf73d8-b2c6-4ce4-b19b-c995d79ee9b8 | saiteja0110/flutter_application | 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.998859 | 6.785645 |
6a99ab21-2ec9-421a-bb90-8688d557bb9c | Sid330s/useFullCodes-return-AC- | Codeforces/edu round 98/a.cpp | #include<bits/stdc++.h>
using namespace std;
long long int t,x,y,ans;
int main(){
cin>>t;
while(t--){
cin>>x>>y;
ans=2*((max(x,y) - min(x,y))) -1;
if(ans < 0) ans = 2*min(x,y);
else ans = 2*min(x,y)+ans;
cout<<ans<<endl;
}
return 0;
}
| ALGO | 0.99981 | 4.26729 |
7b5f885c-bbf9-49cf-85e1-df88a19780fb | wongyiyeung/CodingPractice | binaryTreePreorderTraversalRecursive.cpp | // LeetCode - Binary Tree Preorder Traversal - Recursive Solution
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<int> preorderTraversa... | ALGO | 0.999992 | 6.61693 |
b50c61c7-9e1e-499f-ad41-0f8dfe4ac310 | anpicon/EDUS | Source_Main/runge_kutta_init.cpp | Initial_Population( P0, nk, kpt, Nk[0]*Nk[1]*Nk[2], Unitary, FermiE, Nb[0]+Nb[1]);
//Initial_Population( P0, nk, Nk[0]*Nk[1]*Nk[2], Unitary, FermiE, Nb[0]+Nb[1]);
double dt6=dt/6.0;
double dt3=dt/3.0;
double dt2=dt/2.0;
double ncyc = 8;
time_t time1 = time(0);
tm* now = localtime(&time1);
int ihour = now->tm_hou... | ALGO | 0.999884 | 3.674025 |
06283feb-e1c8-4d53-9cea-335d218c211d | Owmicron/CPStuff | Codeforces/DisplayTheNumber.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=n... | ALGO | 0.999919 | 4.549074 |
ba69c84d-a212-43c1-9404-74f88724432a | MdShah-alam/D_S_-Linked_List | Insertion after a specific value (Duplication enabled List).cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *Next;
Node(int val)
{
this->val=val;
Next=NULL;
}
};
void insert_at_tail(Node *&head,int val)
{
Node *newNode=new Node(val);
if(head==NULL)
{
head=newNode;
return ;
}
... | ALGO | 0.999946 | 4.215737 |
67301413-c76b-428a-a28f-0df76df9f17e | emilymryan/LAMMPS-SPH-Source-Code | src/USER-SPH/pair_sph_twospecies_anisodiffusion_migration_potential_nocsr_constRC.cpp | #include <math.h>
#include <stdlib.h>
#include "pair_sph_twospecies_anisodiffusion_migration_potential_nocsr_constRC.h"
#include "sph_kernel_quintic.h"
#include "atom.h"
#include "force.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "neighbor.h"
#... | ALGO | 0.998446 | 5.685712 |
cdc95ca0-117e-47ec-8980-861241b4362c | liuq901/code | EOJ/e_2431.cpp | #include <cstdio>
typedef long long ll;
ll c[20][20];
int main()
{
for (int i=0;i<=12;i++)
{
c[i][0]=c[i][i]=1;
for (int j=1;j<i;j++)
c[i][j]=c[i-1][j-1]+c[i-1][j];
}
int T;
scanf("%d",&T);
while (T--)
{
int n,m;
scanf("%d%d",&n,&m);
ll ans... | ALGO | 0.999955 | 3.567402 |
96be2148-7d8e-49bb-82a5-419dfcb114dd | apikdech/CP | Contest/CodeForces/Contest/1156/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
int main() {
return 0;
}
abcd
cabd
abcde
cabde
aaabbcd
adacebd
aabcdd
caabdd
caaddb | ALGO | 0.999605 | 3.448712 |
77a6dd48-6e25-4f04-a8fa-9a7863885846 | Sid-bit28/Competitve-Programming | Leetcode/2070. Most Beautiful Item for Each Query.cpp | #include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define EB emplace_back
#define all(x) std::begin(x), std::end(x)
#define sz(x) (int)(x).size()
#define rep(i, a, b) for(long long i = a; i < (b); ++i)
#define endl '\n'
#define debarr(a, n) cerr << #a << " : ";for(int i = 0; i < n; i++) cerr... | ALGO | 0.999934 | 5.371509 |
5786dd10-ec20-4fde-a82c-9dd10e9d8c6d | shravan-d/Leetcode | 2120-execution-of-all-suffix-instructions-staying-in-a-grid/2120-execution-of-all-suffix-instructions-staying-in-a-grid.cpp | class Solution {
public:
vector<int> executeInstructions(int n, vector<int>& startPos, string s) {
vector<int> ans(s.length(), 0);
for(int i=0;i<s.length();i++){
int currRow = startPos[0];
int currCol = startPos[1];
int steps = 0;
for(int j=i;j<s.lengt... | ALGO | 0.99991 | 6.046605 |
c8fa6954-2d25-415a-a63f-c439268814b2 | nickwang333/Leetcode | LC 1408. String Matching in an Array.cpp | class Solution {
public:
vector<string> stringMatching(vector<string>& words) {
unordered_map<string, int> m;
vector<string> ret;
for(int i=0; i<words.size(); i++){
queue<string> q;
for(int j=0; j<words[i].size(); j++){
int n = q.size();
... | ALGO | 0.999935 | 5.534073 |
8a5b8593-60fa-4147-9066-ab490ceaa418 | aanu2021/Leetcode-Solutions | 212-word-search-ii/212-word-search-ii.cpp | class Solution {
public:
struct Node{
Node*links[26];
int endword;
string eword;
bool containsKey(char ch){
return (links[ch-'a']!=NULL);
}
Node*get(char ch){
return links[ch-'a'];
... | ALGO | 0.999957 | 6.024959 |
ed43854a-edcf-47e5-babd-75abdfed487a | stephane-caron/vhip_walking_controller | src/states/Standing.cpp | #include <vhip_walking/utils/clamp.h>
#include "Standing.h"
namespace vhip_walking
{
namespace
{
constexpr double COM_STIFFNESS = 5.; // standing has CoM set-point task
}
void states::Standing::start()
{
auto & ctl = controller();
auto & supportContact = ctl.supportContact();
auto & targetC... | TOOL | 0.941594 | 6.624062 |
f75154ff-4d1b-4069-9cd9-40ac5eccc2ed | shlok-2003/DSA-Notes | 99_Questions/CODE CHEF/Basic Programming/CHFSPL.cpp | /* CODECHEF.com
Chef has three spells. Their powers are AA, BB, and CC respectively. Initially, Chef has 00 hit points, and if he uses a spell with power PP, then his number of hit points increases by PP.
Before going to sleep, Chef wants to use exactly two spells out of these three. Find the maximum number of hit poi... | ALGO | 0.999984 | 5.351006 |
dfa961f4-a59b-4d0e-9c08-28b2cc8cdd38 | Sandor2889/BOJ | C++/1931.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool compare(pair<int, int> _a, pair<int, int> _b)
{
if (_a.second == _b.second) { return _a.first < _b.first; }
return _a.second < _b.second;
}
int main()
{
int answer = 0;
int rooms;
int start, end;
int currentT... | ALGO | 0.99998 | 5.081489 |
f4ac28e5-3052-444d-b93a-83028f6fe53b | GT-TDAlab/BOA | src/distribute_kmers.cpp | #include <mpi.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <math.h>
#include <inttypes.h>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <parallel/algorithm>
#include <numeric>
#include <omp.h>
#include "distribute_kmers.h"
#inc... | DATA | 0.996174 | 5.74919 |
63f1e733-4c05-40a4-a06e-05700d1c1bb2 | shubham-1903/Algorithm | Divide_and_conquer/Max_Min_Algorithm.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
//?Naive Solution
void naive_max_min(int* v,int n)
{
int maximum = v[0];
int minimum = v[0];
for(int i=1;i<n;i++)
{
if(maximum < v[i]) maximum = v[i];
if(minimum > v[i]) minimum = v[i];
}
cout <<"Maximum number is: "<< maximum << "\n" ... | ALGO | 0.999953 | 4.15876 |
2a549557-f942-45d3-a90e-ee877ee2eed5 | JangAJang/Algorithm | 7. ํ๋ ๋ ์ฐ์ฐ์์ ์ค๋ณต/์ค์ต 7-10/์ค์ต 7-10/main.cpp | #include<iostream>
using namespace std;
class Statistics{
int *a;
int cnt; //๋ฐฐ์ด์ ์์ ๊ฐ์
public:
Statistics() { a = new int[8]; cnt=0; }
bool operator! (){
if( this->a && this->cnt==0) return true;
return false;
}
Statistics& operator<< (int num){
this->a[cnt] =... | TOOL | 0.971812 | 3.793227 |
731104b0-ab76-422a-9cf6-9ef7c71ae467 | shauryaagg/Competitive-Programming | ICO Online Judge/PERIODIC STRINGS.cpp | //PERIODIC STRINGS
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
using namespace std;
vector<int>pf;
int n,m;
void primeFactors(int n){
if(n%2==0)
pf.push_back(2);
while (n%2 == 0)
{
n = n/2;
}
for (int i = 3; i <= sqrt(n); i = i+2)
{
... | ALGO | 0.999997 | 4.028231 |
0bf9dabf-b3a6-4804-9fe5-bdf71ad698c8 | Tejendra00/Force_Estimation_Ardupilot | libraries/AP_Motors/AP_MotorsHeli_Swash.cpp | #include <stdlib.h>
#include <AP_HAL/AP_HAL.h>
#include "AP_MotorsHeli_Swash.h"
extern const AP_HAL::HAL& hal;
const AP_Param::GroupInfo AP_MotorsHeli_Swash::var_info[] = {
// @Param: TYPE
// @DisplayName: Swashplate Type
// @Description: H3 is generic, three-servo only. H3_120/H3_140 plates have Motor1... | TOOL | 0.937598 | 5.539259 |
352820df-0b29-4061-85a2-e6b699ac22b3 | mr2rm/solutions | legacy/USACO/Friday the Thirteenth.cpp | /*
ID: mohamma58
PROG: friday
LANG: C++
*/
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
ifstream fin ( "friday.in" );
ofstream fout ( "friday.out" );
int sum = 0 , index , n;
fin >> n;
int Days[7] = { 0 };
//memset ( Days , 0 , sizeof ( Days ) );
int Months[12] = { 31 , 0 , 31 , 3... | ALGO | 0.999925 | 3.225468 |
2ef88eca-0b62-4a06-b419-d0ac3e487f4d | tahsinsoha/Problem-solving- | Codeforces/appleman and toastman.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int n,inp,sum=0;
vector<long long int>v;
cin>>n;
for(int i=0;i<n;i++){
cin>>inp;
v.push_back(inp);
}
sort(v.begin(),v.end());
for(int j=0;j<n;j++){
sum=sum+(j+2)*v[j];
}
cout<<sum-v[n-1]<<endl;
return 0;
}
| ALGO | 0.99983 | 3.103147 |
ef7b88a5-0325-448b-ab81-464191918771 | jeszekely/QLALib | src/vector.cpp | #include <memory>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <assert.h>
#include <random>
#include <stdexcept>
#include "vector.hpp"
using namespace std;
vectorMatrix::vectorMatrix(const int nr, const int nc) : matrixReal(nr,nc){}
vectorMatrix::vectorMatrix(const vectorMatrix& o) : matrixRe... | ALGO | 0.964016 | 5.001545 |
a3d42813-bb25-44e1-b0a0-1d4666b7b12e | CILab-USC/p4c | frontends/common/parser_options.cpp | #include "parser_options.h"
#include <getopt.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <memory>
#include <regex>
#include <unordered_set>
#include "absl/strings/escaping.h"
#include "absl/strings/str_format.h"
#include "frontends/p4/toP4/toP4.h"
#include "ir/... | TOOL | 0.869046 | 3.939329 |
32c79d0a-0028-4335-b655-75522d14b14e | FRC1296/CheezyDriver2016 | third_party/eigen/unsupported/doc/examples/MatrixPower.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
Matrix3d A;
A << cos(1), -sin(1), 0,
sin(1), cos(1), 0,
0 , 0 , 1;
std::cout << "The matrix A is:\n" << A << "\n\n"
"The matrix power A^(pi/4) is:\n"... | ALGO | 0.999755 | 3.790203 |
89d1d46c-2948-4a49-a8a8-bfb5488495f2 | harshraj22/problem_solving | solution/binarysearch/Count Exact Sum.cpp | // https://binarysearch.com/problems/Count-Exact-Sum
#define ll long long int
vector<vector<ll>> dp;
int n, mod = 1e9 + 7;
void print() {
for (auto row: dp) {
for (auto i: row)
cout << i << ' ';
cout << '\n';
}
}
int recur(int r, int sum, vector<int> &nums) {
if (r < 0 && sum ... | ALGO | 0.999991 | 5.41453 |
3bdd5ed4-1571-4074-9f97-756388331f82 | luizeduardofl/lip-2023 | codigos/ordenando_strings_alfabeticamente.cpp | #include <iostream>
#include <cstring>
using namespace std;
void lerString(char s[], int n);
void lerString(char s[], int n)
{
if (cin.peek() == '\n')
{
cin.ignore();
}
cin.getline(s, n);
return;
}
int main()
{
int n;
cin >> n;
char C[n][50];
for (int i = 0; i < n; i+... | ALGO | 0.999957 | 3.946595 |
a9e000ab-5532-4fb1-bdb2-2c9e90b90288 | mewhotheboss/CodeForces | 148A_Insomnia_cure.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int k, l, m, n, d;
cin >> k >> l >> m >> n >> d;
int damaged_dragons = 0;
for (int i = 1; i <= d; ++i) {
if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0) {
++damaged_dragons;
}
}
cout << damaged_dr... | ALGO | 0.999839 | 3.764623 |
b5d0b2e6-4dd3-46f1-b6b2-1e6f21f5e5ec | kyomin/algorithm | Programmers/programmers_43105.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<vector<int>> triangle) {
int answer = 0;
int len = triangle.size();
if (len == 1)
return triangle[0][0];
int DP[500][500];
/* ฺธ ึผ ฯฑ */
DP[0][0] = triangle[0][0];
DP[1][0] = triangle[0][0] + triangle[1][0];... | ALGO | 0.999922 | 5.048222 |
7364cb5d-1f3f-4e9a-bf15-95607daab027 | Tasrina-Urmi/CSE_182 | LAB_8/Lab_8_Practice_4.cpp | /*Practice-4:Write a C++ program to check whether two matrices are equal or not.*/
#include<iostream>
using namespace std;
int main()
{
int A[10][10] ,B[10][10] , i , j , r , c , isEqual;
cout<<"Enter the number of rows = ";
cin>>r;
cout<<"Enter the number of columns = ";
cin>>c;
cout<<"Ente... | ALGO | 0.999314 | 4.520022 |
c304e598-6889-4288-9523-93234decdd76 | wochatyou/webkitsrc | webkit/Source/ThirdParty/ANGLE/src/libANGLE/ProgramExecutable.cpp | #include "libANGLE/ProgramExecutable.h"
#include "common/string_utils.h"
#include "libANGLE/Context.h"
#include "libANGLE/Program.h"
#include "libANGLE/Shader.h"
#include "libANGLE/queryconversions.h"
#include "libANGLE/renderer/GLImplFactory.h"
#include "libANGLE/renderer/ProgramExecutableImpl.h"
namespace gl
{
name... | TOOL | 0.964869 | 3.255581 |
7c41ba7e-e547-48c5-99ab-3c81969ddc34 | ElytraSolutions/Universal-Gate-Parser | Universal Gate Parser.cpp | #include <iostream>
#include <vector>
std::vector<std::string> _SplitRegularExpression(std::string RegularExpression, char splitBy);
std::string RealizeUsingNandGate(std::string RegularExpression);
std::string RealizeUsingNorGate(std::string RegularExpression);
std::string UniversalGateParser(std::string RegularExp... | ALGO | 0.999923 | 5.204295 |
acc16b09-3a2d-4b19-9720-c24f4126b4a6 | antdkfa/LeetCode-Challenge | 2021/May/21-Find and Replace Pattern.cpp | class Solution {
public:
vector<string> findAndReplacePattern(vector<string>& words, string pattern) {
vector<string> ans;
int used[30] = {0,}, now = 1;
vector<int> cmp, tmp;
for(int i=0;i<pattern.length();i++){
if(!used[pattern[i] - 'a' + 1]){
used[patter... | ALGO | 0.999825 | 6.061947 |
bd88a053-8426-4061-a1b8-2f5a9f7d722b | zxyDEDIRE/ACM_CODE | ็็/ๅคง่ฟๅคงๅญฆ2023ๅนด11ๆ็จๅบ่ฎพ่ฎก็ซ่ต/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pp(x) array<int,x>
using ull=unsigned long long;
using ll=long long;
using pii=pair<int,int>;
using pdd=pair<double,double>;
const int dx[]={0,0,1,-1,1,-1,1,-1};
const int dy[]={1,-1,0,0,1,-1,-1,1};
const int mod=998244353;
const int inf=0x3f3f3f3f;... | ALGO | 0.999792 | 4.005069 |
849ac9e7-764e-4205-8395-eed788caafec | marwan-abdellah/luxrender-lux | core/reflection/microfacetdistribution/wardisotropic.cpp | // wardisotropic.cpp*
#include "wardisotropic.h"
#include "luxrays/core/geometry/vector.h"
using luxrays::Vector;
using luxrays::SphericalDirection;
using namespace lux;
// Ward isotropic distribution, adapted from Kelemen and Szirmay-Kalos / Microfacet Based BRDF Model, Eurographics 2001
WardIsotropic::WardIsotropic... | ALGO | 0.993997 | 5.760712 |
4c13a325-e04c-4d4f-a1b2-03a399ffc372 | rubayet211/LoginScreen_Flutter_Bloc | 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 |
296192f2-f5f0-4cd7-b112-36473c0ee016 | MyTamSW/MaTran_NMLT_ThayKhang | Bai062/Bai062.cpp | #include <iostream>
#include <iomanip>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <string>
using namespace std;
void Nhap(int[][500], int&, int&);
void Xuat(int[][500], int, int);
bool ktToanLe(int);
int DemToanLeDong(int[][500], int, int, int);
int main()
{
int b[500][500];
int k;
int l;
N... | ALGO | 0.99836 | 3.287875 |
ea3836a5-cb29-443d-a44b-62fed131fdc7 | flinke/TDCV-L | ObjectDetectionAndClassification/task2.cpp |
#include <opencv2/opencv.hpp>
#include <iostream>
#include <filesystem>
#include "HOGDescriptor.h"
#include "RandomForest.h"
#include "task1.h"
#include "task2.h"
using namespace std;
using namespace cv;
namespace fs = std::filesystem;
template<class ClassifierType>
void performanceEval(ClassifierType& treeOrForest... | TEST | 0.875958 | 5.813171 |
d80a86db-983b-40ab-a57a-617b9c56ddc8 | 2745518585/code | CF1936A.cpp | #include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
const int N=1000001;
int n;
int query(int a,int b,int c,int d)
{
printf("? %d %d %d %d\n",a,b,c,d);
fflush(stdout);
char z[10];
scanf("%s",z);
if(z[0]=='<') return -1;
else if(z[0]=='=') return 0;
... | ALGO | 0.999719 | 3.196516 |
77bf8aac-a755-4ecb-9b27-523a8fb71969 | Piyushhh786/DSA_with_CPP | sorting/SelectionAndInsertion_sort/insertion.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
int n=5;
int l;
int j;
int arr[] = {1,3,5,2,4};
// for(int i=1;i<n;i++){
// l=i;
// for(int j=i-1;j>=0;j--){
// if(arr[j]>arr[l]){
// swap(arr[j],arr[l]);
// ... | ALGO | 0.99998 | 3.828802 |
b6e5e05b-1763-4f59-bd11-d21686bc00de | victorluis22/algoritmos-estrutura-dados | Ponteiro/Exercicios_1/exercicio_8.cpp | #include <iostream>
using namespace std;
int main(){
int mat[] = {4, 5, 6};
for(int j = 0; j < 3; j++) {
cout << "\n" << (mat+j);
}
return 0;
}
| ALGO | 0.975175 | 3.282675 |
7371a549-5edf-4b24-986d-dda0cbbac369 | transfer-learning/llvm-tl45 | llvm/tools/llvm-exegesis/lib/Latency.cpp | #include "Latency.h"
#include "Assembler.h"
#include "BenchmarkRunner.h"
#include "MCInstrDescView.h"
#include "PerfHelper.h"
#include "Target.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstBuilder.h"
#include "llvm/Support/FormatVariadic.h"
namespace llvm {
namespace exegesis ... | TOOL | 0.91186 | 7.902981 |
25f84239-e386-41a4-a4f6-a0cb329f56ed | SunnyYeahBoiii/EveryDayCode | Code cแปงa Sunny/VNOI/Daily/4.11/array/a.cpp | // Author : MinhPhuongVu A.K.A SunnyYeahBoii
/*
Code Ideal: I'm too lazy for something like this .__.
dp[i][j] means the best way the chose the array ends with a[i] and b[j]
if(a[i] == b[j])dp[i][j] = dp[i-2][j-2] + 1;
else dp[i][j] = max(dp[i-1][j] , dp[i][j-1]);
*/
#include "bits/stdc++.h"
using namespace std;... | ALGO | 0.999966 | 3.82132 |
19d88506-caa9-491b-9e79-21413a6447b3 | PyJun/Recover_Figures | 2.็ข็ๅพๅๅคๅ----็ฌฌไบ็/ๆ ธๅฟ็ฎๆณC++ๆบ็ /RecoverFigs/DetectTarget.cpp | #include "header.h"
// ิญอผ๑ทตปาปฤฟฤพ
vector<Rect> detectTarget(Mat srcImg) {
Mat grayImg;
cvtColor(srcImg, grayImg, COLOR_BGR2GRAY);
vector<Rect> rect_vec;
Mat binImg = preSolveImg(grayImg);
vector<vector<Point>> contours, curves;
extractContours(binImg, contours);
approxPoly(curves, contours, 1.0);
for (auto & cont... | ALGO | 0.995613 | 4.226011 |
2ab83b49-ad8d-420b-8714-6ed18c485554 | ema-pandilova/SP-2024 | aud10/zad6.cpp | //
// Created by ema on 8.12.24.
//
#include <iostream>
using namespace std;
// ะะฐ ะดะฐะดะตะฝ ะฑัะพั n, ะดะฐ ัะต ะฝะฐะฟะธัะต ัะตะบััะทะธะฒะฝะฐ ััะฝะบัะธัะฐ ะบะพัะฐ ัะต ะณะธ ะธะทะฑัะพะธ ะฟะพัะฐะฒัะฒะฐัะฐัะฐ ะฝะฐ ัะธััะฐัะฐ 8.
// ะัะธัะพะฐ, ะดะพะบะพะปะบั ะดะพ ะฝะตะบะพัะฐ ัะธััะฐ 8 ะธะผะฐ ัััะต ะตะดะฝะฐ ัะธััะฐ 8 ะฒะตะดะฝะฐั ะปะตะฒะพ ะพะด ะฝะตะฐ, ะฝะตัะทะธะฝะพัะพ ะฟะพัะฐะฒัะฒะฐัะต ัะต ะฑัะพะธ ะดะฒะพัะฝะพ.
int countEight(int n) {
... | ALGO | 0.999303 | 5.175901 |
ee7df527-a87a-4998-94af-4079f91d15b8 | frontenddeveloperpraveen/dsa-practice | Searching/Searching.cpp | #include <iostream>
using namespace std;
int LinearSearch(int arr[], int target, int n){
for(int i = 0; i<n ; i++){
if(arr[i] == target){
return i;
}
}
return -1;
}
int BinarySearch(int arr[], int target, int n){
int start = 0;
int end = n;
int mid;
while(s... | ALGO | 0.999974 | 6.063008 |
bcdd0327-4471-4824-a407-b2d83d9eba38 | miciltjandra/parallel-fingerprint-indexing | feature_extraction.cpp | #include <opencv2/opencv.hpp>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include "fingerprint_structure.hpp"
using namespace cv;
using namespace std;
#define THRESHOLD 40
#define BLOCKSIZE 16
#define REQUIREDMEAN 100
#define REQUIREDVAR 100
#define MINPERIOD 3
#define MAXPERIOD 25
#d... | ALGO | 0.999328 | 4.061746 |
90d910a7-9f02-42e8-9aba-9aa8e8e5f343 | clumsy-sy/code-of-ACM | ACM-template-sy/ๅจๆ่งๅ/ๆฐไฝdp.cpp | //ๆฐไฝdp๏ผๆๆฎ้็้ข็ฎ๏ผๆฑAๅฐBไธญๆปก่ถณ่ฅๅนฒๆกไปถ็ๆฐๆๅคๅฐไธช
//ๆจกๆฟ๏ผๆกไปถๆฏ็ธ้ปๆฐๅญ็ๅทฎ่ณๅฐๅคงไบ2
const int maxn = 12;
int N,M,K,cnt;
int str[maxn];
int dp[maxn][maxn]; //iไฝ็ฝฎ็jๆฐ
int dfs(int pos,int num,int zero,int limit){
if(pos == 0) return (zero ^ 1);
if(~dp[pos][num] && !zero && !limit) return dp[pos][num];
int top = limit?str[pos - 1]:9;
int ans = 0;
f... | ALGO | 0.999877 | 4.030803 |
4e6662cb-8013-436e-872f-d10b3a28d425 | lemoneid/1.do-exercises | Algorithm/LeetCode/219.ๅญๅจ้ๅคๅ
็ด -ii.cpp | /*
* @lc app=leetcode.cn id=219 lang=cpp
*
* [219] ๅญๅจ้ๅคๅ
็ด II
*/
// @lc code=start
class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
/*
k += 1;
unordered_map<int, int> s;
for (int i = 0; i < nums.size(); ++i) {
s[nums[i]]++;
... | ALGO | 0.999846 | 6.219081 |
6cd57e88-5b58-4472-b2cb-f1ea8e2d426b | sarvex/leetcode-bash | solution/2300-2399/2354.Number of Excellent Pairs/Solution.cpp | class Solution {
public:
long long countExcellentPairs(vector<int>& nums, int k) {
unordered_set<int> s(nums.begin(), nums.end());
vector<int> cnt(32);
for (int v : s) ++cnt[__builtin_popcount(v)];
long long ans = 0;
for (int v : s) {
int t = __builtin_popcount(v)... | ALGO | 0.999918 | 5.656733 |
ceb49b91-8ef9-4c57-82dd-5a32fa75bf3b | ShobRaj24/Algorithms | Kruskal.cpp | #include <bits/stdc++.h>
using namespace std;
class DSU {
int* parent;
int* rank;
public:
DSU(int n)
{
parent = new int[n];
rank = new int[n];
for (int i = 0; i < n; i++) {
parent[i] = -1;
rank[i] = 1;
}
}
int find(in... | ALGO | 0.999959 | 4.811608 |
a84c0140-f524-41e1-aeff-64d41a3137d8 | ashishihota/Online_Problems | codeforces/Grade/A/58.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s , ns, o = "hello";
int i = 0; int j = 0;
cin >> s;
for (; i < 6,j < s.length(); i++,j++){
if (s[j] == o[i]){
ns += s[j];
}
else
i--;
}
if( ns == "hello"){
cout << "YES";
... | ALGO | 0.999851 | 3.204538 |
d1e2af18-dc1b-4f4a-8562-7e0e24873c51 | thatguymain/leetcode | 13. Roman to Integer/sln2.cpp | #include <iostream>
using namespace std;
class Solution
{
public:
int romanToInt(string s)
{
int res = 0;
int prev = 0;
for(int i = s.length() - 1; i >= 0; i--)
{
int num;
switch (s[i]) {
case 'I': num = 1; break;
case ... | ALGO | 0.999395 | 6.098323 |
26a187b5-36fd-4109-b140-5e83a84936c8 | exacoin/ExoCoin | src/checkpoints.cpp | #include <boost/assign/list_of.hpp> // for 'map_list_of()'
#include <boost/foreach.hpp>
#include "checkpoints.h"
#include "db.h"
#include "main.h"
#include "uint256.h"
namespace Checkpoints
{
typedef std::map<int, uint256> MapCheckpoints;
//
// What makes a good checkpoint block?
// + Is surrounded ... | TOOL | 0.970572 | 6.58806 |
c794c53a-7af9-43b9-84d6-aad799c77250 | crystax/android-vendor-boost-1-62-0 | libs/math/src/tr1/hermite.cpp | extern "C" double BOOST_MATH_TR1_DECL boost_hermite BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, double x) BOOST_MATH_C99_THROW_SPEC
{
return c_policies::hermite BOOST_PREVENT_MACRO_SUBSTITUTION(n, x);
}
| ALGO | 0.959853 | 3.518458 |
7790f3dc-8c2d-439c-b89d-34a084808ba5 | Kaminyou/MyLeetcode | cpp_solutions/2191.cpp | class Solution {
public:
int num2num(int num, vector<int>& mapping) {
string out = to_string(num);
for (int i = 0; i < out.size(); i++) {
out[i] = mapping[out[i] - '0'] + '0';
}
return stoi(out);
}
vector<int> sortJumbled(vector<int>& mapping, vector<int>& nums) {... | ALGO | 0.999992 | 6.314846 |
09e06ab1-6bcb-4321-a414-d888b46be23f | Robbbert/hbmame | 3rdparty/lzma/CPP/7zip/Compress/ByteSwap.cpp | // ByteSwap.cpp
#include "StdAfx.h"
#include "../../Common/MyCom.h"
#include "../ICoder.h"
#include "../Common/RegisterCodec.h"
namespace NCompress {
namespace NByteSwap {
class CByteSwap2:
public ICompressFilter,
public CMyUnknownImp
{
public:
MY_UNKNOWN_IMP1(ICompressFilter);
INTERFACE_ICompressFilter(;... | ALGO | 0.9038 | 5.803964 |
2111bb64-027b-485c-82a8-e5bf6500152a | DavidSadowsky/Competitive-Programming | CodeForces-456A.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
int n, p, q;
int laptops_checked = 0;
// read in # of laptops
cin >> n;
// Declare key-value array to link dorms with their associated # of rooms
vector<int> laptops(n);
// Assign laptop price to quality in order
wh... | ALGO | 0.99987 | 3.446851 |
80ac8543-e236-484f-9663-adbeeef3c91f | android-la64/platform-frameworks-av | media/module/codecs/amrnb/common/src/sqrt_l.cpp | /*
Pathname: ./audio/gsm-amr/c/src/sqrt_l.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template. Changed function interface to pass in a
pointer to overflow flag into the function instead of using a
global flag. ... | ALGO | 0.99995 | 5.857356 |
5d94526b-2e10-4dde-bc80-f90e39d5cfb5 | haxbos/Vscode_Backup | 01C++_Learn/ๅ
ๅปบๅฝๆฐๅฏน่ฑก/็ฎๆฏไปฟๅฝๆฐ.cpp | #include<iostream>
//ไฝฟ็จๅ
ๅปบๅฝๆฐๅฏน่ฑก้่ฆๅผๅ
ฅๅคดๆไปถ
#include<functional>
using namespace std;
/*ๅๅ
//ๅ
ถไธญ๏ผ้คไบnagate ๆฏไธๅ
่ฟ็ฎ๏ผๅ
ถไป้ฝๆฏไบๅ
่ฟ็ฎ
1ใtemplate<class T> T plus<T> //ๅ ๆณไปฟๅฝๆฐ
2ใtemplate<class T> T minus<T> //ๅๆณไปฟๅฝๆฐ
3ใtemplate<class T> T multiplies<T> //ไนๆณไปฟๅฝๆฐ
4ใtemplate<class T> T divides<T> //้คๆณไปฟๅฝๆฐ
5ใtemplate<class T> T modulus<T> //ๅๆจกไปฟๅฝๆฐ
6ใ... | TOOL | 0.872378 | 4.075491 |
7440b2d8-0df1-4a97-a0c0-9ff634e35a8a | tmusale/Coding | String/permutation_of_string.cpp | /*
Permutations of a given string
Given a string S. The task is to print all permutations of a given string.
Input:
The first line of input contains an integer T, denoting the number of test cases. Each test case contains a single string S in capital letter.
Output:
For each test case, print all permutations of a gi... | ALGO | 0.999947 | 6.048792 |
8dad9d1c-de96-49eb-91e3-0436f9f2227f | Deep-0603/Cpp | ex_array.cpp | #include <iostream>
#include <climits>
using namespace std ;
void max_till_value(int *array,int size)
{
//time complexity is O(n)
int high = array[0];
cout << array[0] <<" ";
for (int i = 1; i < size; i++)
{
high = max(high,array[i]);
cout <<high <<" ";
}
}
void sum_subarrays(in... | ALGO | 0.99858 | 3.608269 |
5621bf35-6b2b-4831-a5be-93a9152f5a34 | PatriceJiang/spidermonkey-69-ios-compile | gfx/skia/skia/src/pathops/SkReduceOrder.cpp | #include "SkGeometry.h"
#include "SkReduceOrder.h"
int SkReduceOrder::reduce(const SkDLine& line) {
fLine[0] = line[0];
int different = line[0] != line[1];
fLine[1] = line[different];
return 1 + different;
}
static int coincident_line(const SkDQuad& quad, SkDQuad& reduction) {
reduction[0] = reduc... | ALGO | 0.995992 | 4.510601 |
2dd5ed98-ef93-4fbc-9f45-103e720a3460 | etnrlz/rtbkit-deps | boost_1_57_0/libs/msm/doc/HTML/examples/SimpleTimer.cpp | #include <vector>
#include <iostream>
#include <boost/msm/back/state_machine.hpp>
#include <boost/msm/front/euml/euml.hpp>
using namespace std;
using namespace boost::msm::front::euml;
namespace msm = boost::msm;
// how long the timer will ring when countdown elapsed.
#define RINGING_TIME 5
namespace // Concrete F... | TOOL | 0.959967 | 6.781747 |
fd81ea2e-de5c-4ce6-ba2e-45ebf62098d6 | MeepoAII/Accelerated_C- | chapter3/exercise/3-5.cpp | #include <algorithm>
#include <iomanip>
#include <ios>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
vector<string> names;
vector<double> grades;
// ask for and read the student's name
cout << "Please enter your first name: ";
string name;
while (ci... | TOOL | 0.990068 | 5.014633 |
1ff7045f-9c3a-4f42-8669-f5077947ee7b | cycleke/OI_Documents | Code/homework/ddd/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int Maxn = 5e5 + 10;
int n, k, w[Maxn];
typedef long long LL;
LL PreS[Maxn];
bool is_min(const int& v) {
int p = lower_bound(w + 1, w + n + 1, v) - w - 1;
return (LL)p * v - PreS[p] <= k;
}
bool is_max(const int& v) {
int p = upper_bound(w + 1, w + n + 1, v) - w... | ALGO | 0.999962 | 3.90167 |
2298b1ec-3f16-43e2-a6b4-bca2d56c1ff1 | saeed68gm/Camera_stabilization | main.cpp | #include <string>
#include <cv.h>
#include <highgui\highgui.hpp>
#include <opencv2\opencv.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <features2d\features2d.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <opencv2/nonfree/features2d.hpp>
#include <queue>
#include <iostream>
#include <fstream>
#includ... | ALGO | 0.984839 | 3.727779 |
4072a1cd-d7db-4981-8f03-0c79e1e84bfd | ankit777666/DSA | leetCode/two-pointer/532. K-diff Pairs in an Array.cpp | class Solution {
public:
int findPairs(vector<int>& nums, int k) {
sort(nums.begin(), nums.end());
int n=nums.size();
int ans=0;
int i=0, j=1;
while(i<n && j<n) {
if(i==j || nums[j]-nums[i]<k) {
j++;
}
else {
... | ALGO | 0.999861 | 5.851976 |
2b946aca-c10f-4354-90f9-d05a25684a88 | HumanHyeon/Algorithm_Book | archive/ayt/๋ฐฑ์ค_๊ทผ์์ค.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void solution(int K, vector<int> ex) {
int result = 0;
vector<int> id(ex.size());
for (int i = 0; i < ex.size(); i++)
id[i] = i;
do {
int sum = 0;
bool ck = true;
for (auto elem : id) {
sum += (ex[elem] - K);
if (sum <... | ALGO | 0.99993 | 3.892242 |
9950033b-0aac-4798-8d3e-e2f0ae8fdc5a | IdoToledo/OS-ex4 | VirtualMemory.cpp | #include "VirtualMemory.h"
#include "PhysicalMemory.h"
#include <algorithm>
#define ROOT 0
#define NOT_IN_MEMORY 0
#define NOT_VISITED -1
void VMinitialize()
{
for (uint64_t i = 0; i < PAGE_SIZE; i++)
{
PMwrite(ROOT + i, NOT_IN_MEMORY);
}
}
int inFramesVisited(int* framesVisited, int num)
{
f... | ALGO | 0.997969 | 4.400405 |
bcfc6f21-ef8b-4a4c-8b83-bd395fdeec66 | javagovindsharma/leetscode | solution/0900-0999/0995.Minimum Number of K Consecutive Bit Flips/Solution.cpp | class Solution {
public:
int minKBitFlips(vector<int>& nums, int k) {
int n = nums.size();
int d[n + 1];
memset(d, 0, sizeof(d));
int ans = 0, s = 0;
for (int i = 0; i < n; ++i) {
s += d[i];
if (s % 2 == nums[i]) {
if (i + k > n) {
... | ALGO | 0.999992 | 5.738476 |
51e3699b-ed87-4de8-95b7-76ece60a62a3 | mindy55/lab1.1 | lab7.cpp | #include <iostream>
using namespace std;
float fraction(float a, float b);
void fraction(float x, float y, float z, float u);
int main()
{
float n,m,n2,m2;
cout << "Enter numerator: ";
cin >>n;
cout << "Enter denominator: ";
cin >>m;
cout << "Enter second numerator: ";
cin >>n2;
... | ALGO | 0.995222 | 3.909105 |
c126e969-c5e7-46e4-a4e6-65a6776e420b | yimuw/expriment | gtsam/3rdparty/Eigen/doc/special_examples/Tutorial_sparse_example.cpp | #include <Eigen/Sparse>
#include <vector>
#include <iostream>
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
typedef Eigen::Triplet<double> T;
void buildProblem(std::vector<T>& coefficients, Eigen::VectorXd& b, int n);
void saveAsBitmap(const Eigen::VectorXd& x, int... | ALGO | 0.997964 | 5.424878 |
292cbfaf-2e03-45bd-86b9-fef7fb8eff4f | Rahul-Malakar/problem-solving | The_two_numbers.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
ll n;
cin>>n;
if(n == 2) cout<<0<<endl;
else if(n == 6) cout<<4<<endl;
else if(n % 2){
cout<<(n/2)*(n/2+1) - 1<<endl;
}
e... | ALGO | 0.999771 | 4.317478 |
fcbfa60a-7de0-4578-bc38-5a5d3afdb334 | hadjitejuco/CCS0015_TN05 | 1_exer5.cpp | #include <iostream>
using namespace std;
int main() {
int a[100]; // Array to hold up to 100 integers
int n, lar;
cout << "Enter the number of elements (n): ";
cin >> n;
// Check to ensure the number of elements does not exceed the array capacity
if (n > 100) {
cout << "Error: Only up... | ALGO | 0.999152 | 5.374902 |
bf441eeb-cbc3-4e83-8914-dcd5d6eacbe7 | thejosess/Informatica-UGR | 2ยบAรO/1ยบCuatrimestre/ED/eje_arbol.cpp | ejercicios_arboles
#include <iostream>
#include "bintree.h"
using namespace std;
int main()
{
bintree<int> A(7);
bintree<int> B(1);
A.insert_left(A.root(),B) ;
B = bintree<int>(9);
A.insert_right(A.root(),B) ;
B = bintree<int>(6);
A.insert_left(A.root(),left(),B);
bintree<int>:node n;
n = A.root(),left();
... | ALGO | 0.995327 | 3.017937 |
d9a7aa52-9505-410a-8cd3-dd5fdc893f72 | Capzera/Cpp | LGOJ/B3911.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
string s, t;
cin >> n >> m;
unordered_map<string, string> mp;
while (n--) {
cin >> s >> t;
mp[s] = t;
}
cin.ignore();
while (m--) {
getline(cin, s);
t = "";
for (int i = 0, flag =... | ALGO | 0.999449 | 4.473592 |
4c9f7dd5-5ad0-4179-b8de-b74b25725563 | ranak8811/Personal_Projects | C++/Toph's code/CaesarCipher.cpp | // #include <iostream>
// #include <string>
// using namespace std;
// int main() {
// int n;
// cin >> n;
// cin.ignore();
// string a;
// getline(cin, a);
// for (int i = 0; i < a.length(); i++) {
// char c = a[i];
// int askv = static_cast<int>(c);
// char askch;
/... | ALGO | 0.999512 | 5.129372 |
345d2788-4ea4-4ead-9412-3f686f84d93d | waynezhangw/Knives-out-offer | codes/4_TreeDepth.cpp | #include<iostream>
#include<vector>
using namespace std;
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode(){
val=0;
left=NULL;
right=NULL;
}
//TreeNode(int x): val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
Solution(void){
deepth = ... | ALGO | 0.999912 | 4.965733 |
5bff41c9-ee46-4980-94dd-6e3ce55f800e | khhitish/Leetcode-GFG | 14-longest-common-prefix/14-longest-common-prefix.cpp | class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
for(int i=0;i<200;i++)
{
char letter;
if(i<strs[0].size()) letter=strs[0][i];
else return strs[0].substr(0,i);
for(auto&x : strs)
{
if(i>=x.size() |... | ALGO | 0.999628 | 5.694188 |
315dd592-fcd9-4ff0-a4b0-328ef02e706c | ishandutta2007/codeforces | wasa855/normal/1261/D1.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define Fast_IO ios::sync_with_stdio(false);
#define fir first
#define sec second
#define mod 998244353
#define int long long
inline int read()
{
char ch=getchar(); int nega=1; while(!isdigit(ch)) {if(ch=='-') nega=-1; ch=getchar();... | ALGO | 0.999973 | 4.187801 |
f8240ce8-bcab-48c9-bcb5-240db2a17ff0 | POC-2025/vllm | csrc/cpu/layernorm.cpp | #include "cpu_types.hpp"
namespace {
template <typename scalar_t>
void rms_norm_impl(scalar_t* __restrict__ out,
const scalar_t* __restrict__ input,
const scalar_t* __restrict__ weight, const float epsilon,
const int num_tokens, const int hidden_size) {
using ... | ALGO | 0.988072 | 6.931891 |
f9e12c73-25ec-4417-a414-7a549da08b46 | ganeshskudva/Algorithms | HackerRank/max_xor.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <cstdlib>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
typedef long long ... | ALGO | 0.999791 | 3.28165 |
065995f0-06e0-4cfb-8cb3-c3c5b228d34c | definitelyNotFBI/utt | tools/KeyfileIOUtils.cpp | #include <fstream>
#include <iostream>
#include <regex>
#include <string>
#include <unordered_map>
#include <string.hpp>
#include <exception>
#include "KeyfileIOUtils.hpp"
#include "yaml_utils.hpp"
void outputReplicaKeyfile(uint16_t numReplicas,
uint16_t numRoReplicas,
... | TOOL | 0.911417 | 7.287629 |
d4963a5d-4073-44ce-9a4c-f22ab6581e63 | suchiwon/algorithm | networkflow/1017_prime_number_matching_by_Dinic.cpp | #include <stdio.h>
#include <string.h>
#include <vector>
#include <queue>
#include <set>
#define MAX_SIZE 50
#define NOT_INIT -1
using namespace std;
vector< vector<int> > graph;
int v[MAX_SIZE + 1];
int dist[MAX_SIZE + 1];
int pair_u[MAX_SIZE + 1];
int pair_v[MAX_SIZE + 1];
int num[2][MAX_SIZE + 1];
bool bPrime[200... | ALGO | 0.999881 | 3.64211 |
30d3604c-b79c-4035-b2b1-f4c1e1b1ac0c | divyanshuraj751/aVscode | C++CH/19L112STLPriorityQueue.cpp | #include <iostream>
#include <queue>
using namespace std;
int main() {
//max heap
priority_queue<int> maxi;
//min-heap
priority_queue<int,vector<int>,greater<int>> mini;
maxi.push(1);
maxi.push(3);
maxi.push(2);
maxi.push(0);
int n=maxi.size();
for(int i=0;i<maxi.size();i++) {... | ALGO | 0.999871 | 4.191458 |
970e9007-0544-4f92-b091-9d0d3bc7e00a | ANIKETRAJ28/DSA-and-CP | Dynamic Programming/leetcode/lis_problems/number-of-longest-increasing-subsequence.cpp | #include<bits/stdc++.h>
#define ll long long int
#define infp INT_MAX
#define infn INT_MIN
#define pp pair<int, int>
#define mod 1000000007
using namespace std;
template<typename T>
using vec = vector<T>;
// https://leetcode.com/problems/number-of-longest-increasing-subsequence/description/
class Solution {
public:
... | ALGO | 0.999986 | 5.709132 |
5dbec264-cfa3-4b1e-ad26-79fbe125ad87 | aaboshaisha/Cpp | 7_char_arrays/easy/is_substring.cpp | #include <iostream>
using namespace std;
int main()
{
string input, substring;
cin >> input >> substring;
int start = 0;
bool is_sub = false;
// find if first letter in substring exists in input
for (int i = 0; i < input.size(); i++)
{
if (input[i] == substring[0])
{
... | ALGO | 0.999965 | 4.475 |
b73ce841-f5c1-44e9-8e6e-68892761b560 | vashu-aggarwal/CrackYourPlacement | 0496-next-greater-element-i/0496-next-greater-element-i.cpp | class Solution {
public:
int solve(vector<int> nums2,int key){
stack<int> st;
st.push(-1);
int j=0;
for(int i=nums2.size()-1;i>=0;i--){
while(nums2[i]>key){
st.push(nums2[i]);
i--;
}
if(nums2[i]==key){
... | ALGO | 0.999951 | 5.770269 |
74a64850-8a4d-4309-be59-08fe11a57d14 | sarvex/leetcode-bash | solution/1100-1199/1140.Stone Game II/Solution.cpp | class Solution {
public:
int stoneGameII(vector<int>& piles) {
int n = piles.size();
int s[n + 1];
s[0] = 0;
for (int i = 0; i < n; ++i) {
s[i + 1] = s[i] + piles[i];
}
int f[n][n + 1];
memset(f, 0, sizeof f);
function<int(int, int)> dfs = ... | ALGO | 0.99993 | 5.005355 |
a1f4ce1f-d57a-4f69-8298-969f2fc2660c | ishandutta2007/codeforces | kenaj712/normal/1096/C.cpp | #include<bits/stdc++.h>
using namespace std;
int tab[200];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
for(int x=1;x<180;x++)
{
for(int y=3;y<10000;y++)
{
if((x*y)%180==0&&180*(y-2)>=x*y)
{
tab[x]=y;
break;
}
}... | ALGO | 0.999435 | 3.928716 |
dd23c8bb-72fe-4236-b984-91c169073375 | ishandutta2007/codeforces | antoine/normal/86/D.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
using namespace std;
struct Query { int id, l, r; };
int n, t;
int a[200000];
int occ[(int)1e6 + 1] = { 0 };
long long power = 0;
int L = 0;
int R = -1;
long... | ALGO | 0.999874 | 4.359563 |
b4fd2353-337a-4844-9562-d38f3e438509 | esteroliver/Algoritmos | lista01/C.cpp | #include <iostream>
using namespace std;
int main(){
long long l1, l2;
cin >> l1 >> l2;
long long p = (l1*2) + (l2*2);
cout << p;
return 0;
} | ALGO | 0.999606 | 3.260377 |
28bad5d1-6737-4f76-8d1c-7a94a40b4192 | ZDowney926/code | suanfa/h6/c3.cpp |
#include <stdio.h>
#include <stdlib.h>
#define LEN 10000
int Sum,PrimarySet[LEN+5],NumberAmount;
int SolutionCount=0,SolutionTag[LEN+5];
void Output()
{
if(SolutionCount==0)
{
printf("No Solution!\n");
}
else if(SolutionCount==1)
{
int SubSet[NumberAmount+5],ElementCnt=0,i;
for(i=1;i<=NumberAmount;i++)
... | ALGO | 0.999996 | 3.028894 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.