uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7b15cf62-e745-4b2e-a224-7ded94691d42 | Aman2913/Owl-Coder-Level-2 | Search Negative in Grid.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int arr[n][m];
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
cin>>arr[i][j];
}
cout<<endl;
}
int c=0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){... | ALGO | 0.999952 | 3.826972 |
5e91e194-8691-4f48-9fbb-c3ebb9cc8748 | Hyuk-II/CPP-Study-2024 | 실습 11주차/실습과제 2.cpp | #include <iostream>
#include <string>
using namespace std;
class LoopAdder { // Ŭ
string name; // ̸
int x, y, sum; // x y sum
void read(); // x, y о ̴ Լ
void write(); // sum ϴ Լ
protected:
LoopAdder(string name = "") { // ̸ ´. ʱ갪 ""
this->name = name;
}
int getX() { re... | ALGO | 0.879596 | 4.357119 |
c47a7d04-e348-4769-9187-142978fae1a5 | SourDumplings/DSA | test/test_splaytree.cpp | /*
@Date : 2018-06-24 18:27:17
@Author : 酸饺子 (<EMAIL>)
@Link : https://github.com/SourDumplings
@Version : $Id$
*/
/*
伸展树的测试
*/
#include "test_splaytree.h"
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <memory>
#include "Tree/BinTree/SplayTree.h"... | TEST | 0.91983 | 3.887197 |
9e1921d4-bd72-4cda-afc4-76bd6b58a8d0 | oldlick/CompetitiveProgramming | atcoder/3 ABC/217/E.cpp | //ver 8.1
#include <bits/stdc++.h>
using namespace std;
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vd = vector<ld>;
using vs = vector<string>;
using vb = vector<bool>;
using vvl = vector<vector<ll>>;
... | ALGO | 0.99979 | 4.166798 |
918c6144-bdf6-42a3-bdee-18e9689d27d1 | DiegoHCH/PushApp | 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.998784 | 6.761023 |
7099849f-3487-4f06-8b49-030fb1213459 | pexip/os-llvm-toolchain-17 | lld/MachO/ExportTrie.cpp | #include "ExportTrie.h"
#include "Symbols.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Memory.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Support/LEB128.h"
#include <optional>
using namespace llvm;
using namespace lld;
using namespace lld::macho;
namespace {
struct Edge {
Edge(StringRef... | TOOL | 0.917974 | 7.562629 |
d34c7b14-7576-4196-876b-f6c314983ed5 | Bhawna751/LeetCode-Solutions | 2179-most-beautiful-item-for-each-query/most-beautiful-item-for-each-query.cpp | class Solution {
public:
int bs(vector<vector<int>> &items, int target){//target = 1
int left = 0, right = items.size()-1;
int maxi =0;
while(left<=right){
int mid = (left+right)/2;// mid = 0
if(items[mid][0] > target)right=mid-1;//right = 1
else{
... | ALGO | 0.99992 | 5.902924 |
c54870a8-2faf-44c7-91d0-ef21a7d1a1ed | ishandutta2007/codeforces | kmjp/normal/601/B.cpp | #include <bits/stdc++.h>
using namespace std;
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(... | ALGO | 0.999793 | 3.609883 |
d62a1296-dde8-4632-a379-c3a0ff0b13f5 | raincross7/code-similarity | codes/train_code/problem101/problem101_437.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mod(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long ... | ALGO | 0.99994 | 4.016501 |
b5ae0d1d-c755-4234-9588-1a195f04aa06 | Quasilius-Starlord/sheet | Count pairs with given sum.cpp | #include <iostream>
#include <unordered_map>
class Solution{
private:
public:
int getPairsCount(int arr[], int n, int k) {
int count=0;
std::unordered_map<int, int> map;
for (int i = 0; i < n; i++)
{
if(map.find(arr[i])!=map.end()){
map[arr[i]]++;
... | ALGO | 0.99981 | 5.703305 |
dc0b6438-17ab-4d2c-b0e0-af312482fe89 | SudShekhar/Programming | codeforces/201Div2/31.cpp | // Standard includes
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<limits.h>
#include<string.h>
//Data Structures
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<utility>
#include<stack>
#include<queue>
using namespace std;
... | ALGO | 0.999988 | 3.929752 |
cb4825ec-a9dc-4915-97c8-60672748980c | sahilya-flutter/Flutter | stateful/netflix_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.998605 | 6.776823 |
4bb3b079-7843-4c74-8af1-285fe53a0fd3 | 192110223/CSA1422-compiler-design | sai 13.cpp | #include <stdio.h>
#include <ctype.h>
int main() {
FILE *file;
char ch;
int characters = 0, words = 0, lines = 0;
int inWord = 0;
file = fopen("input.txt", "r");
if (file == NULL) {
printf("Error opening file.\n");
return 1;
}
while ((ch = fgetc(file)) != EOF) {
... | ALGO | 0.944895 | 4.535167 |
3f51378d-2b68-47f0-904a-dc4979d14fbc | an0520a/boj | BOJ_1676.cpp | #include <stdio.h>
typedef unsigned int u32;
int main()
{
u32 N;
scanf(" %u", &N);
printf("%u\n", N / 5 + N / 25 + N / 125);
} | ALGO | 0.999594 | 3.734216 |
732aecbe-8999-4835-a0b2-cdd2a106156c | GoodKnight06/NOI.PH-Codes | Tataramon.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
typedef long long int lli;
using namespace std;
int main() {
lli t;
scanf("%lld", &t);
while (t--){
lli n;
scanf("%lld", &n);
map<lli, lli> mapa;
for (lli i... | ALGO | 0.999729 | 3.767636 |
3879b384-4b27-4c8f-8bb9-61c6db093e8c | johnpuri/Towson_COSC_471 | HW4.2/eigen3/unsupported/test/NumericalDiff.cpp | #include <stdio.h>
#include "main.h"
#include <unsupported/Eigen/NumericalDiff>
// Generic functor
template<typename _Scalar, int NX=Dynamic, int NY=Dynamic>
struct Functor
{
typedef _Scalar Scalar;
enum {
InputsAtCompileTime = NX,
ValuesAtCompileTime = NY
};
typedef Matrix<Scalar,InputsAtCompileT... | TEST | 0.975852 | 6.166783 |
2eeffb8d-8bac-412a-9d53-84e04c3d7c11 | GaijinEntertainment/DagorEngine | prog/3rdPartyLibs/phys/bullet-3/src/Bullet3OpenCL/BroadphaseCollision/b3GpuParallelLinearBvhBroadphase.cpp | /*
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it f... | ALGO | 0.969187 | 6.246934 |
c1c4e2e8-0718-4a66-98d5-885af3ba5d44 | mfaiz61926/competitive-programming | STEP 4 BINARY SEARCH/LEC 1 BS ON 1D ARRAY/10_no_of_c=occurances.cpp | #include <bits/stdc++.h>
using namespace std;
//Given a sorted array, arr[] and a number target, you need to find the number of occurrences of target in arr[]. gfg
class Solution {
public:
int firstO(vector<int>&arr,int x){
int n=arr.size();
int low=0;int high=n-1;
int ans=-... | ALGO | 0.999957 | 5.856101 |
2b78a7ec-a64a-4473-abe0-b0b9886875cd | QUST-DSRA-2021/legendary-bibimbap | noip/algo-datastruct-test3/prob-f.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
using namespace std;
using namespace __gnu_cxx;
struct Node {
char val;
struct Node *lchild,
*rchild,
*parent;
} *root;
queue <struct Node *> que;... | ALGO | 0.999998 | 3.744312 |
4e2ea1bd-888c-4db2-969e-8aed6a4b6a1d | manu-sankar/cpp.Training | Assignment/day 10/hoursSeconds.cpp | #include<iostream>
void convert(int hours, int& minutes, int& seconds);
using namespace std;
void convert(int hours, int &minutes, int &seconds) {
if (hours < 0){
cout << "Invalid" << endl;
return;
}
minutes = hours * 60;
seconds = minutes * 60;
}
int main() {
int n, minutes, seconds;
cout << "Enter n ";
cin... | ALGO | 0.913349 | 3.310157 |
7e1eb1fa-6cfc-44b5-86b1-9784c2cb0dbe | Fireworker20th/SPORTS | SPORTS/VO/VO_Module/thirdparty/lietorch/eigen/test/sparse_permutations.cpp | static long int nb_transposed_copies;
#define EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN {nb_transposed_copies++;}
#define VERIFY_TRANSPOSITION_COUNT(XPR,N) {\
nb_transposed_copies = 0; \
XPR; \
if(nb_transposed_copies!=N) std::cerr << "nb_transposed_copies == " << nb_transposed_copies << "\n"; \
VERIFY( (#XPR... | TEST | 0.925785 | 6.338624 |
3ae52b97-5c69-408b-8bc2-298408952c2d | Raftouch/second-app-flutter | 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 |
87a23b94-a99f-47ed-b5ab-739bab2ff6fc | manasbis10/code | C_Balls_and_Bag_Query.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
int mod = 1e9+7;
int mod_add(int a, int b, int m) {return (a % m + b % m) % m;}
int mod_mul(int a, int b, int m) {return (a % m * b % m) % m;}
int mod_sub(int a, int b, int m) {return ((a % m - b % m) + m) % m;}
int bin_exp(int base, i... | ALGO | 0.999697 | 4.90004 |
20ca68f6-530f-463a-a3c0-1856828a0443 | ruiwng/program | PAT/data_structure/2-07.cpp | /*#include <stdio.h>
#include <vector>
#include <math.h>
using namespace std;
int main()
{
long int num;
while(scanf("%ld",&num)!=EOF)
{
vector<char> array(num+1);
long int range=sqrt(num);
for(long int i=2;i<=range;++i)
{
if(array[i]!=0)
continue;
long int temp=i+i;
while(temp<=num)
{
... | ALGO | 0.99993 | 3.637036 |
3e364f71-f7bb-4feb-90e5-8d93a2467268 | sinian666/code_102_5 | cpp_副本9/chapter_sorting/bucket_sort.cpp | /**
* File: bucket_sort.cpp
* Created Time: 2023-03-30
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 桶排序 */
void bucketSort(vector<float> &nums) {
// 初始化 k = n/2 个桶,预期向每个桶分配 2 个元素
int k = nums.size() / 2;
vector<vector<float>> buckets(k);
// 1. 将数组元素分配到各个桶中
for (float num : ... | ALGO | 0.999904 | 5.549027 |
bfdc4cce-b6fa-4bcd-bf05-df7c476a91c5 | leonardoAnjos16/Competitive-Programming | Codeforces/pairs_of_segments.cpp | #include <bits/stdc++.h>
using namespace std;
#define llong long long int
int n;
vector<pair<int, int>> segments;
vector<int> memo;
int pairs(int i = 0) {
if (i >= n) return 0;
int &ans = memo[i];
if (~ans) return ans;
ans = pairs(i + 1);
for (int j = i + 1; j < n && segments[j].first <= segme... | ALGO | 0.999778 | 4.787194 |
4f25c01d-e801-49ea-8a9b-a64d0467dd9d | RitamDey/Everything | c++/codeabbey/ex.cpp | #include<iostream>
using namespace std;
int main(){
int range, tmp, sum = 0;
cin>>range;
for(int a=0; a<range; ++a){
cin>>tmp;
sum += tmp;
}
cout<<sum<<endl;
return 0;
}
| ALGO | 0.999698 | 3.460028 |
f7d714bb-41ee-4364-9ed0-aee4c5d7efe8 | pkuxxy/LeetCode | leetcode_forthtime/Largest Rectangle in Histogram.cpp | class Solution {
public:
int largestRectangleArea(vector<int> &height) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
stack<int> s,t;
int maxa = 0;
int len = height.size();
vector<int> width(len);
for(int i = 0; i < len ;i++)
... | ALGO | 0.99986 | 6.099287 |
559ccf3c-67ff-43a4-8d76-d07256643247 | Garimachandra1917/CP_Problems | Search an Element in an array - GFG/search-an-element-in-an-array.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// Function to search x in arr
// arr: input array
// X: element to be searched for
int search(int arr[], int N, int X)
{
for(int i=0; i<N ;i++)
{
if(arr... | ALGO | 0.999536 | 5.823322 |
245be4f2-e905-4e3c-a627-5f12bc924272 | zzhawk/trees_r | kdtree/main.cpp | #include <iostream>
#include "kdtree.hpp"
// https://blog.csdn.net/weixin_45867382/article/details/121731422
int main()
{
typedef kdtree<int, 2> tree2d;
typedef point<int, 2> point2d;
point2d points[] = { { 2, 3 }, { 5, 4 }, { 9, 6 }, { 4, 7 }, { 8, 1 }, { 7, 2 } };
tree2d tree(std::begin(points), std::en... | ALGO | 0.99938 | 5.57848 |
83d35750-2c24-4a57-b317-255007042ee5 | ZackAshM/cluster-mergers | cluster_generator.cpp | /* -------------------------------
N-body Star Cluster Merger Simulation:
Cluster Generating Function
Zachary Martin
Physics 305
------------------------------- */
using namespace std;
#include <iostream>
#define USE_MATH_DEFINES
#include <cmath>
#include <cstdlib>
#include <vector>
#include "Vector3D.h"
/* typical ... | ALGO | 0.999033 | 4.70381 |
7d04521a-5419-4e16-8569-5e517277e5b7 | PixelStuffs/system_core | fs_mgr/libsnapshot/estimate_cow_from_nonab_ota.cpp | #include <iostream>
#include <memory>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/strings.h>
#include <android-base/unique_fd.h>
#include <gflags/gflags.h>
#include <libsnapshot/cow_writer.h>
#include <opens... | TOOL | 0.936358 | 7.364765 |
57a3eb58-2ce3-4158-a9d7-624176e6199a | Aarush-Shukla/IT | Array Questions/Container_With_Most_Water.cpp | #include <bits/stdc++.h>
using namespace std;
int maxArea(vector<int>& height) {
int i=0;
int j=height.size()-1;
int area=0;
while(i<j){
int b=j-i;
int l=min(height[i],height[j]);
area=max(area,l*b);
if(height[i]<height[j]){
i++;
... | ALGO | 0.999779 | 5.794389 |
87d737fe-13a4-4267-bf84-8eb06ecb3ca8 | AaronSequeira/DAA | dijkstra.cpp | #include <iostream>
#include <climits>
#include <vector>
using namespace std;
int mindist(vector<int> dist, vector<int> Q, int V){
int minDist = INT_MAX, minIndex;
for(int i=0;i<V;i++){
if(Q[i] == 1 && dist[i] < minDist)
{
minDist = dist[i];
minIndex=i;
}
}
... | ALGO | 0.999921 | 5.423307 |
69390b5a-3e99-4e1e-9519-472b3860272e | xTecna/solucoes-da-beecrowd | problemas/estruturas-e-bibliotecas/1281/1281.cpp | #include <iostream>
#include <iomanip>
#include <map>
using namespace std;
int main()
{
string fruta;
double preco, resposta;
int N, M, P, quantidade;
map<string, double> precos;
cin >> N;
for (int k = 0; k < N; ++k)
{
precos.clear();
cin >> M;
for (int i = 0; i ... | ALGO | 0.992299 | 4.288785 |
c7b0250d-e1af-40cf-81de-269eb896cce9 | shelltdf/osgall | prebuild/boost_1_82_0/libs/graph/example/bfs.cpp | #include <boost/config.hpp>
#include <algorithm>
#include <vector>
#include <utility>
#include <iostream>
#include <boost/graph/visitors.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/graph_utility.hpp... | ALGO | 0.999564 | 6.485667 |
17d11e47-7258-4531-81a5-8bacf1915384 | Akash9301/C-DSA | module6 pointers/passbyreferance.cpp | #include<iostream>
using namespace std;
int swap(int &a,int &b){
int temp = a;
a = b;
b = temp;
}
int main(){
int a ,b;
cin>> a>> b;
swap(a,b);
cout<< a <<endl<<b;
} | ALGO | 0.999814 | 3.321315 |
ed902363-7599-4b9d-b8f0-c4bc92f34458 | ishandutta2007/codeforces | unstoppablechillmachine/normal/455/B.cpp | //author: extraterrestrial_
#include <bits/stdc++.h>
#pragma GCC optimize("O3,Ofast,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,avx,tune=native")
using namespace std;
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define _ inline
#define p... | ALGO | 0.999993 | 4.998644 |
6c54449c-4601-41e1-9b19-b58cee204b12 | LOL-codes/code | strings/Check if one string is a subsequence of another.cpp | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
bool fuc(string &n1,string &n2){
int i=0,j=0;
while(i<n1.length() && j<n2.length()){
if(n1[i]==n2[j]){
++i,++j;
}
else{
++j;
}
}
return i==n1.length();
}
int main()... | ALGO | 0.999961 | 4.182325 |
1a8e8c36-194d-4179-b4da-df9288792a85 | MuhammetEminOzdemir/C-C- | Döngülerler yıldız örneği.cpp | #include<iostream>
using namespace std;
int main(void)
{
int satir, sutun;
cout << "satir ve sutun giriniz:";
cin >> satir >> sutun;
for (int i = 0; i < satir; i++)
{
for (int j = 0; j < i; j++)
{
cout << "*";
}
cout << endl;
}
return 0;
}
/*Her satrla beraber i deeri artyor ancak her satrda... | ALGO | 0.999213 | 3.664776 |
5aad3594-ed93-4871-b419-70ea7d9c48b9 | vaibhavi-roy/Leetcode | Day 6/ValidSquare.cpp | class Solution
{
public:
double distance(vector<int> v1, vector<int> v2)
{
return (((v2[0] - v1[0]) * (v2[0] - v1[0])) + ((v2[1] - v1[1]) * (v2[1] - v1[1])));
}
bool validSquare(vector<int> &p1, vector<int> &p2, vector<int> &p3, vector<int> &p4)
{
vector<vector<int>> pts = {p1, p2, p... | ALGO | 0.999846 | 5.001415 |
9ae6a12c-8ab0-4121-86c8-0d41e5655289 | jwkim98/Algorithms | chapter21/fortress_new.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
class Node{
public:
int num;
Node *parent;
std::vector<Node*> children;
Node(int num, Node* parent){
this->num = num;
this->parent = parent;
}
~Node(){
st... | ALGO | 0.999785 | 4.630728 |
f8a6396c-eae4-4858-b817-357308420c6a | Kristoff-starling/OJ-Programmes | LOJ/[LOJ119]非负权单源最短路.cpp | // I'll always miss you like a darling.
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define LD long double
#define ull unsigned long long
#define uint unsigned int
#define x first
#define y second
#define pb push_back
#define pf push_front
#define mp make_pair
#define Pair pair<int,int>
#define ... | ALGO | 0.999864 | 4.103559 |
c27aa34f-a1b9-423e-ab40-9b501878bd82 | GaisaiYuno/OI-Record-exe-deleted | Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day1程序包/GD-Senior/answers/GD-0198/money/money.cpp | #include<iostream>
#include<fstream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
int t,n,ans,a[1000005],f[1000005];
void begin_clean()
{
memset(f,0,sizeof(f));
f[0]=1;ans=0;
}
int main()
{
freopen("money.in","r",stdin);
freopen("money.out","w",stdout)... | ALGO | 0.999108 | 3.461093 |
a16bb1f2-50f9-418a-98e6-967f8e2218e5 | 0-jij-0/CompetitiveProgramming | Problems Archive/0000 - 0999/0125 - Merge It.cpp | #include <iostream>
using namespace std;
int mod[3];
int main() {
int t; cin >> t;
for (int i = 0; i < t; i++) {
mod[0] = 0; mod[1] = 0; mod[2] = 0;
int n; cin >> n;
for (int j = 0; j < n; j++) {
int a; cin >> a; mod[a % 3]++;
}
int count = mod[0];
int max = (mod[1] < mod[2]) ? mod[2] : mod[1];
int... | ALGO | 0.999843 | 3.595361 |
f87c9b01-ae7f-453b-bd20-4ef5d21d845e | swati-sharma14/Codeforces_solutions | 1300/1476 B - Inflation.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
ll l;
cin >> l;
for(ll q = 0; q < l; q++) {
ll n, k;
cin >> n >> k;
vector<ll> nums(n);
for(ll i=0; i<n; i++) cin >> nu... | ALGO | 0.999888 | 3.878989 |
298238bb-0640-4c62-ad08-41b1de998b79 | vanandrewnguyen/LC | appendToMakeSubsequence.cpp | class Solution {
public:
int appendCharacters(string s, string t) {
// identical to is subsequence... but check against s instead of t but return diff
int sInd = 0;
int tInd = 0;
while ((sInd < s.size()) && (tInd < t.size())) {
if (s[sInd] == t[tInd]) {
tI... | ALGO | 0.999785 | 5.885667 |
a54a4dc7-080b-4251-878c-7378adff901a | kanyuanzhi/ndnSIM-2.1-modified | NFD/daemon/mgmt/command-validator.cpp | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "command-validator.hpp"
#include "core/logger.hpp"
#include <ndn-cxx/util/io.hpp>
#include <ndn-cxx/security/identity-certificate.hpp>
#include <boost/filesystem.hpp>
#include <fstream>
namespace nfd {
NFD_LOG_INIT("CommandValidator");
Com... | TOOL | 0.935569 | 7.361524 |
082df9ef-4852-4d07-9c25-0af04e841b09 | ishandutta2007/codeforces | golovanov399/normal/993/C.cpp | #include <bits/stdc++.h>
#define itn int
#define all(x) (x).begin(), (x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#ifdef ONLINE_JUDGE
inline int pidorand() {
return ((rand() & 32767) << 15) | (rand() & 32767);
}
#define rand pidorand
#endif // ONLINE_JUDGE
#ifdef O... | ALGO | 0.999946 | 3.603271 |
4f7a0b78-515a-46d0-b5f8-97e513d70e99 | iamvyas/cpp_oops | graphs/traversal/dfs.cpp | // modified code from geeks for geeks and dope tech
#include<iostream>
#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 containing
// adjacency lists
list<int> *a... | ALGO | 0.999929 | 5.47115 |
e4e271f8-40d2-46f1-a72c-b90ada705109 | LSBsity/Cpp_Algorithm | 프로그래머스/unrated/155652. 둘만의 암호/둘만의 암호.cpp | #include <string>
#include <vector>
using namespace std;
string solution(string s, string skip, int index) {
string answer = "";
for (int i = 0; i < s.size(); i++) {
int temp = s[i];
int k = index;
while (k--) {
if (temp + 1 <= 'z')
temp++;
else
... | ALGO | 0.999798 | 5.567539 |
71d6a96a-69e2-4b6f-9211-66cc1a4cf7b0 | NitaiBanik/My-algorithm | Dp/10130 - SuperSale.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
ll cap,n;
ll cost[1005],weight[1005],profit1,profit2;
ll knap(ll i, ll w)
{
if(i == n + 1) return 0;
if(w+weight[i]<=cap)
profit1 = cost[i] + knap(i+1,w+weight[i]);
else
profit1 = 0;
profit2 = knap(i+1,w);
return max(p... | ALGO | 0.999931 | 3.447184 |
135ab5dd-3f8b-422e-bbba-b13e22ecde23 | iAbhayRajput/DSA | C++/150-160/159.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int minIncrements(vector<int> arr) {
sort(arr.begin(), arr.end());
int ans=0;
for(int i=1;i<arr.size();i++){
if(arr[i]<=arr[i-1]){
ans+=(arr[i-1]+1)-arr[i];
arr[i]=arr[i-1]+1... | ALGO | 0.998468 | 5.055047 |
cbd9e170-58d4-4123-bdec-731dce6a50e7 | RSN601KRI/POTD_SOL | FebruraryMon/Boolean Parenthesization.cpp | // User function Template for C++
class Solution {
public:
int dp[101][101][2];
int solve(string s, int i, int j, int isTrue)
{
// Base Condition
if (i > j)
return false;
if (i == j) {
if (isTrue == 1)
return s[i] == 'T';
else
... | ALGO | 0.999986 | 5.344378 |
87d1509e-0777-48d4-a4e6-397aa33ffac3 | atuluttam/cpp_dsa_essentials | 16_binary_tree/build_tree_and_traversal.cpp | /*---------------------------------------------------------------------
* code : build_tree_and_traversal
* @author : Atul Uttam
* Date Created : 19-02-2023(03:20:15)
--------------------------------------------------------------------*/
#include <iostream>
#include <algor... | ALGO | 0.999874 | 5.12777 |
378d2693-5e5e-4b1e-9e73-cc31f0f2b326 | ishandutta2007/codeforces | ekzhang/normal/894/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define error(arg...){vector<string>_v =split(#arg,',');err(_v.begin(),arg);}
vector<string> split(const string& s,char c){vector<string> v;stringstream ss(s);
string x;while(getline(ss,x,c))v.push_back(move(x));return v;}
void err(vector<string>::iterator it){}template<ty... | ALGO | 0.999735 | 3.125967 |
fa46ab1b-5304-4b8c-8cd8-7f6a6a95e675 | Sasi3011/C-Plus-Plus | Arithemitic operator.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<"a+b"<<a+b<<endl;
cout<<"a-b"<<a-b<<endl;
cout<<"a*b"<<a*b<<endl;
cout<<"a/b"<<a/b<<endl;
cout<<"Post increment = a++"<<a++<<endl;
cout<<"Pre increment = ++a"<<++a<<endl;
cout<<"Post decrement = b--"<<b--<... | ALGO | 0.991389 | 3.359074 |
5a884ef0-a4aa-45c9-9da0-55ec6ff548ad | jimchan932/SYSU_OS_Lab | lab6_process_synchronization/assignment3.2.cpp | #include "sync.h"
#include "asm_utils.h"
#include "stdio.h"
#include "os_modules.h"
#include "program.h"
SpinLock::SpinLock()
{
initialize();
}
void SpinLock::initialize()
{
bolt = 0;
}
void SpinLock::lock()
{
uint32 key = 1;
do
{
asm_atomic_exchange(&key, &bolt);
//printf("pid: ... | ALGO | 0.964357 | 3.331134 |
46eac4a5-c56f-4f70-910b-f763fdee33cb | ishandutta2007/codeforces | sohsoh/normal/1705/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define X first
#define Y second
#define sep ' '
#define endl '\n'
#define debug(x) cerr << #x << ": " << x << endl;
const ll MAXN = 2e5 + 40;
const ll LOG = 20;
int n, q, ... | ALGO | 0.999979 | 4.500525 |
782efa90-9918-4bcd-8b39-94fe00858214 | Kyaki101/Competitive-Programming | cses/introductoryProblems/raabGameI.cpp | #include <bits/stdc++.h>
using namespace std;
#define SET(m, i) ((m) | (1ULL << (i)))
#define TEST(m, i) ((m) & (1ULL << (i)))
#define CLEAR(m, i) ((m) &~ (1ULL << (i)))
#define DEBUG(n) cout<<#n<<" = "<<n<<endl
#define MSET(arr, x, n) (memset(arr, x, (n)*sizeof(arr[0])))
#define ALL(v) (v).begin(), (v).end()
#define ... | ALGO | 0.999796 | 3.802075 |
58f4bfdb-faba-421c-befb-6c50482696eb | harshabangi/leetcode | cpp/sub_tree_of_another_tree.cpp | //
// Created by Harsha Vardhan on 24/04/22.
//
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nu... | ALGO | 0.999804 | 6.26607 |
b860bd39-a3dd-4348-abef-1ba3c53674a0 | Mrsandman327/windows-book-code-c- | 从算法到程序(第2版)/Chapter08/zju1002.cpp | #include <iostream>
using namespace std;
char cMap[5][5];
int iBest, n;
bool CanPut(int row, int col)
{
int i;
for (i = row - 1; i >= 0; i--) {
if (cMap[i][col] == 'O') return false;
if (cMap[i][col] == 'X') break;
}
for (i = col - 1; i >= 0; i--) {
if (cMap[row][i] == 'O')... | ALGO | 0.999573 | 5.328683 |
0e9c41ca-8a4e-4d15-87a9-2e88167250c2 | jhu-lcsr-forks/ogre | OgreMain/src/OgreRotationSpline.cpp | #include "OgreStableHeaders.h"
#include "OgreRotationalSpline.h"
namespace Ogre {
//---------------------------------------------------------------------
RotationalSpline::RotationalSpline()
: mAutoCalc(true)
{
}
//---------------------------------------------------------------------
R... | ALGO | 0.992343 | 7.372598 |
4cb35ae1-b107-4d0e-94d9-d40a4542d968 | ishandutta2007/codeforces | darkkcyan/normal/1140/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define jalsol_orz main
// #define constexpr(...) (__VA_ARGS__)
using ll = long long;
using ld = long double;
const ld eps = 1e-8;
// for matching the kactl notes
#define sz(x) ((int)x.size())
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin()... | ALGO | 0.999987 | 5.093576 |
57de4ac8-e851-46af-a329-f75a5da47af2 | astro-heree/Leetcode-Solutions | Custom Sort String.cpp | class Solution {
public:
string customSortString(string order, string s) {
unordered_map<char,int> m;
for(int i = 0 ; i < s.size() ; i++) m[s[i]]++;
string ans ;
for(int i = 0 ; i < order.size(); i++)
{
if(m.find(order[i]) != m.end())
{
... | ALGO | 0.999993 | 6.038053 |
421efa7a-c1db-4e8a-86b0-f0d0c867e168 | TsutsuiMasayoshi/leetcode | groupanagrams4.cpp | #include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string>
using namespace std;
class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
unordered_map<string, vector<string>> map;
... | ALGO | 0.999981 | 6.159667 |
1b1244e7-a4eb-446a-b9f3-9cd85523ee18 | satish-kumar75/DSA | Function/pass_by_refrence.cpp | // PROGRAM TO EX OF PASS BY REFERENCE by swap program
#include<iostream>
using namespace std;
int swap(int *,int *);
int main(){
int a{5},b{10};
cout<<a<<" "<<b<<endl;
swap(a,b);
cout<<"after swap ";
cout<<a<<" "<<b<<endl;
return 0;
}
int swap(int &a,int &b){
int z=a;
a=b;
b=z;
return 0;
}
| ALGO | 0.981988 | 4.783493 |
58927360-1344-4249-8565-4ae0bb7f5007 | sshiv5768/15DaysOfCode | Week-3/Vector_Operations.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> i{1, 2, 3, 4, 5};
// Push_back- O(1)
i.push_back(10);
i.push_back(12);
// Pop_back- O(1)
i.pop_back();
// Insert - Insert element in the middle - O(N)
i.insert(i.begin() + 2, 100);
// Erase eleme... | ALGO | 0.97502 | 4.663891 |
4907da14-db35-47ff-a326-6f840c983a92 | purpl-org/purplOS-old | 3rd/opencv/modules/core/src/convert.cpp | #include "precomp.hpp"
#include "opencl_kernels_core.hpp"
#include "convert.hpp"
#include "opencv2/core/openvx/ovx_defs.hpp"
#ifdef __APPLE__
#undef CV_NEON
#define CV_NEON 0
#endif
#define CV_SPLIT_MERGE_MAX_BLOCK_SIZE(cn) ((INT_MAX/4)/cn) // HAL implementation accepts 'int' len, so INT_MAX doesn't work here
/**... | ALGO | 0.989581 | 6.887409 |
d860be04-c106-4762-88df-c3b9b0ff3c08 | Sivasaiklu/Practise_Problems | wordCount.cpp | // count number of words in a string
#include<iostream>
using namespace std;
int main(){
string s;
getline (cin, s);
int count=0;
for(int i=0;s[i]!='\0';i++){
if(s[i] == ' ' && s[i+1]!=' ')
count++;
}
cout<<count+1<<endl;
}
| ALGO | 0.9969 | 3.711273 |
180589db-ce7d-495c-be4f-ce729d5c1519 | rmagon/cprog | Binary Search Tree/04 - Inorder predecessor and successor for a given key in BST.cpp | #include <iostream>
using namespace std;
struct node
{
int key;
struct node* left,*right;
};
struct node* createNode(int k)
{
struct node* no = new node;
no->key = k;
no->left = NULL;
no->right = NULL;
return no;
}
struct node* insertRecur(struct node* root, int k)
{
if(root==NULL)
... | ALGO | 0.999988 | 4.525123 |
13811f75-b7ed-459e-a706-03d3c60d64b9 | ishandutta2007/codeforces | ei133333/normal/1703/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin >> T;
while(T--) {
string S;
cin >> S;
for(auto& c : S) c = tolower(c);
if(S == "yes") cout << "YES" << endl;
else cout << "NO" << endl;
}
} | ALGO | 0.999703 | 5.452936 |
a497de65-86f9-4d41-9023-b6b3ff501801 | Arup-Deb/60-days-DSA-Problems | 140 Triplet Sum in Array.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
//Function to find if there exists a triplet in the
//array A[] which sums up to X.
bool find3Numbers(int A[], int n, int X)
{
sort(A, A+n);
for(int i = 0; i<n; i++) {
... | ALGO | 0.999771 | 5.562893 |
8f97bf63-dd8e-4f6b-b020-0a282898e1bb | Erazor1980/CarND-MPC-Project | src/Eigen-3.3/test/denseLM.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template<typename Scalar>
struct DenseLM : DenseFunctor<Scalar>
{
typedef DenseFunctor<Scalar> Base;
typedef typename Base::JacobianType JacobianType;
typed... | TEST | 0.985406 | 5.886444 |
dbfb6ddb-4bb4-4b25-a5e2-39c535dac697 | MrEon/Projet_Concurrence | main.cpp | /**
* Main file of the project
*
* @author Renaud Costa Paul Lafaurie
* @version 1.0
*
*/
#include <iostream>
#include <pthread.h>
#include <mutex>
#include <condition_variable>
#define num_threads 4
#include <string>
#include <vector>
using namespace std;
#include "Person.h"
std::mutex mtx; // mu... | TOOL | 0.977801 | 3.771434 |
26a6ba44-e81c-4b82-8f36-50b3f21f0910 | matheusbsilva137/Aula21_MAC0327 | c21ex1.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
stack<char> p;
string s;
int n;
cin >> n;
for (int i = 0; i < n; i++){
cin >> s;
int j;
for (j = 0; j < s.size() ; j++){
if (s[j] == '(' || s[j] == '{' || s[j] == '[') p.push(s[j]);
else if (s[... | ALGO | 0.999886 | 4.731962 |
74692266-ce1d-4dff-b4d3-2a242ef40ff7 | DelaraJ/Codes_Coursera | Algorithmic Toolbox/6_maximum_number_of_prizes/different_summands.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> optimal_summands(int n) {
vector<int> summands;
int trash = 1;
while (n>2*trash)
{
n-=trash;
summands.push_back(trash);
trash++;
}
if (n!=0)
{
summands.push_back(n);
}
return summands;
}
int main() {
int n;
... | ALGO | 0.999945 | 4.622712 |
06a19d06-071a-44e5-9b80-a9f36ac9c78f | imsanjoykb/Computer-Science-Study | 02. Discrete Mathematics/04. Lab Works/Lab Work - 13.cpp | //q 12 . X1 + X2 + X3 + X4 = 5;
//POSSIBLE VALUES OF X1, X2 , X3 , X4
#include <iostream>
using namespace std;
void print(int arr[] ,int n){
for(int i=0;i<n;++i){
cout<<arr[i]<<" ";
}
cout<<endl;
}
void possibleSolutions(int arr[] , int k,int n, int s){
if(k==0){
arr[k]=s;
print(arr,n);
return;
}
fo... | ALGO | 0.999859 | 3.01545 |
ca495b6a-f019-4ca4-a76e-fcb195d39c7f | kapilll/DSA | CPP/DP/eggDropRec.cpp | #include <bits/stdc++.h>
using namespace std;
// A utility function to get
// maximum of two integers
int max(int a, int b)
{
return (a > b) ? a : b;
} ... | ALGO | 0.999002 | 5.406989 |
bf56bc00-2d52-4fa2-8ed0-dfb84b3ba50f | ishandutta2007/codeforces | alex_wei/normal/123/D.cpp | /*
Powered by C++11.
Author : Alex_Wei.
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mem(x,v) memset(x,v,sizeof(x))
const int N=2e5+5;
const int S=26;
int cnt,las,son[N][S],ed[N],fa[N],len[N],buc[N],id[N];
void clear(){
mem(son,0),mem(ed,0),mem(fa,0),mem(len,0),mem(buc,0);
cnt=l... | ALGO | 0.999989 | 4.32937 |
66399c39-5d76-4222-8f33-10b896c42123 | Justdwiwt/Cpp_basic | src/leetcode/860.cpp | #include <vector>
using namespace std;
class Solution {
public:
bool lemonadeChange(vector<int> &bills) {
if (bills[0] != 5 || bills[1] == 20)
return false;
int n = 0;
int m = 0;
for (int bill : bills) {
if (bill == 5) n++;
else if (bill == 10) {... | ALGO | 0.998792 | 5.81781 |
68ef7078-d48b-4ddd-86b1-c4354f932a10 | bitcoin-cored/bitcoin-cored | src/consensus/merkle.cpp | #include "merkle.h"
#include "hash.h"
#include "utilstrencodings.h"
/* WARNING! If you're reading this because you're learning about crypto
and/or designing a new system that will use merkle trees, keep in mind
that the following merkle tree algorithm has a serious flaw related to
duplicate tx... | ALGO | 0.999888 | 7.459734 |
68207692-01dc-4d86-8cb9-e5a07cea8958 | minizyz/----- | 一本通/1256.cpp | #include <iostream>
#include <queue>
#include <utility>
using namespace std;
bool dat[205][205];
char read;
int startx, starty, endx, endy;
typedef __pos;
typedef class pos
{
private:
public:
pair<int, int> postions;
int walk;
pos(int x, int y, int walk);
~pos();
} pos;
pos::pos(int x, int y, int walk)
{
this->po... | ALGO | 0.998968 | 3.05466 |
c8b3c301-8f36-4dd7-8aa1-c2b69a934156 | astromme/Neural-Object-Detection | libgng/node.cpp |
#include "node.h"
#include "edge.h"
#include <QDebug>
#include <cstdlib>
using namespace GNG;
qreal realRand(qreal minimum, qreal maximum) {
qreal rand = ((float)qrand())/RAND_MAX;
rand *= maximum-minimum;
rand += minimum;
return rand;
}
Node::Node(const Point &location, int dimension, qreal min, qreal... | ALGO | 0.898316 | 5.734195 |
3b07a7bc-6676-4a86-891b-3b61139c2985 | thecskc/LeetcodeProblems | problems/breadth-first-search/numberofislands.cpp | #include<iostream>
#include<string>
#include<vector>
using namespace std;
class Solution {
public:
void dfs(vector<vector<char>>& grid, vector<vector<bool>>& visited, int row, int col) {
if (row<0 || col<0 || row >= grid.size() || col >= grid[0].size()) {
return;
}
if (visited[row][col] || grid[row][col]=='0... | ALGO | 0.999871 | 6.408384 |
7f476dac-570a-4ebd-ac71-42ece229b040 | BaeSungHyun/Algorithm | helloworld/Minecraft.cpp | // Since Number of blocks == 256. It is not too many to store in an array.
// O(256) -> constant
// Divie and Conquer -> O(256 * log n) -> OK.
#include <iostream>
#include <stack>
using namespace std;
int groundMatrix[257]; // 0 ~ 256
int noneZeroMatrix[257];
int N, M, B;
int count = 0;
int calculator(int targetH... | ALGO | 0.99998 | 4.045099 |
7aa13eac-6b01-4c82-ab6d-0539dac476b4 | PowerSl1d3/algorithms | 5_sprint/I.different_search_trees/main.cpp | #include <iostream>
int get_different_BTrees_count(size_t number_of_elements) {
if (number_of_elements == 0 || number_of_elements == 1) {
return 1;
}
int answer = 0;
for (size_t i = 0; i < number_of_elements; ++i) {
answer += get_different_BTrees_count(i) * get_different_BTrees_count(numb... | ALGO | 0.999532 | 4.280978 |
a71db2c4-4679-447e-bfe4-c8e7c35f49f6 | IlyaDzh/SevSU | 2 курс/4 семестр/ОС 2/2.cpp | #include <iostream>
#include <string.h>
#include <windows.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
string s;
string search = "char";
string replace = "int";
int count = 0;
int i = 0;
cout << " : " << endl;
getline(cin, s);
cout << " : " << endl;
cout<<s;
size_t pos = 0;
... | TOOL | 0.959309 | 3.512094 |
73471838-634f-43a7-a524-8207e0e1830c | Aronnok093/Online-Judge | Toph/Replay of Virtual Techfest 2020 Regional Programming Contest/Password.cpp | #include<bits/stdc++.h>
#define fs() ios::sync_with_stdio(0); cin.tie(0);
#define ll long long
using namespace std;
int main(){
fs()
ll t;
cin>>t;
while(t--){
string s;
cin>>s;
ll len=s.size();
bool cnt1,cnt2,cnt3,cnt4;
cnt1=cnt2=cnt3=cnt4=false;
if(len<10... | ALGO | 0.996887 | 3.815312 |
6eb06621-40ad-4ec6-908f-19e0327fb003 | Sazid99246/problem-solving | Codechef/FAIRSHARE.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n, k;
cin >> n >> k;
int per_person = n / (k + 1);
int net_worth = n - k * per_person;
cout << net_worth << endl;
}
return 0;
}
| ALGO | 0.999979 | 3.600698 |
df8f40b1-35d4-4215-9f80-28f6f4dce9c3 | masterchef2209/coding-solutions | codes/codechef/MYSARA.cpp | /*Read the problem carefully before starting to work on it*/
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
typedef lo... | ALGO | 0.999981 | 3.962585 |
0b6979b3-eb28-4edd-b50d-c628e9eb9b0c | yusifaliyevpro/Competitive-Programming | LeetCode/Medium/863. All Nodes Distance K in Binary Tree.cpp | // 863. All Nodes Distance K in Binary Tree
// https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/
#include <iostream>
#include <vector>
using namespace std;
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int... | ALGO | 0.999959 | 6.206236 |
02801731-483d-4545-865e-a8b454847d28 | youznn/problem-solving | 프로그래머스/3/72413. 합승 택시 요금/합승 택시 요금.cpp | #include <string>
#include <vector>
#include <queue>
#include <iostream>
using namespace std;
//8시 53분
//어피치한테 합승 제안
//'모두' 귀가하는 데 소요되는 예상 최저 택시요금???
// 다익스트라로 풀어 보자...!
// A먼저 다익스트라로 넣고,
// 이후에 B를 ??
// 그 담에 A+B를!
int solution(int n, int s, int a, int b, vector<vector<int>> fares) {
long long int floyd[201... | ALGO | 0.990341 | 3.977024 |
d9d19e4d-3371-485e-af74-57d8685f5b29 | vovadream/opencvfix | modules/imgproc/src/phasecorr.cpp | #include "precomp.hpp"
#include <vector>
namespace cv
{
static void magSpectrums( InputArray _src, OutputArray _dst)
{
Mat src = _src.getMat();
int depth = src.depth(), cn = src.channels(), type = src.type();
int rows = src.rows, cols = src.cols;
int j, k;
CV_Assert( type == CV_32FC1 || type == C... | ALGO | 0.994696 | 5.991439 |
0caaddbe-f4ad-45d2-998b-f58c31465983 | wmjtxt/PAT | Basic/patB1041 考试座位号(15分).cpp | ///
/// @file :patB1041 考试座位号(15分).cpp
/// @author :wmjtxt(<EMAIL>)
/// @date :2018-10-12 08:55:21(NewYork time)
/// @quote :
///
#include <iostream>
#include <unordered_map>
using namespace std;
int main(){
int N, M;
cin >> N;
unordered_map<int,pair<string,int>> in;
string s;
int x,y;
for(int i... | ALGO | 0.999667 | 4.050927 |
de998bd2-468e-499c-a589-0963ad91b3c6 | COMP-3000-Object-Oriented-Programming/assignment-1-Joel-Beauchamp | q4.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main (){
double sphereWeight;
double sphereRadius;
double sphereVolume;
double waterWeight = 62.4;
double bouyantForce;
cout << "How much does the sphere weigh in pounds?\n";
cin >> sphereWeight;
cout << "What is the radius ... | ALGO | 0.999341 | 4.328621 |
37dca71d-fb36-46d3-8879-45317c062520 | wiktal123/AiP-ItA | Balanced Brackets.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
bool is_match(char a, char b) {
return (a == '[' && b == ']') || (a == '{' && b == '}') || (a == '(' && b == ')');
}
bool is_open(char a) {
return a == '{' || a == '(' || a == '[';
}
string isBalanced(... | ALGO | 0.999027 | 6.363905 |
3c3e56e1-5384-4cb9-854a-2da3b98f25e3 | aj-yegoun/ajou_2024_2_winter_mogakso | 15651.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <cctype>
#include <vector>
#include <iterator>
#define FASTIO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
int n, m;
int arr[101010];
int visited[101010];
void back_tracking(int cn... | ALGO | 0.999959 | 4.113326 |
84d9d766-55da-41f4-9e0b-7d4b6ad33c90 | soonkwan1/beakjoon | bj25591.cpp | #include <bits/stdc++.h>
using namespace std;
int n1, n2, a, b, c, d, q, r;
int main(){
cin >> n1 >> n2;
a = 100 - n1;
b = 100 - n2;
c = 100 - (a + b);
d = a * b;
q = d / 100;
r = d % 100;
cout << a << ' ' << b << ' ' << c << ' ' << d << ' ' << q << ' ' << r << '\n';
cout << c + q << ' ' << r << '\n';... | ALGO | 0.98695 | 3.346956 |
5e66596f-64b5-449a-964a-f7b34dbc02a4 | i-am-faith/CODING-NINJAS-CPP | MILESTONE 1/Pattern 2/star_p.cpp | Code : Star Pattern
Print the following pattern
Pattern for N = 4
*
***
*****
*******
Input Format :
N (Total no. of rows)
Output Format :
Pattern in N lines
Constraints :
0 <= N <= 50
Sample Input 1 :
3
Sample Output 1 :
*
***
*****
Sample Input 2 :
4
Sample Output 2 :
*
***
*****
*******
... | ALGO | 0.999949 | 4.577408 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.