uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
787ee1a7-ab8f-46da-8d14-345ef2feb2f3 | FahimCC/Problem-Solving | Codeforces/A. Word Capitalization.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(NULL);
char a[1010];
cin.getline(a,1010);
//int l = strlen(a);
a[0] = toupper(a[0]);
// if(!(a[0]>=65 && a[0]<=90))
// a[0] = a[0] + 32;
cout<<a<<endl;
return 0;
}
| ALGO | 0.970068 | 3.506 |
92061c9d-f172-4ee3-8bdc-2e862cc0005f | paridhigulati/LeetCode | 1162-as-far-from-land-as-possible/1162-as-far-from-land-as-possible.cpp | class Solution {
public:
int maxDistance(vector<vector<int>>& grid) {
int locMax = 0;
queue<pair<int, int>> q;
for (int i = 0; i < grid.size(); ++i) {
for (int j = 0; j < grid[i].size(); ++j) {
if (grid[i][j] == 1)
q.push({ i, j });
}
}
while (!q.empty()) {
//pa... | ALGO | 0.999899 | 5.553004 |
f60b7921-8aa5-429c-bf75-11a33b62445d | shaikshafiulla/competativeProgramming | dynamic programming/variabletovariable.cpp | #include <bits/stdc++.h>
using namespace std;
int f(int i, int j, int n, int m, vector<vector<int>> &grid)
{
if (i == 0)
return grid[0][j];
if (j < 0 || j >= m)
return -1e8;
int u = f(i - 1, j, n, m, grid) + grid[i][j];
int ld = f(i - 1, j - 1, n, m, grid) + grid[i][j];
int rd = f(i ... | ALGO | 0.999979 | 4.748045 |
feac82a9-0455-474e-a359-cee04b2dc0fc | Quasilius-Starlord/sheet | Minimum swaps and K together.cpp | #include <iostream>
#include <bits/stdc++.h>
class Solution{
private:
public:
int minSwap(int arr[], int n, int k) {
// Complet the function
if(n==1)
return 0;
int window=0;
int i=0,j=0;
int validity=0;
for (int i = 0; i < n; i++)
{
if... | ALGO | 0.999941 | 5.035855 |
8be6a380-a414-4f6d-a328-879ff3537903 | arpituppal/competitive-programming-codes | codeforces/521_div3/521B.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <algorithm>
#include <vector>
#include <cstring>
#include <stack>
#include <cctype>
#include <utility>
#include <map>
#include <string>
#include <climits>
#include <set>
#include <sstream>
#include <utility>
#include <ct... | ALGO | 0.999975 | 4.04968 |
1cb26505-b8d8-4bfe-9b37-dc4c63ab64f1 | Dantovisk/Programacao-Competitiva | GEMA/ED/SegTree/Lazy Propagation/Assignment_to_segment.cpp | #include <bits/stdc++.h> //não é bem uma segtree
using namespace std; //esse exercicio apenas introduz o conceito lazy propagation
#define MAXN 100010
int tree[4*MAXN];
int lazy[4*MAXN];
void unlazy(int no, int l, int r){
if(lazy[no] == -1) return;
tree[no] = lazy[no];
if(r != l){
laz... | ALGO | 0.999823 | 4.518638 |
e4d1c72a-e6ee-43e8-8974-dd9db0446249 | aj-2000/Graphs | BipariteGraphDFS.cpp | #include <bits/stdc++.h>
using namespace std;
bool bipartiteDFS(int node, vector<int> adj[], int color[]){
for(auto it : adj[node]){
if(color[it] == -1){
color[it] = 1 - color[node];
if(!bipartiteDFS(it, adj, color)){
return false;
}
} else if(col... | ALGO | 0.999835 | 5.469473 |
ebce7cde-6871-47ca-a033-6e539aaff739 | crimson000000/OIcode | luogu/2197.cpp | #define LOCAL
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
inline int read()
{
int x = 0, f = 1;
char ch = getchar();
while(ch < '0' || ch > '9')
{
if(ch == '-') f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9')
{
... | ALGO | 0.999953 | 4.296899 |
069e123c-6773-4305-91da-d147dfdaedb4 | plasticny/online-judge | Problem Set Volumes/p0105/105.cpp | #include <iostream>
#include <set>
#include <vector>
#include <algorithm>
#include <tuple>
using namespace std;
int main () {
int l, h, r;
vector<tuple<int, int, bool>> node_ls;
while (scanf("%d %d %d", &l, &h, &r) != EOF) {
if (l == -1) break;
node_ls.push_back(make_tuple(l, h, false));
node_ls.pus... | ALGO | 0.999857 | 3.527526 |
60f0839a-0da4-4cca-ad99-aedc1b04bcc5 | AhmedZ70/BitWise-EducationalApp | levelTwo.cpp | #include "levelTwo.h"
/**
* @author Joseph Corbeil, Johnny Song, Ezekiel Jaramillo, Ahmed Zahran, Raj Reddy, Joel Ronca
* @date April. 22, 2024
* @name levelTwo cpp file for assignment9
* This cpp file contains the the implementation of the methods outlines in the levelTwo h file.
*/
LevelTwo::LevelTwo() : firstBi... | ALGO | 0.998954 | 4.328364 |
353b36eb-3ea7-446c-aedc-bc4a8c9e0d2e | ishandutta2007/codeforces | keshi/normal/1213/D2.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 100;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
#define ll long long
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define X first
#define... | ALGO | 0.999959 | 3.76646 |
1058d62c-762b-4a5a-9e7b-f75ca9f85f9e | ThatGuyVanquish/3DAnimation_AS1 | igl/bijective_composite_harmonic_mapping.cpp | #include "slice.h"
#include "doublearea.h"
#include "harmonic.h"
//#include "matlab/MatlabWorkspace.h"
#include <iostream>
template <
typename DerivedV,
typename DerivedF,
typename Derivedb,
typename Derivedbc,
typename DerivedU>
IGL_INLINE bool igl::bijective_composite_harmonic_mapping(
const Eigen::Matri... | ALGO | 0.987486 | 6.70908 |
f9a9278c-bb1d-4fcb-a71b-bb6d3e780282 | afterklugge/URIONLINE | Lab01DS/p25.cpp | #include <iostream>
using namespace std;
int main()
{
string w1;
string w2;
while (cin >> w1 >> w2)
{
if (w1 < w2)
{
cout << w1 << " < " << w2 << endl;
}
else if (w1 == w2)
{
cout << w1 << " = " << w2 << endl;
}
else
... | ALGO | 0.99987 | 4.069985 |
cc118eab-abbf-41ef-9279-a93b1998b051 | Micky-Virus/opencv | 3rdparty/carotene/src/gaussian_blur.cpp | #include "common.hpp"
#include "saturate_cast.hpp"
#include "separable_filter.hpp"
namespace CAROTENE_NS {
bool isGaussianBlur3x3Supported(const Size2D &size, BORDER_MODE border)
{
return isSupportedConfiguration() && size.width >= 8 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_... | ALGO | 0.991544 | 6.777441 |
3a6817bc-11bc-443f-85e6-eda9e9b7684d | Tanmay-Thanvi/LP3 | DAA/Ass_3/assignment_3b.cpp | // 0-1 KnapSack Problem
#include<iostream>
using namespace std;
int main(){
int capacity = 8;
int items = 4;
int price[5] = {0, 1, 2, 5, 6}; // items + 1
int wt[5] = {0, 2, 3, 4, 5}; // items + 1
int dp[items + 1][capacity + 1];
// Tabulation Method
for(int i = 0; i <= items; i++){
... | ALGO | 0.999968 | 5.866889 |
ffceb964-e855-4afb-a29e-6d57cbf558e8 | ProgrammerShri/Practice-DataStructure-using-C-Plus-Plus | 27.12_sortestDistanceBWTwoNode.cpp | // Time Complexity O(n)
#include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int val)
{
data = val;
left = NULL;
right = NULL;
}
};
Node *LCA(Node *root, int n1, int n2)
{
if (root == NULL)
return NULL;... | ALGO | 0.999995 | 6.045344 |
1dcaa116-89c9-451c-84ca-79fdce5bc8e5 | imsagarchopra/Data-Structures-and-Algorithms-practice | Arrays/Arrays.cpp | #include <iostream>
using namespace std;
template<class T>
class Array
{
private:
T* A;
int size;
int length;
public:
Array()
{
size = 10;
A = new T[10];
length = 0;
}
Array(int sz)
{
size = sz;
length = 0;
A = new T[size];
}
~Array()
{
delete[]A;
}
void Display();
void Insert(int index, T x... | TOOL | 0.972616 | 4.223623 |
5418809d-8cbf-44c7-9203-86a38b78a53c | Devansh-Sood/Data-Structures | heap/kth_smallest_element_in_array.cpp | #include<iostream>
#include<climits>
using namespace std;
int *harr; // pointer to array of elements in heap
int heap_size; // Current number of elements in max heap
void maxHeapify(int i); //To maxHeapify subtree rooted with index i
void MaxHeap(int a[], int size)
{
heap_size = size;
harr = a; // stor... | ALGO | 0.999946 | 4.485702 |
14f24579-13ed-4440-9e0a-7b5849a7bba5 | HeZephyr/Awesome-Algorithm-Resources | Codeforces Round/#750div2/A_Luntik_and_Concerts.cpp | /**
*@filename:A_Luntik_and_Concerts
*@author: pursuit
*@created: 2021-10-24 18:05
**/
#include <bits/stdc++.h>
#define debug(a) cout << "debug : " << (#a)<< " = " << a << endl
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
const int N = 1e5 + 10;
const int P = 1e9 + 7;
const int INF = 0x... | ALGO | 0.9996 | 5.256122 |
3e3bfe0c-0f0b-4b12-a1a0-9e3b27338069 | ColinGilbert/incidental-noise | Noise/implicittriangle.cpp | #include "implicittriangle.h"
#include <cmath>
namespace anl
{
ANLFloatType sawtooth(ANLFloatType x, ANLFloatType p)
{
return (2.0*(x/p-floor(0.5+x/p)))*0.5+0.5;
}
CImplicitTriangle::CImplicitTriangle() : CImplicitModuleBase(), m_source(0.0), m_period(0.0), m_offset(0.0){}
CImplicitTriangl... | ALGO | 0.975583 | 5.915275 |
7885a460-450a-447b-9eb0-2b867c2e8b69 | IamWilson1209/leetcode | Backtracking/39. Combination Sum.cpp | class Solution {
public:
vector<vector<int>> ans;
vector<vector<int>> combinationSum(vector<int>& candidates, int target) {
// 目前嘗試的組合
vector<int> comb;
// function()
combination(candidates, target, 0, comb, 0);
return ans;
}
void combinatio... | ALGO | 0.999824 | 6.298324 |
a2d77b0d-9d3e-4a1e-926d-b0c6f73d4e52 | Chenpi-Sakura/algorithm_practice | cpp/Self-Improvement/WebRecord/matiji/power.cpp | /*
MT1174 A的B次方
输入正整数N,判断它是否可以表示为A的B次方,其中B>1,A>0,都是整数。输出YES或者NO。
*/
/*
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n;
cin >> n;
if (n == 1){
cout << "YES" << endl;
return 0;
}
for (int a = 2; a <= (int)sqrt(n); a++)
{
for (int b = 2, t = ... | ALGO | 0.999884 | 4.518988 |
a3782ad1-5534-4f15-837f-9d015d71f09c | Patrikpcm/Hacker_Rank | Problem Solving/minimum_Distances.cpp | #include <iostream>
#include <vector>
using namespace std;
int minimumDistances(vector<int> a){
int distance = a.size();
for(int i=0; i<(int)a.size(); i++){
for(int j=(int)a.size()-1; j>i; j--){
if(a[i]==a[j] && j-i < distance){
distance = j-i;
}
}
}
... | ALGO | 0.999737 | 4.546857 |
0163ffbb-d753-4803-93af-9f513f980729 | lucaski2/Competitive-Programming | CodeForcesCompleted/InaccurateSubsequenceSearch/main.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <unordered_map>
#include <unordered_set>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n, m, k;
cin >> n >> m >> k;
vector<int> a(n);
vector<int> b(m);
for (int i = 0; i < n; i++)
... | ALGO | 0.999933 | 3.848558 |
d3e787ea-7e19-4bdb-8282-1c9f692600c0 | hribz/llvm-project-postgres | lldb/test/API/lang/cpp/chained-calls/main.cpp | class Bool {
public:
Bool operator&(const Bool other)
{
Bool result;
result.value = value && other.value;
return result;
}
bool value;
};
bool get(Bool object)
{
return object.value;
}
Bool set(bool value)
{
Bool result;
result.value = value;
return result;
}
... | TOOL | 0.9399 | 5.240546 |
cb462fcf-03ed-484f-8c94-cafa4fb4b6fe | kabraneel/Competitive-Programming | Codeforces/CF#1657/C.cpp | // na ho paega humse
// nai_aati_coding
// i love PD
// Motivation when feeling low : http://bitly.com/98K8eH
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
#define int long long
#ifdef KABRANEEL
#define LOCAL
#include "/home/kabraneel/coding/debug.h"
#else
#define debug(x...)
#define debugln(x...)
#e... | ALGO | 0.998105 | 4.246018 |
fbb54ed1-b891-4b5d-9c28-e546225677c0 | joyjoyboy/leetcode | Path Sum/Path Sum.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool recur(TreeNode* node, int sum, int comp){
if(!node) return false;
sum ... | ALGO | 0.999969 | 5.331228 |
0c7136e0-cbe8-4c44-9734-bbe7b3d22539 | luam0oliveira/competitive_programming | contests/simulacao-8/e.cpp | /**
* author: demot.r
* created: 2024-11-16 19:37:23
* source:
* description:
**/
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
int t;cin>>t;
ll mod = 1e9 + 7;
while(t--){
ll a,b;cin>>a>>b;
ll mult = 1;
while(b) {
... | ALGO | 0.999981 | 5.43055 |
dda56b2c-7fe7-4e35-8210-7183cb2775d7 | gnorasi/gnorasi | Gnorasi/src/core/network/networkevaluator.cpp | #include "voreen/core/network/networkevaluator.h"
#include "voreen/core/voreenapplication.h"
#include "voreen/core/network/processornetwork.h"
#include "voreen/core/interaction/idmanager.h"
#include "voreen/core/network/networkgraph.h"
#include "voreen/core/utils/exception.h"
#include "modules/core/processors/output/... | TOOL | 0.873659 | 3.228493 |
7f773512-f514-4143-af0d-5a832628a776 | sxu39/TP-RPMD | lammps-stable_2Aug2023_update2/src/CG-DNA/pair_oxdna2_coaxstk.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Oliver Henrich (University of Strathclyde, Glasgow)
------------------------------------------------------------------------- */
#include "pair_oxdna2_coaxstk.h"
#include "atom.h"
#include "comm.h"
#... | ALGO | 0.99671 | 6.721822 |
ef5816c0-9006-4a3a-bbad-bf7f111eafa3 | Palak206/DSA_LeetCode | 0326-power-of-three/0326-power-of-three.cpp | class Solution {
public:
bool isPowerOfThree(int n) {
if(n== 0){
return false;
}
while(n !=1 ){
if(n%3 !=0)
return false;
n =n/3;
}
return true;
}
}; | ALGO | 0.99941 | 5.825322 |
49f8361a-510f-499e-b3a9-abaa7ded7d05 | quartzcream/tartu_icpc | modifications/general_flow.cpp | #include <bits/stdc++.h>
using namespace std;
//!escape \section{general flow}
//!begin_codebook
struct MaxFlow{
typedef long long ll;
typedef double COST_TYPE;
const ll INF = 1e18;
struct Edge{
int u,v;
ll c,rc;
COST_TYPE cost;
shared_ptr<ll> flow;
Edge(int _u, i... | ALGO | 0.999813 | 3.614935 |
ada98698-44b5-420a-922a-512f7a2bdc24 | Angelina32/progamming_C | Lab02/Lab0203/Lab0203.cpp | #include <iostream>
#include <stdio.h>
#include <conio.h>
#include <math.h>
using namespace std;
int main()
{
setlocale(LC_CTYPE, "ukr");
float x, y;
cout << "Введіть x";
cin >> x;
cout << "Введіть y";
cin >> y;
if ((abs(x) > 1) && (abs(y) > 1) && ((x * x + y * y) < 2))
{
cout ... | ALGO | 0.989345 | 3.558656 |
0312a3f9-5ab3-49da-9730-b02ea59ec0b7 | wyl-lab/raspbian | IntelligenceHomeSys/SecuritySubsystem/SecuritySubsystem/基于OpenCV的人脸识别/opencv-master/samples/cpp/tutorial_code/video/optical_flow/optical_flow_dense.cpp | #include <iostream>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/video.hpp>
using namespace cv;
using namespace std;
int main()
{
VideoCapture capture(samples::findFile("vtest.avi"));
if (!capture.isOpened()){
... | ALGO | 0.994463 | 4.525755 |
3d8d6cdb-2930-4954-bc59-b30276b44bd8 | raincross7/code-similarity | codes/train_code/problem269/problem269_92.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <map>
#include <algorithm> // std::unique
#include <cmath>
#include <limits.h>
#include <queue>
#include <unordered_map>
#include <sstream> // std::ostringstream
#include <bitset>
#include <iomanip>
#include <functional>
#include ... | ALGO | 0.999869 | 4.609319 |
76b85059-c03a-473c-8b7a-9215ce8ae518 | L10yx/LeNet-CUDA-ECE408 | Project/project/third_party/eigen/doc/examples/DenseBase_template_int_middleRows.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(1..3,:) =\n" << A.middleRows<3>(1) << endl;
return 0;
}
| ALGO | 0.963864 | 3.245548 |
7ec60a62-114f-4b0e-bd0f-a3861c635985 | HwpLeo/GAMES | Games101/Assignment/Assignment2/source/rasterizer.cpp | // clang-format off
//
// Created by goksu on 4/6/19.
//
#include <algorithm>
#include <vector>
#include "rasterizer.hpp"
#include <opencv2/opencv.hpp>
#include <math.h>
rst::pos_buf_id rst::rasterizer::load_positions(const std::vector<Eigen::Vector3f> &positions)
{
auto id = get_next_id();
pos_buf.emplace(id... | ALGO | 0.962833 | 6.940475 |
b116df03-6ecf-4d13-89bf-1abdcca7f672 | siddiqui-zeeshan/Leetcode | Code/Insertion Sort List.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* insertionSo... | ALGO | 0.999993 | 5.854187 |
89624203-19df-47a3-9fc3-b5b791cb0678 | asad5059/CP | A_Polycarp_and_Coins.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define ff first
#define ss second
using namespace std;
using namespace __gnu_pbds;
template <typename PB>
using ordered_set = tree<PB,n... | ALGO | 0.999442 | 4.166266 |
fe91c342-3eae-4a6b-bc42-1afc807ee2b5 | PulockDas/Data-Structure-SWE-128 | Chapter 5 (Linked List)/insertion in linked list.cpp | #include <bits/stdc++.h>
using namespace std;
struct node{
int data;
struct node* next;
};
struct node* head;
void insert(int x, int y)
{
node* temp1=new node();
temp1->data=y;
if(x==1){
temp1->next=head;
head=temp1;
return;
}
node* temp2=head;
for(int i=0;i<x-2;i++)
... | ALGO | 0.999776 | 3.721514 |
1dbb145b-757a-4a7a-8551-ba5f5b87fcac | GQH123/Renatus-ACM-Codes | 2019 百度之星·程序设计大赛 - 初赛二/E.cpp | #include <bits/stdc++.h>
#define maxr 100000
#define maxn 200019
#define rep(i, l, r) for (register int i = l; i <= r; i++)
#define per(i, r, l) for (register int i = r; i >= l; i--)
#define srep(i, l, r) for (register int i = l; i < r; i++)
#define sper(i, r, l) for (register int i = r; i > l; i--)
#define gc() ((p1 =... | ALGO | 0.999326 | 3.700711 |
7651f6b1-0663-404b-9bee-b8bc5cea33c9 | giangkhai/FPGA-based-CNN | Vitis/conv_size64.cpp | #include <stdint.h>
// Define image dimensions
#define WIDTH 64
#define HEIGHT 64
void conv(uint8_t image_in[HEIGHT][WIDTH], uint8_t image_out[HEIGHT][WIDTH], char kernel[3][3]){
// Control interface separate from data interfaces
#pragma HLS INTERFACE s_axilite port=return bundle=CTRL_BUS
#pragma HLS INTE... | ALGO | 0.943164 | 5.416589 |
099eb5b4-2db6-4ae2-b3cf-21defd19693d | smileandyxu/Visualized-Neural-Networks | code/src/model/math_utils.cpp | #include <cmath>
#include "math_utils.h"
double sigmod(double v){
return 1.0/(1+exp(-v));
}
double dsigmod(double v){
// v=sigmod(v);
return v*(1-v);
}
//double tanh(double x){
// return (exp(x) - exp(-x)) / (exp(x) + exp(-x));
//}
double dtanh(double outx){
// double tanh = (exp(outx) - exp(-out... | ALGO | 0.995959 | 5.408699 |
dbabfcf9-cabc-4483-8d9e-d0e5ecde2453 | AditiDiti/technical26cohort_cpp | a1_q9.cpp | #include<iostream>
using namespace std;
int main(){
int num1, num2;
cin >> num1 >> num2;
int dvd = num1;
int div = num2;
while(dvd % div != 0){
int rem = dvd % div;
dvd = div;
div = rem;
}
cout<<div<<endl;
int lcm = (num1 * num2) / div;
cout<<lcm<<endl;... | ALGO | 0.999992 | 3.70249 |
70040bd5-5e50-4f94-8340-994bd6a68e58 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_8028_0.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, a[N], depth[N];
long long Up[N], Down[N], Total_down[N], sum, sumDown[N];
vector<int> adj[N];
void input() {
scanf("%d", &n);
for (int i = (1), _b = (n); i <= _b; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
for (int nhi = 0, _n = ... | ALGO | 0.999744 | 3.814215 |
9024b418-9cb3-4024-becb-bf313008a0cb | abhiram138b/LEETCODE | permutation-in-string/permutation-in-string.cpp | class Solution {
public:
bool cmp(int *mp,int *temp){
for(int i=0;i<26;i++){
if(mp[i] != temp[i]){
return false;
}
}
return true;
}
bool checkInclusion(string &s1, string &s2) {
int k = s1.size();
int size = s2.size();
... | ALGO | 0.999971 | 6.132825 |
835d8140-7a4c-4753-9c7d-1aa9f1d65926 | KCNyu/Program-MSU | C++_CLASS_TEST/Dec_1/mystack.cpp | /*================================================================
* Filename:mystack.cpp
* Author: KCN_yu
* Createtime:Mon 30 Nov 2020 06:16:40 PM CST
================================================================*/
#include <iostream>
#include <stdlib.h>
using namespace std;
#define MAX 256
class node{
public:
... | ALGO | 0.991787 | 3.912386 |
8de30fe2-b1c2-4224-921d-c291374d1126 | Hongik-Univ-SoEn/Hongik-Software-Engineering | Hongik-Software-Engineering/source/Entities/CompanyMember.cpp | /**
* Project 채용 정보 시스템
*/
#include "CompanyMember.h"
#include <map>
/**
* CompanyMember implementation
*/
CompanyMember::CompanyMember() {
id = "";
pw = "";
companyName = "";
businessNumber = "";
}
CompanyMember::CompanyMember(string id, string pw, string companyName, string businessNumber) {
... | TOOL | 0.942631 | 5.107581 |
c5efa3d3-8562-4f43-82b9-c2f3f014dc64 | junyoung-o/PS-Cpp | Segment_Tree/1275.cpp | #include <stdio.h>
#define max_size 100001
int list_n[max_size];
int main(void) {
int n, q;
scanf_s("%d", &n);
scanf_s("%d", &q);
for(int i = 0; i < n; i++) {
int temp;
scanf_s("%d", &temp);
list_n[i] = temp;
}
for(int i = 0; i < q; i ++) {
int x, y, a, b;
long long int result = 0;
scanf_s("%d %... | ALGO | 0.999632 | 3.683939 |
65c1824f-43ec-4186-b340-ec0eb931057f | dailyco/problem-solving | 프로그래머스/2019_카카오_개발자_겨울_인턴십/수식_최대화/dailyco.cpp | /*
작성자 : dailyco
문제 난이도: 하
해결시간: 00:40:00
문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/67257
블로그 링크 : https://dailyco.github.io/posts/formula_maximization/
*/
#include <string>
#include <vector>
#include <sstream>
using namespace std;
void strtok_s(string str, string delimeter, vector<long long> &numbe... | ALGO | 0.999995 | 4.874193 |
099738c9-5d03-4aac-8c96-01d768c7f4c0 | Tittanc/Reponame | UnacademyCourse/PythonToCPPOct/Lecture4/little_girl_max_sum.cpp | // Problem Link -
/* By Sanket Singh */
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
#define ll long long int
#define ld long double
#define mod 1000000007
#define inf ... | ALGO | 0.999972 | 4.092058 |
c8b6985c-9a9e-4bca-854e-8165b3426248 | htbkoo/cplusplus | src/onlinePlatform/leetcode/leetcoding_challenge/2024/mar2024/week1/squares_of_a_sorted_array.cpp | #include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <limits>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <iterator>
#include <sstream>
#include <iostream> // includes cin to read from stdin and cout to write to stdout
using namespace std; // since cin and cout a... | ALGO | 0.999974 | 5.773303 |
440c375d-ca1d-4a07-b79c-d7a0d3bc7eb0 | raincross7/code-similarity | codes/train_code/problem230/problem230_123.cpp | #include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<cstring>
#include<sstream>
using namespace std;
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rr... | ALGO | 0.999913 | 3.525515 |
3665bba6-4a6a-4226-a3fb-55dcef684bc2 | alamin5G/Codeforces | codeforces228A.cpp | /**
* @file codeforces228A.cpp
* see the problem - https://codeforces.com/problemset/problem/228/A
* @author Md. Alamin (<EMAIL>)
* I would love be a software engineer at Google. That is why anybody can uses this code without any condition, if you face any difficulty, then try to email me.
* @version 0.1
* @date ... | ALGO | 0.999845 | 4.463681 |
d9a16011-8d82-4f63-8451-3a44dc5c3c5b | 24Pranav/Leetcode_practice | leetcode-main/leetcode-main/0128-longest-consecutive-sequence/0128-longest-consecutive-sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
if(nums.size()<=1)
return nums.size();
unordered_set<int> set;
for(auto &x:nums)
set.insert(x);
int len=1;
for(auto &x:set)
{
if(!(set.find(x-1)!=set.end()))
... | ALGO | 0.999938 | 5.553518 |
21feae19-5c00-4990-8672-007b43e093f2 | KIRITOASUNAFOREVER/Binusian2024AlgoritmaPemrograman | BINUSIAN 2024 WEEK 8 BAWA PULANG/Team Trees (Problem A) Version 2.cpp | #include <stdio.h>
long long int total(int n, long long int sum){
if(n>0){
int a; scanf(" %d", &a);
return total(n-1, sum+a);
}
if(n==0){
return sum;
}
}
int main(){
int t; scanf(" %d", &t);
for(int C = 1; C <= t; C++){
int n; scanf(" %d", &n);
printf("Case #%d: %lld\n", C, total(n,0));
}
}
| ALGO | 0.999067 | 3.907804 |
86564207-8f04-4ded-96bb-a3394e7a9be3 | isolent/ADS | altron/lab3/E.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int mx1 = -1, mx2= -1;
for (int i = 0; i < n; i++){
int x; cin >> x;
if (x > mx1){
mx2 = mx1;
mx1 = x;
}
else if (x > mx2 && x < mx1){
mx2 = x;
}
}
... | ALGO | 0.999986 | 4.075459 |
a4afc746-53ee-4adf-a3d7-cfa8452e466e | llynv/CP-files | codeforce/1882B.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair<int, int>
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define per(i, a, b) for (int i = (b)-1; i >= ... | ALGO | 0.999197 | 5.113141 |
e87bb0d7-7a57-476b-bed0-4b5cd52e84e9 | grayhacker91/Algorithm | beajoon/5598/main.cpp | #include<iostream>
#include<string>
using namespace std;
int main() {
string str;
cin >> str;
for (int i = 0; i < str.size();i++) {
if (str[i] - 3>=65) {
char a = str[i] - 3;
cout << a;
}
else {
char a = str[i] + 23;
cout << a;
}
}
return 0;
} | ALGO | 0.992673 | 3.677521 |
38bc166c-a843-4042-a5fa-6a30c8178609 | neharvard/LeetCode | Daily Challenge/Design/1865. Finding Pairs With a Certain Sum.cpp | /*
Leetcode Link : https://leetcode.com/problems/finding-pairs-with-a-certain-sum
*/
/***************************************************************** C++ *****************************************************************/
//Approach (Using map and approach similar to Two Sum Problem)
//T.C : O(m+n) ... | ALGO | 0.99994 | 6.297073 |
35ff1a14-a301-4624-ab18-9be27e5f266a | raincross7/code-similarity | codes/train_code/problem300/problem300_434.cpp | #include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(void){
// Your code here!
int n,m;
cin>>n>>m;
vector<vector<int>> vec(m);
vector<int> p(m,0);
int a,b;
for(int i=0;i<m;i++){
cin>>a;
for(int j=0;j<a;++j){
cin>>b;
b--;
vec[i].pus... | ALGO | 0.999904 | 3.614357 |
b3ddfeff-d9ec-45f2-ad29-9e1f84a53426 | anuragdandge-mcoe/Assignments | OOP/OOP Unit 5/classTemplateSwapping.cpp | #include <iostream>
using namespace std;
template <class T>
class demo
{
T a, b, temp;
public:
demo(T x, T y)
{
a = x;
b = y;
}
void swap()
{
cout << "\n Before Swap A = " << a << ", B = " << b << endl;
temp = a;
a = b;
b = temp;
cout <... | ALGO | 0.991904 | 5.061837 |
07d654c8-6f88-446d-b511-0696411721de | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_2732_6.cpp | #include <bits/stdc++.h>
using namespace std;
bool notprime[1010];
int pw[60];
vector<int> sp;
long long X;
void init() {
for (int i = 2; i <= 1000; i++) {
if (notprime[i]) continue;
for (int j = i * i; j <= 1000; j += i) notprime[j] = true;
}
for (int i = 2; i <= 37; i++)
if (!notprime[i]) sp.push_ba... | ALGO | 0.999573 | 3.768971 |
1499e67b-7db2-4f58-9c22-34c70ba9fca1 | omteja04/Contest-Programs | CodeChef/Happy_New_Year.cpp | /**
* Author: omteja04
* Created on: 01-01-2025 20:46:56
* Description: Happy_New_Year
**/
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
/*
=========================
Headers
=========================
*/
#pragma G++ optimize("Ofast")
#pragma G++ target("sse,sse2,sse3,ssse3,sse4,popcnt,abm... | ALGO | 0.999002 | 3.636668 |
14c6f717-c5e9-4617-983f-8091ce34f6cd | sarvex/leetcode-clojure | solution/2400-2499/2497.Maximum Star Sum of a Graph/Solution.cpp | class Solution {
public:
int maxStarSum(vector<int>& vals, vector<vector<int>>& edges, int k) {
int n = vals.size();
vector<vector<int>> g(n);
for (auto& e : edges) {
int a = e[0], b = e[1];
if (vals[b] > 0) g[a].emplace_back(vals[b]);
if (vals[a] > 0) g[b... | ALGO | 0.999991 | 5.793853 |
71627575-91ff-4d44-ab79-076421647982 | 1604078-MEHEDI/SPOJ | ROCK.cpp | ///https://www.spoj.com/problems/ROCK/
#include <bits/stdc++.h>
using namespace std;
#define INF 1<<30
#define endl '\n'
#define maxn 100005
#define tc printf("Case %d: ", cs)
#define tcn printf("Case %d:\n", cs);
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
... | ALGO | 0.999958 | 4.081952 |
1cff25e6-7625-4a22-8557-1191b921ca82 | wayfinder/Wayfinder-S60-Navigator | CPP/Targets/MapLib/Shared/src/PositionInterpolatorMath.cpp | #include "PositionInterpolatorMath.h"
#include "GfxConstants.h"
#include <math.h>
#include "Utility.h"
inline float64 getCosLat( int32 lat )
{
static const float64 mc2scaletoradians = 1.0 / (11930464.7111*
180.0/3.14159265358979323846);
return cos( mc2scaletorad... | ALGO | 0.998658 | 6.871631 |
64d22630-2a96-41a9-9207-9211a3308c45 | sarvex/leetcode-powershell | solution/0700-0799/0775.Global and Local Inversions/Solution.cpp | class Solution {
public:
bool isIdealPermutation(vector<int>& nums) {
int mx = 0;
for (int i = 2; i < nums.size(); ++i) {
mx = max(mx, nums[i - 2]);
if (mx > nums[i]) return false;
}
return true;
}
}; | ALGO | 0.999985 | 5.643504 |
bb8f2458-52da-4d85-ac79-5e410daa684d | temasek/android_external_llvm | lib/Analysis/IntervalPartition.cpp | #include "llvm/Analysis/IntervalIterator.h"
using namespace llvm;
char IntervalPartition::ID = 0;
INITIALIZE_PASS(IntervalPartition, "intervals",
"Interval Partition Construction", true, true)
//===----------------------------------------------------------------------===//
// IntervalPartition Impleme... | ALGO | 0.958818 | 7.498781 |
ecf5a672-b03c-47ba-9fd6-c278874f2b1c | Pratikm765/DSA | StackQueue/InfixNotations/postfixtoinfix.cpp | #include<bits/stdc++.h>
using namespace std;
bool isOperator(char element) {
switch (element) {
case '+':
case '-':
case '/':
case '*':
case '^':
return true;
}
return false;
}
string postfixtoinfix(string postfix) {
stack<string> st;
int length = postfix.size();
... | ALGO | 0.999975 | 5.401715 |
ea4918d1-1560-4204-a4a3-ef7f9c12974e | NeedyDenisIOS/OAIP-sem2 | OAIP/laba6/лаба 6.cpp | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
struct Item {
int number;
Item* next;
};
bool check(string v)
{
for (int i = 0; i < v.length(); i++)
if (isdigit(v[i]) == true)
return true;
return false;
}
void console(Item*& p);
void adding(Item*&, int n);
int del(Item*&, int ... | TOOL | 0.887607 | 3.745582 |
61f21c4c-380a-4375-81e6-d655f52100fa | moluwentu/Cocos2d-x-learning | secondGame/cocos2d/cocos/2d/CCAutoPolygon.cpp | #include "2d/CCAutoPolygon.h"
#include "poly2tri/poly2tri.h"
#include "base/CCDirector.h"
#include "renderer/CCTextureCache.h"
#include "clipper/clipper.hpp"
#include <algorithm>
#include <math.h>
USING_NS_CC;
static unsigned short quadIndices9[]={
0+4*0,1+4*0,2+4*0, 3+4*0,2+4*0,1+4*0,
0+4*1,1+4*1,2+4*1, 3+4*... | ALGO | 0.996842 | 4.411828 |
b27c724a-331a-4499-b3f2-4cbf3fc96c2c | jacktreado/dpm | main/test/dpm/singlehesstest.cpp | // File to compute dynamical matrix of single DPM particle at force balance
//
// Will:
// initialize particle,
// set constants,
// relax shapes + positions,
// ** COMPUTE HESSIAN,
// print configuration + eigenvalues
//
// Compilation command:
// g++ -O3 --std=c++11 -I src main/test/singlehesstest.cpp ... | ALGO | 0.928261 | 4.805609 |
dca48d58-695b-49f6-b1f2-ef4091cddb65 | checkcheck897/ps | BOJ/15824.cpp | #include <bits/stdc++.h>
# pragma GCC optimize ("O3")
# pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#define x first
#define y second
#define pii pair<int, int>
#define ll long long
#define pll pair<ll, ll>
using namespace std;
ll p = 1e9+7;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0)... | ALGO | 0.999948 | 4.1824 |
91b57a68-5e02-45bd-a8a6-bdcafe8df6bf | TwistyLime/CodeChef-Contest-Solutions | 03_COOKOFF/COOK139D/Janmansh_and_Assignments.cpp | #include <iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int x;
cin>>x;
if(x+3<=10)
{
cout<<"Yes\n";
}
else{
cout<<"No\n";
}
}
return 0;
} | ALGO | 0.998591 | 3.514885 |
a48129c3-239d-4345-97ec-4dd61a843bc3 | ishandutta2007/codeforces | compute/normal/1252/H.cpp | #include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x...) do{cout << "\033[32;1m" << #x << "->" ; err(x);} while(0)
void err(){cout << "\033[39;0m" << endl;}
template<template<typename...> class T,typename t,typename... A>
void err(T<t> a,A... x){for (auto v:a) cout << v << ' '; err(x...);}
te... | ALGO | 0.999984 | 4.546922 |
616c4e4d-029f-42ee-bd29-41135258c156 | Sean95164/CP | 2024_IONcamp/Ch3_BasicSkill/binary_search/CF1701C.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
bool check(int n, int m, vector<int> count, int mid) {
vector<int> peo(n+1, mid);
// each people do their proficent best for more
for (int i = 1; i <= n; i++) {
int remain = peo[i] - count[i];
if (remain < 0) {
... | ALGO | 0.999996 | 5.119053 |
3893358a-66f9-4b8a-a940-807499da48a3 | AdnanMuzavor/PDS | Graph/Number_of_ways_to_arrive_at_destination.cpp | /*
1976. Number of Ways to Arrive at Destination
Medium
723
22
Add to List
Share
You are in a city that consists of n intersections numbered from 0 to n - 1 with bi-directional roads between some intersections. The inputs are generated such that you can reach any intersection from any other intersection and that th... | ALGO | 0.999973 | 5.933076 |
e5d93b5a-b17c-4ae9-ac49-6fd78272acc2 | raymondlee2020/leetcode-practice | problems/#208/v1.cpp | struct TrieNode {
TrieNode* children[26];
bool isEnd = false;
TrieNode* get(char c) {
return children[c - 'a'];
}
void add(char c) {
children[c - 'a'] = new TrieNode();
}
};
class Trie {
public:
TrieNode* root;
Trie(): root(new TrieNode()) {}
void insert(string... | ALGO | 0.999808 | 6.373948 |
c52cdb35-1ce0-4b76-9caa-cccf618ed03f | Iwannnn/oj | leetcode/82.remove-duplicates-from-sorted-list-ii.cpp | /*
* @lc app=leetcode.cn id=82 lang=cpp
* @lcpr version=30204
*
* [82] 删除排序链表中的重复元素 II
*
* https://leetcode.cn/problems/remove-duplicates-from-sorted-list-ii/description/
*
* algorithms
* Medium (55.12%)
* Likes: 1385
* Dislikes: 0
* Total Accepted: 547.8K
* Total Submissions: 993.6K
* Testcase Exam... | ALGO | 0.999983 | 6.431421 |
21e7ba2a-c1c0-43db-84c2-b6cdf524e6be | andreiarnautu/Algorithmic-Problems-Part-2 | posta2.cpp | /**
* Worg
*/
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
FILE *fin = freopen("posta2.in", "r", stdin);
FILE *fout = freopen("posta2.out", "w", stdout);
const int MAX_N = 1 + 100000;
/*----------------------*/
int N, M;
int Tax[MAX_N];
bool Good[MAX_N];
vecto... | ALGO | 0.999106 | 3.87991 |
ff7fbef3-3cf3-4029-8020-a14da1150855 | Sanghyunn/2021-Summer | Day3/Change_5585.cpp | #include <iostream>
using namespace std;
int main(){
int m_list[] = {500, 100, 50, 10, 5, 1}; // 거스름돈 리스트
int price; cin >> price;
if(price < 1000)
{
int cnt = 0;
int change = 1000 - price;
for(int i = 0; i < 6; i++)
{
cnt += (change / m_list[i]); // m_list[i] 화폐로 거스러줄수 있는 갯수 count
change %= m_li... | ALGO | 0.999512 | 4.587104 |
55bcaa4e-80e0-4fb7-b87e-e8dc34522a0b | XKCdeQ/C_stydy | 数据结构/数据库第三章作业1.cpp | /*************************************************************
дʱ䣺2021-1-5
汾V1.0
ߣ
ܣʽջṹϯᶼӲϯ֮ǰ
ݣ˵ָ
ıջ
****************************************************************/
/*ͷļ*/
#include<iostream>
#include<cstdlib>
using namespace std;
typedef char ElemType;
/*ʽջ洢ṹ*/
typedef struct SNode
{
ElemType data; /*洢Ԫ*/
stru... | ALGO | 0.997747 | 3.112501 |
7f139ce3-15de-4972-a9b0-b46272b4423e | iam1513/CPP-DSA | C49gaPolymorphism.cpp | /*
- ability of objects/methods to take different forms
* compile time polymorphism
- function overloading - no. of functions with same function name but they perform diff acc to arg passed
*/
#include<iostream>
using namespace std;
class Sum{
public:
void add(int x, int y){
int sum = ... | TOOL | 0.915937 | 5.067801 |
a111ab79-b8e6-4777-bfe4-6086032b01c9 | AKGP/Codeforces | 16A.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
char mat[n][m];
for(int i =0;i<n;i++){
for(int j =0;j<m;j++){
cin>>mat[i][j];
}
}
int flag=1;
int j;
for(int i =0;i<n;i++){
for(j =0;j<m-1;j++){
if(mat[i][j]!=mat[i][j+1]){
flag = 0;
... | ALGO | 0.999964 | 3.488948 |
c09672b5-a965-4b65-80a4-2600c9af917a | SLIIT-FacultyOfComputing/tutorial-02b-IT21259098 | tute02.cpp | /*Exercise 2 - Selection
Convert the C program given below which calculates an employee's salary to a C++ program.
Input Type, Salary, otHours
Type = 1
OtRate = 1000
Type = 2
OtRate = 1500
Type = 3
OtRate = 1700
Please Note that the input command in C++ is std::cin. This is a representation of the Keyboard.*/
#incl... | ALGO | 0.876267 | 3.221773 |
5c87913a-cf91-4d8a-a93e-78539b4292bf | zhang-chuanfeng/cpplanguage | algorithm_partition.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
// 打印辅助函数
void print(const std::string& message, const std::vector<int>& vec) {
std::cout << message;
for (int x : vec) {
std::cout << x << ' ';
}
std::cout << '\n';
}
int main() {
// 测试数据
std::vector<int> num... | ALGO | 0.99935 | 5.897543 |
a851d798-a26b-4437-b935-3dc96ddf199e | stamp465/C_Programming | Camp2_61/Day3/entropy.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string arr[8] = {"A","B+","B","C+","C","D+","D","F"};
double check[8] = {0},s=0;
while(1){
string a;
cin >> a;
if(a[0]=='Q') break;
else{
for(int i=0;i<8;i++)
{
if(a==arr[i]) ... | ALGO | 0.998356 | 3.571179 |
fa2cfa71-4e6f-4562-a866-0230e4dbae99 | ishandutta2007/codeforces | denisson/normal/622/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
#define forn(i, n) for (int i = 0; i < n; i++)
#define form(i, n, m) for (int i = n; i <= m; i++)
//
#define read(x) scanf("%d", &x)
#define write(x) printf("%d", &x)
#define read2(x, y) scanf("%d %d", &x, &y)
//
#define clr(a, n)... | ALGO | 0.999899 | 3.569371 |
d7152867-7113-4e54-86eb-b9e017cf59c5 | minhnguyeenx/HAUI_CTDLVGT | TH4/TH4_BTVN_Bai2.cpp | #include <bits/stdc++.h>
using namespace std;
void Selection_sort(string x[], int n){
for(int i = 0; i < n-1; i++){
int m = i;
for(int j = i+1; j < n; j++){
if(x[m] > x[j]){
m = j;
}
}
string tg = x[m];
x[m] = x[i];
x[i] = tg;
}
}
... | ALGO | 0.999856 | 4.148132 |
d41de54e-a34e-4e14-aef7-f39b9f1e5021 | sarvex/leetcode-nim | lcof2/剑指 Offer II 022. 链表中环的入口节点/Solution.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* detectCycle(ListNode* head) {
ListNode* slow = head;
ListNode* fast = head;
bool hasCycle = false;... | ALGO | 0.999912 | 5.82197 |
a9639323-addd-48ee-b75c-9601dc9db890 | Aman18111625/LeetCode-Solutions | 1539-kth-missing-positive-number/1539-kth-missing-positive-number.cpp | class Solution {
public:
/*
//Brute-Force Approach
//TC:=>O(N) && SC:=>O(N)
//insert all the number into set and find kth missing number.
int findKthPositive(vector<int>& arr, int k) {
int no=1,cnt=0;
unordered_set<int>s;
for(auto it : arr)
{
s.insert(it)... | ALGO | 0.999983 | 5.02813 |
58a95d4d-f980-4853-8b56-789da36da782 | Gonu923/1181 | 1074.cpp | #include<stdio.h>
int main()
{
int t,i;
long int n;
scanf("%d",&t);
for(i=0; i<t; i++)
{
scanf("%ld",&n);
if(n==0)
{
printf("NULL\n");
}
if(n%2==0&&(n>0))
{
printf("EVEN POSITIVE\n");
}
else if(n%2==0&&(n<0))
... | ALGO | 0.99907 | 3.428368 |
7014b20f-99a8-4297-a228-927b4ae98507 | Deepak-png981/Data_Structures_And_Algorithms | 2305-fair-distribution-of-cookies/2305-fair-distribution-of-cookies.cpp | class Solution {
public:
void helper(int start, const vector<int>& cookies, vector<int>& temp, int k, int& ans) {
int n = cookies.size();
if (start == n) {
int maxi = INT_MIN;
for (int i = 0; i < k; i++) {
maxi = max(maxi, temp[i]);
}
a... | ALGO | 0.999959 | 5.683727 |
812d2ecd-0fa0-4c2d-bf84-18993cd83f66 | Eirene961/Sorting | Sorting/Source.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <ctime>
#include <vector>
#include <string>
#include <string.h>
#include <algorithm>
#include <chrono>
using namespace std;
template <class T>
void Swap(T& a, T& b)
{
T x = a;
a = b;
b = x;
}
//-------------------------------------------------
// Th... | ALGO | 0.999259 | 4.663357 |
3f04d426-20b3-452a-8a97-167ac73e7c6d | lakshits11/LeetCode | 49-group-anagrams/49-group-anagrams.cpp | class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
unordered_map<string, vector<string>> mp;
for (string s : strs) {
mp[strSort(s)].push_back(s);
}
vector<vector<string>> anagrams;
for (auto p : mp) {
anagrams.push_b... | ALGO | 0.999998 | 6.606236 |
fb713e66-63f1-4e47-95df-676a1fb2d9bc | ifvlaboratory/boost | libs/math/tools/bessel_data.cpp | #include "mp_t.hpp"
#include <boost/math/tools/test_data.hpp>
#include <boost/math/special_functions/bessel.hpp>
using namespace boost::math::tools;
using namespace boost::math;
using namespace boost::math::detail;
using namespace std;
// Compute J(v, x) and Y(v, x) simultaneously by Steed's method, see
// Barnett et... | ALGO | 0.996846 | 6.046522 |
073f9ec9-14fa-41e1-94fd-5deb390f22b3 | trivedipankaj/Spoj | MMAXPER.cpp | #include<iostream>
using namespace std;
int max( int a , int b) {
return (a>b) ? a:b;
}
main(){
int t,h,w,h1,h2,l1,l2,t1,t2;
scanf("%d",&t);scanf("%d%d",&h,&w);
h1= h;l1=w;
h2= w; l2=h;
while(--t){
scanf("%d%d",&h,&w);
t1= m... | ALGO | 0.99976 | 3.734408 |
962ec3f9-eb6e-4ba4-944f-bbc8cced74ed | JuliaReach/AAAI22_RE | Sherlock/examples/tests/headers/eigen_file/bench/perf_monitoring/llt.cpp | #include "gemm_common.h"
#include <Eigen/Cholesky>
EIGEN_DONT_INLINE
void llt(const Mat &A, const Mat &B, Mat &C)
{
C = A;
C.diagonal().array() += 1000;
Eigen::internal::llt_inplace<Mat::Scalar, Lower>::blocked(C);
}
int main(int argc, char **argv)
{
return main_gemm(argc, argv, llt);
}
| ALGO | 0.997918 | 4.213988 |
ebd009df-a720-4262-ac75-e0fd3e4b6b47 | d-graz/Splashy | src/Arduino/Splashy/libraries/FiniteStateMachine/FiniteStateMachine.cpp | #include "FiniteStateMachine.hpp"
#define ATTRACTION_TIME 30000 ///< The time in milliseconds to spend in the attract state. If no one interacts with the penguin, it will go to the sad state.
#define ATTRACTION_STATE_ACTIVATION_TIME 120000 ///< The time that needs to pass before the penguin enters the attract state fr... | ALGO | 0.986438 | 5.474637 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.