uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c0e807e6-c4f9-45a1-8c60-28ece694ea57 | ravi2320/GFG-POTD | 18. Water the plants.cpp | /*
Water the plants
MediumAccuracy: 55.22%Submissions: 25K+Points: 4
Boost your resume to top companies via this Free Hiring Contest!
banner
A gallery with plants is divided into n parts, numbered 0, 1, 2, 3, ..., n-1. There are provisions for attaching water sprinklers in every division. A sprinkler with range x at ... | ALGO | 0.999991 | 5.133174 |
790bd25a-9339-426b-9096-cda2abd2f0da | Mohitbagul/Leetcode-POTD | 151-reverse-words-in-a-string/reverse-words-in-a-string.cpp | class Solution {
public:
string reverseWords(string s) {
string ans="",m="";
for(int i=0;i<s.length();i++){
if(s[i]!=' '){
m+=char(s[i]);
}
else{
if(m.length()>0 && ans=="")
ans+=m;
else if(m.length... | ALGO | 0.999965 | 5.668119 |
0b8f2d39-d7fe-4302-bcc4-f89ae79002df | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_9727_2.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, k, p;
map<int, int> row[1001];
int prod[1001], C[1001][1001];
int pow(int a, int n) {
int ret = 1;
while (n)
if (n & 1)
n--, ret = (long long)ret * a % p;
else
n >>= 1, a = (long long)a * a % p;
return ret;
}
int calc(int n, int prod) {
... | ALGO | 0.999985 | 3.816807 |
bfd9895a-595f-4cdc-a25b-0761d0489364 | kcopenhagen/lammps-myxosim | install-lammps/lammps-working/src/INTEL/pair_buck_intel.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Rodrigo Canales (RWTH Aachen University)
------------------------------------------------------------------------- */
#include "pair_buck_intel.h"
#include "atom.h"
#include "comm.h"
#include "error.... | ALGO | 0.958302 | 6.417189 |
f35e05ee-45c0-4b5a-a320-67d0fd958dbe | AhmedEssamYassin/Problem-Solving | Topic-based Training/FFT, NTT/ACPC 2020-D/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
/*
p | deg | g
132120577 19 5
998244353 23 3
469762049 26 3
1107296257 24 10
10000093151233 26 5
1000000523862017 26 3
1000000000949747... | ALGO | 0.99996 | 5.122098 |
5ce5fd68-5cf4-4115-b24c-5748d4fdacfe | Hunter-Wrynn/Code_Hub | Algorithm/Algorithm_Pattern/Segment_Tree.cpp | #include <bits/stdc++.h>
using namespace std;
const int N=1e5+3;
typedef long long LL;
stuct Node{
int l,r;
int v;
}tr[N*4];
int m,p;
void build(int u,int l,int r){
tr[u]={l,r};
if(l==r) return;
int mid=l+r>>1;
build(u<<1,l,mid);
build(u<<1|1,mid+1,r);
}
int quiry(int u,int l,int r){
... | ALGO | 0.999915 | 4.169812 |
e4d1961f-e16e-4254-83e2-9832be6837cd | o0o0o0o0o0o0o/image-processing-from-scratch | ImageMatting/Eigen/bench/benchGeometry.cpp | #include <iostream>
#include <iomanip>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
#ifndef REPEAT
#define REPEAT 1000000
#endif
enum func_opt
{
TV,
TMATV,
TMATVMAT,
};
template <class res, class arg1, class arg2, int opt>
stru... | TEST | 0.933267 | 6.062908 |
b35985bf-0c31-4a6e-8fed-2feb6e4c87ea | kluophysics/roptlite | Problems/SFRQLyapunov.cpp |
#include "Problems/SFRQLyapunov.h"
/*Define the namespace*/
namespace ROPTLITE {
SFRQLyapunov::SFRQLyapunov(SparseMatrix &inA, SparseMatrix &inM, Vector inC, integer inp)
{
Aptr = &inA;
Mptr = &inM;
C = inC;
Cp = C.Getcol();
n = C.Getrow();
p = inp;
NumGradHe... | ALGO | 0.999032 | 4.384631 |
c7480378-3e5d-4a98-973f-5c4a53779a5a | ishandutta2007/codeforces | fataleagle/normal/436/B.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M, K;
char grid[2000][2000];
int spiders(int x, int y, int t)
{
int ret=0;
ret+=y-t>=0 && grid[x][y-t]=='R';
ret+=y+t<M && grid[x][y+t]=='L';
ret+=x-t>=0 && grid[x-t][y]=='D';
ret+=x+t<N && grid[x+t][y]=='U';
return ret;
}
int main()
{
... | ALGO | 0.999843 | 3.423093 |
274e7043-c7c6-4dcf-937f-8e5c8c634bb8 | sarvex/leetcode-java | solution/2300-2399/2353.Design a Food Rating System/Solution.cpp | using pis = pair<int, string>;
class FoodRatings {
map<string, pis> mp;
map<string, set<pis>> t;
public:
FoodRatings(vector<string>& foods, vector<string>& cuisines, vector<int>& ratings) {
int n = foods.size();
for (int i = 0; i < n; ++i) {
string a = foods[i], b = cuisines[i]... | ALGO | 0.999966 | 6.017699 |
f95095fa-73c4-453c-87d4-6f48128d1c96 | nidhiupman568/C-PLUS-PLUS-PROBLEMS-SOLVED | Longest Valid Parentheses.cpp | class Solution {
public:
int longestValidParentheses(string s) {
stack<int>stk;
stk.push(-1);
int ans = 0;
for(int i = 0 ; i < s.size(); i++)
{
if(s[i] == '(')
stk.push(i);
else
{
if(stk.size() == 1)
... | ALGO | 0.999528 | 5.647781 |
5153b790-d3ed-4931-aafd-a7b4518cf5ba | ivanliu1989/Helping-Santas-Helpers | C++ code/Santa2014/Santa2014/main_test.cpp | #include <Rcpp.h>
#include <algorithm> // std::max
using namespace Rcpp;
// [[Rcpp::export]]
int updateNextAvailableMinute(int start_minute, int work_duration){
int next_available_time = 0;
int S = 0;
int U = 0;
int full_days = work_duration / (60*24);
S = full_days * (10*60);
U = full_days * (... | ALGO | 0.999883 | 6.210663 |
3f7f76b7-a092-401f-b9c0-8f2fe33680e6 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_1920_23.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 10, L = 18;
vector<int> e[MAXN];
int n, dep[MAXN], f[MAXN], sf[MAXN], ssf[MAXN], u[MAXN], fa[MAXN][L],
g[MAXN][L], h[MAXN][L], dfn[MAXN], df[MAXN], tot;
void DFS(int first, int Fa) {
df[++tot] = first, dfn[first] = tot;
for (int i = 0; i < ... | ALGO | 0.999939 | 4.382903 |
4a8b7e94-429f-4793-95f9-a4ee225b2be5 | wenjiey2/cs225 | lab_btree/test_btree.cpp | #include <cstring>
#include <stdexcept>
#include "btree.h"
using namespace std;
template <class K, class V>
void do_inserts(vector<pair<K, V>>& data, BTree<K, V>& b)
{
for (auto& key_val : data) {
b.insert(key_val.first, key_val.second);
}
}
template <class K, class V>
void verify_finds(vector<pair<... | TEST | 0.962827 | 7.045377 |
0181ffd1-6c06-4d26-8067-8359f284f7a9 | abhinav8925/Codechef-Solutions | Dazzling AXNODR Challenge.cpp | /*
***** !!!!! JAI SHREE KRISHNA !!!!! *****
Date -> 20th July 2023
Code by - Abhinav Anand
Problem link -> https://www.codechef.com/problems/AXNODR
*/
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define ll long long int
#define endl "\n"
using namespace std;
int N=1000001;
int mod=1... | ALGO | 0.999871 | 5.011874 |
c38756bf-4f08-4736-853c-52d33ac6cda9 | artkeep/trinity | src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp | #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "naxxramas.h"
//Stalagg
enum StalaggYells
{
SAY_STAL_AGGRO = -1533023, //not used
SAY_STAL_SLAY = -1533024, //not used
SAY_STAL_DEATH = -1533025 //not used
};
enum StalagSpells
{
SPELL_... | TOOL | 0.880812 | 6.729824 |
63773ecf-5c98-4a28-a88f-f27b0218c70e | radhikaarora795/leetcodePrograms | expressionEvaluationBODMAS.cpp | #include <iostream>
#include <stack>
#include <sstream>
#include <cctype>
#include <vector>
#include <string>
using namespace std;
// Function to return precedence of operators
int precedence(char op) {
if(op == '+' || op == '-') return 1;
if(op == '*' || op == '/') return 2;
return 0;
}
// Function to p... | ALGO | 0.999852 | 6.407229 |
295720cd-129c-40d1-891d-4511ac871e44 | ishandutta2007/codeforces | danya090699/normal/844/A.cpp | //Come on, make Togliatti great again!
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
int n, k;
cin>>s>>k;
n=s.size();
set <char> se;
for(int a=0; a<n; a++) se.insert(s[a]);
if(se.size()>=k) cout<<0;
else
{
if(k<=n) cout<<k-se.size();
else cout<<... | ALGO | 0.999957 | 3.809651 |
695cb670-f30d-4b1a-aabe-65b63daede48 | nehcoah/algorithm-template | codeforces/1922(div2)/d.cpp | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
void solve() {
int n;
cin >> n;
vector<int> a(n), d(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n; i++) {
cin >> d[i];
}
set<int> alive, die;
for (int i = 0; i < n; i++) {
... | ALGO | 0.999824 | 4.122684 |
773a8d47-319d-441e-b393-fe2a1e18691b | DhruvK-Sethi/30-day-code | Day_23/test.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, s = 0, res = 0;
cin >> n;
for (int i = 0; i < (n + 1); i++)
{
res += i;
}
res *= 4;
for (int i = 1; i < 4 * n; i++)
{
int a;
cin >> a;
s += a;
}
cout << res - s;
return 0;
}... | ALGO | 0.999844 | 3.542676 |
b3ee66d2-ef75-43f6-842e-f054657c2e74 | mirzaazwad/Competitive-Programming | SolvedProblems/Codeforces/A_Koxia_and_Whiteboards.cpp | // In the name of Allah, The Lord of Mercy, The Giver of Mercy
// Author: Mirza Mohammad Azwad
// Institution: Islamic University of Technology
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define l... | ALGO | 0.999914 | 4.206598 |
f8217b1d-8510-4f76-bdb6-f976b2b681b7 | EdwardOu98/LeetCode | Daily Challenge/304_Range_Sum_Query_2D_Immutable.cpp | #include <vector>
using namespace std;
class NumMatrix {
private:
// PrefixSum[i][j] is the sum of element in the rectangle with
// [0, 0] as its top left corner and [i, j] as its bottom right
// corner
vector<vector<int>> prefixSum;
public:
NumMatrix(vector<vector<int>>& matrix) {
int m =... | ALGO | 0.999872 | 6.492225 |
a29879fa-dbf4-4ac8-a4d7-021e6e802cb6 | devdatt21/LeetCodes | 2685-first-completely-painted-row-or-column/first-completely-painted-row-or-column.cpp | class Solution {
public:
int firstCompleteIndex(vector<int>& arr, vector<vector<int>>& mat) {
unordered_map<int,int> mp_row;
unordered_map<int,int> mp_col;
unordered_map<int, pair<int,int>> mp_mat_value;
for(int i=0;i<mat.size();i++)
{
for(int j=0;j<mat[0].size()... | ALGO | 0.999979 | 5.839892 |
cadfc190-36a9-4cb1-a3fb-a4159a1e2216 | idlegossip/LightOJ | kmp.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll len = 1e5+7;
ll fail[len+1];
void fail_func(string pat,ll n)
{
fail[0] = 0;
fail[1] = 0;
for(int i = 1; i < n; i++)
{
int j = fail[i];
while(1)
{
if(pat[j] == pat[i])
{
... | ALGO | 0.999996 | 4.99126 |
07950f3d-3b5c-4e86-9e25-39403bdaf13f | harsh-vardhan2005/cpp11 | Basics Code1/2D Array/WavePrint.cpp | #include<iostream>
using namespace std;
void WavePrint(int arr[3][3]){
for(int i = 0; i<3; i++){
if(i%2==0){
for(int j = 0; j<3; j++){
cout<<arr[j][i]<<" ";
}
}
else{
for(int j = 2; j>=0; j--){
cout<<arr[j][i]<<" ";
... | ALGO | 0.999452 | 3.652062 |
49b0bb58-1b03-4f41-91a8-58fb496781e4 | ShubhamMutreja/LeetCode-Solutions | Linked List/Linked List Components_357788517.cpp | class Solution {
public:
int numComponents(ListNode* head, vector<int>& G) {
int ret = 0;
set < int > s;
for(int i = 0; i < G.size(); i++)s.insert(G[i]);
bool flag = false;
while(head){
int x = head->val;
if(s.count(x)){
if(!flag) ret++;
flag... | ALGO | 0.999755 | 5.587128 |
b7830fed-9b17-402a-991e-b5e0724588b4 | HarshRaj2717/Programming-Problems | Striver_Recursion_Playlist/Rat in a maze.cpp | // Problem : https://practice.geeksforgeeks.org/problems/rat-in-a-maze-problem/1
// Explanation : https://youtu.be/bLGZhJlt4y0
//{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution
{
public:
vector<... | ALGO | 0.999863 | 6.736604 |
ec7b6893-9164-4170-b47d-65c47418eff1 | AlRezepov/advanced_programming_homework | 08/task_01/task_01.cpp | #include <iostream>
#include <vector>
#include <memory>
class tridiagonal_matrix
{
public:
std::vector<double> m_down;
std::vector<double> m_upper;
std::vector<double> m_middle;
tridiagonal_matrix(
const std::vector<double>& down,
const std::vector<double>& upper,
const std::vec... | TOOL | 0.856202 | 4.034545 |
96470a2f-aa48-4fa1-90fa-815e78d5519a | hezhaojiang/leetcode-cpp | 142.环形链表-ii.cpp | /*
* @lc app=leetcode.cn id=142 lang=cpp
*
* [142] 环形链表 II
*/
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {}
};
// @lc code=start
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), ... | ALGO | 0.99998 | 5.908736 |
21051697-cba1-4978-ab7e-479056d00f68 | particleincell/plasma-simulations-by-example | ch9/snippets/thread_add.cpp | #include <thread>
#include <iostream>
using namespace std;
int main() {
for (int k=1;k<=10000;k++) //run 10,000 times
{
int i=0;
auto f = [&] {++i;}; //lambda expression to increment i
thread t1(f); //create two threads
thread t2(f);
t1.join(); t2.join(); //wait for threads to finish
cout<<(i==2?'.... | TOOL | 0.933679 | 3.810112 |
8b7c06e9-71a9-4ecc-8a1c-d0eeb838ef53 | jjiantong/Boyi | OpenCL_applications_on_FPGAs/PS/SWI/ul6/main.cpp | #include "support/ocl.h"
#include "support/timer.h"
#include <unistd.h>
#include <thread>
#include <assert.h>
#include <vector>
#include <algorithm>
#include <string.h>
#include "CL/opencl.h"
#define AOCL_ALIGNMENT 64
#include <malloc.h>
// Params --------------------------------------------------------------------... | ALGO | 0.969492 | 5.136534 |
2f80e5f1-3a4e-45f9-b3c4-384c4bcbe885 | dileepdhangar/DSA | Code/004conditons/digit.cpp |
// #include <iostream>
// using namespace std;
// int main()
// {
// //int num = 524 ;
// int num ;
// cout<< " enter the no "<< endl ;
// cin >> num ;
// int a = (num%10) ;
// cout << "3rd digit :" << a << "," ;
// int b = num/10 ;
// int c = (b%10) ;
// cout <<"2nd digit :" << c << ",";
// int d = (b/10) ;
// //in... | ALGO | 0.99918 | 3.739047 |
08ba23ad-af93-495d-9d69-ccef450692a5 | OscarCampohermoso/ICPC | 2023/ZuhairAndStrings.cpp | //
// Created by Oscar Campohermoso on 22/1/23.
//
#include "bits/stdc++.h"
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
long long int arr[26] = {0};
long long int n, k, count;
cin >> n >> k;
cin.ignore();
string letters;
getline(cin, letters);
... | ALGO | 0.999981 | 4.188746 |
40a0ac18-a306-49e4-ab87-aa21f7c254e1 | hariom-nabira/dsa | 3870-minimum-moves-to-clean-the-classroom/3870-minimum-moves-to-clean-the-classroom.cpp | class Solution {
public:
int minMoves(vector<string>& g, int energy) {
int r = g.size(), c = g[0].size();
queue<tuple<int,int,int,int>> q; // {x_coord, y_coord, mask, currEnergy}
unordered_map<int,int> coordToBit;
int litCount=0;
for(int i=0; i<r; i++){
for(int j... | ALGO | 0.999931 | 5.871527 |
39255978-45af-467b-b056-ab5426b73182 | orekiousun/Code | C++/LeetCode/LeetCode322-DP.cpp | #include<iostream>
using namespace std;
#include<vector>
#include<algorithm>
/*
给你一个整数数组 coins ,表示不同面额的硬币;以及一个整数 amount ,表示总金额。
计算并返回可以凑成总金额所需的 最少的硬币个数 。如果没有任何一种硬币组合能组成总金额,返回 -1 。
你可以认为每种硬币的数量是无限的。
*/
int coinChange(vector<int>& coins, int amount) {
int size = coins.size();
vector<int> count(amoun... | ALGO | 0.999737 | 5.180872 |
88d13534-2785-445b-b812-75ea140ea5ba | gaodechen/OI_History | problems/poj1041.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define set( p, k ) memset( p, k, sizeof( p ) )
#define cpy( p, k ) memcpy( p, k, sizeof( k ) )
using namespace std;
typedef const int & var;
typedef long long data;
const int N = 60, M = 50000;
const int INF = 0x3f3f3f3f;
struct Edge
... | ALGO | 0.999853 | 3.728519 |
4ca1f3dc-d146-4cbf-a42f-015aaa1fcf00 | Nobles3689/practice | 20230902_1_#1107.cpp | //Beakjoon Online Judge #1107
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int num[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
vector<bool> b_num(10, false);
int start = 100;
int check(int num){
string s = to_string(num);
for(int i = 0; i<s.length(); i++){
if(b_num[s[i]-'0'... | ALGO | 0.993447 | 3.889511 |
7fcda51a-3a06-44a1-87fd-0ad74e7d699a | lDarryll/Autograd-cpp | src/main.cpp | #include <iostream>
#include <memory>
#include <cmath>
using namespace std;
// 存储表达式所需的相关数据
class Container
{
public:
//返回表达是具体是什么类型,或者说什么名称
virtual const char *type() = 0;
// 具体的forward的实现过程
virtual float forward()=0;
// 具体的backward的实现
virtual void backward(float gradient)=0;
};
// 表达式类... | ALGO | 0.999098 | 4.224395 |
777bd83a-d900-4826-adf2-d17ddcc8abe4 | Cedarch/M3Net | pcdet/ops/iou3d_nms/src/iou3d_cpu.cpp | #include <stdio.h>
#include <math.h>
#include <torch/serialize/tensor.h>
#include <torch/extension.h>
#include <vector>
#include <cuda.h>
#include <cuda_runtime_api.h>
#include "iou3d_cpu.h"
#define CHECK_CUDA(x) do { \
if (!x.type().is_cuda()) { \
fprintf(stderr, "%s must be CUDA tensor at %s:%d\n", #x, __FILE_... | ALGO | 0.997081 | 5.210838 |
6dffa8d2-d7f8-4ce7-8f5b-c784bdd501f4 | 0point1Zishan/CP | DSA Practice/Sorting/Insertion Sort.cpp | void insertionSort(vector<int>& arr) {
// code here
for(int i = 1; i < arr.size(); i++){
int j = i;
while(j > 0 && arr[j-1] > arr[j]){
swap(arr[j-1], arr[j]);
j--;
}
}
} | ALGO | 0.999992 | 5.773076 |
77c70c07-e8a3-4fe0-b18a-eb1ad1b0eecf | ssk4988/Coding | UCFPT/230203/l.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vl;
#define nl '\n'
#define sz(x) (int) (x).size()
#define all(x) begin(x), end(x)
#define rep(i,a,b) for(int i = a; i < b; i++)
const int DEBUG = true;
... | ALGO | 0.999908 | 4.828827 |
b849435f-a8cd-4aaa-a794-ea2fa62ce899 | stefdasca/CompetitiveProgramming | Infoarena/zidar.cpp | #pragma GCC optimize ("O3")
#include<bits/stdc++.h>
using namespace std;
ifstream f("zidar.in");
ofstream g("zidar.out");
short n,m,x,t,nr;
short mat[53][22];
short sp[53][22];
short dp[53][402][62];
bool xx[53][402];
vector<int>R[402];
struct secv
{
short st,sf;
};
secv v[402];
short sum(short i, short stc, short ... | ALGO | 0.99993 | 4.513411 |
470a74c9-f98b-4f62-a847-fe16277c670a | TheDev05/CARDIO | CodeForces/Rating 1000/A_Superhero_Transformation.cpp | /*
Believe-In-your-Karma & chant with me,
"Hare Rama Hare Rama, Rama Rama Hare Hare,
Hare Krishna Hare Krishna, Krishna Krishna Hare Hare !!"
Username: TheDev05, Happy Coding <3
*/
#include <bits/stdc++.h>
using namespace std;
#define imax INT_MAX
#define imin INT_MIN
#define pi pair<ll, ll>
#define ps ... | ALGO | 0.99999 | 5.208168 |
b14ccf25-ae85-493f-89dd-b2769c780364 | kangjianwei/Data-Structure | Dev-C++/ExerciseBook/05.34.1/05.34.1.cpp | #include <stdio.h>
#include "Status.h" //**01 **//
#include "SString.h" //**04 **//
#include "GList-HT.h" //**05 **//
/*
* ùͷβ洢ʾ
*/
Status Algo_5_34_1(GList* L);
int main(int argc, char* argv[]) {
GList L;
char* s = "(a,((b,c),()),(((d),e),f))";
SString S;
printf(" L ...\n");
StrA... | ALGO | 0.999339 | 3.771486 |
c2d84efb-7c9c-459a-aabc-8a544e91c297 | sci-visus/BabelFlow | examples/reduction/ReductionGraph.cpp | #include <cmath>
#include <sstream>
#include "ReductionGraph.h"
using namespace BabelFlow;
ReductionGraph::ReductionGraph(uint32_t leafs, uint32_t valence) : TaskGraph(),
mValence(valence)
{
// Find the number of leafs that is a power of valence
mLeafs = 1;
mLevels = 0;
while (mLeafs < leafs) {
mLea... | ALGO | 0.855259 | 5.213593 |
80ff7511-ccff-4f29-828c-b751523904e2 | svivo2/gitrep | Foundations2/pf2-ml-master/src/layerlinear.cpp | #include "layerlinear.h"
#include "matrix.h"
#include "vec.h"
LayerLinear::LayerLinear(size_t _numInputs, size_t _numOutputs) : Layer(_numInputs, _numOutputs)
{
}
LayerLinear::~LayerLinear()
{
}
void LayerLinear::activate(const Vec& x)
{
for(size_t i = 0; i < numOutputs; i++)
(*activation)[i] = (*weigh... | ALGO | 0.892844 | 5.420741 |
74026154-c5f7-4257-8983-6ff8ea0db21b | AleksPopova/All-Homework | hw5-26.12/3.cpp | /*
Напишите программу позволяющую эффективно проверять принадлежность
пары значений массиву. Например, пара (2,3) принадлежит массиву
[1,2,3,5,7,11,13,17], а пара (3,4) - нет. Можно считать, что количество
запросов многократно превышает размер массива.
*/
#include "pch.h"
#include <iostream>
using namespace std;
... | ALGO | 0.999929 | 4.781876 |
33fed5cf-976b-43b0-ad86-a8d076843b58 | ck89119/Algorithm | CodeJam/2009/Round 1C/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << __LINE__ << " : "<< #x << " = " << (x) << endl
#define clr(a, x) memset(a, x, sizeof(a)) //0:0, -1:-1, INF:0x3f, -INF:0xc0
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define lowbit(x) x & (-x)
typedef long long ll;
typedef pair<i... | ALGO | 0.999527 | 3.402205 |
fac697a5-6cea-4e3a-bdbc-b70b7d09f6b4 | otkisyan/NUOS | 01 Year, 01 Semester/BP1/Arrays/array-sum-even.cpp | // Программа, которая выводит сумму элементов массива а, значения которых двузначные четные числа.
#include <iostream>
#include <cmath>
#include <windows.h>
using namespace std;
int main()
{
SetConsoleCP(65001);
SetConsoleOutputCP(65001);
int n = 18;
int a[18], b[18];
b[0] = 19;
int sum = 0;... | ALGO | 0.997751 | 4.384675 |
32e2bfc4-59ef-422c-9061-06782b91cd80 | arrows-1011/CPro | AOJ/Volume02/0243.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <cstring>
using namespace std;
using Mat = vector<vector<char>>;
constexpr char col[] = {'R', 'G', 'B'};
constexpr int MAX = 10;
constexpr int dx[] = {-1, 0, 1, 0};
constexpr int dy[] = {0, -1, 0, 1};
int W, H;
Mat M;
bool visited[MAX]... | ALGO | 0.999794 | 5.125201 |
36df6f29-8245-4579-bac1-3aa5f769f9d5 | hashcodez2004/DSA | Longest Subarray with Sum K.cpp | class Solution {
public:
int longestSubarray(vector<int>& arr, int k) {
// code here
int n = arr.size();
unordered_map<int,int> mpp;
mpp[0] = -1;
int len = 0;
int sum = 0;
for(int i=0;i<n;i++){
sum+=arr[i];
if(mpp.find(sum)==mpp.end()... | ALGO | 0.999915 | 6.079776 |
896271f2-021b-4e85-9212-d1c049270082 | Dev-Bhandari/Tic-Tac-Toe | 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 |
e05d1471-e5ec-42d9-a496-145587385ee2 | AbhinavGangwar12/DataStructures- | Stack/Basic.cpp | #include<iostream>
#include<stdbool.h>
using namespace std;
class stack{
int * arr;
int top;
int size;
public:
stack(int n){
size = n;
arr = new int[size];
top = -1;
}
void push(int);
int pop();
int stackTop();
bool isE... | ALGO | 0.995156 | 4.510365 |
0f29a7e9-bb66-427a-ba9c-2a140d785c5f | deadperalta/binaryTree | sumOfNodesAtMaximumDepth.cpp | int sumAtMaxDepth(Node* root)
{
int sum=0;
queue<Node*>q;
q.push(root);
while(!q.empty())
{
sum=0;
int n=q.size();
while(n--)
{
Node* curr=q.front();
q.pop();
sum+=curr->data;
if(curr->left)
{
q.push(curr->left);
}
if(curr->rig... | ALGO | 0.999874 | 4.861459 |
97d3fcd1-64b4-402b-af02-79cdc1ac2140 | buaawangfish/leetcode | leetcode018.cpp | #include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
#include <numeric>
using namespace std;
vector<vector<int>> fourSum(vector<int>& nums, int target) {
vector<vector<int>> result;
if (nums.size() <= 3) return result;
sort(nums.begin(), nums.end());
if (accumulate(nums.begin(), nums.beg... | ALGO | 0.999874 | 4.798266 |
89575f3a-4d8e-45b6-8e2d-28e88aa40ab6 | MostafaMohamed2001/C-Data-Structure | .history/hello_20240713102640.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main(){
string s1, s2;
cin >> s1>>s2;
bool eq = false;
for (int i = 0; i < s1.length(); ++i)
{
if(s1[i] >= 65 && s1[i] <95){
s1[i] += 32;
}
if(s2[i] >= 65 && s2... | ALGO | 0.999985 | 3.767747 |
2bdd9757-9f77-4309-90a3-755a9d72d91b | flutter4548989fgt89/shareapp | 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.998809 | 6.763549 |
c9e4b866-29fb-4ab0-8d25-a9983f71ea93 | rajibdpi/leetcode-sol-mkdocs | main/solutions/0507. Perfect Number/0507.cpp | class Solution {
public:
bool checkPerfectNumber(int num) {
if (num == 1)
return false;
int sum = 1;
for (int i = 2; i <= sqrt(num); ++i)
if (num % i == 0)
sum += i + num / i;
return sum == num;
}
};
| ALGO | 0.999769 | 6.123635 |
3fe64aae-3616-4e97-a8b7-f3c565e46556 | ikorotkin/gromacs_fhmd | src/gromacs/utility/datafilefinder.cpp | /*! \internal \file
* \brief
* Implements gmx::DataFileFinder.
*
* \author Teemu Murtola <<EMAIL>>
* \ingroup module_utility
*/
#include "gmxpre.h"
#include "datafilefinder.h"
#include <cstdlib>
#include <string>
#include <vector>
#include "buildinfo.h"
#include "gromacs/utility/directoryenumerator.h"
#includ... | TOOL | 0.958857 | 7.285352 |
65809984-3b88-469f-8c56-cfd492973d74 | NeuHezxp/GAT150-Game | Source/ThirdParty/box2d/src/collision/b2_time_of_impact.cpp | #include "box2d/b2_collision.h"
#include "box2d/b2_distance.h"
#include "box2d/b2_circle_shape.h"
#include "box2d/b2_polygon_shape.h"
#include "box2d/b2_time_of_impact.h"
#include "box2d/b2_timer.h"
#include <stdio.h>
B2_API float b2_toiTime, b2_toiMaxTime;
B2_API int32 b2_toiCalls, b2_toiIters, b2_toiMaxIters;
B2_AP... | ALGO | 0.999745 | 6.949615 |
10326a7a-14a9-4a60-bdb9-2af49fd6c97e | Alexander-L-Li/Competitive-Programming | USACO Bronze/December 2017 Contest/billboard.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <fstream>
using namespace std;
#define ll long long
int main(){
ifstream fin("billboard.in");
ofstream fout("billboard.out");
int ans = 0;
int x1, y1, x2, y2, b1x1, b1x2, b1y1, b1y2, b2x1, b2x2, b2y1, b2y2;
int h, w;
for(int i=0; i<3;... | ALGO | 0.999748 | 3.961095 |
044acc92-d888-497e-824a-1d72c87ff780 | kanu-CH/Leetcode-Solutions | 2574_Left_and_Right_Sum_Differences.cpp | class Solution {
public:
vector<int> leftRightDifference(vector<int>& nums) {
vector<int> ans;
int LSum = 0, RSum = 0, tmp = 0;
for(auto x : nums) RSum += x;
for(int i = 0; i < nums.size(); i++){
RSum -= nums[i];
tmp = abs(LSum - RSum);
ans.push_ba... | ALGO | 0.999864 | 5.77121 |
14267633-9f55-4164-850a-6199e9321533 | tsistoza/CppLeetCode | FindCharInWords.cpp | // LeetCode 2942
#include <iostream>
#include <vector>
#include <string>
using std::cout, std::endl, std::vector;
using std::string;
static vector<string> words { "leet", "code" };
static char x = 'e';
namespace Solution {
class Program {
public:
static inline void prettyPrint(vector<int> idx... | ALGO | 0.989647 | 4.836359 |
af8ff6db-f7b1-4775-a9d2-4f627d8e6227 | rohit7044/Advanced-Computer-Vision-NTU-Spring-2022 | ACV_HomeWorks/ACV_HomeWorks/hw1.cpp | #include<iostream>
#include<vector>
#include<limits>
#include<cmath>
#include<utility>
#include<opencv2/opencv.hpp>
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
typedef vector< pair<Point2i, Mat> > imgSet;
typedef vector< pair<Point2i, Point2i> > vecto... | ALGO | 0.976598 | 4.452106 |
15d98a69-4518-4e97-a0f2-15b6b2c6e8a5 | priyanshu334/flutter_ecom | 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 |
5534d221-2641-42d9-b386-f4940bd62355 | emeraldy/CnC_Generals_Zero_Hour | Generals/Code/Tools/Launcher/BFISH.CPP | /***********************************************************************************************
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
***********************************************************************************************
* ... | ALGO | 0.998986 | 6.97261 |
60d6b08c-9e74-4fd3-a357-782aab3480da | HectorTa1989/LeetCode-Cpp | LL/find the most frequent element value in the list and its occurrence.cpp | /*Given a singly linked list, write code to find the most frequent element value in the list and its occurrence.
In case of duplicate number of occurrences, return the element value closest to the head.
A solution of time complexity O(N) average is preferred.
Sample Input: 1 2 3 4 2 3 2
Sample Output: Element 2 occurs... | ALGO | 0.999997 | 5.229934 |
4c402c7d-4b4a-4417-8f27-c5ff6ff76e44 | Wbrta/ACM | Other/BinaryTree.cpp | #include <iostream>
using namespace std;
typedef struct node{
int data; int pos;
node *l, *r;
}Tree;
void insert(Tree *root, int los, int fat, int num){
if(root == NULL) return;
if(fat == 0){
root -> pos = los;
root -> data = num;
root -> l = NULL;
root -> r = NULL;
return;
}else if(root -> pos == fat){... | ALGO | 0.999972 | 3.67883 |
1aa485da-6807-430f-bc51-80c04467d5d0 | mbalasu2/UoI_VAR_V2 | UoI_Lasso.cpp | #define EIGEN_DEFAULT_TO_ROW_MAJOR
#include <boost/tuple/tuple.hpp>
#include <iostream>
#include <eigen3/Eigen/Dense>
#include <fstream>
#include <string>
#include <mpi.h>
#include <cmath>
#define EIGEN_USE_MKL_ALL
#include "lasso.h"
#include "structure.h"
#include "manage-data.h"
#include "UoI_Lasso.h"
#include "bins.... | DATA | 0.997042 | 5.031261 |
2c420d1b-6519-4f85-8efb-4a444217ec7b | Sarang8/Leetcode_Problems | 435-non-overlapping-intervals/435-non-overlapping-intervals.cpp | class Solution {
public:
int eraseOverlapIntervals(vector<vector<int>>& intervals) {
int n=intervals.size();
sort(intervals.begin(), intervals.end());
int end = intervals[0][1];
int ans=0;
for(int i=1;i<n;i++){
if( end > int... | ALGO | 0.999965 | 6.03275 |
2a9e3559-f7d2-4051-b1e7-c819edb3c2a3 | andreshungbz/CMPS2131 | practice/tree/binary-tree-traversal-simplified/main.cpp | #include <iostream>
using namespace std;
//////////////////////////////////////////////////////
/////// NODE ///////
// This struct represents the node in our tree.
struct node
{
int value; // The value
struct node* left; // A pointer to the node for the left child.
struct node* right; ... | ALGO | 0.999659 | 6.07129 |
4d18a462-360d-4eb0-b0b3-6435b6d87cfc | lcnzg/lammps-pi | src/KSPACE/pppm_tip4p.cpp | /* ----------------------------------------------------------------------
Contributing authors: Amalie Frischknecht and Ahmed Ismail (SNL)
------------------------------------------------------------------------- */
#include "pppm_tip4p.h"
#include <mpi.h>
#include <cmath>
#include "atom.h"
#include "domain.h"
#inc... | ALGO | 0.996208 | 6.334095 |
c33cdbcb-0013-4b36-a3fc-268d8c3b3f3f | istiaqueahmedarik/CP_RESOURCE | DP/nThTribonacci.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[1000000];
int ans(int n)
{
dp[0] = 0;
dp[1] = 1;
dp[2] = 1;
for (int i = 3; i <= n; i++)
{
dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3];
}
return dp[n];
}
int main()
{
int n;
cin >> n;
cout << ans(n) << endl;
} | ALGO | 0.999981 | 4.483425 |
33306f26-5de1-4f54-bfd3-7b14edf530cd | Its0mar/CodeForces | A/767A-Snacktower.cpp | //Snacktower
#include <iostream>
#include <vector>
#define loop(i,n) for(int i = 0; i < n; ++i)
using namespace std;
int main() {
int n,x;
cin >> n;
vector<bool> v(n, false);
int next = n;
loop(i, n) {
cin >> x;
v[x] = true;
while (v[next] == true)
{
... | ALGO | 0.999965 | 3.902644 |
0881d440-402c-46c6-ac42-26006087bd0f | StolasIn/leetcode_Submissions | content/course-schedule/Time Limit Exceeded/1-29-2021, 7_27_14 PM/Solution.cpp | // https://leetcode.com/problems/course-schedule
class Solution {
public:
bool ans=true;
int point;
void dfs(vector<vector<int>>& g,vector<bool>& vis,int now){
if(ans==false) return;
if(vis[now]==true) ans=false;
vis[now]=true;
for(int i : g[now]){
dfs(g,vis,i);
... | ALGO | 0.999991 | 6.189492 |
1eac9e55-274c-4f33-bd02-4524db9ab858 | TeckLlama/Safe_Combination | Safe_Combination/Safe_Combination/Safe_Combination.cpp | // Auther: Elliot Rihan
// Created: 02/11/18
// Description: C++ program to find safe combination that is a
// perfect square number and is not divisable by 2, 3 and 5
#include "pch.h"
#include <iostream>
using namespace std;
int main()
{
int totalPossibleCombinations = 0;
int totalNotPossibleCombinations = 0;
int... | ALGO | 0.997632 | 4.166897 |
94c39ae1-af0a-47c5-a990-a6bcaac7f7f6 | RavvChek/algorithms | yandex_exercises/ex3/H.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
int main() {
int n;
string str;
cin >> str;
n = stoi(str);
stack<int> number_stack;
vector<long long> prefix_sum;
vector<long long> result;
prefix_sum.push_back(0);
for (int i = 0; i < n; i++) {
cin... | ALGO | 0.999971 | 4.119456 |
f004dba3-febd-4298-a98e-598763b4ca19 | jainsourav43/DSA | CP/snakeandtemple.cpp | #include<iostream>
#include<map>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
map<ll,ll> m1;
map<ll,ll> m2;
ll inc[100001]; // Length of increasing subarray ending at all indexes
ll dec1[100001];
ll bitonic(ll arr[], ll n)
{
// Length of dec1reasing subarray starting at all indexes
ll i, m... | ALGO | 0.999824 | 3.904875 |
ed32a72a-c23d-411c-b661-aba0108a0e3b | joshualass/CP | Solutions/Default/humancannonball.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
ld distance_time(pair<ld,ld> one, pair<ld,ld> two) {
ld x1 = one.first;
ld y1 = one.second;
ld x2 = two.first;
ld y2 = two.second;
ld distance = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
retur... | ALGO | 0.999956 | 4.595146 |
a84222d5-8de3-459a-a279-15f1a30bc990 | TranKhanhAnB24DTCN183/Session-5 | session 5 ex7.cpp | #include <stdio.h>
int UCLN(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}
int main() {
int a, b;
printf("Nhap so nguyen duong a: ");
scanf("%d", &a);
printf("Nhap so nguyen duong b: ");
scanf("%d", &b);
if (a <= 0 || b <... | ALGO | 0.998258 | 4.771896 |
d4924de5-de33-4509-9d83-101502d86c69 | hzfsls/leetcode-supercrawl | data/0962.maximum-width-ramp/code_snippets/sol.cpp | class Solution {
public:
int maxWidthRamp(vector<int>& nums) {
}
}; | ALGO | 0.999868 | 5.919491 |
8640e4ab-6609-40de-bec1-1dfcdd730d3f | CGCL-codes/MHSim | zsim/pin-2.14/source/tools/SimpleExamples/catmix.cpp | /* ===================================================================== */
/*
@ORIGINAL_AUTHOR: Robert Muth
*/
/* ===================================================================== */
/*! @file
* This file contains a static and dynamic instruction category mix profiler
*/
#include "pin.H"
#include <list>
#in... | TOOL | 0.958547 | 6.991081 |
9e1033e6-99a5-407b-8899-9c9f3bbc028f | 846754497THK/ACM-tools-and-skills | 程序板子/Data-Structure/Barycenter-Tree.cpp | /*
重心树
将分治层的重心和父重心之间连边构树
题目大意:给出一棵点权树,允许修改点权,询问与点x距离差小于等于d的点的点权和
题解:对于原树建立重心树,对于每个点维护两棵权值线段树,
分别表示以该点为重心的分治层中到这个点的距离的点集以及到这个点重心树父亲距离的点集
在统计x节点的时候只要统计其到重心树根的链上每个重心的贡献值累加即可,
每个重心的贡献要计算折算后的距离在第一棵线段树中的答案,
减去子重心的父重心在第二棵线段树的统计答案,即删去Fx和x之间的不该被统计的点权。
*/
#include <algorithm>
#include <cstdio>
#in... | ALGO | 0.999975 | 4.382242 |
92af5821-218b-4c38-a2da-3d27339a455c | AbhJ/some-cp-files-1 | codeforces1433D.cpp | //Coded by Abhijay Mitra
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <numeric>
#include <vector>
#include <iterator>
#include <map>
#include <set>
#include <climits>
#include <queue>
#include <cmath>
#include <stack>
#include <cctype>
#i... | ALGO | 0.99969 | 3.980569 |
7902aba3-d037-4b91-80c7-3251cec884be | joohyuk95/PS_from_BOJ | intermediate/11.cpp | #include <iostream>
using namespace std;
int a, b, sum, res;
int summ[1001];
int arr[1001];
int main()
{
cin >> a >> b;
int num = 1;
while (1) {
summ[num] = summ[num - 1] + num;
if (summ[num] > 1000) break;
++num;
}
int cnt = 1;
for (int i = 1; i <= 1000; ++i) {
... | ALGO | 0.999631 | 3.899102 |
9a012008-36b9-4532-b5c6-d2e4f16c46b4 | wcysai/triple_dogs | ucup/2nd/stage6/gen.cpp | #pragma GCC optimize(3)
#include<bits/stdc++.h>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,q,a[MAXN];
mt19937 wcy(time(NULL));
int main()
{
scanf("%d%d",&n,&q);
printf("%d %d\n",n,q)... | ALGO | 0.996356 | 3.127808 |
7a660488-b5b8-4afa-af63-d6f02eea90d1 | avidLearnerInProgress/placementPreparation | Stack/maxOfMinWindowSize.cpp | #include<bits/stdc++.h>
using namespace std;
int max(int a,int b){
return ((a>b)?a:b);
}
int printMaxOfMin(int v[],int n){
stack<int>s;
vector<int> left(n+1);
vector<int> right(n+1);
for(int i=0;i<n;i++)
{
left[i]=-1;
right[i]=n;
}
for(int i=0;i<n;i++){
... | ALGO | 0.999899 | 4.539505 |
739eea95-4934-4108-a15d-db5da5c6fa52 | Sanvanth/Leetcode-Problems | 0139-word-break/0139-word-break.cpp | class Solution {
public:
bool wordBreak(string s, vector<string>& wordDict) {
unordered_set<string> wordSet(wordDict.begin(), wordDict.end()); // Convert wordDict to a set for faster lookup
vector<bool> dp(s.size() + 1, false); // DP array to store whether substring s[0:i] can be segmented
... | ALGO | 0.998517 | 6.709016 |
3ebb7783-1cc8-4186-b8f9-d6d8504c83f4 | Hee-won/LLVM-JSRfuzz | libcxx/src/debug.cpp | #include <__assert>
#include <__config>
#include <__debug>
#include <__hash_table>
#include <algorithm>
#include <cstdio>
#include <functional>
#include <string>
#ifndef _LIBCPP_HAS_NO_THREADS
# include <mutex>
# if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
# pragma comment(lib, "pthread")
# endif
#e... | TOOL | 0.889473 | 3.772306 |
2189728d-0dfc-44b0-99e4-9f9c5eea3634 | wongxingjun/leetcode | candy.cpp | class Solution {
public:
int candy(vector<int>& ratings) {
int n=ratings.size();
if(n==0)
return 0;
vector<int> c(n,1);
for(int i=1;i<n;i++)
{
if(ratings[i]>ratings[i-1])
c[i]=c[i-1]+1;
else
c[i]=1;
}... | ALGO | 0.999992 | 6.186841 |
cd54d391-1308-4855-a40b-50cb6b264ccb | ishandutta2007/codeforces | mikhaelkh/normal/792/D.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
ios_base::sync_with_stdio(0);
long long n, q;
cin >> n >> q;
for (int i=0; i<q; ++i) {
long long u, x;
string s;
cin >> u >> s;
x = 1LL << __builtin_ctzll(u);
for (char s... | ALGO | 0.999759 | 4.165225 |
b148f09b-ff09-4597-b042-5a078fa4c045 | ProjectGhostOS/frameworks_av | media/module/codecs/amrnb/enc/src/calc_cor.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/calc_cor.c
Date: 06/12/2000
------------------------------------------------------------------------------
REVISION HISTORY
Description: Initial Optimization
Description: Optimize code by calc... | ALGO | 0.999931 | 6.511064 |
99753382-9034-4428-ba63-6166e6f23959 | utkarshindia0122/dsa-code | string/duplicate_in_string.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
getline(cin,s);
unordered_map<char,int> map;
int n=s.size();
for(int i=0;i<n;i++){
map[s[i]]++;
}
for(auto it=map.begin();it!=map.end();it++){
if((*it).second>=2){
cout<<(*it).first<<" "<<(*it).second<<endl;
}
}
return 0;
} | ALGO | 0.999434 | 3.244276 |
1d47ad53-a345-48f6-a496-c75320880804 | VillaKeth/Competitive-Programming | 1800/Path-Queries.cpp | #include <cstdlib>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <iostream>
#include <string>
#include <deque>
#include <queue>
#include <stack>
#include <cmath>
#include <climits>
#include <algorithm>
#include <chrono>
#include <cstdint>
#include <fstream>
#include <numeric>
#defin... | ALGO | 0.999884 | 4.384624 |
9c6d199f-d433-4486-b00a-340c5b751d5c | actium/codeforces | 0800/20/827a.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& v)
{
for (T& a : v)
input >> a;
return input;
}
void answer(const std::string& x)
{
std::cout << x << '\n';
}
void solve(std::vector<s... | ALGO | 0.999468 | 3.995425 |
8d587d38-b0ef-4898-b3fe-0c4503efbbd2 | tjandbjzy/ACMcode | CF/368/A.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <vector>
#include <cmath>
#include <cstdlib>
typedef long long ll;
int main(){
int n, m;
char t;
bool flag = true;
std::cin >> n >> m;
for(int i = 0; i < n; ++i){
for(int j = 0; j < m; +... | ALGO | 0.997996 | 3.662816 |
b5b5ecb6-d80a-4464-8878-a1524ff54183 | connieya/cpp_algorithm | baaaaakingdog/0x13_simulation/14500.cpp | #include "bits/stdc++.h"
using namespace std;
int n, m, ans = 0;
int board[501][501];
bool visited[501][501];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
void dfs(int sum, int idx, int x, int y) {
if (idx == 4) {
ans = max(ans, sum);
return;
}
for (int i = 0; i < 4; ++i) {
... | ALGO | 0.999908 | 4.698204 |
365cee1f-8ba9-46b2-8a9a-6972a17e4897 | MEMORY2077/study | 474一和零.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
int findMaxForm(vector<string>& strs, int m, int n) {
int dp[125][125]={{0}};
for(string str:strs){
int One=0;
int Zero=0;
for(char no... | ALGO | 0.999936 | 5.932196 |
86f51e58-57e9-4e94-b668-0c13cb4c1443 | MericLuc/Common-coding-puzzles | Sorting/bubble sort.cpp | #include <vector>
template< class T >
std::vector<T> bubbleSort( const std::vector<T>& m )
{
std::vector<T> v(m);
bool keep(true);
while( keep )
{
keep = false;
for ( int i = 0; i < v.size() - 1; i++ )
if ( v[i] > v[i+1] ) { swap(v[i], v[i+1]); keep = true; }
}
return v;... | ALGO | 0.999771 | 5.120636 |
a52bc29d-8c28-46d5-9ae4-d8c1212eddaa | Codarki/Pyrotech_2016 | democodebase/SDK/boost/libs/intrusive/example/doc_bucket_traits.cpp | using namespace boost::intrusive;
//A class to be inserted in an unordered_set
class MyClass : public unordered_set_base_hook<>
{
int int_;
public:
MyClass(int i = 0) : int_(i)
{}
friend bool operator==(const MyClass &l, const MyClass &r)
{ return l.int_ == r.int_; }
friend std::size_t has... | TOOL | 0.940169 | 5.914362 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.