uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9b77c90d-4590-4a75-82cf-0e2ce2cc2e8a | lsiddiqsunny/Days-with-programming | Data Structure/500D.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 100005
#define M 26
set<int>tab[M];
int main(){
string s;
cin>>s;
int sz=s.size();
for(int i=0;i<sz;i++){
int now=s[i]-'a';
tab[now].insert(i);
}
int q;
cin>>q;
while(q--){
int type;
cin>>type;
... | ALGO | 0.998426 | 4.25454 |
1c03cbfd-5f04-4340-86ab-101fe606659c | LakshayxBansal/DSA | loveBabbar/Arrays/isSubset/isSubset.cpp | #include<iostream>
#include<unordered_map>
using namespace std;
string isSubset(int a1[],int a2[], int n, int m){
unordered_map<int,int> countMap;
for(int i=0;i<n;i++){
countMap[a1[i]]++;
}
for(int i=0;i<m;i++){
if(countMap[a2[i]] > 0){
countMap[a2[i]]--;
}else{
... | ALGO | 0.999971 | 4.771658 |
fc9e2221-7149-4198-9e7c-67815895fa06 | BychkovArthur/algorithms | MAI-contests/SegTree2-[20]/e.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
struct SegTree {
ll n;
vector<vector<ll>> data;
SegTree(const vector<ll>& vct) : n(vct.size()), data(4 * n) {
build(0, n - 1, 0, vct);
}
void merge(vector<ll>& dest, const vector<ll>& src1, const vector<ll>& src2) {
... | ALGO | 0.999995 | 5.974713 |
232ca9a4-1d21-4f39-a68f-eefc738c61a7 | muhammadhassaanawan/programming_fundamentals_lab | pftask5a.cpp | #include <iostream>
using namespace std;
int main() {
int rowsA, colsA, rowsB, colsB;
// Input dimensions for matrix A
cout << "Enter the number of rows and columns for Matrix A: ";
cin >> rowsA >> colsA;
// Input dimensions for matrix B
cout << "Enter the number of rows and columns for Matri... | ALGO | 0.999804 | 5.14809 |
488e8404-4881-42d7-9346-9881552805e1 | ishandutta2007/codeforces | wangziji/normal/1280/A.cpp | #include <iostream>
#define int long long
#define mod 1000000007
using namespace std;
string a;
signed main(int argc, char** argv) {
int T;
cin >> T;
while(T--)
{
int x;
cin >> x >> a;
int l=0,ans=a.size(),flag=0;
for(int i=1;i<=x;i++)
{
++l;
if(a.size()<=x)
{
string b=a.substr(l);
for... | ALGO | 0.999936 | 4.450821 |
465d237e-8fa3-43b0-a7ff-702355f83eb5 | Nitish9711/coding-blocks | recursion/generat_bracket.cpp | #include<iostream>
using namespace std;
void generate_brackets(char *out, int n, int idx, int open, int close){
if(idx == 2*n)
{
out[idx] = '\0';
cout<<out<<endl;
return;
}
if(close < open)
{
out[idx] = ')';
generate_brackets(out, n, idx+1, open, close+1);... | ALGO | 0.99969 | 3.730037 |
48279dbe-cd5c-40a9-9d06-d208c8c628bc | sipho-mancam/common_module | Dependencies/libs/asio/example/cpp11/executors/fork_join.cpp | #include <boost/asio/execution.hpp>
#include <boost/asio/static_thread_pool.hpp>
#include <algorithm>
#include <condition_variable>
#include <memory>
#include <mutex>
#include <queue>
#include <thread>
#include <numeric>
using boost::asio::static_thread_pool;
namespace execution = boost::asio::execution;
// A fixed-s... | ALGO | 0.998648 | 7.528812 |
bab2505e-b4de-4f5f-a46b-07b0f9fd0431 | Arjun-Batch-3/XPC_W3 | week 3/p9.cPP | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
vector<int>v(n);
for(int i=0;i<n;i++)
{
cin>>v[i];
}
map<int,int>cnt;
for(int i=0;i<n;i++)
{
cnt[v[i]]++;
... | ALGO | 0.999926 | 4.313407 |
1092dac1-a2a6-48aa-8080-ceaec289a811 | Djokovic0311/LeetCode | problems/to_lower_case/solution.cpp | class Solution {
public:
string toLowerCase(string s) {
for(int i = 0; i < s.length(); i++) {
if(s[i] >= 'A' && s[i] <= 'Z') s[i] = 'a'+ s[i] -'A';
}
return s;
}
}; | ALGO | 0.945676 | 5.453631 |
10c04e98-2c10-42b2-8e70-4e40782eb2fc | ishandutta2007/codeforces | jiangly/normal/1263/A.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int a, b, c;
cin >> a >> b >> c;
cout << min((a + b + c) / 2, min(a + b, min(a + c, b + c))) << "\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--)
solve();
return 0;
} | ALGO | 0.999941 | 5.484153 |
e4e85ddb-7698-496d-9d79-842e5a57c466 | matheus3301/neps-academy-exercises | EXERCÍCIOS/escala.cpp | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
int escala[] = {1,3,5,6,8,10,12};
string nota[] = {"do","do#","re","re#","mi","fa","fa#","sol","sol#","la","la#","si","desafinado"};
int ans,n;
vector<int> seq;
bool checa(int i){
for(int j = 0; j < 7; j++){
if(seq[j] != (e... | ALGO | 0.999955 | 3.906391 |
03db2390-f2d4-401a-a3e3-65af68757909 | abrarShariar/Algorithm-problem-solving | concurrent-parallel-programming/Ex_Files_C_Plus_Plus_Parallel_Prog/Exercise Files/CH04/04_02/end/recursive_mutex_demo.cpp | /**
* Two shoppers adding garlic and potatoes to a shared notepad
*/
#include <thread>
#include <mutex>
unsigned int garlic_count = 0;
unsigned int potato_count = 0;
std::recursive_mutex pencil;
void add_garlic() {
pencil.lock();
garlic_count++;
pencil.unlock();
}
void add_potato() {
pencil.lock();... | ALGO | 0.958869 | 6.100183 |
ebf9eeeb-9f20-4500-9651-eb8004219f9d | ArwinMarinta/flutter-pemula-dicoding | 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 |
24d7dafb-4b5a-46eb-8277-c76e94af76fa | vxd7/labs | Lab5/4/main.cpp | #include <iostream>
#include <algorithm>
#include <vector>
typedef std::string::iterator strIter;
int main() {
std::string str1, str2;
std::getline(std::cin, str1);
std::getline(std::cin, str2);
std::sort(str1.begin(), str1.end());
strIter uniqElems = std::unique(str1.begin(), str1.end());
str1.erase(uniqElem... | ALGO | 0.99992 | 3.815076 |
66369a4d-a018-4c4f-bc71-d42eb74a8007 | JMadgwick/bbpi | bbp-pi-parallel-cpu.cpp | #include <algorithm>
#include <iostream>
#include <cmath>
#include <string>
//for printout accuracy
#include <limits>
#include <iomanip>
//Multithreading
#include <thread>
#include <future>
#pragma GCC diagnostic warning "-Wall"//Gives us 'all' warnings, includes avoiding uninitialized varibles, needed for HCC compile... | ALGO | 0.999704 | 3.764977 |
0fd89bad-106e-4980-ad5a-6006fa1bb702 | marcnunezc/AdventOfCode | 2023/Day15/day15.cpp |
AOC_DAY(Day15_1){
size_t sum = 0;
std::string word;
while(getline(cin,word,',')) {
int current_value=0;
for (auto c : word) {
current_value += (int) c;
current_value *= 17;
current_value = current_value % 256;
}
sum += current_value;
... | ALGO | 0.955721 | 4.257757 |
36b01cc4-c3d4-4f65-8563-edfb706ec970 | tuxafgmur/DhollmenK_frameworks | av/media/libstagefright/codecs/m4v_h263/dec/src/find_min_max.cpp | /*
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Inputs:
input_ptr = pointer to the buffer containing values of type UChar
in a 2D block of data.
min_ptr = pointer to the minimum value of type Int to be found in a
square bloc... | ALGO | 0.999966 | 6.515752 |
78ad00ab-be54-47ce-aac5-6a54f7934f3c | stamcenter/llvm-zeno | clang-tools-extra/clangd/index/remote/server/Server.cpp | #include "Features.h"
#include "Index.pb.h"
#include "MonitoringService.grpc.pb.h"
#include "MonitoringService.pb.h"
#include "Service.grpc.pb.h"
#include "Service.pb.h"
#include "index/Index.h"
#include "index/Serialization.h"
#include "index/Symbol.h"
#include "index/remote/marshalling/Marshalling.h"
#include "suppor... | WEB | 0.858064 | 7.84548 |
06f4de53-c927-4add-b598-f0ac6db3b3c2 | Xdydy/OJCode | 板子/图论/SCC.cpp | #include <bits/stdc++.h>
using namespace std;
#define max_size (int)(1e5+10)
#define LL long long
const LL INF = 1ll << 60;
const int inf = 1 << 30;
vector <int> G[max_size];
int pre[max_size] , lowlink[max_size] , sccno[max_size] , dfs_clock , scc_cnt;
stack <int> S;
void dfs ( int u ) {
pre[u] = lowlink[u] = ++d... | ALGO | 0.999708 | 4.830019 |
c1e9800b-e469-4ad5-9ef2-918bd028a34a | PratheekB/suv | llvm/libc/src/math/generic/nextafter.cpp | #include "src/math/nextafter.h"
#include "src/__support/FPUtil/ManipulationFunctions.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(double, nextafter, (double x, double y)) {
return fputil::nextafter(x, y);
}
} // namespace __llvm_libc
| TOOL | 0.940174 | 4.971681 |
e2960549-d959-43bc-acbf-d42558365234 | DucPhamH/Thuat_toan_ung_dung | De_Thi/Bai_Lien_Quan/phan_tu_lien_ke_khac.cpp | // cho 1 dãy số nguyên có n phần tử. tìm dãy con liên tiếp có các phần tử liền kề khác nhau dài nhất
// input 10
// 1 2 3 3 3 4 5 2 1 3
// output 6
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
int a[MAXN], n;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(... | ALGO | 0.999942 | 3.963262 |
697c72f2-335e-4c23-8d76-5c4a0a15db85 | husscc/leetcode | WordSearch.cpp | /*
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.
For example,
Given board =
[
["ABCE"],
["SFCS"... | ALGO | 0.999871 | 6.044174 |
89d83289-c53b-41cd-926d-222d9d4b4192 | surabhi555/basic_concepts_of_dsa | assignments_pgp/week_2_searching_and-sorting/four.cpp | /*
Suppose an array of length n sorted in ascending order is rotated between 1 and n times.
For example, the array nums = [0,1,2,4,5,6,7] might become:
[4,5,6,7,0,1,2] if it was rotated 4 times.
[0,1,2,4,5,6,7] if it was rotated 7 times.
Notice that rotating an array [a[0], a[1], a[2], ..., a[n-1]] 1 time results
in... | ALGO | 0.999993 | 6.875859 |
90c6eed7-71af-4067-ac0e-29244eb70039 | yocoHM/GrafosSnap | snap-core/ggen.cpp | /////////////////////////////////////////////////
// Graph Generators
namespace TSnap {
PBPGraph GenRndBipart(const int& LeftNodes, const int& RightNodes, const int& Edges, TRnd& Rnd) {
PBPGraph G = TBPGraph::New();
for (int i = 0; i < LeftNodes; i++) { G->AddNode(i, true); }
for (int i = 0; i < RightNodes; i++)... | ALGO | 0.993611 | 5.368577 |
8e806944-3041-49d6-83c4-d28944d10e34 | AdarshNandanwar/DSA-and-Competitive-Programming | PU Placements Mock 2022/Mock 3/largest-rectangle.cpp | // https://www.hackerrank.com/contests/placements-2021-mock-3/challenges/largest-rectangle
/*
Skyline Real Estate Developers is planning to demolish a number of old, unoccupied buildings and construct a shopping mall in their place. Your task is to find the largest solid area in which the mall can be constructed.
Th... | ALGO | 0.999969 | 6.294444 |
88e1761a-932d-4a9b-8614-cd630c8f0e62 | ElizarAlexey777/Skillbox_C_pp_prog | Functions_in_programming/11_6_Homework_Checking_the_correctness_of_the_email_address/main.cpp | #include <iostream>
std::string side_address(std::string address, std::string type_side) {
int i = 0;
int count_sym = 0;
int cut = 0;
bool flag = false;
while (i <= address.length()) {
if (address[i] == '@') {
flag = true;
cut = i;
count_sym++;
}
... | ALGO | 0.988683 | 4.704516 |
87423e17-ef99-4896-aaac-b89c21488e64 | manishsarmaa/gfg-practise | Medium/K Sum Paths/k-sum-paths.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// Function to Build Tree
Node *buildTree(string str)
{
// Corner Case
... | ALGO | 0.999886 | 6.295869 |
205fd5c3-300b-4a00-b0f0-30cdb1b614c1 | GunjanShakya/DSA | 34-find-first-and-last-position-of-element-in-sorted-array/34-find-first-and-last-position-of-element-in-sorted-array.cpp | class Solution {
public:
int first(vector<int> a,int t)
{
int s=0,e=a.size()-1; int res=-1;
while(s<=e)
{
int mid=s+ (e-s)/2;
if(t==a[mid])
{
res=mid;
e=mid-1;
}
else if(t>a[mid])
... | ALGO | 0.999965 | 6.483804 |
4859e402-767b-4b8b-982d-9e7b1180546c | dhruvik1999/Competitive-Programming | CodeChef/TreeNode.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int n;
cin >> n;
int sum=0;
while(n--){
int n1,n2;
cin >> n1 >> n2;
sum+=n1-n2;
... | ALGO | 0.999456 | 3.378299 |
bfcf5e9f-97e6-4340-9fbb-e1b824fcc944 | hinokami27/ocrAPI | src/main/resources/tesseract-engine/src/ccstruct/normalis.cpp | #include "normalis.h"
#include <allheaders.h>
#include "blobs.h"
#include "helpers.h"
#include "matrix.h"
#include "ocrblock.h"
#include "unicharset.h"
#include "werd.h"
#include <cfloat> // for FLT_MAX
#include <cstdlib>
namespace tesseract {
// Tolerance in pixels used for baseline and xheight on non-upper/lower ... | ALGO | 0.993198 | 4.584872 |
d4cdb9d7-eaea-4c0b-a44e-1cfdae1d477e | lyr316/practices | src/Remove_Duplicates_from_Sorted_Array.cpp | /*
* Remove_Duplicates_from_Sorted_Array.cpp
*
* Created on: 2014104
* Author: Yanren
*/
//Given a sorted array, remove the duplicates in place such
//that each element appear only once and return the new length.
//
//Do not allocate extra space for another array, you must do this
//in place with constant m... | ALGO | 0.999655 | 5.817291 |
e3facdb8-e749-4bea-9e8f-9f18265f8908 | willzeng274/ASM_DOM-website | server/uri.cpp | #include <string>
#include <algorithm> // find
struct Uri
{
public:
std::wstring QueryString, Path, Protocol, Host, Port;
static Uri Parse(const std::wstring &uri)
{
Uri result;
typedef std::wstring::const_iterator iterator_t;
if (uri.length() == 0)
return result;
iterator_t uriEnd = uri... | TOOL | 0.95521 | 4.214529 |
b807160a-0333-44b7-92e0-5a5a5c9c49f5 | Tamima-Azad/DataStructuresAndAlgorithms | DSA_II/practicefinal2.cpp | // // #include<bits/stdc++.h>
// // using namespace std;
// // #define p pair<int,int>
// // #define vii vector<pair<int,int>>
// // bool cmp(p pi,p pii){
// // double p1=(double) pi.first/pi.second;
// // double p2=(double)pii.first/pii.second;
// // return p1>p2;
// // }
// // int main(){
// // int n... | ALGO | 0.999978 | 4.22069 |
78f9cf2c-abaf-40e1-b49c-f3ed30c4f0d1 | ABHAYB642/PG-DAC-All-Subjects | C++/C++ Lab/Lab 5 & 6/str_cmp.cpp | #include<iostream>
using namespace std;
void compare(char*,char*);
int main()
{
char *a = new char[15];
char *b = new char[15];
cout<<"\n Enter your String1:";
cin>>a;
cout<<"\n Enter your String2:";
cin>>b;
compare(a,b);
delete []a;
delete []b;
return 0;
}
void compare(char *p,char *q)
{
int i=0; int flag... | ALGO | 0.998751 | 3.094512 |
fa41b085-0938-4f8f-9ccd-7aab2088d7ad | SamZhangQingChuan/Templates-for-Competitive-Programming | Maths/Polynomial-Interpolation.cpp | // 传入y = f(x)上的n个点, 拟合出对应的一元n-1次方程, 返回各项系数
// 类型需支持加, 减, 乘, 除, 取反, 加等于这六种操作
template<typename T>
std::vector <T> interpolation(const T x[], const T y[], int n) {
std::vector <T> u(y, y + n), ret(n), sum(n);
ret[0] = u[0], sum[0] = 1;
for(int i = 1; i < n; ++i) {
for(int j = n - 1; j >= i; --j) {
... | ALGO | 0.999881 | 4.458818 |
069d5bf4-5b9d-4336-a6c5-da9e19f57332 | AndarGuy/mipt-algos | semester3/contest0/src/profil.cpp | /*
Замощение
Прямоугольник размером N × M требуется полностью замостить фигурами домино (1 × 2). и тримино (1 × 3).
Определите, сколькими способами можно это сделать.
*/
#include <iostream>
using namespace std;
size_t profil(int N, int M) {
size_t slices = 1 << N;
bool **cache = new bool *[slices];
... | ALGO | 0.99993 | 5.206805 |
f8385c84-8d95-4eff-8a86-570325092a7d | nemo201/Leetcode | 134-gas-station/134-gas-station.cpp | class Solution {
public:
int canCompleteCircuit(vector<int>& gas, vector<int>& cost) {
int sumGas = 0, gasCost = 0, start = 0, tank = 0;
for (int i = 0; i < gas.size(); i++) {
sumGas += gas[i];
gasCost += cost[i];
tank += gas[i] - cost[i];
... | ALGO | 0.999991 | 6.024247 |
3cce23b5-2162-4dd2-b029-8c836885c5ae | refiel-l/caffe-libs | boost/boost_1_56_0/libs/numeric/ublas/doc/samples/vector_binary_redux.cpp | #include <boost/numeric/ublas/vector.hpp>
int main () {
using namespace boost::numeric::ublas;
vector<double> v1 (3), v2 (3);
for (unsigned i = 0; i < (std::min) (v1.size (), v2.size ()); ++ i)
v1 (i) = v2 (i) = i;
std::cout << inner_prod (v1, v2) << std::endl;
}
| ALGO | 0.998744 | 3.986133 |
ac4ecee5-bff6-431b-b044-796aed461cf7 | vivekup3424/Coding_Problems | leetcode/cpp/redundant-connection.cpp | #include <bits/stdc++.h>
using namespace std;
class DSU {
private:
vector<int> parent, size;
public:
DSU(int n) {
size.resize(n + 1, 1); // Using 1-based indexing
parent.resize(n + 1);
for (int i = 1; i <= n; i++) {
parent[i] = i;
}
}
int find(int a) { ... | ALGO | 0.999769 | 6.06497 |
d8d1ecac-6c84-4e39-9fba-ffb017cdf84f | 780Noman/All-C_plus_plus-program | correct comp.cpp | #include<iostream>
#include<cstring>
using namespace std;
int main()
{
char n1[15],n2[15];
cout<<"enter a n1 array:"<<endl;
cin>>n1;
cout<<"enter a n2 array:"<<endl;
cin>>n2;
int n=strcmpi(n1,n2);
if(n<0)
cout<<n2<<" is greater "<<endl;
else if(n==0)
cout<<n1<<" and "<<n2<<" are equal"<<endl;
else
cout<<n... | ALGO | 0.999852 | 3.008683 |
c94c0259-5c77-4247-a8c6-3de6cc80fa6d | esl000/CustomUE4VolumeRaymarching | Engine/Source/ThirdParty/PhysX3/PhysX_3.4/Source/GeomUtils/src/pcm/GuPCMContactGenSphereCapsule.cpp | #include "GuGeometryUnion.h"
#include "GuPCMContactGen.h"
#include "GuPCMShapeConvex.h"
#include "CmRenderOutput.h"
#include "GuPCMContactGenUtil.h"
#include "PsVecMath.h"
#include "GuVecCapsule.h"
#include "GuVecBox.h"
using namespace physx;
using namespace Gu;
using namespace Ps::aos;
//Precompute the convex data
... | ALGO | 0.99208 | 3.983304 |
a068200e-a1e8-4ad6-abcd-b3c487a6a76d | dvtate/single-files | puzzles/hr/repeated_string.cpp | #include <bits/stdc++.h>
using namespace std;
// Complete the repeatedString function below.
long repeatedString(string s, long n) {
// Understand problem
const auto len = s.length();
const auto times = n / len;
const auto rem = n % len;
// Handle repeated case
int a_per_time = 0;
if ... | ALGO | 0.99979 | 4.495829 |
75a769c6-77c5-4cb3-bbe8-098fb0139ee1 | JohnItoo/Solvay | codeforces/rounds/CF-1487C.cpp | // Problem: C. Minimum Ties
// Contest: Codeforces - Educational Codeforces Round 104 (Rated for Div. 2)
// URL: https://codeforces.com/problemset/problem/1487/C
// Memory Limit: 256 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
using namespace std;
#define _CRT_... | ALGO | 0.999673 | 4.406241 |
5af7d03a-7c97-45b8-bd03-1e0591bdb790 | Shoyeb45/PythonBasic | PracticeQuestion/CTCI/Array&String/6.cpp | #include<bits/stdc++.h>
using namespace std;
#define loop(i, n) for(int i = 0; i < n; i++)
typedef long long ll;
const ll mod = 1000000007;
string numToStr(int cnt) {
string ans = "";
if(cnt == 1)
return ans;
while(cnt >= 1) {
ans += (cnt % 10) + '0';
cnt /= 10;
... | ALGO | 0.999966 | 5.138079 |
12e8e87d-1363-42bb-89de-cb0091f7d386 | nlohani20/Data-Structures-and-Algorithms | bstree.cpp | #include<iostream>
using namespace std;
class node
{
public:
int data;
node *left,*right;
node(int x) //constructor
{
data=x;
left = right=NULL;
}
};
class bst
{
public:
node *root=NULL;
node* insert1(n... | ALGO | 0.999878 | 3.985783 |
e33186e8-f93f-4120-bd67-822d3327abe0 | RobotnicRabbit/UE4.15.SVN | Engine/Source/ThirdParty/IntelTBB/IntelTBB-4.4u3/examples/parallel_for/game_of_life/src/Update_state.cpp | #include "Evolution.h"
#ifdef USE_SSE
/* Update states with SSE */
#include <xmmintrin.h>
#include <emmintrin.h>
inline void create_record( char * src, unsigned * dst, unsigned width)
{
dst[0] |= src[width - 1];
for( unsigned a=0; a<31u; ++a )
dst[0] |= src[a]<<(a+1);
unsigned a;
for( a=31u;... | ALGO | 0.999778 | 3.6471 |
db1cf22e-d082-402e-b60a-d03f60c1da56 | gurleen-kaur1313/6Companies30Days | goldman_12.cpp | /* problem link: https://practice.geeksforgeeks.org/problems/squares-in-nn-chessboard1801/1# */
class Solution {
public:
long long squaresInChessBoard(long long N) {
return N*(N+1)*(2*N+1)/6;
}
};
| ALGO | 0.99961 | 4.800407 |
a95ade9a-4e8f-40bc-902f-d806806a908a | alexandraback/datacollection | solutions_1483485_0/C++/Bogdan/ProblemA.cpp | #include <iostream>
#include <cstring>
using namespace std;
const char normalToGMapping[] = {'y','n','f','i','c','w','l','b','k','u','o','m','x','s','e','v','z','p','d','r','j','g','t','h','a','q'};
const char gToNormalMapping[] = {'y','h','e','s','o','c','v','x','d','u','i','g','l','b','k','r','z','t','n','w','j','p'... | ALGO | 0.983225 | 4.645515 |
a90e8aa5-1fef-42f2-bed9-fcd8bdb869e6 | severalfly/MyTest | 30 days operator30天自制操作系统/src/omake/tolsrc/tk5lgpl1/t5lzma0d/7zip/Compress/LZMA/LZMAEncoder.cpp | // LZMA/Encoder.cpp
#include "StdAfx.h"
#include "../../../Common/Defs.h"
#include "LZMAEncoder.h"
// for minimal compressing code size define these:
// #define COMPRESS_MF_BT
// #define COMPRESS_MF_BT4
#if !defined(COMPRESS_MF_BT) && !defined(COMPRESS_MF_PAT) && !defined(COMPRESS_MF_HC)
#define COMPRESS_MF_BT
#de... | TOOL | 0.889862 | 3.945817 |
c4844d85-223a-455e-ae4d-e1da66d88906 | Gencho-Zhilkov/fmi-ip-group-7-2023 | 06. Подготовка К1/solutions/exercise_3.cpp | #include <iostream>
// Use unsigned long for result to avoid numeric overflow
unsigned long largestPermutation(unsigned n) {
// Array to store the frequency of each digit
unsigned frequency[10] = {};
// Count the frequency of each digit in the number
do {
const int digit = n % 10;
freq... | ALGO | 0.999966 | 7.009779 |
ae594ed2-3d9c-450c-93c2-850081a928c3 | dragon-tc/clang | lib/FrontendTool/ExecuteCompilerInvocation.cpp | #include "clang/FrontendTool/Utils.h"
#include "clang/ARCMigrate/ARCMTActions.h"
#include "clang/CodeGen/CodeGenAction.h"
#include "clang/Config/config.h"
#include "clang/Driver/Options.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/FrontendAction... | TOOL | 0.933143 | 7.600567 |
86a04f13-953a-427b-8deb-67129d320818 | RitikSapat02/cpp_programs | 2. if-else/poinr_inside_outside_circle.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int x, y, x1, y1, r;
cout << "Enter the coordinates of center: ";
cin >> x >> y;
cout << "Enter the coordinates of point: ";
cin >> x1 >> y1;
cout << "Enter the radius of center: ";
cin >> r;
double distance = sqrt... | ALGO | 0.997027 | 3.957343 |
1b65d75a-7f60-42ad-8ca9-0c378f2ef269 | liuhe6/leetcode_solution | 42_接雨水.cpp | class Solution {
public:
int trap(vector<int>& height) {
stack<int> stk; // 创建一个栈来存储柱子的索引
int res = 0; // 初始化接雨水的总量为 0
// 遍历每个柱子
for (int i = 0; i < height.size(); i++) {
int last = 0; // 初始化当前柱子和栈顶柱子之间的雨水高度为 0
// 当栈非空且当前柱子高度大于栈顶柱子高度时
... | ALGO | 0.999978 | 6.756509 |
6af4d4f4-b4d5-4f80-abe1-6ac4e3a88eb7 | prashantdhaka1/LeetCode-Solutions | C++/minimum-threshold-for-inversion-pairs-count.cpp | // Time: O(nlogn * logr)
// Space: O(n)
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
// binary search, ordered set
class Solution {
public:
int minThreshold(vector<int>& nums, int k) {
const auto& binary_search = [](auto left, auto right, const... | ALGO | 0.999971 | 5.822326 |
1137d02f-2a03-4b71-8289-adee1f1aad10 | doikimihiro/procon-example | 全探索/bit_serch.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n = 5;
// {0, 1, ..., n-1} ̕W̑ST
for (int bit = 0; bit < (1 << n); ++bit)
{
/* bit ŕ\W̏ */
/* ƂłĂ邱ƂmFĂ݂ */
// bit ̕\W߂
vector<int> S;
for (int i = 0; i < n; ++i) {
if (bit & (1 << i)) { // i bit ɓ邩ǂ
S.push_back(i);
}... | ALGO | 0.999056 | 4.309628 |
9addc654-cec3-4212-a95c-bb20d1ecfcbf | hasinipunugoti412/CSA0697-DAA | Reverse string.cpp | #include <stdio.h>
#define MAX_SIZE 100
int main()
{
char str[MAX_SIZE], reverse[MAX_SIZE];
int i, strIndex, revIndex, len;
printf("Enter any string: ");
gets(str);
i = 0;
while(str[i] != '\0') i++;
len = i;
revIndex = 0;
strIndex = len - 1;
while(strIndex >= 0)
{
... | ALGO | 0.965883 | 3.746419 |
7a44c091-a943-4802-b1d2-05efbc49ab02 | zfa07/Killyouss | Engine/Source/ThirdParty/IntelTBB/IntelTBB-4.4u3/examples/parallel_do/parallel_preorder/parallel_preorder.cpp | #include "tbb/parallel_do.h"
#include <vector>
#include <algorithm>
#include "Graph.h"
class Body {
public:
Body() {};
//------------------------------------------------------------------------
// Following signatures are required by parallel_do
//------------------------------------------------------... | ALGO | 0.999629 | 5.851394 |
b0665069-8436-4ded-b98a-f830a910950b | Aryanlanghanoja/NBS_2025 | Home Work/04-06-2025/prime.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool isPrime(int n) {
if(n < 2) {
return false;
}
if(n < 4) {
return true;
}
if(n % 2 == 0 || n % 3 == 0) {
return false;
}
for(int i = 5 ; i <= (n /... | ALGO | 0.999858 | 5.327525 |
54e436f0-c575-4b58-bcf0-38d345f39278 | AadeeshJainB2K/My-Arduino-Projects-And-Their-Codes- | Arduino/libraries/MD_Parola/src/MD_Parola_Diag.cpp | #include <MD_Parola.h>
#include <MD_Parola_lib.h>
/**
* \file
* \brief Implements diagonal scroll effect
*/
#if ENA_SCR_DIA
void MD_PZone::effectDiag(bool bUp, bool bLeft, bool bIn)
// Scroll the display diagonally up or down, left or right, depending on the selected effect
{
if (bIn) // incoming
{
switch... | TOOL | 0.862197 | 5.722581 |
b06bb601-8731-49bb-8cdd-3eae5cafb9fa | Ilade-s/Mini_projet_L1 | projet.cpp | /*
Mini-projet fin S1L1, Base en info
MERLET Raphaël, Bilal RAHALI
Permet la planification d'une tâche décrite dans un fichier, avec un fichier de coûts et de productions fournis
Les solutions trouvées sont enregistrées dans un fichier de sortie (au nom indiqué dans le fichier de tâche)
Lien github : https://github.c... | TOOL | 0.991145 | 3.112175 |
0bb528fd-b2e2-4370-b63a-30a90a0b6961 | vinodpkd/leetcode | 3285.cpp | //3285. Find Indices of Stable Mountains
/*
There are n mountains in a row, and each mountain has a height. You are given an integer array height where height[i] represents the height of mountain i, and an integer threshold.
A mountain is called stable if the mountain just before it (if it exists) has a height strictly... | ALGO | 0.999997 | 6.33192 |
0639e8c0-7cbc-453e-ad48-7663fd16b2bb | ahmedius2/AutowareAuto | src/universe/autoware.universe/planning/sampling_based_planner/autoware_bezier_sampler/src/bezier.cpp | #include <autoware_bezier_sampler/bezier.hpp>
#include <iostream>
namespace autoware::bezier_sampler
{
Bezier::Bezier(Eigen::Matrix<double, 6, 2> control_points)
: control_points_(std::move(control_points))
{
}
Bezier::Bezier(const std::vector<Eigen::Vector2d> & control_points)
{
if (control_points.size() != 6) {
... | ALGO | 0.994599 | 6.635004 |
f2d54a15-31f1-4ac7-aa1a-34cab5fbf08f | yejin826/codetree-TILs | 240407/포탑 부수기/destroy-the-turret.cpp | #include <iostream>
#include <vector>
#include <queue>
#define MAX 987654321
using namespace std;
int N, M, K;
vector<vector<int>> arr;
vector<vector<int>> last_time;
pair<int, int> attackter, target;
vector<vector<bool>> nothing;
void select_attackter()
{
int a_x = 0;
int a_y = 0;
int min_damage = MAX;
int att... | ALGO | 0.999887 | 4.30926 |
34f99e47-dccb-4d6a-b4be-bc7038d46c07 | Zike420/FICH | c++/C++ejrc/Utilidades/9_3_meterunapalabranueva.cpp | #include <iostream>
#include <vector>
using namespace std;
int buscar_pos(const vector<string> &palabra, string nueva);void insertar(vector<string> &palabra, string nueva, int pos);
int main() {
vector<string> palabra(100);
for(string &p : palabra){
cin >> p;
}
string nueva;
cin >> nueva;
int pos = buscar_p... | ALGO | 0.999036 | 4.716854 |
b428d378-5b06-49dc-b678-29a27c40fbe1 | Mcdouglas-X/KANGAROO-256-CUSTOM | Kangaroo.cpp | #include <string.h>
#include <random>
#include <fstream>
#include "Kangaroo.h"
#include "SECPK1/IntGroup.h"
#include "Timer.h"
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#include <memory>
#ifndef WIN64
#include <pthread.h>
#endif
#include <unordered_map>
#include <bitset>
#include <vector>
#includ... | ALGO | 0.998879 | 4.267544 |
4159dc90-ee8a-40cc-b5f1-484dd1292847 | BrendanCheong/CS2040C-AY2021-22-SEM2 | Kattis Extra/Conquest/conquest.cpp | /**
* Matric: A0217988E
* Name: Brendan Cheong Ern Jie
* Lab: 10
* TA: Fidella Widjojo
*/
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ull = unsigned long long int;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
#define INF 0x3f3... | ALGO | 0.999974 | 4.434347 |
edb43f64-da0f-47db-8d3e-7422c6c3de6f | vulbyte/leetCodeSolutions | cpp/01446-consecutive_characters.cpp | // class Solution {
// public:
// int maxPower(string s) {
// int len = s.length();
//
// //early exit
// if (len == 1){
// return 1;
// }
//
// //define rest of vars
// int i = 0;
// int maxSubArr = 1;
// int currSubArr = 1;
// c... | ALGO | 0.999948 | 5.76539 |
c604f922-cf91-44b1-be17-8d83687a13f2 | Pikandikos/Project_Triangulation | Εργασία 1 - Γιαννάκος-Νικάνδρου/src/export.cpp | #include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Simple_cartesian.h>
#include <fstream>
#include <iostream>
#include <limits>
#include <cmath>
typedef CGAL::Simple_cartesian<double> K;
typedef CGAL::Constrained_Delaunay_triangulation_2<K> CDT;
void export_to_svg(const CDT &cdt, const std::string ... | ALGO | 0.987368 | 6.92857 |
9fcf984e-7e7e-4604-985d-471369dd74d5 | TylerTheFox/Populous-The-Beginning-Public | Internal/DirectDraw/src/detours/modules.cpp | #define _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS 1
#pragma warning(disable:4068) // unknown pragma (suppress)
#if _MSC_VER >= 1900
#pragma warning(push)
#pragma warning(disable:4091) // empty typedef
#endif
#define _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE 1
#include <windows.h>
#if (_MSC_VER < 1310)
#else
#pragma war... | TOOL | 0.872612 | 5.598823 |
d1ca0f57-b37c-4169-9e7a-71d494e906a2 | Nahiyan01/competitive-coding | CP-31 sheet/1000/Luke is a Foodie.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int t;
cin>>t;
while(t--){
int n,x;
cin>>n>>x;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
int l = a[0] - x;
... | ALGO | 0.999823 | 4.45564 |
8c225501-106b-405d-8d31-aaf718599a86 | Vivekrathore2002/DSA-Coding | 2366-minimum-replacements-to-sort-the-array/2366-minimum-replacements-to-sort-the-array.cpp | class Solution {
public:
long long minimumReplacement(vector<int>& nums) {
int n = nums.size();
int last = nums[n-1]; // Initialize 'last' with the last element
long long ans = 0; // Initialize the total operations count
// Traverse the array in reverse order
for (int i... | ALGO | 0.999836 | 6.507841 |
b8ef99be-f269-4783-9d65-49514dd350d3 | NullAwe/competitive-programming | codeforces/combined/Good Bye 2021/RepresentativeEdges.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_X = 201;
void solve() {
int n; cin >> n;
vector<int> arr(n); for (int i = 0; i < n; ++i) cin >> arr[i];
int mh = 1;
for (int i = 0; i < n; ++i) {
for (int j = 1; j < n; ++j) {
vector<int> diffs; map<int, int> m;
for (int k = i + j; k ... | ALGO | 0.999755 | 4.591016 |
a24c9c80-113f-462f-805b-65926c590eba | ishandutta2007/codeforces | andrew.volchek/normal/383/E.cpp | #include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <list>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <ctime>
#include <cctype>
#include <cstring>
#include <bitset>
#include <algorithm>
using namespace std;
#define ll long long
#define ull... | ALGO | 0.999964 | 3.906797 |
b1d438dd-e26b-4188-9b74-267288843981 | shakib071/Solved-Problem | Count_Me.cpp | #include<bits/stdc++.h>
using namespace std;
class Count{
public:
string st;
int ct;
int time;
Count(string s,int n,int t){
st=s;
ct=n;
time =t;
}
};
class cmp{
public:
bool operator()(Count a, Count b){
if(a.ct<b.ct) return true;
else if(a.ct>b.ct) ... | ALGO | 0.999559 | 4.008561 |
0c1b9796-a441-418c-8207-6b1a602bf277 | MTG/essentia | src/algorithms/tonal/tonicindianartmusic.cpp | #include "tonicindianartmusic.h"
#include "essentiamath.h"
using namespace std;
namespace essentia {
namespace standard {
const char* TonicIndianArtMusic::name = "TonicIndianArtMusic";
const char* TonicIndianArtMusic::category = "Tonal";
const char* TonicIndianArtMusic::description = DOC("This algorithm estimates th... | ALGO | 0.969645 | 6.136569 |
a05778e1-afd9-4266-b8da-41fb6700355c | andre-c01/cpp | exercises/07.cpp | #include <iostream>
using namespace std;
int main() {
float bill;
float money_given;
float change;
cout << "Type Cost: ";
cin >> bill;
cout << "Type Value Given: ";
cin >> money_given;
change = money_given - bill;
if (money_given > bill) {
cout << "Your Change is: " << change << "€" << endl;
} ... | ALGO | 0.879503 | 3.988968 |
c27cff6a-afdd-4866-a098-067872032a58 | MTG/essentia | src/examples/standard_stft.cpp | #include <iostream>
#include <fstream>
#include <essentia/algorithmfactory.h>
#include <essentia/pool.h>
using namespace std;
using namespace essentia;
using namespace standard;
void scaleAudioVector(vector<Real> &buffer, const Real scale)
{
for (int i=0; i < int(buffer.size()); ++i){
buffer[i] = scale * buffer[i]... | TOOL | 0.89157 | 5.323723 |
cc9b53c7-be00-40f9-9880-7e8cca551425 | ShreyamHemanta/Programming | 3rd Sem/OOPS/2022/October/19.10.22/Assignment6_5.cpp | /*WAP to add two objects of time class. Overload the operator ‘==’ to compare two objects
and display whether they are equal or not. Overload the assignment operator*/
#include<iostream>
using namespace std;
class Time
{
int hr,min;
public:
void input()
{
cout<<"Enter time in hour... | ALGO | 0.91769 | 3.802894 |
cdb878a6-a36c-4d8e-9301-ae244cfefdaf | nmp9981/coding_daily_2023 | 20230316_14002.cpp | #include <iostream>
#include <vector>
using namespace std;
int n;
const int maxi = 1001;
int A[maxi];//수열
int Len[maxi];//길이
vector<int> ans;//정답 수열
//max
inline int max(int x, int y) {
return x > y ? x : y;
}
//초기화
void init() {
for (int i = 0; i < n; i++) Len[i] = 1;//기본적으로 길이 1
}
//입력
void input() {
cin >> n;
... | ALGO | 0.999993 | 4.127295 |
3bdeef96-cd8b-4f81-b4e3-eb69c20d0a4e | GaisaiYuno/OI-Record-exe-deleted | Grade 8-9/G9S2/GDOI review/Chairman Tree/Model.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
#define inf 0x7fffffff
using namespace std;
inline int read(){
int re=0,flag=1;char ch=getchar();
while(ch>'9'||ch<'0'){
if(ch=='-') flag=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9') re=(re<<1)+(re<<3)+ch-'0',ch=getcha... | ALGO | 0.999993 | 3.717079 |
ae7e4a80-1971-4070-9402-68bab5b9575a | Eckankar/usaco | section1.3/barn1.cpp | /*
ID: eckanka1
PROG: barn1
LANG: C++
*/
#include <fstream>
#include <algorithm>
#include <queue>
//#include <iostream>
using namespace std;
class Space {
public:
int space;
int left;
Space(int space, int left) {
this->space = space;
this->left = left;
}
};... | ALGO | 0.999961 | 3.783629 |
b23acb78-f5ef-4b99-8b5e-0baea4f78ee6 | SudoRmQ/CS_QU | CMPS151/Print EVEN numbers from 1 to 100.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
//Print EVEN numbers from 1 to 100
int i = 0; //start from 0 or 2 if you want
while ( i <= 100)
{
cout << i << endl;
i=i+2;
}
return 0;
} | ALGO | 0.869918 | 3.607397 |
05c0d56c-8872-465a-a16d-9b305145f868 | junes7/CPPalgorithm | KOISTUDY/1849.cpp | // 함수로 실수(double) 3.1415926535897 리턴하기
// return real number(double) 3.1415926535897 through function
// 3.1415926535897 를 출력하시오. 단, 함수형 문제이므로 함수 f()만
// 작성하시오.
# include <iostream>
double f(){
return 3.1415926535897;
}
int main(){
printf("%.13lf\n",f());
} | TOOL | 0.911089 | 3.508698 |
58d1277d-a0ba-428c-ba54-5ad85e4e79a1 | chrstyy/latihanUTS | 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.998764 | 6.762122 |
57f7ef1f-c8ef-4ada-943c-19fde1e8b012 | sumanthumesh/VLDB_Artifacts | hyrise/src/lib/optimizer/strategy/dependent_group_by_reduction_rule.cpp | #include "dependent_group_by_reduction_rule.hpp"
#include <unordered_map>
#include "expression/expression_functional.hpp"
#include "expression/expression_utils.hpp"
#include "hyrise.hpp"
#include "logical_query_plan/abstract_lqp_node.hpp"
#include "logical_query_plan/aggregate_node.hpp"
#include "logical_query_plan/l... | ALGO | 0.995134 | 7.611401 |
cfd282f7-1958-4055-b226-76987845ed0b | Vinit-28/POTD-Leetcode | Year=2023/Month=12/Date=30/Solution.cpp | // Problem Link : https://leetcode.com/problems/redistribute-characters-to-make-all-strings-equal/description/
// Solution //
class Solution {
public:
bool makeEqual(vector<string>& words) {
int totalWords = 0;
int charMap[26] = {0};
for(auto &word : words){
for(auto &ch : word)... | ALGO | 0.999943 | 6.125407 |
9aa97582-0497-4489-a651-b219cac262d7 | henryoier/leetcode | 438_FindAllAnagramsInAString/438_FindAllAnagramsInAString.cpp | /*************************************************************************
> File Name: 438_FindAllAnagramsInAString.cpp
> Author: Sheng Qin
> Mail: <EMAIL>
> Created Time: Mon Oct 24 10:18:49 2016
************************************************************************/
#include<iostream>
using namespace std;
... | ALGO | 0.999699 | 5.55216 |
e7e2ce0f-2865-4626-afb6-6ad970ae3cce | ellynhan/challenge100-codingtest-study | hall_of_fame/wi-seong-cheol/BOJ/0x08 Stack II/10799.cpp | //
// 10799.cpp
// main
//
// Created by wi_seong on 2022/11/10.
//
/*
[Input]
()(((()())(())()))(())
[Output]
17
*/
// 시간복잡도: O(n)
// 최악시간: 100,000
// 난이도: Silver 2
// Timer: 7m
// Url: https://www.acmicpc.net/problem/10799
#include <iostream>
#include <string>
#include <stack>
using namespace std;
int ma... | ALGO | 0.999747 | 4.780318 |
e96eb37f-528a-4278-87bc-7cb753da4c22 | civinx/ACM_Code | Practice/POJ/3026 Borg Maze(BFS + Prim)/3026 Borg Maze(BFS + Prim)/main.cpp | #include <map>
#include <queue>
#include <vector>
#include <string>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int maxn = 200;
const int maxx = 20000;
const int dir[4][2] = {{-1,0},{1,0},{0,-1},{0,1}};
struct P {
int x, y;
bool operator < (const P &rhs) const {
... | ALGO | 0.998945 | 4.138304 |
b263b2d7-72de-4c16-a353-8d4ea7b63165 | Rifat-Ahammed/C-problem | pur.cpp | #include <bits/stdc++.h>
using namespace std;
const long long N=1e6+10;
int main(){
string S;
cin>>S;
int count=0;
for(int i=0; i<S.size(); i++){
if( S[i] =='a')count+=1;
else if(S[i]=='b')count +=2;
else if(S[i]=='c')count +=3;
}
if(count == 6)
cout<<"Y... | ALGO | 0.999905 | 3.795123 |
a24a601a-7a4d-4e23-b471-e4c4b944ea49 | Tomlord1122/llvm-project | libc/src/math/generic/fmaximum_mag_numf.cpp | #include "src/math/fmaximum_mag_numf.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, fmaximum_mag_numf, (float x, float y)) {
return fputil::fmaximum_mag_num(x, y);
}
} // names... | ALGO | 0.985811 | 6.162753 |
b6564ea8-6677-4e9e-9715-a4fa39fd57f0 | adityajamwal02/LeetcodeProblemSet1 | MajorityElement2.cpp | /*
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times.
Example 1:
Input: nums = [3,2,3]
Output: [3]
Example 2:
Input: nums = [1]
Output: [1]
Example 3:
Input: nums = [1,2]
Output: [1,2]
*/
class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
int ... | ALGO | 0.99999 | 5.768083 |
eac96331-8c16-4637-b608-ed9ef9c21e6e | VinayakJamadar/DSA | Dynamic Programming/Code/Part 5 - DP on Strings/Lect 33 - DP on Strings - Edit Distance/Method_4_Space_Optimization.cpp | // Topic : DP on Strings
// Problem : Edit Distance
// Method 4 : Using Space Optimization (Bottom-Up DP --> Base Cases to Recursive Cases)
// Time Complexity : O(n*m)
// Reason : As we are using two nested For Loops (n and m iterations)
// Auxiliary Space Complexity : O(1)
// Reason : Auxiliary space take be recurs... | ALGO | 0.999997 | 6.29702 |
9d595dd0-aa60-4c9c-a893-6d11a63bc1b7 | Den-Git-CPP/LeetCode | 724_Find_Pivot_Index.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solutions
{
public:
Solutions(/* args */) {}
~Solutions() {}
int pivotIndex(std::vector<int>& nums) {
int sum = 0, leftSum=0, i=0;
for( const int& num : nums ) sum += num;
for( const int& num : nums )
... | ALGO | 0.99997 | 5.792587 |
5f9d4949-d70c-4774-b8cd-b62eec76cb8e | raincross7/code-similarity | codes/train_code/problem261/problem261_360.cpp | #include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<numeric>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;
using ll = long long;
class Stream{
public:
Stream(){
}
//配列以外の... | ALGO | 0.999639 | 3.373638 |
0f054e90-ee26-49a9-adcf-1769e6c40e28 | kk-laoguo/ollvm-13 | llvm-project-13/llvm/lib/CodeGen/SwitchLoweringUtils.cpp | #include "llvm/CodeGen/SwitchLoweringUtils.h"
#include "llvm/CodeGen/FunctionLoweringInfo.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
using namespace SwitchCG;
uint64_t SwitchCG::getJumpTableRange(const CaseClu... | ALGO | 0.996897 | 5.256638 |
9ac288c7-6419-40d5-a5fa-f8e22278c8ed | Lokesh-1910/contacts_app-original-for-Appathon | 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 |
8fdbe359-1366-405e-9ba8-224895780f28 | ArmedXDaddy/osprey_repo | 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 |
47ff6646-1283-414d-95a9-ff962f482da3 | waingram/code-embeddings | test_data/C++/Greatest-element-of-a-list/greatest-element-of-a-list.cpp | #include <algorithm>
#include <cassert>
template<typename Ty> Ty max(unsigned int count, Ty values[]) {
assert(count > 0);
return *std::max_element(values, values + count);
}
| ALGO | 0.995554 | 5.688236 |
8c76681c-19e6-4915-9e5a-40aa2dfff407 | iamsayantan1/Programming-And-Personal-Development | CPP/kruskal.cpp | #include<bits/stdc++.h>
using namespace std;
void makeSet(int n, int parent[]) {
for(int i=1;i<=n;i++) {
parent[i] = i;
}
}
int find(int i, int parent[]) {
while(parent[i] != i) {
i = parent[i];
}
return i;
}
bool cmp(vector<int> A, vector<int> B) {
return A[2] < B[2];... | ALGO | 0.999902 | 4.385336 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.