uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
e6aba6d9-f5e0-453b-a53c-cce249503b72 | CherishOS/android_frameworks_av | media/module/codecs/amrnb/dec/src/post_pro.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include "post_pro.h"
#include "typedef.h"
#include "basic_op.h"
/*----------------------------------------------------------------------------
; MACR... | ALGO | 0.987683 | 5.760083 |
c21bfa8a-b72b-4745-9795-57093c669b27 | fayez-anwar/CB-ISA-DEC | Lec 42/stl1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool compar(int a, int b){
//if i want to sort in ascending order
//then smaller value should be first
if(a < b){
return true;
}
//else we need to swap them..
return false;
}
bool compar2(int a, int b){
//if i want to sort in des... | ALGO | 0.999709 | 5.075068 |
d85386af-13cb-4854-b140-2d11c15c81a7 | Zhaoyibinn/gsdf_mvs | gaussian_splatting/submodules/diff-gaussian-rasterization/third_party/glm/test/core/core_func_matrix.cpp | #include <glm/ext/matrix_relational.hpp>
#include <glm/ext/matrix_transform.hpp>
#include <glm/ext/scalar_constants.hpp>
#include <glm/mat2x2.hpp>
#include <glm/mat2x3.hpp>
#include <glm/mat2x4.hpp>
#include <glm/mat3x2.hpp>
#include <glm/mat3x3.hpp>
#include <glm/mat3x4.hpp>
#include <glm/mat4x2.hpp>
#include <glm/mat... | TEST | 0.891171 | 6.991364 |
690c4551-5c67-48e6-abba-76f17e685bf7 | raghavraj-27/dsa | 258-add-digits/258-add-digits.cpp | class Solution {
public:
int sumDigits(int num) {
int sum = 0;
while(num > 0) {
sum += num%10;
num = num / 10;
}
return sum;
}
int addDigits(int num) {
int ans = sumDigits(num);
num = ans;
while(num > 9) {
num = sumD... | ALGO | 0.999939 | 6.564201 |
132ee657-bcbe-43c0-9754-a2484eb5f9de | jcmana/playground | cpp/cpp_exploration/constexpr/main.cpp | #include <iostream>
constexpr long int fib(int n)
{
return (n <= 1) ? n : fib(n - 1) + fib(n - 2);
}
struct constant;
struct constant
{
constexpr constant(int v) :
value(v)
{
}
int value;
};
static constexpr constant c = 6;
int main()
{
// value of res is computed at compile time
const long int res = fi... | ALGO | 0.998536 | 5.188731 |
1c18ab3f-b6a6-4319-b25b-a8813c546c20 | vancegroup-mirrors/bullet-physics | Extras/CDTestFramework/Opcode/Ice/IceRay.cpp | /*
* ICE / OPCODE - Optimized Collision Detection
* http://www.codercorner.com/Opcode.htm
*
* Copyright (c) 2001-2008 Pierre Terdiman, <EMAIL>
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this softw... | ALGO | 0.992346 | 5.637309 |
dcc51d0a-e3be-4b67-b20e-c4031689d5a8 | timflutre/quantgen | myprogram.cpp | #include <cmath>
#include <ctime>
#include <cstring>
#include <getopt.h>
#include <libgen.h>
#include <iostream>
#include <string>
using namespace std;
#include "utils_io.hpp"
using namespace utils;
#ifndef VERSION
#define VERSION "1.0.0" // http://semver.org/
#endif
/** \brief Display the help on stdout.
* \note... | TOOL | 0.926311 | 5.149372 |
71a58d21-9e6b-4721-9a22-b509bd11c937 | ivanlamega/dragon-ball-online-tw-server | Libraries/NtlLib/Shared/PathEngine-5.07/code/libs/PathEngine_Core/CombineCircuits.cpp | #include "platform_common/Header.h"
#include "CombineCircuits.h"
#include "ElementInFaceLookup.h"
#include "ConnectNewCuts.h"
#include "interface/ObstacleInfo.h"
#include "interface/LocalisedConvexShape.h"
#include "interface/LocalisedConvexShapeSet.h"
#include "interface/OverlappingPolygon.h"
#include "interface/Query... | ALGO | 0.984128 | 7.315293 |
2c49b5a8-47c5-424f-9f1d-e337d2ed3f59 | keen-learner/leetcode | c++/445-AddTwoNumbersII.cpp | /*
You are given two non-empty linked lists representing two non-negative
integers. The most significant digit comes first and each of their nodes
contain a single digit. Add the two numbers and return it as a linked list.
You may assume the two numbers do not contain any leading zero,
except the number 0 itself.
... | ALGO | 0.99999 | 6.376139 |
e8713617-dbdc-4fe4-a2f7-88e5d08e0644 | Xilinx/llvm-aie | libc/src/string/strstr.cpp | #include "src/string/strstr.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
#include "src/string/memory_utils/inline_strstr.h"
namespace LIBC_NAMESPACE_DECL {
// TODO: This is a simple brute force implementation. This can be
// improved upon using well known string matching algorithms.
... | TOOL | 0.984533 | 6.388168 |
7ff16116-3ad1-4812-ab42-bea49159db3b | BrajAgrawal/cpp-codes | Bubble_sort.cpp | #include <iostream>
using namespace std;
void printarray(int array[], int n)
{
for (int i = 0; i < n; i++)
cout << array[i]<<" ";
}
void bubblesort(int array[], int n)
{
for (int i = 0; i < n - 1; i++)
{
for (int j = 0; j < n - i; j++)
{
if (array[j + 1] < array[j])
... | ALGO | 0.99882 | 4.353639 |
be6a6347-9536-4593-87f1-65b41ddfaf92 | Blade-hh/C-practice | Multi Table.cpp | #include<iostream>
using namespace std;
int main(){
int a;
cout<<"Enter a no. = ";
cin>>a;
for(int i=a;i<=10;i++){
for(int j=1;j<=10;j++){
cout<<i*j<<"\t";
}
cout<<endl;
}
}
| ALGO | 0.977422 | 3.268657 |
b3015ef8-5b3c-4833-8e82-5842c8152e5b | i-rishikesh/cpp | sumelement.cpp | # include<iostream>
using namespace std;
int main()
{
int a[7]={4,8,6,9,5,2,7};
int sum=0;
for(int i=0;i<7;i++)
{
sum=sum=+a[i];
}
cout<<"sum is: "<<sum;
return 0;
} | ALGO | 0.998112 | 3.17947 |
4cc4d014-cf59-44a2-8323-e2fa995352c5 | ishandutta2007/codeforces | couplefire/normal/1108/D.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string str;
cin >> n;
cin >> str;
char prev = 'X';
bool consec = true;
int cons[n];
int cur = 0;
for(int i = 0; i<n; i++){
cons[i] = 0;
if(str[i] != prev){
consec = true;
}
else{
consec = false;
}
if... | ALGO | 0.999978 | 4.428936 |
80b7bf3c-6612-4c31-a448-a79401ab6417 | utkarsh0309/Leetcode-daily-challenges | 135. Candy.cpp | class Solution {
public:
int candy(vector<int>& ratings) {
int n = ratings.size(); // Get the number of children
vector<int> candies(n, 1); // Initialize a vector to store the number of candies for each child
// First pass: Check ratings from left to right
for(int i... | ALGO | 0.999999 | 6.734876 |
8ba0822d-6232-42c0-8399-5544077539c3 | aceyzz/webserv | src/Webserv.cpp | #include "Webserv.hpp"
Webserver::Webserver(std::vector<Config*> config) : _kqueue(-1), _configs(config)
{
for (size_t i = 0; i < _configs.size(); i++)
{
std::vector<int> ports = _configs[i]->getPort();
for (size_t j = 0; j < ports.size(); j++)
_configsByPort[ports[j]] = _configs[i];
}
_logger = new Logger... | WEB | 0.907434 | 4.172243 |
19dd3f05-044d-4c44-b396-fc2c4130cbb1 | Struna1292/LeetCode | 2727-number-of-senior-citizens/2727-number-of-senior-citizens.cpp | class Solution {
public:
int countSeniors(vector<string>& details) {
int output = 0;
for (string s : details)
{
if (s[11] > '6' || (s[11] == '6' && s[12] > '0'))
{
output++;
}
}
return output;
}
}; | ALGO | 0.997254 | 5.994834 |
09ac25b9-a8c3-44ef-8a4a-bf74a13fc7a9 | MrTuzzO/Xettabytes | Week 7/Day 3/C_Minimize_Distance.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--) {
ll n, k;
cin >> n >> k;
vector<ll> posX;
vector<ll> negX;
for (int i = 0; i < n; i++) {
... | ALGO | 0.999881 | 4.430661 |
004ba8be-a3c3-4019-961b-72d2af4cee74 | ayush-gupta2002/Datastructures-and-Algorithms | reverse-linked-list-recursive.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:
void reverse(Lis... | ALGO | 0.999775 | 5.522285 |
a7d36699-c799-4314-996c-39998bf48e7b | anubhav-jangra/leetCode | 202.cpp | // Sol2 O(1) space
class Solution {
int foo(int x) {
int k, ans = 0;
while (x >= 10) {
k = x % 10;
x = x / 10;
ans += k * k;
}
return ans + x * x;
}
public:
bool isHappy(int n) {
int n1 = n;
while (true) {
... | ALGO | 0.999913 | 6.466143 |
74a1bbc9-fab4-43c5-9a7a-73710a4e2b3a | imvskalhans/DSA-Codes | StackImplementation2.cpp | /*
Stack Implementaion Using Linked LIst
*/
#include<iostream>
#include<vector>
using namespace std;
class node{
// properties
public:
int data;
node *next;
//behavior
node(int data){
this->data = data;
next = NULL;
}
};
class Stack
{
//properties
public:
node... | ALGO | 0.999299 | 5.240664 |
f06d9f28-4f7b-4a77-92e3-453478bd95a1 | byzhang/blaze | blazemark/src/classic/DMatDMatMult.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.998806 | 5.77233 |
fdffc191-2ddd-4460-8b0a-35f6729aa4c6 | tingyingwu2010/MIPCL | mipcl-java/examples/mipshell/timeindex/sources/timeindex.cpp | #include "timeindex.h"
#include <cstring>
#include <limits>
#include <iomanip>
Ctimeindex::Ctimeindex(const char* name): CProblem(name)
{
m_ipRelease=m_ipDead=m_ipProcTime=m_ipStart=0;
char fileName[128];
strcpy(fileName,name);
strcat(fileName,".txt");
readData(fileName);
if (!(m_ipStart = new(std::nothrow) int[... | ALGO | 0.944516 | 3.716149 |
4d12f41f-7f0a-4b82-ac7d-eb26cf04c143 | sajalkumar725/coding-ninja-competitive-programming | dynamic programming/coin_change_problem.cpp | /*
You are given an infinite supply of coins of each of denominations D = {D0, D1, D2, D3, ...... Dn-1}. You need to figure out the total number of ways W, in which you can make change for Value V using coins of denominations D.
Note : Return 0, if change isn't possible.
Input Format
Line 1 : Integer n i.e. total numbe... | ALGO | 0.999959 | 4.498608 |
ab8487bc-ec48-465e-ae1f-04f8d209b0cc | ParticulateFlow/LIGGGHTS-PFM | src/pair_born.cpp | /* ----------------------------------------------------------------------
Contributing Author: Sai Jayaraman (Sandia)
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_born.h"
#include "atom.h"
#in... | ALGO | 0.994594 | 6.079046 |
76081fdb-c7de-41fa-84c6-7d7c0baf160b | liblaf/hpc | exp0/workspace/mpi_pow.cpp | #include <mpi.h>
#include <algorithm>
#include <chrono>
#include <cstdio>
#include <cstdlib>
void pow_a(int *a, int *b, int n, int m, int comm_sz /* 总进程数 */) {
// DONE: 对这个进程拥有的数据计算 b[i] = a[i]^m
int local_n = n / comm_sz;
for (int i = 0; i < local_n; i++) {
int x = 1;
for (int j = 0; j < m; j++) x *= a... | ALGO | 0.999911 | 4.537719 |
7b485534-0630-49f1-af91-174844d5a1ea | Venkat-Vivek/HashTable | src/murmurHash.cpp | #include "murmurHash.h"
uint32_t rotateLeft(uint32_t x, int r) {
return (x << r) | (x >> (32 - r));
}
uint32_t mixing(uint32_t h) {
h ^= h >> 16;
h *= 0x85ebca6b;
h ^= h >> 13;
h *= 0xc2b2ae35;
h ^= h >> 16;
return h;
}
uint32_t murmurHash(const char* key, int len, uint32_t seed) {
co... | ALGO | 0.995504 | 6.138122 |
74234de7-70c8-445d-9d0e-336ad0182f4b | artax-committee/Artax | src/cpp-ethereum/libethereum/Block.cpp | /** @file Block.cpp
* @author Gav Wood <<EMAIL>>
* @date 2014
*/
#include "Block.h"
#include <ctime>
#include <boost/filesystem.hpp>
#include <boost/timer.hpp>
#include <libdevcore/CommonIO.h>
#include <libdevcore/Assertions.h>
#include <libdevcore/TrieHash.h>
#include <libevmcore/Instruction.h>
#include <libethco... | TOOL | 0.890355 | 7.433744 |
60ec1105-66e5-4b21-9759-74aa9a789271 | kartikeymishra22/New- | lovebabbar.com/homewrk/revision8.cpp | #include<iostream>
using namespace std;
int main (){
int n;
cin>>n;
int i = 2 ;
while(i<n){
if(n%i==0){
cout<<"Not prime"<<endl;
}
i = i+1;
cout<<"Prime"<<endl;
}
return 0;
}
| ALGO | 0.999629 | 3.606994 |
cf179bfa-b116-4af2-9ee3-e6dda9df50e7 | Ram-the-coder/interview-prep | binary tree/postorder_traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999986 | 6.604822 |
9ea56379-7183-40ea-b578-e3cedd730217 | prprprpony/oj | cf/762E.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;
// nichijou
#define REP(i,s,e) for (int i = (s), __e = (e); i < __e; ++i)
#define RP(i,n) REP(i,0,n)
#define PER(i,s,e) for (int i = (s) - 1, __e = (e); i >= __e; --i)
... | ALGO | 0.999802 | 3.51671 |
f2a7e3b4-9c83-4111-a8f6-4191badbb157 | pepepper/llvm-temple | llvm/lib/ProfileData/SampleProfReader.cpp | #include "llvm/ProfileData/SampleProfReader.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ProfileSummary.h"
#include "llvm/ProfileData/ProfileCommon.h"
#include "llvm/ProfileData/SampleProf.h"
#include "llvm/Support/Comman... | TOOL | 0.895452 | 4.056167 |
521659f7-57f2-46bd-9915-8474fffd65b6 | fsy-juruo/noip-2021-js-answer | t2021/JS-0019/sequence/sequence.cpp | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define per(i,b,a) for(int i = (b); i >= (a); i--)
#define N 33
#define M 110
#define ll long long
#define mod 998244353
using namespace std;
int n, m, K;
ll v[M], mul[M][N];
ll dp[N][M][N][N], fact[N], inv[N];
ll qpow(ll a, int b){
ll ret = ... | ALGO | 0.999974 | 4.14129 |
1c9c5046-93e1-4a36-a7fc-3db36a322fb0 | Hafiz-Sakib/Data-Structure-Algorithms | Data Structures/19. Greedy/fractionalknapsack.cpp | #include <bits/stdc++.h>
using namespace std;
// Structure for an item which stores weight and
// corresponding value of Item
struct Item {
int value, weight;
// Constructor
Item(int value, int weight)
{
this->value=value;
this->weight=weight;
}
};
// Comparison function to... | ALGO | 0.999793 | 5.02295 |
2294523f-b9c3-49da-aa75-3f1e5c33fda7 | zixfy/cpp-leetcode | [216]组合总和 III.cpp | // 找出所有相加之和为 n 的 k 个数的组合,且满足下列条件:
//
//
// 只使用数字1到9
// 每个数字 最多使用一次
//
//
// 返回 所有可能的有效组合的列表
// 。该列表不能包含相同的组合两次,组合可以以任何顺序返回。
//
//
//
// 示例 1:
//
//
// 输入: k = 3, n = 7
// 输出: [[1,2,4]]
// 解释:
// 1 + 2 + 4 = 7
// 没有其他符合的组合了。
//
// 示例 2:
//
//
// 输入: k = 3, n = 9
// 输出: [[1,2,6], [1,3,5], [2,3,4]]
// 解释:
// 1 + 2 +... | ALGO | 0.999887 | 6.854784 |
2de0ecf3-f5d6-4a2c-92fc-0a8d1035c782 | SistineFibel-2006/Sistine_Fibel-s-Code-library | codeforces/hello2025/a.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;
//超级板子
#define endl '\n'
void solve();
signed main (){
std::ios::sync_with_stdio(false);std::cin.tie(0);
int t;
cin >> t;
while(t--) {
int n, m;
cin >> n ... | ALGO | 0.999757 | 5.308372 |
ebfb26e3-5d43-4290-bddf-c017023f9125 | fastestmk/Competitive-Programming-Algorithms | graph/cycle_in_digraph.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<int> adj[1234];
bool vis[1234];
bool dfs(int node, int parent){
vis[node] = 1;
for(int i = 0; i < adj[node].size(); ++i){
int current = adj[node][i];
if(!vis[current]){
if(dfs(current, node)){
return t... | ALGO | 0.999966 | 4.396282 |
1bbcac2e-b083-462c-a437-44118b54bca3 | Bombastik1/Lab_15-3-_Plutenko | Lab_15(3)_Plutenko/Lab_15(3)_Plutenko.cpp | #include <stdio.h>
#include <limits.h>
#include <locale>
int main() {
setlocale(LC_ALL, "");
int n = 10;
int i;
int* array = (int*)malloc(n * sizeof(int));
srand((unsigned int)time(NULL));
for (int i = 0; i < n; i++) {
array[i] = rand() % 201 - 100;
if (array[i] % 2 == 0) {
... | ALGO | 0.986379 | 3.082773 |
100b8485-8b2a-43c6-aadf-ff4afd30923f | digiry/study | algorithm/mergeSort/mergeSort/main_2021-03-29.cpp | #include <iostream>
using namespace std;
const int LENGTH = 7;
int ARR[LENGTH] = { 20,15,19,4,13,11,23 };
int TEMP[LENGTH] = { 0, };
void PrintArray(int *const pArr, const int length) {
for (int i = 0; i < length; i++) {
cout << pArr[i] << ' ';
}
cout << endl;
}
void Merge(int *const pArr, const int left, cons... | ALGO | 0.999971 | 5.08413 |
25f77945-f060-4aae-9cfd-904b5980fb74 | CitrusSin/AlgorithmProblemAnswers | JXNUOJ/POJ2106.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
using namespace std;
template <typename iter> bool calculate_lvl0(iter &cursor, iter end);
template <typename iter>
bool calculate_lvl3(iter &cursor, iter end) {
while (cursor < end && *cursor == ' ') cursor++;
if (*cursor == '(') {
... | ALGO | 0.99932 | 4.229878 |
922c8a74-178f-4a62-b36e-8400389269b7 | jkataja/tupla | src/main.cpp | /**
* Main program for suffix sorting.
*
* @author jkataja
*/
#include <iostream>
#include <fstream>
#include <stdexcept>
#include <memory>
#include <sys/stat.h>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <boost/iostreams/device/mapped_file.hpp>
#include <boost/thread.hpp>
#include ... | ALGO | 0.983508 | 5.144853 |
6d3dc733-26a4-4824-89a7-896debf2d532 | sherigar/HacktoberFest-2023 | c++/SinglyC.cpp | #include <iostream>
using namespace std;
template<class T>
struct node
{
T iNo;
struct node *next;
};
// typedef struct node NODE;
// typedef struct node *PNODE;
template<class T>
class SinglyC
{
private:
int iSize;
node <T> *Head;
node <T> *Tail;
public:
SinglyC();
... | ALGO | 0.998999 | 4.468901 |
80cfae00-d94d-40ab-8ce4-c5ccabec27d0 | sarvex/leetcode-chef | solution/0800-0899/0821.Shortest Distance to a Character/Solution.cpp | class Solution {
public:
vector<int> shortestToChar(string s, char c) {
int n = s.size();
vector<int> ans(n);
for (int i = 0, j = INT_MAX; i < n; ++i) {
if (s[i] == c) j = i;
ans[i] = abs(i - j);
}
for (int i = n - 1, j = INT_MAX; i >= 0; --i) {
... | ALGO | 0.99998 | 6.137238 |
927a855a-d487-4f31-89e5-60f65eee505d | suankun/cpp_snippets | Codewars/6kyu/03.String/Crack the PIN.cpp | // https://www.codewars.com/kata/5efae11e2d12df00331f91a6/train/cpp
// Given is a md5 hash of a five digits long PIN. It is given as string. Md5 is a function to hash your password: "password123" ===> "482c811da5d5b4bc6d497ffa98491e38"
// Why is this useful? Hash functions like md5 can create a hash from string in a ... | ALGO | 0.999257 | 6.467968 |
2c9cc049-7883-4f22-9684-11aa21d86188 | Justin6842/LeetcodeWork | Leetcode_2023/122_BestTimeToBuyAndSellStockII.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int sol{0};
int start{-1};
for (int i = 0; i < prices.size()-1; i++){
if (start == -1 && prices[i+1] >= prices[i]) start = i;
else if (start != -1 && prices[i+1] < prices[i]){
sol += prices[... | ALGO | 0.999977 | 6.143668 |
2654ba0b-1727-493f-a6f3-3f6eb0c0f512 | Mohitsinghparmarg/DSA | 0268-missing-number/0268-missing-number.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
int n = nums.size();
int missing_number = 0;
sort(nums.begin(),nums.end());
for (int i = 0; i < n; i++) {
if (nums[i] != missing_number) {
break;
}
missing_number++;
... | ALGO | 0.999937 | 5.581965 |
81961467-db97-4c6a-8b40-b7b5a67ef643 | Shamim-38/Programming-Problem-Solving---uva-uri-timus | uri1094.cpp | #include<stdio.h>
int main()
{
int N,i, Amount,c_a=0,r_a=0,s_a=0,t=0;
char b;
scanf("%d",&N);
for(i=0;i<N;i++)
{
scanf("%d %c",&Amount,&b);
if(b=='C'){
c_a += Amount;
}else if(b=='R'){
r_a += Amount;
}else if(b=='S'){
s_a += Amo... | ALGO | 0.923944 | 3.24495 |
d075b360-b665-4a74-a747-cc04061d6a5e | prashkrans/DSA | 9. Bit Manipulation/19. Different Bits Sum Pairwise.cpp | /* Bit manipulation problem 19. Different Bits Sum Pairwise
You are given an array of N positive integers, A1, A2 ,…, AN. Find sum of f(Ai, Aj) for all pairs (i, j)
such that 1 ≤ i, j ≤ N. (Optional - Return the answer modulo 10^9+7)
We define f(X, Y) as number of different corresponding bits in binary representation ... | ALGO | 0.999974 | 5.367576 |
8b2c72c7-a664-4230-9c08-9c76f38b6d2f | daeroro/StudyNote | c++_note/cpp/03_181206/vector.cpp | #include <iostream>
using namespace std;
class Vector
{
private:
int x;
int y;
int z;
public:
Vector(int x, int y, int z);
Vector operator+(Vector& v);
Vector operator-(Vector& v);
Vector operator*(int scale);
int inner(Vector &v);
friend Vector operator*(int scale, Vector& v);
void showInfo(void);
};
Vec... | TOOL | 0.980229 | 4.262821 |
bad72214-93dc-4944-9139-2f9b5fb8b3a4 | Ram-95/Personal-Repo | Linear Search.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
int linear_search(int b[10], int key);
int linear_search(int b[10], int key)
{
int i;
for(i=0;i<(sizeof(b)/sizeof(b[0]));i++)
{
if(b[i] == key)
return(1);
}
return(0);
}
int main()
{
int a[10] = {1,5,9,14,241,6,2,5,... | ALGO | 0.999801 | 3.784227 |
51ea53fa-65cd-4632-acd6-bbe5a5bed419 | jraf3/Rafael-John-CSC5-42829 | Class/Conditional Operators/PayCheckIf/main.cpp | /*
* File: main.cpp
* Author: John Mar Rafael
*
* Created on March 16, 2016, 9:02 AM
*/
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
//Function Prototypes
//Execution Begins Here!
int main(int argc, char** argv) {
//Declare Variables
float payRate,hrsWrkd, payChk;
... | ALGO | 0.998327 | 4.528811 |
f1d872f3-f249-43f8-b77b-763d2c950d63 | ConsultantFoodie/Algorithms_Lab_CS29003 | Lab_Test/Lab_Test.cpp | //Written by Hardik Tibrewal
//18EC10020
#include<bits/stdc++.h>
using namespace std;
int ischessboard(int **F, int row_stt, int row_fin, int col_stt, int col_fin){ //Function to check if a given subarray is a chessboard
int i, j;
for(i=row_stt; i<=row_fin;i++){
if(i!=row_stt){
if(F[i][col_stt]==F[i-1][col_stt... | ALGO | 0.999787 | 4.034191 |
5d988aec-6399-458f-bcb7-023a5b217e02 | Rahul-Kumar-Parida/400-DSA_Practice_ACCENTURE | PREVyear20/Q19.cpp | #include <iostream>
#include <climits>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int max = INT_MIN;
int index = 0;
for (int i = 0; i < n; i++)
{
if (arr[i] > max)
{
max = arr[... | ALGO | 0.999874 | 4.664343 |
9d002796-e58b-4e49-82e5-19ca267f9310 | EddyRC/Trabajos-Progra-1 | Ordenar ventas (Metodo de la burbuja)/main.cpp | /*
Programa realizado por:
Edgar Antonio Reyes Ceron.
# de Carnet:
RC18050.
Ultima actualizacion:
Sabado, 17 de noviembre de 2018.
*/
#include <iostream>
#include <cstdlib>
#include <fstream>//para utilizar la funcion de crear archivos de texto
#include <windows.h>
using namespace std;
int main() {
int i... | TOOL | 0.962087 | 4.25399 |
520f46f0-d329-4440-ad39-736c4ce6e31a | saad0104/Codeforces | CF_Maximum_GCD.cpp | //Maximum GCD
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
cout << n/2 << endl;
}
return 0;
}
| ALGO | 0.999805 | 4.640905 |
cf654c80-76d1-4626-98f5-f06a4395952d | KomeijiSatori/chemical-equation | format.cpp | #include "format.h"
bool isSubstanceChar(char ch)
{
if (ch >= 'A' && ch <= 'Z')
{
return true;
}
if (ch >= 'a' && ch <= 'z')
{
return true;
}
if (ch >= '0' && ch <= '9')
{
return true;
}
if (ch == '(' || ch == ')')
{
return true;
}
if ... | TOOL | 0.905376 | 3.650641 |
59974098-2685-4f03-a434-f0813e9a77a6 | someblue/ACM | CF/290-div1/A/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1e9;
const double eps = 1e-6;
const int N = 110;
int cas = 1;
int n;
int g[N][N], in[N], out[N];
bool flag;
string s[N];
queue<int> que;
vector<int> ans;
void init()
{
flag = 0;
memset(g,0,sizeof(g))... | ALGO | 0.999962 | 3.871316 |
a779ebe2-af01-4e0a-8395-0235837334a1 | yugd1211/algorithm | baekjoon/14891_1.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
using namespace std;
#define RIGHT 2
#define LEFT 6
deque<int> gear[4];
int vis[4];
int K;
// 첫번쩨 풀이
// 문제 자체를 제대로 파악하지 못해서 틀렸다.
// 로직은 다음과같다.
// queue에 회전하고자하는 기어와 방향을 push한다.
// 반복문에서 queue에 담겨진 노드르 꺼내서 양옆을 확인하고 양옆의 기어를 회전하... | ALGO | 0.999941 | 4.485507 |
d043e250-c58b-4761-a4fa-1cf43299728e | TH-takahirohara/atcoder_solve | abc190-199/abc198/c_compass_walking__after_editorial.cpp | // r,x,yの型をintにしていたせいで、x*x+y*yの戻り値がオーバーフローしてWAを大量に出していた。
// llに変更して解消した。
#include <bits/stdc++.h>
// #include <atcoder/segtree>
using namespace std;
// using namespace atcoder;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define fore(i,a) for(auto &i:a)
// 桁数指定: cout <<... | ALGO | 0.999375 | 3.692379 |
1666ae42-f3e8-4641-8e47-f1b6ca2c569d | HLkyss/modified_YOLO_ORB_SLAM3 | Thirdparty/DBoW2/DBoW2/FORB.cpp | #include <vector>
#include <string>
#include <sstream>
#include <stdint-gcc.h>
#include "FORB.h"
using namespace std;
namespace DBoW2 {
// --------------------------------------------------------------------------
const int FORB::L=32;
void FORB::meanValue(const std::vector<FORB::pDescriptor> &descriptors,
FOR... | ALGO | 0.993937 | 6.539618 |
aef6a695-3430-49db-be3d-095fc993f4f5 | snandasena/cpp-advanced-topics | ds/leetcode/backtracking/src/combination_sum.cpp | //
// Created by sajith on 2/17/22.
//
#include "base.h"
class Solution
{
vector<vector<int>> ans;
void backtrack(vector<int> &combination, int remain, vector<int> &candidates, size_t start)
{
if (remain < 0) return;
else if (remain == 0)
{
ans.push_back(combination);
... | ALGO | 0.999884 | 6.803918 |
7f5b15d2-b700-450e-8701-fc305ea1c01d | Pettecco/competitive-programming | ajude_seu_madruga.cpp | #include <bits/stdc++.h>
using namespace std;
double BS(int vetor[], double inicio, double fim, int area, int numTiras) {
double meio, soma = 0;
meio = (inicio + fim) / 2.0;
for (int i = 0; i < numTiras; i++) {
if ((double)vetor[i] > meio) {
soma += (double)vetor[i] - meio;
}
}
if (abs(soma ... | ALGO | 0.999563 | 3.631272 |
5e422cd9-8718-400a-9972-2ff8c060cf5a | G-Gowtham/Programming | cpp/Alien_Dictionary.cpp | // { Driver Code Starts
// Initial Template for C++
/* script for test case http://code.geeksforgeeks.org/PetjYq */
#include <bits/stdc++.h>
using namespace std;
string printOrder(string[], int, int);
string order;
bool f(string a, string b) {
int p1 = 0;
int p2 = 0;
for (int i = 0; i < min(a.size(), b.si... | ALGO | 0.999847 | 5.539576 |
ce031b24-7e1c-4150-a419-b8ffea133e08 | mangonote-project/mangonote | src/blockchain_utilities/blockchain_depth.cpp | #include <boost/range/adaptor/transformed.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/algorithm/string.hpp>
#include "common/command_line.h"
#include "common/varint.h"
#include "cryptonote_core/tx_pool.h"
#include "cryptonote_core/cryptonote_core.h"
#include "cryptonote_core/blockchain.h"
#include "blockc... | TOOL | 0.923597 | 6.337848 |
d62398bb-f444-4387-adfa-04d6bb205c83 | UIT-Together-2022-Team-Nobita/Flowchart-CPP | Bai050/Bai050.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Nhap n: ";
cin >> n;
int i = 1;
int s = 0;
while (i <= n)
{
if (n % i == 0)
s = s + i;
i++;
}
cout << s;
return 0;
} | ALGO | 0.999857 | 4.329743 |
bcc9a0bf-9c3a-4b7b-907e-4bb0ef948ebf | Manahil51/navigations | 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 |
885802fb-d814-4bde-8895-0918f016fc38 | ishandutta2007/codeforces | gmusya/normal/1446/A.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
typedef long long ll;
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while (t--) {
ll n, w;
cin >> n >> w;
vector <pair <ll, ll>> a(n);
for (int i = 0; i < n; i++) {
... | ALGO | 0.999978 | 3.726692 |
6c7f33fb-9f5f-4a65-9982-c3e6a69ceb98 | liangkang233/leetcode-cpp | 刷题计划/牛客TOP101/BM39.cpp | // https://www.nowcoder.com/practice/cf7e25aa97c04cc1a68c8f040e71fb84?tpId=295&tags=&title=&difficulty=0&judgeStatus=0&rp=0&sourceUrl=%2Fexam%2Foj
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *ri... | ALGO | 0.999297 | 4.881244 |
01b42133-38f0-4766-b404-1af074786b68 | ishandutta2007/codeforces | inafstream/normal/1299/D.cpp | #include <bits/stdc++.h>
#define rep(i,n) for ((i)=1;(i)<=(n);(i)++)
#define per(i,n) for ((i)=n;(i)>=(1);(i)--)
using namespace std;
const int mod=1e9+7;
struct lb
{
int a[5];
bool ins(int x)
{
int i,j;
for (i=4;i>=0;i--)
{
if ((x>>i)&1)
{
if (!a[i])
{
for (j=0;j<i;j++) if ((x>>j)&1) x^... | ALGO | 0.999983 | 3.924144 |
738f2259-3c31-4a8f-97ad-b018a4e5cd7b | AIxiaodi4Ever/leetcode_in_cpp | 01y字符串/0058_reverseIterator.cpp | // 58. Length of Last Word
class Solution {
public:
int lengthOfLastWord(string s) {
auto iter = s.rbegin();
while (*iter == ' ' && iter != s.rend()) {
++iter;
}
uint32_t ans = 0;
while (*iter != ' ' && iter != s.rend()) {
++ans;
++iter;
... | ALGO | 0.998823 | 5.552765 |
6ea1634a-86dd-41e3-82fd-f6bd09dde9cf | mpapierski/cryptopp-cmake | gfpcrypt.cpp | // dsa.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#ifndef CRYPTOPP_IMPORTS
#include "gfpcrypt.h"
#include "asn.h"
#include "oids.h"
#include "nbtheory.h"
NAMESPACE_BEGIN(CryptoPP)
void TestInstantiations_gfpcrypt()
{
GDSA<SHA>::Signer test;
GDSA<SHA>::Verifier test1;
DSA::Signer t... | TEST | 0.859191 | 7.513933 |
c4fb419c-748f-4698-b781-00df7cdbf8dc | Ashutosh-Singh-10/LeetcodeQuestions | 1114-binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999931 | 5.246305 |
ad8907c7-7707-4601-b5d8-8123af626ed1 | Kidsunbo/SomeExercise | LeetCode/Q0046/Kie.cpp | #include <iostream>
#include <vector>
#include <algorithm> // Used for the other algorithm
using namespace std;
// // This algorithm is much faster even it seems to be silly. It beats 83% while the other beats 29% in time.
//class Solution {
//public:
// vector<vector<int>> permute(vector<int> nums) {
// st... | ALGO | 0.999991 | 5.731687 |
0b271cbc-d864-4e3a-8917-a8fcd0e4374f | RonSheoran123/rubik-s-cube-solver | Rubik-s-Cube-Solver-main/Model/RubiksCube3dArray.cpp | //
// Created by Lakshya Mittal on 17-12-2021.
//
#include "RubiksCube.h"
class RubiksCube3dArray : public RubiksCube {
private:
void rotateFace(int ind) {
char temp_arr[3][3] = {};
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
temp_arr[i][j] = cube[ind][... | ALGO | 0.994329 | 7.002042 |
f6353dfa-f251-4aa2-856e-1285cf8c1d6e | yuguoshao/boost | libs/fiber/src/numa/windows/topology.cpp | #include "boost/fiber/numa/topology.hpp"
extern "C" {
#include <windows.h>
}
#include <map>
#include <set>
#include <system_error>
#include <vector>
#include <boost/assert.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace {
class procinfo_iterator {
private:
using SLPI = SYSTEM_LOG... | TOOL | 0.939992 | 6.418592 |
2b362469-2ab8-4736-b582-75c24705389d | 84rn/adventofcode | day3_2.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
struct coord
{
int x;
int y;
coord() : x(0), y(0) {}
};
int main()
{
size_t numOfHouses = 1;
std::vector<std::pair<int, int>> santa;
coord csanta[2];
size_t i = 0;
coord* pcsanta = &csanta[0];
char c;
... | ALGO | 0.999946 | 4.236586 |
f1106263-ba10-4691-8b21-e9b4a33ee414 | crystalhd/codes_and_notes | 41_maximum-subarray/maximum-subarray.cpp | /*
@Copyright:LintCode
@Author: holiday_0802
@Problem: http://www.lintcode.com/problem/maximum-subarray
@Language: C++
@Datetime: 16-06-13 22:29
*/
class Solution {
public:
/**
* @param nums: A list of integers
* @return: A integer indicate the sum of max subarray
*/
int maxSubArray(vecto... | ALGO | 0.999923 | 6.095578 |
b2ecf2de-eeb1-42b9-ad16-006fa2349dc5 | Aartimehr/codechef | second max of 3 numbers.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
while(n--)
{
int a,b,c;
cin>>a>>b>>c;
if(a>b && a<c)
{
cout<<a<<endl;
}
else if(a>c && a<b)
{
cout<<a<<endl;
}
else if(b>a && b<c)
{
cout<<b<<endl;
}
else if (b<a && b>c)
... | ALGO | 0.99992 | 3.501334 |
9f389ea9-f984-48fc-98bc-b4490ca550f9 | xiaobinbin813/Algorithm | 代码/2-2 fibonacci.cpp | #include<iostream>
using namespace std;
int fibonacci(int n)
{
if (n <= 1) return 1;
return fibonacci(n-1)+fibonacci(n-2);
}
int main()
{
for(int i=0;i<10;i++)
{
cout<<i<<": ";
cout<<fibonacci(i)<<endl;
}
return 0;
}
| ALGO | 0.997971 | 4.148269 |
8f32dd21-04f4-444b-b73f-8a9df3b2d78c | Remonhasan/codeforces | Online Judge Solves (Others)/Uva/UVA124.cpp | /*******************************************************
Remon Hasan
*******************************************************/
/* Methodology:
* + Problem summary: This problem can be modelled as a directed graph problem.
* - Each letter is a vertex.
* There is a directed edge from u to v if u < v
* ... | ALGO | 0.999989 | 5.178205 |
f76920bb-7689-419a-9cbd-79c49cf4c749 | kadirlua/OpcUaServer | OpcUaServer/opcua/src/server/common_addons.cpp | #include <opc/ua/server/addons/common_addons.h>
#include "endpoints_parameters.h"
#include "server_object_addon.h"
#include <opc/common/addons_core/config_file.h>
#include <opc/ua/server/addons/asio_addon.h>
#include <opc/ua/server/addons/address_space.h>
#include <opc/ua/server/addons/endpoints_services.h>
#include <... | WEB | 0.860427 | 7.018131 |
5ea9c1c3-1087-47ac-9edf-49c533153ec6 | lafilledepondy/donneesLibres | mariage-complet.cpp | #include <stdexcept>
/** @file **/
#include <fstream>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
/** Infrastructure minimale de test **/
#define CHECK(test) if (!(test)) cerr << "Test failed in file " << __FILE__ << " line " << __LINE__ << ": " #test << endl
vector<string> jours = {"... | TOOL | 0.96078 | 3.124965 |
6a16f201-3dfa-4a5b-a617-f3bf990496f9 | moutamarakshit/-6Companies30Days | day 11/CountTheNumberofIncremovableSubarraysI.cpp | class Solution {
public:
int incremovableSubarrayCount(vector<int>& nums) {
int ans = 0;
int n = nums.size();
int left = 0, right = n - 1;
while (left < n - 1 && nums[left] < nums[left + 1]) left++;
while (right > 0 && nums[right] > nums[right - 1]) right--;
ans = (le... | ALGO | 0.999891 | 5.808877 |
11a05443-5dc3-4d9f-a549-cf8f946c349c | Pahomch1k/CDate_05.10.21 | CDate/CDate.cpp | #include "CDate.h"
#include<iostream>
using namespace std;
CDate::CDate()
{
day = 0;
mounth = 0;
year = 0;
}
CDate::CDate(int d, int m, int y)
{
day = d;
mounth = m;
year = y;
}
const char* CDate::DayOfWeek() const
{
CDate start_date(3, 1, 0);
while (true)
{
for (int i = 1; i <= 7; i++, sta... | TOOL | 0.963213 | 4.172148 |
ba01e6ec-64d4-4a5a-bf4d-62b956de0497 | king-yyf/cpcode | atcoder/abc295/d.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(c) (c).begin(), (c).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define f0(e) for(int i = 0; i < (e); ++i)
#define f1(e) for(int i = 1; i <= (e); ++i)
#define f2(i,e) for(int i = 0; i < (e); ++i)
#define f... | ALGO | 0.99963 | 4.531166 |
31d26c40-a7ec-46ba-aff4-ed7088062f33 | UVARocketry/SpaceportAmericaCup23-24 | kalman_rocket/eigen/doc/examples/QuickStart_example2_fixed.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
Matrix3d m = Matrix3d::Random();
m = (m + Matrix3d::Constant(1.2)) * 50;
cout << "m =" << endl << m << endl;
Vector3d v(1,2,3);
cout << "m * v =" << endl << m * v << endl;
}
| ALGO | 0.996488 | 3.375595 |
e5a9ba4b-f751-47fe-b46e-8e8fa7c6193b | weiweiweidong/My_Competitive_Programming_Codes | 1_AcWing_Algo_Course/2_Advanced_Algorithms/CH1/1_Digital_Triangle_Model/1_ACW_1015.cpp | // Problem: https://www.acwing.com/problem/content/1017/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int N = 110;
int n, m;
int w[N][N];
int f[N][N];
void solve() {
int T;
scanf("%d", &T);
while (T--) {
scanf("%d%d", &n, &m);
for (... | ALGO | 0.999914 | 3.913067 |
d92a3baa-7c2e-4523-832f-3c38c6747692 | vinayrn12/gfg_interview_questions | Graphs/Shortest path binary matrix/main.cpp | // { Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
struct point{
int x;
int y;
};
struct Node{
point pt;
int dist;
};
class Solution {
public:
int row_pos[4] = {-1, 0, 1, 0};
int col_pos... | ALGO | 0.999941 | 5.923116 |
9086476e-766c-453f-b956-6d56a2d390e8 | bashirafarhin/gfg-potd | Medium/Choose and Swap/choose-and-swap.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
string chooseandswap(string s){
int curr=0;
char x,y;
int n=s.length();
unordered_set<char> st;
for(int i=0;i<n;i++){
st.insert(s[i]);
... | ALGO | 0.99997 | 6.115205 |
4c32fa18-1bb8-4e8e-9c12-3a7210dd6ef8 | saamyukkth26/DSA_CPP | array_problems/acc2.cpp | // #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int OperationsBinaryString (char *str)
{
if (str == NULL)
return -1;
int i = 1;
int a = *str - '0';
cout<<*str<<endl;
str++;
cout<<*str<<endl;
while(*str!='\0')
{
char h = *str;
str++;
if (h=='A')
{
a&=(*str-'0'... | ALGO | 0.999632 | 4.292537 |
fde74b2d-6851-4ef3-9f1d-806ac6438a48 | shenzheyu/LeetCode | 236. Lowest Common Ancestor of a Binary Tree/main.cpp | #include <iostream>
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
// base case 1
if (root == NULL) {
... | ALGO | 0.999853 | 6.098588 |
b21b3190-5c4a-4108-be94-7f71b0b12d00 | matcher9131/AtCoder-Repo | abc396/c/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <climits>
#include <cfloat>
#include <utility>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <cassert>
#include <numeric>... | ALGO | 0.999987 | 3.632798 |
5570a45f-5251-459a-8c6b-f3857e879c8f | raincross7/code-similarity | codes/train_code/problem319/problem319_10.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);++i)
using ll = int_fast64_t;
using pll = pair<ll,ll>;
constexpr ll INF = 1LL<<60;
constexpr ll MOD = 1e9+7;
template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a,const T &b){if(a>b... | ALGO | 0.999007 | 3.430703 |
df2c9cca-1599-4ae5-a280-f1c087d89eab | Kunalgarg108/CP | CP Lab/Week12/Lab12Q2.cpp | #include<iostream>
#include<vector>
using namespace std;
struct TreeNode{
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x)
{
val = x;
left = NULL;
right = NULL;
}
};
void dfs(TreeNode* root , int k , vector<vector<int>> &ans , vector<int> &temp , int sum)
{
... | ALGO | 0.999903 | 4.477259 |
4c955ebb-ba2d-45b6-b49f-dee2384df792 | guptaa98/HackerEarth | Goki and his breakup.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long int n,x,y;
cin>>n;
cin>>x;
int i;
for(i=1;i<=n;i++)
{
cin>>y;
if(y>=x)
{
cout<<"YES"<<endl;
}
else
{
cout<<"NO"<<endl;
}
}
}
| ALGO | 0.999985 | 3.566086 |
e8d29024-3042-4d38-ad55-cb7a72831bf0 | Keshav7891/Leetcode-Solutions | 33-search-in-rotated-sorted-array/33-search-in-rotated-sorted-array.cpp | class Solution {
public:
int search(vector<int>& nums, int target)
{
int res ;
int low = 0;
int high = nums.size()-1;
while(low<=high)
{
int mid = (low+high)/2;
if(nums[mid]==target)
{
return mid;
}... | ALGO | 0.999978 | 6.09502 |
18c1e797-a094-4740-b42e-8988e285a805 | cran/Boom | src/Models/Glm/PosteriorSamplers/MultivariateRegressionSampler.cpp | #include "Models/Glm/PosteriorSamplers/MultivariateRegressionSampler.hpp"
#include "distributions.hpp"
namespace BOOM {
typedef MultivariateRegressionSampler MRS;
MRS::MultivariateRegressionSampler(
MultivariateRegressionModel *model,
const Matrix &Beta_guess,
double coefficient_prior_sample_si... | ALGO | 0.915332 | 5.824536 |
f497fd05-af23-4bea-9fa2-80fee8f95d35 | luizaes/jde-randomization-methods | source/F8.cpp | #include "F8.h"
#include <fstream>
#include <iostream>
F8::F8(uint _dim):Benchmarks()
{
n_dim = _dim;
ID = 8;
x_min = -5;
x_max = +10;
}
F8::~F8(){
/* empty */
}
double F8::compute(const vDouble gen, const uint ip){
/* Defining fitness function - Zakharov function
Dimensions: d
Domain: x ∈ [-... | ALGO | 0.987889 | 3.767221 |
526fdec2-68a6-4d55-a187-2a2a2c89090f | yujl17/CardGame | CardGame.cpp | #include "CardGame.h"
//A组先选
CardGame::CardGame(QWidget *parent, int co_time)
: QMainWindow(parent)
{
ui.setupUi(this);
ui.punishtext_label->hide();
ui.punishtitle_label->hide();
ui.punish_label->hide();
ui.givepunishtext_label->hide();
//ui.Bt1->hide();
//ui.Bt2->hide();
//ui.Bt3->hide();
ui.info_label->hid... | TOOL | 0.918071 | 3.144012 |
5d8c10b6-1500-4a8d-8bf7-9aa43773dc7f | wcventure/UAF-Fuzzer-TestSuite | openh264/codec/decoder/core/src/get_intra_predictor.cpp | #include <string.h>
#include "macros.h"
#include "ls_defines.h"
#include "get_intra_predictor.h"
namespace WelsDec {
#define I4x4_COUNT 4
#define I8x8_COUNT 8
#define I16x16_COUNT 16
void WelsI4x4LumaPredV_c (uint8_t* pPred, const int32_t kiStride) {
const uint32_t kuiVal = LD32A4 (pPred - kiStride);
ST32A4 (p... | ALGO | 0.999799 | 5.883891 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.