uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9991bf48-95fa-4abd-8894-f025a6bde25c | orhtej2/leetCode | add-two-numbers/runner.cpp | #include <iostream>
#include <vector>
#include "linked_list.hpp"
#include "solution.hpp"
int main()
{
auto input1 = int_to_list(92345);
auto input2 = int_to_list(11111);
Solution s;
auto result = s.addTwoNumbers(input1.get(), input2.get());
std::cout << input1 << " + " << input2 << " = " << resul... | ALGO | 0.999405 | 6.228679 |
bc24482a-b132-4a1c-8a17-dd0b004ce2e5 | luanaamorim04/competitive_programming | cses/teleporter-path.cpp | #include <bits/stdc++.h>
#define int long long
#define MAXN (int)(1e6 + 10)
#define all(x) x.begin(), x.end()
#define ii pair<int, int>
#define iii tuple<int, int, int>
#define esq(x) (x<<1)
#define dir(x) ((x<<1)|1)
#define MOD (int)(1e9 + 7)
#define BASE 37
#define MAXL 20
#define INF (int)(1LL<<30)
#define PI 3.1415... | ALGO | 0.999986 | 4.204951 |
d7b0293c-ce40-4973-812c-26061d158e3a | raincross7/code-similarity | codes/train_code/problem329/problem329_387.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define S... | ALGO | 0.999991 | 4.089607 |
a6237289-2895-46e4-bd9f-5caaa06d45d6 | naman-ked/codeit | potd/2023-05-12_Array_Operations.cpp | /*
You are given an array arr of n integers. You must return the minimum number of operations required to make this array 0.
For this you can do an operation :
Choose a sub-array of non-zero elements & replace all with 0(0 must be present in arr, if not you can not replace it).
Example 1:
Input:
n = 4
arr = {3,0,4,5}... | ALGO | 0.999966 | 6.049341 |
33670fab-7f9e-41ca-ad8c-eee3fd8bc8cd | ToxicPie/codebook | content/numeric/fwht.cpp | // source: waynedisonitau123
void xorfwt(int v[], int l, int r) {
if (r - l == 1) return;
int m = l + r >> 1;
xorfwt(v, l, m), xorfwt(v, m, r);
for (int i = l, j = m; i < m; ++i, ++j) {
int x = v[i] + v[j];
v[j] = v[i] - v[j], v[i] = x;
}
}
void xorifwt(int v[], int l, int r) {
if (r - l == 1) return;
int ... | ALGO | 0.999936 | 3.705597 |
05196eda-795e-4606-83be-f3c7a1a78e47 | 22922511/DSA-FOR-PROBLEM-SOLVING | DP/subsequence not Count of Binary Strings0100.cpp |
#include <bits/stdc++.h>
using namespace std;
int n;
int dp[1000001][4];
int rec(int l,int state){
//pruning
//base case
if(l==0) return 1;
//cache
if(dp[l][state]!=-1) return dp[l][state];
//transition
int ans=0;
if(state<3){
ans=rec(l-1,state)+rec(l-1,state+... | ALGO | 0.999993 | 4.136905 |
4954ea8d-a423-4ac7-9508-9fe57b7402b5 | A7medGhanem/Grade | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
a392ec3e-f0c2-4e9b-ac0c-13358595b8f8 | Amankumar140/Leetcode | Strings/Hard/Basic Calculator.cpp |
class Solution {
public:
int calculate(string s) {
stack<int> st;
int ans = 0;
int num = 0;
int sign = 1;
st.push(sign);
for (char ch : s) {
if (isdigit(ch)) {
num = num * 10 + (ch - '0');
} else if (ch == '+' || ch == '-') {
... | ALGO | 0.999994 | 5.350539 |
e9a4d6a1-8b47-4484-8cf9-826ecbba9e68 | mafimashrafi/C-DSA-and-Problem-solving | arrInput.cpp | #include<iostream>
using namespace std;
int getMax(int arr[], int size){
int max = INT8_MIN;
for(int i=0; i<size; i++){
if(arr[i]>max){
max = arr[i];
}
}
return max;
}
int getMin(int arr[], int size){
int min = INT8_MAX;
for(int i=0; i<size; i++){
if(arr[i... | ALGO | 0.999808 | 4.338938 |
de4a1c05-0db5-48b3-8c73-a8f4f2a0f828 | karabaos/UnrealVN | Engine/Source/ThirdParty/Box2D/Box2D_v2.3.1/Box2D/Dynamics/Joints/b2WheelJoint.cpp | #include <Box2D/Dynamics/Joints/b2WheelJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Linear constraint (point-to-line)
// d = pB - pA = xB + rB - xA - rA
// C = dot(ay, d)
// Cdot = dot(d, cross(wA, ay)) + dot(ay, vB + cross(wB, rB) - vA - cross(wA, rA))
// = -dot(ay, vA) -... | ALGO | 0.962679 | 6.959435 |
3437943b-796a-4210-93a6-e7271ba7564e | yanxiuzi/opencv-3.4.2-build-with-ffmpeg-and-cuda | 3rdparty/carotene/src/reduce.cpp | #include "common.hpp"
#include <cstring>
namespace CAROTENE_NS {
void reduceColSum(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s32 * dstBase)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
memset(dstBase, 0, size.width*sizeof(s32));
s... | ALGO | 0.996762 | 6.186884 |
f445eb77-19f5-41af-943f-86f100d25922 | kundan6930/coding_contest | atcoder/Denso Create Programming Contest 2023 (AtCoder Beginner Contest 309)/B_Rotate.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main (){
int n;
cin>>n;
vector<string>a(n);
for(int i=0;i<n;i++)
{
cin>>a[i];
}
// cout<<s<<endl;
// for(int j=0;j<s.length();j++)
// {
// // int k;
// // cin>>k;
... | ALGO | 0.999987 | 3.343105 |
2b6b63bb-c3cf-4ab7-b47a-2ed4c722c2ac | LiquidPlayer/LiquidCore | deps/boost_1_66_0/libs/graph/test/clustering_coefficient.cpp | #include <iostream>
#include <boost/graph/undirected_graph.hpp>
#include <boost/graph/directed_graph.hpp>
#include <boost/graph/exterior_property.hpp>
#include <boost/graph/clustering_coefficient.hpp>
using namespace std;
using namespace boost;
// number of vertices in the graph
static const unsigned N = 5;
templat... | TEST | 0.920799 | 6.837326 |
ddb860bc-3e72-4526-bee6-84e2d9d80ce6 | vpatelcsguy/AlgorithmsDataStructures | Project2/main.cpp | #include "BinarySearchTree.h"
#include "RBTree.h"
#include <iostream>
#include <fstream>
#include <string>
#include <time.h>
#include <cstring>
using namespace std;
void printPrompt();
void printMenu();
void printSelectionForSearch(const string& file);
bool wordMatching(string const &searchFor, string const &word);
v... | ALGO | 0.973499 | 4.269836 |
d40da11d-f5c8-4261-96c3-0fbc66cf1b6a | knh4735/Algorithm | Baekjoon/Backtracking_2529_inequality.cpp | /*
2529 부등호 Backtracking
<와 >가 나열된 문자열, 부등호 사이사이에 서로다른 한자릿수를 넣어 모든 부등호 관계를 만족시키는 k+1자리의 수를 구해 최대,최소를 찾기
입력 : 부등호의 수 2 <= k <= 9 \n 부등호들
출력 : 부등호를 만족하는 최댓값 \n 최솟값
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int n;
char list[11], max[11] = "0000000000", min[11] = "9999999999";
int dupCheck(int k, char... | ALGO | 0.999963 | 3.498288 |
afc2c35f-43bf-46a9-993b-c0cadff104b3 | hfkfo/CSES_Solution | Range_Queries/Range_Xor_Queries.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,q,a,b;
cin >> n >> q;
int x[n+1] = {0},ans[n+1] = {0};
for(int i = 1 ; i<= n ; i++)
{
cin >> x[i];
}
ans[1] = x[1];
for(int i = 2 ; i<= n ;i++)
{
ans[i] = ans[i-1]^x[i];
}
for(int i = 0 ; i < q ; ... | ALGO | 0.999996 | 4.430972 |
48092b97-a8bd-4ec3-aa14-28dca9666355 | kintzhao/cv-slam | ARToolkitPlus/src/librpp/MATLAB/robust_pose.cpp | // Author: Thomas Pintaric <<EMAIL>>
#include <vector>
#include "../rpp.h"
#include "../rpp_types.h"
#include "../rpp_vecmat.h"
#include "mex.h"
using namespace rpp;
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
const mxArray *model_p, *iprts_p;
double *model_v, *iprts_v, *R_... | ALGO | 0.99978 | 6.474825 |
2e5c4979-5279-41a5-85d7-2c1d04d08fa9 | rudzen/ThicknessGauge | testOpenCV/CV/HoughLinesR.cpp | #include <opencv2/core.hpp>
#include "HoughLinesR.h"
bool HoughLinesR::is_lines_intersecting(Side side) {
auto& lines = side == Side::Right ? right_lines_ : left_lines_;
if (lines.empty())
return false;
auto size = lines.size();
if (size == 1)
return true;
auto intersects = tru... | ALGO | 0.997294 | 5.486961 |
762e4c63-cb2b-43bc-86d5-89e91b18a435 | 1lann/aio-camp-2015 | dp/palin_old.cpp | #include <fstream>
#include <iostream>
#include <map>
#include <string>
using namespace std;
map<string, int> palindromeChanges;
int leastChangesPlaindrome(string inputString) {
if (palindromeChanges.find(inputString) != palindromeChanges.end()) {
return palindromeChanges[inputString];
}
if (inputString.length... | ALGO | 0.999553 | 4.327683 |
7911a8c4-0da8-4fce-ab72-de93dffa19f8 | danielbociat/AlgoLabETH | Week04/Antenna/main.cpp | #include <iostream>
#include <vector>
#include <CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h>
#include <CGAL/Min_circle_2.h>
#include <CGAL/Min_circle_2_traits_2.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt K;
typedef K::Point_2 P;
typedef CGAL::Min_circle_2_traits_2<K> Trait... | ALGO | 0.9988 | 4.210123 |
8636593d-9167-4374-89ab-404810babb52 | Rahul-Kumar-Parida/400-DSA_Practice_ACCENTURE | ArrayQues30/Q13.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int N;
cin >> N;
int sum = 0;
for (int i = 1; i <= sqrt(N); i++)
{
if (N % i == 0)
{
sum += i;
if (i != N / i)
{
sum += N / i;
}
}
}
... | ALGO | 0.999891 | 4.994146 |
f2000e42-be85-4907-ada1-dcc811649f62 | Harshsat/9900079892_PARVAM_CEC | cpp_training/day2/day103.cpp | //to check how many vowels are there in a string//
#include<iostream>
using namespace std;
int main()
{
int n=0,v=0;
char str[n];
cout<<"enter the string"<<endl;
cin>>str;
while(str[n]!='\0')
{
if(str[n]=='a'||str[n]=='e'||str[n]=='i'||str[n]=='o'||str[n]=='u'||str[n]=='A'||str[n]=='E'||... | ALGO | 0.996464 | 3.746028 |
aa84473c-c4bf-4d01-ba5c-5212772d7827 | dabaier/code | 可视化/数据处理相关文件/C++DATA/5_FactorialSum/Factorialsum-21.cpp | #include <iostream>
using namespace std;
int main()
{
int fac(int);
int a,b;
cin>>a>>b;
cout<<fac(a)+fac(b)<<endl;
}
int fac(int n)
{
int i,sum=1;
for(i=1;i<=n;i++)
{
sum=sum*i;
}
return sum;
}
| ALGO | 0.999938 | 4.726991 |
7b1c108c-37c5-4781-bf67-f61ded5fbad4 | berkkadirr/22BILP0093-EDANUR-HASKOL | 22BİLP0093 EDANUR HASKOL/soru 19.cpp | #include<stdio.h>
int main(){
float sayi1 = 0;
float sayi2 = 0;
double sonuc = 0;
char islem = ' ';
printf("\n Hesap Makinesi");
printf("\n 1.sayi :");
scanf("%f",&sayi1);
printf("\n 2.sayi :");
scanf("%f",&sayi2);
fflush(stdin);
printf("\n Islem :(+ - * /)");
scanf("%c",&islem);
switch(islem){
... | ALGO | 0.950514 | 3.003593 |
6a58d649-df0d-4d6a-84e1-c8fa77901f9a | NericeCore/Street-WoW | dep/acelite/ace/ACE_crc32.cpp | // $Id: ACE_crc32.cpp 91286 2010-08-05 09:04:31Z johnnyw $
#include "ace/ACE.h"
namespace
{
/*****************************************************************/
/* */
/* CRC LOOKUP TABLE */
/* ===========... | TOOL | 0.989919 | 6.562897 |
4839775b-d5c9-4d36-a4f5-e183924a2a63 | dshawshank/Blender-android_arm64 | extern/bullet2/src/BulletSoftBody/btDefaultSoftBodySolver.cpp | #include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
#include "btDefaultSoftBodySolver.h"
#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
#include "BulletSoftBod... | ALGO | 0.946904 | 7.481757 |
694f5d2e-cb06-4320-a77e-40c17d4eafc5 | styxBeneath/Programming-Abstractions-2021-Spring | Assignment5/pqueue-vector.cpp | /*************************************************************
* File: pqueue-vector.cpp
*
* Implementation file for the VectorPriorityQueue
* class.
*/
#include "pqueue-vector.h"
#include "error.h"
VectorPriorityQueue::VectorPriorityQueue() {
// TODO: Fill this in!
words = new Vector<string>();
}
VectorPrio... | TOOL | 0.930128 | 5.726288 |
6222c106-519d-4e50-9b08-64db608628fb | DzikuVx/QmuBeaconLocator | qsp.cpp | #include "Arduino.h"
#include "variables.h"
#include "qsp.h"
uint8_t crc8_dvb_s2(uint8_t crc, uint8_t a)
{
crc ^= a;
for (int ii = 0; ii < 8; ++ii) {
if (crc & 0x80) {
crc = (crc << 1) ^ 0xD5;
} else {
crc = crc << 1;
}
}
return crc;
}
void qspComputeCrc... | TOOL | 0.949276 | 5.544138 |
d27919f8-96de-44c5-91ae-38a47d01d3eb | r4tn3sh/ncofdm_final | src/puncturer.cpp | /*! \file puncturer.cpp
* \brief C++ file for the puncture class.
*
* The puncturer class punctures the convolutionally encoded data to
* effectively increase the coding rate. On the receive side it
* depunctures the received punctured data by inserting 0's into the
* "puncture holes".
*/
#include <cmath>... | TOOL | 0.962364 | 6.191412 |
a50e3e47-25ee-41c0-827d-aa096d8b182d | Diaa-Abuelwafa/Datastructures-Problems | 03 Singly List/Demo & Problems/Problems/Medium/4.cpp | #include <iostream>
#include <cassert>
#include <vector>
using namespace std;
struct Node
{
int data;
Node* next = nullptr;
Node(int data) : data(data)
{
}
};
class LinkedList
{
private:
Node* head = nullptr;
Node* tail = nullptr;
int length = 0;
public:
LinkedList()
{
}
void print()
{
for (Node... | ALGO | 0.998856 | 5.321685 |
070f9079-453f-468e-b0cc-0035eafed2f1 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_1371_5.cpp | #include <bits/stdc++.h>
using namespace std;
template <class X, class Y>
void amax(X &x, const Y &y) {
if (x < y) x = y;
}
template <class X, class Y>
void amin(X &x, const Y &y) {
if (x > y) x = y;
}
const int INF = 1e9 + 10;
const long long INFL = (long long)1e18 + 10;
int n, m;
void process() {
cin >> n >> m;... | ALGO | 0.999976 | 3.042206 |
1782e53e-0c72-458b-90df-a6d0a026a90e | cristian-albu/cpp | pbinfo-exercises/001-basics/operators-and-expressions/asii.cpp | #include <iostream>
int main()
{
int a, b;
std::cin >> a;
std::cin >> b;
int sum = a + b;
int diff = a - b;
int product = a * b;
int quotient = a / b;
std::cout << sum << " " << diff << " " << product << " " << quotient << std::endl;
return 0;
} | ALGO | 0.999403 | 4.369344 |
ed20a8f2-db57-405b-86fa-eb4e126290ae | InvisibleQAQ/Learn_Data_Structures_and_Algorithm_by_myself | 7第八章排序/5SimpleSelectionSort.cpp |
// 交换
void swap(int &a, int &b) {
int temp = a;
a = b;
b = temp;
}
void SelectSort(int A[], int n) {
for (int i = 0; i < n - 1; i++) { // 一共进行n-1趟
int min = i; // min记录最小元素位置
for (int j = i + 1; j < n; j++) { // 在A[i]到A[n-1]中选择最少的元素
... | ALGO | 0.999851 | 4.087325 |
bef53675-dd0c-4ee2-9a5d-ef5fb662c33f | akansha2002/LeetCode | 0034-find-first-and-last-position-of-element-in-sorted-array/0034-find-first-and-last-position-of-element-in-sorted-array.cpp | class Solution {
public:
int firstOccurence(vector<int>& nums, int target, int ans){
int s = 0, e = nums.size()-1;
while(s <= e){
int mid = s + (e-s)/2;
if(nums[mid] == target) {
ans = mid;
e = mid-1;
}
else if(nums[mid]... | ALGO | 0.999919 | 6.452087 |
5808e95c-b8ef-4811-ba37-8b97b3e0cf9d | deepakmani2027/DSA | ARRAY/binary search/bottom_of_lower_mountain.cpp | #include <iostream>
using namespace std;
int bottomMountain(int arr[100], int size)
{
int start = 0, end = size - 1, mid;
while (start <= end)
{
mid = (end + (start - end) / 2);
if (arr[mid] < arr[mid - 1] && arr[mid] < arr[mid + 1])
{
return mid;
}
else i... | ALGO | 0.999925 | 5.356569 |
434bf605-74c4-4c2a-9465-8b99e02d7695 | Rajeshnds/Competitive-Programming | codeforces/dragonmas/codeforces(c++)/D2_Equalizing_by_Division_hard_version_.cpp | #include<bits/stdc++.h>
using namespace std;
int n,k,a[200001],b[200001],c[200001];
void solve(){
int ans=1e9;
for(int i=0;i<n;i++){
int d=a[i],j=0;
while(d){
b[d]+=j;
c[d]++;
if(c[d]==k)ans=min(ans,b[d]);
d/=2;
j++;
}
}
... | ALGO | 0.999944 | 3.8218 |
03081d13-5102-47e8-a3b7-09f29ae66583 | DerrickPikachu/Leetcode | submission/Remove_Zero_Sum_Consecutive_Nodes_from_Linked_List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* removeZeroSumSublists(ListNode* head) {
unordered_map<int, ListNode*> mp;
vector<int> accumulate;
... | ALGO | 0.99961 | 5.826209 |
05427ac6-ad8f-48ec-8b5a-076beaff9501 | thakurshashant/CPP-Codes | C++/Pattern Problems/Patterrn17.cpp | #include<iostream>
using namespace std;
int main(){
cout<<"start program"<<endl;
/* *
**
***
**** */
int n;
cin>>n;
int i=1;
while(i<=n){
//Print spaces
int space = n-i;
while(space){
cout<<" "<<" ";
space--;
}
//Print stars
int j=1;
while(j<=i){
cout<<"*"<<"... | ALGO | 0.999974 | 3.811738 |
2239c5fa-5db9-4aea-8712-7d450f97f31e | NUCAR-DEV/multi2sim-iiswc2016 | part4/MatrixTranspose/MatrixTranspose.cpp | #include "MatrixTranspose.hpp"
// auxiliary functions to read event time
double ReadEventTime(cl_event& event);
int MatrixTranspose::setupMatrixTranspose() {
cl_uint inputSizeBytes;
// allocate and init memory used by host
inputSizeBytes = width * height * sizeof(cl_float);
input = (cl_float*)malloc(inputSiz... | ALGO | 0.890374 | 6.597099 |
f2a8a9aa-9b2b-4bbd-99cf-92635b4b2880 | HarshCasper/NeoAlgo | C-Plus-Plus/math/Pronic_numbers.cpp | /*
A pronic number is a number which is the product of two consecutive integers.
Such as 2=2*1 (2 and 1 are consecutive numbers)
12=4*3
This program will print the pronic numbers in the given range.
*/
#include <iostream>
#include <math.h>
using namespace std;
/* Function to check whethe... | ALGO | 0.998964 | 4.653428 |
506ff2a3-937e-4818-b793-1360c453460e | RobbiAdiansyah/tugas_praktikum_c | pertemuan ke 4/tugas 1 program menentukan bilanganv2.cpp | #include <stdio.h>
int main()
{
int B;
printf("program muntuk menentukan bilangan ganjil atau genap\n");
printf("----------------------------------------------------\n");
printf("masukan bilangan yang akan di nilai :");
scanf("%i", &B);
if (B%2==1) {
printf("bilangan diatas adalah \"GANJIL\"");
}else {
pr... | ALGO | 0.998246 | 3.063498 |
8556eb04-c824-4bb6-a771-bbd5f49130a9 | Suyashmishra13/USACO-Questions | FlightRoutes.cpp | #include <bits/stdc++.h>
using namespace std;
void dfs(vector<int> adj[][2],int cur,int state,vector<bool> &vis){
vis[cur] = true;
for(int x:adj[cur][state]){
if(!vis[x]){
dfs(adj,x,state,vis);
}
}
return;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
... | ALGO | 0.99999 | 4.015217 |
c399debe-14f3-4446-813e-bc9e2f623a13 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/11/1101/personal_submission/cf295c_alwaysce.cpp | #include <bits/stdc++.h>
using i64 = long long;
using namespace std;
i64 mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
/*
总共有 n 人在散步,他们立刻决定过河。
我们知道,这条船最多可以载重 k 千克的人。
每个人的体重要么是 50 千克,要么是 100 千克。
现在格雷格想知道,要把整个小组的人运到对岸,小船至少要过河多少次。
小船至少需要一个人驾驶才能从河岸到达对岸。
小船过河时,只要乘客的总重量不超过 k ,乘客的人数不为... | ALGO | 0.999743 | 3.680925 |
74c41be8-0ca0-4dff-986a-b76280f34b69 | Mayur299/DSA-project1 | av.cpp | #include<bits/stdc++.h>
#define Max 4000
#define base 10
using namespace std;
struct bigInt{
int len;
int data[Max];
bigInt (){
memset(data,0,sizeof(data));
len=0;
}
int check (const bigInt &a,const bigInt &b){
if(a.len>b.len)return(0);
if(b.len>a.len)return(1);
for(int i=a.len;i>=1;--i){
if(a.data[... | ALGO | 0.999038 | 3.885221 |
0a4531dc-99d2-4db0-b30b-0602338db750 | hwan0806/SYCL_study | example/cpg/generate_table.cpp | /*
Author: Thomas Kim
First Edit: July 24, 2021
Factorial - https://en.wikipedia.org/wiki/Factorial
k-permutations of n - (nPr)
Permutation - https://en.wikipedia.org/wiki/Permutation
k-combinations of n - (nCr)
Combination - https://en.wikipedia.org/wiki/Combination
Factorial Calculator (x!)
h... | ALGO | 0.997074 | 6.088112 |
eaccfabb-4945-427b-9ee8-23e90bb7dcb6 | Sebitp/summer2023 | summer2023/dp/subsetarraysum.cpp | #include <math.h>
using namespace std;
#include <vector>
#include <algorithm>
#include <iostream>
#include <limits.h>
#include <unordered_set>
#include <numeric>
class Solution {
public:
bool canPartition(vector<int>& nums) {
int res = accumulate(nums.begin(),nums.end(),0);
if(res%2 != 0) return fa... | ALGO | 0.999921 | 5.56284 |
e2ced38e-44dc-43f5-873e-4e118e859671 | hezhaojiang/leetcode-cpp | 1071.字符串的最大公因子.cpp | /*
* @lc app=leetcode.cn id=1071 lang=cpp
*
* [1071] 字符串的最大公因子
*/
#include<string>
#include<algorithm>
using namespace std;
// @lc code=start
class Solution {
int gcd(int a , int b) {
return b ? gcd(b, a % b) : a;
}
public:
string gcdOfStrings(string str1, string str2) {
int len1 = (int)... | ALGO | 0.99967 | 6.321025 |
6d925e43-9b80-4648-8e86-9666b8f016fc | ahernandezGit/QuadMixerConsole | igl/normal_derivative.cpp | template <
typename DerivedV,
typename DerivedEle,
typename Scalar>
IGL_INLINE void igl::normal_derivative(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedEle> & Ele,
Eigen::SparseMatrix<Scalar>& DD)
{
using namespace Eigen;
using namespace std;
// Element simplex-size... | ALGO | 0.999426 | 5.798705 |
11b4dfd5-9f45-47d0-bf40-7e6ef5863dee | K0nnyaku/Code | Data/CSP-JS2021二轮提高组数据/SD-00820/bracket/bracket.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[45];
int ans[45];
int m,q,t,n,k;
void jud(char i,int b,int c,int d);
int main(){
freopen("bracket.in","r",stdin);
freopen("bracket.out","w",stdout);
int n,k,ans=0;//mΪqΪtΪ*
scanf("%d%d",&n,&k);
for(int i=0;i<n;i++){
cin>>a[i];}
... | ALGO | 0.999926 | 3.342977 |
a31c56d8-4dcd-4983-b071-c850f55bac5e | walidabdulhakim/yamd | subprojects/eigen-3.4.0/bench/perf_monitoring/trmv_up.cpp | #include "gemv_common.h"
EIGEN_DONT_INLINE
void trmv(const Mat &A, const Vec &B, Vec &C)
{
C.noalias() += A.triangularView<Upper>() * B;
}
int main(int argc, char **argv)
{
return main_gemv(argc, argv, trmv);
}
| ALGO | 0.977252 | 4.868302 |
eeb60a6c-2e90-47f6-a3d5-2c00485e96dc | SAURABH200301/MyCppCodes | 406. Queue Reconstruction by Height(leetcode).cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
static bool compare(vector<int>& a, vector<int> & b)
{
if(a[0] == b[0])
return a[1] < b[1];
return a[0] > b[0];
}
vector<vector<int>> reconstructQueue(vector<vector<int>>& people) {
int n = peopl... | ALGO | 0.999992 | 4.81343 |
e036e0b4-f7b2-4b49-ba48-2926fb691cf2 | philflex2020/dirtdigger | libraries/Filter/DerivativeFilter.cpp | // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
/// @file Derivative.cpp
/// @brief A class to implement a derivative (slope) filter
/// See http://www.holoborodko.com/pavel/numerical-methods/numerical-derivative/smooth-low-noise-differentiators/
//
#include <inttypes.h>
#include <AP_Math/... | ALGO | 0.935236 | 7.260111 |
d47a8196-7ed4-41b3-bb98-d7c8a71736f6 | Shezitt/Que-no-no-perdio-Teambook | oliver/Kosaraju.cpp |
const int N = 2005;
vector<int> adj[N];
bool vis[N];
int dis[N], noComp[N];
vector<int> nodosk;
void dfs(int nodo){
if(vis[nodo]) return;
vis[nodo] = true;
for(auto u:adj[nodo]){
if(!vis[u]) dfs(u);
}
nodosk.pb(nodo);
}
void dfs2(int nodo, int num){
if(vis[nodo]) return;
vis[nodo... | ALGO | 0.999956 | 3.880209 |
554c6eef-f331-40af-a50a-2ca6dae42727 | pritthiprokashsarkar/problem-set | vjudge/Dudh chayer prolovon1.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n), b(m), c(m);
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < m; i++) cin >> b[i];
sort(a.begin(), a.end());
for (int i = 0; i < m; i++) {
int lo = 0, hi = n - 1, ans ... | ALGO | 0.999995 | 4.469974 |
44b63196-e8d1-432a-970a-13ca94eba4f8 | elixered/leetcode | find-smallest-letter-greater-than-target/find-smallest-letter-greater-than-target.cpp | class Solution {
public:
char nextGreatestLetter(vector<char>& letters, char target) {
int low = 0;
int high = letters.size()-1;
char ans = letters[0];
while(low<=high)
{
int mid = (low+high)/2;
if(letters[mid]>target)
{
ans... | ALGO | 0.99954 | 5.895043 |
618c3b74-dc7f-4640-b777-3c5fdc522ba6 | Heisenberg71/Competitive-Programming | Online Judge Submissions/ACM ICPC Submissions/SEC IUJPC/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second
#define nl '\n'
#define mod 1000000007
#define inf 1000000009
#define MAXX 100000... | ALGO | 0.999982 | 4.345391 |
161cea10-097d-4c7e-8448-c269618e9a95 | cashaffer/DSA | C++Source/grdijkm2.cpp | // Test program for Dijkstra's single-source shortest paths algorithm
// Version 2: Use a priority queue to keep track of which vertex
// is the next closest.
// Use any of the files in this directory with a .gph extension.
// This version is for the Adjancency Matrix representation
#include "book.h"
#include "grmat.... | ALGO | 0.999931 | 5.797846 |
1ed890f0-550d-4b02-9dfe-159dfebcfa5b | raincross7/code-similarity | codes/train_code/problem422/problem422_455.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(int argc, char* argv[]) {
int N, A;
cin >> N >> A;
if (N % 500 <= A) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| ALGO | 0.999828 | 3.095037 |
2b5f2e0e-32b7-4a4e-b78c-3ada0eea0d4c | Rashedul2001/PROGRAMS | DSA_CPA/CP_Course/NthRootofaNumberUsingBinaryNumber.cpp | #include <iostream>
#include <iomanip>
const double prec = 10e-6;
double mul(const double& mid, int n)
{
double result = 1;
while (n--)
{
result *= mid;
}
return result;
}
int main()
{
double num;
std::cout << "Enter your Number: ";
std::cin >> num;
std::cout << "Enter the ... | ALGO | 0.999887 | 4.452171 |
0733702e-8422-483d-9954-7ecc01d9f2bb | mugifusen/atcoder | tessoku/a04.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
string r_ans;
while(n) {
r_ans.append(to_string(n%2));
n /= 2;
}
reverse(r_ans.begin(), r_ans.end());
cout << setw(10) << setfill('0') << r_ans << endl;
return 0;
}
// 別解
// for (int i = 9... | ALGO | 0.999986 | 4.9954 |
5d29de5f-3ba9-422a-836b-557ffcdb37a6 | NahulRahman/C-_For_Noob_Steps | 5.3.1 c++ manip stfill.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main(){
int a=1,b=10,c=100,d=1000;
cout<<setfill('*')<<setw(4)<<a<<endl<<setw(4)<<b<<endl<<setw(4)<<c<<endl<<setw(4)<<d<<endl;
return 0;
}
/*
o/p:
***1
**10
*100
1000
*/
| ALGO | 0.995667 | 3.314103 |
a8a6ccc0-5ba4-4eed-bfd7-d6c38b44aa1c | DS-Meena/Core-problems | Dynamic programming/Edit distance (Memoization).cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"
const int N = 100;
const int mod = 1e9 + 7;
int n, m;
int match(string s1, string s2, int i, int j, int cache[][100])
{
if (s1.length() == i)
return s2.length() - j;
if (s2.length() == j)
return s1.length... | ALGO | 0.999972 | 5.365859 |
e17a8ece-0b57-4193-bee7-a70b4db4ff6b | MakinoRuki/Codeforces | ER72/1217C.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#define N 105
//#define M 10005
#define inf 1000000000
#define pii pair<int, int>
using namespace std;
typedef long long ll;
const ll m... | ALGO | 0.999908 | 4.052168 |
8afa7995-c95f-4c5c-af76-68fd4fa63ed6 | ugidol/atcoder | abc262/b.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void){
int N,M;
cin >> N >> M;
vector<vector<int>> G(N,vector<int>());
for(int i=0;i<M;i++){
int U,V;
cin >> U >> V;
U -= 1;
V -= 1;
G[U].push_back({V});
G[V].push_back({U});
}
int ans = 0;
for(int i=0;i<N;i++){
int a = i;
... | ALGO | 0.999864 | 3.993304 |
1a217127-b8a1-4664-8946-10bd6f8d439a | DOSP-Project/platform_bionic | libc/bionic/system_properties.cpp | #include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <new>
#include <linux/xattr.h>
#include <netinet/in.h>
#include <sys/mman.h>
#include <sys/... | TOOL | 0.871886 | 5.551833 |
cd1906f3-6898-440e-82ed-6b830d3ce1ff | ppv-vldmr/ITMO | Algorithms and Data Structures/term-1/lab-1/1-8.cpp | #include <bits/stdc++.h>
using namespace std;
long long searching(long long w, long long h, long long n) {
long long l = -1, r = 1000000000*min(w,h), m;
while (r - l > 1) {
m = (l + r)/2;
if ((m / max(w,h)) * (m / min(w,h)) < n) l = m; else r = m;
//cout << m / max(w,h) << " " << m / m... | ALGO | 0.999885 | 4.3174 |
34c84ef9-b3ac-4d18-a3db-7ed69f6274d8 | raincross7/code-similarity | codes/train_code/problem206/problem206_327.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end()... | ALGO | 0.975843 | 4.482217 |
ecf35ade-0068-45c6-ba11-930c4c177533 | krishna-raj007/BodhiTree-Annotation | CS101_Spring2020-21 /LAB4_L1/categorized/mod/all_passed/91_mod.cpp | #include<simplecpp>
main_program{
long int factorial=1;
int i=1,m,n,mod;
cin>>n>>m;
repeat(n){
factorial=(factorial*i)%m;
i=i+1;}
cout<< factorial;
}
| ALGO | 0.999983 | 3.951563 |
e20271a0-1976-46dc-86b5-364f142922cf | Danbr23/exercicios | beecrowd/1170.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main(){
int n,i;
double kg, dias;
cin >> n;
for(i=0;i<n;i++){
cin >> kg;
dias = log2(kg);
cout << ceil(dias);
cout << " dias\n";
}
return 0;
} | ALGO | 0.999549 | 3.269752 |
2321555d-691f-4e66-90af-16c4e3cd5543 | DaniilErshov/flame1D | 0709_gorenie/functions_sundials.cpp | #include "functions_sundials.h"
int flag = 0;
#define RTOL RCONST(1.0e-5)
#define T0 RCONST(0.0) /* initial time */
#define T1 RCONST(pow(10, -6)) /* first output time */
#define TMULT RCONST(1.006) /* output time factor */
#define NOUT 1800
#define ZERO RCONST(0.0)
double get_... | ALGO | 0.999856 | 3.173542 |
16cfdb88-a3de-468c-8e80-9a2ea02698d3 | zty950323/UsingSTLCases | TheModernCppChallenge/Chapter_1/ex1_4/main.cpp | #include <iostream>
using std::cin;
using std::cout;
using std::endl;
bool is_prime(int const num) {
if (num <= 3) {
return num > 1;
} else if (num % 2 == 0 || num % 3 == 0) {
return false;
} else {
for (int i = 5; i * i <= num; i += 6) {
if (num % i == 0 || num % (i + 2) == 0) {
retur... | ALGO | 0.999752 | 4.639709 |
492e9570-ff2f-4bd3-9f6e-38c0abb34042 | xuanquynh3005/Code_DSA_PTIT | DSA03018 - SỐ MAY MẮN.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<set>
using namespace std;
int main() {
int t; cin >> t;
while (t--) {
int n; cin >> n;
int a, b;
bool ok=false;
for (int i = 2;i<n/4; i++) {
if (7 * i >= n&&(7*i-n)%3==0) {
a = (7 * i - n) / 3;
b = i - a;
ok = true;
break;
... | ALGO | 0.999566 | 3.955936 |
7bcb3dbe-a09b-45f0-b743-db272186545a | ajsushanth/Leetcode | 0283-move-zeroes/0283-move-zeroes.cpp | class Solution {
public:
void moveZeroes(vector<int>& nums) {
int l=0, h=nums.size()-1;
while(l <= h){
if(nums[l] == 0){
nums.push_back(nums[l]);
nums.erase(nums.begin() + l);
h--;
}
else{
l++;
... | ALGO | 0.999947 | 6.583493 |
9818497f-4341-46ed-95a9-3759183bea32 | takumi34/APG4b | apg4b_ex16.cpp | // EX16 - 隣り合う同じ値を探す / 2.01 <https://atcoder.jp/contests/apg4b/tasks/APG4b_cg>
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> data(5);
for (int i = 0; i < 5; i++) {
cin >> data.at(i);
}
// dataの中で隣り合う等しい要素が存在するなら"YES"を出力し、そうでなければ"NO"を出力する
// ここにプログラムを追記
for (int i = 0; i < 4... | ALGO | 0.999968 | 4.177537 |
741345cb-0ecf-4b58-8c2b-90a5e70229d5 | ahmedsalahsk/Calculatorc- | calcoulator/ConsoleApplication1/ConsoleApplication1.cpp | #include <iostream>
using namespace std;
int main() {
double num1, num2;
char op;
cout << "أدخل العملية الحسابية (مثال: 5 + 3): ";
cin >> num1 >> op >> num2;
switch (op) {
case '+':
cout << "الناتج: " << num1 + num2 << endl;
break;
case '-':
cout << "الناتج: " << n... | TOOL | 0.975012 | 4.614735 |
90f55f7c-5cce-4cd9-88b3-2cc8d71041d7 | Rufian55/Cplusplus | Creature Combat II/Fight.cpp | /****************************************************************************************
** Program Filename: Fight.cpp
** Author: Chris Kearns
** Date: 2/28/2016
** Description: Fight class implementation file. Utilizes virtual class Creature, then
** Medusa, Barbarian, Vampire, BlueMen, and HarryPotter classes.
** ... | TOOL | 0.935618 | 3.436536 |
07265e81-be13-4eba-b894-43aa8e9e6109 | tejus0/Leetcode-solutions | detect-capital/Accepted/1-2-2023, 11_19_23 AM/Solution.cpp | // https://leetcode.com/problems/detect-capital
class Solution {
public:
bool detectCapitalUse(string word) {
int low=0 , up=0;
int flag=1;
if(word.length()==1) return flag;
int first=word[0];
int second=word[1];
if((first>90 and second>90) or (first<=90 and second>9... | ALGO | 0.999765 | 6.221607 |
4e0da300-83fa-4042-8dfd-9e6ec0a14400 | lkkikkil/C-study | 알고리즘/2751/2751/2751.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int numberAmount;
cin >> numberAmount;
vector <int> numbers;
for (int inCounter = 0; inCounter < numberAmount; inCounter++) {
int number;
cin >> number;
numbers.push_back(number);
}
sort(numbers.begin(), number... | ALGO | 0.999774 | 4.791394 |
68ab8f3b-80c1-4a88-9fcb-54c9ea622ab3 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-gpt4/Codenet/p01671/845216033/response_1.cpp | #include <bits/stdc++.h>
using namespace std;
using int64 = long long;
struct UnionFind {
vector<int> data;
UnionFind(int sz) : data(sz, -1) {}
bool unite(int x, int y) {
x = find(x), y = find(y);
if (x == y)
return false;
if (data[x] > data[y])
swap(x, y);
data[x] += data[y];
data... | ALGO | 0.99994 | 4.203984 |
7d16e160-5566-48f2-8533-f5ba9806ef2f | lanbao2021/BlueLeopard | exercise/chapter4/4-12.cpp | // 4-12.cpp
// Created by 蓝同学 on 2021/8/8.
// 编写一个程序,输入一个句子(以句号结束) ,统计该句子中的,元音字母数、辅音字母数、空格数、数字数,及其他字符数。
#include <iostream>
using namespace std;
int main(){
char ch;
int num_y=0, num_f=0, num_space=0, num_digits=0, num_others=0;
while(1){
cin.get(ch);
if(ch=='.'){
cout << "元音字母数:... | ALGO | 0.989216 | 3.40209 |
77a94dff-73bf-4039-98b1-c17e89726d95 | hjhj97/ProblemSolving | BOJ/Geometry/2166-다각형의 면적.cpp | #include<stdio.h>
#define SIZE 10000
typedef long long ll;
struct Point {
double x, y;
};
Point sq[SIZE + 10];
double ans = 0;
double fAbs(double a) {
return a > 0 ? a : -a;
}
ll ccw(Point a, Point b, Point c) {
return a.x*b.y + b.x*c.y + c.x*a.y - (a.x*c.y + b.x*a.y + c.x*b.y);
}
int main() {
int n; scanf("%d", &... | ALGO | 0.999443 | 3.841328 |
f824f443-ba0d-4c1d-9bff-7f44f5092aa0 | InvalidNamee/OJ-AC-Repository-for-UPC | AC_code/新生训练赛/第二场/d.cpp | #include <cstdio>
class FenwickTree {
bool val[1000010];
int n;
public:
void setlen(int n) {
this->n = n;
}
void modify(int u) {
for (; u <= n; u += u & -u) {
val[u] ^= 1;
}
}
bool query(int u) {
bool res = 0;
for (; u; u -= u & -u) {
... | ALGO | 0.999859 | 3.091651 |
be302b0c-c1a5-4206-b551-f3d79e032049 | AnriaruDoragon/VKMNAU-CPP-Exercises | Works/01/Work1_Ex5.cpp | #include <iostream>
using namespace std;
int main()
{
int timeLeftMinutes, toolPrepareMinutes, sortMinutes, setupWorkbenchMinutes, repairingMinutes, repairedParts;
timeLeftMinutes = 2 * 60;
repairingMinutes = 5;
cout << "Хв на підготовку: ";
cin >> toolPrepareMinutes;
cout << endl << "Хв на с... | ALGO | 0.949612 | 4.708021 |
ede83d09-f261-4386-b55d-1ddb729668b1 | Savirayosita27/project-uts-mobile-programming | 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.998693 | 6.797273 |
34689a62-c64d-497c-8378-61cde107d157 | victorradael/Cplusplus | tasks/listas_pilhas_filas/ex12.cpp | #include <iostream>
#include <stack>
using namespace std;
int main()
{
stack<int> operandos;
string lido;
do
{
cin >> lido;
if (lido == "=")
break;
else if (lido == "+")
{
int op1 = operandos.top();
operandos.pop();
int op2 = operandos.top();
operandos.pop();
... | ALGO | 0.999714 | 4.567993 |
85faacde-ef9c-4635-9dad-fb0198f1bf2f | raincross7/code-similarity | codes/train_code/problem178/problem178_481.cpp | #include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c;
while(~scanf("%d %d %d",&a,&b,&c))
{
if(c>=a&&c<=b)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
}
return 0;
}
| ALGO | 0.999892 | 3.353236 |
88e52f98-68dc-4b98-8b2c-84ef3898d118 | bit-chess/A.I. | src/tests/rookattacktest.cpp | #include "../Rules/manipulator.hpp"
#include <cstdio>
const int BitTable[64] = {
63, 30, 3, 32, 25, 41, 22, 33, 15, 50, 42, 13, 11, 53, 19, 34, 61, 29, 2,
51, 21, 43, 45, 10, 18, 47, 1, 54, 9, 57, 0, 35, 62, 31, 40, 4, 49, 5, 52,
26, 60, 6, 23, 44, 46, 27, 56, 16, 7, 39, 48, 24, 59, 14, 12, 55, 38, 28,
58, 20,... | ALGO | 0.994647 | 4.312696 |
cb128905-8be9-4ea8-a8a8-187671dbc91f | Abhisek-07/melos_project | apps/bus_routes_app/Bus_Routes_Modified/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.997047 | 6.76073 |
5ae3d563-332e-4077-913d-86f4267e55f5 | urawa72/procon | atcorder/abc181/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
using ll = long long;
int main() {
int n; cin >> n;
ll ans = 0;
for(int i = 0; i < n; i++){
ll a, b; cin >> a >> b;
ll x = (b * (b + 1)) / 2;
ll y = 0;
if(a != ... | ALGO | 0.999566 | 3.737484 |
4820295a-25c5-4ed5-8e78-ea93e630b53e | xmlb88/algorithm | leetcode/design/341.NestedIterator.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
/**
* // This is the interface that allows for creating nested lists.
* // You should not implement it, or speculate about its implementation
* class NestedInteger {
* public:
* // Return true if this NestedInteger holds a single in... | ALGO | 0.999936 | 6.332981 |
d5c62703-4f07-4eee-87c0-ebfa96ac3c31 | by0gor/atcoder | past_problems/abc138.cpp | // C - Alchemist
// https://atcoder.jp/contests/abc138/tasks/abc138_c
// Q. 入力を足し合わせて2で除算。その最大値を求めよう。ソートして除算での減少分を最小化すればよし。
#include <bits/stdc++.h>
#define lli long long int
#define uli unsigned long long int
#define rep(i, m, n) for (lli i = m; i < (n); i++)
#define repe(i, m, n) for (lli i = m; i <= (n); i++)
#defin... | ALGO | 0.99979 | 4.464058 |
66e1ec54-67fc-4d1f-bd13-43908fc59c5e | patchcoin/patchcoin | src/kernel/coinstats.cpp | #include <kernel/coinstats.h>
#include <chain.h>
#include <coins.h>
#include <crypto/muhash.h>
#include <hash.h>
#include <logging.h>
#include <node/blockstorage.h>
#include <primitives/transaction.h>
#include <script/script.h>
#include <serialize.h>
#include <span.h>
#include <streams.h>
#include <sync.h>
#include <t... | TOOL | 0.886561 | 7.435481 |
aae8e8f3-031c-4455-8158-cc675ce3b88e | Madhavan-012004/SUPER-76-Basic-Programs | Repeated num in array.cpp | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
int main()
{
vector<int> arr;
string str;
getline(cin,str);
stringstream ss(str);
int num;
while (ss>>num)
{
arr.push_back(num); // making the str into arr
}
int n=arr.size();
bool found = f... | ALGO | 0.999812 | 5.154977 |
1444baf6-386b-4166-b500-7bbac7e49d4c | neelchoudhury/cp | Codechef and Spoj/L-Z/SORT4.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
int a[t];
for(int i=0; i<t; i++)
cin>>a[i];
sort(a,a+t);
for(int i=0;i<t; i++)
cout<<a[i]<<endl;
return 0;
}
| ALGO | 0.999712 | 3.442703 |
ccd33f32-d1b2-4923-ac1b-ac09f94f8784 | burlen/SciberQuestToolKit | eigen-3.0.3/eigen-eigen-3.0.3/bench/sparse_transpose.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
// -DNOGMM -DNOMTL
// -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef... | ALGO | 0.976004 | 5.110691 |
796f5998-287d-4735-83ea-54c889dc6082 | AvanNorth/pskda_aicd | sem2/Levenshtein.cpp | #include<iostream>
#include <ctime>
#include <fstream>
using namespace std;
int Minimum(int a, int b, int c) {
return (a = a < b ? a : b) < c ? a : c;
}
int LevenshteinDistance(string firstWord, string secondWord) {
int n = firstWord.length() + 1;
int m = secondWord.length() + 1;
int matrixD[n][m];
... | ALGO | 0.901728 | 3.815153 |
00f5ec8b-5ade-4041-81d8-e9d858032573 | Bjathneas/CPP_Challenges | sum_of_digits/src/main.cpp | #include <iostream>
#include <string>
int get_sum(int num) {
std::string num_str = std::to_string(num);
int sum = 0;
while (num > 0) {
int digit = num % 10;
sum += digit;
num /= 10;
}
return sum;
}
int main()
{
printf("Input number:\n");
int input;
std::cin >> input;
printf("The ... | ALGO | 0.997756 | 6.075725 |
21297430-e23e-41c0-ae07-43f11349b21f | zhzh2001/Learning-public | c++实用代码/平衡树code/statistics/src/splay/statistics/splay/statistics_fast.cpp | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#define N 1000005
struct Splay{
#define oo (1<<30)
struct node{
int key,size;
node *l,*r,*p;
void update(){
size=l->size+r->size+1;
}
};
node a[N];
node *null,*root;
int len;
void clear(){
null=new node;null->l=null->r=null;
... | ALGO | 0.999828 | 3.431235 |
1b60de07-d0e7-44df-90ee-acbf33360f0b | mono-1729/AtCoder_cpp | ABC/317/b.cpp | #include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
#define rep(i, a, n) for(ll i = a; i < n; i++)
#define rrep(i, a, n) for(ll i = a; i >= n; i--)
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
constexpr ll MOD = 998244353;
constexpr int IINF = 1001001001;
constexpr ll INF = 1LL... | ALGO | 0.999997 | 4.294096 |
d98c485f-ddae-4b3a-8183-392926896ec9 | GiuPPon/UniGe | 2023-2024/algoritmi e strutture dati /laboratorio/laboratori (lezioni)/laboratorio 5/asd-lab5-traccia/dictionary-doublylinkedlist.cpp | // Nei calcoli di complessita', n indica la dimensione del dizionario
#include "dictionary.h"
using namespace dict;
struct dict::nodo {
Elem elem;
nodo *precedente;
nodo *prossimo;
};
typedef nodo *nodoPtr;
/****************************************************************/
Error dict::deleteElem(const ... | ALGO | 0.921505 | 4.254187 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.