uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
344eb861-ad27-4f20-bcbe-c417ca802bdd
AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain
code-imitator/data/dataset_2017/dataset_2017_8_formatted_macrosremoved/iwashi31/5304486_5760761888505856_iwashi31.cpp
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #in...
ALGO
0.999976
3.790365
0d9b7208-2af8-468a-ac88-0e1f138d5e82
rail5/polonius
src/block.cpp
#include "polonius.h" #include "block.h" #include "shared/process_special_chars.h" #include <stdexcept> Polonius::Block::Block(const Polonius::Block& other) { this->start_position = other.start_position; this->contents = other.contents; this->op = other.op; this->is_initialized = other.is_initialized; } Polonius...
TOOL
0.898493
7.573026
909336dc-d66f-40fb-9cf3-6280bf73ea34
ishandutta2007/codeforces
ynsm/normal/1428/G1.cpp
#include <bits/stdc++.h> #define f first #define s second #define pb push_back #define mp make_pair using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<long long, long long> pll; const int N = 1000000; const ll INF = 1e18; int k; ll p[7], F[7], dp[7][N]; deque< int > dq; ll cal...
ALGO
0.999166
3.233356
ba129d9f-39e0-4887-8971-7e5feb164b54
mohammad-majoony/codeForces-submits
B. Broken Keyboard/mian.cpp
#include<bits/stdc++.h> #define enl '\n' ; using namespace std ; string solve(){ int len ; string text ; cin >> len >> text ; for(int index = 1 ; index < len ; index += 3){ if(index + 1 >= len || (index + 1 < len && text[index] != text[index + 1])) return "NO" ; } return "YES" ; } int...
ALGO
0.999718
3.858067
a53f277b-c702-40b9-ab55-7899c06528ec
YangYue2022/DataStructure
数据结构与算法教材示例源代码/5.2.cpp
#include <iostream> using namespace std; template <class T> int BiSearch(T Array[], T key, int n) { //۰ҹ̣Array[0,,n-1]Ϊҵݼ¼keyΪҵļ¼ int left = 0; //ҷΧ int right = n-1; //ҷΧҶˣnʾij int mid; //ҷΧм while (left <= right) {//ҷΧЧвң mid = (left + right)/2; if (key < Array[mid]) { //ҷ...
ALGO
0.999864
4.496295
7a1a43c8-ffa9-4ae0-873c-5852bb0a8dbd
ifilex/sensa
ndk/sources/cxx-stl/llvm-libc++/libcxx/test/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/find.pass.cpp
// <string> // template<> struct char_traits<wchar_t> // static const char_type* find(const char_type* s, size_t n, const char_type& a); #include <string> #include <cassert> int main() { wchar_t s1[] = {1, 2, 3}; assert(std::char_traits<wchar_t>::find(s1, 3, wchar_t(1)) == s1); assert(std::char_traits<w...
TEST
0.960048
5.087918
4a136606-fa01-4c99-b5be-4c86505ccd08
SkyFireArchives/SkyFireEMU_434
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
8a288f1e-f4c5-4f4e-80a0-e068b5617b66
taronegeorage/AlgorithmTraining
Stack/1.Baseball Game/solution.cpp
// 682. class Solution { public: int calPoints(vector<string>& ops) { vector<int> s; for(const string& op : ops){ if(op == "+") s.push_back(s.end()[-1]+s.end()[-2]); else if(op == "C") s.pop_back(); else if(op == "D") ...
ALGO
0.999732
6.288993
7b5cd53e-a3ab-4601-a6e4-a728f4c2bfb5
Yawn-Sean/Daily_CF_Problems
daily_problems/2025/05/0519/personal_submission/cf1915g_hum.cpp
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.h" #else #define debug(...) 42 #endif void solve() { int n, m; cin >> n >> m; vector<vector<array<int, 2>>> g(n); for (int i = 0; i < m; i++) { int u, v, w; cin >> u >> v >> w; u--, v--; g[u].push_back({v, w}); g[v]...
ALGO
0.99991
5.614571
8bc47f6f-f85a-49d8-8c70-8c7ea5b2dac5
ketan-suthar/Algorithms
Dynamic Programming/Intermidate/LongesPalindromicString.cpp
#include <bits/stdc++.h> using namespace std; #define SIZE 1001 static int table[SIZE+1][SIZE+1]; // int max(int a, int b) // { // return (a > b)? a : b; // } int fun(string text1, int m, string text2, int n) { int i, j; for (i = 0; i <= m; i++) { for (j = 0; j <= n; j++) ...
ALGO
0.999963
5.351014
0f47f89a-2525-4a3e-91a5-185f7be5fb6d
leanderpfeiffer/EL2450-Hybrid-and-Embedded-Control-Systems
Homework2/HW2_sources_Ubuntu64bit/truetime/kernel/compfunctions.cpp
#ifndef COMP_FUNCTIONS #define COMP_FUNCTIONS // Sorts tasks according to their wakeup time // Should return 1 if time(n1) < time(n2), 0 otherwise int timeCmp(Node* n1, Node* n2) { double cmp1, cmp2; Task* t1 = (Task*) n1; Task* t2 = (Task*) n2; cmp1 = t1->wakeupTime(); cmp2 = t2->wakeupTime(); return...
ALGO
0.999273
4.888884
97320277-c52c-4764-9b17-2e8b8dc661a7
Madaoby/111
routing/car_directions.cpp
#include "routing/car_directions.hpp" #include "routing/turns.hpp" #include "routing/turns_generator.hpp" #include "routing/turns_generator_utils.hpp" #include "geometry/angles.hpp" #include <limits.h> namespace routing { using namespace std; using namespace turns; using namespace ftypes; CarDirectionsEngine::CarD...
ALGO
0.990181
7.72383
e0fdcc6d-7dd6-49d6-9d9b-cb08012ef67a
QuteFuzz/QuteFuzz2.0
src/generator.cpp
#include <generator.h> void Generator::setup_builder(const std::string entry_name){ if(grammar->is_rule(entry_name)){ builder->set_entry(grammar->get_rule_pointer(entry_name)); } else if(builder->entry_set()){ WARNING("Rule " + entry_name + " is not defined for grammar " + grammar->get_name() ...
TOOL
0.986369
6.121648
8b12f601-c212-4488-9b30-4bfc0ab90625
arpitrathore055/Leetcode-Solutions
0279-perfect-squares/0279-perfect-squares.cpp
class Solution { public: int numSquares(int n) { vector<int>dp(n+1,INT_MAX); dp[0]=0; dp[1]=1; for(int i=2;i<=n;i++){ int start=sqrt(i)+1; for(;start>=1;start--){ int square=start*start; if(square <= i){ int ...
ALGO
0.999945
5.763403
a8364977-9b17-487e-b16c-485ead957f44
KangPuding/Code-Test
프로그래머스/0/181881. 조건에 맞게 수열 변환하기 2/조건에 맞게 수열 변환하기 2.cpp
#include <string> #include <vector> using namespace std; int solution(vector<int> arr) { int answer = 0; while (true) { vector<int> A = arr; for(int i = 0; i < arr.size() - 1; i++){ if(arr[i] >= 50 && arr[i] % 2 == 0) A[i] = arr[i] / 2; else if (arr[i] < 50 && arr[i] %...
ALGO
0.999896
4.854269
615488e3-8266-4bb8-b229-2d0ed678632e
chuong1210/RideOS
flutter_app/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.998007
6.76775
448767fd-559e-4015-b92d-6f17f9ae0089
Agenghadiwicaksono/AI-Novel-Generator
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
74e57ae6-e8fc-4b3f-8870-0534552c6826
jochongs/codetree-TILs
240223/점수 비교/score-comparison.cpp
#include <iostream> using namespace std; int main() { // 여기에 코드를 작성해주세요. ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int aMath, bMath; int aEng, bEng; cin >> aMath >> aEng; cin >> bMath >> bEng; if (aMath > bMath && aEng > bEng) { cout << 1; ...
ALGO
0.999856
3.442524
4a0f17ed-2056-4956-a8e1-62925ac18581
Faizan-313/Data-Structures
Level 2/Recursion/sorting/merge_sort.cpp
//without creating temporary arrays //it uses shifting in the main array which increases its time complexity #include <iostream> using namespace std; void merge(int *arr, int s, int e, int mid){ int s1 = s; int s2 = mid+1; while(s1<=mid && s2 <= e){ if(arr[s1]<=arr[s2]) s1++; else{ ...
ALGO
0.999993
4.951894
351e3e2a-e3c9-4e67-a92d-72e4dfcbbab7
Superm4n97/competetive-programming
Codeforces vol 02/1296F.cpp
#include<bits/stdc++.h> #define ll long long int #define pb push_back #define show(x) cout << #x << " : " << x << endl using namespace std; vector < ll > G[5005] ; vector < pair < ll , pair < ll , ll > > > v; //map < pair < ll ,ll > , ll > index; ll index[5005][5005]; bool ans = true; ll P[5005] , val[5005]; ll df...
ALGO
0.999965
4.194143
5a536594-6ee9-48e1-be4c-dba7d760d531
AliOsm/CompetitiveProgramming
CodeForces/7D. Palindrome Degree.cpp
/* Idea: - Using hashing we can check for each prefix if it is a palindrome or not. - From the information from the previous point we can calculate the result. */ #include <bits/stdc++.h> using namespace std; int const N = 5e6 + 1; int const p = 67; int const m = 1e9 + 9; char s[N]; int n, res[...
ALGO
0.999977
4.751382
a3c1225a-fdff-4093-8f4c-e713689d9b68
ouspheaktra/cpp-mini
07 - sort/sort.cpp
#include <iostream> using namespace std; void selection_sort(int array[], int size); void bubble_sort(int array[], int size); void insertion_sort(int arra[], int size); void reverse(int array[], int size); // reverse array main () { const int size = 7; int arr[size] = {12, 18, 2, 4, 3, 7, 9}; bubble_sort(arr, size...
ALGO
0.999644
4.598828
3d946416-20c7-43b7-b64d-8879eda4575e
phooeniix/algorithms
Árvores/ClasseNoList.cpp
#include <iostream> #include "ClasseNoList.h" using namespace std; //bool List::Empty() {return (primeiro==NULL)}; void List::Insert(int dado){ //Criando um novo nó No* novo = new No; novo->dado = dado; novo->prox = NULL; //Agora inserindo o nó na lista //Se a lista estiver vazia, inserimos no primeiro nó if (Em...
ALGO
0.877567
4.229853
3fb03525-3427-4913-a025-8bf28af0f70f
vaibhav19mark1/DSA_Sheet
Stacks_Queues/gfg_implement_2stacks_1array.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; class twoStacks { int *arr; int size; int top1, top2; public: twoStacks(int n=100){size = n; arr = new int[n]; top1 = -1; top2 = size;} void push1(int x); void push2(int x); int pop1(); int pop2(); }; int main() { ...
ALGO
0.996399
5.235765
66d3caed-7f1a-4c37-a35d-a0bb3335f84d
manikanta2901/ubuntu
.history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/ChefAndAnts_20210112142116.cpp
#include<bits/stdc++.h> #include<vector> #include<iostream> #include<cmath> #include<algorithm> #include<iterator> #include<string> #include<map> #define vv vector #define F first #define S second #define MP make_pair #define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define printM...
ALGO
0.999964
3.632112
aa0d4d8b-061b-4a38-bc81-c0e734439b36
arnabs542/LeetCode-26
C++/1229-meeting-scheduler.cpp
// Tags: Two-pointers Sort Heap Amazon Premium // Time: O(nlogn) // Space: O(1) // Two pointers solution class Solution { public: vector<int> minAvailableDuration(vector<vector<int>>& slots1, vector<vector<int>>& slots2, int duration) { sort(slots1.begin(), slots1.end()); sort(slots2.begin(), slots2...
ALGO
0.999974
6.55852
eb1d3e95-d0cc-4944-918c-44e8d20203b8
sureyeaah/Competitive
SPOJ/CNTPRIME.cpp
#include <bits/stdc++.h> using namespace std; #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define FOR0(i,n) for(int i=0, _##i=(n); i<_##i; ++i) #define FOR(i,l,r) for(int i=(l), _##i=(r); i<_##i; ++i) #define FORD(i,l,r) for(int i=(r), _##i=(l); --i>=_##i; ) #define repi(i,a) for(__typeof((a).begin()) i=(a)...
ALGO
0.999068
3.462932
384ed935-fc9f-4ebf-9df0-9a50f635807f
CodingPoeta/My_LOAinMCTS
My_LOAinMCTS/My_LOAinMCTS/MyChessBoard.cpp
#include "pch.h" #include "MyChessBoard.h" #include <iostream> #include <bitset> #include <bitset> #include <bitset> namespace loa { std::vector<POSITION > MyChessBoard::getFeasible(POSITION pos) { std::vector<POSITION> vec; POSITION tmp; if (getFeasibleDir(pos, std::make_pair(-1, -1), tmp)) vec.push_back(tmp)...
ALGO
0.997761
4.294091
27f0a086-9e0a-4d0d-9ae7-68311d7c328c
sekharbag/coding
c++/LinkedList/LL.CPP
#include<iostream> using namespace std; class Node {//LL NODE //user defined datatype public: int val; Node* next; Node(int val) { this->val=val; this->next=NULL; } }; class LinkedList{//user deinfed data strature public: Node* head; Node* tail; int size; LinkedList(){ head=t...
ALGO
0.99921
4.391734
58dd838a-45a0-4ecd-95ab-1f0c3c48aa4e
technexion-android/platform_frameworks_av
media/libstagefright/codecs/amrnb/common/src/negate.cpp
/* Pathname: ./gsm-amr/c/src/negate.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Created separate file for the negate function. Sync'ed up with the current template and fixed tabs. Description: Removed conditional code that updates WMOP...
TOOL
0.892751
6.032191
089239b7-2dab-4493-aa18-ae3a03fd5574
Sbai7/PSUADE
Src/PDFLib/PDFMVNormal.cpp
#include <assert.h> #include <stdio.h> #include <math.h> #include "Globals.h" #include "PsuadeUtil.h" #include "PDFMVNormal.h" #include "PDFNormal.h" #define PABS(x) (((x) >= 0) ? x : -(x)) // ************************************************************************ // constructor // ----------------------------------...
ALGO
0.998348
3.243805
4f0d4dcb-44c4-498d-9a62-c429467704fd
furkankyildirim/CS300-Data-Structures
HW 2 - Ziv-Lempel Algorithm with Hash Tables/compress-program/main.cpp
// // Created by Furkan K. Yıldırım on 11.11.2021. // furkanyildirim 28138 #include <iostream> #include <string> #include <sstream> #include <fstream> #include "HashTable.cpp" using namespace std; int main() { // Initializes main string and hash table string text; int pos = 0, notFound = -1; H...
ALGO
0.999852
4.383621
2462bc89-2417-4fa5-a085-57921d92241f
ssugam10/leetcode-solutions
0237-delete-node-in-a-linked-list/0237-delete-node-in-a-linked-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: void deleteNode(ListNode* node) { node->val = node->next->val; node->next = node->next->next; } };
ALGO
0.999717
5.612188
0dacca44-a22c-4821-bd08-5d6ae2a063eb
SaiVamshiK/Data-Structure-in-C-
Revised DS/DP/Arithmetic Slices.cpp
An integer array is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. For example, [1,3,5,7,9], [7,7,7,7], and [3,-1,-5,-9] are arithmetic sequences. Given an integer array nums, return the number of arithmetic subarrays of nums. A su...
ALGO
0.999844
5.760812
597f2fb2-a2ce-4caf-86bf-28ea5199cfc8
open-watcom/owp4v1copy
bld/plusplus/cpplib/string/cpp/matchstr.cpp
#include "strng.h" signed long __MatchStrings( const char *s1, size_t s1len, const char *s2, size_t s2len ) { /***************************************************************/ // Match two strings, returning the offset from the start where // "s1" and "s2" differ. // Assumes "s1" and "s2" a...
TOOL
0.94377
4.483792
f6947b0c-4667-4874-9e74-56848f946ef8
gangwar1234/CP
codeforces/A_675.cpp
#include <bits/stdc++.h> using namespace std; typedef long long lo; typedef vector<lo> vl; typedef vector<vl>vll; #define all(v) (v).begin(), (v).end() #define debug(x) cerr<<#x<<" = "<<x<<endl; #define REPV(a, b, c) for (lo(a) = b; (a) < (c); (a)++) #define REP(a,b) for(lo i =(a) ;i<(b);i++) template <typename T> i...
ALGO
0.999619
4.132511
23935639-1014-4258-afe3-f8f276f701bf
sqsong47/JRR
Eigen/doc/examples/class_CwiseUnaryOp.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; using namespace std; // define a custom template unary functor template<typename Scalar> struct CwiseClampOp { CwiseClampOp(const Scalar& inf, const Scalar& sup) : m_inf(inf), m_sup(sup) {} const Scalar operator()(const Scalar& x) const { return x<m_...
ALGO
0.953733
6.417363
a789f13c-9bdc-438a-89a3-316fb1273fd7
Fighohji/Competitive-Programming
Record/PassRecord/2023HDU4/1006.cpp
#include <map> #include <set> #include <array> #include <cmath> #include <queue> #include <stack> #include <tuple> #include <bitset> #include <cctype> #include <cstdio> #include <random> #include <string> #include <vector> #include <cassert> #include <cstring> #include <numeric> #include <iomanip> #include <iostream> #...
ALGO
0.999792
4.601769
70f44887-83ec-4486-a1b1-779626d05083
EricJeffrey/myleetcode
leetcode/problems/236.cpp
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; struct TreeNode { int val; Tre...
ALGO
0.999987
5.549745
0430b193-798c-4227-b7de-754f923eae98
libretro/higan
higan/ngp/cpu/rtc.cpp
auto CPU::RTC::step(uint clocks) -> void { counter += clocks; while(counter >= cpu.frequency()) { counter -= cpu.frequency(); if(!enable) continue; //it is unknown what happens when invalid BCD values are fed into the RTC //if it is anything like the Epson RTC-4513, the answer could be quite horrif...
TOOL
0.924889
6.124968
796a5199-43f9-4920-8976-532344cd7324
Vaibhav10sept/DSA
ARRAYS AND STRINGS LEVEL-2/Buy-Maximum-Stocks-if-i-stocks-can-be-bought-on-i-th-day.cpp
#include <bits/stdc++.h> using namespace std; bool comparator(pair<int, int> a, pair<int, int> b) { //inc orddr of price if (a.first == b.first) { //price is same //dec order of quantity return a.second > b.second; } return a.first < b.first; } int buyMaximumProducts(int n, int k, int price[]) { // * NOTE: i ...
ALGO
0.999721
4.972362
c515add3-f7a9-4032-bb45-9df175b5ad0d
Sayan4391/CrackYourPlacement
0014-longest-common-prefix/0014-longest-common-prefix.cpp
class Solution { public: string longestCommonPrefix(vector<string>& strs) { string ans=""; sort(strs.begin(),strs.end()); int n=strs.size(); string first=strs[0],last=strs[n-1]; for(int i=0;i<min(first.size(),last.size());i++){ if(f...
ALGO
0.999894
5.697086
38e47c45-acab-4002-8dca-4002721cd4f4
AChen24562/C-Plus-plus
Intro To C++/Week 3/EX_5a_constants.cpp
// (c) S. Trowbridge // Ex 5 - Constants #include <iostream> #include <string> using namespace std; int main() { // constant variable names should always be UPPERCASE // constants are constant, they cannot be modified const string PAYDAY = "Friday"; // PAYDAY = "Monday"; // remove comment to enable f...
CONFIG
0.867372
4.675915
cdffb629-21c9-41e9-849c-feea85a9d2b2
jim2832/Leetcode
0133-clone-graph/0133-clone-graph.cpp
/* // Definition for a Node. class Node { public: int val; vector<Node*> neighbors; Node() { val = 0; neighbors = vector<Node*>(); } Node(int _val) { val = _val; neighbors = vector<Node*>(); } Node(int _val, vector<Node*> _neighbors) { val = _val; ...
ALGO
0.999951
6.333547
96899394-5b64-4263-94dd-d3c36ded46d9
ishandutta2007/codeforces
ngfam/normal/1286/B.cpp
#include<bits/stdc++.h> using namespace std; const int MAXN = 2020; int n; int cnt; int child[MAXN]; int L[MAXN], R[MAXN]; int inv[MAXN]; int ans[MAXN]; int order[MAXN]; vector < int > g[MAXN]; void upd(int x, int delta, int bound) { for(int id = L[x]; id <= R[x]; ++id) { int v = inv[id]; if(ans[v] >= bou...
ALGO
0.999999
4.077487
7c3b5680-1d6f-47aa-80a0-452db5c63347
hjiang13/LLMs-in-IR
POJ-104/37/713.cpp
#include <iostream> using namespace std; void main() { int t,time,flag=0,i,j; char a[100000],first=0; void yesorno(int Flag,char First); cin >> "%d",&t); for(time=0; time<t; time++) { cin >> "%s",&a); if(a[1]=='\0'){ cout << "%c\n",a[0]); continue; } for(i=0; a[i]!='\0'; i++){ for(j=0; a[j]!='\0'; j++){ if(i==j) contin...
ALGO
0.999917
3.063617
a738d7bb-98f8-4bcf-9b2e-3fe278ab82b5
aurnabnil66/C-plus-plus-Programming-Basics
Data Structure/Graph/Adjacency Matrix (Weighted Edge).cpp
#include <bits/stdc++.h> #include <stdlib.h> using namespace std; int graph[200][200]; int main() { int num_of_nodes,num_of_edges; cout << "Enter number of nodes : "; cin >> num_of_nodes; cout << "Enter number of edges : "; cin >> num_of_edges; int source,destination,weight; for ...
ALGO
0.997004
4.077825
c7c7752a-3a0b-471f-a406-ccfa923e3a83
suryakiranmg/LeetCodeProbs
SieveOfEratosthenes_Primes/Sieve_of_Eratosthenes.cpp
// Prime nos till n---Sieve of Eratosthenes #include <bits/stdc++.h> using namespace std; void SieveOfEratosthenes(int n) { bool prime[n+1]; memset(prime,true,sizeof(prime)); for(int p=2; p*p <= n; p++) { if(prime[p]== true) { for(int i=i*i; i<=n; i=i+p) pri...
ALGO
0.999505
4.846972
5a774293-4fbb-4652-9dff-397b2cc5785c
CaoNguyen-1883/Leetcode-solution
82. Remove Duplicates from Sorted List II.cpp
struct ListNode { int val; ListNode* next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode(int x, ListNode ext) : val(x), next(next) {} }; class Solution { public: ListNode* deleteDuplicates(ListNode* head) { if (!head || !head->next) return h...
ALGO
0.999947
5.880361
ae69f40e-d48c-4c17-9a76-c9814b75f876
karma-riuk/advent-of-code
2022/cpp/05/result.cpp
#include "answer.hpp" #include <iostream> int main(int argc, char *argv[]) { if (argc < 2) error("Please specify the input file as first argument."); #if !VERBOSE std::cout.setstate(std::ios_base::failbit); #endif Input input = get_input(argv[1]); std::string result = get_result(input); #if ...
TOOL
0.970416
5.771202
02a84aed-7078-479f-8118-6e7d06165681
ukohank517/coder_history
lc/monthly_challenge/feb/10_copy-list-with-random-pointer.cpp
#include <iostream> using namespace std; /* // Definition for a Node. */ class Node { public: int val; Node* next; Node* random; Node(int _val) { val = _val; next = NULL; random = NULL; } }; class Solution { public: Node* copyRandomList(Node* head) { Node* ans ...
ALGO
0.99115
5.066648
360b8cf0-e559-49d4-b8d2-a3c4ae299711
bionicotaku/ECE-551D-assignment
083_expr1/expr.cpp
#include "expr.hpp" #include <ctype.h> #include <stdio.h> #include <string.h> #include <cstdlib> #include <iostream> Expression * parse(const char ** strp); void skipSpace(const char ** strp) { while (isspace(**strp)) { *strp = *strp + 1; } } Expression * makeExpr(char op, Expression * lhs, Expression * rhs...
ALGO
0.983972
4.7507
87612065-fefa-40d4-8e40-9400b3dd2002
ngctnnnn/evo_optim_cpp
include/boost/libs/geometry/doc/src/examples/algorithms/num_segments.cpp
// Boost.Geometry (aka GGL, Generic Geometry Library) // QuickBook Example // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle //[num_segments //` Get the number of segments in a geometry #include <iostream> #include <boost/geometry.hpp> #include <boost/geometry/geometries/point_xy.hpp> int m...
ALGO
0.994604
6.788631
d04a81e3-0c85-497e-ba72-e1ac19002ddc
adarsh-fr/Dice-Roller-app
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
9ed9cb78-447e-40cb-aa41-c5fedeb4be98
zephyr-fun/LeetCodeSolution
string/2185_Counting_Words_With_a_Given_Prefix.cpp
// 2023.01.08 class Solution { public: int prefixCount(vector<string>& words, string pref) { int res = 0; int n = pref.size(); for(auto& word : words) { int i = 0; int j = 0; int m = word.size(); bool flag = true; while(i < m && j <...
ALGO
0.999948
6.034182
9627ab63-44c3-48d5-9855-374d13ce48e6
hieupham1103/TINHOC
SCHOOL/LOP10/BackTracking/BAI49QL.cpp
#include <iostream> using namespace std; string s, a; int count[26]; void backTracking(int d) { if (d == (int) a.size()) { cout << s << "\n"; } else { for (int i = 0; i < 26; i++){ if (count[i]) { s += char(i + 'A'); count[i]--; backTracking(d + 1); count[i]++; s.erase(s.size() - 1, 1)...
ALGO
0.99979
4.201276
6296b39b-d4bd-4df4-aaf3-fcccaaecea62
algorithm-hell/problems
week06/92341_wonseok.cpp
#include <string> #include <vector> #include <map> #include <iostream> using namespace std; vector<string> split(string s, string delim) { vector<string> result; int pos = 0; string token; while (pos = s.find(delim), pos != string::npos ) { string token = s.substr(0, pos); result....
ALGO
0.998221
5.777295
fcd34424-ebe7-4909-aea6-7366952ed0ac
SufianTonmoy/C-plus-plus-programming
STL/pair/pait_01.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 int main() { pair<int,int>p1,p2; p1={3,5}; p2={3,4}; //prothome first value compare kore pore second value compare kore if(p1<p2) { cout<<"YES\n"; } else if(p1>p2) { cout<<"NO\n"; } else cout<<"equal\n"; pair<int,in...
ALGO
0.999832
3.617343
c65504f9-391c-4504-8e08-85656051a68f
raincross7/code-similarity
codes/train_code/problem093/problem093_264.cpp
#include <bits/stdc++.h> using namespace std; /////////////////////////////////////////// const long long int INF = 1LL<<60; const long long int Mod = 1000000007; using ll = long long int; using ci = const int; using vi = vector<int>; using Vi = vector<long long int>; using P = pair<int, int>; using PLL = pair<ll, ll...
ALGO
0.999358
4.450503
e8371103-7ed5-4070-9d77-cc357e57011c
AnkitaPorel/DSAPS_Assignment2
2024201043_A2_Q1a.cpp
#include <iostream> #include <vector> using namespace std; long long primes[]={9973,20011,20021,40039,40063,80111,80141,160253,160309}; long long smallerPrime(long long x) { long long y=9973; for(int i=8;i>=0;i--) { if(primes[i]<x) return primes[i]; } return y; } long long ne...
ALGO
0.999353
3.919956
6802b768-9912-42f3-96b6-b73fbcd12009
upesacm/21DaysOfCode-2024
DSA/Arshdeep-Kaur/Day18_Question2.cpp
#include <iostream> #include <string> using namespace std; struct Node { char data; Node* left; Node* right; }; Node* getNode(char data) { Node* newNode = new Node(); newNode->data = data; newNode->left = newNode->right = nullptr; return newNode; } string decode(Node* root, string binaryS...
ALGO
0.99997
6.596392
2494d7ff-de6a-4a41-839d-910b13aec3c5
anwar-arif/acm-code
lightoj/1315 - Game of Hyper Knights.cpp
#include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <sstream> #include <iomanip> #include <string> #include <vector> #include <deque> #include <list> #include <set> #include <map> #include <bitset> #include <stack> #include <queue> #...
ALGO
0.999895
4.141381
c258e609-ad96-45c3-919b-2271cc7ffb84
gexiannan2/testwebsocket
include/boost_1_85_0/libs/graph/test/cuthill_mckee_ordering.cpp
#include <boost/config.hpp> #include <vector> #include <iostream> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/cuthill_mckee_ordering.hpp> #include <boost/graph/properties.hpp> #include <boost/graph/bandwidth.hpp> /* Sample Output original bandwidth: 8 Reverse Cuthill-McKee ordering starting a...
ALGO
0.999986
5.760896
fe8f15e7-91ca-46db-89a0-5c8ab8292adb
nitish7134/Algorithmic-Toolbox
AlgorithmsOnGraphs/Week2/strongly_connected.cpp
#include <algorithm> #include <iostream> #include <vector> #include <stack> using namespace std; using std::pair; using std::vector; vector<vector<int>> reverseEdges(vector<vector<int>> &adj) { vector<vector<int>> rAdj(adj.size(), vector<int>()); for (int i = 0; i < adj.size(); i++) { // Recur for all the ver...
ALGO
0.999843
5.573874
a7141dbf-c403-4479-9b37-3ea5080a331c
HPAC/lammps-tersoff-vector
machines/lammps-10Mar16/src/USER-MISC/fix_ti_rs.cpp
/* ------------------------------------------------------------------------- Contributing authors: Rodrigo Freitas (Unicamp/Brazil) - <EMAIL> Maurice de Koning (Unicamp/Brazil) - <EMAIL> ------------------------------------------------------------------------- */ #include <stdlib.h> #in...
ALGO
0.948549
6.281491
d0629f65-1335-4142-bbfd-3063d8d70d3c
s-spillias/EMs-with-LLMs
POPULATIONS/POPULATION_0014/INDIVIDUAL_T26VBJ1G/model.cpp
#include <TMB.hpp> // TMB library for statistical modeling template<class Type> Type objective_function<Type>::operator() () { // Data: Time and observations (using _dat suffix as in the provided data file) DATA_VECTOR(time); // Time (Year) DATA_VECTOR(cots_dat); // Observed COTS abundance ...
ALGO
0.998951
7.154359
f4e7f97f-b988-4455-b27f-ab6b5cbcf816
ishassan/ProblemSolving
TopCoder/Div 2/364-1000 PowerPlants.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
ALGO
0.999859
5.275298
8e331f29-2d37-4e7e-a051-8f716aa839ad
ahmedibrahim404/CompetitiveProgramming
Codeforces/776D/main.cpp
#include<bits/stdc++.h> using namespace std; /** 1 & 2 1 ^ 2 **/ const int N = 200000 + 3; vector<vector<int>> adj; #define Var(x) ((x)<<1) #define Not(x) ((x)^1) int tim=0, n; int vis[N], stk[N], stkSz, compId[N], ncp,lw[N],dfsTime[N], curTime; void addEdge(int a, int b){ adj[a].push_back(b); } void ...
ALGO
0.999974
4.118763
ad768cd8-5d8c-4ac5-b200-7ad3c3748532
acidentally/cplusplus
CodeForces Problems/Contest 1984 (Div 2)/C.cpp
/* Good luck for those who are trying your best May the most glorious victory come File name: C.cpp Code by : acident / lckintrovert Created since : 09/06/2024 ~~ 22:58:45 Literally the worst cp-er ever */ #include <bits/stdc++.h> using namespace std; #define int long long #define uint ...
ALGO
0.999832
5.354646
64a0b9a3-0e59-4af2-8d8b-68f9428b5e27
oleschl/PPR-Sparsifier
src/exact_ppr-sparsifier/PPR_Matrix_Inv/PPR_Matrix_Inv.cpp
#include <vector> #include <armadillo> #include "exact_ppr_sparsifier/PPR_Matrix_Inv.h" #include "utility/pagerank.h" namespace PPR_Matrix_Inv { DiGraph constructPPRSparsifier(const GEdge& G, const std::vector<int>& K, double alpha) { int k = K.size(); // transform input graph to directed graph an...
ALGO
0.998817
5.201475
4687a418-b351-41f6-8167-d4cefcecd20a
The1one1/code
B_Array_Decrements.cpp
#include<bits/stdc++.h> using namespace std; #define int long long signed main() { int t; cin >> t; while(t--) { int n; cin >> n; vector<int> a(n), b(n); int cnt = 0; for(int i = 0; i < n; i++) cin >> a[i]; for(int i = 0; i < n; i++) { cin >> b[i]; ...
ALGO
0.999639
3.314671
ee8a67ab-c4af-4df1-acc6-e53e31f51405
inniyah/dsp-lessons
example00/example00.cpp
/* * This is a very simple example of a signal generator, in this case a pulse * generator. The main application consists in a non-stop loop that gets a value * from the generator, prints it on the screen, and waits for a bit until getting\ * a new value. */ #include <cstdint> #include <cstdlib> #include <cstdio>...
TOOL
0.981809
6.190237
9255a09f-0dcc-4aab-bda3-0e4a2af56c28
face4/AOJ
Volume10/1035.cpp
#include<iostream> using namespace std; int main(){ int w, q; while(cin >> w >> q, w+q){ int a[w]; for(int i = 0; i < w; i++) a[i] = -1; while(q-- > 0){ char op; int x, y; cin >> op; if(op == 's'){ cin >> x >> y; ...
ALGO
0.999151
3.288274
daef1aaa-817c-4c90-8424-953aba2f0ebd
cnclabs/ICE
ICE/vvNet.cpp
#include "vvNet.h" double random_gen(const int & min, const int & max) { static random_device rd; static thread_local mt19937* generator = new mt19937( rd() ); uniform_real_distribution<double> distribution(min, max); return distribution(*generator); } bool isDirectory(const char *path) { struct ...
ALGO
0.988798
4.136596
af3567da-7896-4690-9b53-d3d1b939ec01
VenkataAnilKumar/LeetCode
C++/unique-number-of-occurrences.cpp
// Time: O(n) // Space: O(n) class Solution { public: bool uniqueOccurrences(vector<int>& arr) { unordered_map<int, int> count; for (const auto& a : arr) { ++count[a]; } unordered_set<int> lookup; for (const auto& [k, v] : count) { if (lookup.count(v...
ALGO
0.999862
6.457808
74bdb7e3-50ee-4bf7-be8f-9df164a90b46
HYOUNJUNROH/Brachytherapy_qa_1_1_0
Brachytherapy_qa/opencv/sources/modules/ml/src/knearest.cpp
#include "precomp.hpp" #include "kdtree.hpp" /****************************************************************************************\ * K-Nearest Neighbors Classifier * \****************************************************************************************/ ...
ALGO
0.998661
6.805709
adfa0b97-2962-4740-82aa-da802e6df8e8
henriqueramosqs/CSES
Dynamic Programming/RemovingDigits.cpp
#include <bits/stdc++.h> using namespace std; #define sws ios_base::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL); #define mp make_pair #define pb push_back #define rep(i, a, b) for (int i = a; i < b; i++) #define dbg(msg,x) cout<<msg<<" "<<x<<endl; #define output(x) for(auto c:x){cout<<c<<" ";}cout<<" "; #define...
ALGO
0.999859
3.967625
0269767f-159a-49fe-953d-f58bdc2fba59
Yukishow/UniversityWork
Year1/S2/week6/q1.cpp
// Overloading operators #include <bits/stdc++.h> using namespace std; class Coordinate { public: Coordinate() { x = 0; y = 0; } Coordinate(const Coordinate &obj) { x = obj.x; y = obj.y; } Coordinate(int _x, int _y) { setX(_x); setY(_y); ...
ALGO
0.977026
4.171834
92149a1c-7064-4035-a425-b89a2152d699
kkw-11/Problem_Solving
C++를 이용한 창의적 문제 해결/28. N!에서 0의 개수.cpp
////28. N!에서 0의 개수 //#include <stdio.h> //#include <stdlib.h> //int main() { // //freopen("input.txt", "rt", stdin); // int n, temp, cnt1 = 0, cnt2 = 0; // scanf("%d", &n); // // //2부터 n까지 소수들로 계속 나누어 보기 // for (int i = 2; i <= n; ++i) { // temp = i; // //i가 증가할때마다 나누는 값 2로 초기화해서 다시 나누기 // //2로 계속 나누어 지지 않을 때 // in...
ALGO
0.999976
4.242292
69f75df5-ae1a-48d8-a552-f1f06e437405
Cyb3rGhoul/LeetCode
0260-single-number-iii/0260-single-number-iii.cpp
class Solution { public: vector<int> singleNumber(vector<int>& nums) { int n = nums.size(); vector<int> result(2); int index = 0; for (int i = 0; i < n; ++i) { bool found = false; for (int j = 0; j < n; ++j) { if (i != j && nums[i] == nums[j])...
ALGO
0.999983
5.699151
ad1dbbd5-da88-4f8e-87f6-eaad23814719
jha-prachi/dsa
lecture3/half_diamond.cpp
#include <iostream> using namespace std; void half(int rows){ int nst =1; int nsp = rows-1; for(int r =1;r<=rows;r++){ for(int csp = 1;csp<=nsp;csp++ ){ cout<<" "; } for(int cst =1;cst<=nst;cst++){ cout<<"*"; } nst+=2; nsp--; ...
ALGO
0.999955
4.283703
6fab724e-fc39-4fb4-9034-b538b43ab027
khushvind/Competitive-Programming
codeforces/1878/E.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define FOR(a,b) for(long long i = a; i < b; i++) int mod = 1e9 + 7; int inf = 1e9 + 10; int solve(){ int n; cin >> n; vector<int> a(n); for (int i=0; i<n; i++){ cin >> a[i]; }; vector<vector<int>> pref(n+1,vector<int> (3...
ALGO
0.999695
4.382213
b38d2b9b-15c6-428d-a80b-392499fbfe0c
Daard/CarND-P10-MPC-Project
src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Eigen::MatrixXf m(2,2); m << 1, 2, 3, 4; //get location of maximum MatrixXf::Index maxRow, maxCol; float max = m.maxCoeff(&maxRow, &maxCol); //get location of minimum MatrixXf::Index minRow, m...
ALGO
0.999322
4.010038
ada4daea-4f5f-491c-8af6-3167b3091b3e
2023-anik/My_Code_Archive
AtCoder Contests/Beginner 393/B_A_B_C.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; #define endl '\n' void solve(){ string s; cin>>s; int cnt=0; for(int i=0; i<s.length(); i++){ if(s[i]=='A'){ for(int j=i+1; j<s.length(); j++){ if(s[j]=='B'){ if(s[(2*j)-i]=='C') ...
ALGO
0.999415
3.891776
5542aac9-4d5f-4355-8f2f-a50fce3dbf6f
rpl-cmu/incopt
gtsam/gtsam/3rdparty/Eigen/doc/examples/TutorialInplaceLU.cpp
#include <iostream> struct init { init() { std::cout << "[" << "init" << "]" << std::endl; } }; init init_obj; // [init] #include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { MatrixXd A(2,2); A << 2, -1, 1, 3; cout << "Here is the input matrix A before decompositi...
ALGO
0.999783
3.804785
ab3ff8a7-3081-46d5-94c1-648ad64bda08
DenisDesimon/LeetCode
152_Max_Product_Subarray.cpp
//#152 Maximum Product Subarray - https://leetcode.com/problems/maximum-product-subarray/ #include <iostream> #include <vector> #include <algorithm> #include <cassert> using namespace std; class Solution { public: int maxProduct(vector<int>& nums) { int best = nums[0], max_product = 1, min_product = 1; ...
ALGO
0.999944
6.043319
ef506376-68b7-42de-bbec-06d06097047b
backengineering/llvm-msvc
llvm/tools/llvm-rc/ResourceScriptCppFilter.cpp
#include "ResourceScriptCppFilter.h" #include "llvm/ADT/StringExtras.h" #include <vector> using namespace llvm; namespace { class Filter { public: explicit Filter(StringRef Input) : Data(Input), DataLength(Input.size()) {} std::string run(); private: // Parse the line, returning whether the line should be i...
TOOL
0.91902
6.887808
e3510068-777d-4678-9785-2efbc8813bdf
Harsh-bharwani/Codeforces
slidingWindow.cpp
#include <bits/stdc++.h> using namespace std; long long maximumSubarraySum(vector<int>& nums, int k) { if (nums.size() < k) return 0; // Edge case: if the array size is smaller than k long long sum = 0; long long maxSum = 0; // Calculate the sum of the first subarray of size k for (int i ...
ALGO
0.999928
6.196996
f3f93550-ac97-4a86-b3ab-fb66b7efdfe5
iamishansharma/Placement-Preparation
DSA/GeeksForGeeks/DSA-Self-Paced/Arrays/Rotate Array.cpp
// { Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends int gcd(int a, int b) { if (b == 0) return a; else return gcd(b, a % b); } void rotateArr(int arr[], int d, int n) { d = d % n; int g_c_d = gcd(d, n); for (int i = 0; i < ...
ALGO
0.999945
5.924698
8efafb81-6c40-47af-aa8b-cf09e1824758
wide777/AtCoder
ABC/ABC204/C.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define REP(i, n) for(int i = 0; i < (int)(n); i++) vector<vector<int> > G; bool seen[2000]; void dfs(int v) { if(seen[v]) return; seen[v] = true; for(auto vv : G[v]) dfs(vv); } int main() { ll N, M; cin >> N >> M; G.resize(N...
ALGO
0.99977
4.283042
051726e1-32a2-415f-a6d3-85b9915c3921
Investigating-Eigen-s-FFT-Module/eigen-gitlab
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.992684
4.868302
c542a6f4-921b-451e-9fbc-95783e0d2558
ishandutta2007/codeforces
rns_cus/normal/1063/A.cpp
#include <bits/stdc++.h> using namespace std; #define N 100100 char s[N]; int main() { int n; scanf("%d %s", &n, s); sort(s, s + n); printf("%s\n", s); return 0; }
ALGO
0.999757
3.964986
043304b8-9a73-4678-8311-8533e6d90519
KyungHoon0126/Algorithm
Study/정렬/InsertionSort.cpp
#include <stdio.h> // InsertionSort( ) : ȿ ˰, ڸ ġ ϴ , ʿҶ ġ ٲ۴. int main(void) { int i, j, temp; int array[10] = { 1, 10, 5, 8, 7, 6, 4, 3, 2, 9 }; for (i = 0; i < 9; i++) { j = i; while (array[j] > array[j + 1]) { temp = array[j]; array[j] = array[j + 1]; array[j + 1] = temp; j--; } } for ...
ALGO
0.999965
3.755605
56bcf00a-ed5b-4588-aeda-e5491b3393d4
harungunaydin/Competitive-Programming-Solutions
Codejam/(+)Alien_Language.cpp
#include <iostream> #include <fstream> #include <cstdio> #include <cstring> #define FOR(i,a,b) for(i=a; i<=b; i++) #define FOR2(i,n) FOR(i,0,n-1) #define TFOR(i,a,b) for(i=a; i>=b; i--) #define MAXN 50005 using namespace std; ifstream in("a.in"); ofstream out("a.out"); string S[MAXN]; int D,L,N; int A[20][300]; void ha...
ALGO
0.999592
3.478282
e1e298da-6ed7-48b6-865a-66793880f58a
satyamrs00/lld
contact-management/Trie.cpp
#include "bits/stdc++.h" #include "TrieNode.cpp" using namespace std; class Trie{ private: AbstractTrieNode *_root; public: Trie(){} set<int> search(string query){} void insert(Contact *contact){} void erase(Contact *contact){} }; class AlphabetTrie:Trie { private: AlphabetTrieNode *_root; ...
ALGO
0.999023
4.726568
02a2bd2f-2d91-429a-a83f-b7bc602ffe11
TudorArnautu/ase_stuff
ConsoleApplication8/ConsoleApplication8/cifrale de pe pozitiile impare.cpp
#include <stdio.h> int get_result(int); int get_pow(int, int); int build_number(int, int); int get_digits(int); int main() { int nr, result; printf("nr= "); scanf("%d", &nr); result = get_result(nr); printf("\nRezultatul e %d\n", result); return 0; } int get_result(int nr) { int c, i = 0, result = 0; /* ...
ALGO
0.999859
4.331648
379ced4c-d295-4122-a078-390df9678ad4
ishandutta2007/codeforces
se1ka2/normal/1430/C.cpp
#include <algorithm> #include <iostream> using namespace std; typedef long long ll; int main() { int t; cin >> t; while(t--){ int n; cin >> n; cout << 2 << endl; cout << n - 1 << " " << n << endl; for(int i = n - 2; i >= 1; i--){ cout << i << " " << i + 2...
ALGO
0.99974
3.845142
dccb7ee2-27ab-4090-91e3-9c7620ed1422
rrafaelramos/ProgramacaoEstruturada
Exercicios/quest4.cpp
#include <stdio.h> #include <conio.h> int main(){ int num, aux=0; printf("Digite o numero:"); scanf(" %d",&num); for (int i=1; i<num; i++){ if(num%i==0){ aux += i; } } if(aux == num) printf("O número %d é um num. perfeito",num); else printf("O número %d não é um num. perfeito",num); return 0; ...
ALGO
0.998688
3.234101
fa95ae13-ff80-461a-931f-b7198eeb2023
hh-wu/getdp
src/kernel/Gauss_Pyramid.cpp
#include "Gauss_Pyramid.h" #include "Message.h" /* Gauss integration over a pyramid */ void Gauss_Pyramid(int Nbr_Points, int Num, double *u, double *v, double *w, double *wght) { switch(Nbr_Points) { case 8: *u = upyr8[Num]; *v = vpyr8[Num]; *w = wpyr8[Num]; *wght = ppyr8[Num];...
ALGO
0.99507
5.003163
44819b70-3f7b-43b5-8669-ac122556906c
arijit-s/CarND-Unscented-Kalman-Filter-Project
src/tools.cpp
#include <iostream> #include "tools.h" using Eigen::VectorXd; using Eigen::MatrixXd; using std::vector; Tools::Tools() {} Tools::~Tools() {} VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations, const vector<VectorXd> &ground_truth) { /** TODO: * Calculate the RMSE...
ALGO
0.986872
6.262182