uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7acaa0f9-40f1-4bbe-bb2d-65931f758c64 | king258436/algorithm | baekjoon/줄 세우기.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int indegree[32001];
int main() {
int n, m;
cin >> n >> m;
vector<int> v[32001];
while (m--) {
int t, s;
cin >> t >> s;
v[t].push_back(s);
indegree[s]++;
}
queue<int> q;
for (int i ... | ALGO | 0.999997 | 4.706586 |
459e2302-7eb6-4bfc-96e8-8e59d86946a1 | soki-rf/Lab_4 | number_6.cpp | #include <iostream>
#include <string>
using namespace std;
string replace(const string& str, const string& old, const string& new_s) {
string s = str;
int pos = 0;
while ((pos = s.find(old, pos)) != string::npos) {
s.replace(pos, old.length(), new_s);
pos += new_s.length();
}
ret... | ALGO | 0.856545 | 5.546547 |
2aeaa51b-9b39-4c96-9486-ef390522a06f | Spuriosity1/qsi_subspace_ED | bench/src/map_choice.cpp | #include <iostream>
#include <cstdint>
#include <map>
#include <ankerl/unordered_dense.h>
#include "bittools.hpp"
using namespace std;
// For benchmarking construction and access time
int main (int argc, char *argv[]) {
if (argc < 2){
cout << "Usage: "<<argv[0]<<" <N>"<<std::endl;
return 1;
}
uint64_t N = a... | TOOL | 0.930973 | 3.365437 |
58a45c78-b0b9-41b5-9364-cafcb3d8cfc5 | ishandutta2007/codeforces | bohdanpastuschak/normal/1305/C.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,fma")
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second
#define FOR(i, a, b) for(int i = (a); i < (b... | ALGO | 0.999993 | 4.484436 |
2c8bf4b2-8dab-47e9-93e8-0aca1ac5e2da | XabierFernandez/MyCppProjects | majority_element.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using std::vector;
int count_occurence(vector<int> &a, int left, int right, int num ) {
int count = 0;
for (int i = left; i <= right; i++) {
if (a[i] == num) {
count++;
}
}
return count;
}
int get_majority_element_... | ALGO | 0.999977 | 4.39703 |
88daae00-c7b8-4591-91ca-608f246e9e24 | alsterium/GEV_calib_tool | cv_calib_test.cpp | //
// カメラキャリブレーションプログラムのサンプル(opencv4.0.0)
//
// ***使い方***
//
// 引数1:チェスボードのコーナー数の行
// 引数2:チェスボードのコーナー数の列
// 引数3:取り込みに成功したチェスボードの数の設定
// 引数4:ディレイ(?)
// 引数5:findChessboardCorners()に渡す画像のスケーリング
//
// (Ex. 10x7チェスボードを用いてキャリブレーションを行う場合(14枚の画像を用いてキャリブレーション)
// ~.exe 10 7 14
//
#include <opencv2\opencv.hpp>
#include... | TOOL | 0.920426 | 4.322458 |
b76ad751-3255-478b-87db-dd2fc3d2a942 | tjkendev/procon-library | cpp/heap/pairing-heap.cpp | #include<vector>
#include<unordered_map>
using namespace std;
template<typename K, typename V>
class PairingHeap {
struct Node {
Node *left, *right, *parent;
K key;
V value;
void init(K key, V value) {
this->key = key; this->value = value;
this->left = this->right = this->parent = nullp... | ALGO | 0.999829 | 5.483656 |
ae524bc5-691e-485a-90bf-ee6bfca76f8d | goelayush89/Data-Structure-and-Algorithms- | 0100-same-tree/0100-same-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.999979 | 6.380075 |
172f20d1-90bb-4306-b061-2ca159c29528 | profornnan/Problem-Solving | BOJ/선분 교차 판정/17386-선분 교차 1.cpp | #include <iostream>
using namespace std;
struct vector2 {
double x;
double y;
vector2(double x = 0, double y = 0) : x(x), y(y) {}
bool operator<(const vector2& rhs) const {
return x != rhs.x ? x < rhs.x : y < rhs.y;
}
vector2 operator-(const vector2& rhs) const {
return vector2(x - rhs.x, y - rhs.y);
}
... | ALGO | 0.99976 | 3.947231 |
3f65ee90-3250-4515-90e5-e6405a4fdd63 | ARAVIND-14-2002/pass_guard | 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.998784 | 6.761023 |
b95b865c-69d4-4f5e-98a1-0d1f211eea19 | ibeastking/CP | LC/953_Verifying_an_Alien_Dictionary.cpp | //? Difficulty -> Easy
//? In an alien language, surprisingly, they also use English lowercase letters, but possibly in a different order.
//? The order of the alphabet is some permutation of lowercase letters.
//? Given a sequence of words written in the alien language, and the order of the alphabet,
//? return true ... | ALGO | 0.999991 | 5.924356 |
01d53099-f440-4b74-b4c6-96f397eaa4b4 | SadmanHafizShuvo21/Schaum-s_Outline_of_Theory_and_Problems_of_Data_Structures_Seymour | Chapter 5/Algo_03.cpp | #include <bits/stdc++.h>
using namespace std;
// Create class for node
class node{
public :
int data;
node* next = nullptr;
node(int value){ // Constructor of node
data = value;
next = nullptr;
}
};
// Insert node
void insertAtTail(node* &head, int value){
node* n = new node(v... | ALGO | 0.999991 | 5.859409 |
bcff5238-6a46-44f6-87f2-f54d322772e1 | arhamsarwar786/whatapp_status_saver | 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.998764 | 6.762122 |
f5887772-ba69-422f-b6fb-9f951693bf98 | aaditkamat/CS3230-Assignments | Programming Assignment 1/idlegame.cpp | #include <iostream>
#include <vector>
int calculate_minimum(int maxLevel, int amountRequired, std::vector<int> values, std::vector<int> costs) {
return 0;
}
int main(){
int testCases;
std::cin >> testCases;
for (int tc = 0; tc < testCases; tc++) {
int maxLevel;
std::cin >> maxLevel;
int amountRequired;
std:... | ALGO | 0.999645 | 3.652501 |
82e96019-643f-4980-ace6-fd1553afddc4 | AhanafTahmid/DSA | Graph/Graph templates/adjList and adjMatrix.cpp | //Adjacency List
#include <bits/stdc++.h>
using namespace std;
void adjacency_list(){
int v,e;//v=vertices, e = edges
cin>>v>>e;
vector<int> graph[N];//can be done like this also
vector<vector<int>> graph(v + 1); // 2d vector array
for(int i=1;i<=e;i++){
int v1,v2;//vertex 1, vertex 2
... | ALGO | 0.999971 | 4.700248 |
52267c14-1fe7-4674-b845-7aa120d42f05 | SirEnri2001/QMorphRefine | QMorph_Refined/src/Smoother.cpp | #include "Smoother.h"
#include"QMorph.h"
#include"util.h"
void Smoother::setMesh(CTMesh* mesh) {
this->mesh = mesh;
}
Point Smoother::getDelC(VertexHandle Ni, HalfedgeHandle ife, HalfedgeHandle ofe) {
double lD;
HalfedgeHandle lhe = mesh->halfedgePrev(mesh->halfedgePrev(mesh->halfedgeSym(ife)));
HalfedgeHandle rh... | ALGO | 0.99848 | 4.694685 |
16def890-866a-46d6-a5b1-6a43434f0438 | a69k/COMP205-OOP | Sheet 3/Q3.cpp | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
class Num {
private:
float N[10];
int m;
string T[10];
public:
Num() {
for (int i = 0; i < 10; i++) {
N[i] = 0.0;
T[i] = "";
}
m = 0;
}
int factorial(int num) {
if (num <= 1) {
return 1;
... | ALGO | 0.999431 | 3.843766 |
bcaf2fa3-a0c5-46b4-ad9c-9a91c4acd766 | iamchandanchaudhary/Cpp-Programs | Classroom/5. Loop/Do while Loop.cpp | #include <iostream>
using namespace std;
int main() {
cout << "Table with Do while Loop:- \n" << endl;
int n = 13;
cout << "Enter Value: ";
cin >> n;
int i = 1;
do {
cout << n << " * " << i << " : " << n * i << endl;;
i++;
} while(i <= 10);
cout << "\nThank You :)" <... | TOOL | 0.998469 | 3.699605 |
c7744717-ff7a-4007-8c28-8a5a2f8c3776 | ishandutta2007/codeforces | anadi/normal/1055/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long long int LL;
#define st first
#define nd second
#define pb push_back
#define PLL pair <LL, LL>
#define PII pair <int, int>
const int N = 1507;
const int MX = 1e9 + 7;
const LL INF = 1e18 + 9LL;
int n, s, m, k;
int in[N];
PII seg[N];
int p... | ALGO | 0.99999 | 3.76196 |
2441fdf4-9e99-47e3-a135-3102988c7794 | Fighohji/Competitive-Programming | Record/PassRecord/cf23826/f.cpp | #include <cstdlib>
#include <map>
#include <numeric>
#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 <iomanip>
#i... | ALGO | 0.999971 | 4.466505 |
cd9f2c71-812e-4f43-a4a6-6a2d6c91a535 | Cipher-08/Graphs | bfs.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mod 1000000007
#define inf 1e18
#define endl "\n"
#define pb push_back
#define vi vector<ll>
#define vs vector<string>
#define pii pair<ll,ll>
#define ump... | ALGO | 0.999865 | 4.297277 |
223748e2-fa2e-4976-a135-4510432c4153 | Maks3410/inf | 27.11/58 параграф в виде подпрограмм/35.cpp | #include <iostream>
using namespace std;
void primes(int a, int b) {
int i, j, k;
bool f;
for (i = a; i <= b; i++) {
f = false;
for (j = 2; j <= i / 2; j++) if (i % j == 0) f = true;
if (!f) cout << i << endl;
}
}
int main() {
cin >> a >> b;
primes(a, b);
} | ALGO | 0.999139 | 4.028536 |
aae6e6f2-e0aa-4984-9c65-06eaf1ea5f59 | CrystalParaboy/leetcode | 39. Combination Sum.cpp | class Solution {
private:
vector<vector<int>> result;
vector<int> path;
void back(vector<int> can,int target,bool mark,int index){
if(target<0){
return;
}
else if(target==0){
result.push_back(path);
mark=true;
return;
}
... | ALGO | 0.99999 | 6.558722 |
a0b1373e-defd-4ef2-a600-f2ec0ea5154c | K0NSTANT1N3/Abstractions | src/assignments/1/1-ConsecutiveHeads/ConsecutiveHeads.cpp | //
// Created by konstantine on 3/22/24.
//
#include "ConsecutiveHeads.h"
/** private */
int ConsecutiveHeads::flipCount(int n) {
int count = 0;
int tails = 0;
while (tails < n) {
count++;
if (getRandomNumber(0, 1) == 0) {
tails++;
} else {
tails = 0;
... | ALGO | 0.998962 | 6.890676 |
82d7a354-579f-4cb1-9d3f-7ea019e7cc7c | moyarishka/mynotes | 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.998784 | 6.761023 |
49a82faf-3f29-42a0-ade1-ed6cff2e17d5 | Racon23/leetcode2 | solution/1046.最后一块石头的重量.cpp | // @before-stub-for-debug-begin
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include "commoncppproblem1046.h"
using namespace std;
// @before-stub-for-debug-end
/*
* @lc app=leetcode.cn id=1046 lang=cpp
*
* [1046] 最后一块石头的重量
*/
// @lc code=start
class Solution
{
public:
int lastS... | ALGO | 0.999766 | 5.480891 |
b04293d7-8953-4e24-ba90-7d2dfb0d7dd7 | Magdib/portfolio | 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.998764 | 6.762122 |
209af837-75b6-4891-b885-32b2a6e52305 | ishandutta2007/codeforces | felerius/normal/1492/A.cpp | // Three swimmers (https://codeforces.com/contest/1492/problem/A)
// begin "cp-lib/boilerplate.hpp"
#include <bits/stdc++.h>
#define _choose(_1, _2, _3, chosen, ...) chosen
#define _rep(i, l, r) for (int i = l; i < r; ++i)
#define _rep0(i, r) _rep(i, 0, r)
#define _repr(i, r, l) for (int i = r; i >= l; --... | ALGO | 0.999771 | 4.435331 |
f3252f11-50b1-4437-ad75-681f2542c893 | shashankms2005/dsaBustsed | BinarySEARCHtree.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int data)
{
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
// INSERTION
Node *insert(Node *root, int Key)
{
// Your code here
if (root == NUL... | ALGO | 0.999952 | 4.56825 |
6be6743d-6396-466a-92a8-8b34578d56ce | MariaBiserica/IDCgrammar-To-PDA | AutomatPushDown/AutomatPushDown/Source.cpp | #include <iostream>
#include<unordered_set>
#include "Grammar.h"
#include "PushDownAutomaton.h"
PushDownAutomaton GeneratePushDownAutomaton(Grammar grammarIDC)
{
//transformam in FNG
grammarIDC.GetGreibachNormalForm();
//construim functia de tranzitie
Transitions transitions;
std::vector<Production> productions ... | ALGO | 0.986736 | 5.908737 |
9d1b918a-f9cb-4b61-a030-651bcd9ad17e | iuvei/Human | frameworks/cocos2d-x/cocos/platform/winrt/CCWinRTUtils.cpp | #include "CCWinRTUtils.h"
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <Windows.h>
#include <wrl/client.h>
#include <wrl/wrappers/corewrappers.h>
#include <ppl.h>
#include <ppltasks.h>
#include <sstream>
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
NS_CC... | TOOL | 0.982544 | 6.043718 |
5eb32ec3-d11a-4548-b618-ffc903050dd9 | rajansaini691/cs24_lab03_rajansaini691 | intlist.cpp | // intlist.cpp
// Implements class IntList
// Rajan Saini, 11/10/2018
#include "intlist.h"
#include <iostream>
using std::cout;
// copy constructor
IntList::IntList(const IntList& source) {
first = 0;
for(Node* s = source.first; s != 0; s = s->next) {
append(s->info);
}
}
// destructor deletes a... | ALGO | 0.959558 | 5.331776 |
73ec3e6e-da56-461c-afb9-e64da8115f47 | reevacodes/DSA_ARRAY | missing_repeating_number.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<int> missingRepeating(int arr[], int n) {
long long SN = n * (n + 1) / 2;
long long S2N = (n * (n + 1) * (2 * n + 1)) / 6;
long long sum = 0, S2 = 0;
for (int i = 0; i < n; i++) {
sum += arr[i];
S2 += (long long)arr[i] * a... | ALGO | 0.999951 | 4.500387 |
006cf485-7a6e-42bd-88b8-0dd4d8eb4a83 | dari-kayoo/Cplusplus | quiz4v2/c.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int prime_ind;
int primeNum = 2, cnt = 0;
for (int i = 2; i*i <= 100; i++){
if (primeNum%i == 0){
cnt++;
}
}
if (cnt > 1){
primeNum;
}
return 0;
} | ALGO | 0.999635 | 3.92031 |
15e084fa-cb6c-47b8-8de7-0eb71e2e1452 | ishandutta2007/codeforces | jdurie/normal/1374/A.cpp | #pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
template<class T, class S>
ostream& operator << (ostream &o, const pair<T, S> &p) {
return o << '(' << p.first << ", " << p.second << ')';
}
template<template<class, class...> ... | ALGO | 0.999817 | 3.958217 |
cd065cf5-5d80-4e5d-960a-1b248cfd2a57 | DerpFest-AOSP/android_system_core | init/ueventd_parser.cpp | #include "ueventd_parser.h"
#include <grp.h>
#include <pwd.h>
#include <android-base/parseint.h>
#include "import_parser.h"
#include "keyword_map.h"
#include "parser.h"
using android::base::ParseByteCount;
namespace android {
namespace init {
Result<void> ParsePermissionsLine(std::vector<std::string>&& args,
... | TOOL | 0.950961 | 6.491435 |
d696637e-70dd-42f3-a20c-9edae3b640e5 | cupeedrl/CODE | DSA PTIT/CODE PTIT/Divide and Conquer/DSA04004_GAP_DOI_DAY_SO.cpp | #include<bits/stdc++.h>
using namespace std;
int conquer(long long n, long long k)
{
long long mid = pow(2,n-1);
if( k == mid)
return n;
else if (k < mid)
return conquer(n-1,k);
else
return conquer(n-1,k-mid);
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0... | ALGO | 0.999938 | 4.895299 |
9f9855cf-b1d1-4b14-90be-01e95e258716 | Jinjin-Wang07/Ecosystem-simulation | src/comportement/Kamikaze.cpp | #include "Kamikaze.h"
#include "../../include/LogUtil.h"
#include "../bestiole/Bestiole.h"
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
Kamikaze::Kamikaze() { LOG_DEBUG("Create a kamikaze behavior par default"); }
Kamikaze::~Kamikaze() {
LOG_DEBUG("Destroying a kamikaze behavior par d... | ALGO | 0.986659 | 5.148125 |
75292d75-9b0c-4322-8d08-4eb35cfe3b52 | Saavrm26/mycppprogs | hackerearth/src/rectangularfield.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int a;
cin>>a;
int n;
for(n=1;n*n<=a;n++){
}
int l,b;
int min=INT32_MAX;
for(int i=1;i<n;i++){
if(a%i==0){
l=i;
... | ALGO | 0.999575 | 4.132654 |
6f1766ac-9ec8-4666-8116-b508f8adb789 | educatedpolarbear/Rep4 | BieuThucTangGiam.cpp | // Designed by Nguyen Thanh Chau
// a.k.a Linh's servant - Ken
// En Taro Adun! - TemplarAssasin a.k.a Zeratul
// Libraries
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// #include <boost/math/constants/constants.hpp>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/trie_p... | ALGO | 0.999888 | 4.406912 |
ca647431-d29c-45db-83b9-bf717950f666 | OsinoviAlex43/Coursework | main.cpp | #include <iostream>
#include <algorithm>
#include <random>
#include <chrono>
#include <iomanip>
#include <thread>
#include <mutex>
using namespace std;
std::mutex consoleMutex;
int barrierSearch(int* arr, int size, int key) {
int last = arr[size - 1];
arr[size - 1] = key;
int i = 0;
while (arr[i] != ... | ALGO | 0.998767 | 6.418657 |
13662bcc-781f-4089-b01d-5725ad48d99d | Muses-lbz/Daily-Practice | 2023_07/2023_07_28.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
class Solution {
public:
int minimumTime(int n, vector<vector<int>>& relations, vector<int>& time) {
vector<vector<int>> graph(n + 1);
vector<int> inDegree(n + 1, 0);
vector<int> earliestTime(n... | ALGO | 0.999994 | 7.059728 |
b44ecfa6-cd08-4f95-a3a6-cdbc1e421f70 | AhmedMekheimer/Image-Filtering-with-Parallel-Programming-Using-OpenMP---Pthreads | Ass3/Ass3/Ass3.cpp | #include "Ass3.h"
#define num_threads 3
using namespace std;
using namespace cv;
int main(void)
{
cv::Mat img1 = cv::imread("E:\Courses\3rd CESS\Parallel & Cluster Comp\Assignments\Ass3\images.jfif", cv::IMREAD_COLOR);
pthread_t threads[num_threads];
thread_stru thread_data[num_threads];
for (int tid = 0; tid < nu... | ALGO | 0.996607 | 3.862718 |
18e08c06-2a20-4a63-85ed-6b701d53e943 | florafloriate/Competitive-Programming-CSE2100 | Codeforces/Regular Codeforces Contests/Codeforces Round #799 (Div. 4)/G - 2^Sort.cpp | #include<bits/stdc++.h>
#define mod 1000000007
#define INF 1e9
#define pi acos(-1)
#define ll long long
#define endl "\n"
#define F first
#define S second
#define LL_INF 1LL<<62
#define twopow(x) (1LL<<x)
#d... | ALGO | 0.999142 | 3.544312 |
b3f486b2-3c6e-465b-9774-2b1d804bf4ad | himanshu13196/interviewbit | arrays/MinStepsGrid.cpp | /**
* You are in an infinite 2D grid where you can move in any of the 8 directions :
* (x,y) to (x+1, y), (x - 1, y), (x, y+1), (x, y-1), (x-1, y-1), (x+1,y+1), (x-1,y+1), (x+1,y-1)
* You are given a sequence of points and the order in which you need to cover the points. Give the minimum number of steps in which you... | ALGO | 0.999923 | 5.056914 |
e4bd673d-efb8-4c0a-b982-b794483adc78 | HungNguyenBa1811/CTDLGT-PTIT-2024 | 310.BienDoiSNT.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ed "\n"
#define use(x) freopen(x".inp", "r", stdin); freopen(x".out", "w", stdout);
#define BidenJr 0
int x_4axis[] = {-1, 0, 0, 1};
int y_4axis[] = {0, -1, 1, 0};
int x_8axis[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int y_8axis[] = {-1, 0, 1, -1, 1, -... | ALGO | 0.999962 | 5.244932 |
a181c504-6dd3-425e-8c54-22efb1c93bda | mskfox/cpp-sandbox | codingame/puzzles/easy/mime_type.cpp | // Puzzle: https://www.codingame.com/ide/puzzle/mime-type
#include <algorithm>
#include <iostream>
#include <string>
#include <unordered_map>
/**
* @brief The program reads a list of MIME types and file names, and outputs
* the MIME type of each file.
*/
int main() {
int n, q;
std::cin >> n >> q;
std::cin.ignor... | ALGO | 0.995121 | 6.141006 |
7db8fa46-53b2-4931-b63c-408b857bfe6c | PootieT/explain-then-translate | CodeGenMirror/data/transcoder_evaluation_gfg/cpp/HARDY_RAMANUJAN_THEOREM.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
int f_gold ( int n ) {
int count = 0;
if ( n % 2 == 0 ) {
count ++;
while ( n % 2 == 0 ) n = n / 2;
}
for ( int i = 3;
i <= sqrt ( n );
i = i... | ALGO | 0.999051 | 5.684269 |
21f1b0e9-0c0f-486e-9d37-9a48b13af151 | coderbysoul/Strivers-SDE-Sheet-Challenge | Day 28/01knapsack.cpp | //https://www.codingninjas.com/studio/problems/0-1-knapsack_8230801?challengeSlug=striver-sde-challenge&leftPanelTab=1
#include<bits/stdc++.h>
int maxProfit(vector<int> &values, vector<int> &weights, int n, int w)
{
// Write your code here
vector<int>prev(w+1,0);
for(int i=weights[0];i<=w;i++)
{
prev[i]=values[... | ALGO | 0.999997 | 5.499798 |
69a72b9f-7152-403d-9b0b-0b08cd1abcc1 | mandog66/LeetCode | Pow(x, n)/Solutions.cpp | #include <iostream>
#include <cmath>
// watch solution video : https://www.youtube.com/watch?v=g9YQyYi4IQQ
double recursive(double x, long n)
{
if (n == 0)
return 1.0;
else if (n < 0)
{
n = std::abs(n);
x = 1.0 / x;
}
double res;
if (n % 2 == 0)
{
res = rec... | ALGO | 0.999938 | 6.021233 |
8140aac0-d37e-4e62-bfc5-dea95fdeecc6 | johngarrett/llvm-research | libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n.pass.cpp | // <algorithm>
// template<class ForwardIterator, class Size, class T>
// constexpr ForwardIterator // constexpr after C++17
// search_n(ForwardIterator first, ForwardIterator last, Size count,
// const T& value);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iter... | TEST | 0.990154 | 7.374958 |
2e50e127-77bc-474e-bc68-4e60888c8170 | sju3358/Algorithms | SWEA/D2/1961. 숫자 배열 회전/숫자 배열 회전.cpp | /////////////////////////////////////////////////////////////////////////////////////////////
// 기본 제공코드는 임의 수정해도 관계 없습니다. 단, 입출력 포맷 주의
// 아래 표준 입출력 예제 필요시 참고하세요.
// 표준 입력 예제
// int a;
// float b, c;
// double d, e, f;
// char g;
// char var[256];
// long long AB;
// cin >> a; // int 변수 1개 입력... | ALGO | 0.999285 | 4.207598 |
76835d0d-b611-4a59-a39b-79d4e68bd4c9 | dumganhar/firefox | mfbt/HashFunctions.cpp | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* Implementations of hash functions. */
#include "mozilla/HashFunctions.h"
#include "mozilla/Types.h"
#include <string.h>
namespace mozilla {
uint32_t
HashBytes(const void* aBytes, size_t aLeng... | ALGO | 0.902433 | 7.022894 |
dc17608a-7d47-42f8-8591-66426080fd95 | FofaTakeBrianRich237/Snake-in-console | snake.cpp | #include "display.h"
#include "snake.h"
#include<unistd.h>
int main()
{
srand(time(NULL));
int tab[30][30];
int a = 0;
Snake snake;
initialise_table(tab);
tab[10][10] = 1;
tab[10][9] = 2;
tab[10][8] = 3;
tab[10][7] = 4;
tab[10][6] = 5;
tab[10][5] = 6;
tab[11][5] = 7;
... | ALGO | 0.974551 | 4.727259 |
d3b9092a-637a-43de-a2b1-236b11161d3b | hiraditya/fool | interview/in-order.cpp | // Recursive Left->Root->Right
void in_order(Node *n) {
if (!n)
return;
in_order(n->L);
visit(n);
in_order(n->R);
}
void in_order(Node *n) {
stack s;
while (!s.empty() || n != nullptr) {
if (n != nullptr) {
s.push(n);
n = n->L;
} else {
n = s.pop();
visit(n);
n = n... | ALGO | 0.999918 | 5.427303 |
f1582053-7f9d-496b-b3cb-3dd30cb9faa4 | ishandutta2007/codeforces | antoine/normal/1180/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define DBG(v) cerr << #v << " = " << (v) << endl;
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
int n;
cin >> n;
vector<int> a(n);
for (int &x : a) {
cin >> x;
if (x >= 0)
x = -x - 1;
}
if (n & 1) {... | ALGO | 0.99998 | 3.981071 |
fcf7e5dc-f59d-49f2-ae01-ed2e2f402c26 | SparshJain2000/mocks-tests | morgan stanley/test2/min-sum.cpp | /*
Sulekha loves playing with words. She has the habit of finding various combinations of letters and numbers that can be formed on seeing a word. During on of these times, she tried finding out the value of a particular word after removing some letters in it. And then she improvised it by finding the sum of squares of... | ALGO | 0.999944 | 5.472929 |
1469c2aa-1a79-4d21-9789-84e7fa5a7fb4 | PhamNhatTanCris/UDTT | OnTap/OnTap/De2.cpp | #include <bits/stdc++.h>
using namespace std;
struct Task{
string code;
float start;
float finish;
};
int schedule[6] = {0};
int a[6] = {0};
int n = 6, k = 5;
Task c[6] = {
{"CV01", 8, 8.5},
{"CV02", 9, 11},
{"CV03", 10, 11.5},
{"CV04", 11, 12.5},
{"CV05", 12, 13},
{"CV06", 13.5, 15},
};
float sum_of_time(i... | ALGO | 0.999266 | 3.373078 |
66663baa-e60f-482b-be45-834fe41b3d06 | almishra/metadirective | llvm/tools/llvm-nm/llvm-nm.cpp | #include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/Demangle/Demangle.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Object/Archive.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/COFFImportFile.h"
#include "llvm/Object/ELFObjectFile.h"
#include... | TOOL | 0.893517 | 5.504101 |
7e84a4a9-8a1b-4dfe-a80f-4b4f95b3deb7 | AyeshaHaidri/DSA | Array/Check if array is sorted.cpp | // check if the array is sorted or not
#include<bits/stdc++.h>
using namespace std;
int main()
{
int arr[] = {1,2,3,4,5,8,6};
int n=sizeof(arr)/sizeof(arr[0]);
int c = 0;
for(int i = 1; i < n; ++i)
{
if(arr[i] >= arr[i-1])
{
continue;
} else
c++;
break;
}
if(c == 0)
{
cout << "Array is sorted" << endl;
} el... | ALGO | 0.999826 | 5.037005 |
3267b545-fe1b-4e26-ac69-8843fd4e43b7 | GiovanniBussi/plumed-mingw | src/mapping/PathBase.cpp | #include "PathBase.h"
#include "tools/SwitchingFunction.h"
namespace PLMD {
namespace mapping {
void PathBase::registerKeywords( Keywords& keys ) {
Mapping::registerKeywords( keys );
keys.add("compulsory","LAMBDA","0","the value of the lambda parameter for paths");
keys.addFlag("NOZPATH",false,"do not calculate... | TOOL | 0.977092 | 6.125571 |
6ae23da0-9e4b-444f-8fb4-d46059718ffb | coding-net-cloud-studio/sf | codes/cpp/chapter_stack_and_queue/deque.cpp | /**
* File: deque.cpp
* Created Time: 2022-11-25
* Author: krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Driver Code */
int main() {
/* 初始化双向队列 */
deque<int> deque;
/* 元素入队 */
deque.push_back(2);
deque.push_back(5);
deque.push_back(4);
deque.push_front(3);
deque.push_fron... | TEST | 0.894964 | 5.815483 |
9495fec1-3b76-40ad-a759-759454a43480 | mishra-ji20/Leetcode | 1799-maximize-score-after-n-operations/1799-maximize-score-after-n-operations.cpp | class Solution {
public:
int backtrack(vector<int> &nums, vector<int> &vis,vector<int> &dp,int index,int k){
// for(int i=0;i<vis.size();i++)
// cout<<vis[i]<<" ";
// cout<<endl;
if(k>nums.size()/2)
return 0;
// cout<<(index)<<" ";
if(dp[index]!=-... | ALGO | 0.999936 | 5.080973 |
1e71fc6b-dbc1-458f-b6b2-3ae9d6e58ead | navytuner/basic-algorithm | 0x15-hash
/9375.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int T;
cin >> T;
while (T--){
int n;
unordered_map<string,int> table;
cin >> n;
for (int i = 0; i < n; i++){
string tmp, cloth;
cin >> tmp >> cloth... | ALGO | 0.999453 | 4.275813 |
0c109671-d249-4643-8038-ae7ba32dbcac | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J01344/sticks/sticks.cpp | #include <bits/stdc++.h>
using namespace std;
string ans1[15]={"-1","-1","1","7","4","2","6","8","10","18","22","20","28","68","88"};
string ans2[7]={"888","108","188","200","208","288","688"};
int main(){
freopen("sticks.in","r",stdin);
freopen("sticks.out","w",stdout);
int T;
cin >> T;
while (T--)... | ALGO | 0.99928 | 4.635337 |
529ba522-cc0f-486d-b0bc-c3134657b5f6 | alifalhasan/CP-code-vault | CodeChef/CDSP2021/SEPT204 - Rashid and Coding/51519645.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
template<typename temp>using ordered_set = tree<temp, null_type, less_equal<temp>, rb_tree_tag,tree_order_statistics_node_update
//order_of_key(k) : ... | ALGO | 0.999966 | 5.926882 |
f85da3ec-0ac2-4939-9cd3-a478865edd4f | subnr01/subs-practice | leet_code/graphs/hard/union_find/bricks_falling_hard.cpp | /*
We have a grid of 1s and 0s; the 1s in a cell represent bricks.
A brick will not drop if and only if it is directly connected to the top of the grid, or at
least one of its (4-way) adjacent bricks will not drop.
We will do some erasures sequentially. Each time we want to do the erasure at the location (i, j),
the... | ALGO | 0.999966 | 6.83622 |
75ff55f2-2c23-44af-8732-f9a70d668ac9 | Hiver93/BaekJoonOJ | 예전 정리/PrefixSum/PrefixSum_10986_RemainderSum/main.cpp | #include <iostream>
using namespace std;
long long check[1000]{ 0 };
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n, m;
long long temp, sum;
long long ans = 0;
cin >> n >> m;
cin >> sum;
check[sum % m]++;
for (int i = 1; i < n; i++)
{
... | ALGO | 0.9997 | 3.598322 |
9c16e52d-d06a-4a6b-b23b-4ebc8020e1f4 | revng/llvm-project | libcxx/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp | // UNSUPPORTED: c++03, c++11
// <vector>
// vector.bool
// template <class... Args> reference emplace_back(Args&&... args);
// return type is 'reference' in C++17; 'void' before
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
TEST_CONSTEXPR_CXX20 bool tests()
{
{
... | TEST | 0.898049 | 5.897774 |
b499f1cf-700d-4806-b9ea-10e430b2300b | bd878/cpp-coursera | white/palindrome.cpp | #include <string>
#include <algorithm>
#include <iterator>
#include <cstring>
#include <vector>
#include <iostream>
using namespace std;
// tutorial example
bool isPalindromeShort(string str) {
for (int i = 0; i < str.size() / 2; ++i) {
if (str[i] != str[str.size() - i - 1]) {
return false;
}
}
re... | ALGO | 0.975967 | 5.505542 |
86a5fbbe-6512-4ecc-83b5-22d007b71731 | eliteProgrammer-1/LeetCode | permutations_swap.cpp | class Solution
{
private:
vector<vector<int>> ans;
void help(vector<int> &arr, int index = 0)
{
if(index == arr.size())
{
ans.push_back(arr);
return;
}
for (int i = index; i < arr.size(); i++)
{
swap(arr[index], arr[i]);
... | ALGO | 0.999998 | 6.39968 |
0dbb3a4d-4bc3-4911-a23b-9edc8c85ee6d | Moeez-Rajpoot/C-Programs | Level 8 Tasks/TASK 3.cpp | #include<iostream>
using namespace std;
double max(double n1, double n2);
double min(double n1, double n2);
int main()
{
double num1,num2;
cout<<"ENTER 1st NUMBER = ";
cin>>num1;
cout<<"ENTER 2nd NUMBER = ";
cin>>num2;
cout<<"THE MAXIMUM NUM IS = "<<max(num1,num2)<<endl;
cout<<"THE MINIMUM NUM IS = "<<min(num1,n... | ALGO | 0.987461 | 3.445654 |
988e9d84-3c12-43e5-b5c7-fa106de3fe29 | vimarsh6739/CP | Ladder11/8.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to output.txt
freopen("output.txt", "w", stdout);
#endif
string s;
cin>>s;
if(s[0] >= ... | ALGO | 0.99786 | 3.591746 |
bc3bae1c-b46a-4229-a04c-5f7c74b51f4c | Matt-0301/leetcode-solution | 3623. Count Number of Trapezoids I
.cpp | class Solution {
public:
int countTrapezoids(vector<vector<int>>& points) {
std::unordered_map<int, long long> map;
long long res = 0, mod = 1000000007;
for(const auto& point: points){
++map[point[1]];
}
std::vector<int> toerase;
for(const auto& m... | ALGO | 0.999886 | 5.632693 |
873ba29c-195d-490c-8490-e6ba0def8d44 | reedeXx/cppml | ej1.cpp | //Suma de dos vectores
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
double b [3];
double a [3];
double c [3];
for (int i=0; i<=3; i=i+1 ){
printf("Introduce datos en el vector"); cin >> a[i];
}
for (int i=0; i<=3; i=i+1 ){
printf("Introduce datos en el vector"); cin >> ... | ALGO | 0.998772 | 3.421818 |
717b7d97-cee3-45fe-9968-a01fb5e81515 | esl000/CustomUE4VolumeRaymarching | Engine/Source/Runtime/Navmesh/Private/DetourCrowd/DetourProximityGrid.cpp | #include "DetourCrowd/DetourProximityGrid.h"
#include "Detour/DetourCommon.h"
#include "Detour/DetourAlloc.h"
#include "Detour/DetourAssert.h"
dtProximityGrid* dtAllocProximityGrid()
{
void* mem = dtAlloc(sizeof(dtProximityGrid), DT_ALLOC_PERM);
if (!mem) return 0;
return new(mem) dtProximityGrid;
}
void dtFreePro... | ALGO | 0.952525 | 6.977983 |
7f705ad4-992e-433c-b1f0-4832cbdbb646 | barbarabizinoto/linguagem-c-plus-plus | EXERC02I.CPP | #include <iostream>
#include <iomanip>
using namespace std;
int main(void)
{
float P, D, R;
cout << setprecision(2);
cout << setiosflags(ios::fixed);
cout << setiosflags(ios::right);
cout << "Insira o valor do raio da esfera ....: "; cin >> R;
cout << "Insira o valor da densidade da esfera: "... | TOOL | 0.988405 | 3.28015 |
91a71bcb-8dec-42bf-bdd5-a57a871f496c | saquibjawedbit/cp | A_Directional_Increase.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll tc = 1; cin >> tc;
for(ll t = 1; t <= tc; t++) {
ll n; cin >> n;
vector<ll> arr(n);
for(auto &v: arr) cin >> v;
ll sum = 0;
ll index = 0;
for(auto &v: arr) {
sum +=... | ALGO | 0.999925 | 4.332792 |
7d905358-c56f-45e2-b6ce-84a466893d1f | realamanvats/cpp | 2D_ArrayPart2/multiplication.cpp | //multiplication of array
#include<iostream>
using namespace std;
int main(){
int m;
cout<<"Enter rows of first matrix ";
cin>>m;
int n;
cout<<"Enter columns of first matrix ";
cin>>n;
int p;
cout<<"Enter rows of second matrix ";
cin>>p;
int q;
cout<<"Enter columns of second matrix ";
... | ALGO | 0.99937 | 3.239343 |
b55e97be-c8a2-407d-97b9-17b258a5b36a | sourcegraph/lsif-clang | libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter>
// requires ShuffleIterator<Iter>
// && LessThanComparable<Iter::value_type>
// void
// push_heap(Iter first, Iter last);
#include <algorithm>
#include <functional>
#include <random>
#include <cassert>
#include <memory>
#include "test_macros.h"
#inc... | TEST | 0.923392 | 5.443487 |
3ac5ea93-cfc9-4c27-95be-f6ad179414a6 | jorangi/Study | Project1/11651.cpp | //#include <iostream>
//#include <vector>
//#include <algorithm>
//using namespace std;
//bool compare(const pair<int, int>& a, const pair<int, int>& b)
//{
// if (a.second != b.second)
// return a.second < b.second;
// else
// return a.first < b.first;
//}
//int main(void)
//{
// int n;
// cin >> n;
// vector<pair<i... | ALGO | 0.999842 | 4.641449 |
fddb4f35-3ee1-4dee-9d5a-e6b727e9fbd2 | tvm-contest/devex | proposal-18/submission-18/devex-18-zk-contest/02_euler/cpp/main.cpp | #define PROVING_KEY_FILE "provkey.bin"
#define VERIFICATION_KEY_FILE "verifkey.bin"
#define BIG_PROOF_FILE "big_proof.bin"
#define PROOF_FILE "proof.bin"
#define PRIMARY_INPUT_FILE "primary_input.bin"
#include <iostream>
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include "detail/r1cs_examp... | ALGO | 0.987122 | 5.524998 |
4e21187c-96e6-4473-89b3-7c22e6d26996 | techcoincommunity/firecoin | src/addrman.cpp | #include "addrman.h"
using namespace std;
int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const
{
CDataStream ss1(SER_GETHASH, 0);
std::vector<unsigned char> vchKey = GetKey();
ss1 << nKey << vchKey;
uint64_t hash1 = Hash(ss1.begin(), ss1.end()).Get64();
CDataStream ss2(SER_... | ALGO | 0.964511 | 6.04855 |
74ab6490-9037-4a35-931c-09af74a159d7 | Muakjwa/Depth_Foveated_Compression | opencv_contrib-4.x/modules/tracking/src/kuhn_munkres.cpp | #include "precomp.hpp"
#include "kuhn_munkres.hpp"
#include <algorithm>
#include <limits>
#include <vector>
namespace cv {
namespace detail {
inline namespace tracking {
KuhnMunkres::KuhnMunkres() : n_() {}
std::vector<size_t> KuhnMunkres::Solve(const cv::Mat& dissimilarity_matrix) {
CV_Assert(dissimilarity_mat... | ALGO | 0.999972 | 6.419296 |
8252a9a7-68bb-4bfb-b872-de798784f57a | Pettecco/cses-problem-set | Sorting-and-Searching/factoryMachines.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0); cin.tie(0);
typedef long long ll;
const int MAXV = 2*(1e5) + 10;
ll machines[MAXV];
int n, t;
bool bs (ll mid, int t) {
ll sum = 0;
for (int i = 0; i < n; i++) {
sum += (mid / machines[i]);
if(sum >= t) ret... | ALGO | 0.999978 | 5.63489 |
d949c84b-1d20-4e60-acaf-b7c4ec7a6d0f | soonsoo3595/To_Win_Code_Test | 2910.cpp | #include <bits/stdc++.h>
using namespace std;
int N, C;
vector<int> v;
priority_queue<int> pq;
// 1. ڰ C ۰ų
// 2. ϴ Ƚ տ
int main()
{
cin >> N >> C;
for (int i = 0; i < N; i++)
{
int input;
cin >> input;
v.push_back(input);
}
return 0;
}
| ALGO | 0.999963 | 3.615303 |
0ca48422-2483-4a31-8121-9aa72b60e311 | xi-guo-0/leetcode-solutions | cpp/0446-arithmetic-slices-ii-subsequence.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
class Solution {
public:
int numberOfArithmeticSlices(vector<int> &nums) {
int n = nums.size();
int count = 0;
vector<unordered_map<long long, int>> dp(n);
for (int i = 0; i < n; ++i) {
for (int j = 0; j < i; ... | ALGO | 0.999265 | 5.972816 |
36a61fcb-2e76-4caa-bb24-ed663485a10e | rahulkamble2026rk/Leetcode | 2509-minimize-xor/2509-minimize-xor.cpp | // class Solution {
// public:
// int minimizeXor(int num1, int num2)
// {
// int xorresult = INT_MAX;
// int ans = 0;
// int count2 = __builtin_popcount(num2);
// for (int i = 0; i < (1 << 20); i++)
// {
// if (__builtin_popcount(i) == count2)
// ... | ALGO | 0.999919 | 5.730875 |
52caed2a-41c7-42d0-8a9d-f9d93e22bb8c | miaomiaocoder/CodePractice | .leetcode/69.x-的平方根.cpp | /*
* @lc app=leetcode.cn id=69 lang=cpp
*
* [69] x 的平方根
*/
// @lc code=start
class Solution {
public:
int mySqrt(int x) {
int l = 0, r = x;
while (l < r) {
int mid = l + 1ll + r >> 1;
if (mid <= x / mid)
l = mid;
else
r = mi... | ALGO | 0.999772 | 5.61104 |
b05f1fc7-770b-4670-8af3-db1cedc05d07 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_5685_12.cpp | #include <bits/stdc++.h>
using namespace std;
int ans[1000000][4];
int len[1000000];
int C;
int cnt[300][300];
void add3(int a, int b, int c) {
cnt[a][b]++, cnt[b][a]++, cnt[a][c]++, cnt[c][a]++, cnt[b][c]++, cnt[c][b]++;
ans[C][0] = a;
ans[C][1] = b;
ans[C][2] = c;
len[C] = 3;
C++;
}
void add4(int a, int b... | ALGO | 0.999818 | 3.954145 |
d7827dc1-7bd1-4a4b-93a6-3b1147810eef | neeraj-bhoi/CPP | modern_cpp/week3/day12/threads/sample3.cpp | /*
objective :
Design a consumer for :
- make allocations on heap for 10 integers.
- save square of first 10 integers on the heap storage created.
- calculating sum of first N natural numbers, where N is accepted assynchronously in the function and return the value
... | TOOL | 0.970135 | 4.78378 |
8cddc3a0-a805-424a-9bc1-a919cce6945a | sarvex/leetcode-chef | solution/2300-2399/2303.Calculate Amount Paid in Taxes/Solution.cpp | class Solution {
public:
double calculateTax(vector<vector<int>>& brackets, int income) {
int ans = 0, prev = 0;
for (auto& e : brackets) {
int upper = e[0], percent = e[1];
ans += max(0, min(income, upper) - prev) * percent;
prev = upper;
}
return... | ALGO | 0.999846 | 5.910436 |
b9c8ed8a-e4ec-4505-83f4-c9fd5cc285d7 | meSAHAD/ErfanSirCode | 4th Semester/Assignment7March/10783_Odd_Sum.cpp | #include <stdio.h>
int main()
{
int t, i = 1;
scanf("%d", &t);
while (t--)
{
int a, b;
scanf("%d %d", &a, &b);
long long sum = 0;
int j;
for ( j = a; j <= b; j++)
{
if (j % 2 != 0)
sum += j;
}
printf("Case %d: %... | ALGO | 0.99958 | 3.976119 |
ee9a10fd-3ffb-4e1b-b14d-212cde177a34 | rylahs/Study_Previous | CPP,CodingTest/Baaarking/0x10/PS/11726.cpp | // 0x10. 다이나믹 프로그래밍
// Written by : Rylah
// Date : 2022.02.13
// 11726. 2xn 타일링
// https://www.acmicpc.net/problem/11726
// https://www.acmicpc.net/source/38983410
#include <bits/stdc++.h>
using namespace std;
int dp[1003];
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
dp[... | ALGO | 0.999985 | 5.136696 |
624abdce-b847-4e73-8850-afedc455b906 | ferry-hhh/CXL-DMSim | src/systemc/tests/systemc/misc/cae_test/general/arith/divide/divide/divide.cpp | /*****************************************************************************
divide.cpp --
Original Author: Rocco Jonack, Synopsys, Inc., 1999-05-13
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.997243 | 4.037971 |
dead8480-186f-43e0-b635-ab9513fc90e9 | mzytnicki/msscaf | src/helper.cpp | #include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <unordered_map>
#include <Rcpp.h>
#include "sharedFunctions.h"
// [[Rcpp::plugins(openmp)]]
// [[Rcpp::plugins(cpp11)]]
using namespace Rcpp;
// [[Rcpp::export]]
void splitChromosomeCpp (DataFrame &data, int prevRef, int newRef, int ... | DATA | 0.95212 | 6.108295 |
6dbd00c4-8749-43fb-8a99-4e22e284199d | Gprakash8/CSA1486-Compiler-Design | Descent Parsing (10).cpp | #include <stdio.h>
#include <ctype.h>
char *input;
char token;
// Function prototypes
void E();
void T();
void F();
void advance();
void error(const char *message);
void advance() {
token = *input++;
}
void error(const char *message) {
printf("Error: %s\n", message);
exit(1);
}
// E -> T | E + T
void E... | ALGO | 0.999229 | 5.519443 |
9bb5712d-6632-4f63-bd55-6023afe60e19 | zackkk/Cracking-the-Coding-Interview | Chapter 3_Stacks and Queues/Sort Stack.cpp | #include<iostream>
#include<stack>
using namespace std;
class solution_3_6{
public:
// kind of insertion sort
stack<int> sortStack(stack<int> unsorted){
stack<int> sorted;
while(!unsorted.empty()){
int tmp = unsorted.top();
unsorted.pop();
while(!sorted.empty() && tmp > sorted.top()){
unsorted.push... | ALGO | 0.999984 | 5.102711 |
9f7edb54-e3d3-4443-8999-26970fca19f6 | ishandutta2007/codeforces | a.k.e.e/normal/1375/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define x first
#define y second
typedef pair<int,int> pii;
typedef long long ll;
typedef unsigned long long ull;
template <typename T> void chkmax(T &x,T y){x<y?x=y:T();}
template <typename T> void chkmin(T &x,T y){x>y?x=y:T();}
te... | ALGO | 0.999359 | 4.015826 |
0705ab2a-8856-44b0-bdeb-7f321878e44b | AndroidOpenDevelopment/android_frameworks_av | media/libstagefright/codecs/amrwb/src/synthesis_amr_wb.cpp | /*
------------------------------------------------------------------------------
Filename: synthesis_amr_wb.cpp
Date: 05/04/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
--------------------------------------------------------------------... | ALGO | 0.999688 | 3.877183 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.