uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
170d5676-103b-4b95-befc-7eeea1fffeaf | sammochen/cp-submissions | hackerrank/40-fair-cut.cpp | /*
Original problem:
Author: sammochen
*/
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define REP(x,l,u) for(ll x = l;x<u;x++)
#define RREP(x,l,u) for(ll x = l;x>=u;x--)
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
string to_string(string s) {return s;}
s... | ALGO | 0.999901 | 3.574794 |
72f33b0a-edcf-4acf-bdd0-8ed9afea1b4a | Harry-kp/Cp | Leetcode/1488-sort-integers-by-the-power-value/2022-05-23 23.45.50 - Runtime Error - runtime NA - memory NA.cpp | class Solution {
public:
int dp[3005];
int pow(int n){
if(n == 1)
return 0;
if(dp[n]!=-1)return dp[n];
return dp[n] = n&1?(1+pow(3*n+1)):(1+pow(n/2));
}
int getKth(int lo, int hi, int k) {
vector<int> a;
for(int i = lo;i<=hi;i++){
... | ALGO | 0.999965 | 5.089537 |
4d09a0bc-6a23-4205-98f4-e13c10ec22b0 | Mani5871/Striver | DAY18/Nodes K distance.cpp | class Solution
{
public:
void find_parent(TreeNode *root, unordered_map<TreeNode *, TreeNode *>&par)
{
queue<pair<TreeNode *, TreeNode *>> q;
q.push({root, NULL});
while(!q.empty())
{
int n = q.size();
for(int i = 0; i < n; i++)
{
... | ALGO | 0.999997 | 5.874499 |
4d2c3be6-7dde-449b-a77c-b030404628a4 | enbugging/SummerInternship2021 | lib/numerical_recipes/golden.cpp | #include "nr.h"
#include <cmath>
using namespace std;
namespace {
inline void shft2(DP &a, DP &b, const DP c) {
a = b;
b = c;
}
inline void shft3(DP &a, DP &b, DP &c, const DP d) {
a = b;
b = c;
c = d;
}
}
DP NR::golden(const DP ax, const DP bx, const DP cx, DP f(const DP), const DP tol, DP &xmin... | ALGO | 0.999936 | 4.530598 |
59664ef1-74c5-44c8-9c11-fd16315bebd0 | AutumnRockDev/JUCE-8.0.6-Fork | modules/juce_dsp/frequency/juce_FFT.cpp | namespace juce::dsp
{
struct FFT::Instance
{
virtual ~Instance() = default;
virtual void perform (const Complex<float>* input, Complex<float>* output, bool inverse) const noexcept = 0;
virtual void performRealOnlyForwardTransform (float*, bool) const noexcept = 0;
virtual void performRealOnlyInverseTra... | ALGO | 0.916275 | 7.107293 |
91e12358-ad34-4e4f-9b22-ca7b84f54600 | danielhO9/PS | CODEFORCES/1966D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, k;
void solve() {
cin >> n >> k;
int mx;
for (int i = 19; i >= 0; --i) if ((k >> i) & 1) {
mx = i;
break;
}
vector<int> ans;
int s = 0;
for (int i = 0; i < mx; ++i) ans.push_back(1 << i);
for (auto i: ans) s += i;
s = k - 1 - s;
... | ALGO | 0.999775 | 4.346704 |
280d84c7-9480-4942-807d-f874fd5f3ee7 | wvu-navLab/ICE | 3rdparty/Eigen/test/sparseLM.cpp | #include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template <typename Scalar>
struct sparseGaussianTest : SparseFunctor<Scalar, int>
{
typedef Matrix<Scalar,Dynamic,1> VectorType;
typedef SparseFunctor<Scalar,int> Base;
typedef typename Base::JacobianType JacobianT... | TEST | 0.98381 | 6.130261 |
96e401a7-c1df-45d4-9984-befe2761b947 | attaurrehmanhaji/table-generator-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 |
a11279a6-08a8-4df1-bf4f-33ad845856f3 | nobushi95/Boot_camp_for_Beginners | medium100/015.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
#define REP(i, left, right) for (ll i = left; i < right; i++)
#define REPEQ(i, left, right) for (ll i = left; i <= right; i++)
#define RREP(i, right, left) for (ll i = right; i >= left; i--)
#define FORE(elem, container) for (aut... | ALGO | 0.999987 | 3.844201 |
5ce06533-cf27-4319-9ccf-2e20e367629d | 1nF0rmed/CompetitiveCoding | LUCKFOUR.cpp | //Beginner Practice Problem
//Lucky Four [LUCKFOUR]
#include <bits/stdc++.h>
using namespace std;
int main()
{
unsigned long long t=0;
cin>>t;
while(t--)
{
unsigned long long c=0;
string n="";
cin>>n;
for(unsigned long long i=0;i<n.length();i++)
{
if(n[i]=='4') {c++;}
}
... | ALGO | 0.999461 | 4.983663 |
e6d542db-fd55-4080-9760-4dd3130d1be6 | lokeshkumar80/gfg | 70_non_repeating_Chars.cpp | // class Solution {
// public:
// // Function to find the first non-repeating character in a string.
// vector<int>freq(string s){
// vector<int>freqcount;
// int n = s.length();
// int i=0;
// while(i<26){
// int count=0;
// for(int j=... | ALGO | 0.999739 | 5.105071 |
ee5e8100-cb9f-4a5b-856c-f265634f6817 | jongyeon95/algorithmStudy | Samsung_SW_Expert_Academy/D4/7733. 치즈 도둑.cpp | #include <iostream>
#include <queue>
#include <cstring>
using namespace std;
int cheese[100][100];
int visited[100][100];
int n;
int flag=1;
int dx[]={0,0,1,-1};
int dy[]={1,-1,0,0};
void bfs(int y, int x){
queue<pair<int ,int>> q;
q.push({y,x});
while(!q.empty()){
pair<int,int> temp;
temp=... | ALGO | 0.999068 | 3.72736 |
19585974-f5fc-438b-91f3-13b5573a292d | Mukesh-Khemani/DSA-Problems | Dota2_Senate.cpp | #include <bits/stdc++.h>
using namespace std;
/*
INTUITION:
In each round, each senator will try to ban the voting rights of the members of the
other party. This process will continue until all the eligible voters are of the
same party.
Solution:
-> We take two queues and append the indices of all the members of the ... | ALGO | 0.999963 | 6.097005 |
313ed2bf-bc70-44f2-a95b-bb24bf3686a7 | Gatovsky/estructura-de-datos_isc_3er | unidad-1-y-2/examen/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
unsigned long auxiliar =1, numeroFib =0, inicio=1, limite=10;
unsigned long a, b, c=0;
cin >> a >> b;
cin.ignore();
//cin >> limite;
if(limite >0) {
for (inicio; inicio <= limite; inicio++) {
//cout << numeroFib <<... | ALGO | 0.999695 | 3.601495 |
7db434e4-daec-4dea-a577-05239b078c0c | wenqiangwangsustech/FP16-LSRK | gaussModel/src/src_willimson_con/medium.cpp | /*================================================================
* ESS, Southern University of Science and Technology
*
* File Name:medium.cpp
* Author: Wenqiang Wang, <EMAIL>
* Created Time:2021-10-31
* Discription:
*
================================================================*/
#include "header.h"... | ALGO | 0.993871 | 3.949705 |
83a95bc5-6734-4efa-83f8-0a7a3fb578ee | sarvex/leetcode-checked-c | solution/1400-1499/1411.Number of Ways to Paint N × 3 Grid/Solution.cpp | using ll = long long;
class Solution {
public:
int numOfWays(int n) {
int mod = 1e9 + 7;
ll f0 = 6, f1 = 6;
while (--n) {
ll g0 = (f0 * 3 + f1 * 2) % mod;
ll g1 = (f0 * 2 + f1 * 2) % mod;
f0 = g0;
f1 = g1;
}
return (int) (f0 + ... | ALGO | 0.999993 | 5.193399 |
6360d7c5-3b33-4e1b-9e90-1046b8dde738 | KausBoss/HP_Codes | CircularQueue.cpp | class MyCircularQueue {
public:
int *ar;
int ms,cs,f,r;
MyCircularQueue(int k) {
ms=k;
sr = new int[ms];
cs=0;
f=0;
r=ms-1;
}
/** Insert an element into the circular queue. Return true if the operation is successful. */
bool enQueue(int value) {
... | ALGO | 0.998716 | 5.545827 |
b7ff9671-f9b0-4a09-9215-ef08c75ff11c | LMFRomero/SRS_Cards | boost/libs/compute/perf/perf_partial_sum.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/partial_sum.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
i... | ALGO | 0.982336 | 5.905273 |
7cf8e08a-9492-40f3-8890-753cc5724338 | suriya911/Expense-Tracker | 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 |
3c151395-2881-498e-b473-36fe2ef9bade | KangkhitaUrbee/IP | problem05.cpp | #include<iostream>
#include<climits>
using namespace std;
int main ()
{
int x;
cout<<"Number of Student :";
cin>>x;
float arr[x];
for(int i = 0 ; i < x ; i++)
cin>>arr[i];
float currentMax = arr[0];
float secondMax = INT_MIN;
for(int i = 1; i< x ; i++){
if( currentMax < arr[i]){
se... | ALGO | 0.999895 | 3.939316 |
047e55e0-66d0-47f6-a25c-7cae3ad8aef2 | omarkhair/Problems-Editorial | UVA/10920 - Spiral Tap/10920.cpp | #include<iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false), cin.tie(0);
int n, row, col;
ll p, count;
pair<int, int> dir[] = { { 1, 0 }, { 0, -1 }, { -1, 0 }, { 0, 1 } }; // up, left, down, right
while (true) {
cin >> n >> p;
if (n == 0)
... | ALGO | 0.999672 | 4.193904 |
bcd262f9-55a9-4516-ae07-93426569f745 | MengqiYe/Cpp_Playground | omp.reduction/basic.cpp | //
// Created by elsey on 2021/11/11.
//
#include <omp.h>
#include <cstdio>
int f(int x) { return x + 1; }
int g(int x) { return x + 2; }
int h(int x) { return x + 3; }
int f(int x, int i) { return x + i; }
int sol1() {
double result = 0;
int x = 5;
#pragma omp parallel
{
double local_result;
... | ALGO | 0.999519 | 4.121234 |
52521e0d-6923-49ab-b1a8-8cc70685bce5 | ishandutta2007/codeforces | peltorator/normal/842/B.cpp | #include <iostream>
#include <cstdio>
#include <math.h>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef double ld;
#define fastRead cin.sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fi first
#define se second
const double eps = 1e-7;
int main()
{
... | ALGO | 0.999925 | 3.787178 |
250236a2-60b2-4089-802d-d07bdf2d2a44 | Azgoh/Sudoku | main.cpp | #include "Grid.h"
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main(void) {
start:
system("cls");
srand(time(NULL));
Grid* g = new Grid();
int InvisNumbers[9][9];
for (int i = 0; i < 9; i=i+3) {
for (int j = 0; j < 9; j = j + 3) {
again:
int num = 1 + rand() % 9;
... | ALGO | 0.95559 | 3.095137 |
099ce915-2842-4ce3-8235-29e612406bae | Akshayp001/LeetSolutions | 1397-search-suggestions-system/search-suggestions-system.cpp | class Solution {
public:
bool startsWith(const string& mainStr, const string& prefix) {
return mainStr.compare(0, prefix.length(), prefix) == 0;
}
vector<vector<string>> suggestedProducts(vector<string>& prods, string word) {
vector<vector<string>> ans;
priority_queue<string,vector<... | ALGO | 0.999801 | 6.489438 |
a5c75ca3-df0c-44ec-8439-6aec2b606d66 | HanaYukii/CSES | 1178.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
const int mod = 1e9 + 7;
const int maxn = 200005;
vector<int>g[100005];
int p... | ALGO | 0.999824 | 4.416603 |
17532702-aea7-4052-bc66-7d066798a610 | danieltrt/SBFL | results/COUNT_CHARACTERS_POSITION_ENGLISH_ALPHABETS.java.cpp | int findCount ( string str ) {
int result = 0 ;
for ( int i = 0 ;
i < str . length ( ) ;
i ++ ) {
if ( i == ( str [ i ] - 'a' ) || i == ( str [ i ] - 'A' ) ) result ++ ;
}
return result ;
}
| ALGO | 0.923753 | 4.683266 |
7f26b0a8-7001-4c13-a1c2-ea566fb8b47e | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt35/Codenet/p00442/834932158/response_3.cpp | #include <iostream>
#include <vector>
#include <deque>
#include <map>
#include <stack>
class t_sort {
public:
int n;
std::vector<int> deg;
std::vector<std::vector<int>> G;
void init(int N) {
n = N;
deg.resize(n);
G.resize(n);
}
void add_edge(int from, int to) {
G[from].push_back(to);
de... | ALGO | 0.999863 | 4.694252 |
d7078611-61d5-4285-9a30-55a5c3550594 | HekpoMaH/Olimpiads | codeforces/round184/b.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<iomanip>
#include<set>
#include<map>
#include<stack>
#include<queue>
using namespace std;
long long x,y,p,q,n,tt;
long long a[100];
long long nod(long long a,long long b)
{
long long r;
while(b!=0)
{
r=a%b;a=b;b=r;
}
return a;
... | ALGO | 0.999982 | 3.402329 |
adf9b033-a4d8-4176-bb28-eae031c02637 | unixpickle/goigl | cvendor/libigl/include/igl/copyleft/cgal/incircle.cpp | #include "incircle.h"
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
template<typename Scalar>
IGL_INLINE short igl::copyleft::cgal::incircle(
const Scalar *pa,
const Scalar *pb,
const Scalar *pc,
const Scalar *pd)
{
typed... | ALGO | 0.999042 | 5.908986 |
564af801-9ebe-4185-96ee-2bbd39119696 | ayush1409/Coding_Platforms_Submissions | LeetCode/pathWithMaxProbability.cpp | // Problem: https://leetcode.com/problems/path-with-maximum-probability/
class Solution {
public:
// Using Dijkshtra's longest path: Accepted
double maxProbability(int n, vector<vector<int>>& edges, vector<double>& succProb, int start, int end){
vector<double> prob(n, 0) ;
vector<vector<pa... | ALGO | 0.999978 | 6.037044 |
aebd5bd2-3bae-4f60-9fbb-f904500004c5 | Feroz455/DATA-STRUCTURE-By-Seymour-Lipschutz | Chapter-06/ALGORITHM/Algorithm-6-14.cpp | /*
Algorithm 6.17: This algorithm deletes and processes the first element
in a priority queue which appears in memory as a one-way list.
1. Set ITEM := INFO[START]. [This saves the data in the first node.]
2. Delete first node from the list.
3. Process ITEM.
4. Exit
Algorithm 6.18: This algorithm adds an ITEM wit... | ALGO | 0.999961 | 4.399688 |
2a1b15ae-da70-4de0-bd7d-3bd44e87e69d | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6935_7.cpp | #include <bits/stdc++.h>
using namespace std;
long long mx = -1e9, mn = 1e9 + 5;
long long T, n, m, k, ans, a[510][510], b, c, l, r, sum, mid, coin, cnt, pos,
number, x, y, z;
vector<long long> v, v1;
map<long long, long long> mp, mm;
map<long long, long long>::iterator it;
pair<long long, long long> p[100005];
que... | ALGO | 0.999966 | 3.43883 |
89df4681-df8e-4fb5-9b02-b89722c4a175 | ayang114/CS141 | CS141-Homework-4/HomeworkB.cpp | #include <bits/stdc++.h>
#include <vector>
#include <algorithm>
using namespace std;
int editDistDP(int arr1[], int arr2[], int s1, int s2){
int arr3[s2+1][s1+1];
int temp1;
int temp2;
if(s1 == 0 && s2 == 0){
return 0;
}
arr3[0][0] = 0;
for(int i = 0; i < s1; i++){
arr3[0][i + 1] = arr3[0][i... | ALGO | 0.999977 | 3.751265 |
8e39be65-51ac-4bf9-b55c-de4400d55247 | HassnHamada/CP-Solutions | 1689B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e3 + 10, M = 32, MOD = 1e9 + 7, HV = 151, INF = 0x3f3f3f3f;
int n, arr[N];
bool usd[N];
bool ans(vector<int> &out)
{
if ((int)(out.size()) == n)
{
return true;
}
for (int i = 1; i <= n; i++)
{
if (us... | ALGO | 0.999823 | 4.015447 |
b97bac19-8e21-4c0c-a545-ad0d76a83eee | bonoproject/Bonorum | src/merkleblock.cpp | #include "merkleblock.h"
#include "hash.h"
#include "primitives/block.h" // for MAX_BLOCK_SIZE
#include "utilstrencodings.h"
CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter& filter)
{
header = block.GetBlockHeader();
std::vector<bool> vMatch;
std::vector<uint256> vHashes;
vMatch.reserve... | ALGO | 0.998907 | 6.03262 |
ef5bcebb-5871-45a6-9c51-5f094ded5f3d | itu-itis21-ilker20/BLG223E-Data-Structures | Project 2- Huffman Algortihm/src/huffman.cpp | //--- 2022-2023 Fall Semester Data Structure Assignment 2 ---//
//--------------------------//
//---Name & Surname:Fatmagül İlker
//--------------------------//
//-------------Do Not Add New Libraries-------------//
//-------------All Libraries Needed Were Given-------------//
#include <iostream>
#include <stdio.h>
#i... | ALGO | 0.963353 | 3.439727 |
0271eb57-b45e-4ada-8963-d1f459a01fe5 | danzeng8/MultiTopo | third_party/boost_1_62_0/libs/compute/perf/perf_set_union.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/set_union.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int... | ALGO | 0.967517 | 5.67954 |
43451ea0-5f0b-41d0-aeff-becfa379f5da | jcmsj/ITE-001-G2 | A1.1/problem-7-Volume-of-Object.cpp | #include <iostream>
#include <iomanip>
using namespace std;
// Contributed by Sons Justin Paraiso Garcia
int main() {
float mass, density, volume;
cout << "Enter mass: ";
cin >> mass;
cout << "Enter density: ";
cin >> density;
volume = mass / density;
cout << "Volume: " << fixed << setpr... | TOOL | 0.85074 | 4.252203 |
78fcdfce-e0cd-439f-8704-e913687b36b1 | faijurrahman/pSolving | 2. AlgoSolution/8. backTracking/knightMove.cpp | //http://www.geeksforgeeks.org/backtracking-set-1-the-knights-tour-problem/
#include<stdio.h>
#define N 4
int sol[N][N];
/* xMove[] and yMove[] define next move of Knight.
xMove[] is for next value of x coordinate
yMove[] is for next value of y coordinate */
int xMove[8] = {2, 1, -1, -2, -2, -1, 1, 2};
int yM... | ALGO | 0.999814 | 3.891993 |
9048e060-6b26-4ebf-95cf-e8af7101981b | nguyenvantu11052002/CPP | CPP0434 - BIẾN ĐỔI DÃY SỐ - 2.cpp | #include<bits/stdc++.h>
using namespace std;
void inraketqua(){
int n;
cin >> n;
vector<int> a(n);
for(int i = 0; i < n; i++){
cin >> a[i];
}
vector<int> b(n);
b[0] = a[0] * a[1];
b[n - 1] = a[n - 1] * a[n - 2];
for(int i = 1; i < n - 1; i++){
b[i] = a[i - 1] * a[i + 1];
}
for(int i = 0; i < n; i++){
... | ALGO | 0.999848 | 3.456946 |
2eb88cf7-3477-4edd-9ed6-f750d587e9f5 | Smit-Patel-2133/CPP | DSA/Linked list/reverse2.cpp | #include <bits/stdc++.h>
template <typename T>
class LinkedListNode
{
public:
T data;
LinkedListNode<T> *next;
LinkedListNode(T data)
{
this->data = data;
this->next = nullptr;
}
};
template <typename T>
LinkedListNode<T> *reverseLinkedList(LinkedListNode<T> *head)
{
if (head =... | ALGO | 0.999831 | 6.262414 |
9a1196ba-721f-4b11-85e7-e51dee008194 | ishandutta2007/codeforces | bmerry/normal/452/E.cpp | #include <bits/stdc++.h>
/*** TEMPLATE CODE STARTS HERE ***/
using namespace std;
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef complex<double> pnt;
typedef pair<int, int> pii;
#define RA(x) begin(x), end(x)
#define FE(i, x) for (auto i = begin(x); i != end(x); ++i)
#define SZ(x) ... | ALGO | 0.99983 | 3.985152 |
c2c2c725-c254-4ed0-b82f-f5a119fe64e5 | Abdel-koddous/CarND-Path-Planning-Project | src/Eigen-3.3/doc/examples/Tutorial_ArrayClass_accessors.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf m(2,2);
// assign some values coefficient by coefficient
m(0,0) = 1.0; m(0,1) = 2.0;
m(1,0) = 3.0; m(1,1) = m(0,1) + m(1,0);
// print values to standard output
cout << m << endl << endl;
... | ALGO | 0.937598 | 3.536336 |
a421be6e-9c4d-444b-96d6-82e2cf322330 | trietvuive/CF_Practice | CodeForces/old/1499A.cpp | #include<iostream>
using namespace std;
int main()
{
int cases;
cin >> cases;
while (cases--)
{
int n, a, b, black_small_edge;
cin >> n >> a >> b;
black_small_edge = n - max(a, b);
int white, black;
cin >> white >> black;
white -= min(a, b);
white -= abs(a - b) / 2;
black -= black_small_edge;
bl... | ALGO | 0.99952 | 3.44631 |
b20ad29a-9a23-4d1c-873e-959b6fc7a6b5 | GloWE3/raindrop-space-happiness | Source/ThirdParty/skia/src/gpu/graphite/render/PerEdgeAAQuadRenderStep.cpp | #include "src/gpu/graphite/render/PerEdgeAAQuadRenderStep.h"
#include "src/base/SkVx.h"
#include "src/core/SkRRectPriv.h"
#include "src/gpu/graphite/DrawParams.h"
#include "src/gpu/graphite/DrawWriter.h"
#include "src/gpu/graphite/render/CommonDepthStencilSettings.h"
// This RenderStep is specialized to draw filled r... | TOOL | 0.986898 | 7.779388 |
094fd446-fe0f-4198-81fd-275c569c7d79 | turneja123/competitive-programming-library | Problem/Math/Sum of Tetranacci Numbers.cpp | //https://www.spoj.com/problems/TETRAHRD/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define endl "\n"
#define ll long long
#define IOS ios_base::sync_with_stdio(false); cin.tie(nullptr);
long long M = 1e9 + 7;
vector<long long> mul(int n, vect... | ALGO | 0.999994 | 4.572242 |
bf4ffe66-3774-41a7-909a-d67ec9aeb760 | ls-jun/practice_the_Algorithm | Baekjoon/silver/11651.cpp | #include<bits/stdc++.h>
using namespace std;
bool comp(pair<int, int> a, pair<int, int> b){
if(a.second == b.second)
return a.first < b.first;
return a.second < b.second;
}
int main(){
int a,tmpa, tmpb ;
cin >>a;
vector<pair<int, int>> nums;
for(int i=0;i<a;i++){
cin >> tmpa>>... | ALGO | 0.999851 | 3.197412 |
e5482b77-5d29-4ebe-a65e-fa4a37bb723f | doorbash/andro7z | jni/CPP/7zip/UI/FileManager/PanelSort.cpp | // PanelSort.cpp
#include "StdAfx.h"
#include "Windows/PropVariant.h"
#include "../../PropID.h"
#include "Panel.h"
using namespace NWindows;
static UString GetExtension(const UString &name)
{
int dotPos = name.ReverseFind(L'.');
if (dotPos < 0)
return UString();
return name.Mid(dotPos);
}
static int CA... | TOOL | 0.969136 | 5.71551 |
44e046f5-ec88-4d84-8099-622801b302e9 | iHTCboy/iNetworkEngineering-Exercise | 1.1 C编程/2011/11/11.30/p2.cpp | # include <stdio.h>
int main ()
{
void sort(int array[],int n);
int i, a[10]={1,3,5,7,9,2,4,6,8,10};
sort(a,10);
printf("The sorted array:\n");
//printf("%d\n",a[0]);
for(i=0;i<10;i++)
printf("% d",a[i]);
printf("\n");
return 0;
}
void sort(int array[],int n)
{
int i,j,k,t;
for(i=0;i<... | ALGO | 0.99998 | 4.206921 |
f8f1cfcd-1fa4-4c88-969e-76ad8b6192e7 | A-stick-bug/DMOJ | New Year's '16 P7 - Old Christmas Lights.cpp | /*
* https://dmoj.ca/problem/year2016p7
* Precomputation trick with no updates
* - Compute the maximum possible `r` for each index `l`
* - This can be done with a sliding window + multiset
* - For each query, use a sparse table to find the maximum length interval
*
* TC: O(nlogn + qlogn)
*/
#include <bits/st... | ALGO | 0.999939 | 5.36596 |
a5d19b64-0e04-4cd0-afea-fe89888e992b | hyuneu-n/CPP | 230914.cpp | /*
//Ʈ 1 [ۼ Է¹ 3 ϱ]
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
printf("2022307022 \n");
int a;
int b;
int sum = 0;
// Է
printf("ۼ Էϼ >> ");
scanf_s("%d", &a);
// Է
printf(" Էϼ >> ");
scanf_s("%d", &b);
// 3
for (int i = a; i <= b; i++)
if (i % 3 == 0)
sum += i;
... | ALGO | 0.96594 | 3.204781 |
b4c9b19b-b925-494d-9ff5-addf941b1b57 | Paloquete/Sesion1_DavidPalomeque | Ejemplo12/main.cpp | #include <string.h>
#include <stdio.h>
#include <iostream>
using namespace std;
struct persona{
char nombre[30];
int edad;
long telefono;
};
void Escribir(persona p){ //paso por valor
cout << p.nombre << " tiene " << p.edad << " anos y su telefono es " <<p.telefono;
cout << endl;
}
void EscribirPuntero(persona*p)/... | TOOL | 0.918699 | 3.71244 |
258f1753-9777-4764-b0fe-274ce927ceb7 | enricole/SEIR | SEIR.cpp |
#include "SEIR.hpp"
// NOT SEIR_MODEL FUNCTIONS
//This function is needed to convert numbers under 1e-10 in to 0.0
double approx_zero(double value, double tolerance = 1e-10) {
if (std::abs(value) < tolerance) {
return 0.0;
} else {
return value;
}
}
//This function is needed to convert in int type the ... | ALGO | 0.999317 | 5.245074 |
8888947b-67a2-4a6d-b8e3-66b04a833889 | yuval2017/3DAnimation | ass3/igl/combine.cpp | template <
typename DerivedVV,
typename DerivedFF,
typename DerivedV,
typename DerivedF,
typename DerivedVsizes,
typename DerivedFsizes>
IGL_INLINE void igl::combine(
const std::vector<DerivedVV> & VV,
const std::vector<DerivedFF> & FF,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<De... | TOOL | 0.861776 | 5.802545 |
dfcc4012-0c59-4d7c-bb20-e7e8ab36b33e | mehdihasan010/E-Commerce-Product-Listing-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.998733 | 6.76775 |
8cd0ce35-5ee5-4e3b-aa24-b4b9f76e133b | ofZach/RTP_SFPC_FALL19 | sfpcContourProject/localAddons/ofxBox2d/libs/Box2D/Dynamics/Contacts/b2CircleContact.cpp | #include <Box2D/Dynamics/Contacts/b2CircleContact.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Collision/b2TimeOfImpact.h>
#include <new>
b2Contact* b2CircleContact::Create(b2Fixture*... | ALGO | 0.95905 | 6.984516 |
ab1ff955-7032-4d80-a62d-e1c5be5d48a8 | BtraRahul/LC-Problems | 0098-validate-binary-search-tree/0098-validate-binary-search-tree.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.999983 | 6.858603 |
942d4c2d-0db4-4bc7-8f8c-ba0ce3e209c3 | ishandutta2007/codeforces | oleh1421/normal/1458/C.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
typedef long long ll;
#define endl '\n'
using namespace std;
const int N=1019,L=20;
int a[N][N];
int x[N*N][3];
pair<int,int> val[3];
void solve(){
int n,m;cin>>n>>m;
int cnt=0;
for (int i=1;i<=n;i++){
fo... | ALGO | 0.999904 | 4.140889 |
cd8823d1-5fcc-4014-9078-bad8fff69363 | PriyankaWani66/Data_Structures | Recursion/Exponential.cpp | #include<iostream>
using namespace std;
int exp(int n)
{
//B.C
if(n==0)
{
return 1;
}
// Recursive Case: 2^n = 2 * 2^(n-1)
return 2*exp(n-1);
}
int main()
{
cout<<"Enter n: "<<endl;
int n;
cin>>n;
int ans = exp(n);
cout<<"2^n is : "<<ans<<endl;
} | ALGO | 0.99968 | 5.099219 |
1cb4afe2-eb91-4cf9-a97c-fe95a2b5fcb5 | Rodagui/UVa-Solutions | 576 - Haiku Review.cpp | /*576 - Haiku Review*/
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio();
cin.tie();
cout.tie();
string linea;
while(getline(cin, linea)){
if(linea == "e/o/i")
break;
vector <int> ans(3, 0);
int syllables = 0;
int line = 0;
bool antVowel = false;
for (in... | ALGO | 0.998264 | 3.051491 |
0934b982-0197-4738-96d3-f56299c5cc86 | ef1301/flutter-1 | budget_tracker/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.998698 | 6.785645 |
e7535ebe-b843-4099-b369-317c215ed974 | wuqiongjin/LeetCode | 剑指offer/剑指Offer II 31 最近最少使用缓存.cpp | class LRUCache {
public:
LRUCache(int capacity)
:_capacity(capacity)
{}
int get(int key) {
auto ret = hashMap.find(key);
if(ret != hashMap.end()){
auto it = ret->second; //对应LRUList位置的迭代器
LRUList.splice(LRUList.begin(), LRUList, it);
return... | ALGO | 0.999082 | 6.265029 |
4cd32a8a-71e3-4210-82ae-bc39c5a784e6 | MohamedIrfanAM/cp | dsa-sheet/2.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<vector<int>> generate(int numRows)
{
vector<vector<int>> res;
for (int i = 0; i < numRows; i++)
{
res.push_back({});
for (int j = 0; j <= i; j++)
{
if (j == 0 || j == i)
{
res[i].p... | ALGO | 0.999953 | 4.893046 |
675b1335-0fcb-4d20-83e6-3bd0c1682867 | realaltffourOldAccount/UVa-Judge | UVa-10300-Ecological-Problem/main.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(int argc, char **argv)
{
int n, f, a,b,c, sol = 0;
cin >> n;
while (n--)
{
cin >> f;
sol=0;
for (int i = 0; i < f; i++)
{
cin >> a >> b >> c;
sol += a * c;
}
cout << sol << endl;
}
return 0;
}
| ALGO | 0.993915 | 3.453322 |
a4754676-fe6e-4408-8f01-8d50c219f062 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_350_6.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1008611;
struct ST {
int i, j, l, r, mid;
vector<int> vv;
} st[maxn * 4];
int p1[maxn];
int p2[maxn];
int xx[maxn];
void bd(int d, int x, int y) {
st[d].i = x, st[d].j = y;
st[d].mid = (x + y) >> 1;
st[d].vv.clear();
for (int i = x; i <= y; i++)... | ALGO | 0.999954 | 4.235559 |
4f517e9c-6e84-431b-8e40-f780f130870a | TomLeeLive/cudgel | _CharAni_1/GbsCharacter/GCoreLibV2/map/GBspTree.cpp | #include ".\gbsptree.h"
bool GBspTree::Load( ID3D11Device* pd3dDevice, TCHAR* szFileName, bool Binary )
{
SAFE_NEW( m_pRootNode, GNode );
if( !m_BspParser.Load( GetDevice(), m_pRootNode, szFileName, Binary ) )
{
return false;
}
m_pRootNode->iNumPolygon = CalculateBox( &m_pRootNode->m_tBox, m_pRootNode->m_pSpl... | ALGO | 0.896283 | 3.088292 |
da2c28eb-0b5b-48d8-a3e7-3d3d26ce00c0 | Israt1063/phitron-cpp | C++ for DSA/F. Reversing.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n/2;i++)
{
swap(a[i], a[n - i - 1]);// array swap
}
for(int i=0;i<n;i++)
{
cout<<a[i]<<" ";
}
// i... | ALGO | 0.9999 | 3.633332 |
8baef166-a478-41c7-ac95-3754c9585ce1 | madalenaye/feup-aed-proj2 | classes/graph.cpp | #include "graph.h"
#include "supervisor.h"
/**
* Graph class constructor
* @param size - number of nodes
*/
Graph::Graph(int size) : nodes(size+1){
this->size = size;
}
/**
* Adds an edge from source to destination with an airline and distance\n\n
* <b>Complexity\n</b>
* <pre>
* <b>O(1)</b>
* </pre>
... | ALGO | 0.998568 | 5.775213 |
6ff47657-eca6-4417-adbd-a4dcd8825272 | cy12y/Problems | Codeforces/110A.cpp | #include <bits/stdc++.h>
using namespace std;
#define Anas() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main(){
Anas();
string s;cin>>s;
int cnt =0;
for (int i = 0; i < s.size(); ++i)
if(s[i]=='7' or s[i]=='4') cnt++;
if(cnt==7 or cnt ==4) cout<<"YES"<<endl;
else... | ALGO | 0.999175 | 3.841594 |
78c82719-18d9-4c34-b640-45c3509d794e | faterazer/LeetCode | 1736. Latest Time by Replacing Hidden Digits/Solution.cpp | #include <string>
using namespace std;
class Solution
{
public:
string maximumTime(string time)
{
for (size_t i = 0; i < time.size(); i++) {
if (time[i] != '?')
continue;
if (i == 0)
time[i] = (time[i + 1] == '?' || time[i + 1] - '0' < 4) ? '2' : ... | ALGO | 0.999956 | 5.92207 |
c7a88242-7c83-4052-81ca-4d3cf7a92d17 | Ashishkubehera/300-days-challenge | sum of deepest values in binary tree.cpp | ✔️ Solution - I (DFS Traversal)
We can do a simple Depth-First Traversal on the Tree. We maintain sum which will store sum of deepest leaves and deepest which will be the depth of the deepest nodes. There will be following cases available to us where current Node is -
Not a Leaf Node - Traverse the left and right nod... | ALGO | 0.999995 | 6.770653 |
43250e2e-d4f6-4fbd-bf98-909058b61253 | ychin/EAWebKit | WebCore/rendering/InlineTextBox.cpp | #include "config.h"
#include "InlineTextBox.h"
#include "Chrome.h"
#include "ChromeClient.h"
#include "DashArray.h"
#include "Document.h"
#include "DocumentMarkerController.h"
#include "Editor.h"
#include "EllipsisBox.h"
#include "Frame.h"
#include "GraphicsContext.h"
#include "HitTestResult.h"
#include "ImageBuffer.h... | TOOL | 0.891204 | 7.937068 |
ac142fb2-83ad-48c6-867b-5914afa79f5a | Bartek-19/Materialy-edukacyjne | 5.SE.1 Zaawansowane Programowanie Obiektowe w C++/Klimiuk_Bartosz_5.6_Lab5_Zad3/main.cpp | #include <iostream>
#include <map>
#include <string>
using namespace std;
char dodatkowyZnak(const string& str1, const string& str2) {
map<char, int> charCount;
for (char c : str1)
charCount[c]++;
for (char c : str2)
charCount[c]--;
for (const auto& entry : charCount)
if (entry... | ALGO | 0.999829 | 4.886286 |
0dbefdbf-a3fb-4227-b830-36c26736e44a | Kanikawadhwa28/dailypractice | 0684-redundant-connection/0684-redundant-connection.cpp | class Solution {
public:
bool dfs(unordered_map<int,vector<int>>& adj,int u,int v, vector<bool>& visited){
visited[u]= true;
if(u==v) return true;
for(int i :adj[u]){
if(visited[i]) continue;
if(dfs(adj,i,v,visited)) return true;
}
return false;
... | ALGO | 0.99992 | 5.817836 |
67eccb9d-ecc7-48f7-99d6-e0d8afee5a56 | juneLLIM/PS | BOJ/Stage/23_DynamicProgramming2/7579_SavingMemories.cpp | #include <stdio.h>
main(){
int n,m,i,j,x,MAX=10001;
scanf("%d%d",&n,&m);
int mem[n],dp[MAX]={};
for(i=0;i<n;i++) scanf("%d",&mem[i]);
for(i=0;i<n;i++) {
scanf("%d",&x);
for(j=MAX-1;j>=x;j--) if(dp[j]<dp[j-x] + mem[i]) dp[j] = dp[j-x] + mem[i];
}
for(i=0;i<=MAX;i++) {
... | ALGO | 0.999993 | 3.070795 |
bb941749-fd5f-4a82-8a83-f75180c0f3c2 | ELVIS-Project/VISIntervalSonifier | SuperCollider-Source/ELVISon/server/plugins/PartitionedConvolution.cpp | //Partitioned Convolution, Nick Collins mid October 2008
//PartConv(in, fftsize, irbufnum, accumbufnum)
#include "FFT_UGens.h"
#include <stdio.h>
struct PartConv : public Unit {
int m_counter;
uint32 m_specbufnumcheck;
float* m_fd_accumulate; //will be exactly fftsize*frames in size
float * m_irspectra;
int m_f... | ALGO | 0.965111 | 4.099914 |
c988b4e7-a636-490f-9435-32b422ac1e53 | LeeJJason/OpenGL | Project/src/1.getting_started/5.2.transformations_exercise1/transformations_exercise1.cpp | int main()
{
[...]
while(!glfwWindowShouldClose(window))
{
[...]
// create transformations
glm::mat4 transform = glm::mat4(1.0f);
transform = glm::rotate(transform, (float)glfwGetTime(), glm::vec3(0.0f, 0.0f, 1.0f)); // switched the order
transform = glm::tran... | ALGO | 0.971208 | 6.76322 |
a42d5893-1858-4c4b-821d-4d1f736f963b | shuvokr/Solution_for_UVA_OnlineJudge_Problems | 12708.cpp | #include <stdio.h>
int main()
{
long long n;
int T;
scanf("%d", &T);
while( T-- )
{
scanf("%lld", &n);
printf("%lld\n", n / 2);
}
return 0;
}
| ALGO | 0.999645 | 4.086622 |
ab77e104-5469-47ab-9cd5-b58003b30502 | raincross7/code-similarity | codes/train_code/problem319/problem319_490.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll... | ALGO | 0.999325 | 3.342059 |
14118648-4c63-4c53-b716-2d67fbfdb0d8 | kmjp/procon | leetcode/201-250/240/1856.cpp | typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) me... | ALGO | 0.999987 | 4.375896 |
ba2ccdcc-21da-4ec2-a592-1ba0c7cc525a | albertomontesg/algorithms-lab | exercises/octopussy/octopussy.cpp |
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
long find_minimum_time(vector<long> &t, long pos) {
if (pos == 0) {
return t[pos];
}
long upper_pos = (pos % 2 == 1) ? (pos - 1) / 2 : (pos - 2) / 2;
long next_pos = (pos % 2 == 1) ? pos + 1 : pos... | ALGO | 0.999971 | 4.775401 |
4d495ad2-c65d-419e-ae01-803ad467ae3a | ishandutta2007/codeforces | mhq/normal/1753/A2.cpp | #ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int maxN = 5e5 + 10;
int n;
int a[maxN];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
#ifdef DEBUG
freopen("input.txt",... | ALGO | 0.999017 | 3.775873 |
f8175377-df53-4778-b270-9373a4612bf2 | TheCenturiaGames/Sobrassada_Engine | SobrassadaEngine/Libs/bullet/include/BulletDynamics/Featherstone/btMultiBodyFixedConstraint.cpp | ///This file was written by Erwin Coumans
#include "btMultiBodyFixedConstraint.h"
#include "btMultiBodyLinkCollider.h"
#include "BulletDynamics/Dynamics/btRigidBody.h"
#include "BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.h"
#include "LinearMath/btIDebugDraw.h"
#define BTMBFIXEDCONSTRAINT_DIM 6
bt... | TOOL | 0.857987 | 7.591651 |
bec5300d-72c1-4ba1-bbf2-4ab6f9e70dd2 | Kporras21/Proyecto- | DiscosCpp/discos.cpp | #include "discos.hpp"
#include <cmath>
#include <algorithm>
// Constructor
Disco::Disco(double x_position, double y_position, double radio, const std::string& color, double Vx, double Vy)
: x_position(x_position), y_position(y_position), radio(radio), color(color), Vx(Vx), Vy(Vy) {
x_positions.push_back(x_posi... | ALGO | 0.956776 | 5.817711 |
7952ff40-7d1e-4e17-98bc-c04487399485 | Ouan2551/POSN-Computer | work study posn/2.work-c++/morning test/6.average.cpp | #include <bits/stdc++.h>
using namespace std;
int main () {
int n, num;
double sum;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> num;
sum += num;
}
cout << fixed << setprecision(2) << sum/n;
} | ALGO | 0.998855 | 4.205079 |
bed146f5-abcc-41b2-88a7-b374b197a96a | QuinBis/Labs | ASD_Lab2/Library.cpp | #include <iostream>
#include <vector>
#include "Header.h"
int occurrence(std::string word, std::string text,int* table, int start = 0, int end = INT_MAX) {
int lengthWord = word.length(),
lengthText = text.length(),
i = start + lengthWord - 1,
j = lengthWord - 1,
k = i;
int occurrence;
// Find all occur... | ALGO | 0.999908 | 5.151722 |
98c35082-4564-4447-ab84-6c259bc3db34 | craciunoiuc/algorithm-design | Graph Algorithms/src/p3.cpp | // Functia ruleaza un dijkstra din nodul 1 pana in n si apoi verifica daca
// exista schimbari de tipuri de muchii si le marcheaza adaugandu-le intr-un
// vector. La final calculeaza penalizarea adaugata si o returneaza.
int64_t dijkstra(int64_t source, int64_t n,
const std::vector<std::vector<std::tuple<int64_t, int64... | ALGO | 0.999513 | 5.716705 |
8889aaef-2ebe-43ee-8a22-217d9d002d0b | ishandutta2007/codeforces | tute7627/normal/1487/A.cpp | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define P... | ALGO | 0.999716 | 4.257596 |
71b610fa-ddf3-46e7-9adb-25c941a8257a | ishandutta2007/codeforces | fsouza/normal/498/C.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#define MAXN 100
#define INF 1000000000
using namespace std;
int v[MAXN];
vector<int> adj[MAXN+2];
int mark[MAXN+2];
int caps[MAXN+2][MAXN+2];
int dfs(int v, int t, int n... | ALGO | 0.999743 | 3.697874 |
ce1c5eea-48a4-4ffe-9841-27319b821494 | alexandraback/datacollection | solutions_5766201229705216_1/C++/cedriclin/b.cpp | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int n;
vector<int> graph[1024];
vector<int> children[1024];
int parent[1024];
bool visited[1024];
int num[1024]; //returns # of nodes in the subtree rooted by the index
int delcnt[1024]; // returns # of nodes required to delete in the sub... | ALGO | 0.999603 | 4.851655 |
15a38029-a08c-4d60-8bdf-a46dbefb9d48 | ishandutta2007/codeforces | climpet/normal/297/B.cpp | #include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include ... | ALGO | 0.999993 | 3.627101 |
6dc627aa-cbc1-4dbc-91f4-4a6631d04d07 | FloatingcloudKnight/LlaMa | midend/lib/Utils/Utils.cpp | #ifndef UTILS_UTILS_DEF
#define UTILS_UTILS_DEF
#include <mlir/Dialect/Affine/IR/AffineOps.h>
#include <mlir/Dialect/Affine/IR/AffineValueMap.h>
#include <mlir/Dialect/Arith/IR/Arith.h>
#include <mlir/Dialect/Math/IR/Math.h>
#include <mlir/Dialect/MemRef/IR/MemRef.h>
#include <mlir/Dialect/SCF/IR/SCF.h>
#include <mlir... | TOOL | 0.951201 | 6.497048 |
d2194a4f-47c2-458b-b536-fbfc6988961c | zeynepozcelk/42-exam2 | c 02/max.cpp | #include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int max(int* tab, unsigned int len)
{
unsigned int i = 0;
int max;
if(!tab)
return (0);
max = tab[i];
while(i < len)
{
if(tab[i] > max)
{
max = tab[i];
}
i++;
}
return (max);
}
int main()
{
int arr[] = {4,6,2,8};
printf("%d",max(ar... | ALGO | 0.995745 | 4.136858 |
1a835a4b-cc6e-40be-ad85-71486f511f32 | atrainag/code-repo | Atcoder/ABC251/B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <utility>
#include <cmath>
#include <iomanip>
#include <map>
#include <stack>
#include <string>
#define all(x) x.begin(),x.end()
#define last(x) x.size()-1
#define ll long long
#define vi vector<int>
#define pi pair<int,int>
#define m... | ALGO | 0.999986 | 4.055833 |
c5e42405-af09-4366-ab02-8f20eeb817bf | ckdgus0505/ACM | dongseoki/Dijkstra Algorithm_Bellman Ford/Dijkstra Algorithm_Bellman Ford/tree_and_color_15899.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
int N;
int M;
int C;
int anss; // answers .
vector<vector<pair<int, int>>> memo(200000);
vector<vector<int>> al(200000);//adjacent list Ʈ ظ.
vector<int> tc; // 츰 ε 0 Ŵ.tree color .
vector<bool> visited(200000, false);... | ALGO | 0.999979 | 4.089088 |
72d03158-3407-4f0a-a138-ff96908aa2cc | CrystalLincolndt/FHE_Demo | FHE_demo/src/fheroes2/system/fh2_win32.cpp | #include <vector>
#include <string>
#ifdef WIN32
#include "dir.h"
#include <Windows.h>
std::vector<std::string> extractArgsVector(int argc, char** argv)
{
int nArgs;
std::wstring commandLine = GetCommandLineW();
LPWSTR* szArglist = CommandLineToArgvW(commandLine.c_str(), &nArgs);
std::vector<std::st... | TOOL | 0.93558 | 4.409508 |
4e8106ed-5346-401e-bafe-654c624857a6 | NonnaKwon/Algorithm | 프로그래머스/unrated/181829. 이차원 배열 대각선 순회하기/이차원 배열 대각선 순회하기.cpp | #include <string>
#include <vector>
using namespace std;
int solution(vector<vector<int>> board, int k) {
int answer = 0;
for(int i=0;i<board.size();i++)
{
for(int j=0;j<board[i].size();j++)
{
if(i+j <= k)
answer += board[i][j];
}
}
return answer... | ALGO | 0.99956 | 5.346118 |
b893d846-050e-4dd4-a311-373a2029e773 | adit2005/LEETCODE-CPP-DSA-QUESTIONS | 1422-divide-array-in-sets-of-k-consecutive-numbers/divide-array-in-sets-of-k-consecutive-numbers.cpp | class Solution {
public:
bool isPossibleDivide(vector<int>& nums, int k) {
if (nums.size() % k != 0) {
return false;
}
unordered_map<int,int> map;
for (int num : nums) {
map[num]++;
}
sort(nums.begin(), nums.end());
... | ALGO | 0.999954 | 5.638521 |
9a1019d1-998b-40d5-aa69-50c65db33b10 | Priyo002/DSA | A2OJ/Ratings_below-1300/Difficulty-level-2/System_of_Equation.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("inputf.in", "r", stdin);
freopen("outputf.in", "w", stdout);
#endif
int n, m;
cin >> n >> m;
int cnt = 0;
for (int i = 0; i <= max(n, m); i++) {
int a2 = n - i;
int a = m - (i * i);
if (a < 0) continue;
if (a2 == (a... | ALGO | 0.99989 | 3.506207 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.