uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
15eb8cbd-6217-4b3e-afea-6bed02272d39 | qkrtjddn0628/C-and-Cplusplus-note | Project1/4-5-2. for문 예제2.cpp | #include<stdio.h>
int main() {
// 1~n ϴ α
int n;
scanf_s("%d", &n);
int sum = 0;
for (int i = 1; i <= n; i++) {
sum += i; // sum = sum + i;
}
printf('%d\n', sum);
} | ALGO | 0.996448 | 3.654224 |
07a8f3cb-0fb2-4298-9614-67fd0a3f1e45 | 9kyo-hwang/Problem-Solving | 프로그래머스/unrated/181857. 배열의 길이를 2의 거듭제곱으로 만들기/배열의 길이를 2의 거듭제곱으로 만들기.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> arr) {
while(arr.size() & arr.size() - 1) // 2의 제곱수는 비트로 표현 시 왼쪽 1비트만 1이고 나머지 0 -> 따라서 size와 size - 1을 and 연산해서 0이면 size는 2의 거듭제곱수
arr.emplace_back(0);
return arr;
} | ALGO | 0.999789 | 4.751252 |
ae6b9482-4629-4d31-8e45-0e6efde496cc | shankerabhigyan/dsa-code | DP/minSidewaysJump.cpp | // https://leetcode.com/problems/minimum-sideway-jumps/
#include<bits/stdc++.h>
using namespace std;
int getminSideJumpsMem(vector<int>&obstacles, int &n, int x, int y, vector<vector<int>> &dp){
if(x==n){
return 0;
}
if(dp[x][y]!=-1){
return dp[x][y];
}
if(obstacles[x+1]==y){
... | ALGO | 0.999951 | 4.571764 |
18fa47b5-848b-4cfa-9b1b-cae323dcd84e | liangkyle08/competitive-programming | USACO/multiplayer-moo.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
const int MOD = 1e9+7;
const int INF = (1<<30);
const int ALP = 26;
const long long LL_INF = (1LL<<60);
const int MAX_N = 250;
const int MAX_A = 1e6;
int N;
int A[MAX_N + 5][MAX_N + 5];
int maxComp[MAX_A + 5];
int total[MAX_A + 5];
boo... | ALGO | 0.999833 | 4.429566 |
829e0055-883f-4a29-8d35-cbe5808d8509 | NCAR/lrose-core | codebase/libs/euclid/src/GeographicLib/GeodesicExactC4.cpp | #include <euclid/GeographicLib/GeodesicExact.hpp>
namespace GeographicLib {
using namespace std;
// If the coefficient is greater or equal to 2^63, express it as a pair [a,
// b] which is combined with a*2^52 + b. The largest coefficient is
// 831281402884796906843926125 = 0x2af9eaf25d149c52a73ee6d
// = 1... | ALGO | 0.998776 | 5.591315 |
3c7b95d0-2fb9-40c7-b405-e702aed7ee2a | ffallrain/lammps_waterbox | src/fix_dt_reset.cpp | #include <math.h>
#include <stdlib.h>
#include <string.h>
#include "fix_dt_reset.h"
#include "atom.h"
#include "update.h"
#include "integrate.h"
#include "domain.h"
#include "lattice.h"
#include "force.h"
#include "pair.h"
#include "modify.h"
#include "fix.h"
#include "output.h"
#include "dump.h"
#include "comm.h"
#inc... | TOOL | 0.911926 | 6.349414 |
d34a2122-541e-472c-8b25-04ef8a1f75dd | Nikita12112002/Placement_Preparation_Module | Graph/Kruskals_algorithm.cpp | #include <bits/stdc++.h>
using namespace std;
int findPar(int node , vector<int>&par)
{
if(par[node]==node)
return node;
par[node]=findPar(par[node],par);
return par[node];
}
void union_find(int a , int b , vector<int>&rank , vector<int>&par)
{
a=findPar(a,par);
b=findPar(b,par);... | ALGO | 0.999999 | 4.34191 |
21d5a530-05fd-4515-a4a8-44d5b2578a64 | KYLIN-KYN/kylin | src/rest.cpp | #include "chain.h"
#include "chainparams.h"
#include "primitives/block.h"
#include "primitives/transaction.h"
#include "validation.h"
#include "httpserver.h"
#include "rpc/server.h"
#include "streams.h"
#include "sync.h"
#include "txmempool.h"
#include "utilstrencodings.h"
#include "version.h"
#include <boost/algorith... | WEB | 0.942046 | 4.954602 |
777ab8c7-236f-4c26-bc5b-ab9f4a4b4d92 | yakuri354/cp | prev/tink/heur/b.cpp | // #pragma GCC optimize("Ofast")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using fl = long double;
const ll inf = INT32_MAX;
ll fld[10][10];
ll n, m, c;
ll f() {
ll ans = 0;
for (ll i1 = 0; i1 < n; i1++) {
for (ll j1 = 0; j1 ... | ALGO | 0.999892 | 3.358561 |
30343ea2-59bc-4aff-bbd9-c2f7650e5574 | jeete121/Coding | Programs/Practice/Prac/GraphAlgorithms/rajan_and_odd_frequency_number.cpp | #include <bits/stdc++.h>
using namespace std;
long long oddFrequency(long long n, long long a[])
{
long long ans = a[0];
for (long long i = 1; i < n; i++)
ans = ans ^ a[i];
return ans;
}
int main()
{
long long n = 2;
n = 2 * n + 1;
long long a[n] = {1, 2, 3, 2, 1};
cout << oddFreq... | ALGO | 0.99998 | 3.69699 |
a5dac70d-6fb3-4aa7-9138-b119d1b176be | niraj9504/-SdeSheetChallenge | strings/Rabin Carp.cpp | //m1(wrong but keep in mind)
vector<int> stringMatch(string &s, string &p) {
//int idx=s.find(p);
vector<int> ans;
// if(idx!=string::npos)
// ans.push_back(idx);
// else return ans;
int idx=0;
while((idx=s.find(p,idx))!=string::npos){
ans.push_back(idx);
idx+=p.size();
... | ALGO | 0.999955 | 4.669131 |
fa3ba5be-168d-4f9e-95ea-d2d9cd26ddac | parabel1um/Programavimo-uzdaviniu-sprendimai | A_Cheap_Travel.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m, a, b;
double priceMin;
int kaina;
cin >> n >> m >> a >> b;
priceMin = min((double)a, (double)b / m);
if (priceMin == a) {
kaina = n * a;
} else {
int kiek = n / m;
int lik = n % ... | ALGO | 0.999143 | 3.446158 |
5f26cec4-373e-487e-b5d9-f5ce838e8f2e | ielevenliu/Algorithm_Dome | CopyListWithRandom.cpp | /*
* @Author: lwl
* @Date: 2019-12-23
* @Description: ָʱ临ӶΪ O(N)ռ临ӶΪ O(1)
*/
#include <iostream>
using namespace std;
struct Node {
int val;
Node* next;
Node* rand;
Node(int value) {
val = value;
next = nullptr;
rand = nullptr;
}
};
class CCopyList {
public:
Node* copyList(Node* head) {
Node* newHead ... | ALGO | 0.997605 | 3.979274 |
57573ac9-c449-4e60-a877-c260626e2ebb | SiddharthYadav-v/CSES-Problem-Set | Tree Algotihms/treeDiameter.cpp | #include<bits/stdc++.h>
using namespace std;
int x, y;
pair<int, int> bfs(int src, vector<vector<int>>& graph) {
int n=graph.size();
int d=0;
queue<pair<int, int>> q;
q.push({src, 0});
vector<bool> vis(n, false);
pair<int, int> u;
while(!q.empty()) {
u=q.front();
vis[u.fir... | ALGO | 0.999908 | 4.207602 |
9b891641-3046-47a9-9257-33a42e149538 | WillPen/leetCode | code/696. 计数二进制子串-E-看了答案才做出来/main.cpp | /*
给定一个字符串 s,统计并返回具有相同数量 0 和 1 的非空(连续)子字符串的数量,并且这些子字符串中的所有 0 和所有 1 都是成组连续的。
重复出现(不同位置)的子串也要统计它们出现的次数。
*/
#include <iostream>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
using namespace std;//使用标准命名空间
//00111
class Solution {
public:
int countBinarySubs... | ALGO | 0.999969 | 5.481214 |
4ab314a4-dc73-4826-9e0b-afb64f173b4e | pavelsimo/ProgrammingContest | codeforces/PastContest/Codeforces Beta Round #6 (Div. 2 Only)/E.cpp | #include <iostream>
#include <vector>
#include <set>
using namespace std;
multiset<int> S;
vector<int> ans;
int a[100002], best;
int main(int argc, char *argv[]) {
std::ios_base::sync_with_stdio(false);
int n, k;
cin >> n >> k;
for(int i = 0; i < n; ++i)
cin >> a[i];
S.insert(a[0]);
int ma = ... | ALGO | 0.999926 | 4.142617 |
3a46937a-e2a3-4588-bbc1-15d7716f594b | vg11k/Advent-of-Code-2023 | Sujet 12/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <omp.h>
using namespace std;
// compile with: /openmp
static string fileInputName = "input.txt";
//static string fileInputName = "example.txt";
class Spring {
private:
vector<st... | ALGO | 0.999848 | 4.765759 |
ee120e1a-771d-436a-8141-fe511eb4c698 | shoukailiang/algorithm | leetcode/algorithms/40. 组合总和 II/1.cpp | class Solution {
private:
vector<int> path;
vector<vector<int>> result;
void backtracking(vector<int> &candidates, int target, int sum, int startIndex) {
if(sum>target){
return;
}
if(sum==target){
result.push_back(path);
return;
}
f... | ALGO | 0.999995 | 6.507443 |
730a46ec-3a28-4df6-9425-d8bad5dc9295 | mtri1310/dk | Cpp/sapxep.cpp | #include<iostream>
#include <iomanip>
using namespace std;
int main() {
int n;
cin >> n;
cout << setprecision(2) << n;
return 0;
}
| ALGO | 0.998767 | 3.369452 |
c237a677-5d03-43ba-85fd-61813747ea17 | atsb/daikatana-restoration-project | base/dk_/dk_inv.cpp | ///////////////////////////////////////////////////////////////////////////////
// dk_inv.c
//
// inventory management routines
///////////////////////////////////////////////////////////////////////////////
#include "server.h"
#include "qcommon.h"
#include "dk_inv.h"
// inventory subsystem
/////////////////////////... | TOOL | 0.859185 | 4.875253 |
072a23ae-e3c9-4629-bd8e-d74ab110f76f | artium59/algo_study | BOJ/1966.cpp | #include <iostream>
#include <queue>
using namespace std;
int main() {
int t, n, m, p;
scanf("%d", &t);
for (int h = 0; h < t; h++) {
int dest, count = 0;
queue<pair<int, int>> prints;
priority_queue<int> order;
scanf("%d %d", &n, &m);
for (int i = 0; i < ... | ALGO | 0.999902 | 3.895705 |
c0e821f1-3f53-4b19-9d75-77dbfb2591a4 | ishandutta2007/codeforces | jdurie/normal/1691/D.cpp | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
template<class T, class S>
ostream& operator << (ostream &o, const pair<T, S> &p) {
return o << '(' << p.first << ", " << p.second << ')';
}
template<template<class, class...> cla... | ALGO | 0.999922 | 4.039716 |
b6421f0f-e1d2-4785-9d29-e681e1badfae | VarionDrakon/OSSS | lib/cryptopp/rsa.cpp | // rsa.cpp - originally written and placed in the public domain by Wei Dai
#include "pch.h"
#include "rsa.h"
#include "asn.h"
#include "sha.h"
#include "oids.h"
#include "modarith.h"
#include "nbtheory.h"
#include "algparam.h"
#include "fips140.h"
#include "pkcspad.h"
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_... | ALGO | 0.899605 | 7.560223 |
a81a23f0-32c1-4642-8345-e5fbfcf96a4b | BryanHdezL/Cpp_ATS | Ordenamiento/insercion.cpp | //Metodo de ordenamiento por insercion.
#include <iostream>
using namespace std;
int main(){
int num[] = {4, 1, 2, 3, 5};
int aux, pos;
//Algoritmo de forma ascendente.
for (int i = 0; i < 5; i++){
pos = i; // Indicador de cada posicion del arreglo.
aux = num[i]; //Almacena el val... | ALGO | 0.999981 | 4.469234 |
fd15a0bd-461f-443f-a751-76d2ff250dc7 | Saksham-Aggarwal-1/Leetcode-problems | 516-longest-palindromic-subsequence/516-longest-palindromic-subsequence.cpp | class Solution {
public:
int longestPalindromeSubseq(string s) {
int n = s.length();
vector<vector<int>> dp(n, vector<int>(n, 0));
for(int i=n-1;i>-1;i--)
{
dp[i][i]=1;
for(int j=i+1;j<n;j++)
{
if(s[i] == s[j])
... | ALGO | 0.999933 | 6.269067 |
307b93fe-335b-4076-922b-319aefba46be | christt105/Pinball-Box2D | Pinball_box2D/Box2D/Box2D/Collision/b2DynamicTree.cpp | #include <Box2D/Collision/b2DynamicTree.h>
#include <string.h>
b2DynamicTree::b2DynamicTree()
{
m_root = b2_nullNode;
m_nodeCapacity = 16;
m_nodeCount = 0;
m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode));
memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode));
// Build a linked list for th... | ALGO | 0.997223 | 7.786732 |
f3212397-c3f2-4a46-b2dc-1aa44f21ca60 | aswinpm-ofc/data-structures | ds/array.cpp | #include"Array.h"
template <class T>
Array<T>::Array(){
LB=1;
UB=0;
}
template <class T>
Array<T>::Array(int LB,int UB,T x[]){
}
template <class U>
ostream& operator << (ostream& os,Array<U> M){
int i;
os<<endl;
for (i=M.LB;i<=M.UB;i++){
os<<M.A[i]<<" ";
}
os<<endl;
return os;
}
template <class T>
void Ar... | ALGO | 0.995967 | 4.250329 |
29c35aa0-5aef-4fc3-aba8-18f5f72f2a8f | llCnll/algorithm | leetcode/unique-paths-ii.cpp | #include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
int uniquePathsWithObstacles(int obstacleGrid[][3], int obstacleGridSize, int* obstacleGridColSize){
int m = obstacleGridSize;
int n = obstacleGridColSize[0];
int ** dp = (int**)malloc(sizeof(int*)*m);
for (int i = 0; i < m; ... | ALGO | 0.999624 | 4.647379 |
4c56d64a-25e8-405d-9e10-503225009d7a | geekygirl8/Hacktoberfest_2022_DSA | C++/C++/finding-mk-average.cpp | // Time: ctor: O(1)
// add_element: O(logn)
// calc_mkaverage: O(1)
// Space: O(m)
class MKAverage {
public:
MKAverage(int m, int k)
: m_{m}
, k_{k} {
}
void addElement(int num) {
if (size(dq_) == m_) {
remove(dq_.front());
... | ALGO | 0.999892 | 6.195759 |
f9cf7aaa-4eaf-4f6e-a497-382472dad371 | clarabalcantara/competitive-programming | Programa Olimpico de Programação IFPB/magicacomprata.cpp | #include <bits/stdc++.h>
using namespace std;
// 6 3
// 10 7 6 4 10 10
// XOR (^)
// 10 ^ 7 = 13
// 1010 ^ 0111
// 1010
// 0111
// -----
// 1101 => 13
// operação inversa do xor == o proprio xor
// se dois bits forem iguais = 0
// se dois bits forem diferentes = 1
#include <bits/stdc++.h>
using namespace std;
int m... | ALGO | 0.999993 | 5.09867 |
749748f7-f055-4d86-959e-f3683b1d641f | blandamellus/CCS | alp_eletrica_course/alp_codes/701_ataque_rainha_matriz_2D.cpp | #include<stdio.h>
#include <stdlib.h>
#define N 8
// a ultima dimensao deve ser declarada
void inicializa_matriz( int matriz[][N] , int );
void imprime_matriz( int matriz[N][N] , int );
void ataques_rainha( int matriz[][N] , int , int, int);
int posicao_legal_do_REI( int matriz[][N] , int , int, int);
int... | ALGO | 0.999883 | 3.638869 |
2a0f9012-1261-4736-be53-191d9935ed9b | Master5T3V3/tareas_prog1 | main_tres_en_raya.cpp | //Programa creado por: Brian Steve Rodas Hernandez
//Ultima fecha de modificacion 28/09/2018
#include <iostream> //Libreria de entradas y salidas
using namespace std; //Implificar codigo
char square[10] = {'o','1','2','3','4','5','6','7','8','9'}; //Variable para los codigos del tablero
int checkwin(); //Variable pa... | ALGO | 0.99787 | 4.013175 |
c6327866-140b-4301-b775-cc69537b43be | harvard-acc/gem5-aladdin | src/systemc/tests/systemc/misc/v1.0/dash3/pulse.cpp | /*****************************************************************************
pulse.cpp -- Implementation of the pulse generator.
Original Author: Ali Dasdan, Synopsys, Inc.
*****************************************************************************/
/*****************************************************... | TOOL | 0.928847 | 6.367835 |
b596b1d7-610e-4f34-aa67-a55f3c57b13b | SmartCash/Core-Smart | src/messagesigner.cpp | #include "base58.h"
#include "hash.h"
#include "validation.h" // For strMessageMagic
#include "messagesigner.h"
#include "tinyformat.h"
#include "utilstrencodings.h"
bool CMessageSigner::GetKeysFromSecret(const std::string strSecret, CKey& keyRet, CPubKey& pubkeyRet)
{
CBitcoinSecret vchSecret;
if(!vchSecret.... | TOOL | 0.933035 | 6.766189 |
6c5280b5-ecc7-469b-901f-7f9c4141c3a2 | logan818/Anet-A8 | Marlin-2.0.x/Marlin/src/lcd/menu/menu_delta_calibrate.cpp | //
// Delta Calibrate Menu
//
#include "../../inc/MarlinConfigPre.h"
#if HAS_LCD_MENU && EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)
#include "menu_item.h"
#include "../../module/delta.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#if HAS_LEVELING
#include "../../feature/bedleve... | TOOL | 0.900564 | 7.196941 |
73f17c25-3d48-45fd-820b-113c05defd54 | bran-x/easy_software | example/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.998831 | 6.761023 |
06ba4ad5-0d7d-43c8-9801-76db3d21e85e | yilinguo121/cp | abc277c.cpp | #include <bits/stdc++.h>
using namespace std;
#define IO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
const long long INF = numeric_limits<int>::max();
bitset<1000000001> vis;
int main() {
int n;
cin >> n;
map<int, vector<int>> v;
while (n--) {
int a, b;
cin >> a >> b;
v[a].push_back(b);
v[b].push_back... | ALGO | 0.993488 | 4.148571 |
40c17090-3644-4c2c-957a-e9e9f1e28f33 | Harshit-Kumar-Singh/Code-Forces | A_Odd_Selection.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll N = 100000;
void solve()
{
ll n, x;
cin >> n >> x;
ll count_odd = 0;
ll count_even = 0;
for (int i = 0; i < n; i++)
{
ll no;
cin >> no;
if (no & 1)
{
if (count_odd >= x)
... | ALGO | 0.999898 | 4.370982 |
a3b70ff0-861b-4b00-852d-fca1def06561 | rylahs/Algorithm-2024- | BOJ/24.03/24.03.04/10872.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
long long res = 1;
if (n == 0)
cout << res << '\n';
else
{
for (int i = 1; i <= n; i++)
res *= i;
cout << res << '\n';
}
return 0;
} | ALGO | 0.999993 | 5.258837 |
b269b779-629d-461e-9658-c4d1f271e3cc | Jinseok-Heo/ps | baekjoon_1167.cpp | #include <iostream>
#include <vector>
#define p pair<int, int>
using namespace std;
void inputData(int &numberOfPoint, vector<vector<p>>& container) {
cin >> numberOfPoint;
container.resize(numberOfPoint + 1);
for (int i = 0; i < numberOfPoint; i++) {
int first, second, dist;
cin >> fir... | ALGO | 0.999838 | 4.331511 |
d5b4fdc0-26e9-4abc-81c1-4742cb22a3b5 | anshgupta6031/Cpp | 02_practice/practice_85.cpp | // print factorial of first n natural numbers and modulo the result by 10^9 + 7.
#include <bits/stdc++.h>
using namespace std;
vector <long long int> factorial (int n){
vector <long long int> fact (n+1, 1);
int mod = 1000000007;
for (int i=2; i<=n; i++){
fact[i] = ((fact[i-... | ALGO | 0.999619 | 4.72116 |
e4bdcd13-798a-4f54-8406-e0b1f7bb8972 | SVA-BL00/LeetCode | squares-of-a-sorted-array/squares-of-a-sorted-array.cpp | #include <algorithm>
class Solution {
public:
vector<int> sortedSquares(vector<int>& nums) {
for(int i = 0; i < nums.size(); i++){
nums[i] = nums[i] * nums[i];
}
sort(nums.begin(), nums.end());
return nums;
}
}; | ALGO | 0.999988 | 5.833578 |
4cd57a5f-f30f-4619-bc86-d6dd036157e9 | kumarrahul33/learning_stuff | random_stuff/test_and_trails.cpp | #include<bits/stdc++.h>
using namespace std;
int getbin(int n){
int bin=0;
int i=0;
while(n!=0){
bin+=(pow(10,i))*(n%2);
n=n/2;
//cout<<bin<<" "<<n<<endl;
i++;
}
return bin;
}
int main(){
#ifndef ONLINE_JUDGE
freopen("/home/rahul/Code/C++/input.txt" , "r" ,... | ALGO | 0.999905 | 3.730607 |
d63e9e25-4dab-4e31-973d-cfee2fc9900a | zim2510/Online-Judge-Solves | UVA/Cutting Carrots.cpp | #define MAX_N 2
struct Matrix
{
int mat[MAX_N][MAX_N];
};
Matrix matMul(Matrix a, Matrix b) // O(n^3)
{
Matrix ans;
int i, j, k;
for (i = 0; i < MAX_N; i++)
for (j = 0; j < MAX_N; j++)
for (ans.mat[i][j] = k = 0; k < MAX_N; k++) // if necessary, use
ans.mat[i][j] +... | ALGO | 0.99986 | 3.45701 |
15da3c33-97f6-4e8b-bc50-e77f0e7ddf61 | Kia420/https-github.com-llvm-llvm-project-staging | libcxx/test/std/containers/sequences/forwardlist/forwardlist.ops/sort.pass.cpp | // <forward_list>
// void sort();
#include <forward_list>
#include <iterator>
#include <algorithm>
#include <vector>
#include <random>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
std::mt19937 randomness;
template <class C>
void test(int N)
{
typedef typename C::value_type T;
type... | TEST | 0.955269 | 6.478312 |
290f69d7-412b-4176-b608-6f323fd7c946 | insilications/vscode-copilot-chat | src/extension/prompts/node/test/fixtures/problem1.cpp | #include "BinaryTreeProblems.h"
#include<stack>
/*
* 题目1: 统计二叉树中度为1的结点个数
*
* 请在此处完成你的代码:
*/
int countDegreeOneNodes(TreeNode* rootss) {
int ans=0;
auto root=rootss;
std::stack<TreeNode*>s;
while (!s.empty() or root)
{
while(root){
s.push(root);
root=root->left;
... | ALGO | 0.995914 | 5.22951 |
c1bf21c2-120a-401a-99f8-12ee1743be93 | OmBharsakle/C-Plus-Plus-Language | 06. Inheritance/01.cpp | //Q.1 Write a Program to find the sum of all three numbers cubes by implementing single-level inheritance: Class X->Class Y
// Class X has the following members: a, b & c attributes in integer data type
// Class Y has the following members: setData() and getData() methods
#include<iostream>
using namespace std;
class X... | TOOL | 0.904089 | 3.829352 |
95d12060-5984-46d9-ac5e-77238ef6d818 | manish-kumar1/CPP-with-DSA-Problem | Interview Problem/NextGreaterDigit.cpp |
#include<iostream>
#include<vector>
using namespace std;
int NextGreaterDigit(vector<int> &num, int target){
int left = 0;
int right = num.size() - 1;
int ans = 0;
while(left <= right){
int mid = left + (right - left) / 2;
if(num[mid] == target){
left = mid + 1;
... | ALGO | 0.999983 | 4.26657 |
c7c609a9-993d-4206-9341-9fe564118d5f | Ethereal-OS/external_libcxx | test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp | // UNSUPPORTED: c++98, c++03, c++11, c++14
// XFAIL: c++17, c++2a
// <functional>
// boyer_moore_horspool searcher
// template<class RandomAccessIterator1,
// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
// class BinaryPredicate = equal_to<>>
// class boyer_moore_h... | TEST | 0.904942 | 6.652854 |
4b84bd49-462c-4c26-85b2-c42322848813 | codecraft26/DSA | graph/bfs.cpp | #include "bits/stdc++.h"
using namespace std;
const int N=1e5+2;
bool vis[N];
vector<int> adj[N] ;
int main()
{
for(int i=0;i<N;i++)
vis[i]=0;
int n,m;// number of node and edges
cin>>n>>m;
int x,y;
for(int i=0;i<m;i++){
cin>>x>>y;
adj[x].push_back(y);
adj[y].push_back(x);
... | ALGO | 0.999996 | 4.156128 |
897e8a28-a064-499d-8b1f-0274534aa05a | anupam6335/DATA-STRUCTURE | Array/apna college/22.cpp | #include<bits/stdc++.h>
using namespace std;
// https://practice.geeksforgeeks.org/problems/trapping-rain-water-1587115621/1#
// https://leetcode.com/problems/trapping-rain-water/submissions/
// https://youtu.be/FbGG2qpNp4U
int trap(vector<int>& arr) {
// vector<int>mxr,mxl;
int n=arr.size();
in... | ALGO | 0.999908 | 6.131539 |
e77e42b6-7016-4d5d-b2d5-e9a16f70c9ea | shubham-begn/DSA | Graph/Maximal_network_rank_leetcode.cpp | int maximalNetworkRank(int n, vector<vector<int>>& roads) {
vector<int> vec(n); // will keep sum of how many roads (incoming/outgoing) for all cities
vector<vector<int>> rdNum(n, vector<int>(n,0)); //matrix values will set to 1 if the pair of cities has road between them
int i,j, s... | ALGO | 0.999878 | 5.323089 |
0138819f-b250-4c74-a728-88cb2ae14ac8 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3682_4.cpp | #include <bits/stdc++.h>
using namespace std;
int clrsvis[100005];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin >> n >> m;
int clr[100005];
vector<int> clrindx[100005];
vector<int> adj[100005];
for (int i = 0; i < n; i++) {
cin >> clr[i];
clrindx[clr[i]].push_back(... | ALGO | 0.999942 | 4.524697 |
541227d1-7ba7-4986-ab5d-e1cbe0bb5ffd | jocelynkang/UCLA-CS32-Projects | project/project1/Game.cpp | ///////////////////////////////////////////////////////////////////////////
// Game implementation
///////////////////////////////////////////////////////////////////////////
#include <iostream>
using namespace std;
#include "Game.h"
#include "Arena.h"
#include "Player.h"
class player;
Game::Game(int rows, int cols... | TOOL | 0.96484 | 4.649649 |
0d7e4463-42e7-4040-a0d7-f61b6738f8c7 | wangfengjs/codeforwork | leetcode/tips/2/src/reorderList/reorderList.cpp | // Source : https://oj.leetcode.com/problems/reorder-list/
// Author : Hao Chen
// Date : 2014-06-17
/**********************************************************************************
*
* Given a singly linked list L: L0→L1→…→Ln-1→Ln,
* reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…
*
* You must do this in-place without... | ALGO | 0.999992 | 5.472514 |
8d2def22-8d44-4738-9599-0375d69706f5 | colinauyeung/CPSC457-F22-Notes | WeekLast/linkedlistexample/linkedlist.cpp | #include<iostream>
#include<cstring>
#include<list>
#include<vector>
using namespace std;
struct customer{
int id;
int items;
};
using customerref = std::list<customer>::iterator;
class lineup{
private:
std::list<customer> line;
std::vector<std::list<customerref>> customers;
public:... | TOOL | 0.99197 | 4.547537 |
e660ad28-7ff3-493e-8cc8-bbb3f4f1e6a9 | ishandutta2007/codeforces | wifiiii/normal/1598/F.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n;
cin >> n;
vector<string> a(n);
vector<int> cnt(n);
vector<map<int,int>> mp(n);
vector<vector<int>> mn(n);
vector<vector<vector<int>>> qwq(n);
for(i... | ALGO | 0.999555 | 3.816477 |
fc58764b-5844-43e1-ad9c-ed6ab2928c09 | mabseher/htd | src/htd/BreadthFirstGraphTraversal.cpp | #ifndef HTD_HTD_BREADTHFIRSTGRAPHTRAVERSAL_CPP
#define HTD_HTD_BREADTHFIRSTGRAPHTRAVERSAL_CPP
#include <htd/Globals.hpp>
#include <htd/Helpers.hpp>
#include <htd/BreadthFirstGraphTraversal.hpp>
#include <deque>
#include <tuple>
#include <stdexcept>
#include <unordered_set>
/**
* Private implementation details of c... | ALGO | 0.999154 | 7.466902 |
70288fd3-ec5f-4cf5-9998-df9d021500fe | samarthcode1/LeetCode1 | 2265-partition-array-according-to-given-pivot/partition-array-according-to-given-pivot.cpp | class Solution {
public:
vector<int> pivotArray(vector<int>& nums, int pivot) {
vector<int>v(nums.size());
int n=nums.size();
int less=0,greater=n-1;
for(int i=0,j=n-1;i<n;i++,j--){
if(nums[i]<pivot){
v[less]=nums[i];
less++;
}
... | ALGO | 0.999984 | 6.183209 |
bbd6189d-7b52-47fb-818f-9c5c8f3de529 | JuyeoungJun/algorithm | baekjoon/mathematics/problem1978.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int num[1001];
int result = 0;
int main(){
int N,a;
vector<int> value;
num[1] = 0;
for(int i = 2; i<1001 ; i++){
num[i] = 1;
}
for(int i = 2; i<1001; i++){
if(num[i] == 1){
... | ALGO | 0.999814 | 3.985585 |
dbb20ba2-200b-469e-997b-6af0e041e735 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/EncodedString_20210101214511.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999988 | 3.387247 |
8124d302-edfd-4f17-a72e-c47bb82f09fb | lagadic/visp | 3rdparty/simdlib/Simd/SimdNeonResizer.cpp | #include "Simd/SimdMemory.h"
#include "Simd/SimdStore.h"
#include "Simd/SimdResizer.h"
#include "Simd/SimdResizerCommon.h"
#include "Simd/SimdUpdate.h"
namespace Simd
{
#ifdef SIMD_NEON_ENABLE
namespace Neon
{
ResizerByteBilinear::ResizerByteBilinear(const ResParam & param)
: Base::Resi... | ALGO | 0.930074 | 5.971663 |
2c54eae7-2beb-4607-a8eb-096933a022df | richidubey/AwesomeDataStructuresAndAlgorithms | Bit Masking/bestbats.cpp | #include<bits/stdc++.h>
#include<time.h>
using namespace std;
int main()
{
int t;
cin>>t;
int a[11];
int k;
while(t--)
{
for(int i=0;i<11;i++)
cin>>a[i];
cin>>k;
//Uncomment lines no 27 28 67 68 70 to check how much time the programs takes for your input. Complexity of Code is O(n*2^n)
... | ALGO | 0.999823 | 3.695259 |
c0a060fe-ab8b-4e97-a99d-29728ad756b9 | jonrichards/Crespo_android_frameworks_base | media/libstagefright/codecs/amrwb/src/isp_az.cpp | /*
------------------------------------------------------------------------------
Filename: isp_az.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
------------------------------------------------------------------------------... | ALGO | 0.999643 | 4.915586 |
b18f518d-8fed-471c-b3fa-9d18c3cb6dcd | sbn1/Competitive_programming | standart_problems/Arrays_and_Hashing/find_symetric_paris.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <unordered_set>
using namespace std;
//Time: O(N)
//Space: O(N)
void find_symetric_pairs(vector<pair<int, int>> & arr)
{
unordered_set<string> set;
for (int i=0; i<arr.size(); i++)
{
string p = "{" + to_string(arr[i].first) + "," ... | ALGO | 0.996515 | 5.478104 |
3d0c7688-f227-43a1-a945-d8120f2001cf | trilinos/Trilinos | packages/percept/src/adapt/NodeRegistry.cpp | #include <adapt/NodeRegistry.hpp>
#include <adapt/FindValidCentroid.hpp>
#include <adapt/UniformRefinerPattern.hpp>
#include <adapt/Refiner.hpp>
#include <adapt/RefinerUtil.hpp>
#include <percept/mesh/mod/smoother/SpacingFieldUtil.hpp>
#include <stk_mesh/base/DataTraits.hpp>
#include <stk_util/parallel/CommSparse.hpp>... | ALGO | 0.99859 | 5.410676 |
ed82e3bf-989c-47ac-9f95-eee5fc013f58 | zino23/Data_Structures_and_Algorithms | problem_sets/LeetCode/23_merge_k_lists.cpp | #include <iostream>
#include <vector>
using namespace std;
/* Definition for singly-linked list. */
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution {
public:... | ALGO | 0.999758 | 5.772322 |
a7ee2f68-9273-4a7e-98bd-8edcc83174c5 | mcfi/MCFI | lib/libcxx-3.5.0.src/test/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp | // <algorithm>
// template<BidirectionalIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
// OutIter
// reverse_copy(InIter first, InIter last, OutIter result);
#include <algorithm>
#include <cassert>
#include "test_iterators.h"
template <class InIter, class OutIter>
void
test()
{
const int ... | TEST | 0.882282 | 6.376065 |
38bc6210-af9c-4b33-a59b-1a194fd4cfcc | Tus1811/Applied_Algorithm | codeforce/POSTMAN.cpp | #include<bits/stdc++.h>
using namespace std;
vector<pair<long long int, long long int>> a_pos;
vector<pair<long long int, long long int>> a_neg;
long long n, k, cap, res = 0;
void Init() {
cin >> n >> k;
long long xi, mi;
for (int i = 0; i < n; i++) {
cin >> xi >> mi;
if (xi > 0) a_pos.pus... | ALGO | 0.999909 | 3.782047 |
0ba8d114-cb4d-4a9b-8c67-aae156ddf2d4 | asSqr/AtCoder | ABC134 D.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define repi(i,a,b) for(ll i=... | ALGO | 0.999903 | 3.228328 |
7ef39d74-ba39-4670-9cf2-d2cf21cf1f4b | NeelRanka/-C-Games | 2_cars_1.cpp | #include<iostream>
#include<stdio.h>
#include<windows.h>
#include<graphics.h>
#include<conio.h>
#include<string>
using namespace std;
class cars{ //20*40
public:
int x,y;
int fig(int colour)
{
int i;
setcolor(colour);
line(x,y+3,x,y+37);
line(x+1,y+2,x+1,y+38);
for... | ALGO | 0.99137 | 3.594703 |
294afa68-1bd0-4793-9fd5-955a10611b92 | RAJESHKUMAR65/leetcode | 48-rotate-image/rotate-image.cpp | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
// transpose krna padega
for(int i=0;i<matrix.size();i++){
for(int j=0;j<matrix[i].size();j++){
if(j>=i){
swap(matrix[i][j],matrix[j][i]);
}
}
}
for(int i=0;i<matrix... | ALGO | 0.999965 | 6.59793 |
4f53395c-d6cc-41b4-88bd-4de9b26daea7 | opencv/opencv_attic | opencv/modules/legacy/src/blobtrackpostprockalman.cpp | #include "precomp.hpp"
/*======================= KALMAN FILTER =========================*/
/* State vector is (x,y,w,h,dx,dy,dw,dh). */
/* Measurement is (x,y,w,h). */
/* Dynamic matrix A: */
const float A8[] = { 1, 0, 0, 0, 1, 0, 0, 0,
0, 1, 0, 0, 0, 1, 0, 0,
0, 0, 1, 0, 0, ... | ALGO | 0.997347 | 5.976617 |
a0785865-ee3d-436c-ab19-ef2ad4781c74 | LovenSar/firmware-mod-kit-improveVer | src/others/squashfs-3.2-r2-lzma/CPP/7zip/Compress/ByteSwap/ByteSwap.cpp | // ByteSwap.cpp
#include "StdAfx.h"
#include "ByteSwap.h"
STDMETHODIMP CByteSwap2::Init() { return S_OK; }
STDMETHODIMP_(UInt32) CByteSwap2::Filter(Byte *data, UInt32 size)
{
const UInt32 kStep = 2;
UInt32 i;
for (i = 0; i + kStep <= size; i += kStep)
{
Byte b = data[i];
data[i] = data[i + 1];
d... | ALGO | 0.951751 | 5.367475 |
865d95d9-8e5e-420c-a2c3-e2e43b51d60d | aaryan-00/Practice-Leetcode | 2379-maximum-total-importance-of-roads/2379-maximum-total-importance-of-roads.cpp | class Solution {
public:
long long maximumImportance(int n, vector<vector<int>>& roads) {
vector<int> indegree(n);
for(auto i:roads)
{
indegree[i[0]]++;
indegree[i[1]]++;
}
sort(indegree.begin(),indegree.end(),greater<int>());
long long ans=0;
... | ALGO | 0.999951 | 5.41498 |
77bc3399-a497-4505-b89c-4f0a1165d77f | Majestic-Joker/4883-PT-Beaty | Assignments/A14/P11764/main.cpp | /**
* Joshua Beaty
* 4883
* 12/07/2021
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
//when set to true, prints debug messages to debug.out file
bool debugMode = false;
int main()
{
ofstream fout, debug;
//open files
fout.open("test.out");
debug.o... | ALGO | 0.998462 | 4.106596 |
f769553b-714b-4a05-8d87-2ceb85e41554 | S-Virendra/OOPS | rotate_array.cpp | #include<iostream>
using namespace std;
void reverse(int*arr,int i,int j){
int temp;
while(i<j){
temp=arr[i];
arr[i]=arr[j];
arr[j]=temp;
i++;
j--;
}
}
void rotate(int*arr,int n,int k){
k=k%n;// if k bada ho gya n se to lagana hai
reverse(arr,0,n-1);
rever... | ALGO | 0.999957 | 4.665669 |
6ff03b7d-1fa4-4a19-a6ac-5314eded28d4 | yyppsk/LeetCode | July 2023/17LetterCombinationsofaPhoneNumber.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
void findStuff(vector<string> &result, vector<string> &mappingStuff, string output, string digits, int index)
{
// if index goes out of the bounds
if (index >= digits.length())
{
result.push_back(output... | ALGO | 0.999772 | 6.017829 |
6c4987de-fd8e-46cd-a804-b7573cd5fe1a | kimitya/PP1 | lab4/f4.cpp | #include <iostream>
#include <limits.h>
using namespace std;
int main () {
int n;
cin >>n;
int arr[n][n];
int maxx=INT_MIN;
int imaxx;
int jmaxx;
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
cin >> arr[i][j];
}
}
for (int i=0; i<n; i++) {
fo... | ALGO | 0.999563 | 3.779787 |
a580a2e3-ff9a-49da-93b2-2c04b450f9c1 | Mamun-NSU/Problem-Solving-2025 | leetcode/Top Interview 150/189. Rotate Array.cpp | // Link: https://leetcode.com/problems/rotate-array/description/
class Solution
{
public:
void rotate(vector<int> &nums, int k)
{
int n = nums.size();
k = k % n; // Handle cases where k > n
int count = 0; // Number of elements moved
for (int start = 0; count < n; start++)
... | ALGO | 0.999986 | 6.608713 |
f014b7ed-6ac9-496f-bc2b-e1d308983a79 | MckAudio/freeverb3 | freeverb/frag.cpp | #include "freeverb/frag.hpp"
#include "freeverb/fv3_type_float.h"
#include "freeverb/fv3_ns_start.h"
// class fragfft
FV3_(fragfft)::FV3_(fragfft)()
{
fragmentSize = 0;
simdSize = 1;
setSIMD(0,0);
}
FV3_(fragfft)::FV3_(~fragfft)()
{
freeFFT();
}
long FV3_(fragfft)::getSIMDSize()
{
return simdSize;
}
long... | TOOL | 0.986185 | 5.386392 |
2a285d9a-794a-4336-844f-1a08d88c789f | NARUTOfzr/Neptune_3 | Source Code/ZNP_F401_Marlin-Beta/Marlin/src/feature/tramming.cpp | #include "../inc/MarlinConfigPre.h"
#if ENABLED(ASSISTED_TRAMMING)
#include "tramming.h"
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../core/debug_out.h"
PGMSTR(point_name_1, TRAMMING_POINT_NAME_1);
PGMSTR(point_name_2, TRAMMING_POINT_NAME_2);
PGMSTR(point_name_3, TRAMMING_POINT_NAME_3);
#ifdef TRAM... | TOOL | 0.871936 | 4.382432 |
edefa59c-c042-4f87-b0c0-829ce48bed66 | MADHUSHUDHAN1/DSA-Questions. | 1721-swapping-nodes-in-a-linked-list/1721-swapping-nodes-in-a-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* swapNodes(L... | ALGO | 0.999998 | 5.649701 |
cd62430d-b0e9-4896-8130-4c07d5de4f9f | subu-4494/DSA-INTERVIEW-QUESTIONS | zbasic/DSA 3rd year/q2.cpp | // #include <bits/stdc++.h>
// using namespace std;
// int main()
// {
// int t;
// cin >> t;
// while (t--)
// {
// int n;
// cin >> n;
// int a[n];
// for (int i = 0; i < n; i++)
// {
// cin >> a[i];
// }
// int b[n];
... | ALGO | 0.99985 | 4.209192 |
06e553cf-2e80-418e-ab0c-925ad1972c02 | wjwhhhhhh/ACM_ | 杭电多校/T_356565_究竟是多少呢.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
constexpr int mod = 1000000007;
int N, T, seed, vmax;
int rnd(int &seed)
{
int ret = seed;
seed = (7LL * seed + 13) % mod;
return ret;
}
struct DSU
{
std::vector<int> p;
DSU(int n) : p(n)
{
std::iota(p.begin(), p.end()... | ALGO | 0.999691 | 5.122557 |
d1debc5a-4570-4c27-9bc8-e8b6fc846fab | JstD/HackerRank | DataStructure/delete_node.cpp | #include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
class SinglyLinkedList {
public:
S... | ALGO | 0.999863 | 4.585412 |
b8eb5770-64c1-411d-af85-53a1595e3915 | BRUTEUdesc/AlmanaqueBrute | Codigos/Estruturas-de-Dados/Disjoint-Set-Union/DSU-Bipartido/bipartite_dsu.cpp | struct Bipartite_DSU {
vector<int> par, sz, c, bip;
bool all_bipartite;
void build(int n) {
par.assign(n, 0);
iota(par.begin(), par.end(), 0);
sz.assign(n, 1);
c.assign(n, 0);
bip.assign(n, 1);
all_bipartite = 1;
}
int find(int a) { return a == par[a] ... | ALGO | 0.999454 | 5.045832 |
320c91ec-5ae2-4f2f-882d-5beba2c982f5 | kalashpatil33/Leetcode-Daily | Find duplicates in an array - GFG/find-duplicates-in-an-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
vector<int> duplicates(int arr[], int n) {
// code here
map<int,int> mp;
vector<int> ans;
for(int i=0;i<n;i++)
{
mp[arr[i]]++;
}
f... | ALGO | 0.999541 | 6.17632 |
225430b5-5e38-44d6-bd11-ba96ad82edeb | Saikat-98/competitive-coding | contest problems/sorting algorithms/quick_sort.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define setbits(x) __builtin_popcountll(x)
#define tz(x) __builtin_ctzll(x)
#define lz(x) __builtin_clzll(x)
#define fsetbit(x) ffsll(x)
#define mod 1000000007
#define inf 1e18
#define w(x) \
int x; \
cin >> x; \
while (x--)
#define debug(x,... | ALGO | 0.999942 | 4.759363 |
063bf41d-a40a-493b-892e-2499a71a6153 | AakashRanjan001/leetcodebros | 1044-find-common-characters/1044-find-common-characters.cpp | class Solution {
public:
vector<string> commonChars(vector<string>& words) {
vector<string>ans;
for(char ch ='a' ;ch<='z';ch++){
int mnc =INT_MAX;
for(string eachstr:words){
int count =0;
for(char c:eachstr){
if(c == ch)coun... | ALGO | 0.999952 | 5.837006 |
73bbfea5-51e9-4de6-b917-6e3a6cd7b702 | sarvex/leetcode-elm | solution/1100-1199/1155.Number of Dice Rolls With Target Sum/Solution.cpp | class Solution {
public:
int numRollsToTarget(int n, int k, int target) {
const int mod = 1e9 + 7;
int f[n + 1][target + 1];
memset(f, 0, sizeof f);
f[0][0] = 1;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= min(target, i * k); ++j) {
for (in... | ALGO | 0.99999 | 6.175041 |
8d5a8403-1959-4ecd-8b95-24398b9b1d9b | kallaballa/Poppy | third/opencv_contrib-4.x/modules/xphoto/src/learning_based_color_balance.cpp | #include "learning_based_color_balance_model.hpp"
#include "opencv2/core.hpp"
#include "opencv2/core/hal/intrin.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/xphoto.hpp"
using namespace std;
#define EPS 0.00001f
namespace cv
{
namespace xphoto
{
inline void getChromaticity(Vec2f &dst, float R, float G, float... | ALGO | 0.918056 | 5.703774 |
0dc0656e-97c8-4216-a95b-fedafb44b6f7 | Sriramkk123/leetcode-problems | 2171-second-minimum-time-to-reach-destination/second-minimum-time-to-reach-destination.cpp | class Solution {
public:
int secondMinimum(int n, vector<vector<int>>& edges, int time, int change) {
vector<int> adj[n+1];
for(auto edge : edges){
int from = edge[0];
int to = edge[1];
adj[from].push_back(to);
adj[to].push_back(from);
}
... | ALGO | 0.999992 | 5.629794 |
508e5014-36ab-4d86-a291-2b69c1508138 | Raghav13995/Codes-C- | count.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int r=10;
int n=432;
int p=n;
int count=0;
while(n>0){
int s=n%10;
count++;
n=n/10;
}
cout<<"the value of count "<<count<<endl;
int ans=pow(r,count);
cout<<ans<<endl;
cout<<(ans-p);
} | ALGO | 0.999648 | 3.306045 |
028bd73e-9580-4db5-8f73-1f17218e463f | orlandoisay/Competitive-Programming | COJ/2341.cpp | #include <stdio.h>
#include <iostream>
#include <string>
#include <map>
using namespace std;
typedef struct {
string Q; long long int A;
}Question;
map <string,int> Lista;
map <string,bool> BL;
int N,M;
char buffer[256];
int main()
{
scanf("%d %d",&N,&M);
for(int i=0;i<N;i++)
{
string ... | ALGO | 0.999001 | 3.571256 |
4fc8a9c7-7dff-467a-88b4-7806e9ac1ae6 | Shabbir421/DSA-with-Cpp | C++ Basics/sum.cpp |
#include <iostream>
using namespace std;
int main(){
// int i,sum=0;
// for(i=1; i<=n; i++){
// sum=sum+i*i;
// cout<<sum<<endl;
// }
int i,sum=0,n;
cout<<"enter the number ";
cin>>n;
for(i=1; i<=n; i++){
sum=sum+i;
cout<<sum<<endl;
}
} | ALGO | 0.995384 | 3.583187 |
0943ccda-39dd-490b-8625-d15b1dd908dc | TakumaSato777/Atcoder | ABC/206/c.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <string>
#include <cstdlib>
#include <cmath>
#include<stack>
#include <map>
using ll=long long;
#include <cctype>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i,x,n) for (int i =... | ALGO | 0.999934 | 3.891635 |
ff7783fb-94c8-49a0-8716-b2493621d473 | ZulfahmiCP/Competitive-Programming-Recources | CodeForces/Div_3/Set_300/Round_739/E_Polycarp_and_String_Transformation.cpp | #include <iostream>
#include <functional>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <numeric>
#include <vector>
#include <string>
#include <array>
#include <cmath>
#include <queue>
#include <stack>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#define X first
#define Y secon... | ALGO | 0.998144 | 4.492514 |
11ef154a-8417-4c93-b2c5-3891f245dd04 | ArefinAlter/ProblemSolving | atcoder/dp/Z.cpp | #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
us... | ALGO | 0.999982 | 3.496279 |
5d013da6-b7e4-4021-9976-ad62884bc63b | nono19972020/atcoder | ABC/ABC033/c.cpp | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
int main(){
string s;
cin >> s;
if(s.size() == 1 and s[0] == '0'){
printf("0\n");
return 0;
}
else if(s.size() == 1 and s[0] != '0'){
printf("1\n");
return 0;
}
vector<long long> ... | ALGO | 0.999888 | 3.474194 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.