uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
38cc521a-7570-4945-b122-9580130fb47c | hzfsls/leetcode-supercrawl | data/1300.sum-of-mutated-array-closest-to-target/code_snippets/sol.cpp | class Solution {
public:
int findBestValue(vector<int>& arr, int target) {
}
}; | ALGO | 0.999681 | 5.796828 |
c4376940-5e22-4d9b-964f-2f82b6dd0ccb | BohdanKyslyi/Infernis-Engine | src/Layers/xrRenderPC_R4/r4_rendertarget_phase_luminance.cpp | #include "stdafx.h"
#pragma pack(push,4)
struct v_build {
Fvector4 p;
Fvector2 uv0;
Fvector2 uv1;
Fvector2 uv2;
Fvector2 uv3;
};
struct v_filter {
Fvector4 p;
Fvector4 uv[8];
};
#pragma pack(pop)
void CRenderTarget::phase_luminance()
{
u32 Offset = 0;
// float eps = EPS_S;
float eps = 0;
// Targets
RC... | TOOL | 0.938551 | 3.477755 |
15d24b26-0681-4757-ab1d-089547c1c687 | P0L3NARUBA/roblox-2016-source-code | Contribs/boost_1_56_0/libs/numeric/odeint/examples/vexcl/lorenz_ensemble.cpp | #include <iostream>
#include <vector>
#include <vexcl/vexcl.hpp>
#include <boost/numeric/odeint.hpp>
//[ vexcl_includes
#include <boost/numeric/odeint/external/vexcl/vexcl.hpp>
//]
namespace odeint = boost::numeric::odeint;
//[ vexcl_state_types
typedef vex::vector< double > vector_type;
typedef vex::multivector... | ALGO | 0.999855 | 6.114208 |
5d57e624-5c44-47ca-8671-3dcd5f65fd16 | jacobeverist/opaque | src/modules/alphashape/boost_1_53_0/libs/icl/example/partys_height_average_/partys_height_average.cpp | /** Example partys_height_average.cpp \file partys_height_average.cpp
\brief Using <i>aggregate on overlap</i> a history of height averages of
party guests is computed.
In partys_height_average.cpp we compute yet another aggregation:
The average height of guests as it changes over time. This is... | ALGO | 0.959909 | 6.924452 |
840569c3-b6ae-4cb4-b163-8b8e85fac61d | ljwin007/Fin-Eng-C-course | Fin Eng C++ course/DesignCPP/mains/VanillaMain1.cpp | //
//
// VanillaMain1.cpp
//
//
/*
requires DoubleDigital.cpp
PayOff2.cpp
Random1.cpp
SimpleMC3.cpp
Vanilla1.cpp
*/
#include<SimpleMC3.h>
#include<DoubleDigital.h>
#include<iostream>
using namespace std;
#include<Vanilla1.h>
int main()
{
double Expiry;
double L... | ALGO | 0.996671 | 5.518151 |
adfa79ab-20e0-4e06-93e9-95e56534d457 | niljason/leetcode | 1301-1400/1400-Construct-K-Palindrome-Strings.cpp | class Solution {
public:
bool canConstruct(string s, int k) {
// each letter is used once and so cannot be possible to have more than length of string
if (k > s.size()) { return false; }
vector<int> occurences(26, 0);
for (char c : s) {
occurences[c-'a']++;
}
... | ALGO | 0.999966 | 6.374076 |
dbbc3834-0629-47b8-9709-8f95198d36a1 | sxmbaka/leetcode-solutions-archive | 0946-validate-stack-sequences/0946-validate-stack-sequences.cpp | class Solution {
public:
bool validateStackSequences(vector<int>& pushed, vector<int>& popped) {
int ptr = 0, len = popped.size();
stack<int> s;
for (auto p : pushed) {
s.push(p);
// cout << "pushed " << p << ".\n";
while (!s.empty() && ptr < len && s.top(... | ALGO | 0.999276 | 6.010922 |
40db9d29-8fe5-46d1-b4f4-5b812517fdda | KOSASIH/pi-nexus-autonomous-banking-network | nexus_banking_networks/core/authenticator.cpp | #include <iostream>
#include <string>
#include <openssl/aes.h>
#include <openssl/rand.h>
class Authenticator {
public:
Authenticator(const std::string& username, const std::string& password) : username_(username), password_(password) {}
bool authenticate(const std::string& otp) {
// Generate a random ... | TOOL | 0.968717 | 7.05143 |
20757b74-7b72-4673-a093-f2a5eb9f89a2 | Hiikarishma/_PaymentGetwayDemo | 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 |
26de4fb6-c9e7-4fa2-a939-12c8e79a21c7 | Hasil-Sharma/leet-code | trim-a-binary-search-tree-1.cpp | // https://leetcode.com/problems/trim-a-binary-search-tree/description/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* trimBST(Tree... | ALGO | 0.999983 | 6.939974 |
50185b57-60d5-40a3-a85f-249b4ee0d739 | ifilot/hfcxx | src/repulsion.cpp | #include "repulsion.h"
double cgf_repulsion(const CGF &cgf1,const CGF &cgf2,const CGF &cgf3,const CGF &cgf4) {
double sum = 0;
int size1 = cgf1.gtos.size();
int size2 = cgf2.gtos.size();
int size3 = cgf3.gtos.size();
int size4 = cgf4.gtos.size();
#ifdef HAS_OPENMP
#pragma omp parallel for... | ALGO | 0.999871 | 4.800475 |
7468cf76-cf26-4e88-8abf-085140f4c4a0 | VuTienQuang/CTDL-GT | bobanhohonk.cpp | #include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz size()
#define ll long long
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define FORD(i, a, b) for(int i = a; i >= b; i--)
#define F(i, a, b) for(int i = a; i < b; ++i)
#define FD(i... | ALGO | 0.999882 | 3.96393 |
8f0a4321-911a-48a9-b075-acbb63e7ec06 | Bigcheese/libcxx | test/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T>
// requires HasLess<T, Iter::value_type>
// && HasLess<Iter::value_type, T>
// pair<Iter, Iter>
// equal_range(Iter first, Iter last, const T& value);
#include <algorithm>
#include <vector>
#include <cassert>
#include "../../../iterators.h"
tem... | TEST | 0.998875 | 6.330051 |
b1a5c18f-df56-4e3b-ba5c-fd4a7def04f2 | debarghamitraroy/Competitive-Programming | CodeChef/THREETOPICS.cpp | #include <iostream>
#include <vector>
using namespace std;
void solve();
int main() {
solve();
return 0;
}
void solve() {
vector<int> v(3);
for (int i = 0; i < 3; i++) {
cin >> v[i];
}
int n;
cin >> n;
int count = 0;
for (int i = 0; i < 3; i++) {
if (v[i] == n)
... | ALGO | 0.999979 | 4.094289 |
5c8dd4f6-900a-4113-a9ba-fa8d556132e5 | JstVex/CS-002 | Chp8/programming_project_1/main.cpp | #include <iostream>
#include <cctype>
void processSentence(char sentence[]) {
bool capitalizeNextWord = true;
for (int i = 0; sentence[i] != '\0'; ++i) {
if (std::isalpha(sentence[i])) {
if (capitalizeNextWord) {
sentence[i] = std::toupper(sentence[i]);
capi... | TOOL | 0.950145 | 6.291725 |
f878527e-eede-4ce5-b211-dcd150436b98 | MyLeetCodeRecord/cpp-leetcode | workspace/538.把二叉搜索树转换为累加树.cpp | /*
* @lc app=leetcode.cn id=538 lang=cpp
*
* [538] 把二叉搜索树转换为累加树
*/
// @lc code=start
class Solution {
public:
// 先右后左的中序遍历
int sum = 0;
void inOrder(TreeNode* root){
if(root==NULL)
return ;
else{
inOrder(root->right);
root->val += sum;
sum... | ALGO | 0.999981 | 6.711464 |
3d140559-7461-42c2-ad4f-124c4e3acf00 | rwightman/boost | libs/sort/example/keyplusdatasample.cpp | // See http://www.boost.org/libs/sort for library home page.
#include <boost/sort/spreadsort/spreadsort.hpp>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
using namespace boost::sort::spreadso... | ALGO | 0.998613 | 4.633251 |
093bba5a-f375-4858-83d4-1d3bcce5b683 | rocmnavi/boost | libs/numeric/odeint/examples/van_der_pol_stiff.cpp | #include <iostream>
#include <fstream>
#include <utility>
#include <boost/numeric/odeint.hpp>
#include <boost/phoenix/core.hpp>
#include <boost/phoenix/operator.hpp>
using namespace std;
using namespace boost::numeric::odeint;
namespace phoenix = boost::phoenix;
const double mu = 1000.0;
typedef boost::numeric::ub... | ALGO | 0.999001 | 5.570545 |
9cd21941-eb94-4450-9046-22d634e41b7b | namsojeong/CodingTest_Study | CodingTest/숫자카드.cpp | #include<iostream>
#include<set>
using namespace std;
int n, m;
int num;
set<int> s;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> num;
s.insert(num);
}
cin >> m;
for (int i = 0; i < m; i++)
{
cin >> num;
if (s.find(num)... | ALGO | 0.999886 | 3.592561 |
4f396aa5-3172-469f-9b2c-c09515677152 | 7Kaloyan7Markov7/Introduction-To-Programming-FMI | Week 4/getReversedNumber.cpp | #include <iostream>
int getReversedNum(int n)
{
if (n == 0)
{
return 0;
}
int result = 0;
while (n != 0)
{
result += n % 10;
if (n >= 10)
{
result *= 10;
}
n /= 10;
}
return result;
}
| ALGO | 0.998848 | 5.149419 |
da97ea88-b11e-49ed-a40a-51e6f8d024f4 | asu-crypto/mpsica | thirdparty/linux/boost/libs/type_traits/examples/fill_example.cpp | #include <iostream>
#include <typeinfo>
#include <algorithm>
#include <iterator>
#include <memory>
#include <cstring>
#include <boost/test/included/prg_exec_monitor.hpp>
#include <boost/timer.hpp>
#include <boost/type_traits.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE) || (defined(std) && defined(__SGI_STL_PORT))
namesp... | TOOL | 0.851455 | 6.61789 |
7dc9b287-d317-43f5-91b0-7956d153cfe5 | ShreyaPramanik47/TCS-NQT-Coding-Sheet | String/6.cpp | // Remove characters from a string except alphabets
#include <bits/stdc++.h>
using namespace std;
string newStr(string str){
string strr;
for(int i=0; i<str.size(); i++){
if(isalpha(str[i])){
strr+=str[i];
}
}
return strr;
}
int main(){
string str = "take12% *&u ^$#forward... | ALGO | 0.96599 | 3.848087 |
7518d320-c22b-4b11-bfc2-7bda1fc9ff8f | likalella/PL-Assignment1 | TicTacToe/TicTacToeAI.cpp | #include "StdAfx.h"
#include "TicTacToeAI.h"
/**
: TicTacToeAI(GameBoard board)
: Ѱܹ Լ
*/
// lika
TicTacToeAI::TicTacToeAI(GameBoard board)
{
tttBoard = board;
root = new Node;
InitNode(root, 0);
LAlevel = tttBoard.oppLevel;
criterion = tttBoard.oppnentCom;
};
/**
: InitNode(Node* node, int inDepth)
... | ALGO | 0.997335 | 4.266032 |
063defa2-0ccf-4a6d-919b-1b310ad2f5ec | nehasangeetajha/LeetCode | JulyLeetCodingChallenge/SingleNumberIII.cpp | //https://leetcode.com/explore/challenge/card/july-leetcoding-challenge/547/week-4-july-22nd-july-28th/3399/
/*
Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.
Example:
Input: [1,2,1,3,2,5]
Ou... | ALGO | 0.999538 | 5.567348 |
b36c2852-1ca0-4ae7-9057-6d61424861e4 | jiangxu05/notes | 题/洛谷刷题笔记/数组/冰雹猜想.cpp | //输入一个数,如果是奇数,乘3+1;偶数除2.循环后变成1,冰雹猜想
//要求存储每一次的变化,并且倒顺序输出,不知次数,动态数组,while循环
//我不知如何存入每次变化的数据
#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> v;
while(n != 1){ //n不等于1时,但是n最后一个 都是1,所以看下一条注释
if(n %2 == 0 ){
v.pu... | ALGO | 0.999976 | 4.721661 |
b0f24bcf-75be-4e05-a6f7-206104121ca5 | 1468362286/Algorithm | POJ/3264/12356331_AC_1625ms_2188kB.cpp | #include <stdio.h>
int max(int a,int b){return a>b?a:b;}
int min(int a,int b){return a>b?b:a;}
const int maxn = 50010;
const int inf = 0x7fffffff;
struct tree
{
int l,r;
int Min,Max;
}segTree[200040];
void build(int i,int l,int r)
{
segTree[i].l=l;
segTree[i].r=r;
segTree[i].Max=0;
segTree[i].Min=0;
if(l==r)
... | ALGO | 0.999982 | 4.364469 |
1133dad8-9678-45b5-8c35-9523a45e6eac | ishandutta2007/codeforces | dormi/normal/1556/B.cpp | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T>
int SZ(const T &a){return int(a.size());}
const int MN=1e5+1;
int arr[MN];
int bit[MN];
int n;
void update(int loc, int val){
for(;loc<=n;loc+=loc&-loc)bit[loc]+=val;
}
ll que... | ALGO | 0.999933 | 3.7402 |
dc52e71c-cdda-4a0e-b5f7-80738571e4bf | MercuryGH/brushed_questions | bytedance/2.cpp | #include <algorithm>
#include <ctime>
#include <cmath>
#include <iostream>
#include <list>
#include <memory>
#include <queue>
#include <stack>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using std::vector, std::string;
int n, m;
class Solutio... | ALGO | 0.99999 | 5.065433 |
cb1abc39-4562-4db9-b02d-777a3a78e5fc | noureldin-khaled/workspace | C++/UVA/Coin Collector.cpp | #include <bits/stdc++.h>
#define INF 2147483647
using namespace std;
int main()
{
int t;
scanf("%i",&t);
while(t--)
{
int n;
scanf("%i",&n);
int arr[n];
for (int i = 0; i < n; i++)
scanf("%i",&arr[i]);
int ans[n];
memset(ans, 0, sizeof ans);
for (int i = 0; i < n; i++)
{
int cur = arr[i];... | ALGO | 0.999834 | 3.629684 |
f93ecca0-ee10-4e65-b655-e4370106be5a | sarvex/leetcode-chicken | lcof2/剑指 Offer II 074. 合并区间/Solution.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
sort(intervals.begin(), intervals.end());
int st = intervals[0][0], ed = intervals[0][1];
vector<vector<int>> ans;
for (int i = 1; i < intervals.size(); ++i) {
int s = intervals[i][0], e ... | ALGO | 0.999995 | 6.041413 |
27d35d94-c3ce-450a-9555-925ae6fbe0f8 | eryueniaobp/leetcode | revised/3 Sum Closest.cpp | /**
* O(nlogn) + O(n^2)
* */
class Solution {
public:
int threeSumClosest(vector<int> &num, int target) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int size = num.size();
if(size == 0 ) {
return 0;
}
sort(num.be... | ALGO | 0.999994 | 5.683406 |
bb390eff-7177-4daf-bb0b-9b55dc094d6b | open-watcom/owp4v1copy | bld/plustest/regress/stl.94/examples/modulus.cpp | // This example compiles using the new STL<ToolKit> from ObjectSpace, Inc.
// STL<ToolKit> is the EASIEST to use STL that works on most platform/compiler
// combinations, including cfront, Borland, Visual C++, C Set++, ObjectCenter,
// and the latest Sun & HP compilers. Read the README.STL file in this
// directory ... | ALGO | 0.99938 | 4.297268 |
f2fa43dd-828f-4e30-8cc8-1ec7e1f97c59 | thecreatorsir/striver-DSA-sheet-solutions | DFS for graph.cpp | void dfs(vector<int> adj[],vector<int> &ans,vector<int> &vis,int curr){
vis[curr] = 1;
ans.push_back(curr);
for(auto x:adj[curr]){
if(!vis[x]){
dfs(adj,ans,vis,x);
}
}
}
vector<int> dfsOfGraph(int V, vector<int> adj[]) {
vector<int>... | ALGO | 0.999938 | 5.772927 |
1be3da9a-aca6-48a2-8cad-4157ea2232e0 | sarnold/cbmc | src/linking/entry_point.cpp | /*******************************************************************\
Module:
Author: Daniel Kroening, <EMAIL>
\*******************************************************************/
#include <cassert>
#include <cstdlib>
#include <util/namespace.h>
#include <util/expr_util.h>
#include <util/std_expr.h>
#include <uti... | TOOL | 0.930442 | 7.67188 |
8fc98d1e-28d9-405b-8ca6-67c6a79aa4a4 | SanaAitLahcen/ArbreBinaire | ArbreBinaire/ArbreB.cpp | #include "ArbreB.h"
ArbreB::ArbreB(int val) : Fdt(NULL), Fgh(NULL), value(val)
{
}
ArbreB* ArbreB::getFdt()
{
return Fdt;
}
ArbreB* ArbreB::getFgh()
{
return Fgh;
}
int ArbreB::getVal()
{
return value;
}
// Insérer une nouvelle valeur dans l'arbre binaire
void ArbreB::InsertArbB(int val)
{
// Si le... | ALGO | 0.999395 | 3.637509 |
9e1e0e76-4db8-4354-9c65-a9439e5e5ced | Dreamer0iQ/nstu_lab6 | fifth/smth.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;
typedef vector<vector<int>> Matrix;
// случайной доски
Matrix generateRandomBoard(int n, int m) {
Matrix board(n, vector<int>(m));
for (int i = 0; i < n; ++i)
for (int j = 0; j < m; ++j)
bo... | ALGO | 0.999992 | 5.717308 |
1893ec84-c881-4194-a1fa-c4cae55edce5 | NateLeeP/eecs-280-p1-stats | p1_library.cpp | /* p1_library.cpp
*
* Libraries needed for EECS 280 project 1
* Project UID 5366c7e2b77742d5b2142097e51561a5
*
* by Andrew DeOrio <<EMAIL>>
* 2015-04-28
*/
////////////////////////// Local copy of csvstream.h ///////////////////////////
///////////// GitHub hash 5778b1dcd2e65c7019b0d5bd903950a3d787cd9d ///////... | TOOL | 0.944682 | 6.92916 |
7c2e1fc8-8bcc-4728-b906-aa42a7944210 | ishandutta2007/codeforces | peti1234/normal/1345/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int c=100001;
long long p[c], w, n, db;
int main()
{
ios_base::sync_with_stdio(false);
for (int i=1; i<=c; i++) p[i]=p[i-1]+3*i-1;
cin >> w;
while(w--) {
cin >> n, db=0;
while(n>1) {
int l=1, h=c;
while(h-l>1) {... | ALGO | 0.999961 | 3.824662 |
b6460db3-9d5f-4409-847d-a859456c5407 | nandinitak/Interview_pep | 0081-search-in-rotated-sorted-array-ii/0081-search-in-rotated-sorted-array-ii.cpp | class Solution {
public:
bool search(vector<int>& nums, int target) {
int n = nums.size();
int low = 0, high = nums.size() - 1;
while (low <= high) {
int mid = (high + low) / 2;
if(nums[mid]==target) return true;
if (nums[low] == nums[mid] && nums[mid] ... | ALGO | 0.999981 | 6.165576 |
8591dbdc-0448-4bde-81a0-e97e6d701118 | cyberAlchem1st/Neps-Academy | EntranceExam.cpp | #include<iostream>
using namespace std;
int main() {
int N;
string A, B;
cin >> N >> A >> B;
int c = 0;
for(int i = 0; i<N; i++) {
if(A[i] == B[i]) c++;
}
cout << c;
return 0;
} | ALGO | 0.999872 | 3.8878 |
0b95e920-872e-4491-8cb9-b72dc832fb2d | lammps/lammps | src/ML-QUIP/pair_quip.cpp | /* ----------------------------------------------------------------------
Contributing authors: Albert Bartok (Cambridge University)
Aidan Thompson (Sandia, <EMAIL>)
------------------------------------------------------------------------- */
#include "pair_quip.h"
#include "atom.h"
#inclu... | ALGO | 0.992982 | 6.415535 |
93c58b3c-2f4a-4c2b-81b0-99dd81cccbb4 | MimkaKek/maiLabs | mai_oop/Lab04/Pentagon.cpp | #include "Pentagon.h"
#include <iostream>
#include <cmath>
const double pi = 3.141592;
const double k = 0.688191;
Pentagon::Pentagon() : Pentagon(0) {
}
Pentagon::Pentagon(int i) : side_a(i) {
std::cout << "Pentagon created: " << side_a << std::endl;
}
Pentagon::Pentagon(std::istream &is) {
do {
is ... | TOOL | 0.913339 | 4.363787 |
fd6f8184-fe60-43b9-854c-fc592f4b5a2c | stamp465/C_Programming | Camp2_60-61/Basic/Gardening.cpp | #include<bits/stdc++.h>
using namespace std;
int arr[100],sum=0,maxx[2]={0,0},minn[2]={10000,0};
int main()
{
int N,day;
cin >> N >> day;
for(int i=0;i<day;i++){
for(int j=0;j<N;j++){
int work;
cin >> work;
if(work>10) work=10;
sum += work*40;
//cout << "\nsum = " << sum << endl;
arr[j] += work*4... | ALGO | 0.998876 | 3.28145 |
48888e74-097e-47ef-a7e0-22a315caaa02 | yzzupgo/MFTCG | Data/abc123_b/Kenkenkaij/wa/7833129.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> S(5);
int num;
int num2 = 0;
for(int i = 0;i < 5;++i){
cin >> S[i];
}
num = S[0];
for(int i = 1;i < 5;++i){
if(num % 10 > 0){
num = min(S[i + 1] % 10,num % 10);
}
}
for(int i = 0;i < 5;++i){
if... | ALGO | 0.999348 | 3.809262 |
217cf382-3602-441a-b832-47b9a58a0739 | Djuffin/project-euler | LeetCode/232 Implement Queue using Stacks/djuffin.cpp | class Queue {
stack<int> incoming, outgoing;
void move() {
while (!incoming.empty()) {
outgoing.push(incoming.top());
incoming.pop();
}
}
public:
// Push element x to the back of queue.
void push(int x) {
incoming.push(x);
}
// Remov... | ALGO | 0.999246 | 5.615241 |
45969dc1-f46d-40a7-a110-249b49a30867 | jnegrite/Competitive-Programming | Chapter 2/2.3/uva/10909.cpp | #include <bits/stdc++.h>
using namespace std;
#include <bits/extc++.h> // pbds
#include<malloc.h>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, splay_tree_tag,
tree_order_statistics_node_update> ost;
int main() {
int n = 2000000;
ost tree;
for (int i = 1; i <= n; i+=2) // O(n lo... | ALGO | 0.999584 | 3.78223 |
e42a4767-0998-4c81-8444-f577cdaf8120 | AFpine/Problem-Solving | BOJ/1000-4999/1368.cpp | #pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define sz(a) (int)(a.size())
#define all(a) (a).begin(), (a).end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<long long, long long> pl... | ALGO | 0.999823 | 3.712917 |
5d6bf1d0-7a3d-40b7-873b-8d585c03a5af | ishandutta2007/codeforces | teja349/normal/742/C.cpp |
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
//setbase - cout << setbase (16); cout << 100 << endl; Prints... | ALGO | 0.999988 | 3.237982 |
d864bd7c-3997-4481-b020-36df8b1d38dd | ishandutta2007/codeforces | crh380bl-2339/normal/1572/B.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int a[200005],s[200005],stp,ans[1000002],n;
int chk(int x){
return a[x]^a[x+1]^a[x+2];
}
void opt(int x){
if(a[x]==a[x+1]&&a[x]==a[x+2])return;
ans[++stp]=x;
int t=a[x]^a[x+1]^a[x+2];
a[x]=a[x+1]=a[x+2]=t;
}
void go_left(int x){
int i;
for(i=x;i>=... | ALGO | 0.999995 | 3.57776 |
425cb6fa-bec2-4eaf-856f-4bfbf38831d4 | lt974982407/leetcode | 221/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int maximalSquare(vector<vector<char>>& matrix) {
vector<vector<int>> dp (matrix.size(),vector<int>(matrix[0].size(),0));
int res = 0;
for(int i = 0; i < matrix.size(); i++){
for(int j = 0; j < matrix[0].size();j++){
if(matrix[... | ALGO | 0.998375 | 5.243463 |
b0b6c46f-784c-4115-b067-22235f96b7f2 | PlayingPeano/algorithms | bfs.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int main()
{
int n, v;
cin >> n >> v;
vector <vector <int>> g(n);
v--;
g[v].push_back(v + 1);
for (auto i = 0; i < n - 2; i++)
{
int start, finish;
cin >> start >> finish;
--start; --finish;
g[start].push_b... | ALGO | 0.999948 | 4.360634 |
fc667f03-b599-452a-9976-701307a22efd | dman96/CodingPuzzles | 812C.cpp | #include <iostream>
#include <stack>
#include <string>
/*
This file contains the solution to problem 821C from CodeForces (https://codeforces.com/problemset/problem/821/C).
The algorithm uses a stack that holds box numbers. Whenever a box is commanded to be added, the box is pushed to the top of the stack. If a box i... | ALGO | 0.998956 | 5.400259 |
7e20e9f6-20a2-4ac9-a081-dd30789870bd | gopoma/competitive-programming | tasks/2060E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = long double; // or double if tight TL
using str = string;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
#define mp make_pair
#define f first
#define s second
#define tcT template<class T
tcT> using V = vect... | ALGO | 0.999757 | 4.616157 |
682c9630-71c5-4f7b-8516-a061174d6e54 | kayarre/reconbench | pbrt/src/renderers/samplerrenderer.cpp | // renderers/samplerrenderer.cpp*
#include "stdafx.h"
#include "renderers/samplerrenderer.h"
#include "scene.h"
#include "film.h"
#include "volume.h"
#include "sampler.h"
#include "integrator.h"
#include "progressreporter.h"
#include "camera.h"
#include "intersection.h"
static uint32_t hash(char *key, uint32_t len)
{
... | ALGO | 0.969039 | 4.956045 |
ed91d67e-a979-4184-972e-f3042cf38911 | drkiettran/Multicore_and_GPU_2e_code | Chapter_08_OpenMP/mergesort_omp_bottomup.cpp | #include <stdlib.h>
#include <string.h>
#include <iostream>
#include <memory>
#include <omp.h>
using namespace std;
#define MAXVALUE 10000
#define min(A,B) ((A<B) ? A : B)
#define max(A,B) ((A>B) ? A : B)
//------------------------------------
void numberGen (int N, int max, int *store)
{
int i;
srand (time (0));
... | ALGO | 0.999497 | 4.78533 |
51922495-7f3d-4bb5-96e5-cca3f89239e9 | ripalnakiya/Cpp-Programmes | Recursion/02_TailRecursion.cpp | #include <iostream>
using namespace std;
void tailRecursion(int num)
{
if (num != 0)
{
tailRecursion(num-1);
}
cout << num << " ";
}
int main()
{
tailRecursion(5);
return 0;
} | ALGO | 0.999643 | 5.200326 |
078bd270-6cd4-4ff6-9d5b-889665599906 | yinzixuan126/my_udacity | src/CarND-MPC-Quizzes/mpc_to_line/src/Eigen-3.3/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A;
A << 1, 2, 2, 3;
cout << "Here is the matrix A:\n" << A << endl;
SelfAdjointEigenSolver<Matrix2f> eigensolver(A);
if (eigensolver.info() != Success) abort();
cout << "The eigenvalues of A ... | ALGO | 0.999123 | 3.846247 |
f8c0de27-f8bc-4a04-8242-021da5f03e0f | xpertsea/tensorflow | third_party/mlir/lib/Transforms/Utils/RegionUtils.cpp | #include "mlir/Transforms/RegionUtils.h"
#include "mlir/IR/Block.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/Value.h"
#include "llvm/ADT/SmallSet.h"
using namespace mlir;
void mlir::replaceAllUsesInRegionWith(Value *orig, Value *replacement,
Region ®ion) {
for (IROp... | TOOL | 0.919479 | 7.925445 |
385839cc-e9fc-4b08-8caa-fe31f29a9090 | IngwarSV/Test_Cocos | Test_Cocos/cocos2d/tools/simulator/libsimulator/lib/platform/win32/PlayerFileDialogServiceWin.cpp | #include <string.h>
#include "stdafx.h"
#include <Windowsx.h>
#include <Shlobj.h>
#include <Commdlg.h>
#include "cocos2d.h"
#include "PlayerUtils.h"
#include "PlayerFileDialogServiceWin.h"
PLAYER_NS_BEGIN
PlayerFileDialogServiceWin::PlayerFileDialogServiceWin(HWND hwnd)
: _hwnd(hwnd)
{
}
std::string PlayerFileDial... | TOOL | 0.88372 | 5.747205 |
8764fa8c-d635-436d-9187-9cc329953087 | BEknUur/ADS-2024 | 1Lab/royalflush.cpp | //Bismillah
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
while(n!=0){
int a;
cin>>a;
n--;
deque<int>sandar;
for(int i=a;i>=1;i--){
sandar.push_front(i);
for(int j=0;j<i;j++){
int number=sandar.back();
sandar.pop_back();
sanda... | ALGO | 0.999981 | 4.29863 |
2db88827-6c5c-4f6e-8c1a-ffe1e40d5723 | vineethkvd/flutter_freezed_ammotation | 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 |
1f8dbcd4-6cf7-43af-a36f-6ab357e2965d | sebwdz/skynet | srcs/Neuronal/Neuron/SelfOrganizingMapNeuron.cpp | //
// Created by sebastien on 10/2/16.
//
#include <cmath>
#include <iostream>
#include "Neuronal/Neuron/SelfOrganizingMapNeuron.hpp"
namespace Skynet {
namespace Neuronal {
void SelfOrganizingMapNeuron::setPos(std::pair<double, double> const &pos) {
... | TOOL | 0.869868 | 4.252154 |
41b8bffb-5eef-4606-9dff-8ce2d4de00bf | Shaad2004/Classroom-Assignment | Strings 2/Length of Last Word.cpp | class Solution {
public:
int lengthOfLastWord(string s) {
int l=0;
int n=s.length();
int i=n-1;
while (i>=0 && s[i]==' '){
i--;
}
while (i>=0 && s[i]!=' '){
l++;
i--;
}
return l;
}
};
| ALGO | 0.998149 | 5.402341 |
5dc951b0-61a2-49c1-a11c-ac708eb64613 | Akshatyadav0001/Sudoku-solver | perlinNoise.cpp | #define OLC_PGE_APPLICATION
#include "olcPixelGameEngine.h"
#include <vector>
#include <cstdlib>
#include <iostream>
#define WIDTH 200
#define HEIGHT 200
#define PIXEL_SIZE 2
#define WRAP_SIZE 256
using namespace std;
struct Vec2
{
float x, y;
};
float DotProduct(const Vec2 &v1, const Vec2 &v2)
{
return v1.... | TOOL | 0.855613 | 5.876237 |
bc5cba4f-b536-4a24-8fa4-bf2c7e418a98 | CGCL-codes/LoomIO | src/boost/libs/hana/benchmark/fold_left/execute.std.array.erb.cpp | #include "measure.hpp"
#include <array>
#include <cstdlib>
#include <numeric>
int main () {
boost::hana::benchmark::measure([] {
long long result = 0;
for (int iteration = 0; iteration < 1 << 10; ++iteration) {
std::array<int, <%= input_size %>> values = {{
<%= input_siz... | TEST | 0.867116 | 3.801625 |
624928dd-9ab1-4fe6-a6d6-593634ca5a6f | bitsta/IncogCoin | src/key.cpp | #include <map>
#include <openssl/ecdsa.h>
#include <openssl/obj_mac.h>
#include "key.h"
// Generate a private key from just the secret parameter
int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key)
{
int ok = 0;
BN_CTX *ctx = NULL;
EC_POINT *pub_key = NULL;
if (!eckey) return 0;
const EC_... | TOOL | 0.955043 | 7.293437 |
c8cc2e7d-1700-49f6-83e6-42811d80264d | shivamm-jha/leet-code | 438-find-all-anagrams-in-a-string/438-find-all-anagrams-in-a-string.cpp | class Solution {
public:
vector<int> findAnagrams(string s, string p) {
int n = s.size();
int m= p.size();
vector<int> ans;
if(m>n) return ans;
vector<int> hash1(26,0);
vector<int> hash2(26,0);
for(int i=0;i<m;i++){
hash2[p[i]-'a']++;
... | ALGO | 0.999938 | 6.092372 |
a0da5637-1c67-4f88-9fa3-1519fd97237c | coopjz/Fall2022-COMP2012 | class/Program/Template/template/template-problem-extra.cpp | #include <iostream> /* File: template-problem.cpp */
using namespace std;
template <typename T>
const T &
larger(const T &a, const T &b) { return (a < b) ? b : a; }
char *const &larger(char *const &a, char *const &b)
{
return (a < b) ? b : a;
}
int main()
{
const char *m = "microsoft";
const char *a = "app... | ALGO | 0.99472 | 3.705955 |
a29938f5-8464-4c41-ad77-31cddfc86eda | balabit-deps/balabit-os-8-opencv | samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp | /**
* @file introduction_to_pca.cpp
* @brief This program demonstrates how to use OpenCV PCA to extract the orientation of an object
* @author OpenCV team
*/
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace std;
using namespace cv;
// F... | ALGO | 0.999011 | 7.384108 |
4b16aa20-097f-42e9-8bb6-de2bd379a912 | moroccan-competitive-programmers/codeit-v4 | J/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
{
long long n;
cin >> n;
cout << n << endl;
}
return 0;
}
| ALGO | 0.99943 | 3.740221 |
c83b0273-0793-4391-9111-6fb7c51b7888 | berkaymuratt/sep_app_web | 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.998762 | 6.786404 |
90c3ae38-db02-40b5-aed6-08b6d7c9264b | oji53/algo-training | aoj/ITP1/8/8_B.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string a;
int res;
int digit;
while(true){
cin >> a;
digit = a.size();
if(a[0] == '0' && digit == 1) break;
res = 0;
for (int i=0; i<digit; ++i) {
res += (int)a[i]-'0';
}
cout << res << endl;
}
}
| ALGO | 0.999742 | 4.421673 |
c97bf5b1-d1d1-44d9-a05e-3300c30c9256 | munjungmin/Algorithm | baekjoon/6198.cpp | #include <iostream>
#include <stack>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(NULL);
stack<int> st;
int n;
long long ans = 0;
cin >> n;
int h;
for (int i = 0; i < n; i++) {
cin >> h;
if (st.empty()){
st.push(h);
... | ALGO | 0.999927 | 4.62359 |
ed8e5f14-2726-4649-946c-5fb1c851b401 | boomzero/XMOJ | 1000-1999/1590.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 105;
struct NODE
{
char str[N];
int count;
};
int LengthB = 0;
struct NODE b[60000];
void check(char temp[])
{
int i;
if (LengthB == 0)
{
strcpy(b[0].str, temp);
b[0].count = 1;
LengthB++;
... | ALGO | 0.999929 | 3.673938 |
89021846-fa02-440f-a3df-a05dcf3c0f0a | ReML-AI/UCCIX | eval/scripts/clean_training_data/janitor_util.cpp | #include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <queue>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
bool is_whitespace(char ch) noexcept {
// " \t\n\r\x0b\x0c" (python string.whitespace)
return ch == 32 or (9 <= ch and ch <= 13);
// return ch <= 32; // arguably to... | TOOL | 0.971127 | 7.597184 |
e00a9a26-8029-426c-8b3d-e141b99d26c5 | Nitin013/leetcode_prob | delete_node_in_a_linklist.cpp | // time complexity O(1)
#include<iostream>
#include<vector>
#include<string>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
void deleteNode(ListNode* node) {
node -> val = node -> next -> v... | ALGO | 0.999775 | 4.488766 |
8f48366b-d598-4d35-a250-15308483bf19 | eren-mikasa/Leetcode-Parctice | DSA Crack Sheet/solutions/Longest consecutive subsequence.cpp | /*
Longest consecutive subsequence
===============================
Given an array of positive integers. Find the length of the longest sub-sequence such that elements in the subsequence are consecutive integers, the consecutive numbers can be in any order.
Example 1:
Input:
N = 7
a[] = {2,6,1,9,4,5,3}
Output:
6
Expla... | ALGO | 0.99993 | 5.549651 |
3d61d233-7d25-4886-8a57-7a9013c19ccd | ishandutta2007/codeforces | riverhamster/normal/1100/E.cpp | #include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
const int N = 100005;
int hd[N], nt[N], to[N], w[N], deg[N], tot = 0, n, m, id[N];
int ansv[N];
template<typename T> inline void in(T &x){ //Read Positive Integer.
register char ch; x... | ALGO | 0.999992 | 3.55546 |
26be28d2-caed-45db-8420-5045717956c7 | mkaguilera/yesquel | src/loadstats.cpp | //
// loadstats.cpp
//
// Keeps statistics about access to coid's and cells within coids.
// We keep track of all read accesses within the last StatIntervalMs ms.
// Then, once this interval is past, we look at the statistics to find
// coids with a large number of accesses. For those coids, we look at
// the cell acce... | ALGO | 0.918597 | 5.30295 |
93b5a7c2-71d0-41a0-b5e9-41d327f6954a | amslabtech/chibi24_a | local_path_planner_a/src/local_path_planner_a.cpp | /*
DWA: Dynamic Window Approach
速度について以下のようにする
velocity(vel) : 並進速度
yawrate : 旋回速度
speed : 速度の総称(vel, yawrate)
*/
#include "local_path_planner_a/local_path_planner_a.hpp"
using namespace std::chrono_literals;
// コンストラクタ
DWAPlanner::DWAPlanner() : Node("local_path_planner_a"), clock_(RCL_ROS_TIME)
{
... | ALGO | 0.994089 | 4.4591 |
00d95a05-b301-44c9-a42d-48ad3e51c3c2 | Project-Astera/frameworks_av | media/codecs/m4v_h263/enc/src/datapart_encode.cpp | #ifndef H263_ONLY
#include "mp4def.h"
#include "mp4lib_int.h"
#include "bitstream_io.h"
#include "mp4enc_lib.h"
#include "m4venc_oscl.h"
/* ======================================================================== */
/* Function : EncodeFrameDataPartMode() */
/* Date : 09/6/200... | TOOL | 0.888493 | 5.804534 |
091ddcce-a413-4255-86f9-1248020d8bec | MdRifathSharker/Competitive-programming | OOPlab62.cpp | #include<bits/stdc++.h>
using namespace std;
class binary{
int x;
public:
void get_data(){
int d;
cin>>d;
x=d;
}
friend binary operator+(binary q,binary s){
binary rr;
rr.x=s.x+q.x;
return rr;
}
void put_data(){
cout<<x<<endl;
}
};
... | ALGO | 0.996575 | 3.324402 |
982efb12-5762-4000-a063-5d03182e5814 | ishaanjav/USACO-Solutions | Gold 2018 Dec/teamwork.cpp | /*
* Created by ishaanjav
* github.com/ishaanjav
* USACO Solutions: https://github.com/ishaanjav/USACO-Solutions
*/
#include <fstream>
#include <iostream>
using namespace std;
#define max_self(a, b) a = max(a, b);
int n, k;
bool done[10001];
int ar[10001], dp[10001];
int recurse(int p = 0) {
if (done[p]) retu... | ALGO | 0.999876 | 3.618475 |
b470eae0-23db-435d-9dc7-1fb14ebcef1b | yzzupgo/MFTCG | Data/abc136_b/tarutallone/wa/9290918.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int ans=0;
for (int i=1;i<=n;i++){
if ((n/10)%2==0){
ans++;
}
}
cout << ans << endl;
}
| ALGO | 0.998969 | 4.13528 |
33b3dc51-8179-4ba8-a1bf-3676f53b5683 | erciktiburak/neetcode | DataStructure/DesignDynamicArray.cpp | #include <iostream>
#include <vector>
class DynamicArray {
public:
DynamicArray(int capacity) {
this->capacity = std::max(1, capacity); // Ensure capacity is at least 1
this->size = 0;
this->array.resize(this->capacity, 0);
}
int get(int i) {
return this->array[i];
}
... | TOOL | 0.866312 | 6.64529 |
fcea72f2-6aed-4138-94c7-265a2fdbec20 | LMFRomero/SRS_Cards | boost/libs/icl/example/partys_tallest_guests_/partys_tallest_guests.cpp | /** Example partys_tallest_guests.cpp \file partys_tallest_guests.cpp
\brief Using <i>aggregate on overlap</i> the heights of the party's tallest
guests are computed.
In partys_tallest_guests.cpp we use a different instantiation of
interval map templates to compute maxima of guest heights.
... | ALGO | 0.997145 | 6.08484 |
ff301254-3fe9-438e-b93c-b914babf8ce3 | Hasnain1408/Cpp | dot.cpp | #include<iostream>
using namespace std;
int perimeter(int* sides)
{
int perimeter=0;
for(int i=0; i<4; ++i)
{
perimeter+=sides[i];
}
cout<<"Perimeter : "<<perimeter<<endl;
return 0;
}
int main()
{
int polygon[] = {2,3,4,5};
perimeter(polygon);
return 0;
}
| ALGO | 0.997691 | 3.490824 |
2d9a027b-e815-4e08-a8cd-848a55a0fd79 | meilleur777/Competitive_Programming | BOJ/cpp/2420.cpp | #include <iostream>
using namespace std;
int main() {
long long N, M; cin >> N >> M;
cout << abs(N - M) << '\n';
}
| ALGO | 0.999918 | 3.637608 |
b9a16a75-4e1c-400c-aa97-682bfb8c9308 | Akshat-07-ux/GfG-Questions | Difficulty: Basic/Binary Array Sorting/binary-array-sorting.cpp | //{ Driver Code Starts
// A Sample C++ program for beginners with Competitive Programming
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// A[]: input array
// N: size of the input array
// Function to sort the binary array.
void binSort(int A[], int... | ALGO | 0.999912 | 5.703139 |
b0de1344-8024-42f0-a344-6c092b494104 | akcodes17/Data-Structures | Class 11 - Stacks/balanceExpression.cpp | #include<iostream>
#include<stack>
using namespace std;
/*
template<typename T>
struct stack{
private:
//vector<int>v;
vector<T>v;
public:
int size(){
return v.size();
}
bool isEmpty(){
if(v.size()==0){
return true;
}
return false;
//return v.e... | ALGO | 0.999609 | 4.414956 |
3446a25d-cbe3-424d-ad65-4bf2fd0e2f88 | wdeyes/Note_c_jiajia | NetEase/job.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
using namespace std;
/*
int main(){
int job_num, per_num;
cin >> job_num >> per_num;
map<long,long> job;
for(int i=0;i<job_num;++i){
long dif_temp, pi_temp;
cin >> dif_temp >> pi_temp;
job[pi... | ALGO | 0.999992 | 4.003265 |
797cfc43-0509-4db9-bdbb-db793c6a75c7 | Sumanth-NR/CompetitiveProgramming | Platforms/CodeForces/Rounds_0951-1000/CFR_0965_Div2/E_1_Subtangle_Game_Easy_Version.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
int l, n, m;
cin >> l >> n >> m;
vector<int> a(l);
for (auto &x: a) {
cin >> x;
}
vector<vector<int>> b(n, vector<int>(m));
for (auto &x: b) {
for (auto &y: x) {
cin >> y;
... | ALGO | 0.999074 | 3.931092 |
d109e579-73f8-421b-8cb0-db4711b82763 | DevikaBoddu13/cpp | multithreading/taskScheduler.cpp | #include <iostream>
#include <queue>
#include <thread>
#include <functional>
#include <vector>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <future>
using namespace std;
// Task class that holds the priority and the function to execute.
class Task {
public:
int priority;
functio... | ALGO | 0.999172 | 6.72475 |
e5edb586-d678-4ee1-9425-a85c0b361247 | Charbel-11/Competitive-Programming | Contests/Codeforces/Educational 103/D.cpp | #include <iostream>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int t; cin >> t;
while (t--) {
int n; cin >> n;
string s; cin >> s;
reverse(s.... | ALGO | 0.999981 | 4.247994 |
5556b697-1434-46ef-bce1-8ab6fa0ec455 | Fireworker20th/SPORTS | SPORTS/VO/VO_Module/thirdparty/eigen/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.98386 | 4.145121 |
01560b48-3384-4653-a93b-6d74d043d0a6 | aharbii/Learn-Cpp | Section20/Challenge_1/main.cpp | // Section 20
// Challenge 1
// Identifying palindrome strings using a deque
#include <cctype>
#include <deque>
#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
bool is_palindrome(const std::string& s)
{
// You must implement this function.
// Since we are learning the STL - use a deq... | ALGO | 0.996482 | 6.736416 |
e986a590-c5ac-4212-9009-276294335d6b | SinghRajan41/code | MY_CPP/CF/Normal/158A.cpp | #include<iostream>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
int arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
int count = 0;
int mark = arr[k-1];
for(int i=0;i<n;i++)
{
if(arr[i]>=mark && arr[i]!=0)
{
count++;
}
}
c... | ALGO | 0.999983 | 3.320095 |
cab5dde7-594f-475a-81a3-6f1b8420fabe | TomaSajt/prog-solutions | CSES/2195 - Convex Hull.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct point {
ll x, y;
};
inline ll turn(point& a, point& b, point& c) {
return (b.y - a.y) * (c.x - a.x) - (c.y - a.y) * (b.x - a.x);
}
inline ll md(const point& a, const point& b) {
return abs(a.x - b.x) + abs(a.y - b.y);
}
int main() {
... | ALGO | 0.999997 | 4.732606 |
256b5f44-abbc-4862-ae5b-e87b16cde987 | jvergara2506/ICPC_problems | Escape.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int R, C;
cin>>R>>C;
vector<vector<char>> room(R+2, vector<char>(C+2));
vector<vector<int>> etiqueta(R+2, vector<int>(C+2, -1));
int e=0;
vector<pair<int, int>> index(R*C);
for(int i=1;i<=R; i++) for(int j=1; j<=C; j++) {
eti... | ALGO | 0.999979 | 3.984523 |
bcedcd43-415e-43ce-b2d4-77c004f7273b | calgagi/leetcode | 1394/answer.cpp | class Solution {
public:
int findLucky(vector<int>& arr) {
map<int,int> s;
for (auto& i : arr) {
s[i]++;
}
int res = -1;
for (auto& p : s) {
if (p.first == p.second) {
res = max(p.first, res);
}
}
return res;... | ALGO | 0.999823 | 5.475815 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.