uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f2ed71b7-5a5d-4dfd-bacc-fd44bef3b2f7 | kaqu2022/xtu-oj | 日期.cpp | #include <stdio.h>
int main ()
{
int N,year,month,date,i;
int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
scanf("%d",&N);
while(N--)
{
scanf("%d-%d-%d",&year,&month,&date);
if(year%400==0||(year%100!=0&&year%4==0))
a[1]=29;
else
a[1]=28;
int day=0;
for(i=0;i<month-1;i++)
{
day=day+a[i];
}
... | ALGO | 0.999807 | 3.733809 |
aa83b9c7-05fe-4f2c-9656-0a9c47925ec4 | JosueFidelis/Algoritmos | mergesort.cpp | #include <iostream>
using namespace std;
void mergesort(int merge[], int mergeSaida[], int begining, int end);
void intercala(int merge[], int mergeSaida[], int begining, int begining2, int end){
int i, k = i = begining;
int j = begining2 + 1;
while (i <= begining2 && j <= end) {
if (merge[i] <=... | ALGO | 0.999945 | 4.5952 |
39c1a747-88ed-4402-8e0e-a1d5106bb643 | vvanthanh/N22DCDK087_monC | Chapter 13/bt_challenges/c13_bai_chall_17.cpp | #include <iostream>
#include <string>
using namespace std;
class InventoryItem {
private:
string description;
double cost;
int onHand;
public:
InventoryItem(string desc, double c, int qty) {
description = desc;
cost = c;
onHand = qty;
}
string getDescription() const {... | TOOL | 0.954953 | 7.325976 |
5e459dfb-4784-4c92-a037-8b0e0cfaa5ea | mramirez7/CompetitiveProgramming | books/competitive_programming/7-geometry/intersection.cpp | #include <bits/stdc++.h>
using namespace std;
double start_x, start_y, end_x, end_y, lt_x, lt_y, rb_x, rb_y;
double EPS = 1E-12;
struct point{
double x, y;
};
struct line{
double a, b, c;
};
void line_generator(point p1, point p2, line &l){
if (fabs(p1.x-p2.x)<EPS){
l.a = 1.0; l.b = 0.0; l.c = -... | ALGO | 0.998969 | 3.677421 |
bd67be33-4cf1-4461-9b90-b526677a124c | roshnimishraa/Leetcoding | remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int n= nums.size();
if(n==0) return 0;
int i=0;
for(int j=1;j<n;j++){
if(nums[j] != nums[i])
i++;
// place
nums[i] = nums[j];
}
return i+1;
}
}; | ALGO | 0.999924 | 5.852901 |
fb0b9253-4851-475d-8645-e7b1ea74a592 | rohit9123/Daily_question | high_score.cpp | #include<iostream>
#include<vector>
#include<set>
#include<algorithm>
#include<stack>
#include<queue>
#include<string>
#include<map>
#include<cmath>
#include<string.h>
#include<math.h>
#include<unordered_map>
#include<iomanip>
#include<unordered_set>
#define rep(i,x,n) for(int i=x;i<n;i++)
#define ll long long
#defin... | ALGO | 0.999944 | 4.108473 |
39e408e0-34f1-4603-812d-ffe058ce6edc | NikhilGante/LeetCode | NeetCode150/Greedy/Partition Labels (763).cpp | #include <bits/stdc++.h>
using namespace std;
class Solution2 { // Initial O(n^2) solution
public:
vector<int> partitionLabels(string s) {
vector<int> ans;
int furthest = 0, n = s.size(), l = 0;
for(int i = 0; i < n; i++){
int r = n - 1;
for(; s[r] != s[i]; r--);
... | ALGO | 0.999397 | 5.739995 |
fd31bf36-dbcd-4334-8068-4d2bd14d95a5 | danil4157/calculator_for_tests | sources/calculator.cpp | double summary (float a, float b) {
return a + b;
}
double subtraction (float a, float b) {
return a - b;
}
double multiplication (float a, float b) {
return a * b;
}
double division (float a, float b) {
if (b != 0) {
return a / b;
}
else {
return -1;
}
}
double involutio... | TOOL | 0.990605 | 3.459614 |
ae8e7326-c8e0-4e5c-b1ea-cd477531a5c0 | cdecapito/Sim05 | simFuncs.cpp | // Program Information ////////////////////////////////////
/**
* @file simFuncs.cpp
*
* @brief implementation of simulation, simulates
* processes and threading
*
* @details splits meta data into processes and outputs data
*
* @version 1.11 Carli DeCapito
* Schuduling Algorithms ( 11/... | TOOL | 0.97091 | 3.888049 |
bab8c59c-7a1e-435d-a70b-af3a854586fb | BonexGoo/Boss2D | Boss2D/addon/opencv-4.1.1_for_boss/samples/cpp/tutorial_code/snippets/core_various.cpp | #include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/features2d.hpp>
using namespace std;
using namespace cv;
int main()
{
//! [Algorithm]
Ptr<Feature2D> sbd = SimpleBlobDetector::create();
FileStorage fs_read("SimpleBlobDetector_params.xml", FileStor... | ALGO | 0.972976 | 6.382742 |
0d70794d-c5f3-41bb-8850-294f211eb92c | Md-Nasiat-Hasan-Fahim/Problem-Solving-with-C | .acmx/solutions/LightOJ/Brush_III.cpp | #include<bits/stdc++.h>
using namespace std;
#define FastIO ios_base::sync_with_stdio(false), cin.tie(0)
#define endl '\n'
#define int long long
#define all(x) x.begin(),x.end()
#define pb push_back
#define YES cout<<"YES\n"
#define NO cout<<"NO\n"
#define check(x) cout << (#x) << " is " << (x) << endl;
const int mod ... | ALGO | 0.999979 | 4.073359 |
e2b598af-19ab-4e16-ab34-0e4a21527fe6 | ishandutta2007/codeforces | andr0901/normal/1493/A.cpp | //#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
//vector string deque break continue
#define forn(i, s, f) for (int i = (int)s; i < (int)f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define fs first
#define sc second
#defi... | ALGO | 0.9997 | 4.018689 |
1718d1f6-43d0-4311-beb6-403e7b00acfe | MananGandhi1810/PPS-Experiments | experiments/Exp8/prog9.cpp | // WAP to find the number of vowels in entered string using pointer [eg - i/p India o/p -> A-1, E-0, I-2, O-0, U-0]
#include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter n: ";
cin >> n;
char original_string[n];
cout << "Enter string: ";
cin >> original_string;
char *pt... | ALGO | 0.997655 | 5.441934 |
c277043f-c481-45dc-9a60-73b326ee1cdc | ZhenyingZhu/ClassicAlgorithms | src/CPP/src/leetcode/GreyCode.cpp | /*
* [Source] https://leetcode.com/problems/gray-code/
* [Difficulty]: Medium
* [Tag]: Backtracking
*/
#include <iostream>
using namespace std;
// [Solution]: Start from 0 and 1, keep add 2^n to the list in reverse order.
// [Corner Case]:
class Solution {
};
/* Java solution
https://github.com/ZhenyingZhu/Clas... | ALGO | 0.998728 | 5.782662 |
ad5a8273-15bd-4594-a6ec-3698d86d4884 | guru-divine/Codeforces_Code | 1389_b.cpp | //Author: DIVYA RAJ (aka guru_divine)
#include <bits/stdc++.h>
#define ll long long
#define int long long
#define nl "\n"
#define pb push_back
#define popb pop_back
#define F first
#define S second
#define sz(arr) (int)arr.size()
#define vi vector<int>
#define vs vector<string>
#define pii pair<int, int>
#define mapi m... | ALGO | 0.999833 | 4.13825 |
0f4dc423-e1a5-4bd6-b71b-50e2b1f5a5e3 | ishandutta2007/codeforces | panole233/normal/1209/H.cpp | #include<bits/stdc++.h>
using namespace std;
int n,L,id[400010];
double f[400010];
struct node{int l,r; double v;}a[200010];
struct seg{int l,r; double laz,mi;}t[1600010];
void build(int i,int l,int r)
{
t[i].l=l,t[i].r=r;
if (l==r) {t[i].mi=f[l]; return;}
int mid=(l+r)>>1;
build(i<<1,l,mid),build(i<<1|1,mid+1,r)... | ALGO | 0.999955 | 3.484056 |
a9128b89-d027-428b-9376-80a110282b81 | DywangIT/PTIT-Programing | PTIT-DSA/CHUYEN DANH SACH KE SANG MA TRAN KE.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define faster() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
const int MAX_N = 1e6 + 5;
int n;
vector<vector<int>> graph;
void testCase()
{
cin >> n;
cin.ignore()... | ALGO | 0.998978 | 4.065037 |
4ab41e92-35eb-4a72-ad41-589c5255df3b | SALAH-NAME/LC_Solutions | Easy/0219_contains-duplicate-ii/contains-duplicate-ii.cpp | #include <unordered_map>
#include <vector>
class Solution
{
public:
bool containsNearbyDuplicate(std::vector<int>& nums, int k)
{
std::unordered_map<int, int> seen;
for (int i = 0; i < nums.size(); i++)
{
if (seen.find(nums[i]) != seen.end())
{
if (i - seen[nums[i]] <= k)
return true;
}
... | ALGO | 0.999467 | 6.067904 |
965c286e-2eab-4bd6-8e3d-b5aded2ac386 | manishtomar-cpi/DSA-CP | Array/Char-Array/problems/printAllPfefix.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
void printPrifix(string s)
{
// BF
// for (int i = 0; i < s.size(); i++)
// {
// for (int j = 0; j <=i; j++)
// {
// cout << s.at(j);
// }
// cout << endl;
// }
// TWO P... | ALGO | 0.997492 | 4.78929 |
28a6c9d6-ca58-404d-89d3-4b1827fea9c7 | PhamQuan2303/bmi_calculator | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
954ae682-ef9c-478b-aeca-ac6c037d3f47 | DonteWilson/year2 | FuzzyLogic/BehaviouralAI/dep/glm/test/gtx/gtx_simd_mat4.cpp | ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentatio... | TEST | 0.98671 | 6.443896 |
7ee7ca15-556d-42d5-acfd-0d3d5bd3b128 | gourdi/ggp | ggophysics/src/physics/ggo_physics_world.cpp | #include "ggo_physics_world.h"
#include <physics/ggo_collisions.h>
namespace ggo
{
namespace
{
void apply_impulse(ggo::rigid_body * reference_body, ggo::rigid_body * incident_body, ggo::vec2_f r1, ggo::vec2_f r2, ggo::vec2_f impulse)
{
auto cross = [](ggo::vec2_f a, ggo::vec2_f b)
{
ret... | ALGO | 0.989769 | 7.319485 |
18d56c77-0f57-4d0d-91e1-e6e8ee027ca1 | wanggp3/CodeIn2014 | mytemplate/SA_orign.cpp | #include<iostream>
#include<cstring>
#include<set>
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<algorithm>
#include<stdio.h>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;++i)
#define fab(i,a,b) for(int i=a;i<=b;++i)
#define fba(i,b,a) for(int i=b;i>=a;--i)... | ALGO | 0.999023 | 3.046983 |
ec9a81f2-6c88-41dd-9522-73928aa04e3e | mumba-org/mumba | third_party/boost/src/libs/contract/example/features/private_protected_virtual.cpp | #include <boost/contract.hpp>
#include <limits>
#include <cassert>
//[private_protected_virtual_counter
class counter {
// Virtual private and protected functions still declare extra
// `virtual_* = 0` parameter (otherwise they cannot be overridden), but...
protected:
virtual void set(int n, boost::contrac... | TOOL | 0.874073 | 5.958814 |
cec1e09a-a1b7-428c-816a-a56ec6c142df | franc0r/libfrancor | example/src/find_blue_lines_in_image.cpp | #include "francor_algorithm/line_processing_pipeline.h"
#include "francor_vision/image_processing_pipeline.h"
#include "francor_processing/data_processing_pipeline.h"
#include "francor_vision/io.h"
using francor::processing::ProcessingPipeline;
using francor::algorithm::DetectLineSegments;
using francor::vision::Expor... | TOOL | 0.926572 | 6.266602 |
761240e0-88d4-46bb-9205-42102ae8b303 | cjh8993/Algorithms | Chap6/6.PICNIC/PICNIC.cpp | #include <iostream>
#include <string>
#include <vector>
#include <list>
using namespace std;
struct BF{
int f_set[2];
//대소비교를 위한 연산자.
bool operator<(const BF& other)
{
if( f_set[0] < other.f_set[0])
return true;
else
return false;
... | ALGO | 0.99967 | 4.254767 |
36048a3f-00c3-413c-b230-e6a6bc9cf9e4 | WEGFan/Algorithm-Contest-Code | online-judge/CodeForces/CodeForces 1105C.cpp | #include <iostream>
using namespace std;
const int mod = 1e9 + 7;
long long arr[3], dp[200017][3];
void solve(long long &a, long long b)
{
a += b;
while (a >= mod)
{
a -= mod;
}
}
int main()
{
long long n, l, r;
cin >> n >> l >> r;
arr[l % 3] = (r - l + 3) / 3;
arr[(l + 1) %... | ALGO | 0.999927 | 4.205276 |
2e8aae64-7e9a-4a75-89cd-c2e80c6dc733 | exit-code-1/Opengauss-Serverless | src/common/backend/utils/adt/tsrank.cpp | #include "postgres.h"
#include "knl/knl_variable.h"
#include <math.h>
#include "tsearch/ts_utils.h"
#include "utils/array.h"
#include "miscadmin.h"
static float weights[] = {0.1f, 0.2f, 0.4f, 1.0f};
#define wpos(wep) (w[WEP_GETWEIGHT(wep)])
#define RANK_NO_NORM 0x00
#define RANK_NORM_LOGLENGTH 0x01
#define RANK_NO... | ALGO | 0.998016 | 5.934934 |
ac14dffa-de1d-42c0-a47a-d3940cf56a56 | darkv314/CompetitiveProgrammingBackup | PPP/H.cpp | #include <bits/stdc++.h>
#define fori(x, y) for (int i = x; i < y; i++)
#define forj(x, y) for (int j = x; j < y; j++)
using namespace std;
int main()
{
int n;
cin>>n;
cin.ignore();
while(n--)
{
string s;
stack<char>st;
int cont=0,c=0;
getline(cin,s);
if(s.e... | ALGO | 0.999864 | 4.794074 |
a67f50a2-e8cc-4790-b8c3-be9b908eb63a | shinyPy/news_project | 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 |
d4033f22-d8d3-4114-baba-2a8fd6e7aa07 | Rakib-Ahasan/DatastractureAndAlgorithm | PrimeFactorization.cpp | #include<bits/stdc++.h>
using namespace std;
#define MAX 32000
int List[128]; ///saves the List
int listSize;
vector<int>primes;
void sieve(int n)
{
bool isPrime[MAX];
for(int i =0; i<MAX; i++)
isPrime[i]=true;
for(int i=3; i*i<=MAX; i+=2)
{
if(isPrime)
{
for(int j = ... | ALGO | 0.999973 | 4.252398 |
6e3257be-7e2e-4a25-823f-a04275c2daf8 | nkirov/nkirov.github.com | 2005/netb101/Horstmann/ch15/bsearch.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;
/**
Finds an element in a sorted vector.
@param v the sorted vector with the elements to search
@param from the start of the range to search
@param to the end of the range to search
@param a the value to sear... | ALGO | 0.999627 | 5.459786 |
bed648bd-6eec-4698-9cae-2aba9c381931 | rdforte/competitive-programming | LeetCode/Easy/1-two-sum/index.cpp | // https://leetcode.com/problems/two-sum/description/?envType=study-plan&id=level-1
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<int> twoSum(vector<int> &nums, int target)
{
unordered_map<int, int> numMap;
for (int i = 0; i < nums.size(); i++)
{
if (numMap.count(... | ALGO | 0.999295 | 6.544765 |
7c4e133a-8cd6-40b1-b637-172f82da33e8 | wndms710/Coding_test | swift/BOJ/ProblemSet/DFS,BFS 추천문제/cpp/1697.cpp | // https://scarlettb.tistory.com/85
#include <iostream>
#include <queue>
using namespace std;
const int MAX = 100001;
int N, K;
bool visited[MAX] = { 0, };
int path[MAX];
queue<int> q;
void printPath() {
cout << "[PATH]" << endl;
for (int i = N; i <= K; i++) {
printf("%2d ", i);
}
printf("\... | ALGO | 0.999913 | 4.120444 |
81fd576a-7756-44b1-b39c-82a4bb767738 | sarker306/Codeforces | codeforces75C.cpp | #include <cstdio>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <ctime>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
... | ALGO | 0.999955 | 3.820882 |
d340298e-dbd3-44c1-a110-b32ab4d1012f | one-saurabhsingh/Competitive-Coding | codeforces/A_Strong_Password.cpp | #include "bits/stdc++.h"
#define int long long
#define uint unsigned long long
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define fr(i,n) for(int i=0; i<(n); i++)
#define rep(i,a,n) for(int i=(a); i<=(n); i++)
#define nl cout<<"\n"
#define dbg(var) cout<<#var<<"="<<va... | ALGO | 0.999932 | 5.02001 |
636643af-a9a0-4497-8e11-2a0cbabeedf9 | hebaiyang/KnapsackProblem_NEDP | dynamic_programming.cpp | //
// Created by baiyanghe on 03/11/23.
//
#include "dynamic_programming.h"
FPDP::FPDP() {
fp_decimal_digit = 0;
dp_flag = 0;
fp_type_name = "";
integer_scale_range = 0;
max_integer_over_fp = 0;
max_scale_factor = 0;
max_decimal_digit = 0;
}
FPDP::~FPDP() {}
FloatPatternStatePool FPDP::In... | ALGO | 0.964039 | 4.13739 |
8c197f00-81a6-4bb1-aa1a-5e3a55fc9c55 | Stensal/boost | libs/geometry/doc/src/examples/quick_start.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Quickbook Examples, for main page
#if defined(_MSC_VER)
// We deliberately mix float/double's here so turn off warning
//#pragma warning( disable : 4244 )
#endif // defined(_MSC_VER)
//[quickstart_include
#include <boost/geometry.hpp>
#include <boost/geometry/... | TOOL | 0.861334 | 6.385831 |
861cacc0-7b8a-43bd-ab3e-1f0944dc32e9 | cjjtencent/software | leetcode/reversewords.cpp | class Solution {
public:
// function to reverse any part of string from i to j (just one word or entire string)
void reverseword(string &s, int i, int j){
while(i<j){
char t=s[i];
s[i++]=s[j];
s[j--]=t;
}
}
void reverseWords(string &s) {
int i=0, j=0;
int l=0;
int len=s.length();
... | ALGO | 0.999937 | 5.524346 |
a26011f4-85b8-40f5-a797-8ead5c160449 | dreamer2q/learnCpp | learn/acm2/homework14/1001.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
while (cin >> n) {
vector<int> c1(n + 1, 1);
vector<int> c2(n + 1, 0);
for (int i = 2; i <= n; i++) { //循环x^1 ... x^n
for (int j = 0; j <= n; j++) {
for (int k = 0; k + j <= n; k += i) {
... | ALGO | 0.999932 | 3.78691 |
400bfbbb-120b-4b43-a707-fd0f16b430f7 | WilliamDidier/Curve-Drawing-App | eigen/doc/examples/tut_matrix_resize.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,5);
m.resize(4,3);
std::cout << "The matrix m is of size "
<< m.rows() << "x" << m.cols() << std::endl;
std::cout << "It has " << m.size() << " coefficients" << std::endl;
VectorXd v(2);
v.resize(5);
... | ALGO | 0.970448 | 3.882785 |
50b7a487-b394-40c6-8751-62e76b7e0aab | Monal-Patel/amrsolver | lib/boost/libs/contract/example/features/base_types.cpp | #include <boost/contract.hpp>
#include <vector>
#include <algorithm>
#include <cassert>
template<typename T>
class pushable {
public:
void invariant() const {
BOOST_CONTRACT_ASSERT(capacity() <= max_size());
}
virtual void push_back(T x, boost::contract::virtual_* v = 0) = 0;
protected:
virtu... | TOOL | 0.955959 | 7.183741 |
e812dcd6-92bd-41c9-9a92-15e8d3e0e16c | Felipefams/competitiveProgramming | leetcode/hard/median.cpp | //https://leetcode.com/problems/median-of-two-sorted-arrays/description/
#include <bits/stdc++.h>
using namespace std;
//vrum vrum
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0);
//constants
#define endl "\n"
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define exp 1e9
#define imax INT_... | ALGO | 0.999991 | 5.080775 |
d5218483-c0b5-4381-b6f5-ce450b33330d | snewptl/stationaryTraveller | cf-round/2104/A.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <assert.h>
#include <cmath>
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll, int> pli;
typedef std::pair<ll, ll> pll;
typedef... | ALGO | 0.999709 | 4.569763 |
2d5a8f67-c10d-4fbe-ba94-6644a319f36d | elrudrakssh/Dynamic-Programming | code-force-vault/1165E-TwoArraysAndSumOfFunctions.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
typedef long long ll;
int main(){
const ll MOD = 998244353;
ll n; scanf("%lld", &n);
std::vector<ll> a(n); for(ll p = 0; p < n; p++){scanf("%lld", &a[p]); a[p] *= (p + 1) * (n - p);}
std::vector<ll> b(n); for(ll p = 0; p < n; p++){scanf("%lld",... | ALGO | 0.999957 | 4.476788 |
d6c14637-f7d8-4e6f-8e3d-d063334aa4b3 | Vilinz/leetcode | src/108.cpp | #include <iostream>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
TreeNode* newNode(int l, int r, vector<int> &nums) {
if(l > r) {
return nullptr;
}
int mid ... | ALGO | 0.999992 | 6.005666 |
bc4aa490-ecdf-4979-829e-9b463681dbf5 | ddevilz/Cpp | patterns/06_pattern.cpp | #include<bits/stdc++.h>
using namespace std;
void print1(int n ) {
for (int i = 1; i <= n; i++)
{
// if i = 1
// n - row + 1
// if i = 0 then n - 1
for (int j = 1; j <= n - i + 1; j++)
{
cout << j << " ";
}
cout << endl;
}
}
int main()
{
... | ALGO | 0.999875 | 4.009264 |
4bc2b7d2-545b-4bda-8714-4a376b62795f | btrishaa/MTP-II | Message_framing.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>
#include <set>
using namespace std;
// Signal structure
struct Signal {
int id; // Signal ID
int size; // Signal size in bytes
int period; // Pe... | ALGO | 0.999836 | 6.768029 |
60b6e875-dff0-4013-8baa-12328262bf13 | Mymoonah-030/CSE-122FALL2023-51-1 | lab-4/Bit++.cpp | #include<iostream>
#include<conio.h>
using namespace std;
int main()
{
string ch;
int t, i, x=0;
cin>>t;
for(i=0; i<t; i++)
{
cin>>ch;
if(ch[1]=='+')
{
x++;
}
else
x--;
}
cout<<x<<endl;
getch();
}
| ALGO | 0.999813 | 3.791991 |
f01ded0c-34ce-4833-a252-65a95ceaa4ba | shivam-73/Code-With-Harry-DSA- | 10_Circular_LL.cpp | #include<iostream>
using namespace std;
struct node{
int data;
struct node*next;
};
void traversal(struct node*head)
{
struct node*ptr=head;
do{
cout<<ptr->data<<" ";
ptr=ptr->next;
}while(ptr!=head);
}
struct node*InsertatFirst(struct node*head,int element)
{
struct node*ptr=(st... | ALGO | 0.999941 | 3.926448 |
e8ceec29-12ae-41c1-b2c5-fa575b0cc2c9 | mybubble-team/calentre | 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.998859 | 6.785645 |
bde11efa-8470-457b-89b8-1116eb334d25 | nei1ee/WDAlgorithmsNote | 第6章数学问题/6.3质数/6-8素数.cpp | #include<iostream>
#include<vector>
using namespace std;
/**
*˼·ʹɸ
*弴ı
*/
const int MAXN=10001;
bool isPrime[MAXN];
vector<int> prime;
void Init() {
for(int i=0; i<MAXN; i++) {
isPrime[i]=true;
}
isPrime[0]=false;
isPrime[1]=false;
for(int i=2; i<MAXN; i++) {
if(!isPrime[i])cont... | ALGO | 0.999518 | 4.185997 |
fa812216-e2f2-4203-8777-08fe1bccb4af | ykylcxlx/SYSU-crypto-2024 | lab5-RSA加密/submission-2629.cpp | #include<stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include<iostream>
#include <vector>
#include<math.h>
#include<string>
#include <algorithm>
#include<x86intrin.h>
using namespace std;
#define uint8_t unsigned char
#define MGF1_BUF_SIZE 256
// uint8_t seed[32]= {
// 0x84, 0xEE, 0x1D, 0x92, 0xBE, 0xFC, 0... | ALGO | 0.9972 | 3.159046 |
f029b857-f387-4c30-8a02-cf36cacdd36c | Ch-Lokesh/cp_practice | cf_247.cpp | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vb vector<bool>
#define vii vector<vector<int>>
#define vpii vector<pair<int, int>>
#define vs vector<string>
#define fori(i, n) for (int i = 0; i < n; i++)
#define ff fir... | ALGO | 0.999876 | 3.414542 |
4cfa1cb8-7afe-4325-8d6a-5f1a8454d64c | thinkexist1989/ur_ws | src/fmauch_universal_robot/ur_kinematics/src/ur_kin.cpp | #include <ur_kinematics/ur_kin.h>
#include <math.h>
#include <stdio.h>
namespace ur_kinematics {
namespace {
const double ZERO_THRESH = 0.00000001;
int SIGN(double x) {
return (x > 0) - (x < 0);
}
const double PI = M_PI;
//#define UR10_PARAMS
#ifdef UR10_PARAMS
const double d1 = ... | ALGO | 0.999491 | 4.850995 |
f1632217-c56f-47bf-b061-4bd37642d2fa | heesangh/spmm-llm-optimization | optim6/cmake-build-debug/doc/snippets/compile_Cwise_min.cpp | static bool eigen_did_assert = false;
#define eigen_assert(X) \
if (!eigen_did_assert && !(X)) { \
std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X \
<... | TEST | 0.949916 | 3.582302 |
1dece63c-89fd-4824-8cf5-6bb7b00ce221 | Shivam0001/Competitive-Programming | Test/RemoveadjacentCopy.cpp | #include<bits/stdc++.h>
using namespace std;
int flag;
int check(char a[])
{
int len=strlen(a);
for(int i=0;i<len-1;i++)
if(a[i]==a[i+1])
return 1;
return 0;
}
int main()
{
//char new[100];
char a[1000000];
cin>>a;
int i=0,j=0;
while(check(a))
{
i=0;
j=0;
while(a[i]!='\0')
{
if(a[i]=... | ALGO | 0.999989 | 3.464087 |
31a911c8-3de6-4f84-b57e-26f506915fe7 | achpooja/JavaProgram | DSAProgram/stack.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
#define size 4
class Stak
{
int tos=-1 ,stack[size];
public:
// Stak()
// {
// tos=-1;
// }
void push()
{
int item;
// cout<<"Enter the element to push"<<endl;
// cin>>item;
if(tos==size-... | ALGO | 0.966928 | 3.550842 |
72620852-420d-4a92-b539-f25c61dbff36 | Kuliyalrashmi/DSA_Questions | 0015-3sum/0015-3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
int n=nums.size();
sort(nums.begin(),nums.end());
vector<vector<int>>ans;
for(int i=0;i<n;i++)
{
if(i!=0&&nums[i]==nums[i-1])
{
continue;
}
... | ALGO | 0.999951 | 6.059951 |
2f5b6c9a-e896-47a9-9098-dcbd6bcba122 | ishandutta2007/codeforces | memset0c/normal/1088/D.cpp | // =================================
// author: memset0
// date: 2018.12.06 19:22:54
// website: https://memset0.cn/
// =================================
#include <bits/stdc++.h>
namespace ringo {
typedef long long ll;
template < class T >
inline void read(T &x) {
x = 0; register char c = getchar(); register... | ALGO | 0.999839 | 3.060705 |
9700fcf9-3ba9-4e83-8def-d8435d00f515 | didw/coding | algospot/algosrc/src/articulation_point/articulation_point.cpp | #include<sstream>
#include<cassert>
#include<cstdio>
#include<iostream>
#include<string>
#include<vector>
using namespace std;
// 그래프의 인접 리스트 표현
vector<vector<int> > adj;
// 각 정점의 발견 시점. -1 로 초기화한다.
vector<int> discovered;
// 각 정점이 절단점인지 여부를 저장한다. false 로 초기화한다.
vector<bool> isCutVertex;
int counter = 0;
// here 를 루트... | ALGO | 0.999658 | 4.809927 |
87c3c1b7-e07a-479d-a6e7-1b31bf3bb5a2 | SuperMousse/Interview | LeetCode/814_BinaryTreePruning/BinaryTreePruning.cpp | TreeNode* pruneTree(TreeNode* root) {
if (root == nullptr) {
return nullptr;
}
root->left = pruneTree(root->left);
root->right = pruneTree(root->right);
if (root->left == nullptr && root->right == nullptr && root->val == 0) {
return nullptr;
}
return root;
}
| ALGO | 0.999542 | 6.035229 |
37108542-e75d-43f6-b2c2-573fe365de29 | listedlinked/new | src/hash.cpp | #include "hash.h"
int HMAC_SHA512_Init(HMAC_SHA512_CTX *pctx, const void *pkey, size_t len)
{
unsigned char key[128];
if (len <= 128)
{
memcpy(key, pkey, len);
memset(key + len, 0, 128-len);
}
else
{
SHA512_CTX ctxKey;
SHA512_Init(&ctxKey);
SHA512_Update(... | ALGO | 0.997572 | 5.090844 |
552f190e-880c-49cb-851d-bfa5b3b522cb | vasiliyrod/LaboratoryWork1_3 | Laboratory_work_1/Laboratory_work_1/Protein.cpp | #include "Protein.h"
#include<iostream>
Protein::Protein()
{
sequence = "";
}
Protein::Protein(std::string _sequence)
{
sequence = _sequence;
}
Protein::Protein(const Protein& _protein)
{
sequence = _protein.sequence;
}
Protein::~Protein() {}
std::string Protein::concat(std::string sequence2)
{
std::string ans... | ALGO | 0.996864 | 3.342425 |
32e49924-506e-471d-ae08-ce1e8785b34f | sourav-kundu443/Mathletico_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.998762 | 6.786404 |
9c1c33ea-0ed3-4a99-b003-5cf6713a903e | Nalwa-Jayesh/cpp-stuff | arrays/subarray/max_sum_kadane.cpp | #include<iostream>
#include<climits>
using namespace std;
int main()
{
int n;
cout<<"Input the size of array: ";
cin>>n;
int arr[n];
cout<<"Input the array: ";
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int currSum = 0;
int maxSum = INT_MIN;
for (int i = 0; i ... | ALGO | 0.999688 | 4.480816 |
a7bad527-c9a3-40c2-bc73-fdd46fb35dd4 | Abhishekrauniyar2906/Leetcode_Solutions | 22-generate-parentheses/generate-parentheses.cpp | class Solution {
public:
vector<string>result;
bool isValid(string &curr){
int count = 0;
for(auto ch : curr){
if(ch == '('){
count++;
}
else{
count--;
if(count < 0){
return false;
... | ALGO | 0.999804 | 6.238128 |
8631c482-25c2-4d4d-a004-d05280ae15fa | RyokoAzuno/C-Labs | MyTask6/MyTask6/Task3.cpp | #include "pch.h"
#include "Task3.h"
#include <iostream>
#include <ctime>
#include <cmath>
using namespace std;
// Absolute average
int AbsAvg(int *arr, int size)
{
int result = 0;
for (int *p = arr; p != arr + size; ++p)
{
result += *p;
}
return abs(result / size);
}
void ArraySeq()
{
const int SIZE = 100;
... | ALGO | 0.999587 | 4.238229 |
3baff663-1f0d-4877-bf4f-236779313150 | george-popoiu/infoarena_campion | infoarena_campion/secventa.cpp | #include<fstream>
#include<iostream>
#define inf "secventa.in"
#define outf "secventa.out"
#define MaxN 500001
#define MINF -0x3f3f3f3f
using namespace std;
fstream f(inf,ios::in),g(outf,ios::out);
int N,K;
int v[MaxN];
int q[MaxN],Front,Back;
int st,sf;
void Citire()
{
f>>N>>K;
for(int i=1;i<=N;i++)f>>v[i];
}
int ... | ALGO | 0.999976 | 3.690406 |
5e7c4b89-927b-4188-8ddd-cda56c15e66d | alekseystrunets/University | OAIP/lab4/ConsoleApplication4/ConsoleApplication4/ConsoleApplication4.cpp | #include <iostream>
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
int size;
cout << "Введите k - количество элементов массива: ";
cin >> size;
int* arr = { new int[size] };
for (int i = 0; i < size; i++) {
cout << "Введите " << i + 1 << " элемент массива: ";
... | ALGO | 0.999456 | 4.167262 |
0c386884-8d12-464a-8179-af37ce9f0adb | Edgarins29/Doom3 | neo/tools/compilers/roqvq/codec.cpp | #include "sys/platform.h"
#include "framework/FileSystem.h"
#include "framework/Session.h"
#include "tools/compilers/roqvq/codec.h"
float glimit( const float val ) {
if (val<0) return 0;
if (val>255) return 255;
return val;
}
codec::codec() {
int i;
common->Printf("init: initing.....\n");
codebooksize = 256;
... | ALGO | 0.997923 | 4.104589 |
269d4468-c209-4efa-ba0d-7ced0fdd499f | livewj/Project1 | Project-1-coding/main.cpp | #include <iostream>
#include <cmath>
#include <fstream>
#include <iomanip>
using namespace std;
ofstream ofile; //for writing to file
//This function uses Gaussian elimination to solve a tridiagonal matrix.
//Our main problem is to solve the equation - u''(x) = f(x)
//the given function f(x):
double f(double x) {
... | ALGO | 0.999845 | 4.36443 |
73d346b2-db1d-4b92-8731-3157240b1e74 | Pavan-B-N/DSA-with-C_plus_plus | Binary Search/SearchInsertPosition.cpp | // https://leetcode.com/problems/search-insert-position/
#include <vector>
#include <algorithm>
using namespace std;
class Solution
{
public:
// algorithm states to return the index
// if ele found return its inde
// if ele not found return its next greater ele index where i can insert
// so its indir... | ALGO | 0.999943 | 6.534768 |
70ce03e4-0919-4044-8620-ee46a4a1abbd | d1sq/lab3 | Projects/algorithms/Algorithm.cpp | //
// Created by user on 23.03.2021.
//
#include "Algorithm.h"
Algorithm::Algorithm(const Function *function) {
this->function = function;
}
const Function *Algorithm::getFunction() const {
return function;
}
void Algorithm::setFunction(const Function *function) {
Algorithm::function = function;
}
| ALGO | 0.927302 | 4.380749 |
a9e2a2e7-16de-43a7-8bdc-cae7b56c05f2 | AkashDungrani/c_plus_plus | 22-7-3.cpp | #include<iostream>
using namespace std;
int fact(int);
int main()
{
int n,ans;
cout<<"Enter Value Of N = "<<endl;
cin>>n;
ans = fact(n);
cout<<"Factorial Of "<<n<<" is = "<<ans;
}
int fact(int n)
{
if(n<=1)
return 1;
else
return n*fact(n-1);
} | ALGO | 0.998765 | 3.399006 |
b151f27c-881f-4fd9-ad66-de5cf2a78656 | vivekpisal/Leetcode-Problems | 40-combination-sum-ii/40-combination-sum-ii.cpp | class Solution {
public:
void uniqueComb(vector<vector<int>> &ans,vector<int> arr,vector<int>& ds,int tar,int i){
if(tar == 0){
ans.push_back(ds);
return;
}
if(i == arr.size()) return;
for(int ind=i;ind<arr.size();ind++){
if(arr[i] > tar) ... | ALGO | 0.999988 | 6.307635 |
798dace1-06c4-443f-ad55-2500861fc8c3 | slitvinov/lammps-swimmer | src/USER-OMP/bond_harmonic_shift_cut_omp.cpp | /* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include "bond_harmonic_shift_cut_omp.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neighbor.h"
... | ALGO | 0.998237 | 5.955101 |
6d2def4b-fe0a-42c6-a608-5d11f729bdba | ishandutta2007/codeforces | ftiasch/normal/1475/B.cpp | #line 1 "/home/ftiasch/Documents/shoka/util.h"
#include <bits/stdc++.h>
template <typename T = int> T read() {
T v;
std::cin >> v;
return v;
}
template <typename T = int> std::vector<T> read_vector(size_t n) {
std::vector<T> v(n);
for (size_t i = 0; i < n; ++i) {
v[i] = read<T>();
}
return v;
}
#de... | ALGO | 0.999613 | 5.335411 |
318252f0-4ec4-4aa2-8a86-93a92a35e193 | scarlet2131/leetcode | DP/maximum_sum_path_in_matrix.cpp | int Solution::minPathSum(vector<vector<int> > &a) {
int n=a.size();
int m=a[0].size();
int dp[n][m];
dp[0][0]=a[0][0];
for(int i=1;i<m;i++)
{
dp[0][i]=dp[0][i-1]+a[0][i];
}
for(int i=1;i<n;i++)
{
dp[i][0]=dp[i-1][0]+a[i][0];
}
for(int i=1;i<n;i++)
{
f... | ALGO | 0.999939 | 4.29677 |
85b85377-a41c-4cff-bbc4-1a060e3e27e1 | ForOPC/0ad | libraries/source/nvtt/src/src/nvimage/Quantize.cpp | // This code is in the public domain -- <EMAIL>
/*
http://www.visgraf.impa.br/Courses/ip00/proj/Dithering1/floyd_steinberg_dithering.html
http://www.gamedev.net/reference/articles/article341.asp
@@ Look at LPS: http://www.cs.rit.edu/~pga/pics2000/i.html
This is a really nice guide to dithering algorithms:
http://ww... | ALGO | 0.997126 | 6.911335 |
97f61600-8432-4463-ac21-08a7227d85e6 | andrewyli/usaco | usaco2014/mirror.cpp | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream fin("mirror.in");
ofstream fout("mirror.out");
int n, m;
fin >> n >> m;
char field[n][m];
bool visited[n][m];
char buffer;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
... | ALGO | 0.999423 | 3.240757 |
2a7619f0-eda5-4f80-a34b-a8ad9c188d5a | lenskiykirill/algorithms_2022 | verbose.cpp | #include <iostream>
#include "s_alg.h"
int main() {
std::string s;
int x;
dst::__basic_array_trie<int> T;
while (true) {
std::cin >> s;
if (s == "quit")
break;
if (s == "insert") {
std::cin >> s >> x;
T.... | ALGO | 0.995236 | 4.843312 |
ba64102f-07b8-468a-b0f1-261ebd92f1bd | SBhat2615/OpenCV | files/opencv-4.x/modules/features2d/src/kaze/nldiffusion_functions.cpp | /**
* @file nldiffusion_functions.cpp
* @brief Functions for non-linear diffusion applications:
* 2D Gaussian Derivatives
* Perona and Malik conductivity equations
* Perona and Malik evolution
* @date Dec 27, 2011
* @author Pablo F. Alcantarilla
*/
#include "../precomp.hpp"
#include "nldiffusion_functions.h"
#... | ALGO | 0.99992 | 7.032291 |
71ff7144-ceb8-44af-a022-0ec24dc59fb4 | Nolin7777/HysteriaCoreClustering | dep/g3dlite/source/uint128.cpp | /**
@file uint128.cpp
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@author Kyle Whitson
@created 2008-07-17
@edited 2008-07-17
*/
#include "G3D/uint128.h"
namespace G3D {
/** Adds two 64-bit integers, placing the result and the overflow into 64-bit integers.*/
static void addAndCarry(const ... | ALGO | 0.973332 | 7.435829 |
dcdbc169-d2cb-4240-b044-0fb28563feec | EslamKhder/problem-solving-with-c- | Al-Azhar ICPC Community/Sheet #2 (Loops)/X. Convert To Decimal 2.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int numberTest;
cin>>numberTest; // 3 0 1 2
long long num;
for(int i=0;i<numberTest;i++){
cin>>num;
int ones = 0;
while(num > 0){
if(num % 2 == 1){
ones++;
}
num /=2;
}
long long sum = 0;
for(int z=0;z<ones;z++){
sum+= 1 * pow(2... | ALGO | 0.999762 | 4.374352 |
3bba466f-5065-4765-8652-34240a20c046 | Pabfigueira/Maratona | Codeforces/Div2_294D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
ll i, ans;
string word;
vector<ll> prefix;
vector<ll> alphabet(26);
map<char,map<ll,ll>> dp;
for(i=0; i<26; i++) {
cin >> alphabet[i];
}
cin >> word;
... | ALGO | 0.999963 | 3.711785 |
52658599-f9bd-44cc-ab27-fa7db83936a5 | SnowyTulip/-LeetCode | LeetCode100/222完全二叉树节点数.cpp | #include <math.h>
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), left(left), right(right) {}
};
//二分查找+位运算版本
c... | ALGO | 0.999985 | 6.018963 |
7ffacffa-b96f-433e-87e9-5316ef480fee | DucL0c/CPP_PTIT | src/cpp0207 quay vong day so 1.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,d;
cin>>n>>d;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=d;i<n;i++)
cout<<a[i]<<" ";
for(int i=0;i<d;i++)
cout<<a[i]<... | ALGO | 0.999392 | 3.077587 |
53e10278-10c0-435c-809c-b62fe21c18d5 | xincheng624/LeetCode | Algorithm/unique-binary-search-trees/unique-binary-search-trees.cpp | /*Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
For example,
Given n = 3, there are a total of 5 unique BST's.
1 3 3 2 1
\ / / / \ \
3 2 1 1 3 2
/ / \ \
2 1 ... | ALGO | 0.999977 | 5.871256 |
4364f71f-0af6-448a-b533-e5dd67a3ef2c | npanuhin/ITMO-Algo | Dynamic programming/G.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC target("avx2")
// #include <bits/stdc++.h>
// #include "getCPUTime.c"
#include <algorithm>
#include <iostream>
#include <iterator>
#include <limits.h>
#include <cassert>
#include <cstring>
#include <flo... | ALGO | 0.999983 | 4.543354 |
becfdff8-0676-4109-a33a-7af38e98c24c | CellworldProjects/cellworld_controller | src/pid_controller.cpp | #include <controller/pid_controller.h>
using namespace cell_world;
using namespace std;
#define RATIO 1.0
namespace controller{
Pid_outputs Pid_controller::process(const Pid_inputs &inputs, Behavior behavior) {
double speed, P_value, I_value, D_value;
double t = timer.to_seconds(); //* 30;
... | ALGO | 0.994588 | 5.990945 |
7d8a7bab-2341-4946-a6c8-9073f8d2bf3e | Tianyi-Tang/Poj_Algorithm_Practice | Mixed/solution/1006.cpp | #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
#define phsyCycle 5544
#define emotCycle 14421
#define intellCycle 1288
#define maxCycle 21252
int peakDay;
int counter;
void result(){
cout << "Case " << counter << ": the next triple peak occurs in ";
cout << peakDay << " days." << en... | ALGO | 0.999568 | 3.550848 |
f901ddac-e592-4cf1-af6b-2c486edeedbc | ayushshivam48/CPP-Pattern-Printing | equilateraltriangle.cpp | #include<iostream>
using namespace std;
int main(){
int m;
cout<<"Enter no of rows: ";
cin>>m;
for(int i=1;i<=m;i++){
for(int j=1;j<=m-i+1;j++){
cout<<" ";
}
for(int j=1;j<=i;j++){
cout<<"* ";
}
cout<<endl;
}
} | ALGO | 0.996973 | 3.73553 |
c2ce779b-54af-421d-84a4-aa1980f4a523 | ItsukiYoshida/zxing | main/cpp/zxing/pdf417/PDFHighLevelEncoder.cpp | #include "PDFHighLevelEncoder.h"
#include "PDFCompaction.h"
#include "CharacterSet.h"
#include "ECI.h"
#include "TextEncoder.h"
#include "ZXBigInteger.h"
#include "ZXAlgorithms.h"
#include <cstdint>
#include <algorithm>
#include <string>
#include <stdexcept>
namespace ZXing {
namespace Pdf417 {
/**
* code for Text c... | TOOL | 0.94721 | 5.973221 |
a9fd32d5-b518-4def-b693-a5eef1479199 | snewptl/stationaryTraveller | old-memory/Educational_Round#106/B.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e5+10;
int main(){
int T;scanf("%d",&T);
while(T--){
}
return 0;
} | ALGO | 0.993903 | 3.118979 |
d07c4e6a-8d05-46e5-8cc4-5b0418eda141 | luis01qs/Repositorio | Libro/Paradigmas de resolucion de problemas/DP/UVA 507.cpp | // Solución al ejercicio 507 de Online Judge UVA usando Jay Kadane
# include <bits/stdc++.h>
using namespace std;
int main()
{
freopen("prueba.txt", "r", stdin);
freopen("resultado.txt", "w", stdout);
int tt;
cin>>tt;
for(int zz=1;zz<=tt;zz++)
{
int n;
cin>>n;
n--;
... | ALGO | 0.999624 | 4.963761 |
0e294f71-b49d-4850-9575-0fb88496e52c | SutarRutuja/DSAL_Codes | assignment_6.cpp | /*Represent a given graph using adjacency list to perform DFS and BFS.
Use the map of the area around the college as the graph. Identify the
prominent land marks as nodes and perform DFS and BFS on that.*/
#include<bits/stdc++.h>
using namespace std;
class graph{
public:
int v;
unordered_map<int,list<int>>adj;
graph... | ALGO | 0.99938 | 5.00929 |
2c7acf72-525f-4ee2-b306-155484ca9a01 | salimmia/Workstation | Problem Solving/Code_Template/Notes and files/HellBent/Zahin Bhai's Library/DSU On Subtree.cpp | /// Codeforces 601D
/// D[i] = number of distinct strings starting at vertex i and ending on some vertex down subtree i
#include <bits/stdtr1c++.h>
#define MAX 300010
#define clr(ar) memset(ar, 0, sizeof(ar))
#define read() freopen("lol.txt", "r", stdin)
#define dbg(x) cout << #x << " = " << x << endl
using namespac... | ALGO | 0.99977 | 3.797539 |
5f60c7e9-ea18-4973-ba99-eae090e5df71 | raincross7/code-similarity | codes/train_code/problem141/problem141_57.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.99904 | 3.521452 |
28d62d7c-b94b-43d0-9f48-581caf45828e | Ss157/problemSolve | Cbaekjoon/31403.cpp | #include <iostream>
using namespace std;
int main(void)
{
string A, B, C;
cin >> A >> B >> C;
cout << stoi(A) + stoi(B) - stoi(C) << "\n";
string tmp = A + B;
cout << stoi(tmp) - stoi(C);
} | ALGO | 0.999418 | 4.278433 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.