uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3a012f69-1da8-44e9-a5b5-3740aba44b65 | ArturMSS/IDP | 2025.1/TAA/LEA_04/organizacao/copaIDP.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int qtd_F , qtd_P;
cin >> qtd_F >> qtd_P;
map<string, set<string>> aluno;
while (qtd_F--){
string nome, op1, op2, op3;
cin >> nome >> op1 >> op2 >> op3;
aluno[no... | ALGO | 0.996572 | 4.436043 |
429967ae-cac3-4748-bb8c-734242395313 | aryan-0069/CPP_basics | c++/linkedlist/deletionattail.cpp | #include <bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node* next;
Node(int data){
val = data;
next = NULL;
}
};
void InsertionatheadLL(Node* &head, int val){
Node* new_node = new Node(val);
new_node->next=head;
head = new_node;
}
void DisplayLL(No... | ALGO | 0.999268 | 4.965352 |
4a65b43d-b5d7-4384-a596-4993110aace2 | luoxn28/algorithm_data_structure | search/rbtree_test.cpp | #include <iostream>
#include "rbtree.h"
using namespace std;
int main(void)
{
Rbtree tree;
tree.insert(200);
tree.insert(1);
tree.insert(12);
tree.insert(10);
tree.insert(23);
tree.insert(14);
tree.insert(39);
tree.insert(59);
tree.insert(69);
tree.insert(30);
tree.insert(25);
cout << "size: " <<... | ALGO | 0.977616 | 4.806736 |
293304bc-c159-4124-8665-798d53aad9ca | maahirai/atcoder_solver | abc080/c_re1.cpp | #include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>
#include<limits>
#include<bitset>
#include<functional>
#include<type_traits>
#include<queue>
#include<stack>
#include<array>
#include<random>
#include<utility>
#include<cstdlib>
#include<ctime>
using... | ALGO | 0.999514 | 3.040022 |
a032cdac-0881-4306-ab45-075a3d9e6d8b | op07n/qt_4_8_7_win | src/3rdparty/md4/md4.cpp | /*
* MD4 (RFC-1320) message digest.
* Modified from MD5 code by Andrey Panin <<EMAIL>>
*
* Written by Solar Designer <<EMAIL>> in 2001, and placed in
* the public domain. There's absolutely no warranty.
*
* This differs from Colin Plumb's older public domain implementation in
* that no 32-bit integer data type... | ALGO | 0.999339 | 6.953258 |
d30b00cd-f436-4cd6-bd0f-e29cdba45f2d | wotsushi/competitive-programming | abc/007/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define OUT(x) cout << (x) << endl;
#define OUTA(a, n) \
REP(i, n) { cout << (a[i]) << (i == n - 1 ? "\n" : " "); }
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL... | ALGO | 0.999734 | 3.446212 |
1926360f-2e71-40ce-8211-7071360d10a5 | phitronio/XPSC_Batch_02 | Class 13 - MST/D_Roads_not_only_in_Berland.cpp | // link - https://codeforces.com/contest/25/problem/D
#include <bits/stdc++.h>
#define pi pair<int, int>
using namespace std;
const int N = 1e5 + 5;
int par[N];
int parentLevel[N];
void dsu_set(int n)
{
for (int i = 0; i <= n; i++)
{
par[i] = -1;
parentLevel[i] = 0;
}
}
int dsu_find(int n)
{... | ALGO | 0.999609 | 3.814786 |
23922656-70ba-4cac-8925-57d6664525e9 | snmath-pi/DataStructures | GraphsII/G47KrushkalsAlgorithmDSU.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
class DSU {
public:
vector<int> size, p;
DSU(int n) {
size.resize(n + 1, 1);
p.resize(n + 1);
for(int i=0; i<=n; i++) p[i] = i;
... | ALGO | 0.999992 | 5.955698 |
84941d53-627e-4381-99b6-48c784522b1a | saikrishnamamidi2003/Leetcode | 448-find-all-numbers-disappeared-in-an-array/find-all-numbers-disappeared-in-an-array.cpp | class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& nums) {
vector<int> ar(nums.size()+1, 0);
for(int i=0; i<nums.size(); i++){
ar[nums[i]]++;
}
vector<int> res;
for(int i=1; i<nums.size()+1; i++){
if(ar[i] == 0){
res.push_back(i);
}
... | ALGO | 0.999428 | 5.040126 |
7736b4c4-755b-45b3-975c-0b955382ff1d | ravitejamadala5/Finoramic-Interviewbit | Sumrootoleafpath.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
int check(TreeNode* root, int sum, vector<vector<int> > &v, vector<int> p){
if(root == NULL)
return 0 ;
else if(ro... | ALGO | 0.999968 | 5.392452 |
c2c789cb-fe3d-47a4-8d62-c391273ee9c1 | Mehulcoder/Codeforces | Random_Problems/1197C.cpp | /*
Name: Mehul Chaturvedi
IIT-Guwahati
*/
/*
Talent is Overrated
*/
#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;
template <typename T>
using ordered_set = tree<T, null_type, les... | ALGO | 0.999923 | 4.034626 |
246f28ef-bf3e-4ee4-9e97-2006027cb12b | SaniyaParveenCode/My-Code | 0733-flood-fill/0733-flood-fill.cpp | class Solution {
public:
bool isValid(vector<vector<int>>& image,int i , int j, int n , int m ,int color) {
if(i>= 0&& i<n && j>=0 && j<m && image[i][j] == color)
return true;
return false;
}
void floodFillRec(vector<vector<int>>& image, int i , int j , int n , int m ,int color, int newColor) {
... | ALGO | 0.997951 | 6.617494 |
ce0b5fd0-0a3c-4f2d-a15b-8d317b58dd26 | achenfengb/PRINCESS_opensource | ThirdParty/cryptopp562/square.cpp | // square.cpp - written and placed in the public domain by Wei Dai
// Based on Paulo S.L.M. Barreto's public domain implementation
#include "pch.h"
#include "square.h"
#include "misc.h"
#include "gf256.h"
NAMESPACE_BEGIN(CryptoPP)
// apply theta to a roundkey
static void SquareTransform (word32 in[4], word32 out[4])... | ALGO | 0.999883 | 7.150234 |
a2a2bcca-b1a6-48d0-99c6-33eca2eeac59 | WojciechKonior/CodilitySolutions | cpp/BinaryGap.cpp | int solution(int N) {
int mask = 1;
int maxgap = 0;
int tmpgap = -1;
for(int i = 1; i<33; i++)
{
if(mask & N)
{
maxgap = max(maxgap, tmpgap);
tmpgap = 0;
}
else if(tmpgap!=-1)
{
tmpgap++;
}
mask <<= 1;
... | ALGO | 0.999778 | 4.224658 |
19fba668-829c-4732-96c5-1acd6c3e2517 | mejibyte/brazil_problems | during_the_camp/08-02/bricks/bricks.cpp | using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
... | ALGO | 0.99986 | 4.393113 |
bd540a57-1532-419a-8361-5df2bde1273d | dvtkachenko/microprocessor_emulator | ITEMS.LIB/and/TAnd.cpp | # include "TAnd.hpp"
# include <vcl\dstring.h>
# include "..\..\service\service.h"
# include <stdlib.h>
# include <alloc.h>
// Нумерация выводов ЛЭ "И" следующая:
// - сначала нумеруются все I - входы; I0,I1,I2,I3 (1 ... 4)
// - далее Y - выход ; Y (5)
// Такая нумерация необходима для лин... | TOOL | 0.953259 | 3.316481 |
0bc187af-4dfe-4cf8-a88f-05472ebf6a42 | merelydust/PAT-Advanced-Level | 北大程序设计与算法专项课程/算法基础/广搜_迷宫问题.cpp | #include <cstdio>
#include <queue>
#include <vector>
using namespace std;
struct node {
int x, y, data;
node* pre;
node() {
pre = NULL;
}
}matrix[5][5];
int inq[5][5] = {0};
int ans = 50; vector<node> path;
int X[4] = {1, -1, 0, 0};
int Y[4] = {0, 0, 1, -1};
bool judge(int x, int y) {
if ... | ALGO | 0.999903 | 3.157412 |
30833d7f-b02e-486f-ae0b-c7c2762bb44d | holystar97/OOP-Basic | chap12/wordgame/main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
void echo(vector<string>& v) {
int n = v.size();
for (int i = 0; i < n; i++) {
string s = v[i];
cout << s << endl;
}
}
void search(vector<string>& v, string word) {
int n = v.size();
for (int i = 0; i < n; i++) {... | TOOL | 0.922205 | 4.085303 |
2935df03-4d12-4e52-beb6-75c946bc9818 | manikanta2901/ubuntu | .history/practice/cpp/Codechef/PrimeTuples_20210130181253.cpp | #include <bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define trav(dataType,DataStruct,name) for(dataType<DataStruct>::itt ip = name.bb(); ip != name.ee(); ip++)
//Pre processors & typedefs
... | ALGO | 0.999812 | 4.165909 |
d68e8189-95be-48e5-9c24-b4e1414a1674 | YashSampat23154/A20J-Ladders | Codeforces rating < 1300/72. B. Big Segment.cpp | // #pragma GCC optimize("Ofast", "unroll-loops")
// #pragma GCC target("avx2", "tune=native")
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define what(x) cerr << #x << " is " << x << endl;
#define vi vector<int>
#define vll vector<long long>
#define endl "\n... | ALGO | 0.999912 | 4.504469 |
a9ba19e4-8f34-475d-853f-0eae4fc37515 | Mr-Priyadarshi/C-Training | Wipro C++/PBL/Pointers/pointer4.cpp | #include<iostream>
using namespace std;
char *my_strstr(const char *s1, const char *s2)
{
int i,j,c=0,c1=0,f=0;
while(s1[c]!='\0')
c++;
while(s2[c1]!='\0')
c1++;
for(i=0; i<=c-c1; i++)
{
for(j=i;j<i+c1;j++)
{
f=1;
if(s1[j]!=s2[j-i])
{
f=0;
break;
}
}
if(f==1)
break;
}
if(f==... | ALGO | 0.998205 | 3.319301 |
60ade011-64c8-461c-b677-06a918e401fb | Slava/competitiveProgramming | timus/timus_1260.cpp | #include <cstdio>
int a[60] = {0, 1, 1}, n;
int main (){
scanf("%d", &n);
for (int i = 3; i <= n; i++)
a[i] = a[i - 1] + a[i - 3] + 1;
printf("%d\n", a[n]);
return 0;
}
| ALGO | 0.999843 | 3.322412 |
d829d3b5-000c-4ac8-abd2-1c8f393877e6 | wookim0719/codingTest-practices | study/15654.cpp | #include<bits/stdc++.h>
using namespace std;
int n,m;
vector<int> v;
vector<int> a;
int visited[9];
void go(int cnt){
if(v.size()==m){
for(int i=0; i<m; i++){
cout<<v[i]<<" ";
}
cout<<"\n";
return;
}
for(int i=0; i<n; i++){
if(!visited[i]){
visited[i]=1;
v.push_back(a[i]);
go(cnt+1);
v.pop_... | ALGO | 0.999965 | 3.559305 |
1b566327-a9d6-4085-9c09-ac8ff096bdc2 | KomiMoe/Arkari | libc/src/math/generic/log10f.cpp | #include "src/math/log10f.h"
#include "common_constants.h" // Lookup table for (1/f)
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FMA.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/PolyEval.h"
#include "src/__support/FPUtil/except_value_utils.h"
#include "src/__s... | ALGO | 0.995446 | 6.97206 |
661c33b4-d493-4fd3-a37a-473fabe5ff11 | HYOUNJUNROH/Brachytherapy_qa_1_1_0 | Brachytherapy_qa/opencv2/sources/modules/core/src/lpsolver.cpp | #include "precomp.hpp"
#include <climits>
#include <algorithm>
#define dprintf(x)
#define print_matrix(x)
namespace cv
{
using std::vector;
#ifdef ALEX_DEBUG
static void print_simplex_state(const Mat& c,const Mat& b,double v,const std::vector<int> N,const std::vector<int> B){
printf("\tprint simplex state\n");
... | ALGO | 0.999945 | 5.854489 |
a34c4855-3d1f-41ef-bf65-6684f5da1344 | 1tygoime/a | codefun/P359.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
int mi = min(min(a, b), c), ma = max(max(a, b), c), temp = a + b + c;
a = mi;
c = ma;
b = temp - a - c;
if (a + b > c)
cout << "NONDEGENERATE";
else if (a + b == c)
cout << "DEGEN... | ALGO | 0.999963 | 4.311666 |
59eb294c-39f9-404d-9980-7b07ffc8c70d | ishandutta2007/codeforces | nots0fast/normal/1544/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp(a,b) make_pair(a,b)
#define ff first
#define setp setprecision
#define ss second
#define fori(v) for(ll i=0; i<v; i++)
#define forj(v) for(ll j=0; j<v; j++)
#define fork(v) for(ll k=0; k<v; k++)
#define forl(v) for(ll l=0; l<v; l++)
#define fort(v) for(ll t=0; t<... | ALGO | 0.999882 | 4.064232 |
1b8f2cc6-02bf-493b-b428-da0e5fd45d74 | n0IQ/Data-Structures-and-Algorithms | Backtracking/N Queen Problem.cpp | #include <bits/stdc++.h>
using namespace std;
#define mem0(a) memset(a, 0, sizeof(a))
#define fastio ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
int n;
int board[15][15];
void Print()
{
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cout << board[i][j] << " ";
... | ALGO | 0.999633 | 5.698883 |
22017d79-e88f-49a6-8fcd-c27cc15213d7 | koba-e964/contest | atcoder/abc075/c.cpp | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <str... | ALGO | 0.999832 | 4.283087 |
e11cb369-81b5-4a06-afef-8a4e8b07e809 | ishandutta2007/codeforces | pikel_rik/normal/467/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int p, q, c = 0;
for (int i = 0; i < n; i++) {
cin >> p >> q;
if (q - p >= 2)
c += 1;
}
cout << c;
} | ALGO | 0.99981 | 3.992321 |
cf0a1145-99b9-4d2f-8cd6-83aaac5884ee | JRgit03/Algorithm | atcoder/abc/323/E_Playlist.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 1e4 + 10 , Mod = 998244353;
int n,x;
int t[N];
int dp[N]; // dp[i]表示歌曲在第i秒播放的概率 (不一定是第一首歌)
int fastpow(int a,int b){
int res = 1;
while(b){
if(b&1) res = 1LL * res * a % Mod;
b >>= 1;
a = 1LL * a * a % Mod... | ALGO | 0.999991 | 4.951258 |
6c284c59-59a2-47c3-8198-1e23903ce824 | dimmkan/MSHP | contr3/contr3-5/contr3-5/main.cpp | #include <iostream>
using namespace std;
int find_min(int data[100], int n) {
int min = data[0];
for (int i = 1; i < n; ++i)
if (data[i] < min)
min = data[i];
return min;
}
int find_max(int data[100], int n) {
int max = data[0];
for (int i = 1; i < n; ++i)
if (data[i] > m... | ALGO | 0.999976 | 4.387362 |
b7a95d90-5593-40eb-86a3-87b04f5dc252 | Aditya3425-Fst/NewChapterDsa | Array/linearsearch.cpp | #include <iostream>
using namespace std;
int linearSeach(int arr[] , int sz,int target){
for(int i =0;i<sz;i++){
if(arr[i] == target){
return i;
}
}
return -1;
}
int main(){
int arr[] = {1,2,4,78,80};
int sz = 5;
int target = 89;
int index = linearSeach(ar... | ALGO | 0.999577 | 4.495231 |
322b698b-f4cc-49d6-91c0-6ef0fd2b6526 | J-Larose/SchoolWork | Comp 1406B/tut/tut1q2/main.cpp | #include <iostream>
bool validIsbn(char digits[])
{
int weighted [10];
for(int x=0; x<9; x++){
weighted[x] = (int(digits[x]));
}
if(digits[9]=='x'){
weighted[9]=10;
}
else{
weighted[9] = (int(digits[9]));
}
int total=0;
int weight = 10;
for(int x=0; x<1... | ALGO | 0.996281 | 4.047619 |
212a8058-9604-4534-90fc-2c70f6d8e407 | Perchik71/Creation-Kit-Platform-Extended | CKPE/Src/CKPE.StringUtils.cpp | #include <windows.h>
#include <limits.h>
#include <cstdio>
#include <cstdlib>
#include <memory>
#include <CKPE.StringUtils.h>
#include "Impl/utfcpp/utf8.h"
#include "Impl/utf8.h"
//#define UNICODE_USES_WINDOWS
namespace CKPE
{
bool StringUtils::IsASCII(const std::string& src) noexcept(true)
{
for (std::size_t i =... | TOOL | 0.868951 | 5.349092 |
28437ab9-e7ef-40aa-903a-c217fce46231 | Rehyanyadav/main | DataStructures/recursion/factorial.cpp | #include<iostream>
using namespace std;
int factorial (int n ){
if (n ==0){
return 1;
}
int smalloutput = factorial (n-1);
int output = n*(smalloutput);
return output;
}
int main()
{
cout<<factorial(4);
return 0;
} | ALGO | 0.999725 | 4.174314 |
12f0628b-1869-4ef7-8502-ec048424b73e | v21k93/PVPCore | src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp | /* ScriptData
SDName: Boss_Thekal
SD%Complete: 95
SDComment: Almost finished.
SDCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
enum Says
{
SAY_AGGRO = 0,
SAY_DEATH = 1
};
enum Spells
{
SPELL_MORTALCLEAVE ... | TOOL | 0.939193 | 6.706428 |
f6887a44-6b77-4899-8e2d-9f59acf77ae4 | ralepop/CLI-projekat | Funkc/command.cpp | #include "command.h"
#include "commandFactory.h"
bool Command::checkIfFile(std::string &line, const std::string& filetype){
// Ako je duzina stringa 'line' manja od minimalne potrebne duzine vraca false
if(line.size() < filetype.size() + 1) return false;
// Trazi znak '<', ako ga nadje uklanja ga i brise... | TOOL | 0.884935 | 4.638146 |
3a2ce3eb-083c-4018-8273-53e3c84a4f40 | AkshatSharma1/DSA | Stack/Stack qs/NGR.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<stack>
using namespace std;
vector<int> findNGR(vector<int> arr){
//make a vector and a stack
vector<int> v;
stack<int> s;
//traverse arr in R->L
for(int i=arr.size()-1;i>=0;i--){
//Conditions
//1.if stack size is ... | ALGO | 0.999998 | 5.455285 |
67f7bcd3-13cf-49f1-84e7-932716d92c38 | Vivashwan/LeetCodeSubmits | 0098-validate-binary-search-tree/0098-validate-binary-search-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.999961 | 6.881411 |
bc6975d3-da6a-4682-84d8-c4ee545d9e6e | sinian666/codes_41_19 | cpp_副本6/chapter_backtracking/preorder_traversal_iii_template.cpp | /**
* File: preorder_traversal_iii_template.cpp
* Created Time: 2023-04-16
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 判断当前状态是否为解 */
bool isSolution(vector<TreeNode *> &state) {
return !state.empty() && state.back()->val == 7;
}
/* 记录解 */
void recordSolution(vector<TreeNode *> &state, ve... | ALGO | 0.999956 | 5.798366 |
825325f1-979e-4c52-b533-300d5409b5a6 | HansSunY/SysYFCodeGenOpt | BZ_Backend_Student/src/pass/CFG_simply.cpp | #include "pass/CFG_simply.h"
#include "pass/loop_search.h"
void CFG_simply::run() {
for (auto fun : m_->get_functions())
{
func_ = fun;
if(func_->is_declaration())
continue;
rebuildCFG();
changed = true;
while(changed) {
changed = false;
... | ALGO | 0.996496 | 3.838845 |
7a632249-a548-41c9-bd10-c63ac85d280f | cucapra/gem5-mesh | src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_signed/bits_to_bits/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.966945 | 5.590904 |
e9fe52c8-467f-44d7-b0ba-6206296eae8f | ishandutta2007/codeforces-s | sexpert/normal/1100/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> v(n);
for(int i = 0; i < n; i++)
cin >> v[i];
int mx = -1, sum = accumulate(v.begin(), v.end(), 0);
for(int b = 0; b < k; b++) {
int a... | ALGO | 0.999964 | 4.054192 |
c0cfca7e-46fe-4327-a512-d598ea6715db | ishandutta2007/codeforces | dorost/normal/1372/B.cpp | /* * In the name of GOD
* Thanks God */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
int32_t main(){
int t = 1;
cin >> t;
while (t--){
int n;
cin >> n;
int an1 = -1;
for (int i = 1; i * i <= n; i++){
if (n % i == 0){
... | ALGO | 0.999874 | 4.603088 |
fddc1c80-e53d-4402-9280-4ed281e5aaef | alvinnardo/licode | leetcode/3097.cpp | #include "../template/head.h"
#include <bits/stdc++.h>
int minimumSubarrayLength(vector<int> nums, int k) {
// 思路: 双指针 + 统计
/* 之前有一道题是关于与的,当时看错题了,
认为是求子数组了,当时想了很久,没有想到如何处理去掉数字的位
今天这道题,想到了可以用统计每一位的个数来求,删除数字可以删除该数的每一位
*/
// 时间 O(kn),空间 O(k),k 为 32
// 优化一个空间
vector<int> nvv(32);
... | ALGO | 0.999938 | 5.242777 |
5241fe98-528c-4ddd-9397-31694e3128c3 | dkpark10/Algorithm | Beak__13702이상한술집.cpp | /*
프로그래밍 대회 전날, 은상과 친구들은 이상한 술집에 모였다.
이 술집에서 막걸리를 시키면 주전자의 용량은 똑같았으나 안에 들어 있는 막걸리 용량은 랜덤이다.
즉 한 번 주문에 막걸리 용량이 802ml 이기도 1002ml가 나오기도 한다.
은상은 막걸리 N 주전자를 주문하고, 자신을 포함한 친구들 K명에게 막걸리를 똑같은 양으로 나눠주려고 한다.
그런데 은상과 친구들은 다른 주전자의 막걸리가 섞이는 것이 싫어서, 분배 후 주전자에 막걸리가
조금 남아 있다면 그냥 막걸리를 버리기로 한다.
(즉, 한 번 주문한 막걸리에 남은 것을 모아서 친구들에게 다시 주는 경우는... | ALGO | 0.999945 | 4.423864 |
579b9a07-aefd-4abc-b9ac-7e1a427749a1 | sayedmoataz/Algoriza-Internship-Tasks | Task-1/task_1/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.99846 | 6.785645 |
ad17e8ff-1aa6-4032-b013-314286042d49 | YuvrajSingh3110/cpp-and-golang-practice | C++/Binary Tree/Intro.cpp | #include <iostream>
#include <queue>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
node(int d)
{
this->data = d;
this->left = NULL;
this->right = NULL;
}
};
node *buildTree(node *root)
{
cout << "Enter data " << endl;
int d;
c... | ALGO | 0.999949 | 4.920963 |
65cdc57a-a1e3-4966-b7f8-1f2400f0e9ac | wassimalharaki/Codeforces | 800/DigitsSum.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long
#define all(v) v.begin(), v.end()
#define nl << '\n'
#define v vector
#define vi vector<int>
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define INF LONG_LONG... | ALGO | 0.999636 | 4.820878 |
ae019fef-f068-486e-875f-4ade138b3a06 | shanwazshaik/Design-analysis-and-algorithm1- | daa 16.cpp | #include <stdio.h>
void merge(int arr[], int left, int mid, int right) {
int n1 = mid - left + 1;
int n2 = right - mid;
int L[n1], R[n2];
for (int i = 0; i < n1; i++)
L[i] = arr[left + i];
for (int j = 0; j < n2; j++)
R[j] = arr[mid + 1 + j];
int i = 0, j = 0, k = left;
... | ALGO | 0.999942 | 5.255138 |
534a79a3-0f0d-40bb-a1a5-70612830f3f2 | raincross7/code-similarity | codes/train_code/problem032/problem032_50.cpp | #include "bits/stdc++.h"
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++)
#define REP(i,n) for(int i = 0;i < (n) ; i++)
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/2
usin... | ALGO | 0.999951 | 4.168982 |
c446b86a-4449-4000-a89a-532ff6ac8e5b | rsotani/AtCoder | GrandContest/020-029/028/A.cpp | #include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y){
if (x<y) gcd(y,x);
else if (y==0) return x;
else gcd(y,x%y);
}
int main(){
long long N, M;
cin >> N >> M;
string S, T;
cin >> S >> T;
long long check = gcd(N, M);
long long L = N*M/check;
long long i=0, j=0;
w... | ALGO | 0.999985 | 4.150115 |
e65d472b-4c83-4959-a1d5-d93eaa2ff1d0 | Saviour1001/C--_Codes | cookoff1.cpp | #include<bits/stdc++.h>
using namespace::std;
#define ll long long
#define endl "\n";
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int t;
cin>>t;
int n;
while(t--)
{
cin>>n;
string arr;
cin>>arr;
int count=0;
for(int i=0;i<n;i++)
... | ALGO | 0.999597 | 4.299823 |
cc934d65-c89f-4024-b86d-db1b6ebb0e3e | skotish06/Cplusplus-Repository | oj/chtoj/tk5_22022025/TRIANGLES.cpp | #include <bits/stdc++.h>
#define int long long
#define MOD 1000000007
#define INF 1e18
#define MAXN 100005
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 1, n)
#define all(a, n) (a) + 1, (a) + (n) + 1
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define fi first
#define se ... | ALGO | 0.999977 | 3.56303 |
b5b1525d-2e58-4182-814c-6db6ec23b884 | Shidkung/Project10 | Project10/Source.cpp | #include <stdio.h>
int main() {
int x, y, z, m, n;
scanf_s("%d %d %d", &x, &y, &z);
if (x >= y)
{
m = x;
}
else { m = y; }
if (z >= m)
{
m = z;
}
if (x <= y)
{
n = x;
}
else { n = y; }
if (z <= n)n = z;
printf("%d", m + n);
} | ALGO | 0.999907 | 3.721983 |
3f125c3e-4e0d-41e2-a169-6e2cdad14128 | hadleyhzy34/data_structure_and_algorithm | graph/src/547_number_of_provinces.cpp | #include <iostream>
#include <vector>
#include <queue>
void checkCycle(int idx, int n, std::vector<std::vector<int>> &isConnected, std::vector<bool>& visited){
visited[idx] = true;
for(int i = 0; i < n; i++){
// std::cout<<"idx: "<<idx<<"adj "<<i<<"connected status: "<<isConnected[idx][i]<<"visited sta... | ALGO | 0.999911 | 5.650147 |
6d2c2ac3-4b02-46a4-8af7-24d06000cba4 | Pranav0786/COdeForEnjoy | 91graph/4dfs_travelsal.cpp | #include<bits/stdc++.h>
using namespace std;
void prepare_list(unordered_map<int,list<int>> &adjlist , vector<pair<int,int>> &edges )
{
for( int i=0 ; i< edges.size() ; i++ )
{
int u = edges[i].first ;
int v = edges[i].second ;
adjlist[u].push_back(v) ;
adjlist[v].push_back(u) ... | ALGO | 0.999991 | 4.755627 |
0acbc0ea-8996-4393-9f42-8b41f470a71e | slyjain/CP | Graph/RoundTrip1.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
vector<vector<int>> g; // adjacency list
//int n; // number of vertices
vector<int> vis;
bool cycle_exist=false;
void dfs(int v,int par){
vis[v] = 2;
for(int u : g[v]){
if(vis[u]==1){
dfs(u,v);
}
... | ALGO | 0.999996 | 4.710734 |
9e9c2977-c7d1-44c7-b4ad-88755ef0b2dc | yzzupgo/MFTCG | Data/abc206_a/kaw123/wa/23574057.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,c) for(int i=0; i<c; i++)
const int INF = 100100100;
int r[2001][2001];
int main() {
double n;
cin >> n;
n *= 1.08;
floor(n);
if(n <= 206) {
cout << "Yay!" << endl;
} else if(n == 206) {
cout << "so-so" << endl;
} else {
cout << ":(" << e... | ALGO | 0.992883 | 3.686356 |
328627ce-28cc-4abb-b095-e598116dddd0 | tony-t-tang/LeetCode | 0049-group-anagrams/0049-group-anagrams.cpp | class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
unordered_map<string, vector<string>> mp;
vector<vector<string>> res;
for(auto str : strs)
{
string sorted = str;
sort(sorted.begin(), sorted.end());
... | ALGO | 0.999993 | 6.530681 |
d27eb100-93a5-418a-9aed-b6bf32cbdf47 | phygima/laba2 | EncoderAtbash.cpp | #include <iostream>
#include "EncoderAtbash.h"
#include "String.h"
using namespace std;
EncoderAtbash::EncoderAtbash(const char* str) :AbstractEncoder(str)
{
}
EncoderAtbash::~EncoderAtbash()
{
}
//string encoding method
void EncoderAtbash::encode()
{
for (int i = 0; i < length; i++)
{
if (isupper(this->str[... | TOOL | 0.929492 | 3.906367 |
48ed8c03-7f62-43cc-a70e-fb6200ca0930 | cuong2905say/codeforces | codeforces/1278A.cpp | /*
author : NGUYEN MANH CUONG
created : 04-09-22 10:55
*/
#include <bits/stdc++.h>
using namespace std;
int t=0;//test case
int B[26];
int B_[26];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>t;
while(t--){
string p;
cin>>p;
string p_;
cin>>p_;
for(int i=0;i<26;i++... | ALGO | 0.999987 | 5.110671 |
096963d5-ed4b-4494-9bb5-88d5766039ac | raincross7/code-similarity | codes/train_code/problem017/problem017_291.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main( ) {
//freopen("C.01.in","r",stdin);
... | ALGO | 0.999575 | 3.824699 |
ede259b1-b622-4ef3-ac87-fa9d5723ffc6 | zspace/system.opencv.4.5.4 | modules/objdetect/src/face_detect.cpp | #include "precomp.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/core.hpp"
#include "opencv2/dnn.hpp"
#include <algorithm>
namespace cv
{
class FaceDetectorYNImpl : public FaceDetectorYN
{
public:
FaceDetectorYNImpl(const String& model,
const String& config,
... | ALGO | 0.970955 | 6.472251 |
e0e649e5-7ba0-4758-95d5-d11db4670fac | HC-Chang/LeetCode | complete/264.ugly-number-ii.cpp | /*
* @lc app=leetcode id=264 lang=cpp
*
* [264] Ugly Number II
*/
// @lc code=start
class Solution
{
public:
int nthUglyNumber(int n)
{
vector<int> ugly(n);
ugly[0] = 1;
int idx_2 = 0, idx_3 = 0, idx_5 = 0;
int next_2 = 2, next_3 = 3, next_5 = 5;
for (int i = 1; i ... | ALGO | 0.999991 | 6.516209 |
cf77a050-3487-4610-b35d-94be4f2b7bcd | Kawser-nerd/CLCDSA | Source Codes/AtCoder/abc001/D/1941207.cpp | #include <algorithm>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::cerr;
using std::string;
using std::to_string;
using std:... | ALGO | 0.999777 | 3.99858 |
1e7f3c10-36e6-433e-bbe4-00f290de81b0 | DuNai0524/algorithm_solving | leetcode/editor/cn/LeetCode515.cpp | #include <bits/stdc++.h>
using namespace std;
//leetcode submit region begin(Prohibit modification and deletion)
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int... | ALGO | 0.999989 | 6.575137 |
f7c504de-09a2-4e29-a69f-a8d9b9786908 | tflsguoyu/layeredbsdf | src/shapes/heightfield.cpp | #define MTS_QTREE_MAXDEPTH 50
#define MTS_QTREE_FASTSTART 1
MTS_NAMESPACE_BEGIN
static StatsCounter numTraversals("Height field", "Traversal operations per query", EAverage);
namespace {
/// Find the smallest t >= 0 such that a*t + b is a multiple of c
inline Float nextMultiple(Float a, Float b, Float c) {
... | ALGO | 0.995627 | 3.134926 |
96462d13-6638-4c8e-b79f-d0bf878da9eb | RenanTashiro/URI | code/Matemática/p-level-4/1990.cpp | /*
Nome: Equilíbrio
ID: 1990
Resposta: Accepted
Linguagem: C++ (g++ 4.8.5, -std=c++11 -O2 -lm) [+0s]
Tempo: 0.004s
Tamanho: 917 Bytes
Submissao: 29/11/15 20:10:05
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
int N;
while(cin >> N && N != -... | ALGO | 0.999486 | 3.88784 |
77323887-2ad2-4439-ab6a-cf63816aa5d1 | yangchenglin815/Fastman | FastmanCombo2/Packer/src/installer-framework-2.0/src/libs/kdtools/kdsysinfo_mac.cpp | #include "kdsysinfo.h"
#include <Carbon/Carbon.h>
#include <sys/mount.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#include <QtCore/QList>
namespace KDUpdater {
quint64 installedMemory()
{
SInt32 mb = 0;
Gestalt(gestaltPhysicalRAMSizeInMegabytes, &mb);
return quint64(static_cast<quint64>(mb) * 102... | TOOL | 0.887329 | 4.525617 |
93daed19-96c3-4151-ad49-972cf5b34691 | kundan6930/coding_contest | codeforces/Educational Codeforces Round 142 (Rated for Div. 2)/A_GamingForces.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main (){
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
vector<int>a(n);
int o=0;
for(int i=0;i<n;i++)
{
cin>>a[i];
if(a[i]==1)
{
o++;
}
}
int ans=0;
ans+=(o/2);
if(o%2!=... | ALGO | 0.999766 | 4.388601 |
f7e187eb-71ff-4fe9-8164-d25f65c940a1 | milesmiles902/C | other/probability/geometric_dist.cpp | /*
* @file .cpp
* @brief [Geometric Distribution]
*
* @details
* The geometric distribution models the experiment of Doing Bernoulli trials
* until a success was observed. There are two formulations of the geometric
* distribution. 1) The probability distribution of the number of X of Bernoulli
* trials needed ... | TEST | 0.875594 | 7.448634 |
5f2c58f6-ca96-40c0-b640-ba9ff916545a | calofmijuck/BOJ | Codes/11300/11368.cpp | use std::{
io::{self, BufReader, Read},
str::FromStr,
};
struct Reader {
vec: Vec<String>,
idx : usize,
}
impl Reader {
fn read_input() -> Reader {
let mut stdin = String::new();
BufReader::new(io::stdin().lock())
.read_to_string(&mut stdin)
.unwrap();
l... | ALGO | 0.990528 | 5.246572 |
6717da7a-29aa-4cea-9a0f-4b11f7f94eaa | nucleargezi/acm-icpc | atcoder/abc/390-399/abc395 -ak/F_Smooth_Occlusion.cpp | #include "MeIoN_Lib/MeIoN_all.hpp"
void before() {}
// #define tests
void Yorisou() {
LL(n, x);
vector<ll> a(n), b(n);
FOR(i, n) {
IN(a[i], b[i]);
}
ll s{SUM(a) + SUM(b)};
FOR(i, n - 1) chmin(a[i + 1], a[i] + x);
FOR_R(i, n - 1) chmin(a[i], a[i + 1] + x);
ll h{inf<ll>};
FOR(i, n) chmin(h, a[i] +... | ALGO | 0.999952 | 4.45319 |
3cd7d965-0344-4152-bb02-32b53191bb17 | zim2510/Online-Judge-Solves | UVA/Trailing0.cpp | #include <bits/stdc++.h>
using namespace std;
bool prime[1000000000];
void siv(long long int n)
{
for(long long int i = 4; i<n; i+=2){
prime[i] = 1;
}
for(long long int i = 3; i*i<n; i++){
if(prime[i]==0){
for(long long int x = i*i; x<n; x+=i){
prime[x] = 1;
... | ALGO | 0.997931 | 4.390089 |
ed26d3e1-b1bb-4498-88d5-73ab1a04c960 | emonislive/leetcode-problems | c++/704.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int start = 0;
int end = nums.size() - 1;
while (start <= end) {
int mid = start + (end - start) / 2;
if (nums[mid] == target)
return mid;
else if (nums[mid] < target)
... | ALGO | 0.999868 | 6.213903 |
65a13122-6f5f-4d6d-9cca-c124e5055af1 | MMoA16/CoDeLiBrArY | tomnjerry.cpp | #include <iostream>
#define max 999999999
using namespace std;
long long int visi[100000000]={0};
void merge(long long int arr[], long long int l, long long int m,long long int r)
{
long long int i, j, k;
long long int n1 = m - l + 1;
long long int n2 = r - m;
/* create temp arrays */
long long int L[n1], R[n2];... | ALGO | 0.999835 | 3.809579 |
1312178b-997d-4a40-af9f-3aeba7a281ad | UA1ZDC/UHD-Owl | host/utils/uhd_cal_tx_dc_offset.cpp | #include "usrp_cal_utils.hpp"
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/utils/algorithm.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/safe_main.hpp>
#include <boost/format.hpp>
#include <boost/program_options.hpp>
#include <chrono>
#include <complex>
#include <ctime>
#include <functional>
#include <ios... | TOOL | 0.879869 | 5.695051 |
4aa504a6-d163-45e8-ab89-f1edc42e4d61 | Aniumbott/Some-good-DSA-questions | Arsh Goel Sheet/Stack-Queue/36-E Evaluation of Postfix Expression.cpp | /*
Simple solution just go through once.
*/
class Solution {
public:
ListNode* halfreverse(ListNode* head){
ListNode* slow = head, *fast = head;
int i=1;
while(fast and fast->next){
fast=fast->next->next;
slow=slow->next;
i++;
}
ListNode* ... | ALGO | 0.999984 | 5.59264 |
a38d05f1-01f9-4ffa-ad1b-dd629121067d | maxwellcc/bytebank | 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.998693 | 6.797273 |
be0becad-cd4b-4c63-9254-f26033cc9e97 | AlexandreBinninger/Local-Smooth-Interpolating-MonoCurvature | extern/libigl/include/igl/dfs.cpp | #include "dfs.h"
#include "list_to_matrix.h"
#include <vector>
template <
typename AType,
typename DerivedD,
typename DerivedP,
typename DerivedC>
IGL_INLINE void igl::dfs(
const std::vector<std::vector<AType> > & A,
const size_t s,
Eigen::PlainObjectBase<DerivedD> & D,
Eigen::PlainObjectBase<DerivedP>... | ALGO | 0.998994 | 6.122498 |
da290207-1653-48b0-afbe-f2634d757b2a | MRshahed/Programming-Contests | Toph.co/Intra NSU Programming Contest Fall 2018/Gauss - The Great Mathematician.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t,t1,t2,t3;
int sum=0;
cin>>t;
for(int i=0; i<t; i++)
{
cin>>t1>>t2>>t3;
int st=t2-t1;
for(int j=t1; j<=t3; j+=st)
{
sum+=j;
}
cout<<sum<<endl;
sum=0;
}
return 0;
}
| ALGO | 0.99971 | 3.635275 |
7a2db890-9609-4d31-8ed6-f2ad6f7e36dc | 1471436961/2.Algorithm-DataStructure | 12.回溯算法/5.P1443-BFS.cpp | /*************************************************************************
> File Name: 5.P1443-BFS.cpp
> Author: zhouyingda
> Mail:
> Created Time: Sun 13 Jul 2025 04:53:04 PM CST
************************************************************************/
#include <iostream>
#include <queue>
using namespace std;
... | ALGO | 0.999604 | 3.671564 |
dfb3ed65-031e-4cb0-b0a6-a8a01de4ec0d | noelkelias/lova | examples/toy/bn254/toy_cpp/calcwit.cpp | #include <iomanip>
#include <sstream>
#include <assert.h>
#include "calcwit.hpp"
extern void run(Circom_CalcWit* ctx);
std::string int_to_hex( u64 i )
{
std::stringstream stream;
stream << "0x"
<< std::setfill ('0') << std::setw(16)
<< std::hex << i;
return stream.str();
}
u64 fnv1a(std::stri... | ALGO | 0.996365 | 3.934887 |
baadbafa-7b36-4ca8-8b92-a18bb51abfa1 | pritisharma1511/oop2 | complex.cpp | #include<iostream>
using namespace std;
class Complex
{
public:
int real;
int img;
Complex ()
{
real=0;
img=0;
}
Complex operator+(Complex &c)
{
Complex temp;
temp.real=real+c.real;
temp.img=img+c.img;
return temp;
}
friend istream &operator>>(istream &input,Complex &c)
{
cout<<"enter real num... | ALGO | 0.90325 | 4.493699 |
9e912173-4486-4efb-aa52-f629e702db9c | aman212yadav/COMPETETIVE_PROGRAMMING | LEETCODE/EASY/STRING/number_of_segment_in_a_string.cpp | // problem link - https://leetcode.com/problems/number-of-segments-in-a-string/
// time complexity - O(n)
// space complexity - O(1)
class Solution {
public:
int countSegments(string s) {
int seg=0,i=0;
while(i<s.size()){
while(i < s.size() && s[i]==' '){
i++;
... | ALGO | 0.999903 | 5.429325 |
7bbf7b8c-7bb9-4a08-b59a-852c5827d973 | ivorymood/ALGORITHM | CODEPLUS/BASIC_01/step02/Q1309.cpp | //https://www.acmicpc.net/problem/1309
#include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int const MAX = 100000;
int const mod = 9901;
int D[MAX + 1];
int n;
cin >> n;
/*
D[0][0] : 0
D[0][1] : 1° ĭ
D[0][2] : 2° ĭ ϶
D[n][0] = D[n - 1][... | ALGO | 0.999956 | 4.436399 |
12208d8d-0682-4fd2-87a3-848739448e6f | petrosyh/ga-project | mcalgo.cpp | #include <fstream>
#include <iostream>
#include <sstream>
#include <ctime>
//#include "Graph.h"
//#include "Gene.h"
#include "Gasolver.h"
using namespace std;
#define INITIAL 1000
#define ITERTIME 5
#define CHILDNUM 40
int main(int argc, char *argv[]) {
clock_t start_time = clock();
clock_t diff_time;
string f... | ALGO | 0.99823 | 3.380015 |
f02a0cbb-2925-48ef-b219-ade4ad3f0759 | ishandutta2007/codeforces | pwild/normal/1325/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a)... | ALGO | 0.998735 | 4.101754 |
856c4758-f849-4b8e-b923-938d13967f54 | GaryBoone/cuda_optimizer | src/adaptive_sampler.cpp | #include "adaptive_sampler.h"
#include <stddef.h>
#include <cmath>
#include <utility>
#include <vector>
#include "./errors.h"
#include "tl/expected.hpp"
namespace cuda_optimizer {
// Calculate the student's t distribution value for the 2-sided 95% confidence
// interval for the given degrees of freedom. This funct... | ALGO | 0.999383 | 6.865165 |
8cc4e6b2-eb49-4a99-a268-719b6a5b73ca | mashnoor/problem-solving | leetcode/75/sol.cpp | #include<iostream>
#include<vector>
using namespace std;
void sortColors(vector<int>& nums)
{
int cnt[3] = {0, 0, 0};
for(int i=0; i<nums.size(); i++)
{
int val = nums[i];
cnt[val]++;
}
// for(int i = 0; i<3; i++) cout<<cnt[i]<<" ";
for(int i = 0; i<nums.size(); i++)
{
... | ALGO | 0.999935 | 5.344296 |
af22c07b-6947-40ce-8ce4-26d835467dce | amin-imani-v/backup-soft | schifra/schifra_reed_solomon_threads_example01.cpp | /*
Description: This example will demonstrate the use of the Reed-Solomon
encoder and decoder capabilities in a threaded context. One
must note that the number of threads should not exceed the
architecture's ability to efficiently and productively run the
... | ALGO | 0.981654 | 5.362908 |
8b9d7011-438c-4d0c-bb32-6f010f9e3528 | AdamtayZzz/PAT | AdvanceLevel/1012.cpp | #include<iostream>
#include<vector>
#include<map>
#include<cmath>
#include<algorithm>
using namespace std;
map<int,int> best_place;
map<int,char> best_course;
typedef struct{
int id;
int c;
int m;
int e;
int a;
}Student;
bool com1(Stude... | ALGO | 0.99989 | 4.689626 |
07d47346-17fa-4ceb-9c9d-6c960956bc59 | vsroy/Data-Structures-and-Algorithms | Arrays/Equilibrium_Index_Of_Array.cpp | /*Given an array A of N positive numbers. The task is to find the position where equilibrium first occurs in the array.
Equilibrium position in an array is a position such that the sum of elements before it is equal to the sum of elements after it.*/
#include<iostream>
#include<vector>
using namespace std;
int equil... | ALGO | 0.999965 | 5.515996 |
7814e37a-8b32-460a-8a44-6caec3d238cf | yu3mars/proconVSCodeGcc | atcoder/abc/abc158/b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,... | ALGO | 0.999859 | 3.107677 |
3091fe1c-e591-4fcd-9689-d1401a67d257 | mohit2023/DataStructures | hashmap/mapClass.cpp | #include "node.cpp"
template <typename T>
class hashmap{
mapNode<T> **bucket;
int count=0;
int cap;
int hashcode(string key){
int code=0;
int mult=1;
int n=key.size();
for(int i=0;i<n;i++){
code+= key[i]*mult;
code=code%cap;
mult*=37... | ALGO | 0.993668 | 4.394902 |
57baed61-50e2-46ff-a5be-387ed93b57e5 | smallhand/codePractice | uva/10878_Decode_the_tape.cpp | #include <iostream>
using namespace std;
int main(){
string s;
int ascii;
while(getline(cin, s)) {
ascii = 0;
if (s[0]=='_')
continue;
for (int i=0; i<s.size(); i++) {
if (s[i]==' ')
ascii *= 2;
else if (s[i]=='o')
... | ALGO | 0.997387 | 3.30352 |
2638dd9c-7a11-4342-81ac-2bf3dce2b37f | dEsquilas/aoc2020 | boost_1_74_0/libs/compute/perf/perf_sort_float.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/is_sorted.hpp>
#include <boost/compute/algorithm/sort.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
float rand_float()
{
return ((rand() / float(RAND_MAX)) - 0... | ALGO | 0.998221 | 5.955168 |
348b7f54-7599-4ba8-b36f-3ba8f671ec5a | AndanteKim/LeetCode_Practice | 0kth-largest-element-in-a-stream/0kth-largest-element-in-a-stream.cpp | class KthLargest {
priority_queue<int, vector<int>, greater<int>> pq;
int kLargest;
public:
KthLargest(int k, vector<int>& nums) {
kLargest = k;
for (int num : nums) {
if (pq.size() >= kLargest) {
if (pq.top() <= num){
pq.pop();
... | ALGO | 0.999974 | 6.14884 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.