uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
98632e80-382c-4800-9b6a-f86846ee93f7 | smartzcy/My_vscode | C_learn/2023_7/2023_7_17/P3.cpp | #include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
const int mod = 998244353;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e5 + 5;
const int maxm = 2e5 + 5;
typedef long long ll;
int n, m;
int etot = 1;
struct edge {
int y, nxt, id;
} g[maxm * 2];
int h... | ALGO | 0.999831 | 4.890656 |
98856807-4566-4714-b16c-c564fdd095a8 | 406345/leetcode | 735_asteroidCollision/main.cpp | #include "stdio.h"
#include "vector"
using namespace std;
class Solution
{
private:
inline bool isSameDirect(int a, int b)
{
return (a >> 31) == (b >> 31);
}
public:
vector<int> asteroidCollision(vector<int> &ast)
{
int size = ast.size();
for (int i = 0; i < (size - 1);)
... | ALGO | 0.999837 | 4.920988 |
2bb8ccbd-ce41-4399-9165-7d98194b2364 | HHS-Proclub/hhs-pro-club-website | solutions2020/PRA9/kevinwang0324@gmail.com.cpp | #include <iostream>
#include <cmath>
using namespace std;
#define INF 1000000000
int a, n, b;
int h[25];
int sum, best = INF;
int main () {
cin >> a;
for (int y = 0; y < a; y++) {
cin >> n >> b;
for (int i = 0; i < n; i++)
cin >> h[i];
for (int i = 0; i < (1 << n); i++) ... | ALGO | 0.999508 | 3.076216 |
e0a4c93f-46b4-4ab9-aec3-9ea50c3abe58 | deepikapathak25/Leetcode-Practice | Arrays/Day 15/FindTheDuplicateNumber.cpp | /*
🚀 Problem: Find the Duplicate Number
------------------------------------
Given an array `nums` containing `n + 1` integers where each integer is in the range [1, n] inclusive,
return the duplicate number.
The array contains only one duplicate number, but it could be repeated more than once.
... | ALGO | 0.999891 | 7.642583 |
27c14b2e-5ed9-4f2d-9823-0a99012da804 | rahulsenna/LeetCode | codeforces_solved/D_X_Sum.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define PI 3.141592653589793238462
#define set_bits __builtin_popcountll
typedef int64_t s64;
typedef uint64_t u64;
typedef long do... | ALGO | 0.999945 | 5.860829 |
ef552fd8-eb74-49fd-aded-dbbb30942a79 | The-atama/Library | DataStructure/RBST.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | ALGO | 0.999964 | 4.141908 |
b67f8e91-deac-492f-b750-ba46a2a86ef7 | marvenlee2486/CP-teaching | Chapter_2/4_Stack/valid_stack_sequences.cpp | class Solution {
public:
bool validateStackSequences(vector<int>& pushed, vector<int>& popped) {
vector<int> st;
int ptr = 0;
for(int v: pushed){
while(st.size() != 0 && popped[ptr] == st.back()) {
st.pop_back();
ptr++;
}
st... | ALGO | 0.999799 | 6.259609 |
6d637faa-d2d3-4de4-9465-ff41632cc6c8 | gabkidner/CS_2420Programs | 7.4_Gumball_Guess/CandyGuessTester.cpp | #include <iostream>
#include <cmath>
#include <sstream>
#include <memory>
#include "Queue.h"
#include "Person.h"
using namespace std;
Queue<Person>findWinners(int numberOfCandies, Queue<Person>guessList);
void testQueue();
void testConstructors();
void testCandyGuessMethod1();
void testCandyGuessMethod2();
template<c... | TEST | 0.854206 | 5.103938 |
a0ec6ba8-1bd3-4cd3-a3b7-7ed8f425ce8f | r-forge/flr | experimental/FLcpp/inst/etc/cpp/FLAdvice/src/FLBRP.cpp | double t1,t2;
/*
* FLBRP.cpp =
*
* Author : Laurie Kell <<EMAIL>> Cefas, UK
* Last Change: 06 Mar 2009 16:01
* $Id: FLBRP.cpp 994 2011-06-03 14:30:21Z lauriekell $
*
*/
#define ADOLC_TAPELESS
#include <adouble.h>
typedef adtl::adouble adouble;
#include "FLBRP.hpp"
int RP_harvest=0,
RP_yie... | ALGO | 0.998951 | 5.721809 |
1a60a84f-468e-4dba-a7af-e3e133d69d61 | proRamLOGO/Competitive_Programming | Algorithms/BigNumber.cpp | #include <iostream>
using namespace std ;
class pnumber {
public:
short int *arr;
pnumber( string num ) {
arr = new short int[10000000] ;
for ( auto i = 0 ; i < num.size() ; ++i )
arr[i] = (int)(num[num.size()-1-i]) - '0' ;
}
bool add( pnumber num ) {
short int... | ALGO | 0.992061 | 3.701691 |
53644792-9708-4623-bf4d-084a81bbd437 | yashsharm884/C-Placement-Oriented-Work | Hexadecimal_to_Decimal.cpp | #include<bits/stdc++.h>
using namespace std;
int HexadecimalToDecimal(string n)
{
int ans = 0;
int x = 1;
int s = n.size(); // size of string............. .size() is only for string.
for(int i = s - 1; i >= 0; i--)
{
if( n[i] >= '0' && n[i] <= '9')
{
ans +... | ALGO | 0.999392 | 5.432878 |
6c5f70f9-a294-49bd-b474-aebffa8cb95d | objectbox/objectbox-dart | objectbox/example/flutter/objectbox_demo/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.997945 | 6.76073 |
e094cfc7-ab4d-48e7-bf41-74ec67f73e29 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_11714_10.cpp | #include <bits/stdc++.h>
int main() {
int d, L, v1, v2;
scanf("%d %d %d %d", &d, &L, &v1, &v2);
printf("%.20lf", (double)(L - d) / (v1 + v2));
return 0;
}
| ALGO | 0.995941 | 3.54941 |
6772741d-b56c-4cf7-829e-fa1f11d954dd | rkb3004/cpp-programs | sorting/merge.cpp | #include <bits/stdc++.h>
using namespace std;
int low,high;
void merge(int arr[], int low, int mid, int high);
void mergeSort(int arr[] , int low,int high){
if(low<high){
int mid=(low+high)/2;
mergeSort(arr,low,mid);
mergeSort(arr,mid+1,high);
merge(arr,low,mid,high);
}
}
void m... | ALGO | 0.999993 | 5.674818 |
cedfb5d2-0e9e-4e7f-8586-c2b223f8430d | ladeng07/libcxx-scripts | libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp | // UNSUPPORTED: c++98, c++03
// <queue>
// priority_queue();
// template <class... Args> void emplace(Args&&... args);
#include <queue>
#include <cassert>
#include "../../../Emplaceable.h"
int main()
{
std::priority_queue<Emplaceable> q;
q.emplace(1, 2.5);
assert(q.top() == Emplaceable(1, 2.5));
q... | TEST | 0.914347 | 5.559402 |
ea01699d-cec0-4281-a7ad-167abd089873 | TeamCarbonXtremeARMv6/frameworks_av | media/libstagefright/codecs/m4v_h263/dec/src/post_proc_semaphore.cpp | /*
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Inputs:
q_block = pointer to buffer of inverse quantized DCT coefficients of type
int for intra-VOP mode or buffer of residual data of type int
for inter-VOP mode
Local Sto... | ALGO | 0.993392 | 7.19238 |
cff9f775-849e-48c4-b9af-3e4ce9475186 | EpsilonsQc/Programming-projects | Programmation-I/Project 022 (Perform the appropriate calculation to get the values).cpp | // Perform the appropriate calculation to get the values
#include <iostream>
using namespace std;
int main()
{
for (unsigned int y = 1; y != 10; ++y)
{
cout << (static_cast<double> (y) / 10) << endl;
}
cout << endl;
system("pause");
return 0;
} | ALGO | 0.995353 | 3.441031 |
4ec6cc1c-6eec-4f26-b4f6-76cbb6b91f09 | ylug/RBPO_laba2 | student_1bib20095.Lab2.Variant21.Task2.cpp | #include <cmath>
#include <iostream>
module student_1bib20095.Lab2.Variant21.Task2;
void RBPO::Lab2::Variant21::Task2::Function1() {
double x, y;
std::cout << "Enter x >> ";
std::cin >> x;
std::cout << "Enter y >> ";
std::cin >> y;
double result = (sqrt(x) - sqrt(y)) / x;
std::cout << "Resul... | ALGO | 0.999562 | 3.992375 |
dc1df0b1-c80a-4c7b-a90e-7f86c84d3b7a | kharish1995/Robotics_Algos | src/ARA*/arastar_test.cpp | #include <iostream>
#include "ARA*/arastar.h"
int main()
{
std::vector<std::vector<int> > world_state = {{0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0},
... | ALGO | 0.999824 | 4.34561 |
d9abb8b5-effa-46b4-885d-a926d381530d | karimali03/Competitive-programming | solutions/archive/solve/14_2025-07-14/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define ln "\n"
#define ll long long
#define ld long double
#define ull unsigned long long
#define vec vector
#define vi vector<int>
#define vii vector<vector<int>>
#define viii vector<vector<vector<int>>>
#define f(i, a, b) for(int i = a; i < b; i++)
#define all(x) (x).be... | ALGO | 0.999806 | 4.454948 |
43cc9839-a311-40ef-9d3c-7667441f6bd8 | Mahmoudabdellatif/assembler | Pass1/Pass1/src/Parser.cpp | /*
* Parser.cpp
*
* Created on: Apr 24, 2016
* Author: dod
*/
#include "Parser.h"
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <regex>
#include<string.h>
#include<ByteTable.h>
#include <LiteralTable.h>
#include <map>
#include <utility>
using namespace std;
string src... | TOOL | 0.932641 | 3.727093 |
151c9177-494b-4a24-9aef-92ce906821c3 | VietTho1989/TurnBasedGame | Android/UnityNativePlugin/app/src/main/cpp/Seirawan/seirawan_uci.cpp | #include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include "seirawan_evaluate.hpp"
#include "seirawan_movegen.hpp"
#include "seirawan_position.hpp"
#include "seirawan_search.hpp"
#include "seirawan_thread.hpp"
#include "seirawan_tt.hpp"
#include "seirawan_timeman.hpp"
#include "seirawan_uci.h... | ALGO | 0.997523 | 6.38364 |
0274ba2f-8722-4dff-bd80-11a6b8c5779d | kargneq/CSES-INTRODUCTORY | 1083.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
scanf("%d", &a);
vector<bool> numbers(a, false);
for (int i = 0; i < a; i++) {
int b;
scanf("%d", &b);
numbers[b - 1] = true;
}
for (int i = 0; i < a; i++) {
bool x = numbers[i];
if (!x) {
printf("%d", i + 1);
break;
}
}
} | ALGO | 0.99964 | 3.364422 |
9d2eeb60-bc6c-4fe0-a14a-475b545949b9 | kunnaal11/leetcode_problems | 2144-maximum-difference-between-increasing-elements/2144-maximum-difference-between-increasing-elements.cpp | class Solution {
public:
int maximumDifference(vector<int>& nums) {
//vector<int> diff;
int n=nums.size();
int maxi=-1;
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(nums[i]<nums[j]){
int diff=nums[j]-nums[i];
max... | ALGO | 0.999988 | 5.369018 |
cea1a41b-f754-43fb-96c2-ef4814b5ea33 | cssahil98/CPP | Student-Details/student.cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debu... | TOOL | 0.989056 | 3.359763 |
8cdd3441-ccee-4039-9b91-fc47914cd99b | BaiLibl/my-leetcode | DP/medium/392.cpp | #include<iostream>
#include<string>
using namespace std;
bool isSubsequence2(string s, string t) {
int idx = 0;
int cur = -1;
for (auto & c : s) {
if ((cur = t.find(c, idx)) < idx)//
return false;
else
idx = cur + 1;
}
r... | ALGO | 0.999887 | 3.733903 |
86f5a5c0-ebb5-4bff-a15b-00b7c1b8de7e | W-void/Just-No-Name | Advancing C/PAT_Advanced/1102 Invert a Binary Tree.cpp | //
/*
1102 Invert a Binary Tree(25 分)
The following is from Max Howell @twitter:
Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboard so fuck off.
Now it's your turn to prove that YOU CAN invert a binary tree!
Input Specification:
Each input file conta... | ALGO | 0.999974 | 4.271693 |
ba461ff1-982f-429f-9834-48c8d8f25019 | rettihovka/prd | src/rpc/mnemonic.cpp | #include "rpc/server.h"
#include "util.h"
#include "utilstrencodings.h"
#include "key.h"
#include "key/extkey.h"
#include "base58.h"
#include "random.h"
#include "chainparams.h"
#include "support/cleanse.h"
#include "key/mnemonic.h"
#include <string>
#include <univalue.h>
//typedef std::basic_string<char, std::char_... | WEB | 0.853219 | 6.920581 |
9d2bb7bc-8d05-4a59-9aec-b9fa761c5bb1 | my0614/c-cpp | vector.cpp | //
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std; //c++ 사용할때 기본적으로 쓰는 namespace
int main()
{
vector<int> vec;
vec.push_back(1);
vec.push_back(2);
vec.push_back(3);
//vec.erase(++vec.begin());
// vec.begin()과 end()사용해보기
auto i = vec.begin();
i.operator++();
vec.erase(i);
... | ALGO | 0.952566 | 3.585583 |
4f0a05b3-09b0-4063-bab6-6481b284ef0b | jnegrite/Competitive-Programming | Chapter 4/4.4/uva/11280.cpp | #include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;
#define INF (~(1<<31))
vector<string> cities {};
unordered_map<string,int> mapCities {};
vector<vector<pair<int,int>>> paths {};
unordered_map<int,int> ans {};
vector<int> dist {};
int nCities;
int getId(string s){
auto it {mapCities... | ALGO | 0.998729 | 4.541184 |
e2ca8684-bf15-4020-8ac3-b849a60921b3 | Agniva-c11/DSA | HashedIn/stock_buy_sell.cpp | #include<iostream>
#include<vector>
using namespace std;
int maxProfitRec(vector<int> &prices, int start, int end)
{
int res = 0;
for(int i = start;i<end;i++)
{
for(int j = i+1;j<=end;j++)
{
if(prices[j]>prices[i])
{
int curr = (prices[j]-prices[i]) +
... | ALGO | 0.999671 | 5.639004 |
47c09447-49f9-4dd3-abaf-a301d2e87d2e | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6999_6.cpp | #include <bits/stdc++.h>
using namespace std;
inline long long read() {
char ch = getchar();
long long nega = 1;
while (!isdigit(ch)) {
if (ch == '-') nega = -1;
ch = getchar();
}
long long ans = 0;
while (isdigit(ch)) {
ans = ans * 10 + ch - 48;
ch = getchar();
}
if (nega == -1) return ... | ALGO | 0.999967 | 5.032508 |
4fb1deaa-4149-420b-b146-3b493c1cb1cf | BastiBernal/Programacion_Competitiva_I | 04E-Crypt Kicker.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <string>
#include <sstream>
using namespace std;
vector<string> dictionary; // Lista de palabras del diccionario
// Función que intenta descifrar la línea cifrada usando backtracking
bool decrypt_line(const vector<string>& encrypted_words, unor... | ALGO | 0.999617 | 6.205373 |
e1aa634d-78ef-46a7-9d03-ebf9a4528eba | PetterS/curve_extraction | thirdparty/Eigen/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp | MatrixXd X = MatrixXd::Random(5,5);
MatrixXd A = X + X.transpose();
cout << "Here is a random symmetric 5x5 matrix, A:" << endl << A << endl << endl;
SelfAdjointEigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << ... | ALGO | 0.999753 | 3.056724 |
3be09cb4-38cb-441d-8b9b-f5204425288b | WWaynee/LeetcodeClassificationsAndSolutions | Dynamic Programming/DP on Complete Knapsack/medium/322. Coin Change.cpp | class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
if(amount==0) return 0;
int n = coins.size();
vector<int> dp(amount+1,99999);//dp[i]代表能凑出总额为j时的最少硬币数
for(int i=0;i<n;i++){
for(int j=1;j<=amount;j++){
if(j>=coins[i]){
... | ALGO | 0.99993 | 5.665767 |
698ac428-34f9-42cf-a8cd-0b67037e06a2 | kisang0365/baekjoonAlgorithm | 1149.cpp | /*
* 1149.cpp
*
* Created on: 2017. 3. 27.
* Author: chokisang
*/
#include<iostream>
#include<cmath>
using namespace std;
int main(void){
int N;
cin >> N;
int R=0, G=1, B=2;
int RGB[3][1001];
for(int i=0; i<N; i++)
cin >> RGB[R][i] >> RGB[G][i] >> RGB[B][i];
for(int i=1; i<N; i++){
RGB[R][i]... | ALGO | 0.995188 | 4.363862 |
ce1a5984-9278-44b4-856f-426aacdd7a03 | MIJI-H/CodingTest | 프로그래머스/1/86051. 없는 숫자 더하기/없는 숫자 더하기.cpp | #include <string>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int solution(vector<int> numbers) {
int answer = -1;
int sum = 0;
for(int i = 0; i < numbers.size(); i++){
sum += numbers[i];
}
answer = 45 - sum;
return answer;
} | ALGO | 0.999612 | 4.988228 |
bef00f11-0695-4d1c-898f-98fab42d9145 | Esraa-Abdelnaser/ProblemSolving_HackerRank | 018-Left Rotation _ HackerRank.cpp | vector<int> rotateLeft(int d, vector<int> arr) {
int temp;
for (int i=0; i<d; i++) {
temp=arr[0];
for (int j=0; j<arr.size()-1;j++) {
arr[j]=arr[j+1];
}
arr[arr.size()-1]=temp;
}
return arr;
}
| ALGO | 0.999731 | 4.68872 |
dab08bd9-a712-43ca-b85a-a50b6ec9e6db | ercydann/13-Self-Driving-Car-Projects-Machine-Learning_Computer-Vison | project_10_MPC_control/src/Eigen-3.3/doc/examples/TutorialLinAlgInverseDeterminant.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
A << 1, 2, 1,
2, 1, 0,
-1, 1, 2;
cout << "Here is the matrix A:\n" << A << endl;
cout << "The determinant of A is " << A.determinant() << endl;
cout << "The inverse of A is:\n... | ALGO | 0.999342 | 4.186114 |
4f483fa3-405e-4d19-a051-8537f1ab6608 | mukuldeep/cs | cp/CodeForces/cdfr_1451B.cpp | //
// Created by me on 30-05-2021.
//
#include <bits/stdc++.h>
#define SYNC ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define DRIVER int main(){SYNC ll t=1;I_ t;W_(t)soln(t);return 0;}
#define TEST_DRIVER int cc_main(){SYNC ll t=1;I_ t;W_(t)soln(t);return 0;}
#define FR_(a,c) for (ll (a)=0;(a)<(c); (a)++)
#... | ALGO | 0.999864 | 3.760504 |
d5853b18-573b-4e75-b850-d3aa418f6b2e | phitronio/Conceptual-Sessions-Code | Batch 6/Algorithm/Week 4-2/can_reach.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 5;
int dp[N];
/* bool canReach(int start, int target) //
{
if (start == target)
return true;
if (start > target)
return false;
// dp[15]=false/0;
// dp[16]=true/1;
if (dp[start] != -1)
return dp[start];
... | ALGO | 0.999975 | 4.480742 |
48732d1c-8f78-4eb1-bcdc-e8937c90dca0 | USW-Semicolon/Algorithm-Study | 2024-1/week_2/안태경/2. 문자열 교환.cpp | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int Count_a(string line, int index, int size) {
int b_count = 0;
for (int i = 0; i < size; i++) {
if (line[index] == 'b') {
b_count++;
}
index++;
if (index == line.size()) index = 0;
}
return b_count;
}
void algorithm(strin... | ALGO | 0.998532 | 3.903904 |
c3489b33-199d-40b0-a807-8498dc1f4489 | armaan-monga/DSA | 0035-search-insert-position/0035-search-insert-position.cpp | class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int left = 0, right = nums.size() - 1;
while (left <= right) {
int mid = left + (right - left) / 2;
if (nums[mid] == target) {
return mid;
} else if (nums[mid] < target) {... | ALGO | 0.999973 | 6.906675 |
a3b7f769-826f-428a-b213-d7ce8e80a631 | bae1776/A4_BOJPractice | A4_BOJPractice/1795.cpp | //https://www.acmicpc.net/problem/1795
/*마알 (Gold 4)
각 말에 대해 특정 보드 칸에 도달할 수 있는 최소 이동 횟수를 BFS로 구한뒤에
이를 각 원소끼리 모두 합친다. 합친 행렬에서 최소 원소값이 최소 이동 횟수이다.
칸의 수는 최대 N = 100이고, 시간 복잡도 O(N^2)에 풀 수 있다.
*/
#include <iostream>
#include <queue>
#include <list>
#include <vector>
#include <tuple>
using namespace std;
constexpr int MAX... | ALGO | 0.999731 | 5.750888 |
645637b5-0b2b-429b-8d78-7892819f7372 | zou-haisheng/BashuOJ-pub-code | 1759.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int ans=0, len;
string s;
getline(cin, s);
len = s.length();
for(int i=0;i<len;i++)
{
if(s[i]!=' ') ans++;
}
cout<<ans;
return 0;
} | ALGO | 0.99833 | 3.379389 |
720a5263-82db-460d-b85b-2db73b20104b | hyewonss/cpptetbase | hwseo/cpptetbase2/cpptetbase/Main.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include "colors.h"
#include "Matrix.h"
using namespace std;
/**************************************************************/
/**************... | TOOL | 0.904513 | 3.95622 |
1a505ac9-f69a-4fa2-8340-5f6c2fc28b47 | mattblferrer/codeforces | 1118D1.cpp | #include <bits/stdc++.h>
void problem1118D1() {
int n, m;
std::cin >> n >> m;
std::vector<int> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
// TODO: solve
}
int main() {
problem1118D1();
return 0;
} | ALGO | 0.999833 | 3.804552 |
72299d39-9925-41bc-a500-8d8074132d9d | Randowlh/Project_ACM_2021 | code/luogu/p2084.cpp | #include<cstdio>
#include<string>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int i,j,m,n,d;
scanf("%d",&d);
string ss,ans;
cin>>ss;
int flag=0;
for(i=0;i<ss.length();i++){
if(flag==0&&ss[i]!='0'){
flag=1;
cout<<ss[i]<<'*'<<d<<'^'<<ss.length()-1-i;
}else if(ss... | ALGO | 0.999865 | 3.141781 |
78832d36-7d41-4c1e-baaf-15dc9aeba4f7 | queelius/digistar | tests/integration/test_bh_robust.cpp | #include "src/algorithms/BarnesHutRobust.h"
#include <iostream>
#include <iomanip>
#include <cmath>
#include <random>
#include <chrono>
// Test with a realistic N-body system
void testNBodySystem(int n_particles, float theta, int steps = 1000) {
// Create a cluster of particles
std::vector<Particle> particles(... | ALGO | 0.999917 | 7.402411 |
b486988c-c30a-44aa-8fd6-d0eb9f6a6c4c | dhairyapandya05/Data-Structures-and-Algorithms | Trees/P_1026_maxdifferencebetweennodeandancestor.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999976 | 6.439369 |
d6cfbc4a-90c6-43de-8016-502066e6b621 | ishandutta2007/codeforces | ivan100sic/normal/582/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
int n;
int a[200005], b[200005], c[400005], z[400005], q[200005];
basic_string<int> e[200005];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cerr.tie(n... | ALGO | 0.999881 | 3.534047 |
93eafaf2-9b71-4d1f-aad4-6aaa815467f5 | allcoinguru/AllCoinGuru-Core | src/policy/rbf.cpp | #include "policy/rbf.h"
bool SignalsOptInRBF(const CTransaction &tx)
{
BOOST_FOREACH(const CTxIn &txin, tx.vin) {
if (txin.nSequence < std::numeric_limits<unsigned int>::max()-1) {
return true;
}
}
return false;
}
bool IsRBFOptIn(const CTxMemPoolEntry &entry, CTxMemPool &pool)
... | ALGO | 0.861688 | 7.171942 |
599be99a-da13-445d-abd9-a02ee4bffd9a | yzqhao/JYEngine2 | Third/bimg/3rdparty/nvtt/bc7/avpcl_mode7.cpp | // Thanks to Jacob Munkberg (<EMAIL>) for the shortcut of using SVD to do the equivalent of principal components analysis
// x10000000 5555.1x4 64p 2bi (30b)
#include "bits.h"
#include "tile.h"
#include "avpcl.h"
#include "nvcore/debug.h"
#include "nvmath/vector.inl"
#include "nvmath/matrix.inl"
#include "nvmath/fitt... | ALGO | 0.991213 | 4.569853 |
b03e188a-6868-4b70-aed4-9d2ff7abbf08 | hjptriplebee/Leetcode | 136.single-number/single-number.cpp | class Solution {
public:
int singleNumber(vector<int>& nums) {
int res = 0;
for(int i = 0; i < nums.size(); i++) res ^= nums[i];
return res;
}
}; | ALGO | 0.999967 | 5.673577 |
e81607e8-6107-42f9-82b2-83a35c4d5654 | 7hong13/Problem-Solving | String/1157/1157.cpp | #include <iostream>
#include <cstring>
using namespace std;
int alphabets[26] = {0, };
void countEachAlphabet(string word) {
for (int idx = 0; idx < word.length(); idx++) {
int charToInt;
if (65 <= word[idx] && word[idx] <= 90) {
charToInt = word[idx] - 65;
}
else {
... | ALGO | 0.99999 | 4.58104 |
1b83eeea-fb5c-4fdd-bb7e-6a5a2199090f | dinesh-mcw/m30 | cobra_raw2depth/util/LumoUtil.cpp | /**
* @file LumoUtil.cpp
* @brief Some general purpose utilities used in the RawToDepth repo.
*
* @copyright Copyright (c) 2023 Lumotive, Inc. All rights reserved.
*
*/
#include <LumoUtil.h>
#include <iostream>
#include <fstream>
#include <string>
uint32_t LumoUtil::countWordsInFile(std::string filename, std::... | TOOL | 0.913909 | 5.720793 |
54c898da-728e-4b1e-89bd-e3e06e3d8bab | jacke121/push_image_to_rtsp | hik_client_dll/opencv/sources/3rdparty/carotene/src/blur.cpp | #include <vector>
#include "common.hpp"
#include "saturate_cast.hpp"
namespace CAROTENE_NS {
bool isBlur3x3Supported(const Size2D &size, BORDER_MODE border)
{
return isSupportedConfiguration() && size.width >= 8 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_REPLICATE);
}
void b... | ALGO | 0.995355 | 6.554525 |
3bc4c0b6-9ed8-47cb-b440-579625c7af56 | weria-pezeshkian/FreeDTSv2.2 | dts_vmd/PositionRescaleFrameTensionCoupling.cpp | #include <stdio.h>
#include "PositionRescaleFrameTensionCoupling.h"
#include "Nfunction.h"
#include "vertex.h"
#include "Curvature.h"
#include "State.h"
PositionRescaleFrameTensionCoupling::PositionRescaleFrameTensionCoupling()
{
}
PositionRescaleFrameTensionCoupling::PositionRescaleFrameTensionCoupling(double sigmap... | ALGO | 0.989024 | 4.624456 |
03a9d7d0-d040-4001-94f4-a8d685c72288 | Moinkhan21/CPPDemoPractice | Practice36.cpp | #include <iostream>
using namespace std;
// ============================================
// Function: binarySearch
// Purpose : Perform binary search on a sorted array
// Params : arr[] -> sorted array of integers
// n -> size of the array
// target -> the number to find
// Returns : index of ... | ALGO | 0.999932 | 7.38872 |
408739dd-cb6c-4088-ad61-b428ca9ae29c | yerin85/BOJ_solving | Bronze/1712 손익분기점.cpp | #include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <algorithm>
#include<climits>
using namespace std;
long long a, b, c;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> a >> b >> c;
int ans = 0;
if (c - b <= 0) cout << -1;
else {
ans = a /... | ALGO | 0.999915 | 3.700328 |
5aa3482f-8756-4858-9f18-5d4817bea5c5 | aditya-sengupta/simea | lib/boost_1_70_0/libs/bimap/example/mi_to_b_path/mi_hashed_indices.cpp | /*****************************************************************************
Boost.MultiIndex
*****************************************************************************/
#include <boost/config.hpp>
//[ code_mi_to_b_path_mi_hashed_indices
#include <iostream>
#include <iomanip>
#include <boost/tokenizer.hpp>
#i... | ALGO | 0.901533 | 6.647751 |
3c15a32c-5e4b-46a0-b183-0b20f91ff06e | umma-aymon/Codeforces | A. Ehab and another construction problem.cpp | #include<bits/stdc++.h>
using namespace std;
int a,b,x;
int main()
{
cin>>x;
if(x==1)
cout<<-1<<endl;
else if(x==2 || x==3)
cout<<"2 2";
else if(x==5)
cout<<"4 2";
else
{
b=ceil(sqrt(x));
a=b*2;
cout<<a<<" "<<b<<endl;
}
return 0;
}
| ALGO | 0.999868 | 3.714342 |
ab574989-9240-4617-a03e-7689e0e30d7f | JooHui-void/algorithm | 14442.cpp | #include <stdio.h>
#include <queue>
using namespace std;
int map[1000][1000];
int visit[1000][1000][2];
int _x[4]={0,0,1,-1};
int _y[4]={1,-1,0,0};
queue<vector<int> > q;
int Min=9999;
int main(){
int N,M,K;
scanf("%d %d %d",&N,&M,&K);
for(int i=0;i<N;i++){
for(int j=0;j<M;j++){
scanf("%1d",&map[i][j]);
}
}
... | ALGO | 0.999932 | 3.434175 |
f0bd367d-b0a9-410e-aaec-2bbe3caf874b | Stensal/boost | libs/numeric/ublas/doc/samples/matrix_column_project.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
for (unsigned j = 0; j < m.size2 (); ++ j) {
for (unsigned i = 0; i < m.size1 (); ++ i)
... | ALGO | 0.989604 | 3.302267 |
332817cd-9989-47c1-9ed2-ffbdd9b7437c | ankitguptabk/DSA-and-LeetCode | 3561-resulting-string-after-adjacent-removals/3561-resulting-string-after-adjacent-removals.cpp | class Solution {
public:
string resultingString(string s) {
string stack;
for(char c:s){
if(stack.empty()==false){
char last=stack.back();
if(abs(last-c)==1 || abs(last-c)==25){ //last-c=1 for ab type....last-c=225 for za type
stack.pop_ba... | ALGO | 0.999935 | 6.17418 |
bbf607ad-1be9-4c22-8450-87fdf97a68f4 | Souma-cpp/Cpp-Journey | L59_to_L70/Binary search trees/LCA_BST.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* left;
Node* right;
Node(int data) {
this->data = data;
left = nullptr;
right = nullptr;
}
};
Node* build_bst(Node* root, int data) {
if (root == nullptr) {
root = new Node(data);
... | ALGO | 0.999993 | 7.090176 |
4d321080-aa4b-4e23-8383-b8c6cb1becfd | taqihaider110/DSA---LeetCode | Strings/C++/Append Characters to String to make a subsequence.cpp | class Solution {
public:
int appendCharacters(string s, string t) {
int s_index = 0, t_index = 0;
int s_length = s.length(), t_length = t.length();
while (s_index < s_length && t_index < t_length) {
if (s[s_index] == t[t_index]) {
t_index++;
}
... | ALGO | 0.999957 | 6.331371 |
104989de-121f-4d89-a402-e7f131f0168f | Ipilot7/FlutterApps | best_calculator/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.998172 | 6.785645 |
ec8f3af7-39f0-42aa-a73b-a3ab4ec7cee4 | rudalsd/Algorithm-Study | 백준/그래프/27009. Out of Hay.cpp | #include<iostream>
#include<algorithm>
using namespace std;
struct node {
int A, B, L;
};
bool cmp(node left, node right)
{
return left.L < right.L;
}
int N, M;
int vect[2001];
node arr[10000];
int Find(int num)
{
if (vect[num] == num) return num;
return vect[num] = Find(vect[num]);
}
void Union(int a, int b)... | ALGO | 0.999968 | 4.444346 |
39cfdaf1-e54c-4b20-a37c-43d86eab841b | axelu/leetcode | cpp/02500-02999/maximumpointsaftercollectingcoinsfromallnodes.cpp |
// 2920. Maximum Points After Collecting Coins From All Nodes
// https://leetcode.com/problems/maximum-points-after-collecting-coins-from-all-nodes/
class Solution {
private:
int mem[100000][14];
int dfs(vector<int> g[], int u, vector<int>& coins, int k, bool seen[], int way2) {
// cout << "dfs u... | ALGO | 0.999896 | 5.330951 |
b510f97a-772b-48b7-bf5e-68732fa8fb24 | jimin-0415/beakjoon | C++/프로그래머스/2/12909. 올바른 괄호/올바른 괄호.cpp | #include <string>
#include <iostream>
#include <stack>
using namespace std;
bool solution(string s)
{
//1. 첫괄호 ) 마지막 (일경우
//2. 개수가 같지 않으면 안닫힘.
//3. (() 같자기 비정상적으로 많아질경우 2개 -> 3개 -> 2개?
//1. stack을 통해서 한다면, 초기 ( 부터 시작 만약 스택이 비었는데 ) 부터 들어오면 fail
//2. ( 들어올경우 stack에 넣기. ) 반대가 올경우 pop처리.
bool ... | ALGO | 0.99523 | 5.405878 |
9cd16ca6-ac4b-4232-8baa-6d14bb3cd867 | Thiendeptrai169/Div-4-1st-time | solsoldierandbananas.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int k,w;
long long n,sum = 0;
cin >> k >> n >> w;
for(int i = 1; i <= w; i++)
sum+= i*k;
if(n > sum) cout << "0";
else{
cout << sum - n;
}
} | ALGO | 0.999931 | 3.437671 |
33c64962-0ec3-4dfa-9390-01437cd5c72c | Adityamaurya123uma/LeetCode-DSA-Questions---Solved- | Sort the Matrix Diagonally.cpp | class Solution
{
public:
vector<vector<int>> diagonalSort(vector<vector<int>> &mat)
{
int n = mat.size(), p = mat[0].size();
map<int, priority_queue<int, vector<int>, greater<int>>> diag;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < p; j++)
{
... | ALGO | 0.999949 | 5.56287 |
245fcd64-f82b-419a-a161-9b6ce8e813a4 | VC6378/Codeforces | B_Difference_of_GCDs.cpp | #include <bits/stdc++.h>
using namespace std;
//Speed
#define fastio() ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int32_t main()
{
long long t;
cin>>t;
while(t-->0){
long long n,l,r;
cin>>n>>l>>r;
vector<long long> vec(n+1);
bool flag=1;
... | ALGO | 0.999906 | 3.081066 |
e509c920-a00a-42be-8ddc-9881fa9ca994 | dubeyayushi/Competitive-Programming | Strivers A2Z DSA Sheet/Step-3: Solve Problems on Arrays/Lec-1: Easy/01_largest_element_in_an_array.cpp | //https://www.naukri.com/code360/problems/largest-element-in-the-array-largest-element-in-the-array_5026279?utm_source=striver&utm_medium=website&utm_campaign=codestudio_a_zcourse&leftPanelTabValue=PROBLEM
#include <bits/stdc++.h>
int largestElement(vector<int> &arr, int n) {
// Write your code here.
int ans ... | ALGO | 0.999731 | 4.960418 |
08ee60bc-a45c-4dcc-892d-e2c53101ad99 | Wang-yeeming/bpnn | bpnn.cpp | #include "bpnn.h"
#define TRY try {
#define CATCH \
} \
catch (const char* msg) { \
std::cerr << msg << std::endl; \
system("pause"); \
exit(-1); \
}
static std::vector<std::string>... | ALGO | 0.983107 | 4.221468 |
901c00e7-4181-47ac-91ce-17f89bc1e8d1 | Afianaeem124/chat_call_app | 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 |
66b232e9-43c3-48b6-b2ca-27b096c9bce7 | MariaChrysafis/CompetitiveProgramming | Codeforces/1450C2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <set>
#include <stack>
#include <map>
#define ll long long
using namespace std;
vector<bool> isPrime;
void print(vector<ll> v){
for(int i: v) cout << i << " ";
cout << endl;
}
char op(char c){
if( c== 'X') return 'O';
... | ALGO | 0.999769 | 4.899281 |
c0a33bae-be64-4562-b5b5-1a66e058cefb | Uness10/CodeForces | K-thNotDivisiblebyn.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
using namespace std ;
typedef long long ll;
int main(){
ll t ;
cin >> t;
string out ="";
for(ll i=0;i<t;i++){
ll n,k;
cin >> n >>k ;
ll sup = k * (static_cast<double>(n)/(n-1)) ;
if(s... | ALGO | 0.99995 | 3.864779 |
1abbd4fb-cfd2-40f1-8254-2d4057cbc7f4 | Pragad/Algos | Stanford/linked_list_stanford.cpp | /*
* PROBLEM 1. Finding length of the linked list.
* unsigned int getLength(node* head)
*
* PROBLEM 2. Get Nth node
* int getNth(node* head, int index)
*
* PROBLEM 3. Delete the complete list
* void deleteList(node*& headRef)
*
* PROBLEM 4. Pop function
* int pop(node*& head)
*
* PROBLEM 5. InsertNth to i... | ALGO | 0.999111 | 4.96104 |
489488df-965c-4f14-aad9-19f0457cc670 | rohit141914/LeetCode | 0515-find-largest-value-in-each-tree-row/0515-find-largest-value-in-each-tree-row.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999977 | 6.234132 |
98d91155-83e1-416b-a44a-f8fe9cd8f687 | haikion/pbochecker | lib/pbochecker.cpp | #include "pbochecker.h"
#include <QByteArray>
#include <QCommandLineParser>
#include <QCoreApplication>
#include <QCryptographicHash>
#include <QDir>
#include <QDirIterator>
#include <QFile>
#include <QFileInfo>
#include <QList>
#include <QMap>
#include <QSet>
#include <QStringList>
#include <QStringLiteral>
#include ... | TOOL | 0.932675 | 7.375991 |
6ba7e9a1-e563-4bcf-9c94-fa9fb132a654 | AshishKumar555/DSA_STL | 0.36STL_Array/7.cpp | #include<iostream>
#include<array>
#include<algorithm>
using namespace std;
int main()
{
int arr[]={50,60,30,40,5,4};
// sort(arr.front(),arr.back());
// cout<<arr.sort();
int size=sizeof(arr)/sizeof(int);
cout<<sizeof(arr)<<endl;
cout<<endl<<size<<endl;
sort(arr,arr+size);
cout<<endl;
for(auto i... | ALGO | 0.997535 | 3.412345 |
0c7c72c7-ae36-43c9-9656-0a9c750fc629 | Gorang-Maniar/graphics | carrom/carrom.cpp | #include<iostream>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<GL/glut.h>
using namespace std;
#define PI 3.141592653589
#define DEG2RAD(deg) (deg * PI/180)
int score = 30;
int t=0;
class Draw{
public:
void Box(float len){
glBegin(GL_QUADS);
glColor3f(200.0/248, 150.0/248, 70.0/248);
glV... | TOOL | 0.903759 | 4.017513 |
45906873-4142-4147-a6fe-ed2902b465a8 | nkhoroshavin/Attestation | 2_12.cpp | #include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
int min = 0, max = 0, n;
int a[100];
cout << " : ";
cin >> n;
cout << " : ";
for (int i = 1; i <= n; i++)
{
cin >> a[i];
}
cout << ":\n";
for (int i = 1; i <= n; i++)
{
cou... | ALGO | 0.999605 | 3.609627 |
a2868622-f9b1-4830-aaae-6a83dcd026a1 | nekomaruh/flutter_clean_bloc_news_api | 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 |
044fcdb7-b3b7-4f59-8c03-404825f66efd | GeorgeBalayan/mixed | b_s.cpp | #include <vector>
#include <iostream>
using namespace std;
void binarySearch(vector <int> &array, int lowerbound, int upperbound, int key)
{
int position = 1 / 0;
int position2 = 1 / 0;
int c;
int comparisonCount = 1; //count the number of comparisons (optional)
// To start, find the subscr... | ALGO | 0.999628 | 4.653862 |
850abaed-976b-457d-8adf-54bfd839ae86 | rhmunna143/competetive-programming | Cpp/Algorithms/mid/Knight_Moves.cpp | /***
* Objective:
*
* Context:
*
*
* Constrains:
*
*
* Note:
*
*
* TODO:
* Algorithm | Pseudo-code | Steps -- Write here
*
* 1.
*
*/
#include<bits/stdc++.h>
using namespace std;
int n, m;
vector<pair<int, int>> knight_moves = {
{-2, -1}, {-2, 1}, {-1, -2}, {-1, 2},
{1, -2}, {1, 2}, {2, -1... | ALGO | 0.999944 | 5.856699 |
af816d64-9f8e-43b8-844b-5741bcfdd810 | KinyaIwamoto/CxImage | CxImage/ximadsp.cpp | // xImaDsp.cpp : DSP functions
/* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it
* CxImage version 7.0.2 07/Feb/2011
*/
#include "ximage.h"
#include "ximaiter.h"
#if CXIMAGE_SUPPORT_DSP
////////////////////////////////////////////////////////////////////////////////
/**
* Converts the image to B&W.
* The Opti... | TOOL | 0.887964 | 5.20434 |
8771537c-9d85-42e6-887b-dd82a381574b | ishandutta2007/codeforces | jdurie/normal/1662/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll, ll> pl;
typedef vector<ll> vl;
#define G(x) ll x; cin >> x;
#define F(i, l, r) for(ll i = l; i < (r); i++)
#define all(a) begin(a), end(a)
#define K first
#define V second
int main(){
ios_base::sync_with... | ALGO | 0.999743 | 3.879734 |
4b385483-8516-4ed0-b110-a54061a10e4a | JeffLegendPower/cp-codes | codeforces/Beautiful Array div3 E/E_Beautiful_Array.cpp | // https://codeforces.com/contest/1986/problem/E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef pair<ll, int> plli;
struct comp {
bool operator() (plli a, plli b) {
retu... | ALGO | 0.999714 | 4.508871 |
043d24f2-46ab-4d83-9250-cc0dfa83e526 | Greeeder/Program | &HydroNet_FlowSolver/HydroNet_FlowSolver/HydroNet_FlowSolver/Libraries/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::VectorXf v(2);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,
1;
//add v to each column of m
mat.colwise() += v;
std::cout << "Broadcasting result: " << std::endl;... | ALGO | 0.998486 | 4.136906 |
8d4b5ab5-cd1f-4552-962e-4d02d8939ab9 | Hao-yu-lin/Leetcode | BFS/0515-Find_Largest_Value_in_Each_Tree_Row.cpp | /*
題目:
https://leetcode.com/problems/find-largest-value-in-each-tree-row/
解說:
使用 BFS 觀念逐層搜索。
使用 queue 紀錄接下來要拜訪的 Node,利用 qsize 紀錄該層有幾個 Node,進行大小比對。
該層比對完之後,將最大值放入 ans 中。
在比較過程中,如果該 Node 有 child 時,將 child 放入 queue 中。
待 qsize 歸零時,queue 內記載的是下一層的 queue。再繼續比較下一層,直到 queue 為空
有使用到的觀念:
BFS, Tree
*/
#include "../code_functio... | ALGO | 0.99999 | 6.456035 |
b571d404-d0fb-41ce-bad2-5d9bfdffc39b | VuLeCoder/UTC_ltol | Problem/GiaiOSoGameSudoku.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int N = 9;
vector<vector<int>> Sudoku(N, vector<int>(N));
bool IsValid(int num, int x, int y)
{
for(int i=0; i<N; ++i)
if(Sudoku[x][i] == num || Sudoku[i][y] == num)
return false;
int dx = x - x%3, dy = y - y%3;
for(int i=... | ALGO | 0.999916 | 5.511906 |
9cc298ae-5076-4b98-87fd-ca9bf363e463 | 8l/llvm2 | lib/Transforms/Utils/CtorUtils.cpp | #include "llvm/Transforms/Utils/CtorUtils.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#define DEBUG... | TOOL | 0.93055 | 7.819459 |
6a44fd65-54ec-4229-a4d7-2f64f0ad0ce3 | ss09777/calculator_demo | 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 |
e2f91e75-bfe3-4859-868a-ee86d1cc14c5 | Relintai/pandemonium_engine | editor_modules/raycast/embree/kernels/bvh/bvh_builder_sah_mb.cpp | #include "bvh.h"
#include "bvh_builder.h"
#include "../builders/bvh_builder_msmblur.h"
#include "../builders/primrefgen.h"
#include "../builders/splitter.h"
#include "../geometry/linei.h"
#include "../geometry/triangle.h"
#include "../geometry/trianglev.h"
#include "../geometry/trianglev_mb.h"
#include "../geometry/t... | ALGO | 0.988837 | 3.132003 |
819c9a48-d215-42f6-97ec-23df1efb8cf4 | maletsden/refactored-cache | srcs/6_vectorized_multithreaded.cpp | //
// Created by maletsden on 17.08.21.
//
#include <vector>
#include <array>
#include <thread>
#include <numeric>
#include <immintrin.h>
#include "../hdrs/6_vectorized_multithreaded.h"
MATRIX_VAL vectorizedThreadedSum(const MATRIX_VAL* data, size_t rows, size_t cols) {
constexpr auto threadsNum = 6;
std::vecto... | TOOL | 0.987822 | 6.105049 |
a9ff43a7-1263-4e27-8fc3-914d44d305ee | jahidneub/Codeforce-Problem-Solution-in-Cpp | 116A- Tram.cpp | #include<iostream>
using namespace std;
int main()
{
int n,a,b,sum=0,k=0;
cin>>n;
for(int i=0; i<n;i++)
{
cin>>a>>b;
sum=(a+k)-b;
k=sum;
if(sum<0)
k=0;
else
k=sum;
}
cout<<sum;
}
| ALGO | 0.999957 | 3.1415 |
a47be1e9-b59e-4026-b0e7-357d5ccd2df1 | Tommylee1013/Cplusplus | Chapter05/prg05_09.cpp | //
// Created by Junghun Lee on 1/18/24.
//
#include <iostream>
using namespace std;
int main() {
int n;
cout << "enter the integer to print : ";
cin >> n;
for (int counter = 0; counter < n; counter ++) {
cout << counter << " ";
}
return 0;
} | TOOL | 0.977102 | 3.994867 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.