uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4c7b932e-63f2-4396-baf3-5becc4366f99 | SquidwardOV/Structrure-of-dannie | BitreePoisk.cpp | BiTree.h
#pragma once
#include <iostream>
#include <time.h>
#include <Windows.h>
#include <conio.h>
#include <stdio.h>
#include "compare_string.h"
enum ColorConsole {
Blue = 1,
Green = 2,
Read = 12,
White = 7
};
class Node {
public:
std::string date;
std::string color;
int score;
No... | ALGO | 0.994164 | 5.53129 |
008a5cd6-51e6-4a57-8556-a6adb3123cea | Abhishekraj276/75-days-question | maximum subarray.cpp | #include <stdio.h>
int maxSubArray(int* nums, int numsSize) {
if (numsSize == 0) {
return 0;
}
int maxSum = nums[0];
int currentSum = nums[0];
for (int i = 1; i < numsSize; i++) {
currentSum = (nums[i] > currentSum + nums[i]) ? nums[i] : currentSum + nums[i];
maxSum = (max... | ALGO | 0.999975 | 6.325033 |
0029b057-2872-4054-9a89-6681467bdf38 | AlexiaDucreay/2143-OOP-Ducreay | Assignments/HO2/main.cpp | //## H01 - Commenting Code
//### Alexia Ducreay
//### Description:
//This program implements a list data structure that links together nodes of integers.
//### Files
//| # | File | Description |
//| :---: | -------- | -------------------------------- |
//| 1 | main.cpp | Main driver ... | ALGO | 0.986545 | 4.453852 |
e3d7870c-7e12-49ca-a89a-ada0f6d13949 | draperlaboratory/hope-llvm-project | lldb/packages/Python/lldbsuite/test/commands/command/script/main.cpp | #include <cstdlib>
#include <cstring>
#include <string>
#include <fstream>
#include <iostream>
int
product (int x, int y)
{
int result = x * y;
return result;
}
int
sum (int a, int b)
{
int result = a + b;
return result;
}
int
strange_max (int m, int n)
{
if (m > n)
return m;
else if ... | ALGO | 0.993207 | 4.093703 |
7b316e42-1872-4894-b6cf-96828c5eaa3b | himanshu-10/GFG-Questions | 0118-pascals-triangle/0118-pascals-triangle.cpp | class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> ans(numRows);
for(int i =0;i<numRows;i++){
// step1: resize the array in every new row i.e increase by 1
ans[i].resize(i+1);
// step2: initialize the 1st and last value to ... | ALGO | 0.999989 | 6.012884 |
8f00634e-d392-4dc1-92fe-d81ff10bef39 | litmusos-mirror/frameworks_av | media/codecs/amrnb/dec/src/dec_lag3.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/dec_lag3.c
Functions: Dec_lag3
Date: 01/31/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description:
(1) Updated to accept new parameter... | ALGO | 0.99985 | 7.141468 |
637033ed-6a32-4d0c-9633-8ed0576581ad | akairisu/NTUCSIE-JudgeGirl | Exam/Week 8/Loops/testmain.cpp | #include <stdio.h>
#include <stdlib.h>
#define MAXN 1000000
int visited[1000000];
int count[1000000];
int Bpoint[1000000];
void loops(int N, int *A, int *B[], int ans[4]){
int check = 0;
int start;
int counter = 0;
int maxlength = 0;
int maxnumber = 0;
int minlength = N + 1;
int minnumbe... | ALGO | 0.999934 | 3.084482 |
8fd7462a-67c9-4cf2-ad53-c770865864d5 | yitianhao/gpu_sched_new | gpu-sched-centralcontrol/minor/boost_1_61_0/libs/graph/example/matching_example.cpp | #include <boost/graph/max_cardinality_matching.hpp>
using namespace boost;
typedef adjacency_list<vecS, vecS, undirectedS> my_graph;
int main()
{
// Create the following graph: (it'll look better when output
// to the terminal in a fixed width font...)
const int n_vertices = 18;
std::vector<std::string> ... | ALGO | 0.99768 | 6.274728 |
82db566c-c85b-4782-b91c-c4741d16474b | abdelaleem024/competitive-programming | Material/Juniors Phase 2/SegmenTree/Codeforces Edu/Part #1/Setp #1/B - Segment Tree for the Minimum.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
struct SegmentTree {
private:
int sz, ignored;
vector<int> seg;
int op(int a, int b) {
return min(a, b);
}
void update(int i, int v, int x, int lx, int rx) {
if (lx == rx) {
seg[x] = v;
return;
}
int m = (rx + ... | ALGO | 0.999935 | 4.967623 |
3c07e29a-ac63-44e1-8d72-2e62b3709f94 | Parihar07/DSA | DungeonPrincess/dp.cpp | #include<iostream>
#include<vector>
using namespace std;
int calculateMinimumHP(vector<vector<int> >& A);
int calculateMinimumHPHelper(vector<vector<int> >& A, int i, int j, int M, int N);
int calculateMinimumHPHelperDP(vector<vector<int> >& A, vector<vector<int> >& dp, int i, int j, int M, int N);
int calculateMinim... | ALGO | 0.999774 | 3.995089 |
1b351942-1fd5-4437-817c-3b22aa1a7ea4 | LargerPanda/luminous | src/boost/libs/graph/example/roget_components.cpp | #include <stdio.h>
#include <iostream>
#include <boost/graph/stanford_graph.hpp>
#include <boost/graph/strong_components.hpp>
#define specs(v) \
(filename ? index_map[v] : v->cat_no) << " " << v->name
int main(int argc, char* argv[])
{
using namespace boost;
Graph* g;
typedef graph_traits<Graph*>::vertex_descr... | ALGO | 0.9984 | 4.802451 |
a7c05ac8-23c5-47f3-b1d7-1a2eebb39fa4 | TimurZheksimbaev/Linear-Algebra | CholeskyDecomposition.cpp | #include<iomanip>
#include<iostream>
#include<cfloat>
#include<cmath>
using namespace std;
class SymmetricMatrix {
public:
int n, m;
int d = 1.0;
double matrix[100][100];
SymmetricMatrix(int row, int column) {
this->n = row;
this->m = column;
}
SymmetricMatrix operator+(Symme... | ALGO | 0.999683 | 3.146735 |
c64adbd0-96c2-403e-b059-211c52456c11 | redwanh25/cpp | recursion/code/fibonacci imp.cpp | #include<bits/stdc++.h>
using namespace std;
int fibo[50];
int fib(int n)
{
cout<< n <<" - " << endl;
if(fibo[n]!=0)
return fibo[n];
// if(n<3)
// return fibo[n];
cout<< n <<" + " << endl;
fibo[n] = fib(n-1) + fib(n-2);
cout << fibo[n] << " res " << endl;
cout<< n <<" * " << en... | ALGO | 0.999921 | 3.368671 |
fcac7825-0573-4b46-8501-9795441e3962 | VTharakaRam/Cpp-Dsa | c++/Constants, Manipulators & Operator Precedence.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(){
//*************************Constants in C++************************
int a=34;
cout <<"the value of a is "<<a<<endl;
a=45;
cout <<"the value a is "<<a<<endl;
// as we see above that same a has printing different values
// to avoid this we... | TOOL | 0.893202 | 3.646107 |
18117182-1655-4570-9c80-3f49b1bc2f84 | HN026/CAlgo | String/SortTheJumbledNumbers.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
using namespace std;
class Solution {
public:
vector<int> sortJumbled(vector<int> &mapping, vector<int> &nums) {
vector<int> mappedOrder(nums.size());
for (int i = 0; i < nums.size(); i++) {
... | ALGO | 0.999897 | 6.258063 |
576e0f49-5ea3-42a0-bae9-66259099931f | SUMEG-04/C | c++Question_01.cpp | //Program to compute the sum of the first n terms of the following series:
//S=1-1/(2*2)+1/(3/3)-...1/(n*n)
#include<iostream>
using namespace std;
//function to convert String argument into integer
int string_to_int(char* str){
int x,i;
for(x=0,i=0;str[i];i++){
if(str[i]>='0'&&str[i]<='9'){
x=x*10+(str[i... | ALGO | 0.998886 | 3.660873 |
42d14b21-258d-436c-937a-5b1ec688ec86 | DEPTH-STRIDA/laboratory-work-of-the-data-structure | Переполнение стека массивом.cpp | #include <iostream>
using namespace std;
int n = 0;
void print(int n) {
char array[10000];
cout << n << " ";
n++;
print(n);
}
int main() {
print(n);
return 0;
} | ALGO | 0.999306 | 3.967606 |
5fd13ac7-853c-48c4-8c71-91c761e5a23a | miharu1414/Atcoder | AtCoder/ABC/ABC220/b.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <stdexcept>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long,long long>;
using vec = vector<int>;
using vecll = vector<long long>;
using mat = vector<vector<int>>;
using matll = vector<vector<l... | ALGO | 0.999933 | 4.490608 |
b963d1af-c094-4f75-90ff-9f716d0e1476 | bitcoin-dev-tools/runs-on-testing | src/wallet/test/fuzz/coinselection.cpp | #include <policy/feerate.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <test/util/setup_common.h>
#include <wallet/coinselection.h>
#include <numeric>
#include <vector>
namespace wallet {
st... | TEST | 0.995992 | 3.528682 |
44382653-de1b-4bd7-a99c-dda601852212 | AreYouKhush/dsa-cpp | C++ DSA/Array Qustions/open_the_lock.cpp | #include<bits/stdc++.h>
using namespace std;
int openLock(vector<string>& deadends, string target) {
unordered_set<string> deadendSet(deadends.begin(), deadends.end());
if (deadendSet.count("0000")) {
return -1;
}
queue<pair<string, int>> queue;
queue.push({"0000", 0});
unordered_s... | ALGO | 0.999939 | 6.163218 |
2a925d88-d570-4f08-b8ed-7d44e88cc065 | jmvalois/Sherlock_Compilation | SRC_old/reliability/analysis/analysis/UnivariateDecomposition.cpp | //
// Written by Quan Gu UCSD
//
#include "UnivariateDecomposition.h"
//#include <fstream.h>
#include <math.h>
UnivariateDecomposition::UnivariateDecomposition( int pNumAxis, /*Vector * pGradient,*/ PrincipalAxis ** pPrincipalAxes, bool pIsTimeVariant) // numAxes is the number of principalAxes+1
{
numAxes = pNu... | ALGO | 0.919037 | 3.631691 |
386be375-bcd3-4094-ae7d-5db2d8c8552c | ozner77/ozner | Codeforces/Codeforces_Round1027(Participado)/B_Not_Quite_a_Palindromic_String.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
typedef tree<int, null_type, less<int>... | ALGO | 0.999928 | 4.226417 |
b5886dc5-ce2f-4e37-999c-a64234afb28a | ZhenyuLiu46/os-lab3-nyu | pager.cpp | #include <stdio.h>
#include <iostream>
#include <fstream>
#include <climits>
#include "pager.h"
using namespace std;
frame* FIFO::select_victim_frame(frame_table* frametable, vector<Process*> processes, unsigned long instructionidx){
if(frame_list.size() == 0) return nullptr;
frame* frame = frame_list.front(... | ALGO | 0.995183 | 3.637027 |
8f149d4a-06c2-4803-a721-79af3eb8ec47 | ayk-dev/CPP_Basics | ForLoop/HalfSumElement/HalfSumElement.cpp | // HalfSumElement.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int sum = 0;
int max_element = 0;
for (int i = 0; i < n; i++) {
int number;
cin >> number;
... | ALGO | 0.999983 | 4.694599 |
77912293-b6cc-40ed-abe2-c25e209057d8 | eyupece/cpp-my-projects | Mersenne prime.cpp | #include <iostream>
using namespace std;
// Mersenne Sayısı = 2^n - 1
/*
mersenne(4) = mersenne(3)*2 + 1
mersenne(3) = mersenne(2)*2 + 1
mersenne(2) = mersenne(1)*2 + 1
*/
int mersenne(int n) {
if (n == 0)
return 0;
return mersenne(n - 1) * 2 + 1;
}
int main() {
int howMany =0;
cout << "how many Mersenne Numb... | ALGO | 0.999417 | 4.481231 |
c029bc54-09cc-4213-81c8-f5f7fcd5b2c2 | sicongyu/Unreal-Lightmass-SH-based-GI | Engine/Source/ThirdParty/nvTextureTools/nvTextureTools-2.0.8/src/src/nvmath/Montecarlo.cpp | // This code is in the public domain -- <EMAIL>
#include <nvmath/Montecarlo.h>
using namespace nv;
void SampleDistribution::redistribute(Method method/*=Method_NRook*/, Distribution dist/*=Distribution_Cosine*/)
{
switch(method)
{
case Method_Random:
redistributeRandom(dist);
break;
case Method_Stratifi... | ALGO | 0.999291 | 5.538893 |
8c9a55c4-fec1-44ab-88c6-1819c999115c | xxcosmos/MyCPPAlgorithm | WoodenSticks/WoodenSticks.cpp | //
// Created by 张啸宇 on 2019-04-22.
//
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
struct node {
int len, w;
} wood[5002];
bool operator<(const node &l, const node &r) {
return (l.len < r.len) || (l.len == r.len && l.w < r.w);
}
int flag[5002];
int wooden_sticks() {
... | ALGO | 0.999941 | 4.142652 |
c95a271a-8d4f-440c-b162-879eb1e82da9 | ylyking/UnrealEngineNiv | Engine/Source/ThirdParty/IntelEmbree/Embree2140/src/common/algorithms/parallel_sort.cpp | #include "parallel_sort.h"
#include "../sys/regression.h"
namespace embree
{
template<typename Key>
struct RadixSortRegressionTest : public RegressionTest
{
RadixSortRegressionTest(const char* name) : RegressionTest(name) {
registerRegressionTest(this);
}
bool run ()
{
bool passe... | TEST | 0.900425 | 6.641005 |
c7d42522-48b5-4e8e-8e62-59a931da927b | Meghana-sk/DSA-Cpp | Pattern-Questions/invertedTriangleWithNumberPattern1.cpp | /*
------------------------------------
Print
1111
222
33
4
------------------------------------
*/
#include <iostream>
using namespace std;
int main(){
int n;
cout << "enter n" << endl;
cin >> n;
for(int i = 1; i <= n;i++){
for(int j = 1;j < i;j++) {
cout << " ";
}
for (int j = i;j <= ... | ALGO | 0.999962 | 4.091552 |
6c427e53-10ea-4830-aaa1-89e55446242a | junhochoi-dev/algorithm | [PS]BOJ/10000_19999/14000_14999/14264/boj14264.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
double num;
cin >> num;
cout << fixed;
cout.precision(10);
cout << pow(num, 2) * sqrt(3) / 4 << endl;
return 0;
} | ALGO | 0.999679 | 3.53997 |
4d3c8808-9aab-4350-b717-ea0f841174ac | lovelyoverflow/2023MORAIContest | src/navigation/base_local_planner/src/point_grid.cpp | #include <base_local_planner/point_grid.h>
#include <ros/console.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <math.h>
#include <cstdio>
#include <sensor_msgs/point_cloud2_iterator.h>
using namespace std;
using namespace costmap_2d;
namespace base_local_planner {
PointGrid::PointGrid(double size_... | ALGO | 0.994244 | 5.886246 |
959915d0-5319-4509-bb8a-b26c42feedae | SangHunHan92/SensorsCalibration | SensorX2car/radar2car/eigen3/doc/examples/Tutorial_PartialLU_solve.cpp | #include <Eigen/Core>
#include <Eigen/LU>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
Vector3f b;
A << 1,2,3, 4,5,6, 7,8,10;
b << 3, 3, 4;
cout << "Here is the matrix A:" << endl << A << endl;
cout << "Here is the vector b:" << endl << b << endl;
Vec... | ALGO | 0.999906 | 3.142099 |
8ab6f9d2-78bf-46e4-a50b-ca3067c7c0aa | alexandraback/datacollection | solutions_5630113748090880_0/C++/abyssmally/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define fo(i,a,b) for (int i = (a); i < (b); i++)
int cases;
int c[2555];
int main() {
freopen("b.in", "r", stdin);
freopen("b.out", "w", stdout);
scanf("%d", &cases);
fo(_case,1,cases+1) {
printf("Case #%d: ", _case);
int n;
fo(i,0,2555) c[i] = 0;
scanf("%d", ... | ALGO | 0.99929 | 3.97782 |
1cdb0d26-3454-42d4-a5dd-7755d0df5116 | kxxian/flutterdart_cookbook | chapter_11/horizontal_listview/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.998704 | 6.785645 |
e825bb99-c15d-4cef-81f6-a35784c0ed9b | Adarsh-1806/Learning | Operators/let_us_understand_computer.cpp | // Problem
// https://www.hackerearth.com/practice/basic-programming/operators/basics-of-operators/practice-problems/algorithm/let-us-understand-computer-78476e7a/
#include<bits/stdc++.h>
using namespace std;
int bitcount(int n){
int res = 0;
while(n>0){
res++;
n>>= 1;
}
return res;
}
int main() {
int t;
c... | ALGO | 0.999965 | 4.338403 |
8c2e0704-8d09-4df1-91e1-5c6342aac4c5 | NarayaneRM/Brazilian-Olympiad-in-Informatics | 2021/fase01/torneio_de_tenis/main.cpp | #include <iostream>
using namespace std;
int main() {
int i;
char partida;
int vencidas=0;
int perdidas=0;
int grupo;
for(i=0;i<6;i++){
cin>>partida;
if(partida=='V'){
vencidas+=1;
}
else if(partida=='P'){
perdidas+=1;
}
}
if (vencidas==0){
grupo=-1;
}
else if ... | ALGO | 0.999847 | 3.824589 |
36d4f436-2ed7-4094-8751-bae87dc28d94 | Superm4n97/competetive-programming | Codeforces vol 04/1569B.cpp | #include<bits/stdc++.h>
#define ll long long int
#define show(x) cout << #x << " : " << x << endl
using namespace std;
int main()
{
int tc;
cin >> tc;
while(tc--){
ll n;
cin >> n;
string s;
cin >> s;
string X[n+5];
vector<ll> ... | ALGO | 0.999544 | 3.77986 |
aeb1310d-b936-43df-856a-4221f7d95b0f | Swapno963/Phitron-Batch-3 | Competative_topic/Prifix_sum/of_2d_matrix.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
const lld pi = 3.14159265358979323846;
#defi... | ALGO | 0.999903 | 3.356995 |
b6c14b1b-a0d8-4834-9de9-e1fe7797804a | BingyuZhou/Algorithm | path_sum/solve.cpp | #include <algorithm>
#include <stack>
#include <unordered_map>
#include "../tree_traversal/node.h"
using namespace std;
class is_path_sum
{
bool exist = false;
int m_sum;
public:
is_path_sum(){};
bool solve(TreeNode *root, int sum)
{
stack<TreeNode *> s;
s.push(root);
uno... | ALGO | 0.999983 | 5.904447 |
6caa7dba-5d72-45ff-a8f8-5bf2612e1197 | prashjha/PeriDEM | test/test_exec/nsearch/testNSearchLib.cpp | #include "testNSearchLib.h"
#include "nsearch/nsearch.h"
#include "util/function.h"
#include "util/matrix.h"
#include "util/methods.h"
#include "util/point.h"
#include "util/randomDist.h"
#include "util/parallelUtil.h"
#include <fmt/format.h>
#include <bitset>
#include <fstream>
#include <iostream>
#include <random>
#i... | TEST | 0.995055 | 6.74605 |
f386ca13-3f2f-4bbf-b48a-9f4c8816fdb1 | tlsgkdns/study | BfsAndDfs/2573_iceberg.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, m, t = 0, ans = 0;
int iceberg[301][301];
int dx[4] = { 1, -1, 0, 0 };
int dy[4] = { 0, 0, 1, -1 };
vector<vector<bool>> sea;
void dfs(vector<vector<bool>>& v, int y, int x)
{
for (int i = 0; i < 4; i++)
{
int ny = y + dy[i];
... | ALGO | 0.999761 | 4.346705 |
ed6765b2-e391-4079-8e3f-d58c82ef35fa | sv1811/Dataset-Eval | Leetcode/Medium/p2-addTwoNumbers/sol3.cpp |
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
ListNode* temp=new ListNode;
ListNode* ans=temp;
int carry=0;
while(l1!=nullptr&&l2!=nullptr){
int t=l1->val+l2->val+carry;
carry=0;
if(t/10) carry=1;
t=t%1... | ALGO | 0.999946 | 6.013086 |
94be2ab5-ee0a-4c77-b347-42a43f9695fe | ishandutta2007/codeforces | sdya/normal/11/A.cpp | #include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <cstring>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
long long n, d;
long long a[10000];
int main()
{
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
... | ALGO | 0.99963 | 3.160896 |
9160a89a-9b30-4ed1-9b6c-dadfd66f1c25 | whosxavierwu/LeetCodeSolution | SearchInArray/leetcode_33.cpp | // leetcode_33.cpp : This file contains the 'main' function. Program execution begins and ends there.
// https://leetcode.com/problems/search-in-rotated-sorted-array/
/*
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).
... | ALGO | 0.999996 | 6.33246 |
e7380187-7866-4127-90a2-888ef6a3ff74 | tipu72/Learning | Prateek Advanced Course Code/Coding Exercise Solutions/One Integer.cpp | #include<bits/stdc++.h>
using namespace std;
int solve(vector<int> nums) {
priority_queue<int, vector<int>, greater<int>> pq;
int ans = 0;
for (int i = 0; i < nums.size(); i++) {
pq.push(nums[i]);
}
int a, b, sum;
while (pq.size() > 1) {
a = pq.top();
pq.pop();
b... | ALGO | 0.999985 | 4.742979 |
e9ad4e46-5075-4a97-8904-94805f3e89d3 | AnimezKishan/Data-Structures-and-Algorithm-Preparation | LeetCode/Heap/[C++] 2406. Divide Intervals Into Minimum Number of Groups.cpp | class Solution {
public:
int minGroups(vector<vector<int>>& intervals) {
// Sort the intervals based on the start time
sort(begin(intervals), end(intervals));
// Min Heap to track the end times of the groups
priority_queue<int, vector<int>, greater<int>> pq;
for (auto &inter... | ALGO | 0.999993 | 6.764911 |
d2a80452-de20-4278-920c-3dd1916d3ff2 | rafaelborba1989/lista_5_algoritmos_cpp_strings | lista5 -5.cpp | /*5. Elabore um algoritmo que receba um nome completo em uma string e apresente apenas o
último nome e o 1º nome na seguinte forma: último, 1º nome.
Entrada: Ana Fernandes Oliveira
Saída: Oliveira, Ana*/
#include <iostream>
#include <string>
using namespace std;
int main() {
int i,posicao, i2=0, i3, j, t1, t2, cont=0... | ALGO | 0.967407 | 3.596104 |
e77ccde8-eaff-4915-8bed-6c35b3d2a96d | vanitas-23/Daily_progress | 2465-shifting-letters-ii/shifting-letters-ii.cpp | class Solution {
public:
char f(char c, int x) {
int pos = c - 'a';
int new_pos = (pos + x) % 26;
if (new_pos < 0) {
new_pos += 26;
}
char new_char = new_pos + 'a';
return new_char;
}
string shiftingLetters(string s, vector<vector<int>>& shifts) {... | ALGO | 0.999987 | 6.361741 |
850cc63b-0d8f-4e5a-8621-9e60314c2b2d | GulkoBogdan/25b | Source.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int a;
int b;
int c;
cout << "Input a: ";
do {
cin >> a;
} while (a<=0);
cout << "Input b: ";
do {
cin >> b;
} while (b <= 0);
cout << "Input c: ";
do {
cin >> c;
} while (c <= 0);
int s = 2 * (a * c + b * c + a * b);
int v ... | ALGO | 0.964669 | 3.401915 |
e7ad7a71-c191-48d0-953f-190469afc0ef | MFpizza/UVa_online_judge | UVa 109/UVa 10943 - How do you add/Source.cpp | #include <iostream>
using namespace std;
int main() {
const long long int mod = 1000000;
long long int combinationTable[205][205] = { 0 };
combinationTable[0][0] = 1;
for (int i = 1; i <= 200; ++i) {
combinationTable[i][0] = 1;
for (int j = 1; j <= i; ++j) {
combinationTable[i][j] = (combinationTable[i - 1]... | ALGO | 0.99976 | 4.440895 |
defd5c48-5669-4cf6-9b22-d2699c4f6c5e | aceetheridge/Data-Structures-assignments | ass8/finalproject.cpp | #include <string>
#include <set>
#include <algorithm>
#include <cassert>
#include <unordered_map>
#include "Bridges.h"
#include "DataSource.h"
#include "data_src/ActorMovieIMDB.h"
#include "GraphAdjList.h"
using namespace std;
using namespace bridges;
string getEnvVar(string const & key);
// set<string> findmovies(st... | ALGO | 0.904472 | 4.613697 |
47432ce0-e96a-4b83-8d87-e1800ba74cd5 | fant0r/taller_3 | ejer.3.12/main.cpp | /*programa que cambia el signo de los elementos de un vector
fecha: 25 sept 2017
creado por manuel fernando soto
*/
#include<stdio.h>
#include<conio.h>
//Prototipos de Funcion
void cambiarSigno (int vec[],int);
void mostrarVector (int vec[],int);
void pedirDatos ();
int vec [100];
int tam;
//funcion principal
int m... | ALGO | 0.998502 | 3.791778 |
2400adba-0f4b-4fb3-b370-af70a7441c7e | RealworldSystems/android-qt | src/3rdparty/webkit/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp | #include "config.h"
#include "TransformationMatrix.h"
#include "AffineTransform.h"
#include "FloatPoint3D.h"
#include "FloatRect.h"
#include "FloatQuad.h"
#include "IntRect.h"
#include <wtf/Assertions.h>
#include <wtf/MathExtras.h>
namespace WebCore {
//
// Supporting Math Functions
//
// This is a set of function ... | TOOL | 0.994466 | 7.364858 |
b20f03eb-3980-4131-a2bf-ef8c09d60735 | Ranadipgithub/Problems | sorting/014-count_of_range_sum.cpp | // problem statement: Given an array of long longegers, find the number of reverse pairs in the array. A reverse pair is defined as (i, j) such that i < j and arr[i] > 2 * arr[j].
// https://leetcode.com/problems/reverse-pairs/description/
#include <bits/stdc++.h>
using namespace std;
void merge(vector<long long>& ar... | ALGO | 0.999992 | 4.620927 |
ae2a14b6-06f3-4c0e-b28f-9d2715769dad | Takiwa-i/Atcoder | ABC/112/B.cpp | #include <iostream>
#include <algorithm>
int main(void)
{
int N, T;
int ans = 2000;
std::cin >> N >> T;
for (int i = 0; i < N; i++)
{
int c, t;
std::cin >> c >> t;
if (t <= T)
ans = std::min(ans, c);
}
if (ans == 2000)
std::cout << "TLE" << std::endl;
else
std::cout << ans << std::endl;
return (... | ALGO | 0.9999 | 3.640665 |
10d3a759-145d-4f71-beb7-b7b88007939d | abdur-rafi/Codeforces-practice | 225C.cpp | #include <cstdio>
#include <vector>
#include <climits>
#include <string>
using namespace std;
typedef long long ll;
ll dp[2][1010], count[2][1010];
ll n, m ,x, y;
ll calc(ll i, bool flip){
// printf("%d\n",i );
if(i > m) return 0;
if(dp[flip][i] != -1) return dp[flip][i];
ll mn = INT_MAX;
ll to = min(i + y, m +... | ALGO | 0.999341 | 3.744648 |
6d27987a-ff10-4b44-9790-a633e8754fe6 | pavankumar130/LeetCode | 523-continuous-subarray-sum/continuous-subarray-sum.cpp | class Solution {
public:
bool checkSubarraySum(vector<int>& nums, int k) {
int presum = 0;
unordered_map<int,int>mp;
mp[0] = -1;
for(int i = 0; i < nums.size(); i++){
presum = (presum + nums[i]) % k;
if(mp.find(presum) != mp.end()){
if(i - mp... | ALGO | 0.999954 | 5.734754 |
b74d5032-c8cc-42fa-8d3a-e2b8448863af | vishwaspaikra007/striver-SDE-sheet-challange | 20 june 2022 delete-node-in-a-linked-list.cpp | // striver SDE sheet challange delete-node-in-a-linked-list
// author Vishwas Paikra
#include <bits/stdc++.h>
/****************************************************************
Following is the class structure of the LinkedListNode class:
template <typename T>
class LinkedListNode
{
public:
... | ALGO | 0.999962 | 4.626224 |
35738902-c936-4fb4-a3e1-a96aa7b8202d | Hasan1485/competitive-coding | codechef/anubtg.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int start_up()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
return 0;
}
int static r = start_up();
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
int a[n];
for (int i = ... | ALGO | 0.999969 | 4.745957 |
9762b64c-3d26-4e11-b92a-48695167e884 | Sumanth-NR/CompetitiveProgramming | Platforms/CodeForces/Global_Rounds/GR_26/D_a_String_Problem.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> getDp(int f, int b) {
vector<ll> dp(f + b + 1);
if (f > b) {
swap(f, b);
}
for (int i = 0; i <= f; ++i) {
dp[i] = i + 1;
}
for (int i = f + b, j = 0; i >= b; --i, ++j) {
dp[i] = j + 1;
}
... | ALGO | 0.999377 | 5.121687 |
d32b630d-fe56-46b2-9791-b737c13a47f3 | ishandutta2007/codeforces | kimnait/normal/1043/E.cpp | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <locale>
using namespace std;
#define F first
#define S second
#define pb push_ba... | ALGO | 0.99997 | 3.281699 |
5ab9e82c-0d09-4536-8656-e98880e9f027 | Huuuhi/LeetCode | 236. 二叉树的最近公共祖先.cpp | #include<iostream>
#include<vector>
using namespace std;
/*
给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。
百度百科中最近公共祖先的定义为:“对于有根树 T 的两个节点 p、q,最近公共祖先表示为一个节点 x,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。”
*/
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNo... | ALGO | 0.999977 | 5.327236 |
1b2edefa-dea2-4b30-ad51-c9b74267f890 | NCAR/GPU_workshop | archivedLessons_CUDA/Lesson_3_FMA/OpenACC/solution/common.cpp | /* common.cpp
* To contain functions that are common across all lessons
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define RANGE_MAX 1.0
#define RANGE_MIN -1.0
/* Sets all values in array equal to val */
void InitializeMatrixSame(float *array, const int ny, const int nx, const float val, const ch... | TOOL | 0.888317 | 5.62461 |
a35827bf-1437-46d2-9122-e5d00cccbfa8 | ishandutta2007/codeforces-nonalphabetic | 300iq/normal/1096/G.cpp | #include <cmath>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#inc... | ALGO | 0.999981 | 4.439097 |
d73b6b6c-21cf-4ba4-9ac1-79c8cde82b58 | pductrungg/DSA_241_Lab | heap/heapSort.cpp | //Helping functions go here
static void heapSort(T* start, T* end){
//TODO
priority_queue<int,vector<int>,greater<int>> pq;
for(int i=0;i<end-start;i++){
pq.push(start[i]);
}
for(int i=0;i<end-start;i++){
start[i]=pq.top();
pq.pop();
}
Sorting<T>::printArray(start,end... | ALGO | 0.99958 | 4.505208 |
783a12c4-7fe5-47ac-9c49-7cbf82ade1d2 | BilalSajid173/LeetcodeSolutions | 106-construct-binary-tree-from-inorder-and-postorder-traversal/106-construct-binary-tree-from-inorder-and-postorder-traversal.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.999972 | 6.173845 |
9246b072-9741-4d8d-a4db-336fa39bc64c | qdttdev/Hacker-Rank | Problem Solving/Algorithms/Halloween_Sale.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
// Complete the howManyGames function below.
int howManyGames(int p, // price
int d, // discount
int m, // minimum
int s) // spend amount available
{
int game = 0;
int cost =... | ALGO | 0.999455 | 3.890752 |
7a5abeb3-956e-47d5-a349-bd637ca89b32 | minseonkkim/Algorithm_BOJ | Greedy/13904.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<pair<int, int>> v;
int arr[1001] = {0, };
for(int i = 0; i < n; i++){
int d, w;
cin >> d >> w;
v.push_back({w, d});
}
sort(v.begin(), v.end(), greater<>());
int sum = 0;
for(int i = 0; i ... | ALGO | 0.999952 | 3.827103 |
4ef54a1f-1da3-4e14-a3ff-6548e20d9c25 | Mahin7773/CSE-4116-Security-Lab | assignment/hashing.cpp | #include<bits/stdc++.h>
#include <stddef.h>
#include <stdint.h>
using namespace std;
uint32_t crc32(const char *s,size_t n) {
uint32_t crc=0xFFFFFFFF;
for(size_t i=0;i<n;i++) {
char ch=s[i];
for(size_t j=0;j<8;j++) {
uint32_t b=(ch^crc)&1;
crc>>=1;
if(b) crc=crc^0xEDB88320;
ch>>=1;
}
}
return... | ALGO | 0.999579 | 5.235618 |
577b7fc5-bd6a-43cd-94bd-378e6b0eda68 | Lincito-31/Preseleccion | III Campamento Iberoamericano/STL/B.cpp | #include <bits/stdc++.h>
using namespace std;
int t,n,m,cont,a;
int main(){
scanf("%d",&t);
while(t--){
scanf("%d%d",&n,&m);
map<int,int> con;
cont=0;
while(n--){
scanf("%d",&a);
con[a]++;
}
while(m--){
scanf("%d",&a);
... | ALGO | 0.999936 | 3.847528 |
1ff7500a-113c-45af-a794-afc1c8adb98d | yuvraj0502/DSA | LeetCode/LinkedList/reverse linked list 2.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseBetw... | ALGO | 0.999997 | 5.868798 |
69a797c8-683b-4ad8-bfd7-3efc7c7b2fe9 | murataksoy/adventofcode-2021 | day3.cpp | // to compile - g++
#include <iostream>
#include <fstream>
#include <string>
#include <deque>
#include <vector>
using namespace std;
int main()
{
fstream f;
f.open("input3.txt", ios::in);
string str;
// manually entering the number of digits
int n = 12;
vector<int> ones(n);
vector<int> zero... | ALGO | 0.999807 | 4.796936 |
cbda246b-9ea8-40e2-80e0-938780ef30f3 | tofuwen/icpc-Rujia-Liu | Training_Guide_Rujia_Liu/TrainingGuide_examples/ch4/la4795.cpp | // LA4795 Paperweight
// Rujia Liu
#include<cstdio>
#include<cmath>
using namespace std;
const double eps = 1e-8;
int dcmp(double x) {
if(fabs(x) < eps) return 0; else return x < 0 ? -1 : 1;
}
struct Point3 {
double x, y, z;
Point3(double x=0, double y=0, double z=0):x(x),y(y),z(z) { }
};
typedef Point3 Vector... | ALGO | 0.999765 | 3.630404 |
51a78854-1661-4f81-92ac-3b4128e082ee | ishandutta2007/codeforces | kamer/normal/1401/C.cpp | #include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <algorithm>
#include <utility>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <fstream>
#include <cmath>
using namespace std;
typedef long long... | ALGO | 0.999677 | 4.152751 |
08f47966-21fe-4b18-8b66-40604e435af2 | Ziklon/algorithms | tc/testprograms/MoneyExchange.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.997297 | 4.6877 |
c89b05b5-71fc-4ef2-a0e8-77946a4b9616 | behnejad/Online-Judge-Solutions | TJU/2236 - Partial Sums.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
int main(){
int n,L,U,sum,total,ans,max,a[100000],cont[5200];
while(scanf("%d %d %d",&n,&L,&U)==3){
for(int i=0;i<n;i++) scanf("%d",&a[i]);
ans=max=-1;
for(int i=L;i<=U;i++){
fill(cont+1,cont+i,0);
cont[0]=1;
sum=total=0;
... | ALGO | 0.999594 | 3.21593 |
a23e0c19-93bb-4e41-8335-386d23c4abf9 | baaazik/paralell_prog_labs | lab1/mpi_collective.cpp | #include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <mpi.h>
#include <Windows.h>
#include "matmul.h"
#define SIZE 650 // Размер матриц
static double t0; // Время начала работы программы
static int size, rank; // Количество процессов и номер процесса
static... | ALGO | 0.999854 | 3.764597 |
53837733-b4af-4f54-8bc9-787fdbcde921 | AOSP-10-CAF/hardware_qcom_media | mm-video-v4l2/vidc/vdec/src/frameparser.cpp | #include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <fcntl.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <pthread.h>
#include <ctype.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/poll.h>
#include <st... | TOOL | 0.87416 | 3.996777 |
f6a68062-749f-4f8f-88c9-984fe2ec49a7 | GopherTeen/OJ_Code | Problems/nowcoder/小白月赛 101/A.tb的区间问题.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
static constexpr int MOD = 1'000'000'007;
void solve() {
int n, k;
cin >> n >> k;
vector<int> vec(n);
for (int i = 0; i < n; ++i) {
cin >> vec[i];
}
ll sum = 0;
for (int i = 0; i < k; ++i) {
sum += vec[n... | ALGO | 0.999979 | 4.659195 |
caaa7c3c-f733-43c5-aea1-ac2069781eb4 | Ayushi-Dhingra/Data-Structures | linked_list.cpp | #include<stdio.h>
#include<stdlib.h>
struct node
{
int info;
struct node *link;
};
struct node *start;
void add(int item)
{
struct node *newnode;
//start =NULL;
newnode=(struct node*)malloc(sizeof(struct node));
newnode->info=item;
newnode->link=start;
start=newnode;
}
void traverse()
{
struct node *ptr=start;
wh... | ALGO | 0.998753 | 3.42287 |
274f7406-6a0c-4312-b07d-eea02d4e2a5e | Shafiul-006/DSA_Shafiul | binary_search.cpp | #include<bits/stdc++.h>
using namespace std;
int b_s(int arr[],int n,int k){
int low=0;
int high=n-1;
int mid=low+(high-low)/2;
while(low<=high){
mid=low+(high-low)/2;
if(arr[mid]==k){
return mid;
}
else if(arr[mid]>k){
high=mid-1;
}
... | ALGO | 0.999923 | 5.742215 |
40fb2fc6-8f1e-4359-b78f-fcb103fefa4f | krotrn/CPP | Arrays/Ordinary/copyinreverseorder.cpp | #include<iostream>
#include<vector>
using namespace std;
void display(vector<int>& a){
for(int i=0;i<a.size();i++){
cout<<a[i]<<" ";
}
cout<<endl;
}
void swap(int *a, int *b){
int t=*a;
*a=*b;
*b=t;
}
int main(){
vector<int> v1;
v1.push_back(1);
v1.push_back(6);
v1.push_b... | ALGO | 0.999303 | 3.660108 |
1ed2c2d5-4d57-496c-a8ae-ca4a9d6d8afa | JosephL8912/Competitive-programming | ChickenCrossingTheRoadWithCow.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
multiset<int> chickens;
vector<pii> cows;
int C, N;
int main(void)
{
freopen("helpcross.in", "r", stdin);
freopen("helpcross.out", "w", stdout);
cin >> C >> N;
int x, y, answer = 0;
for (int i = 0; i < C; i++) {
ci... | ALGO | 0.999966 | 3.951173 |
d619670a-27a4-43a8-8afc-8e57e1132d00 | Spade17/DignitaryWoW-Core | src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp | #include "ByteBuffer.h"
#include "TargetedMovementGenerator.h"
#include "Errors.h"
#include "Creature.h"
#include "CreatureAI.h"
#include "World.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
#include "Player.h"
#include "VehicleDefines.h"
template<class T, typename D>
void TargetedMovementGeneratorMedium<T, D... | TOOL | 0.860917 | 3.565072 |
4a36cd4e-e76f-4e23-8d20-df3d8e6533b0 | SachinM97/CodingProblems | search_insert_position.cpp | // Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
// You must write an algorithm with O(log n) runtime complexity.
// Example 1:
// Input: nums = [1,3,5,6], target = 5
// Output: 2
// Exam... | ALGO | 0.999991 | 6.52505 |
8bcadd65-15e9-4019-9ead-7f2f8a607855 | lakshitsaini/graph_algos | dfs.cpp | // // C++ program to print DFS traversal from
// // a given vertex in a given graph
// #include<bits/stdc++.h>
// using namespace std;
// // Graph class represents a directed graph
// // using adjacency list representation
// class Graph
// {
// int V; // No. of vertices
// // Pointer to an array containin... | ALGO | 0.999883 | 5.080687 |
9e12c3a7-56cd-455c-926a-426f488e06fc | sumandeka223037/LeetCode | 0009-palindrome-number/0009-palindrome-number.cpp | class Solution {
public:
bool isPalindrome(int x) {
long int reverseNum=0;
long int temp=x;
while(temp>0){
reverseNum=(reverseNum*10)+(temp%10);
temp=temp/10;
}
return (reverseNum==x);
}
}; | ALGO | 0.999976 | 5.731177 |
f719fd04-b481-4ad9-a11b-0805907a5fa2 | burakltnds/CppAlgoritma | 01_Siralama/01_Siralama.cpp | #include <iostream>
using namespace std;
//----------BUBBLE----------
void bubbleSort(int dizi [] ,int boyut ) {
for (int i = 0 ; i < boyut-1 ; i++) {
for (int j = 0; j < boyut - 1 - i; j++) {
if (dizi[j] > dizi[j + 1])
{
int temp;
temp = dizi[j];
dizi[j] = dizi[j + 1];
dizi[j + 1] = temp;
... | ALGO | 0.99991 | 4.726974 |
dda53cd1-e772-4f4c-bdba-7ba1dea43411 | YuWeihung/LeetCode | stack/901_股票价格跨度_medium.cpp | /*
* @lc app=leetcode.cn id=901 lang=cpp
*
* [901] 股票价格跨度
*/
#include <climits>
#include <stack>
using namespace std;
// @lc code=start
class StockSpanner {
public:
stack<pair<int, int>> st;
int cur_day = -1;
StockSpanner() {
st.emplace(-1, INT_MAX);
}
int next(int price) {
cur... | ALGO | 0.998533 | 6.280809 |
9cde8a33-d017-4986-b1fc-5528430de312 | shenghuntianlang/Play-with-Algorithm-Interview | 07-Binary-Tree-and-Recursion/Course Code (C++)/04-Binary-Tree-Paths/main.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
/// 257. Binary Tree Paths
/// https://leetcode.com/problems/binary-tree-paths/description/
/// 时间复杂度: O(n), n为树中的节点个数
/// 空间复杂度: O(h), h为树的高度
/// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
Tre... | ALGO | 0.999744 | 5.228351 |
4b67c33a-c25a-4f0f-8a89-6a958a584b40 | kkw-11/Problem_Solving | C++를 이용한 창의적 문제 해결/29. 3의 개수는(small).cpp | //29.3의 개수는?(small)
#include <stdio.h>
int main() {
freopen("input.txt", "rt", stdin);
int n, temp, cnt = 0;
scanf("%d", &n);
int temp2 = 10;
for (int i = 1; i <= n; ++i) {
temp = i;
while (temp > 0) {
if (temp % 10 == 3) {
++cnt;
}
temp /= 10;
}
if (i == temp2) {
printf("number:%d->%d\n"... | ALGO | 0.999476 | 3.573917 |
bb8de19d-7fc5-46d0-a756-b475adfc8d6a | surajsinsinwar/competitive-programming-3-solutions | 1-Introduction/super-easy/272.cpp | #include <cstdio>
#include <cstring>
using namespace std;
int main() {
char line[1024];
bool open = true;
while (gets(line)) {
int len = strlen(line);
for (int i = 0; i < len; i++) {
if (line[i] == '"') {
if (open)
printf("``");
else
printf("''");
open = !open;
} else
printf("... | TOOL | 0.981237 | 4.352389 |
94defe40-e23e-471f-bcbb-a56aab86e27b | Alex-Tooomato/Leetcode101 | search/51.cpp | //
// Created by pc on 2022/3/1.
//
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
vector<vector<string>> solveNQueens(int n) {
vector<vector<string>>ans;
if(n==0){
return ans;
}
vector<string>board(n,string(n,'.'));
vector<bool>column(n... | ALGO | 0.999786 | 5.575883 |
0372785f-c2a5-44e0-8e85-a1a4edebc642 | kuanarshubham/DSA | 15.Graph/01/01.cpp | // store the graph in the
// 1. matrix
// 2. adj list
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
void matrix(vector<vector<int>> &arr){
int edges, nodes;
cin>>nodes>>edges;
while(edges){
int u, v, wt;
cin>>u>>v>>wt;
arr[u][v] = wt;
arr[v][u] = wt;
... | ALGO | 0.999871 | 4.674884 |
cd962d4f-4917-447a-b9f1-8906b3a9aa2c | yangjufo/LeetCode | 2021/653. Two Sum IV - Input is a BST.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.999978 | 6.29781 |
c6b9b4a1-8ebe-465e-88fa-c634df75d8d5 | NipenPaul/Program-Catagory-Document | Contest/Codemarshal/UIU CODERS COMBAT 2.0/uiu-cc-19.C.cpp | #include<bits/stdc++.h>
#define Fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Freed freopen ("0in.txt","r",stdin);
#define Fout freopen ("0out.txt","w",stdout);
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define Mod 1000000007
#define limit 1000008
using namespace std;
void solve(i... | ALGO | 0.999762 | 3.510861 |
d3a90663-1070-4980-b521-55b0f0e00dd6 | Zhuk-al/cpp-transport-catalogue | transport-catalogue/geo.cpp | #include "geo.h"
#include <cmath>
namespace geo {
double ComputeDistance(Coordinates from, Coordinates to) {
using namespace std;
if (from == to) {
return 0;
}
static const double dr = 3.1415926535 / 180.;
return acos(sin(from.lat * dr) * sin(to.lat * dr)
+ cos(from.... | ALGO | 0.98487 | 5.081778 |
758ccf9f-e84f-4213-98dc-cb2437406e35 | vuphuong1794/data-structures-algorithms | caitui0-1QHD.cpp | //#include <iostream>
//using namespace std;
//int main() {
// int n, S; cin >> n>>S;
// int w[100], v[100];
// for (int i = 1; i <= n; i++) cin >> w[i];
// for (int i = 1; i <= n; i++) cin >> v[i];
// int dp[100][100];
// memset(dp, 0, sizeof(dp));
// for (int i = 1; i <= n; i++) {
// for (int j = 1; j <= S; j++) {
/... | ALGO | 0.999917 | 3.061158 |
4096e70c-6c73-48c1-8482-679cac5897fb | gopoma/competitive-programming | events/archive/Problemset/1811A.cpp | #pragma GCC optimize(3,"Ofast","inline")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
#define MACRO(code) do {code} while (false)
#define DBG(x) MACRO(cerr << #x << " ... | ALGO | 0.999703 | 5.044178 |
242d8f6c-4c02-459c-b2a9-8c43a6af9414 | jim2832/Leetcode | 2385-amount-of-time-for-binary-tree-to-be-infected/2385-amount-of-time-for-binary-tree-to-be-infected.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.99998 | 6.540408 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.