uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
176710ec-17c4-4dcf-a8d0-4a6165fb1b0f | DuongHaoNika/CPP__CODEPTIT | CPP0310 - TỔNG LỚN NHẤT VÀ NHỎ NHẤT.cpp | #include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz size()
#define ll long long
#define FOR(i, a, b) for(int i = a; i <= b; ++i)
#define FORD(i, a, b) for(int i = a; i >= b; --i)
#define F(i, a, b) for(int i = a; i < b; ++i)
#define FD(i... | ALGO | 0.999615 | 4.872154 |
07c7031c-6261-4b20-95b4-d61b3b77d2cf | petrfrantal/BlackHoleVIS | BlackHoleVIS/VisMath.cpp | #include "VisMath.h"
void VisMath::interpolateVectors(float * first, float * second, float * result, float parameter) {
for (int i = 0; i < 3; i++) {
result[i] = (1 - parameter) * first[i] + parameter * second[i];
}
}
float VisMath::computeHorizontalAngle(glm::vec3 v) {
if (v.x == 0.0f && v.z == 0.0f) {
return... | ALGO | 0.996777 | 6.133008 |
cae901c3-cef0-4b0c-8b87-43d229a9a82b | BenjaminGROISNE/BotMaker | src/sysCommands.cpp | #include "sysCommands.h"
std::string moveAndExecute(const std::string& folder, const std::string args)
{
std::string command = "cd " + folder +" && "+ args;
return receivePipe(command);
}
void moveAndStartProgram(const std::string& programFolder, const std::string& exeName, const std::string args)
{
std::s... | TOOL | 0.943916 | 3.014057 |
6251e6c8-5873-42c5-879a-59866b750607 | Traeyee/leetcode | cpp/P494.cpp | /**
* @author <EMAIL>
* @time 2021-11-02 20:12
* @brief
*/
#include <algorithm>
#include <climits>
#include <iostream>
#include <queue>
#include <random>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
... | ALGO | 0.99991 | 5.172675 |
6eb9f643-63e3-4ff7-8b53-d7440f02b0b1 | RMGDFT/rmgdft | NEGF/Common/H01_to_HCL.cpp | #include "negf_prototypes.h"
/************************** SVN Revision Information **************************
** $Id:
******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include <assert.h>
#include "main.h"
#include "init_var.h"... | ALGO | 0.998007 | 3.616172 |
967a193d-96fa-439a-b758-24960a597f45 | khushal-bhamre/DSA-CPP | Recursion/factorial.cpp | #include<iostream>
using namespace std;
int fac(int n)
{
if(n<=0)
return 1;
else
return n*fac(n-1);
}
int Ifac(int n)
{
int i,factorial=1;
for(i=1;i<=n;i++)
factorial=factorial*i;
return factorial;
}
int main()
{
int factorial=Ifac(5);
cout<<factorial;
return 0;... | ALGO | 0.999965 | 4.683876 |
b77577d9-91b0-4677-9fcc-0006ce17fa21 | iamrudhresh/GeeksforGeeks | Medium/Smith Number/smith-number.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int smithNum(int n) {
// code here
if(n==1)
return 0;
int m =n;
int sum1=0;
int sum2=0;
int i=2;
while(i<=n/2)
{
... | ALGO | 0.999723 | 6.523416 |
dcc3d7bf-715a-4e8a-8119-8ada70356118 | kmjp/procon | csacademy/021-040/029/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.999923 | 4.343919 |
11539e09-b214-4b09-b36a-fcccb1e8b487 | Ankit087-acer/Ankit1139DSOOPS | week_2/day_1/ques_3_printthenumber.cpp | #include <iostream>
using namespace std;
int main(){
int arr[5]={1,2,3,4};
cout<<arr[2]<<endl;
return 0;
} | TOOL | 0.86119 | 3.100635 |
33325629-e94e-4551-9b1d-d4eb5323cca9 | Prakashsaw/DSA_Problem_GFG_and_Leetcode | DSA_Problem_On_Leetcode/Linked_List/Convert Sorted List to Binary Search Tree.cpp | /*
Q_Id:- 109.
Q_Name:- Convert Sorted List to Binary Search Tree.
Platform:- Leetcode
Difficulty:- Medium.
Q_Description:-
Given the head of a singly linked list where elements are sorted in ascending order, convert it to a
height-balanced
binary search tree.
Example 1:
Input: head = [-10,-3,0,5,9]
Outpu... | ALGO | 0.999999 | 6.508622 |
a9b99db5-eeea-4009-b008-74da751d4dc7 | KallumYooBee/cs105 | cs105/sumFunction2021/sumFunction2021.cpp | // sumFunction2021.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
void addingValues(float m, float n) { // temp values for whatever is going to be passed through here.
cout << "\nsum of the two given values is ";
cout << m + n... | TOOL | 0.930883 | 4.954883 |
169517ff-fc51-4cfd-81e7-65e04470a148 | Pradeep17Jadhav/450-DSA-Questions | 02_Find_maximum_and_minimum_in_array.cpp | //https://www.geeksforgeeks.org/maximum-and-minimum-in-an-array/
#include<iostream>
using namespace std;
int main()
{
int n;
int min, max;
cout << "Enter number of elements: ";
cin >> n;
int arr[n];
cout << "\nEnter elements: ";
for(int i = 0; i < n; i++)
{
cin >> arr[i];
}
... | ALGO | 0.99926 | 4.225232 |
596105d0-7993-48f4-aca6-79d53fed4e80 | ppkhang285/C-Codes | QGSS2/CHKSTR.cpp | #include <bits/stdc++.h>
#define task "CHKSTR"
#define REP(i,a,b) for(int i = a; i<=b; ++i)
using namespace std;
int solve( string s ){
int trai = 0;
int phai = 0;
for( auto chr:s){
if ( chr =='(' ) trai++;
else if (chr == ')' && trai>0) trai--;
}
for( int i = s.size()-1; i>=0;--i... | ALGO | 0.986247 | 4.313797 |
7753fa4e-d236-49a8-bf6d-0ed75ef2fc0b | exmex/HC | Client/Code_Core/cocos2dx/support/ccUTF8.cpp | #include "ccUTF8.h"
#include "platform/CCCommon.h"
NS_CC_BEGIN
int cc_wcslen(const unsigned short* str)
{
int i=0;
while(*str++) i++;
return i;
}
/* Code from GLIB gutf8.c starts here. */
#define UTF8_COMPUTE(Char, Mask, Len) \
if (Char < 128) \
{ \
Len = 1; ... | TOOL | 0.885415 | 6.140511 |
7b15668d-7a43-40d9-896a-cac1d338382f | fangyunh/CC-DRAM-Gem5 | gem5/src/systemc/tests/systemc/misc/v1.0/dash7/pulse.cpp | /*****************************************************************************
pulse.cpp -- Implementation of the pulse generator.
Original Author: Ali Dasdan, Synopsys, Inc.
*****************************************************************************/
/*****************************************************... | TOOL | 0.933773 | 6.291791 |
7651a49d-a4bf-4a4e-bdbf-ad2a396d5c7a | PIFClub/FlyMew_Ardupilot | libraries/AP_Math/quaternion.cpp | #pragma GCC optimize("O3")
#include "AP_Math.h"
// return the rotation matrix equivalent for this quaternion
void Quaternion::rotation_matrix(Matrix3f &m) const
{
float q3q3 = q3 * q3;
float q3q4 = q3 * q4;
float q2q2 = q2 * q2;
float q2q3 = q2 * q3;
float q2q4 = q2 * q4;
float q1q2 = q1 * q2;... | ALGO | 0.992494 | 6.19181 |
5d6e6497-59a3-474d-8279-28b57085652d | Jeongmin4869/Algorithm | 프로그래머스/Level.2/전력망을 둘로 나누기.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
/*
n : 송전탑의 개수
wires : 전선 정보
*/
int g[101][101] = {0}; // 그래프
vector<bool> visited; // 방문여부
int dfs(int index, int n){
if(visited[index]) // 방문했을 경우 count 세지 않는다
return 0;
visited[index] = true;
int c... | ALGO | 0.999783 | 4.989864 |
51d38f16-13c3-4dcc-abd3-eca962f6805e | IhorVodko/Hackerrank_solutions | Algorithms/beautifulBinaryString.cpp | // problem : https://www.hackerrank.com/challenges/beautiful-binary-string/problem?isFullScreen=true
#include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
/*
* Complete the 'beautifulBinaryString' function below.
*
* The function is expected to return an INTEGE... | ALGO | 0.999981 | 5.552219 |
9b7fe96b-5239-41dd-ad16-24f7ce42a926 | Saptadeep717/DSA | 5-longest-palindromic-substring/longest-palindromic-substring.cpp | class Solution {
public:
int dp[1001][1001];
int rec(int l, int r, string &s){
if(r-l+1 <=1) return 1;
if(dp[l][r] != -1) return dp[l][r];
int ans = (s[l]==s[r]) && rec(l+1, r-1,s);
return dp[l][r] = ans;
}
string longestPalindrome(string s) {
int n = s.size();
... | ALGO | 0.999992 | 6.266934 |
e2c7753d-3fe4-4cc4-b84b-f01b462da179 | JeongNahyeon/Practice2024 | 023_gugudan/023_gugudan.cpp | // 023_gugudan.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include <stdio.h>
int main()
{
for (int j = 1; j <= 9; j++) {
for (int i = 2; i <= 5; i++)
printf("%d x %d = %d\t", i, j, i * j);
printf("\n");
}
}
// 프로그램 실행: <Ctrl+F5> 또는 [디버그] > [디버깅하지 않고 시작] 메뉴
// 프로그램 ... | ALGO | 0.970586 | 3.815416 |
e7b10e6d-0cf9-4155-99e2-5f8843b3bfbe | Kiritouse/am-kernels | kernels/blockchain/src/Block.cpp | #include <klib.h>
#include <klib-macros.h>
#include "Block.h"
#include "sha256.h"
void Block::block_init(uint32_t nIndexIn, const char *sDataIn, const char *sPrevHashIn) {
_nIndex = nIndexIn;
_sData = sDataIn;
_sPrevHash = sPrevHashIn;
_nNonce = -1;//NounceΪ-1
_tTime = io_read(AM_TIMER_UPTIME).us / 1000000;//ʱ... | ALGO | 0.856502 | 4.087991 |
c07345d4-17b0-4fdc-a0d2-1b2317ae2605 | jaesoon-park/1file | jeasoon/Project1/소스12.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
/* Ʈ &,|,^ Ʈ ~ ϰ, ǥϿ ƮȮ*/
//ݺ̿
int bit;
int x = 0;
int y = 0;
do
{
printf(" [1] Ʈ AND(&) ");
printf(" [2] Ʈ OR(|) ");
printf(" [3] Ʈ XOR(^) ");
printf(" [4] Ʈ COMPLEMENT(~) ");
printf(" [0] (s... | ALGO | 0.984377 | 3.640753 |
d6973f21-53fc-4945-8e74-f4bb4024c013 | richarddmorey/BayesFactor | pkg/BayesFactor/src/dinvgamma.cpp | #include "bfcommon.h"
using namespace Rcpp;
// [[Rcpp::depends(Rcpp)]]
/*
* dinvgamma1_Rcpp: log density of the inverse gamma distribution
* dinvgamma1_logx_Rcpp: log density of the inverse gamma distribution, as a function of log(x)
* ddinvgamma1_Rcpp: first derivative of the log density of the inverse gamma ... | ALGO | 0.96015 | 5.948003 |
162dcc71-785c-4d6c-94ec-c29cb5718a92 | 23f2002007/leetcode | solution/0400-0499/0485.Max Consecutive Ones/Solution.cpp | class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int ans = 0, cnt = 0;
for (int x : nums) {
if (x) {
ans = max(ans, ++cnt);
} else {
cnt = 0;
}
}
return ans;
}
}; | ALGO | 0.999971 | 6.219433 |
eb6ad7ce-5446-4e3b-aea7-1a8e61dd7537 | yancouto/competitive-programming | ojs/trains/1469F.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
template<typename T> inline T abs(T t) { return t < 0?... | ALGO | 0.999718 | 3.701189 |
98f4c7ff-b583-43de-9a63-5e285ffeafc8 | Larahhh/Plano-de-Desenvolvimento-Individual-Peki-Code | Exemplo_Lista/exemplo/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.996884 | 6.76073 |
018f4ea0-b5b1-4ac8-bcee-2e088e9cca57 | RJD02/DSA-Practice | coding-ninjas/Graph/kruskals.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> parent, r;
vector<vector<int>> edgeList;
int n, e;
int find(int i) {
if (parent[i] == -1) return i;
return parent[i] = find(parent[i]);
}
void unite(int x, int y) {
int s1 = find(x);
int s2 = find(y);
if (s1 != s2) {
if (r[s1] < r[s2]) {
parent[s1] ... | ALGO | 0.999991 | 4.403062 |
ea18b495-c432-4d03-b5ee-97eb1457927a | jjkimCombustion/CEMA | src/thermophysicalModels/chemistryModel/eigen/doc/snippets/JacobiSVD_basic.cpp | MatrixXf m = MatrixXf::Random(3,2);
cout << "Here is the matrix m:" << endl << m << endl;
JacobiSVD<MatrixXf> svd(m, ComputeThinU | ComputeThinV);
cout << "Its singular values are:" << endl << svd.singularValues() << endl;
cout << "Its left singular vectors are the columns of the thin U matrix:" << endl << svd.matrixU(... | ALGO | 0.999743 | 3.463409 |
321f7e78-fd1c-465b-b016-8720f4dc3ae3 | kand1bober/Onegin | sources/MySort.cpp | #include "../headers/library.h"
#include "../headers/MySort.h"
#include "../headers/custom_strcmp.h"
#include "../headers/swap.h"
void MySort(void* ptr, size_t lines_amount, size_t el_size, int(*comparator)(void* a, void* b))
{
assert(ptr);
assert(isfinite(lines_amount));
assert(isfinite(el_size));
ass... | ALGO | 0.999793 | 3.934299 |
93aa56e3-8e79-47a6-8d35-4e4a4c9323e1 | coin-or/CppAD | example/general/mul_eq.cpp | /*
{xrst_begin mul_eq.cpp}
AD Compound Assignment Multiplication: Example and Test
#######################################################
{xrst_literal
// BEGIN C++
// END C++
}
{xrst_end mul_eq.cpp}
*/
// BEGIN C++
# include <cppad/cppad.hpp>
bool MulEq(void)
{ bool ok = true;
using CppAD::AD;
using ... | TEST | 0.988078 | 6.994092 |
30eb55e7-d864-4674-91ed-7e915a13c4f6 | Najma099/CompetitiveProgramming | DP/longestsub.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const long long MOD = 1000000007;
int n;
int arr[1001];
int dp[1001][1001];
int rec(int level,int ele) {
if(level == n) {
return 0;
}
if(dp[level][ele] != -1) {
... | ALGO | 0.999852 | 4.292032 |
cb7e1866-30a3-4118-8b8f-17f01988ac0f | yhwang-hub/dl_model_infer | utils/tracker/ByteTracker/byte_tracker.cpp | #include "byte_tracker.hpp"
#include <fstream>
namespace ai
{
namespace ByteTrack
{
BYTETracker::BYTETracker(int frame_rate, int track_buffer)
{
track_thresh = 0.5;
high_thresh = 0.6;
match_thresh = 0.8;
frame_id = 0;
max_time_lost = int(frame_rate / 30.0 * track_buffer);
}
BYTETracker::~BYTE... | ALGO | 0.982082 | 5.853124 |
4e56a3ac-97d9-45c1-b827-b1e7b71056d4 | whquddn55/Algorithm_BojSolves | 2000/2162.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename a, typename b>
ostream& operator<<(ostream& os, const pair<a, b>& pai) {
os << pai.first << ' ' << pai.second;
return os;
}
template<typename a, typename b>
istream& operator>>... | ALGO | 0.999829 | 4.828054 |
63402fea-ad4b-4891-b80a-9525c1d3bbbf | 15rsirvin/School-Assignments | CS315/program3/program.cpp | #include<iostream>
#include<vector>
using namespace std;
int main()
{
int num, roll;
int highest = 0;
vector<int> nums(6,0);
cin >> num;
vector<int> input(num,0);
for(int i =0; i < num; i++)
{
cin >> roll;
nums.at(roll -1) += 1;
input.at(i) = roll; ... | ALGO | 0.999985 | 4.917667 |
2afaa494-c448-4256-babb-959276ab3af4 | akiiishiii/oi_exercises | code/1057.cpp | // 1057.cpp
#include <iostream>
#include <cstring>
int main(int argc, char const *argv[]) {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, s, t;
int l[4] = {0}, c[4] = {0};
int f[101], d[101] = {0};
memset(f, 0x3f, sizeof f);
std::cin >> l[1] >> l[2] >> l[3]
... | ALGO | 0.999856 | 4.248356 |
84bc25a3-dc21-44b2-ae66-72d08a13f1dc | David-Mahoney/Unicycler_remove_overlaps | unicycler/src/miniasm/hit.cpp | #include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <assert.h>
#include <iostream>
#include <fstream>
#include <set>
#include <limits>
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wvla"
#pragma GCC diagnostic ignor... | DATA | 0.976394 | 4.962492 |
04386d19-0e7c-4864-9665-ac7bd2b96876 | ak2798094/KoksalAttila_CIS_7_43527 | Lab/Lab_Luhn_Algorithm_3/main.cpp | /*
* File: main.cpp
* Author: Attila Koksal
* Purpose: Lab Luhn Algorithm 3
*/
//System Libraries
#include <iostream> //I/O Library
#include <cstdlib> //Random Function Library
#include <iomanip>
#include <ctime> //Time Library
using namespace std;
//Global Constants
enum cardLst {AmEx, Visa, MstrCrd, ... | ALGO | 0.98103 | 4.843823 |
541f0527-4523-46e5-a77c-bf3af7af2b6a | JJWasyl/ASD-2017 | Divide et Imperia/leader.cpp | #include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <ctime>
using namespace std;
//Przywodca ciagu pewny (Moore's voting algorithm) O(n)
int certLeader(int tab[], int n){
int leader = tab[0];
int count = 1;
for(int j = 1; j < n; j++){
if(tab[j] == l... | ALGO | 0.999718 | 4.218917 |
f1f82454-ccb6-457a-a201-814a028744de | lovethiscode/boost | libs/compute/perf/perf_set_difference.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/set_difference.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}... | ALGO | 0.96499 | 5.842721 |
a6419a6d-2c31-488c-a08d-ebd68c437d4b | ramenhut/final-stage-path-tracer-2-0 | source/math/matrix3.cpp |
#include "matrix2.h"
#include "matrix3.h"
namespace base {
matrix3::matrix3() {
m[0] = m[3] = m[6] = 0;
m[1] = m[4] = m[7] = 0;
m[2] = m[5] = m[8] = 0;
}
matrix3::matrix3(const matrix2& rhs) {
clear();
m[0] = rhs[0];
m[1] = rhs[1];
m[3] = rhs[2];
m[4] = rhs[3];
}
matrix3::matrix3(const matrix3& rh... | ALGO | 0.985563 | 7.531354 |
464375cd-7ada-4112-b833-458cb37b9fa3 | a2bhijeet/DataStructures | Cpp_Training/Day3/lambdaUseCase.cpp | #include <iostream>
#include <list>
#include <algorithm>
using namespace std;
class CA
{
private:
int a, b;
public:
CA(int x = 0, int y = 0) : a(x), b(y) {}
void print() const { cout << a << " " << b << endl; }
int sum() { return a + b; }
};
int main()
{
list<CA> ls1;
for (int i = 0; i < ... | ALGO | 0.998927 | 4.047171 |
170b767a-53d2-4f4c-bea4-f031a03294dd | farhan1807ahmad/c-program | nestedif-else.cpp | // // Q4. Take 3 +ve integers input and print the greatest of them.
// #include<iostream>
// using namespace std;
// int main(){
// int a,b,c;
// cout<<"enter a number a : ";
// cin>>a;
// cout<<"enter a number b : ";
// cin>>b;
// cout<<"enter a number c : ";
// cin>>c;
// if(a>b){ ... | ALGO | 0.987676 | 3.400948 |
444447c8-78c0-4982-833c-1ff9636d134e | raincross7/code-similarity | codes/train_code/problem333/problem333_120.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n, k, a[100000];
int main() {
while (1) {
scanf("%lld%lld", &n, &k);
if (n == 0) break;
for (ll i = 0; i < n; i++) scanf("%lld", &a[i]);
ll sum = 0;
for (ll i = 0; i < k; i++) sum += a[i];
ll ans = sum;
fo... | ALGO | 0.999926 | 3.532379 |
d9fd096b-4005-49b1-bad8-b61e4e292ab5 | dengziming/c-tour | leetcode/leetcode1249_remove_invalid_parentheses.cpp | //
// Created by 邓子明 on 1/27/22.
//
#include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string minRemoveToMakeValid(string s) {
int left = 0;
int right = count(begin(s), end(s), ')');
string ans;
for (auto& c : s) {
if (c == '(') {
... | ALGO | 0.998841 | 5.766531 |
fdeca470-b492-4869-80cb-a0b7f03e03f3 | i2p/i2p-browser | gfx/angle/checkout/src/compiler/translator/VariablePacker.cpp | #include <algorithm>
#include "angle_gl.h"
#include "common/utilities.h"
#include "compiler/translator/VariablePacker.h"
namespace sh
{
namespace
{
// Expand the variable so that struct variables are split into their individual fields.
// Will not set the mappedName or staticUse fields on the expanded variables.
v... | TOOL | 0.928888 | 7.79077 |
7ef9ee71-6a2d-48aa-adf3-d3a6f54fc6d6 | andyyang200/CP | Competitive Programming/Contests/USACO/Contests/2015 - 2016/US Open/Platinum/Bull in a China Shop/bcs.cpp | //Andrew Yang
#include <iostream>
#include <stdio.h>
#include <sstream>
#include <fstream>
#include <string>
#include <string.h>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <functional>... | ALGO | 0.999947 | 3.2505 |
f28e08d9-2c69-4c71-9f13-b689aeb48cb2 | averyevy/superave | src/cpp/2016 circular barn.cpp |
#include <bits/stdc++.h>
#include <utility>
#include <vector>
using namespace std;
#define forn(i, n) for (int i = 0; i < int(n); i++)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define u... | ALGO | 0.999882 | 3.516877 |
48d3c51b-b7e7-4b9d-aa59-82a73b6135a9 | Jain-Ayush-11/Competitive-Programming | Make_Multiple.cpp | /*******************
CodeForces:- Ayush_J
CodeChef:- stein_1103
********************/
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long int
int ... | ALGO | 0.999356 | 5.213774 |
f9d9ab63-d3f5-4594-b56b-b8c90ba14ac7 | sugapiko2/procon | atcoder/abc/abc188/d/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using vi = vector<int64_t>;
using vvi = vector<vi>;
using ll = int64_t;
using P = pair<ll,ll>;
ll INF = 1000000007;
// ll INF = 9223372036854775807;
// ll INF = 998244353;
int main() {
... | ALGO | 0.999915 | 3.96428 |
00b0130d-698d-4341-9bab-e8a40d96771e | divcs/I-am-neo | I_am_neo/Unit 5/My content/Lec 31/COD/Q4/sol.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int *numbers = new int[100];
int num;
int sum = 0;
double avg = 0.0;
int count = 0;
while (cin >> num && num >= 0)
{
numbers[count] = num;
sum += num;
count++;
}
if (count > 0)
{
avg = static_cast<double>(sum / count);
}
cout... | ALGO | 0.998918 | 7.32227 |
e658a9f5-cc0b-46a3-851d-90770be63404 | TeaqariaWTF/Qingyue | module/jni/libcxx/test/std/algorithms/alg.nonmodifying/alg.find.first.of/ranges.find_first_of.pass.cpp | // <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
// template<input_iterator I1, sentinel_for<I1> S1, forward_iterator I2, sentinel_for<I2> S2,
// class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
// requires indirectly_co... | TEST | 0.969751 | 7.341061 |
92e889dc-2b64-4f9e-a9ce-2404c75dd15c | ShreyashiBansal/LEETCODE-JUNE-2021 | Number of Subarrays with Bounded Maximum.cpp | class Solution {
public:
int numSubarrayBoundedMax(vector<int>& nums, int left, int right) {
int result=0, start=-1, end=-1;
for(int i=0;i<nums.size();i++){
if(nums[i]>right) start=i;
if(nums[i]>=left) end=i;
result +=end-start;
}
return r... | ALGO | 0.999978 | 5.993331 |
8a641e6a-08be-4955-97e4-e0349ef1136e | Exzorcist14/Yandex-Algorithm-Training | YandexAlgorithms#1.2/task3.cpp | #include <iostream>
#include <vector>
using namespace std;
void solveС() {
int n;
cin >> n;
vector<int> numbers(n);
for (int i = 0; i < n; i++) {
cin >> numbers[i];
}
int search;
cin >> search;
int currDiff;
int minDiff = abs(numbers[0] - search);
int ans = numbers[... | ALGO | 0.999861 | 4.028093 |
830ad361-982d-4689-809e-b0b48fb1be9b | rschurade/braingl | src/algos/marchingsquares.cpp | /*
* marchingsquares.cpp
*
* Created on: May 6, 2014
* Author: schurade
*/
#include "marchingsquares.h"
MarchingSquares::MarchingSquares( std::vector<float>* data, float isoValue, int nx, int ny, float dx, float dy, bool voxelize ) :
m_data( data ),
m_isoValue( isoValue ),
m_nx( nx ),
m_ny(... | ALGO | 0.997777 | 6.152693 |
6b4b120a-45c1-4dcd-a662-287d455c0a79 | kallaballa/Poppy | third/opencv_contrib-4.x/modules/mcc/src/graph_cluster.cpp | #include "precomp.hpp"
#include "graph_cluster.hpp"
namespace cv
{
namespace mcc
{
CB0cluster::CB0cluster()
{
}
CB0cluster::~CB0cluster()
{
}
void CB0cluster::
group()
{
size_t n = X.size();
G.clear();
G.resize(n);
for (int i = 0; i < (int)n - 1; i++)
{
std::vector<double> Y;
... | ALGO | 0.999486 | 5.627856 |
aaeea514-4da9-49e2-8ef5-0cd056792ff0 | NUS-LinS-Lab/Jade | dart/biomechanics/MarkerFitter.cpp | #include "dart/biomechanics/MarkerFitter.hpp"
#include <future>
#include <iostream>
#include <limits>
#include <memory>
#include <mutex>
#include <unordered_map>
#include <vector>
#include <coin/IpIpoptApplication.hpp>
#include <coin/IpSolveStatistics.hpp>
#include <coin/IpTNLP.hpp>
#include "dart/dynamics/BodyNode.... | ALGO | 0.993338 | 6.41769 |
ad5bccb6-d1af-4eb2-b464-2d60e5333a5e | dilshod-s/os-2023 | armen-mkrtchyan/05/myterm.cpp | #include <iostream>
#include <sstream>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>
int main(){
std::cout << "Please, type your command, my comrade \n";
std::string command;
while(true){
... | TOOL | 0.896881 | 3.076419 |
5b2c9d97-8516-4f0f-9164-31f292c9321e | kpdev/llvm-tnt | lib/CodeGen/MachineBranchProbabilityInfo.cpp | #include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
INITIALIZE_PASS_BEGIN(MachineBranchProbabilityInfo, "machine-branch-prob",
... | ALGO | 0.890664 | 7.847661 |
936d87f9-e986-43f1-9e9a-ff69167ad2b7 | BorisJancic/Algorithms-and-Data-Structures | ElectricalGridCost/main.cpp | #include <iostream>
#include "Graph.hpp"
#include "illegal_exception.hpp"
int main() {
std::string command = "";
Graph* G = new Graph;
while (command != "END") {
try {
std::cin >> command;
if (command == "LOAD") {
std::string filename;
st... | ALGO | 0.853435 | 4.50927 |
f7c6ab46-fda4-405a-ab84-754cd34c74b3 | ibab/lhcb-software | Stripping/Phys/DisplVertices/src/SelectVeloTracksNotFromPVS20p3.cpp | // Include files
#include <boost/foreach.hpp>
// from Gaudi
#include "GaudiKernel/AlgFactory.h"
// from LHCb
#include "Event/RecVertex.h"
#include "LoKi/TrackCuts.h"
#include "LoKi/Operators.h"
#include "KalmanFilter/FastVertex.h"
// boost
#include "boost/numeric/conversion/bounds.hpp"
#include "boost/limits.hpp"
... | TOOL | 0.885233 | 5.944716 |
83eaeaf2-1d77-48c9-bbef-8df6efa88a28 | hhandoo/learn_programming | problems/arrays/basics/1534_Count_Good_Triplets.cpp |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int countGoodTriplets(vector<int> &arr, int a, int b, int c)
{
int res = 0;
for (int i = 0; i < arr.size(); i++)
{
for (int j = i + 1; j < arr.size(); j++)
{
for (int k = j + 1; k < arr.size(); k... | ALGO | 0.999578 | 5.172208 |
9e7e5560-2ec1-452a-9b08-d947bdaca0aa | umair-666/DSA-everyday | DSA questions/POTD/Leetcode/12th_Jan - Determine if String Halves Are Alike.cpp | // 1704. Determine if String Halves Are Alike
// https://leetcode.com/problems/determine-if-string-halves-are-alike/description/?envType=daily-question&envId=2024-01-12
class Solution {
bool isVowel(char c){
return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'A' || c == 'E' || c == 'I'... | ALGO | 0.999406 | 6.581671 |
6a8098df-5c7b-4dec-affe-754a785ee340 | Phuong22122003/Data_Structures_And_Algorithms | De_quy/ThapHaNoi.cpp | #include<iostream>
using namespace std;
void chuyendia(int a,string c,string d){
cout<<"Chuyen dia thu "<<a<<" tu cot "<<c<<" sang cot "<<d<<endl;
};
void ThapHaNoi(int n,string A,string B,string C){
if(n==1)cout<<"Chuyen dia tu cot "<<A<<" sang cot "<<C<<endl;
else{
ThapHaNoi(n-1,A,C,B);
T... | ALGO | 0.999696 | 3.198106 |
603dc7c4-0dd5-4fb1-a9a5-d2c14a3c5351 | johnduffymsc/msc_phas0100assignment2 | Code/Lib/sfmForces.cpp | #include "sfmTypes.h"
#include "sfmForces.h"
#include "sfmPedestrian.h"
#include <cmath>
// Helbing and Molnar constants.
constexpr double V0 {2.1};
constexpr double SIGMA {0.3};
constexpr double U0 {10.0};
constexpr double R {0.2};
namespace sfm {
double B(Vec2d r, Vec2d e, double v, double dt) {
return 0.5 ... | ALGO | 0.999217 | 6.631869 |
1b395712-d73f-4371-a4c1-59d21f25fda2 | SJMA11723/Problem-solving | codeforces/Codeforces Round 797 (Div. 3)/A.cpp | /**
* Author: Jorge Raul Tzab Lopez
* Github: https://github.com/SJMA11723
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t; cin >> t;
while(t--){
int n; cin >> n;
if(n % 3 == 0) cout << n / 3 << ' ' << n / 3... | ALGO | 0.999646 | 3.916879 |
2f2f02ee-1227-4cd0-adeb-3158397bcbe8 | Joviisaus/Registration | eigen-3.4.0/bench/benchCholesky.cpp | // g++ -DNDEBUG -O3 -I.. benchCholesky.cpp -o benchCholesky && ./benchCholesky
// options:
// -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3
// -DEIGEN_DONT_VECTORIZE
// -msse2
// -DREPEAT=100
// -DTRIES=10
// -DSCALAR=double
#include <iostream>
#include <Eigen/Core>
#include <Eigen/Cholesky>
#include <bench/BenchUt... | TEST | 0.973331 | 5.992048 |
25c1cd68-82bd-44f7-8e39-2694b07fb62a | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_431_8.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename IntType>
void read(IntType& val) {
val = 0;
int c;
bool inv = false;
while (!isdigit(c = getchar()))
if (c == '-') inv = true;
do {
val = (val << 1) + (val << 3) + c - '0';
} while (isdigit(c = getchar()));
if (inv) val = -val;
}
tem... | ALGO | 0.999075 | 4.047025 |
8187f986-2780-4eff-9cfe-2890ed61dbf8 | Justpenz233/ConformableMechanism | Engine/ThirdParty/libigl/include/igl/is_edge_manifold.cpp | #include <algorithm>
#include <vector>
template <
typename DerivedF,
typename DerivedEMAP,
typename DerivedBF,
typename DerivedBE>
IGL_INLINE bool igl::is_edge_manifold(
const Eigen::MatrixBase<DerivedF>& F,
const typename DerivedF::Index ne,
const Eigen::MatrixBase<DerivedEMAP>& EMAP,
Eigen::PlainObje... | ALGO | 0.971847 | 7.076856 |
f7172f97-ee94-4526-801c-f912ddb58bf4 | vuonghung2308/CTDL | contest6/ex13.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t; cin >> t;
for(int i = 0; i < t; i++) {
int n, x; cin >> n >> x;
int a[n] = {};
for(int i = 0; i < n; i++)
cin >> a[i];
int count = upper_bound(a, a+n, x) - lower_bound(a, a+n, x);
count = (count > 0)?count:-1;
cout << count << endl;
}
... | ALGO | 0.999767 | 4.575183 |
3a00b48a-46b3-4861-a3dc-7996da7fa91d | sujal325/ARRAY_CPP | reverse_an_array.cpp | #include <iostream>
using namespace std;
void reverse_and_print_array(int arr[], int size)
{
int left = 0, right = size - 1;
while (left < right)
{
swap(arr[left], arr[right]);
++left;
--right;
}
for (int i = 0; i < size; i++)
{
cout << arr[i] << " ";
}
}
int... | ALGO | 0.999581 | 5.141697 |
a5f83e5d-03b0-4f2d-911b-e6e7b9c17038 | jstmee/Programming | Contests/Codeforces/Edu Codeforces 151 div2/a.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
bool f(int i,int n,int target,vector<int> &v,vector<int> ans,vector<int> &temp){
if(target<0){
return false;
}
if(target==0){
temp=ans;
return true;
}
if(target!=0 && i==n){
return false;
}
i... | ALGO | 0.999942 | 3.798755 |
6d39f3b6-1cd8-4d40-86b8-3401b53f3eea | Asmitagorti/Leet_code | 1448-maximum-69-number/1448-maximum-69-number.cpp | class Solution {
public:
int maximum69Number (int num) {
string s = to_string(num);
for(int i=0;i<s.size();++i){
if(s[i]=='6') {
s[i]='9';
break;
}
}
return stoi(s);
}
}; | ALGO | 0.997657 | 6.32393 |
9e4499a8-ef8f-47ca-b506-09e4eeea1564 | nhienhien/SPCT | lgedvoj/BFS/main.cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run a... | ALGO | 0.997022 | 3.580874 |
801951c2-223f-4218-b633-e4fe05d603ec | youjin-43/Baekjoon | 10001_15000/14501/14051.cpp | #include<iostream>
using namespace std;
int dp[16]={0,};
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
// freopen("input.txt","r",stdin);
int n; cin>>n;
int day, earnings;
for(int i=1;i<=n;i++){
cin>>day>>earnings;
dp[i+day-1]=max(dp[i+day-1],dp[i-1]+earnings);
... | ALGO | 0.999951 | 4.052517 |
87636e0f-f65c-48ec-be03-545c28994ca6 | COLA-Laboratory/ranknet | IEMO-LTR/code/src/algorithms/spea2/spea2.cpp | #include "algorithms/spea2/spea2.h"
#include <cmath>
#include <iostream>
#include <algorithm>
#include <vector>
#include "core/global.h"
#include "core/utility.h"
#include "core/tournament_selection.h"
#include "operator/sbx.h"
#include "operator/mutation.h"
#include "random/random.h"
namespace emoc {
SPEA2::SPEA2... | ALGO | 0.999992 | 5.212935 |
55dcf0ad-d109-4c9a-a19d-09de7c5769c9 | pranavjawale01/cp.exe | CodeForces/1155-A-Reverse a Substring/1155-A-Reverse a Substring.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned long long
#define vi vector<int>
#define vll vector<long long>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) x.begin(), x.end()
#define pb push_back
#define ff first
#define ... | ALGO | 0.999934 | 3.56704 |
bf6b5a87-b99e-4033-8ade-c2cb6063cabd | Anisha-singh2207/Leetcode-questions | 735. Asteroid Collision.cpp | class Solution {
public:
vector<int> asteroidCollision(vector<int>& asteroids) {
stack<int> st;
for (int num : asteroids) {
bool flag = false;
while (!st.empty() && num < 0 && st.top() > 0) {
if (abs(st.top()) < abs(num)) {
st... | ALGO | 0.999989 | 6.022239 |
88be26e2-e4c4-44b3-b841-8070eb5cf718 | ishandutta2007/codeforces | tourist/normal/367/E.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <set>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <memory.h>
#include <string>
#include <cstring>
#include <sstream>
#include <cstdlib>
#include <ctime>
#include <cassert>
using namespace std;
const long long md = 10... | ALGO | 0.999988 | 4.443263 |
930e584f-a1d3-426a-bc98-7bb36a0b1c69 | giabach1106/cp | 2021/sodoi.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
freopen("sodoi.inp","r",stdin);
freopen("sodoi.out","w",stdout);
int n,x=1;
cin >> n;
int a[10000001],b[10000001];
for(int i=0;i<n;i++)
cin >> a[i];
b[0] = a[0];
for(int i=1;i<n;i++){
int dem=0;
for(int j=0;j<x;j++){
if(a[i] +b[j]==0)
dem++;
... | ALGO | 0.999179 | 3.864056 |
53ff2c01-5cd1-483c-a937-0a5bf7cd44a9 | adilhamid/Practice-Leetcode | HouseRobberTree.cpp | class Solution {
public:
int rob(TreeNode* root)
{
auto ret = postOrder(root);
return max(ret.first, ret.second);
}
private:
pair<int, int> postOrder(TreeNode *node)
{
if (!node) return {0,0};
auto left = postOrder(node->left);
auto right = postOrder(node->ri... | ALGO | 0.999989 | 6.434929 |
9e04b57a-5d92-4b27-8c75-491487838b7e | ishandutta2007/codeforces | zscoder/normal/743/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair... | ALGO | 0.999094 | 3.560447 |
640a6747-2f9f-491b-a8f8-40b3bf5dda42 | karthikeya03/LEETCODE-dsa | 500-keyboard-row/keyboard-row.cpp | #include <vector>
#include <string>
#include <cctype> // For std::tolower
using namespace std;
// Function to convert a string to lowercase
string toLowerCase(const string& input) {
string result = input;
for (char& c : result) {
c = tolower(c); // Convert each character to lowercase
}
return ... | ALGO | 0.999582 | 6.756968 |
126d94c7-d95d-4baf-a9a3-7896d04cb3ac | DonPedro228/laboration_7.2 | laboration_7.2.cpp | #include <iostream>
#include <iomanip>
#include <time.h>
using namespace std;
void Create(int** a, const int rowCount, const int colCount, const int Low, const int High);
void Print(int** a, const int rowCount, const int colCount);
int Find_Largest_From_Min(int** a, const int rowCount, const int colCount);
int main(... | ALGO | 0.994752 | 3.481013 |
b24592fe-0c2f-45b7-b407-21078dd66bc2 | louisejanuel/project_imac_digger | src/ennemi/ennemis.cpp | #include "ennemis.hpp"
Ennemi::Ennemi(std::vector<Enemy> enemies)
: enemies(std::move(enemies))
{
tex = chargerTexture("assets/images/chat.png");
}
void Ennemi::update(float deltaTime, const FlowField &flow, const std::vector<std::vector<int>> &map, Player &player)
{
for (auto &enemy : enemies)
{
... | TOOL | 0.95526 | 4.330784 |
b109518e-6291-4216-b1a7-cd6687f67914 | orel1108/hackerrank | practice/algorithms/sorting/counting_sort_1/counting_sort_1.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int main()
{
map<int, int> counter;
for (int i = 0; i < 100; i++)
{
counter.insert(make_pair(i, 0));
}
int n, v;
cin >> n;
for (int i = 0; i < n; i... | ALGO | 0.999613 | 4.079456 |
2dc5c5f1-c524-47ee-b30d-072657bbc681 | KevinVanNieuwenhuizen/openanpr | shapes/circledetector.cpp | #include "circledetector.h"
/*!
* \brief constructor
*/
circleDetector::circleDetector()
{
maximum_possible_centre_separation = 20;
minimum_centre_response = 15;
dilation = 3;
}
/*!
* \brief destructor
*/
circleDetector::~circleDetector()
{
}
// ********** public methods **********
/*!
* \brief Sho... | ALGO | 0.971493 | 5.99521 |
e91b49fa-dfb7-4320-9296-1069efe99494 | StBiccy/GEC-Sem1 | Program12_Weather/Program12_Weather/Source.cpp | #include <iostream>
using namespace std;
int main()
{
int rian = 1;
int snow = 2;
int weather;
float temp;
cout << "Please tell me if it's raining with 1, or snowing with 2." << endl;
cin >> weather;
cout << "What temperature in Celsius" << endl;
cin >> temp;
if (weather == 1)
{
if(temp > 15)
{
... | TOOL | 0.936414 | 4.072782 |
016f510f-59c9-468c-8c1b-5cd32dd95b6b | PalladiumOS-Temp/platform_frameworks_av | media/libeffects/lvm/lib/Common/src/JoinTo2i_32x32.cpp | /**********************************************************************************
INCLUDE FILES
***********************************************************************************/
#include "VectorArithmetic.h"
/**********************************************************************************
FUNCTION JoinTo... | ALGO | 0.966101 | 4.802431 |
7fdc6c0a-38b9-4d8f-b8cb-b21a83b7065c | Archit669/competitive-programming | codechef/MP2T0302/1_coins_and_traingle.cpp | #include <iostream>
#include <math.h>
#define int long long
using namespace std;
signed main() {
int t;
cin >> t;
while (t--){
int n;
cin >> n;
cout << ((int)sqrt(1+8*n) - 1)/2 << endl;
}
}
| ALGO | 0.999755 | 4.438625 |
d7eca68a-4e85-4474-93aa-bf672b8fe829 | akherlan/ccc | cpp/09_flow_control_continue.cpp | // program ini mencetak angka mulai dari 1 sampai 10
// tetapi melewatkan 6 dan 9
#include <iostream>
using namespace std;
int main() {
for (int i = 1; i <= 10; ++i) {
if (i == 6 || i == 9 ) {
continue;
}
cout << i << "\t";
}
return 0;
}
| ALGO | 0.977078 | 3.55324 |
6fe33ada-09cf-4e48-89f0-0a856d444a74 | ng420/RocketClassifier | src/Bayes.cpp | #include "Bayes.h"
#include "Reader.h"
#define DEBUG if(1)
const std::string spam_path = "./train/spam/test";
const std::string ham_path = "./train/non_spam/test";
const std::string store_path = "./saved_file.txt";
Bayes::Bayes()
{
if(!readTrain()) {
train();
saveTrain();
}
}
void Bayes::train() {
DEBU... | DATA | 0.931491 | 5.586092 |
03d08567-8573-48c9-98d5-23a5a1801452 | tamim36/Problem-Solving | Vjudge Online Judge/one way road.cpp | #include <bits/stdc++.h>
#define inf 1000000009
#define ms(a,b) memset (a,b, sizeof a)
using namespace std;
typedef pair <int,int> pr;
bool visit[105];
int arr[105][105], sum;
vector <pr> vec[105];
void dfs(int node, int parent)
{
int sz = vec[node].size();
for (int k=0; k<sz; k++){
pr w = vec[node][... | ALGO | 0.999885 | 4.28601 |
f7fbe65f-5cde-447a-b6c2-86b6ecd244c7 | MohamedBouafif/Problem-Solving | CodeForces/B_Good_Arrays.cpp | #include<bits/stdc++.h>
using namespace std;
void solve()
{
int n;
cin>>n;
long long a[n];
int nb = 0;
for(int i = 0; i< n;i++) {cin>>a[i];if(a[i]==1)nb++;}
if(n==1){cout<<"NO\n";return;}
long long acc = 0;
for(int i = 0; i < n;i++)
{
acc+= a[i]-1;
}
if... | ALGO | 0.999496 | 4.067059 |
b8fabf52-46f5-45b9-9097-d2847add9d7b | DennohDev/Beginning_flutter | ch11_dismissible/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.999177 | 6.785645 |
943ea324-bb3f-47cb-b270-cf99abbc7eeb | karandeep-3154/Leetcode-Solved-Questions | 1765-merge-in-between-linked-lists/merge-in-between-linked-lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* mergeInBetw... | ALGO | 0.999986 | 4.776711 |
7467dc14-efaf-4bf5-ba9a-7e4cb3c65abe | Anand1997/semaphores_basics | main_reader_writer.cpp | #include "semaphor.h"
// reader writer
Semaphore MUTEX(1);
Semaphore writer_barrier(1);
int nReaderCnt = 0; // shared variable
void writer(){
while (true)
{
writer_barrier.wait();
// write
writer_barrier.signal();
}
}
void reader() {
while (true)
{
MUTEX.wait();
... | ALGO | 0.98427 | 4.81071 |
6f55c6f0-d560-479e-8fa6-bcec3a3ed882 | asav-abhish/ProblemSolving-DSA | Arrays-Is Second Array Mirror Inverse Of First Array.cpp | // https://hack.codingblocks.com/app/contests/4001/486/problem
#include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
int b[n];
int c[n];
int i;
for( i = 0 ; i <= n-1; i++){
cin >> a[i] ;
}
for( i = 0 ; i <= n-1; i++){
cin >> c[i] ;
}
for( i = 0; i <= n-1; i++){
int num = a[i... | ALGO | 0.999792 | 3.182137 |
3edd80c6-8d12-47a1-ba45-a832869fefb7 | pjh612/PS | 14505.cpp | #include <string>
#include <vector>
#include<iostream>
#include<memory.h>
#include<map>
#include<algorithm>
#include<queue>
#include<set>
using namespace std;
long long d[31][31];
int main()
{
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
string s;
cin >> s;
int len = s.size();
for (int i = 0; i < le... | ALGO | 0.999887 | 3.675323 |
972fb86d-fde7-4e89-9895-1470945becd9 | iamirzashowvik/codeforces | problem/546/A.cpp | #include <iostream>
using namespace std;
int main()
{
int k;
int w;
int n;
cin >> k >> n >> w;
int price = 0;
for (int i = 1; i <= w; i++)
{
price = price + k * i;
}
int lend = price - n;
if (lend < 0)
{
lend = 0;
}
cout << lend;
} | ALGO | 0.9999 | 3.448819 |
336f4c65-c9d5-4ff1-a6b3-445c91903ef9 | shivangdubey/HacktoberFest2020 | c++/WeightedJobScheduling.cpp | /* C++ implementation of the weighted job scheduling problem
using DP*/
#include <bits/stdc++.h>
using namespace std;
void JobScheduling(vector<tuple<int,int,int>> vti,int n)
{
int *arr=(int *)malloc(n*sizeof(int));
int *temp=(int *)malloc(n*sizeof(int));
for(int i=0;i<n;i++)
{
arr[i]=... | ALGO | 0.999968 | 4.439905 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.