uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
bbf9ee2e-bf0a-4cbe-950c-5f993f5b84f3 | blueboy/portal | dep/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp | #include <float.h>
#include <string.h>
#include "DetourNavMeshQuery.h"
#include "DetourNavMesh.h"
#include "DetourNode.h"
#include "DetourCommon.h"
#include "DetourMath.h"
#include "DetourAlloc.h"
#include "DetourAssert.h"
#include <new>
/// @class dtQueryFilter
///
/// <b>The Default Implementation</b>
///
/// At co... | ALGO | 0.991734 | 5.491837 |
14241ef3-e703-4359-a44c-6a7b9b91be18 | kika1s1/Leetcode-Questions | leetcode/medium/key_insight.cpp | /*
* ✅ Key Insight
* Platform: LEETCODE
* Difficulty: medium
* Language: cpp
* Problem URL: https://leetcode.com/problems/maximum-product-of-first-and-last-elements-of-a-subsequence/
* Date: 2025-06-15T19:38:30.339Z
* Author: CodeSync Extension
*/
class Solution:····def·maximumProduct(self,·nums:·List[int],·m:... | ALGO | 0.999913 | 6.033674 |
d7353914-2ed2-493c-ba99-1feacead5333 | SkyFireArchives/SkyFireEMU_433 | dep/acelite/ace/ACE_crc_ccitt.cpp | // $Id: ACE_crc_ccitt.cpp 91286 2010-08-05 09:04:31Z johnnyw $
#include "ace/ACE.h"
namespace
{
/*****************************************************************/
/* */
/* CRC LOOKUP TABLE */
/* =======... | TOOL | 0.99694 | 6.738245 |
6974ac44-d5e4-4267-b177-0811ab94ebf3 | ProgramExecuter/LeetCode-Daily | 01-March2022/16-ValidateStackSequences.cpp | class Solution {
public:
bool validateStackSequences(vector<int>& pushed, vector<int>& popped) {
stack<int> st;
int n = pushed.size(), m = popped.size(), i = 0, j = 0;
while(i < n && j < m) {
st.push(pushed[i]);
// Check for 'stack' and 'popped... | ALGO | 0.999454 | 6.513692 |
39be455e-8952-4bc2-98ee-698da92bfa7a | user-ZJ/zack_notes | 数据结构与算法/leecode/code/众数.cpp | #include <vector>
int MoreThanHalfNum_Solution(std::vector<int> numbers) {
if (numbers.size() == 0)
return 0;
int result = numbers[0];
int times = 1;
for (int i = 1; i < numbers.size(); i++) {
if (times == 0) {
result = numbers[i];
times = 1;
} else if (numbers[i] == result)
++time... | ALGO | 0.999975 | 5.64343 |
66f1519f-fece-4038-a058-afe3d3a1b26c | ganeshskudva/Algorithms | HackerRank/Save_Prisoner.cpp | /*
* AUTHOR: Ganesh S Kudva
* https://www.hackerrank.com/challenges/save-the-prisoner
*/
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <map>
typedef long long int ull;
#define MEM(a, b, c, d) memset(a, (b), c... | ALGO | 0.999738 | 3.752991 |
82eb1c9d-e80a-4293-94d2-ff766c1ffe11 | openharmony-gitee-mirror/third_party_boost | libs/compute/example/opengl_sphere.cpp | #include <iostream>
#include <algorithm>
#include <GL/gl.h>
#include <vtkActor.h>
#include <vtkCamera.h>
#include <vtkgl.h>
#include <vtkInteractorStyleSwitch.h>
#include <vtkMapper.h>
#include <vtkObjectFactory.h>
#include <vtkOpenGLExtensionManager.h>
#include <vtkOpenGLRenderWindow.h>
#include <vtkProperty.h>
#inc... | TOOL | 0.927715 | 6.577618 |
2e44f04b-ecfa-4d2b-a38a-7b014f1b1955 | ishandutta2007/codeforces | flowerletter/normal/1630/A.cpp | #include<bits/stdc++.h>
#define rep(i, l, r) for(int i = (l); i <= (r); i ++)
#define per(i, r, l) for(int i = (r); i >= (l); i --)
#define trv(i, u, v) for(int i = head[u], v = e[i].to; i; v = e[i = e[i].nxt].to)
#define fi first
#define se second
#define all(s) s.begin(), s.end()
#define sz(s) (int)(s.size())
#define... | ALGO | 0.999744 | 3.485616 |
f528e4bb-59f3-4c76-8960-9a7d5a5af9ec | tenick/cp | Codeforces/Practice/1909b.cpp | #include <iomanip>
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef un... | ALGO | 0.998948 | 3.990684 |
03e68354-f2d5-43f6-9c9e-36f5fbd9393b | da1234cao/data_structure | 华为机试/code/HJ4_字符串分隔.cpp | #include <iostream>
#include <string>
using namespace std;
int main(void){
string input;
while(getline(cin,input)){
int size = input.size()/8;
int left = input.size()%8;
for(int i=0; i<size; i++){
for(int j=0; j<8; j++)
cout<<input[i*8+j];
cout<... | ALGO | 0.997789 | 3.190933 |
92e815b1-4b34-4a0c-bd1c-6b92ae781db1 | parsa/blaze | blazemark/src/eigen/DVecDVecSub.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.968442 | 6.937034 |
d778a468-1524-428f-a10d-dce5a64becc0 | RitabrataDas343/OOPs-Lab | ListStackQueueDequeue_Inheritance.cpp |
// C++ implementation of De-queue using circular
// array
#include<iostream>
using namespace std;
// Maximum size of array or Listue
#define MAX 100
// A structure to represent a List
class List
{
protected : int arr[MAX];
int beg;
int end;
int size;
public :
List(int size=... | ALGO | 0.999262 | 5.332558 |
69a8fe5b-7c14-4a7e-b7b9-ee6089021dde | noob-nilarghya/Striver-SDE-Sheet | Day-14/celebrityProblem.cpp | // Approach 1:
int findCelebrity(int n) {
vector<int> inDeg(n, 0);
vector<int> outDeg(n, 0);
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
if(i!=j && knows(i,j)==true){
// i know j [ i-->j ]
outDeg[i]++;
inDeg[j]++;
}
... | ALGO | 0.999827 | 5.155128 |
c9e3b10f-f82b-472b-8487-5c29ed08192b | SeaBass917/Blind75 | 64 - LongestIncSubSeq/main.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <stdio.h>
#include <math.h> /* log10 */
#include <string>
using namespace std;
class Solution {
int insert_loc_li... | ALGO | 0.999866 | 5.879365 |
974455d7-a869-4e6d-9171-1cf84a268210 | 21omkarsase/CP | Codeforces/Practice/800/softDrinking.cpp | // A. Soft Drinking
// time limit per test2 seconds
// memory limit per test256 megabytes
// inputstandard input
// outputstandard output
// This winter is so cold in Nvodsk! A group of n friends decided to buy k bottles of a soft drink called "Take-It-Light" to warm up a bit. Each bottle has l milliliters of the drink... | ALGO | 0.999653 | 3.862432 |
cd91a1fd-5532-4724-8a58-cfa73a94d648 | betteryjs/LC | 695/main.cpp | #include <vector>
#include <iostream>
#include <stack>
using namespace std;
// @solution-sync:begin
// DFS
class Solution {
public:
int maxAreaOfIsland(vector<vector<int>> &grid) {
int ans = 0;
for (int i = 0; i != grid.size(); ++i) {
for (int j = 0; j != grid[0].size(); ++j) {
... | ALGO | 0.999892 | 6.317399 |
0df73935-2c29-4711-a2fb-7ed7b2c535ea | praydog/GlacierGenny | shared/utility/Memory.cpp | #include <optional>
#include <vector>
#include <Windows.h>
#include "Memory.hpp"
#include "String.hpp"
using namespace std;
namespace utility {
thread_local vector<MEMORY_BASIC_INFORMATION> g_pages{};
optional<MEMORY_BASIC_INFORMATION> findInCache(uintptr_t ptr, size_t len) {
for (const auto& mbi : g_pages) {
... | TOOL | 0.851735 | 6.260555 |
f997284c-c74a-4a20-823f-eba6f418ec68 | Guru2113/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 |
12252a35-745b-4202-a00d-7f74d4bf2bf5 | Pebriyantii/modul-3 | modul 3 tugas mandiri 4.cpp | #include <stdio.h>
int main() {
int bilangan;
printf("Masukkan sebuah bilangan bulat positif: ");
scanf("%d", &bilangan);
if (bilangan % 2 == 0) {
printf("Bilangan tersebut adalah GENAP\n");
} else {
printf("Bilangan tersebut adalah GANJIL\n");
}
return 0;
}
| ALGO | 0.997916 | 4.099924 |
79b361d8-b8b8-42e2-b88e-1f4515067af9 | jhasan2026/Road_To_Grandmaster | 1_Learn_CPP/1_Simple_problems/3_sum_of_digit_of_number.cpp | #include "iostream"
using namespace std;
int sumOfDigit(int n){
int sum = 0;
while (n){
sum += n%10;
n/=10;
}
return sum;
}
int main(){
cout<<sumOfDigit(4562)<<endl;
} | ALGO | 0.999521 | 4.292548 |
582b81d4-b148-4d3b-a3eb-8bd213f3a5c9 | sinian666/codes_102_3 | cpp_副本45/chapter_searching/two_sum.cpp | /**
* File: two_sum.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 方法一:暴力枚举 */
vector<int> twoSumBruteForce(vector<int> &nums, int target) {
int size = nums.size();
// 两层循环,时间复杂度 O(n^2)
for (int i = 0; i < size - 1; i++) {
for (int j = i + 1; j ... | ALGO | 0.999836 | 6.081783 |
378400f0-0eac-4b40-b72e-4c4a779d792f | bengxy/LeetCode | cpp/058_LengthofLastWord.cpp | class Solution {
public:
int lengthOfLastWord(string s) {
s.erase(0,s.find_first_not_of(" "));
s.erase(s.find_last_not_of(" ") + 1);
int i;
for(i=s.size()-1;i>=0;i--){
if( s.at(i) == ' ')
return s.size()-i-1;
}
return s.size()-i-1;
}
}; | ALGO | 0.994086 | 5.27792 |
ce5d6f8a-753e-4d51-a9f8-5e33cd4079a8 | lgtm-migrator/algo-practices | atcoder/ac-library-practice-contest/A.cpp | #include <atcoder/all>
#include <iostream>
#include <vector>
using namespace std;
using namespace atcoder;
using Graph = vector<vector<int>>;
int main()
{
int N, Q;
cin >> N >> Q;
dsu d(N);
for (int i = 0; i < Q; i++)
{
int t, u, v;
cin >> t >> u >> v;
if (t == 0)
... | ALGO | 0.999902 | 5.403935 |
036e1fc8-9423-44ec-8655-c29ecaefbac9 | ManishBisht777/StriverSdeSheet | binary tree/preorder.cpp | void helper(TreeNode *root, vector<int> &ans)
{
if (!root)
return;
ans.push_back(root->data);
helper(root->left, ans);
helper(root->right, ans);
}
vector<int> getPreOrderTraversal(TreeNode *root)
{
// Write your code here.
vector<int> ans;
helper(root, ans);
return ans;
} | ALGO | 0.999985 | 6.198927 |
da3b3523-ca64-4d88-bd22-fb153d81190d | JiaxianGu/algorithm-and-data-structure | 1/twosum.cpp | class Solution{
public: vector<int> twoSum(vector<int>& nums, int target){
for(int i = 0; i<num.size(); i++){
for(int j = i; )
}
}
} | ALGO | 0.998615 | 5.679383 |
31aaa111-5d4a-47be-8dd4-0a775abd325f | CunjunWang/leet-code-cpp | solution0244_ShortestWordDistanceII/main.cpp | //
// Created by 王存俊 on 2019-08-29.
//
#include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <stack>
#include <queue>
#include <sstream>
#include <cassert>
#include <list>
#include <set>
#include "TreeNode.h"
#include "ListNode.h"
using namespace std;
class WordDistance {
private:
... | ALGO | 0.999902 | 5.929823 |
6e6f1321-0eda-495a-bb7d-67c3ba74e51c | stevend12/SolutioCpp | Library/Therapy/GammaIndex.cpp | /******************************************************************************/
/* */
/* */
/* ... | ALGO | 0.995764 | 7.512887 |
9cdb1dbc-d83a-4cdd-b4b7-c753cc658fbd | osamaairfan/Data-Structures | Searching Algorithms/Binary Search.cpp | #include <iostream>
using namespace std;
int BinarySearch(int arr[], int low, int high, int key) {
if (low > high)
return -1;
int mid = (low + high) / 2;
if (arr[mid] == key)
return mid;
if (arr[mid] < key) /*If key is greater than mid, it is in the right subarray*/
BinarySearch(arr, mid + ... | ALGO | 0.999976 | 5.930413 |
cafb1b5b-076d-480f-a83f-e883bc14da0a | AdirakhmatM/huh | tugas4pnn.cpp | #include <iostream>
using namespace std;
int main(){
int x;
cout <<"Masukkan Nilai : ";cin >>x;
if (x>0){
cout <<"Nilai positif";
}else if (x<0){
cout <<"Nilai negatif";
}else {
cout <<"Nilai nol !!";
}
}
| ALGO | 0.969332 | 3.555791 |
c53ff3d9-0308-4775-971f-ffa18fc64f4c | ishandutta2007/codeforces | e869120/normal/724/D.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int D, cc[26];
string S; vector<int>V[26];
vector<int>V2[100009];
int solve2(int len, vector<int>B) {
int cx = 0, cntv = 0; B.push_back(len);
for (int i = 0; i < (int)B.size() - 1; i++) {
if (B[i + 1] - cx > D) { cx ... | ALGO | 0.999982 | 4.174217 |
36734a2a-a094-4d94-a67d-33a9c7097a0f | ishandutta2007/codeforces | rajat1603/normal/866/D.cpp | #include "bits/stdc++.h"
using namespace std;
const int N = 3e5 + 5;
const int SN = 1 << 20;
const int inf = 1e9 + 9;
struct data{
int mini;
int idx;
int pref;
int sum;
};
inline data combine(const data &lft , const data &rgt){
data res;
res.sum = lft.sum + rgt.sum;
res.mini = min(lft.mini , rgt.mini);
if(lft.m... | ALGO | 0.999934 | 3.73155 |
2179e9d2-9077-420b-bca7-dd2d2af5fd40 | Johnson2209/TU-Wien-Assignments | Scientific Programming/SOLUTIONS/serie08/main.cpp | #include <iostream>
#include <math.h>
class Matrix {
private:
int n;
double *coeff;
char type;
public:
double *vec;
int len;
void scanMatrix(int n, char type);
void printMatrix();
double columnSumNorm();
double rowSumNorm();
double frobeniusNorm();
Matrix();
Matrix(int d... | ALGO | 0.999692 | 3.661923 |
66ba7364-b0fb-447b-ae27-f48a4808dc3b | wasabi3D/AtCoderPractice | pr2/trophy.cpp | #include <iostream>
#include <vector>
#include <limits>
#include <stdio.h>
using namespace std;
struct Stage{
int cinematic;
int gameplay;
int total;
};
struct Status{
bool available;
bool first_time;
};
Status get_status(const vector<bool>& clear_list, const int& index){
if(index == 0){
... | ALGO | 0.99995 | 3.900221 |
5e920f7d-2063-4464-bc93-6857b5fe76d9 | karthikprasannamuralidharan/DSA | Data Structures/Linked List/circularLinkedList.cpp | #include <iostream>
using namespace std;
// Node structure for a circular linked list
struct Node {
int data;
Node* next;
Node(int val) : data(val), next(nullptr) {}
};
// Circular Linked List class
class CircularLinkedList {
private:
Node* head;
public:
// Constructor
CircularLinkedList() ... | ALGO | 0.999341 | 6.263561 |
801226c8-72d2-40e1-a5de-6bb8b4ae46c9 | mahadev-sharma/-C-Programming | conditional1.cpp | #include <iostream>
using namespace std;
main() {
cout << "Enter the first number : " ;
double firstNumber;
cin >> firstNumber;
cout << "Enter the second number : " ;
double secondNumber;
cin >> secondNumber;
if ( secondNumber > firstNumber )
cout << "Awsome second is first" ;
}
| TOOL | 0.854752 | 3.203079 |
9f44a54a-3866-4321-89c1-4aff77a32556 | bnafack/openmp | integral_with_cash.cpp | #include<iostream>
#include<omp.h>
#define PAD 8 // assume 64 byte l1ne size
#define NUM_THREADS 4
static long num_steps = 1000000; double step;
int main(){
int i, nthreads; double pi, sum[NUM_THREADS][PAD];
step = 1.0/(double)num_steps;
omp_set_num_threads(NUM_THREADS);
#pragma omp parallel
{
int i,... | ALGO | 0.999977 | 3.330932 |
2b1c6303-d1c1-4e45-a23a-2fa974fd3bb5 | IOSD/IOSD-UIETKUK-HacktoberFest-Meetup-2019 | Intermediate/Binary_Search.cpp | #include <iostream>
using namespace std;
// A recursive binary search function. It returns
// location of x in given array arr[l..r] is present,
// otherwise -1
int binarySearch(int arr[], int l, int r, int x)
{
if (r >= l) {
int mid = l + (r - l) / 2;
// If the element is present at ... | ALGO | 0.999969 | 5.326955 |
3d421235-cd7f-448c-a95a-39e71b171f56 | wenhanshi/lemsvxl-shock-computation | osf-to-esf/dbsk2d_compute_ishock_process.cpp |
// Created by wenhan on 7/19/17.
//
// This is brcv/shp/dbsk2d/pro/dbsk2d_compute_ishock_process.cxx
//:
// \file
#include "dbsk2d_compute_ishock_process.h"
#include "dbsk2d/pro/dbsk2d_shock_storage.h"
#include "dbsk2d/pro/dbsk2d_shock_storage_sptr.h"
#include "vidpro1/storage/vidpro1_image_storage.h"
#include "vi... | ALGO | 0.98488 | 7.11894 |
b3432951-8910-452d-81f8-0861f5c4fc84 | bacuc1998/baitap | Bai051.cpp | //tích các ước số nguyên dương
//#include<iostream>
//using namespace std;
//int main()
//{
// int n;
// cout << "nhap n :" << endl;
// cin >> n;
// int i = 1,T = 1;
// while (i <= n)
// {
// if (n%i == 0)
// T = T* i;
// i = i + 1;
//
// }
//
// cout << "tich uoc so nguyen duong cua n la" << T << endl;
// system("... | ALGO | 0.999853 | 3.272275 |
3a6cc612-03d7-4960-9a57-fe8e3bb61289 | pparth27743/interview-preparation-codes | Graph/DisJointSet.cpp | #include <bits/stdc++.h>
using namespace std;
class DisJointSet {
int *rank, *parent, n;
public:
DisJointSet(int n){
rank = new int[n];
parent = new int[n];
this->n = n;
for(int i=0; i<n; i++)
make_set(i);
}
void make_set(int v){
parent[v] = ... | ALGO | 0.999959 | 4.652629 |
44d57c7c-f57a-4251-b15c-31445423b87f | jNLeee/DataStructures-and-Algorithms | HW2/q5.cpp | #include <iostream>
#include <cstdlib>
#include <queue>
using namespace std;
struct Node
{
int data;
struct Node *left, *right;
};
struct Node *newnode(int data)
{
struct Node *node = new Node;
node->data = data;
node->left = node->right = nullptr;
return (node);
}
int totalNodesofTwoChildre... | ALGO | 0.999891 | 6.687259 |
268401a3-70c7-41c8-9081-8794b64afbce | ishandutta2007/codeforces | feecie6418/normal/1161/C.cpp | #include<bits/stdc++.h>
using namespace std;
int n,a[55],cnt[55],mn=1e9;
int main() {
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i],cnt[a[i]]++,mn=min(mn,a[i]);
if(cnt[mn]>n/2)puts("Bob");
else puts("Alice");
return 0;
} | ALGO | 0.999984 | 4.429107 |
4385e219-696b-4cf6-92ea-fc9895efe2ca | Rintu341/DSA | Stack/Decode_String.cpp | #include <iostream>
#include <string>
#include <vector>
#include <stack>
using namespace std;
class Solution {
public:
string decodeString(string s) {
}
};
int main()
{
string str = "ab";
vector<char> vec ;
str = str + str;
cout<<str<<endl;
str.clear();
cout<<str<<end... | ALGO | 0.998536 | 3.999341 |
c0d67327-b3ef-40be-a562-1f9bcf867e3f | Advay17/DSA-practice | Stacks/StringReverse.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX_SIZE 101
char a[MAX_SIZE];
int top = -1;
void push(char ele){
if(top<MAX_SIZE-1){
a[++top]=ele;
}
}
char pop(){
if(top!=-1){
char ele= a[top];
top--;
return ele;
}
}
int isEmpty(){
return top==-1;
}
int isF... | ALGO | 0.999914 | 5.638301 |
61814389-a9fa-4cf4-8baf-aa78e2974211 | PauloRobertoPC/Library | Contests/Codeforces/DIV 3/820/C.cpp | #include <bits/stdc++.h>
using namespace std;
bool cmp(pair<char, int> a, pair<char, int> b){
if(a.first != b.first) return a.first > b.first;
return a.second < b.second;
}
int main(){
int t; cin >> t;
while(t--){
string s; cin >> s;
int n = s.size();
vector<pair<char, int>> v... | ALGO | 0.999738 | 3.539042 |
3cdf72f4-1f4c-4544-aa1a-2ce145927310 | babisant88/SpLap | src/ApproxReff.cpp | /*
* ApproxReff.cpp
*
* Created on: Jul 3, 2021
* Author: babis
*/
#include "../hpp/ApproxReff.hpp"
#include <iostream>
#include <cmath>
#include "../hpp/iter_solver.hpp"
#define dbg 0
double *appxReff_mem(graph *A_grph, double delta)
{
double *Reff = new double[A_grph->num_of_edges]();
uint k = (uint)... | ALGO | 0.99936 | 4.215371 |
9f2b012d-8229-4012-aa3c-acf07cbdc441 | jala-foundation-student24/frontend_test | 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 |
02026f86-9dd6-4636-9262-b39429c8ff3a | LevyMatan/sample_project | test/sum_of_beauty/sum_of_beauty_test.cpp | #include "gtest/gtest.h"
#include "sum_of_beauty.hpp"
#include <bitset>
TEST( SumOfBeauty, SampleTestCase) {
std::cout << "Testing sum_of_beauty()" << std::endl;
std::cout << "Inputs:" << std::endl;
std::string s("sdgnjsjklgnvjklsazdskjf");
int sum_of_beauty = beautySum(s);
ASSERT_EQ(sum_of_beauty, 232);
... | TEST | 0.982305 | 5.535443 |
67363ff5-ac7e-4087-8b43-d05f5e6aefdf | web-developer-damian94oka/C-and-C-plus-plus-college | Tablice3 najwieksza z.cpp | #include <stdio.h>
#include <stdlib.h>
int main() {
int wielkoscTab, max;
printf("Wybierz ilosc liczb ktore chcesz wprowadzic : ");
scanf("%d", &wielkoscTab);
int tablica[wielkoscTab];
for(int i = 0; i < wielkoscTab; i++){
printf("Wprowadz liczbe calkowita nr %d : ", i + 1);
scanf("%d", &tablica[i]);
... | ALGO | 0.99894 | 3.50201 |
fdb0f217-4abc-455b-88dc-80e4c7231e13 | raincross7/code-similarity | codes/train_code/problem477/problem477_217.cpp | #include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define REP(i,x,n) for(int i = (x); i < (n); ++i)
#define ll long long
#define P pair<ll,ll>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
const ll mod = 1e9+7;
const ll INF... | ALGO | 0.99972 | 4.52193 |
03f4ff43-1439-4460-a46e-084eb7dc50aa | windkeepblow/LeetcodePractice | problem_80_remove-duplicates-from-sorted-array-2.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
if (nums.size() == 0) return 0;
int cur_max = nums[0];
int cur_idx = 1;
int last_num = nums[0];
int bonus = 1;
for (int i = cur_idx; i < nums.size(); i++) {
if (cur_max >= nums[i] && bonus <=... | ALGO | 0.999942 | 6.346012 |
a9150809-02b9-480f-b241-dd27b23fb6fd | ishandutta2007/codeforces | tzc_wk/normal/1110/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define fill0(a) memset(a,0,sizeof(a))
#define fill1(a) memset(a,-1,sizeof(a))
#define fillbig(a) memset(a,63,sizeof(a))
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define mt make_tuple
#define eprintf(...) fprintf(stde... | ALGO | 0.999994 | 3.011047 |
68d73b0e-06d7-4047-bed2-4ad7c5e76276 | LJH-coding/code | 2021 YTP 高中組初賽/hungrytime.cpp | #include <bits/extc++.h>
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target("abm,bmi,bmi2,mmx,sse,sse2,sse3,ssse3,sse4,popcnt,avx,avx2,fma,tune=native")
#pragma comment(linker, "/stack:200000000")
#ifdef local
#define debug(args...) f(#args, args)
template <typename ...T> void f(... | ALGO | 0.999994 | 4.187019 |
367e7026-b014-4219-8485-9ee5e4c330db | Deepak20y/automatic-memory | B_Little_Pony_and_Harmony_Chest.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ull = unsigned long long;
/*I liked you once but not anymore now
She's wearin' dresses on the border line
(Lookin' good)
Oh wakin' senses that were lost in time
(Make amends)
This liberation is the one they'll love for ages
(Hey man, I see th... | ALGO | 0.999978 | 3.767068 |
5b868af8-0542-4694-8ab9-a06d8a85bbc6 | soso-light/PPS | A052_최소미_21900745.cpp | #include <iostream>
#include <string>
using namespace std;
//
int main() {
int T;
string s;
cin >> T;
cin.ignore();
for (int j = 0; j < T; j++) {
getline(cin, s);
int sum, cnt;
sum = cnt = 0;
for (int i = 0; i < s.length(); i++) {
if (s[i] == 'O') cnt++;
else cnt = 0;
sum += cnt;
}
cout << s... | ALGO | 0.996196 | 5.152136 |
8e40b76f-ee97-4447-83b7-b53dcfa299fb | iknoom/Problem_Solving | BOJ/4225.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;
int N;
typedef pair<ll, ll> point;
typedef pair<ll, pair<ll, ll>> dot;
vector< dot > dots;
int convexhull[100001]; // stack
int top; // stack push idx
int ccw(point a, point b, point c) {
point a... | ALGO | 0.999687 | 5.100973 |
ca608371-329b-4034-854d-c56d48c29deb | GIT-heyok/PS | BOJ/Solutions/DP/Tree DP/13325.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <sstream>
#include <string>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <set>
#include <map>
#include <cmath>
#include <memory.h>
#define FAST \
ios::sync_with_stdio(false); \
cin.tie(nu... | ALGO | 0.99974 | 3.807346 |
c47c7399-fcfa-4962-b0f8-b7aa7da6a2c2 | dshnightmare/LeetCodeC | src/ConvertSortedArrayBinarySearchTree.cpp | #include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};
class Solution{
public:
TreeNode *sortedArrayToBST(vector<int> &num){
return help(num, 0, num.size() - 1);
}
TreeNode *help(vector<int> &num, int ... | ALGO | 0.99997 | 6.134916 |
fc074437-b2d6-4206-b5cb-0fc53ef061d6 | Rishika756/DSA | 2917-count-pairs-whose-sum-is-less-than-target/count-pairs-whose-sum-is-less-than-target.cpp | class Solution {
public:
int countPairs(vector<int>& nums, int target) {
int n = nums.size();
int count = 0;
for(int i = 0 ; i<n-1 ; i++){
for(int j = i+1 ; j<n ; j++){
if(nums[i]+nums[j] < target){
count++;
}
}
... | ALGO | 0.999939 | 5.997928 |
8c55d1af-ae62-4951-8d6d-8b2b4ffc22fd | zhxieml/Programming | 06/7/signed_longlongint.cpp | #include "signed_longlongint.h"
#include <iostream>
#include <cstring>
using namespace std;
void SignedLongLongInt::trans()
{
char *tmp;
sign = '+';
tmp = signednumber;
if (signednumber[0] == '-')
{
sign = '-';
tmp = &signednumber[1];
}
if (signednumber[0] == '+')
{
... | TOOL | 0.996702 | 4.049984 |
a8b1e49a-69fe-4199-8f2b-cee13d541ad4 | Brio-yj/AlgorithmStudyBarkingDog | chanwan/week4/graph/1260.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
int n,m,t;
vector<vector<int>> v;
bool cash[1000];
void bfs(int a){
queue<int> qu;
qu.push(a);
cash[a]=true;
int num;
while (!qu.empty())
{
num = qu.front();
qu.pop();
cout << num+1<<" ";
for(int i=0;i<... | ALGO | 0.999996 | 4.244889 |
d376ab4f-286a-445a-be09-106e16af59ae | MZhikoV/04_CPlusPlus_OOP_SoftUni | 03_Objects_and_Classes_Lab/02.Rust.cpp | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
class Board {
private:
char board[10][10];
public:
Board(istream & istr);
void print(ostream & ostr) {
for(size_t x=0; x<10; x++) {
for(size_t col = 0; col<10; col++)
... | ALGO | 0.993431 | 4.479732 |
26db485b-baca-4d76-b56a-59f7b46bb817 | edge555/Online-Judge-Solves | Codechef/That Is My Score.cpp | #include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pf printf
#define sc scanf
#define sf(n) scanf("%d",&n)
#define sff(n1,n2) scanf("%d %d",&n1,&n2)
#define sfff(n1,n2,n3) scanf("%d %d %d",&n1,&n2,&n3)
#define sl(n) scanf("%lld",&n)
#define sll(n1,n2) scanf("%ll... | ALGO | 0.999647 | 3.435901 |
8ab252d8-f866-4b62-8587-b8b7d34d4c98 | Hritik003/Hacker-rank-problems-in-C | printing pattern using loops 2.cpp | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int findMax(int a, int b)
{
if(a > b)
return a;
else
return b;
}
int main()
{
int n;
scanf("%d", &n);
// Complete the code to print the pattern.
for (int i = 1; i <= 2*n - 1; i++)
{
for (int... | ALGO | 0.999948 | 3.185337 |
202c781a-1a57-4c28-8e80-5349f66c2b8a | pcb9382/FaceAlgorithm | include/Eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
std::cout << "Row's maximum: " << std::endl
<< mat.rowwise().maxCoeff() << std::endl;
}
| ALGO | 0.999761 | 3.881484 |
d7be88c3-bb9b-431d-af48-5039bf1274fd | eric070021/2021-Autumn-Introduction-to-Cryptography | HW2/aes/aes/cryptopp860/donna_64.cpp | // donna_64.cpp - written and placed in public domain by Jeffrey Walton
// Crypto++ specific implementation wrapped around Andrew
// Moon's public domain curve25519-donna and ed25519-donna,
// https://github.com/floodyberry/curve25519-donna and
// https://gith... | ALGO | 0.996228 | 7.304822 |
3f249afd-076e-4067-8294-58a2a3c98793 | liujiapeng678/AlgorithmPracticing | 线段树/9.8.cpp |
//segment tree߶segmentation faultδ
// ߶һƽÿڵ¼һεĺ͡߶ÿڵ㶼Ӧһ߶Σ䣩֤е߶Σ䣩߶Ľڵ㣬Ӧֿ
// ߶ ӽڵ䳤ȱұӽڵ䳤ȶһ
// ֽ뵽һAУbuildtreeн߶ȣѣֽһ֣ٴn/2ʼdownͽ˶
// ֮ԽΪÿֻµҪλãҪľµĶȫ
/*
void build(int l,int r,int p) // lrԭе䣬ptree±,һʼ 1n1
{
if(l==r)
{
tree[p] = A[l];
return;
}
int mid = l + r >> 1;
build(l,mid,2*p);
build(mid+1,r,2*p+1);
tree(... | ALGO | 0.999941 | 4.173124 |
06a77bf0-01f1-48fd-b4a9-d569a10193ab | Rana-Randeep/C-PROGRAMS... | initilizationoflinkedl.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int new_data){
data=new_data;
next=nullptr;
}
};
void printLL(Node* head){
while(head!=nullptr){
cout<<head->data;
if(head->next!=nullptr){
cout<<" -> ";
}
head=head->n... | ALGO | 0.995382 | 4.060109 |
6e3d5838-25e5-45b2-9bd8-a013da57a4ba | AniketMukul/Top-50-Graph-Problems-By-GeeksForGeeks-Solutions | XTotalShapes.cpp | class Solution
{
public:
//Function to find the number of 'X' total shapes.
int delrow[4]={-1,0,+1,0};
int delcol[4]={0,+1,0,-1};
void solve(int i,int j,vector<vector<char>>&grid,vector<vector<int>>&visited)
{
queue<pair<int,int>>q;
q.push({i,j});
visited[i][j]=1;
... | ALGO | 0.999882 | 6.48865 |
189c4d52-8321-484f-bd9f-223ac3bfff6f | Pallavi1904/Cpp | templates.cpp | // TEMPLATE IS ONE OF MOST IMP CONCEPT ACCORDING TO COMPITATIVE EXAM
#include <iostream>
using namespace std;
template <class T> //TEMPLATE...we can simply define T instead of data type
class Vector{
public:
T* arr;
int size;
Vector(int m){
size=m;
arr=new T[size];
}
T sum(Vector &v){
T d=0;
for(... | ALGO | 0.996696 | 4.119968 |
34315a4f-32cf-48e8-8cfb-922d36fb9800 | Nickeron-dev/Codewars | c++/kyu4/parse_int.cpp | #include <string>
#include <vector>
#include <cstring>
using namespace std;
long parse_int(std::string number) {
if (number == "one million")
{
return 1000000;
}
if (number == "zero")
{
return 0;
}
vector<string> nstr = {"one", "two", "thr", "fou", "fiv", "six", "sev", "eig", "nin", "ten", "ele"... | ALGO | 0.993938 | 4.187441 |
ea0e37b8-b9be-4bdb-a29e-793f6f455474 | hachemite/c-Structure_de_donnees | trie/triBulleLSC.cpp | #include <stdio.h>
#include <stdlib.h>
typedef struct Node {
int data;
struct Node* next;
} Node;
Node* create_node(int data) {
Node* new_node = (Node*)malloc(sizeof(Node));
new_node->data = data;
new_node->next = NULL;
return new_node;
}
void insert_node(Node** head, int data) {
Node* ne... | ALGO | 0.999985 | 4.61454 |
fcd79ddf-fd46-429d-9fbe-bc160e09abef | MinKevin/AlgorithmWithCLion | barkingdog/[0x10]dynamicProgramming/241021-11055.cpp | #include <sstream>
#include <iostream>
#include <vector>
using namespace std;
int N;
vector<int> board;
vector<int> dp;
int answer;
void input() {
cin >> N;
board = vector(N, -1);
dp = vector(N, -1);
for (int i = 0; i < N; i++) {
cin >> board[i];
}
}
void solution() {
for (int i = 0... | ALGO | 0.999926 | 4.902572 |
f4a9bdc3-d0e6-4155-bc65-a44909068b61 | SAGAR-RAJ1/DSA-CODES1 | VIDEO 8/PATTERN1.cpp | #include <iostream>
using namespace std;
int main()
{
for (int row = 5; row >= 1; row--)
{
for (int space = row-1; space > 0; space--)
{
cout<<" ";
}
for (int column = 6-row ; column >0 ; column--)
{
cout<<"*";
}
cout << endl;
... | ALGO | 0.989679 | 3.11508 |
2ccf3831-561a-4ce3-980c-bfe613ad7c8c | ThoseBygones/ACM_Code | BZOJ/BZOJ 3894.cpp | /*
********************************************************************************
* Author: ThoseBygones
* Version: V1.0
* Date: 2018-09-30
* Subject: ACM-ICPC
* Language: C/C++11
* OJ: BZOJ
* Algorithm: 最大权闭合子图
********************************************************************************
* Algo-... | ALGO | 0.999953 | 3.482328 |
c2944911-3422-4c89-95a2-e9373e39fc4d | M-Farjad/FlutterapP | chatgpt1/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.998525 | 6.785645 |
98bc3549-b929-44d0-954b-6419fa23ca5f | g932150283/leetcode | mycode/34回溯/216.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<int>> res;
vector<int> path;
vector<vector<int>> combinationSum3(int k, int n) {
backtracking(k, n, 1);
return res;
}
void backtracking(int k, int n, int start){
if(path.size() == k && (su... | ALGO | 0.999871 | 6.070206 |
8ea6e4b1-617d-4449-bd0b-96044e28b647 | AnjaliPatle/Leetcode-Challenge | November_Challenge/Problem7.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
ListNode* p,*q;
p=l1; q=l2;
int c1=0,c2=0,carry=0,v... | ALGO | 0.999939 | 5.847947 |
8ed73ec0-6611-4f82-8b89-b63f40fb99da | zbw001/TAPIP3D | third_party/megasam/base/thirdparty/lietorch/eigen/doc/examples/TemplateKeyword_flexible.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
template <typename Derived1, typename Derived2>
void copyUpperTriangularPart(MatrixBase<Derived1>& dst, const MatrixBase<Derived2>& src)
{
/* Note the 'template' keywords in the following line! */
dst.template triangularView<Upper>() = src.template... | TOOL | 0.989859 | 5.804369 |
7b869b37-33a2-443b-b03a-ac886a07a03f | RedaMokarrab/Udemy_DataStructure_Algo | Graph-DataStructure/dfs and prims/dfs(net).cpp | #include<iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;
int cost[10][10],i,j,k,n,stk[10],top,v,visit[10],visited[10];
int main()
{
int m;
cout <<"Enter no of vertices:";
cin >> n;
cout <<"Enter no of edges:";
cin >> m;
cout <<"\nEDGES \n";
for(k=1; k<=m; k++)
{
... | ALGO | 0.999984 | 4.130223 |
1f65ec6a-97c5-4949-90b7-e357777c3295 | windbicycle/oru-ros-pkg | grasping_oru/aass_icr/libicr/icrcpp/tools/eigen-eigen-3.0.2/doc/examples/Tutorial_ArrayClass_cwise_other.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXf a = ArrayXf::Random(5);
a *= 2;
cout << "a =" << endl
<< a << endl;
cout << "a.abs() =" << endl
<< a.abs() << endl;
cout << "a.abs().sqrt() =" << endl
<< a.abs().sqrt() << endl... | ALGO | 0.981702 | 3.130341 |
0e285cf9-f45c-4ad0-88b0-1d30849a5428 | pioneerAlpha/CP_Beginner_B1 | Class 10 - solve class 4/C.cpp | #include<bits/stdc++.h>
#define MOD ((int)1e9 + 7)
#define N ((int)2e6 + 7)
#define fastio ios_base::sync_with_stdio(false),cin.tie(NULL)
#define endl "\n"
#define ll long long
using namespace std;
/*fast io
ios_base::sync_with_stdio(false);
cin.tie(NULL);
*/
int fac[N] , ifac[N];
int power(int n , int p)
{
if(... | ALGO | 0.999869 | 4.313625 |
9374de2c-f7ed-4290-b217-299985e28522 | atuly31/Leetcode-Solutions | 2460-apply-operations-to-an-array/2460-apply-operations-to-an-array.cpp | class Solution {
public:
vector<int> applyOperations(vector<int>& nums) {
int n = nums.size();
for(int i=0;i<n-1;i++){
if(nums[i]==nums[i+1]){
nums[i]=nums[i]*2;
nums[i+1]=0;
}
else{
continue;
}
}
int i=0;
for(int j=0;j... | ALGO | 0.999985 | 5.302616 |
a7c06cb2-3646-4b1a-812f-7b7deb7baf06 | carterqberry/SQLite | Stuff/CCSC/Algorithms/accumulate.cpp | // fun sqsum nums = foldl (fn (a,b) => a * a + b) 0 nums;
#include <iostream>
#include <numeric>
using namespace std;
int sum_sofar(int b, int a) {
return a*a + b;
}
int main() {
int a[] = {1,2,3,4};
cout << accumulate(a, a+4, 0, sum_sofar) << endl;
cout << accumulate(a, a+4, 1, multiplies<int>());
}... | ALGO | 0.999659 | 4.570109 |
169f7c74-e1f1-49e8-a3f1-5f9097817ce6 | gitHritik/Cpp | Special_permutation.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
int32_t main(){
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
cout << (i + 1) % n + 1 << " ";
}
cout << endl;
}
} | ALGO | 0.999879 | 3.876433 |
e9edbdd0-a709-4af9-a879-c9c3c629ef6c | NgesBrian/saferewrite_for_test | src/openFHE_bigintdyn_add_bitVal/ref/verify.cpp | #include <stdio.h>
#include <vector>
#include <array>
typedef unsigned char uschar;
const unsigned int m_numDigitInPrintval = 1500;
void addbitVal(unsigned char* a, unsigned char b) {
uschar ofl = 0;
*(a + m_numDigitInPrintval - 1) += b;
for (int i = m_numDigitInPrintval - 1; i > -1; i--) {
*(a + ... | ALGO | 0.985141 | 3.438836 |
0680b96f-b94e-46ff-9669-1dab675e3747 | MotoAcidic/Shroud | src/elysium/signaturebuilder.cpp | #include "sigmaprimitives.h"
#include "signaturebuilder.h"
#include "../base58.h"
namespace elysium {
SigmaV1SignatureBuilder::SigmaV1SignatureBuilder(
CBitcoinAddress const &receiver,
int64_t referenceAmount,
SigmaProof const &proof)
{
CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION);
// seria... | TOOL | 0.857152 | 7.071273 |
8c90299b-eced-486f-a564-eff6cc9418bd | andgra2/poker | hand.cpp | #include "hand.hpp"
namespace Poker
{
bool operator<(const Hand &h1, const Hand &h2)
{
if (static_cast<int>(h1.type_) < static_cast<int>(h2.type_))
return true;
else if (static_cast<int>(h1.type_) == static_cast<int>(h2.type_))
{
switch (h1.type_)
{
... | ALGO | 0.94551 | 5.757157 |
3e378ea1-60a6-451e-a4c2-aa8fc66496d2 | codeisop/competitive-programming | templates/binarysearch/main.cpp | // main.cpp
#include <iostream>
#include "BinarySearch.h"
int main() {
std::vector<int> arr = {1, 3, 5, 7, 9, 11, 13};
int key = 7;
int result = binarySearch(arr, key);
if (result != -1) {
std::cout << "Element found at index " << result << std::endl;
} else {
std::cout << "Eleme... | ALGO | 0.999961 | 6.336699 |
5b6c6e21-bb36-4d34-bf54-51613c5d8c3e | AlecBrooks/C-PlusPlus | random/Kaprekars_constant.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <fstream> // for file output
using namespace std;
vector<int> intToVector(int num) {
vector<int> digits;
for (int i = 1000; i >= 1; i /= 10)
digits.push_back((num / i) % 10);
return digits;
}
int vectorToInt(co... | ALGO | 0.976999 | 6.092869 |
89fae62f-cc0d-4076-8ca7-118fc363d9c4 | ishandutta2007/codeforces | qiuzx/normal/1051/F.cpp | //ANMHLIJKTJIY!
#pragma GCC optimize(2)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector")
#pragma GCC diagnostic error "-fwhole-program"
#pragma GCC diagnostic error "-fcse-skip-blocks"
#pragma GCC diagnostic error "-funsafe-loop-optimizations"
#include <bits/s... | ALGO | 0.999975 | 4.599245 |
18fe563f-2d5f-4e45-b393-f1e156d810b5 | ishandutta2007/codeforces | hitonanode/normal/1450/B.cpp | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, e... | ALGO | 0.999923 | 5.276234 |
6c6fa320-2b49-44a8-9f3d-04368b2b8c32 | prabowo02/toki-regular-open-contest | troc-23/troc-23-tiles/solution.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
long long n, m;
cin >> n >> m;
long long min3 = (n+n%2)*(m+m%2)-n*m;
if(3*min3>n*m){
cout << -1 << endl;
}else{
cout << (n*m-3*min3)/4 << endl;
}
}
| ALGO | 0.999981 | 3.95461 |
2d29b8f4-e5c1-4a06-a082-cfe1692ecefe | ershehzan/Cpp_Codes | Max-E-arr.cpp | #include <iostream>
#include <climits>
using namespace std;
int main()
{
int arr[1000]; // Array to store elements
int n; // Variable to store number of elements
cout << "Enter the index: ";
cin >> n;
cout << "Enter the Elements: ";
for (int i = 0; i < n; i++)
{
cin >> arr... | ALGO | 0.999713 | 4.85892 |
5b470a69-1e39-44f2-aa42-d3446a7bc3f7 | soonkwan1/beakjoon | bj20546.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <deque>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#define endl "\n"
#define ll long long
#define fastio cin.tie(NULL), cout.tie(NULL), ios_base::sync_with_stdio(f... | ALGO | 0.999962 | 4.12573 |
beec5ca2-266b-47d1-94cb-1867eb0fcf45 | Coloquinte/moosic-yosys-plugin | src/output_corruption_optimizer.cpp | #include "output_corruption_optimizer.hpp"
#include <algorithm>
#include <bitset>
#include <cassert>
#include <stdexcept>
OutputCorruptionOptimizer::OutputCorruptionOptimizer(const std::vector<CorruptionData> &data) : outputCorruption_(data)
{
for (const CorruptionData &d : data) {
corruptionRate_.push_back(countS... | ALGO | 0.99975 | 6.585978 |
15a5cc23-9ea0-4f89-ae05-0e22ae4cda53 | Bertrand0001/datasciencecoursera | RProjects/win-library/3.2/Rcpp/examples/ConvolveBenchmarks/convolve14_cpp.cpp | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
// This is a rewrite of the 'Writing R Extensions' section 5.10.1 example
#include <Rcpp.h>
using namespace Rcpp ;
RcppExport SEXP convolve14cpp(SEXP a, SEXP b){
NumericVector xa(a), xb(b);
int n_xa = xa.size() ;
int n_xb = xb.size(... | ALGO | 0.962707 | 6.087545 |
e8d76048-6c25-4b56-ba20-cf15b17d3dd9 | jack-pan-ai/ParallelScaledBlockVecchiaGP | src/block_info.cpp | #include "block_info.h"
#include <algorithm>
#include <mpi.h>
#include <cmath>
#include <omp.h>
#include <iostream>
#include "flops.h"
// Function to create block information for each processor
std::vector<BlockInfo> createBlockInfo_test(const std::vector<std::vector<PointMetadata>> &finerPartitions,
... | ALGO | 0.997601 | 4.294926 |
b530cd6a-6ecf-43f3-beda-3f8ed1c17379 | Fortich/HackerRank-Training | sock-merchant/main.cpp | #include <bits/stdc++.h>
#include <map>
using namespace std;
vector<string> split_string(string);
int sockMerchant(int n, vector<int> ar) {
vector<int> socksNumb(100);
for (int i = 0; i < 100; i++){
socksNumb[n] = 0;
}
for (int i = 0; i < n; i++){
socksNumb[ar[i]-1]++;
}
int p... | ALGO | 0.999968 | 5.285149 |
3e56353e-4358-45de-9b09-d0b3c86ee0bd | aditya-mishr/k-step-function-approximation | checkError.cpp | #include <bits/stdc++.h>
using namespace std;
#define DEBUG2(x) do { std::cerr << #x << ": " << x << std::endl; } while (0)
string infile,outfile;
vector<double> points_x;
vector<double> points_y;
vector<double> step_x;
vector<double> step_y;
double typeError;
double k_value;
double numInputPoints;
double steps_used;
... | ALGO | 0.998454 | 4.074112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.