uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1b242ef9-2a4d-4485-9644-83c1a671b3af | Jontte/DMCR | backend/src/octree.cpp | #include <vector>
#include <algorithm>
#include "octree.h"
#include "vector.h"
namespace dmcr {
class Ray;
} // namespace dmcr
dmcr::Vector3f extentPermutations[8] =
{ dmcr::Vector3f(1, 1, 1), dmcr::Vector3f(1, 1, -1),
dmcr::Vector3f(1, -1, 1), dmcr::Vector3f(1, -1, -1),
dmcr::Vector3f(-1, 1, 1), dmcr::Vector3f... | ALGO | 0.971287 | 7.001438 |
d07af167-5a00-4b15-bbe7-94d88458e489 | 2013612/CP-algorithm | codeforces/1260/1260B.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
int N, ans, a, b;
int main() {
scanf("%d", &N);
for (int i = 0; i < N; i++) {
scanf("%d %d", &a, &b);
if (a > b) {
int temp = a;
a = b;
b = temp;
}
if ((a + b) % 3 == 0 && b <= 2 * a) {
cout << "YES" << ... | ALGO | 0.999917 | 3.319081 |
2b396ca6-5ad2-4447-be7a-3d39b11a4eab | oosquare/OI-Codes | Storage/Luogu/P1005-矩阵取数游戏.cpp | #include <cstdio>
#include <iostream>
using namespace std;
typedef __int128 ll;
const int lim = 100;
ll f[lim][lim], ans;
ll a[lim];
int n, m;
inline int read() {
ll s = 0, f = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-')
f = -1;
ch = getchar();
}
... | ALGO | 0.999899 | 3.31261 |
680f18f3-9e2b-42a2-9676-3822123151ee | Normal-pcer/sync_code | 让 AI 识别 AI 和人类的代码/1.cpp | // 1.cpp
#include<bits/stdc++.h>
#include<bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
constexpr int mod=998244353;
ll qpow(ll a,ll b){
ll res=1;
for (;b;b>>=1,a=a*a%mod) if (b&1) res=res*a%mod;
return res;
}
int n;
ll a[200001],tr[300001];
tree<pair<int,int>,null_type,less<p... | ALGO | 0.999962 | 4.319499 |
243f4f7f-0f16-4fca-8632-b7575af43b43 | Ryushi-tech/factory | combined.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define fore(i_in,a) for (auto& i_in: a)
#define sz(x) (int)x.... | ALGO | 0.999935 | 4.461212 |
246c3dc9-68b3-4e9c-8ff4-9ea9e7ad71d4 | nmt-ht/dttx-cdtcdl-excerise | CDTCDL.BaiTap3/Program.cpp | /*
Student Name : Nguyễn Minh Tư
Student Id : 21850024
Reference : Vũ Quốc Hoàng, Bí kíp luyện Lập trình C (Quyển 1), hBook, 2017
*/
#include <iostream>
#include <cmath>
using namespace std;
/*
1. (3 đ) Mô hình dữ liệu hàng đợi ưu tiên (priority queue) là mô hình dữ liệu cho phép quản lý
một tập các đối tượ... | ALGO | 0.999957 | 4.937821 |
f752a46d-212b-404e-b9ee-bc36c9d4d394 | Ryb7532/AtCoder | submissions/abc028/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0; i<(n); i++)
#define reps(i,s,n) for (int i=(s); i<(n); i++)
#define rep1(i,n) for (int i=1; i<=(n); i++)
#define print(a) cout << a << endl;
#define all(v) v.begin(), v.end();
int main() {
string S;
int n, cnt[6];
... | ALGO | 0.999856 | 3.745039 |
dcd518dc-7ca7-448a-b79e-45723cfcffab | SeeleVolle/cann-ops-clean | src/foreach/foreach_lerp_scalar/op_kernel/foreach_lerp_scalar.cpp | /*!
* \file foreach_lerp_scalar.cpp
* \brief
*/
#include "foreach_lerp_scalar.h"
using namespace ForeachLerpScalar;
extern "C" __global__ __aicore__ void foreach_lerp_scalar(
GM_ADDR x1, GM_ADDR x2, GM_ADDR weight, GM_ADDR y, GM_ADDR workspace, GM_ADDR tiling) {
GET_TILING_DATA(tilingData, tiling);
... | ALGO | 0.980408 | 4.712348 |
6fa0f702-3bb7-421d-95fc-8c3f159ea2ca | Jo4ovlm/Processor-Architecture | M1/Trabalho 1 -1 C++/main.cpp | #include <iostream>
using namespace std;
int soma(int x, int y){
return x + y;
}
int main()
{
int x, y, result;
cout<<"Entre com o valor de X: ";
cin>>x;
cout<<"Entre com o valor de Y: ";
cin>>y;
result = soma(x,y);
cout<<"O resultado eh: "<<result;
return 0;
}
| TOOL | 0.976058 | 4.310687 |
9ef4f5e7-6aff-4a29-9bee-b658ef42425f | shubhamhazard/Data-Structures-and-Algo | lec85 Graphs/BFSTraversal.cpp | #include<bits/stdc++.h>
void bfs(vector < vector < int >> & adj, unordered_map < int, bool> & visited, vector < int > & ans, int node)
{
queue < int > q;
q.push(node);
visited[node] = 1;
while (!q.empty())
{
int frontNode = q.front();
q.pop();
... | ALGO | 0.999935 | 5.414733 |
524b1391-dd2d-4d4a-acc0-91be92af5885 | abdul-rozzaq/pdp-darslar | 2-modul/6-dars/09.cpp | #include <iostream>
using namespace std;
int getRandomNumber(int start, int end)
{
return rand() % (end - start + 1) + start;
}
int main()
{
srand(time(0));
int row, col;
cout << "Qatorlar soni: ";
cin >> row;
cout << "Ustunlar soni: ";
cin >> col;
int arr[row][col];
for (int ... | ALGO | 0.952188 | 3.417043 |
cd4bf245-6354-4d05-84fa-f3f5383bd921 | Pussycat-Doll/C-practice | Day-04/3.幂之和.cpp | //Sn=a+aa+aaa+aaaa+aaaaaǰ5֮ͣaһ
#include<stdio.h>
#include<math.h>
int main()
{
int a,n,i;
int num = 0;
int sum = 0;
scanf("%d %d",&a,&n);
for( i = 1; i <= n; i++)
{
num = num*10+a;
sum += num;
}
printf("sum = %d\n",sum);
return 0;
}
| ALGO | 0.998993 | 3.160161 |
9057f22d-2da6-44bf-937e-fa7763736f87 | abxhr/Open-DSA | Data Structures/LinkedList/DoublyLinkedList/DoublyLinkedList.cpp | #include <iostream>
using namespace std;
struct node{
int data;
node* next;
node* prev;
};
int llsize = 0;
node* head = NULL;
node* last = NULL;
void insert(int val, int index = llsize){
llsize++;
if (head == NULL){
head = new node();
head->data = val;
head->next = NULL;
... | ALGO | 0.998926 | 4.402237 |
a9ad236d-211c-44e6-8ab8-61bfd9d1e041 | cran/volesti | src/write_sdpa_format_file.cpp | // VolEsti (volume computation and sampling library)
//Contributed and/or modified by Repouskos Panagiotis, as part of Google Summer of Code 2019 program.
#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
#include "cartesian_geom/cartesian_kernel.h"
#include <boost/random.hpp>
#include <boost/random/uniform_... | ALGO | 0.993431 | 5.95693 |
81c46092-b530-4fc8-a1e0-3064c4845d7b | Alexisflipi/Club-de-Algoritmia | Online-judge/Codeforces/721C.cpp | #include <bits/stdc++.h>
#define mp make_pair
#define fst first
#define snd second
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
const int MAX = 5001;
const int INF = (1<<30);
int n, m, T;
int p[MAX][MAX];
int memo[MAX][MAX];
vector<ii> ady[MAX];
void printpath(int u, int i) {
if (i == ... | ALGO | 0.99999 | 4.715733 |
da89af59-d578-40b8-a553-e04674325912 | DeNRaiM/testtest | src/USER-INTEL/improper_harmonic_intel.cpp | /* ----------------------------------------------------------------------
Contributing author: W. Michael Brown (Intel)
------------------------------------------------------------------------- */
#include <mpi.h>
#include <cmath>
#include <cstdlib>
#include "improper_harmonic_intel.h"
#include "atom.h"
#include "c... | ALGO | 0.989259 | 6.196329 |
53eebeab-c123-4121-a8c6-05efbf17af70 | MK2112/CarND-Highway_Path_Planner | src/Eigen-3.3/failtest/colpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
ColPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.909831 | 3.159166 |
4193034c-2957-4dd0-afce-e1cc784b89b1 | jjeff-han/leetcode | eg100-109/cpp100_sameTree.cpp |
class Solution {
public:
bool isSameTree(TreeNode *p, TreeNode *q) {
if (!p && !q)
return true;
if ((p && !q) || (!p && q) || (p->val != q->val))
return false;
return isSameTree(p->left, q->left) && isSameTree(p->right, q->right);
}
};
class Solution {
public:
bool isSameT... | ALGO | 0.999978 | 6.091327 |
824c9da4-d32b-462c-82da-e64f737801c3 | iSuneast/uva-codes-for-acm-icpc | UVa 10000/10701 - Pre, in and post_0419_graph theory_tree build.cpp | /*
10701 - Pre, in and post
graph theory...
tree build...
ݹ齨...
ԽԽ...
*/
#include<iostream>
#include<string>
#define MAXN 60
using namespace std;
int nodes,pos;
string po,io;
char node[MAXN];
void build(int pstart,int pend,int istart,int iend)
{
if(istart>=iend || pstart>=pend)
return ;
int i;
for(i=istart;i<ie... | ALGO | 0.999973 | 3.56935 |
18458017-d1cb-4a40-82f6-1f3f20b995a0 | balabit-deps/balabit-os-8-llvm-toolchain-12 | llvm/lib/CodeGen/RegAllocBasic.cpp | #include "AllocationOrder.h"
#include "LiveDebugVariables.h"
#include "RegAllocBase.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/CalcSpillWeights.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveRangeEdit.h"
#include "llvm/CodeGen/LiveRegMatrix.h"
#include "llvm/CodeGen/LiveSt... | ALGO | 0.942839 | 7.844592 |
985bf8b9-fee6-4029-8d89-ae30d5063915 | fred-yagofarov13/Education | cpp/KT-1/lab2/Series4.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
int N;
double sumNums = 0, multipleNums = 1;
cout << "Введите количество чисел, которые хотите ввести: ";
cin >> N;
double massiveNums[INT16_MAX];
cout << endl << "Введите все числа по порядку: ";
for ... | ALGO | 0.992124 | 3.783068 |
b23625f6-00ab-4393-8a70-1ddae4701fe6 | Kanadae/codetree-TILs | 240408/1차원 폭발 게임/The-1D-bomb-game.cpp | #include <iostream>
#define MAX_N 101
using namespace std;
int n, m, end_of_array;
int bomb[MAX_N];
int GetEndOfExplosion(int start_idx, int cur_num){
int end_idx = start_idx + 1;
while(end_idx < end_of_array){
if(bomb[end_idx] == cur_num) end_idx++;
else break;
}
return end_idx - 1... | ALGO | 0.999938 | 4.13475 |
396af351-5245-4672-b06d-e72d5d75d282 | sarvex/leetcode-cpp | solution/2100-2199/2122.Recover the Original Array/Solution.cpp | class Solution {
public:
vector<int> recoverArray(vector<int>& nums) {
sort(nums.begin(), nums.end());
for (int i = 1, n = nums.size(); i < n; ++i) {
int d = nums[i] - nums[0];
if (d == 0 || d % 2 == 1) continue;
vector<bool> vis(n);
vis[i] = true;
... | ALGO | 0.999998 | 5.380901 |
7e91c740-8efe-4df0-8aa7-3772b3682f0e | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10685_4.cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
os << "[ ";
for (auto v : V) os << v << " ";
return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, set<T> S) {
os << "{ ";
for (auto s : S) os << s << " ";
return os << "}";
}
t... | ALGO | 0.999987 | 3.356843 |
537c4d05-7aba-416c-aa17-83d29db322be | tinicius/programing-problems | Online Judges/URI/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define endl '\n'
#define dbg(x) cout << #x << " = " << x << endl
typedef unsigned long long ll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
int main() {
... | ALGO | 0.999928 | 4.716571 |
3d4d6ad5-adf9-4f4a-8195-f0106bbd00c8 | Rayeesgithub/DSA_365_Challenges | Binary-Search/find-the-col-with-maximum-number-of-1.cpp |
#include <bits/stdc++.h>
using namespace std;
int colWithMax1s(vector<vector<int>> &matrix, int n, int m) {
int cnt_max = 0;
int index = -1;
//traverse the matrix:
for (int i = 0; i < n; i++) {
int cnt_ones = 0;
int j = 0;
for (; j < m; j++) {
cnt_ones += matrix[j... | ALGO | 0.999902 | 5.492206 |
4472a54e-b39e-4f83-9367-36755a8af5c3 | purple-jwl/atcoder | src/AGC/003/A.cpp | #include <bits/stdc++.h>
#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define un... | ALGO | 0.999943 | 3.734469 |
2c4b63a8-c534-4a75-8e07-b4f8399e8267 | Prateek-Wayne/prateek-DSA | 0162-find-peak-element/0162-find-peak-element.cpp | class Solution {
public:
int findPeakElement(vector<int>& nums) {
// bases
int n=nums.size();
if(n==1)
return 0;
if(nums[0]>nums[1])
return 0;
if(nums[n-1]>nums[n-2])
return n-1;
int low=1,high=n-1;
while(low<=high){
... | ALGO | 0.999953 | 5.512511 |
95a66d7d-c411-4f37-a9e6-16731277e1a7 | kimurash/tessoku-book | chap09/B64.cpp | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, s, n) for (int i = s; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
#define MAXNODE 100'009
#define MAXCOST 10'000
using namespace std;
typedef pair<int32_t, int32_t> pi32;
int32_t dist[MAXNODE], before[MAXNODE];
bool locked[MAXNODE];
void d... | ALGO | 0.999997 | 4.184455 |
6e2e993a-9d38-46fa-b1d5-a698b98b57c4 | jonspock/tessa | src/block.cpp | #include "blockdisk.h"
#include "addrman.h"
#include "chainparams.h"
#include "checkqueue.h"
#include "ecdsa/blocksignature.h"
#include "init.h"
#include "kernel.h"
#include "main.h"
#include "merkleblock.h"
#include "net.h"
#include "txdb.h"
#include "txmempool.h"
#include "util.h"
#include "utiltime.h"
#include <ss... | TOOL | 0.871238 | 6.03885 |
51268df1-4b4d-4ec5-b3e5-53b6cfee7feb | nikhilsharma-github/CP-Problems-Repo | Maximum_Value.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int test;
cin >> test;
while (test--)
{
long long n, p, q, ans = 0;
long long j, k, l, m, ans1, ans2;
cin >> n;
long long a[n];
for (int i = 0; ... | ALGO | 0.999982 | 3.931216 |
b01de153-0af9-450e-97f7-1688922f2861 | Gray1486567118/BIT-Data-Science | 大二/大二上/数据结构与算法设计/乐学代码/Chapter5 Trees/HuffmanTree.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const double PI = 3.14159265358979323846;
const int INF = 0x3f3f3f3f;
const int N = 10001;
const int MOD = 10000000;
struct Compare {
bool operator()(int a, int b) {
return a > b;
}
};
int main() {
... | ALGO | 0.999924 | 3.608348 |
0927badc-6059-48a2-b961-c79bf12bc894 | ishandutta2007/codeforces | shameimaru_aya/normal/1616/E.cpp | #include <bits/stdc++.h>
#define lowbit(x) (x & (-x))
using namespace std;
int T , n , c[220000];
char s[220000] , t[220000];
long long ans , sum;
vector< int > pl[30];
void add( int x , int a )
{
while(x <= n)
{
c[x] += a;
x += lowbit(x);
}
}
int ask( int x )
{
int ans = 0;
while(x)
{
ans += c[x];
x -= ... | ALGO | 0.999801 | 3.633673 |
4301cca2-2877-45d7-bf4d-e698cc82318b | sakshi8707/NextLeap | LINKEDLIST/Single linkedlist/design_hashset.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
// **brute approch**
// class MyHashSet {
// public:
// vector<int> m;
// int size;
// MyHashSet() {
// size = 1e6+1;
// m.resize(size);
// }
// void add(int key) {
// // m.push_back(key);
// m[... | ALGO | 0.999428 | 4.780231 |
372b649c-fe40-4953-8b06-6bf49f246586 | dvanaken/peloton-bwtree | src/postgres/backend/executor/nodeLimit.cpp | /*
* INTERFACE ROUTINES
* ExecLimit - extract a limited range of tuples
* ExecInitLimit - initialize node and subnodes..
* ExecEndLimit - shutdown node and subnodes
*/
#include "postgres.h"
#include "executor/executor.h"
#include "executor/nodeLimit.h"
#include "nodes/nodeFuncs.h"
static void recompute_limi... | ALGO | 0.967139 | 6.606196 |
949d30f0-0466-4bf5-be0d-204066843a2e | CLeJack/Scribe | Source/Likelihood.cpp |
#include "Likelihood.h"
void setSineMatrix(fmatrix& sineMat, const cmatrix& matrix, const fvec& timeVector,
const fvec& freqs, void (*normFunc) (fvec&))
{
fvec signal;
for(int row = 0; row < sineMat.size(); row++)
{
signal = sinusoid(timeVector, freqs[row], 0, 1);
sineMat[row] = dct... | ALGO | 0.998585 | 5.240654 |
a8d09e79-d6fc-424a-bdb1-13eec18e3c3b | aaronhsueh0506/Leetcode | 139. Word Break/sol-medium.cpp | class Solution {
public:
bool wordBreak(string s, vector<string>& wordDict) {
int n = s.size();
vector<bool> dp(n+1);
unordered_map<char, vector<string>> m;
for(auto word: wordDict){
m[word[0]].push_back(word);
}
dp[0] = true;
for(int i=0;i<n;i++){
if(!dp[... | ALGO | 0.99851 | 6.174322 |
7e7bcf7a-06f9-48c7-b4de-24b0079166db | beastwaleed/Nuces_3rd_Sem | DSA/A#03/Stack/ques3.cpp | #include<iostream>
#include<string>
using namespace std;
class Stack {
private:
string* arr;
int top;
int size;
int capacity;
public:
Stack(int s) {
capacity = s;
arr = new string[capacity];
top = -1;
size = 0;
}
bool isEmpty() {
return top == -1;
}
bool isFull() {
return top == capacity - 1;
... | ALGO | 0.999249 | 5.335409 |
4cec8133-e8f2-498f-9dde-9dd6a3bbf337 | liu115/renderpy | thirdparty/eth3d-pipeline/thirdparty/igl/faces_first.cpp | #include <vector>
#include <Eigen/Dense>
template <typename MatV, typename MatF, typename VecI>
IGL_INLINE void igl::faces_first(
const MatV & V,
const MatF & F,
MatV & RV,
MatF & RF,
VecI & IM)
{
assert(&V != &RV);
assert(&F != &RF);
using namespace std;
using namespace Eigen;
vector<bool> in_... | ALGO | 0.998841 | 5.292408 |
403cb2cf-ed54-4c44-b2c4-03b06789a26e | AyushNighot/Leetcode-Daily-Challenge | Missing Number.cpp | int n = nums.size();
int sum = n * ( n + 1) / 2;
int sum2 = 0;
for ( int i =0 ; i < n ; i++)
{
sum2 += nums[i];
}
return sum - sum2;
| ALGO | 0.999475 | 3.537742 |
366d14b1-2d74-4809-b11f-464002ad0214 | kunyavskiy/competitive-programming-archive | opencup/20-21/210516/L.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#includ... | ALGO | 0.999923 | 3.61563 |
0fef88bf-58e1-4b6f-97eb-2966187964ad | Dipti821/DSA_Questions | 297-serialize-and-deserialize-binary-tree/297-serialize-and-deserialize-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Codec {
public:
// Encodes a tree to a single string.
string serialize(TreeNode* root) {
if(!root) r... | ALGO | 0.999804 | 6.206127 |
04d643cc-1c4b-4475-b32b-b4611c405ca4 | PranjalPal75389/love_babbar_cpp | lecture 5/leetcode Q2.cpp | #include<iostream>
using namespace std;
int main(){
int count=0,n;
cout<<"Enter a number:";
cin>>n;
while(n!=0){
if(n&1)
count++;
n=n>>1;
}
cout<<"No. of 1 bit is :"<<count<<endl;
return 0;
}
| ALGO | 0.999701 | 4.557881 |
9204e010-0697-481b-a686-dde0c6d56ebd | Adri5truji/PRA_2324_P2 | test_DyV.cpp | #include "DyV.h"
#include <vector>
#include <chrono>
#include <iostream>
int main(){
int tam = 7;
int ini = 0;
std::vector<int> a{1, 2, 3, 5, 7, 8, 9};
std::vector<double> b{1.6, 3.6, 4.2, 4.6, 5.2, 6.4, 8.5};
std::vector<char> c{'c', 'd', 'f', 'h', 'j', 'm', 'z'};
std::vector<int> d{1, 14, 20, 35, 43, 51, 60};... | ALGO | 0.987011 | 4.898307 |
d4871357-5f41-4f61-9ed6-b4916e94a453 | bartvbl/Shapebench | lib/CGAL-5.6.1/examples/QP_solver/first_qp_from_iterators.cpp | // example: construct a quadratic program from given iterators
// the QP below is the first quadratic program example in the user manual
#include <iostream>
#include <CGAL/QP_models.h>
#include <CGAL/QP_functions.h>
// choose exact integral type
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpz.h>
typedef CGAL::Gmpz ET;
#else
... | ALGO | 0.988499 | 4.290153 |
1c0b23b1-59c1-44bb-a136-6cb875bda9ed | cowtony/Education | C++ Fundamental/03 Loop, Array/christan_fibonacci.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
cout << "This is the Fibonacci Sequence Printer 5000. It prints the Fibonacci "
"Sequence up to a selected number." << endl;
// I used push_back() here to add the 1s because I got this weird error when adding them directly:
/* ma... | ALGO | 0.999812 | 4.616159 |
a2dd8072-e59a-4fe1-8873-e80bc8dd89c4 | GauthamPrabhuM/LeetCode | colorofchessboard.cpp | int flag;
class Solution
{
public:
bool squareIsWhite(string s)
{
if (s[0] == 'a' || s[0] == 'c' || s[0] == 'e' || s[0] == 'g')
{
if (s[1] == '1' || s[1] == '3' || s[1] == '5' || s[1] == '7')
return false;
else
return true;
}
else
{
if (s[1] == '1' || s[1] == '3' || s[1] == ... | ALGO | 0.999015 | 4.976593 |
9bd3635c-a9bd-422e-8c87-53c3642782ae | imWhS/ProblemSolving | baekjoon_16236(2)/main.cpp | /*
* 16236 아기 상어
*
* N * N 크기의 map에 물고기 M 마리, 아기 상어 1 마리가 존재한다.
* map의 각 칸에는 최대 한 마리의 물고기만 존재할 수 있다.
* 아기 상어는 처음부터 2 크기 값을 가진다.
* 아기 상어는 1초에 상, 하, 좌, 우 인접 영역으로 1칸 이동할 수 있다.
* 아기 상어는 자신보다 큰 물고기가 있으면 해당 칸으로 이동할 수 없다.
* 아기 상어는 자신보다 작은 물고기만 먹을 수 있다.
* 아기 상어는 자신과 크기가 같은 물고기는 먹을 수 없고 지나갈 수만 있다.
* 아기 상어는 이동할 때 1초의 시... | ALGO | 0.999807 | 4.281675 |
1d4eb305-2473-4cc3-9965-2cac1d34f192 | tuxafgmur/PRW_system_core | adb/sockets.cpp | #define TRACE_TAG SOCKETS
#include "sysdeps.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <algorithm>
#include <mutex>
#include <string>
#include <vector>
#if !ADB_HOST
#include <android-base/properties.h>
#include <log/log_propertie... | TOOL | 0.927529 | 7.191809 |
4cebdde4-fd70-465d-99fd-14df09e466e2 | heavenMOJANG/ICPC | .history/programmes_C_Cpp/Codeforces/CF2063/D_20250123001726.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
void solve() {
int n, m; cin >> n >> m;
deque<int> a(n), b(m);
for (int i = 0; i < n; ++ i) cin >> a[i]; sort(a.begin... | ALGO | 0.999985 | 3.980429 |
3cd665c0-9583-4055-93f8-aa9b1863a5c7 | suzhiking/programming-solutions | atcoder/341/a/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int mod = 1000000007;
int main() {
// solution goes here
int n;
cin >> n;
for (int i = 0; i < 2 * n + 1; i++) {
cout << (i & 1 ? '0' : '1');
}
cout << endl;
}
| ALGO | 0.99999 | 3.919595 |
c8a72673-f422-4b9a-aa9a-79abd3ede862 | AdityaSolanki189/Cpp-Projects | CP/DP1(Very important)/coinchange.cpp | /*
Name: Gourav Singh
https://www.linkedin.com/in/gouravsingh2580/
*/
/*
PROBLEM STATEMENT
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 denom... | ALGO | 0.999983 | 4.761413 |
8c2b32e3-d73c-4aa9-95a1-3f9be392b75f | dginhac/esirem-itc313 | samples/2020-2021/lesson05/functor-with-vector.cpp | /*
* @File: functor-with-vector.cpp
* @Project: C++ Programming - ESIREM 3A IT
* @Author: Dominique Ginhac <d0m>
* @Email: <EMAIL>
* @Date: 2020-10-31 11:04:22
* @Summary:
*
* @Last Modified by: d0m
* @Last Modified time: 2020-10-31 23:58:18
*/
#include <iostream>
#include <algorithm>
#include <vector>
std... | ALGO | 0.996698 | 5.332541 |
cdb5a5c6-2ec9-4a84-817c-b137c37400ce | Shezitt/CP | Codeforces/Div. 4/Codeforces Round 1017 (Div. 4)/A.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
uniform_int_distribution<int> dist(1, 10);
#define ll long long
#define ld long double
#define gcd(... | ALGO | 0.999854 | 5.446525 |
c5c0108a-9a38-4d24-a3fc-95af2f1267f8 | tri-water/SimpleMonteCarloPricer | SimpleMonteCarloPricer/ParkMiller.cpp | #include "ParkMiller.h"
const long a = 16807;
const long m = 2147483647;
const long q = 127773;
const long r = 2836;
ParkMiller::ParkMiller(long fSeed) :
Seed(fSeed)
{
if (Seed == 0)
Seed = 1;
}
void ParkMiller::SetSeed(long fSeed)
{
Seed = fSeed;
if (Seed == 0)
Seed = 1;
}
long ParkMiller::GetOneRandomInte... | ALGO | 0.999078 | 4.004817 |
f1d178b6-2fec-4f87-9136-69aa11dd10fc | connieya/cpp_algorithm | jongman/ch06_brute_force/board_cover.cpp | #include "bits/stdc++.h"
using namespace std;
int board[21][21];
int h, w;
int coverType[4][3][2] =
{
{{0, 0}, {1, 0}, {0, 1}},
{{0, 0}, {0, 1}, {1, 1}},
{{0, 0}, {1, 0}, {1, 1}},
{{0, 0}, {1, 0}, {1, -1}}
};
bool setting(int x, int y, in... | ALGO | 0.999729 | 4.506763 |
5782bef9-bf0f-42ff-9ad1-94d2a248d6e9 | khoffan/test-codemegic-ios | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
3b29854b-4c38-4c1f-890d-61ca36e75c32 | AbhishekMankame/cpp_data_structures | complexity/bubble_sort.cpp | #include<iostream>
#include<vector>
#include<ctime>
#include<algorithm>
using namespace std;
bool compare(int a, int b){
return a>b;
}
void bubble_sort(vector<int> &arr, int n){
for(int times=1;times<=n-1;times++){
for(int j=0;j<=n-times-1;j++){
if(compare(arr[j],arr[j+1])){
... | ALGO | 0.999271 | 4.364743 |
400b8bce-f9bf-44e3-89a9-b5f5dae9e8e2 | lianlian51/LeetCode | HOT100/LeetCode114/LeetCode114/LeetCode114/test.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), left(left... | ALGO | 0.999991 | 5.921052 |
c2a0c40b-64f0-41e2-9eba-06c7a9cb0a7c | aswan-1840/cpp | FUNCTIONSq2.cpp | #include <iostream>
using namespace std;
int square(int num){
return num * num;
}
int main() {
cout <<square(5);
}
| TOOL | 0.850329 | 4.074092 |
404f517c-3164-4a97-a2ca-70a0de20e235 | MuhiminOsim/Leetcode-Solutions | 2162-minimum-cost-to-set-cooking-time/2162-minimum-cost-to-set-cooking-time.cpp | class Solution {
public:
int findMinCost(int startAt, int moveCost, int pushCost, int targetSeconds, vector<int> digits, int cost) {
int idx = digits.size() - 1;
int seconds = 0;
if(idx >= 0) seconds = digits[idx--];
if(idx >= 0) seconds += 10 * digits[idx--];
int minutes = 0... | ALGO | 0.999013 | 5.943747 |
aca4260f-c73c-4b54-ba5b-a3d2425135a3 | wei-han/LeetCode | 017_Letter Combinations of a Phone Number.cpp | class Solution {
public:
vector<string> letterCombinations(string digits) {
vector<string> ans;
if (digits == "") return ans;
ans.push_back("");// without this, line 16 will be invalid always
vector<string> cell={"", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wx... | ALGO | 0.999858 | 6.839472 |
662e207e-88c5-421b-8cac-62ac73bc2232 | cicuvc/LLVM-LA32R | libc/src/math/generic/log10f16.cpp | #include "src/math/log10f16.h"
#include "expxf16.h"
#include "hdr/errno_macros.h"
#include "hdr/fenv_macros.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/PolyEval.h"
#include "src/__support/FPUtil/cast.h"
#include "src/__support/FPUtil/except_value... | ALGO | 0.971516 | 7.335208 |
f89c7f28-5605-4844-abf5-057b95d35411 | Tapiocaman/sudoku | P2/integer_sub.cpp | #include "integer.h"
#include <stdexcept>
integer integer::operator-(integer y) const
{ integer x = *this;
integer::normalize(x,y);
if(y < x) std::swap(x, y);
//long long int borrow = 0; // borrow = 1 if last subtraction borrowed, and 0 otherwise.
long long unsigned tmp = 0;
for(size_t i = 0; i < data.size(); ++i... | TOOL | 0.985473 | 5.480953 |
b177dbf2-a345-4dd5-a912-b25a0bc69f8b | ishandutta2007/codeforces | sirshokoladina/normal/442/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define ford(i,n) for (int i = int(n) - 1; i >= 0; --i)
#define forv(i,v) for (auto i = v.begin(); i != v.end(); ++i)
#define forr(i,v) for (auto i = v.end(); i != v.begin() && (--i, 1); )
#define ve vector
#define pa pai... | ALGO | 0.999978 | 3.767094 |
0691f618-064d-42b6-9a93-09b467ce7097 | KanagatS/ADS | LAB1/f.cpp | #include <bits/stdc++.h>
using namespace std;
#define sep ' '
#define ll long long
bool check(string s)
{
stack<char> st;
for (int i = 0; i < s.size(); i++)
{
if (s[i] == '(' || s[i] == '{' || s[i] == '[')
st.push(s[i]);
else if (st.empty())
return false;
... | ALGO | 0.999786 | 5.298865 |
9c0e52a1-f34f-46b2-922d-ab8a160bf4bd | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/12/1230/personal_submission/cf327d_syf.cpp | // Problem: D. Block Tower
// Contest: Codeforces - Codeforces Round 191 (Div. 2)
// URL: https://codeforces.com/problemset/problem/327/D
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// DateTime : 2024-12-30 14:37:27
// Author : sunyafei
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
usi... | ALGO | 0.998644 | 4.47941 |
7da51943-8983-4056-988e-cbcf8ab2ea9a | Illusion0-0/LCBase | 0154-find-minimum-in-rotated-sorted-array-ii/0154-find-minimum-in-rotated-sorted-array-ii.cpp | class Solution {
public:
int findMin(vector<int>& nums) {
int l=0,r=nums.size()-1;
while(l<=r){
int mid = l+(r-l)/2;
if(nums[mid]>nums[r]) l=mid+1;
else if(nums[mid]<nums[r]) r=mid;
else r--;
}
return nums[l];
}
}; | ALGO | 0.999989 | 5.980591 |
1e9a3953-61be-48e4-b76f-cb0c70d52881 | ritchann/Anthill-simulator | Enemy.cpp | #include "Enemy.h"
Enemy::Enemy()
{
srand(time(0));
x = 41;
y = rand() % 23;
attackTime = 25 + rand() % 35;
intervalBetweenAttacks = 10 + rand() % 20;
livespan = 1;
texture.loadFromFile("images/Enemy.png");
sprite.setTexture(texture);
sprite.setPosition(x * 32, y * 32);
}
Sprite Enemy::getSprite() { return... | ALGO | 0.859053 | 3.089747 |
3c57f299-b280-431a-b2f4-d736e3e90f8e | syednajamusaqib/180daysofcode | Day35/Group Anagrams.cpp | class Solution {
public:
string newWord(string str){
vector<int> freq(26,0);
for(auto ch: str){
freq[ch-'a']++;
}
string result = "";
for(int i = 0; i < 26; i++){
if(freq[i] > 0){
result += string(freq[i], i + 'a');
}
... | ALGO | 0.999997 | 6.54706 |
1f54e885-7695-43b6-a936-7e67df69431f | Alvee78/Codeforces | Increasing_Array.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define FIO ios::sync_with_stdio(false);cin.tie(nullptr);
void solve() {
int n;
cin >> n;
ll a[n];
for(int i = 0; i < n; i++) {
cin >> a[i];
}
ll ans = 0;
for(int i = 1; i < n; i++) {
... | ALGO | 0.999886 | 3.836972 |
59cceace-3af3-4e5c-8e37-521897dcb181 | kmoreau-cstj/A2021SolutionLabos101 | ProjetEnCours/Labo09Vecteurs.cpp | // But : Utiliser les vecteurs pour stocker une grande quantit de valeurs de mme type
// Auteur : Karine Moreau
// Date : 2021-11-01
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
setlocale(LC_ALL, "");
// Dclaration des constantes
const int NB_ETUDIANTS = 10... | TOOL | 0.951722 | 3.4469 |
b637cf1d-f540-4fed-a571-b604508e2f61 | captainnghia/CandCPPVns | Mang2Chieu/Mang2ChieuVuong/FileName.cpp | #include <stdio.h>
#include <conio.h>
#include <math.h>
#define MAX 100
// n tuong trung cho so dong va so cot
void NhapMaTran(int a[][MAX], int n) {
/*for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
printf("\nNhap vao a[%d][%d] = ", i, j);
scanf_s("%d", &a[i][j]);
}
}*/
for (int i = 0; i < ... | ALGO | 0.999405 | 3.078221 |
a276f702-480d-46c9-ac73-121237e7e376 | Mehulcoder/Codeforces | Random_Problems/139.cpp | class Solution {
public:
set<string> m;
string s1;
vector<int> dp;
bool get(int end) {
if (m.find(s1.substr(0, end + 1)) != m.end()) {
return 1;
}
int &anss = dp[end];
if (anss != -1) return anss;
for (int len = 1; len < end + 1; len++) {
bool ans = 0;
if (m.find(s1.substr(len, end - len + 1)) !... | ALGO | 0.999633 | 5.885852 |
2a9b8530-8cbf-410c-b7f1-d8b0adca7932 | ishandutta2007/codeforces | basic_string/normal/753/C.cpp | #include<bits/stdc++.h>
using namespace std;
struct P{
int a[4];
}a;
basic_string<P>u,v;
map<pair<int,int>,int>mp;
bool f[13];
int x,y;
void dfs(int x){
if(x>3)return void(u+=a);
for(int i=0;i<10;++i)if(!f[i])f[i]=1,a.a[x]=i,dfs(x+1),f[i]=0;
}
bool chk(P b){
int i,u=0,v=0;
for(i=0;i<4;++i)if(b.a[i]==a.a[i])++u;
... | ALGO | 0.999584 | 3.166772 |
b03d0f00-053a-46d7-89cb-22bed564523c | yuiandyuki/bustub | src/optimizer/optimizer_custom_rules.cpp | #include "execution/plans/abstract_plan.h"
#include "optimizer/optimizer.h"
// Note for 2022 Fall: You can add all optimizer rule implementations and apply the rules as you want in this file. Note
// that for some test cases, we force using starter rules, so that the configuration here won't take effects. Starter
// r... | ALGO | 0.965275 | 6.637854 |
a15a6703-2d4b-451f-943a-866bff81c68e | IshanX111/CODEFORCES | B. Maximums.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,i,x;
cin>>n;
int a[n];
x=0;
for(i=0;i<n;i++){
cin>>a[i];
}
for(i=0;i<n;i++){
a[i]+=x;
x=max(a[i],x);
}
for(i=0;i<n-1;i++){
cout<<a[i]<<" ";
}
cout<<a[i]<<endl;
}
| ALGO | 0.999969 | 3.170969 |
d1ce867d-0a75-4416-bb7a-1843c55b191a | AjajAlam1399/Leetcode-Aj | 2271-rearrange-array-elements-by-sign/rearrange-array-elements-by-sign.cpp | class Solution {
public:
vector<int> rearrangeArray(vector<int>& arr) {
queue<int>neg;
queue<int>pos;
int n=arr.size();
for(int i=0;i<n;i++){
if(arr[i]<0){
neg.push(arr[i]);
}
if(arr[i]>0){
pos.push(arr[i]);... | ALGO | 0.999962 | 5.603681 |
7f15f583-36e1-4080-b9d9-ca431347e932 | Harshkaushik04/striverA2Z | DP/25_longest_common_subsequence_string/25_longest_common_subsequence_string_optimized_striver.cpp | #include<bits/stdc++.h>
using namespace std;
int longestCommonSubsequence(string text1, string text2) {
int size1=text1.size();
int size2=text2.size();
int temp;
vector<int> current(size2+1,0);
vector<int> last(size2+1,0);
//base case is that at any size=0,=0
for(int i=1;i<=size1;i++){
... | ALGO | 0.999942 | 5.637079 |
63e0ec4f-c575-4bc9-bc1d-10220912ddfd | sahuankit010/LeetCode-Solutions | 98-validate-binary-search-tree/98-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.999676 | 6.147767 |
f64d0d73-9e00-4bfb-a74a-0b91dab97c58 | Asadujjaman47/PRADUM_DSA | Week1/W01D05E04.2.cpp | // Find digit count usng while loop:
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cout << "Enter your digit: ";
cin >> n;
cout << "\n";
int digit = 0;
while(n) {
digit++;
n = n/10;
}
cout << digit;
return 0;
} | ALGO | 0.999743 | 4.0557 |
845e22b3-4d7b-4a5c-85ce-f2df37beff14 | Amitkumaramit118589/Leetcodesolutions | 2050-count-good-numbers/count-good-numbers.cpp | class Solution {
public:
const int M = 1e9 + 7;
long long fpow(long long n, long long m) {
if (m == 0) return 1;
long long half = fpow(n, m / 2);
long long res = (half * half) % M;
if (m % 2 == 1) res = (res * n) % M;
return res;
}
int countGoodNumbers(long long... | ALGO | 0.999977 | 6.088428 |
e637a826-1f1c-4433-a88c-9f388567f9ca | Achno2k/Data-Structures-and-Algorithms | CodeForces_Problems/1881A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve() {
ll n, m;
cin >> n >> m;
string x, s;
cin >> x;
cin >> s;
for (int i = 0; i<6; i++) {
if (x.find(s) != string::npos) {
cout << i << '\n';
return;
}
x += x;
}
cout << -1 << '\n';
}
int main() {
ll t;
cin >> t;
whi... | ALGO | 0.999868 | 4.573612 |
8610df22-4cd7-4bd4-bc2e-a8b4d0cfa006 | kennent/for_scsc_code_save2 | atcoder/ABC357/a.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using pii = pair<int, int>;
int n, m, h[100];
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> n >> m;
for (int i = 1; i <= n; i++) {
int h;
cin >> h;
if (m >= ... | ALGO | 0.999985 | 4.458932 |
3f99ba5e-e597-4410-a3c9-2f450d78ee29 | simgksk/Baekjoon | Cpp/31xxx/31306.cpp | #include <iostream>
using namespace std;
int main()
{
string s;
int vowels = 0;
int vowelsY = 0;
cin >> s;
for (int i = 0; i < s.length(); i++)
{
if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u')
vowels++;... | ALGO | 0.999176 | 4.728744 |
fb77560a-afcf-4577-bdab-f59d26052d80 | AlexanderPro/Stepik | YandexIntroCpp/1_5/1_5_6.cpp | /*
Дано натуральное число N. Выведите слово YES, если число N является точной степенью двойки, или слово NO в противном случае.
Формат входных данных
Вводится натуральное число.
Формат выходных данных
Выведите ответ на задачу.
Sample Input 1:
1
Sample Output 1:
YES
Sample Input 2:
2
Sample Output 2:
YES
*/
#incl... | ALGO | 0.999911 | 5.149605 |
2ded9627-1780-4aca-a82f-19abde794239 | pradeepkarn/wed | wed_app/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998936 | 6.76073 |
85065d00-2863-4d0c-9d71-159eceb23ae6 | Kim0914/AlgoGYM | JINSEOP/백준_혼자_풀기/DP/외판원 순회.cpp | #include <iostream>
#include <cstring>
using namespace std;
#define INF 999999999
int num = 0, graph[16][16];
int dp[16][1 << 16];
int dfs(int curr, int visit) {
if (visit == (1 << num) - 1) {
// 모든 도시를 다 방문했다면?
if (graph[curr][0] == 0)
return INF;
// 출발지를 의미하는데, 출발지가 0이라면 갈 수 없는 곳이... | ALGO | 0.999933 | 4.12462 |
bdfc3980-6dff-47f2-8e23-a032dcc8bde4 | RajMakkad/LeetCode | 1345-jump-game-iv/1345-jump-game-iv.cpp | class Solution {
public:
int minJumps(vector<int>& a){
int n = a.size();
vector<int> steps(n,1e9);
map<int,vector<int>> g;
steps[0] = 0;
for(int i = 0;i<n;i++){
g[a[i]].push_back(i);
}
queue<int> q;
q.push(0);
while(q.size()){
... | ALGO | 0.999944 | 5.31483 |
fd39450a-51b7-45eb-bdc8-bf8e28752c3b | pedroxc/Marlin-Software---SPQR | Marlin-bugfix-2.1.x/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
// Digital PinName array
const PinName digitalPin[] = {
PA_0, // Digital pin 0
PA_1, // Digital pin 1
PA_2, // Digital pin 2
PA_3, // Digital pin 3
PA_4, // Digital pin 4
PA_5, // Digital pin 5
PA_6, // Digital pin 6
PA_7, // Dig... | CONFIG | 0.863399 | 6.185098 |
336d0d38-b245-4fdb-9173-a3ff13754cdb | AlexandruOlteanu/CompetitiveProgramming | template/NumberTheory/ModInt.cpp | // ========================================================================
// = Modular Int taken from tourist, respect
// =
// = This template provides a type-safe modular arithmetic class `Modular<T>`
// = for computations under a fixed modulus. It supports all basic arithmetic
// = operations and combination (nCk) ... | ALGO | 0.984246 | 6.427019 |
56c0536e-c5b3-42b4-a28d-2bf2ac1c17d1 | anant147/Coding-Problems | ImpTopic/tp7.RabinKarpSubstringSearch.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<unordered_map>
#include<queue>
#include<stack>
#include<cmath>
#include<cstring>
using namespace std;
bool rabinKarpSubstringSearch(string text, string pattern)
{
int i,j,k,u,v,x,y,z;
int tlen = text.size();
int plen = pattern.size(... | ALGO | 0.999974 | 5.167843 |
764bb187-13a2-4344-8d41-a6399b735843 | ishandutta2007/codeforces | pavelkunyavskiy/normal/367/A.cpp | //#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdi... | ALGO | 0.999966 | 3.292304 |
08555b47-0280-49e8-bd90-4a8a798575b9 | Vegas30/Top | Homework/HW7/Ex4_2 Простые числа/Ex4_2 Простые числа.cpp | // Ex4_2 Простые числа.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
/* Создать программу, которая выводит на экран простые числа в диапазоне от 2 до 1000. (Число называется простым, если оно делится только на 1 и на само себя без остатка; причем число 1 простым не счит... | ALGO | 0.985715 | 4.905507 |
ab15b4b2-d6de-442e-939a-848020f27714 | vasilkadt/Data_structures_and_algorithms_FMI | Linked_list/LinkedListOperations/LinkedListOperations.cpp | #include <string>
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode* next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
class SinglyLinkedList {
public:
SinglyLinkedLis... | ALGO | 0.999669 | 4.156257 |
42260552-13e2-4707-85e1-78ffb1192c5a | 565353780/multi-fetch-ros | navigation/costmap_2d/src/costmap_math.cpp | #include <costmap_2d/costmap_math.h>
double distanceToLine(double pX, double pY, double x0, double y0, double x1, double y1)
{
double A = pX - x0;
double B = pY - y0;
double C = x1 - x0;
double D = y1 - y0;
double dot = A * C + B * D;
double len_sq = C * C + D * D;
double param = dot / len_sq;
double... | ALGO | 0.999044 | 5.157523 |
fbaa8089-df73-49da-8b8d-c0f249c3beb3 | raincross7/code-similarity | codes/train_code/problem441/problem441_461.cpp | #include <bits/stdc++.h>
using namespace std;
int digit(long long n){
string s = to_string(n);
return (int)s.size();
}
int main() {
long long N;
cin >> N;
int ans = 1000000;
for (long long A = 1; A < sqrt(N) + 10; A++){
if (N % A) continue;
long long B = N / A;
ans = min(ans, max(digit(A), ... | ALGO | 0.999737 | 4.687022 |
9e5079a6-e78c-4622-b0d3-307716c8b067 | raincross7/code-similarity | codes/train_code/problem102/problem102_427.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define sz(x) int(x.size())
using namespace std;
using ll = long long;
using P = pair<int ,int>;
const int INF = 1001001001;
const int MOD... | ALGO | 0.999946 | 3.961851 |
3e81e606-94bc-4691-8a7f-abfa3d77185a | nmpogg/CodePTIT | c++/thi_thu_thcs2_28tech_test4/bai5.cpp | #include <bits/stdc++.h>
using namespace std;
struct word{
string data;
int fre;
};
bool cmp(word a, word b){
if(a.fre != b.fre) return a.fre > b.fre;
return a.data < b.data;
}
int main(){
word ds[4];
ds[0].data = "good";
ds[1].data = "bad";
ds[2].data = "wonderful";
ds[3].data = "terrible";
for(int i = 0;... | ALGO | 0.999676 | 4.31406 |
7971170e-0a45-45e9-8795-9fc3a60c22a3 | Toysoft/NNvision | darknet_nvenc/opencv-3.4.4/modules/videostab/src/inpainting.cpp | #include "precomp.hpp"
#include <queue>
#include "opencv2/videostab/inpainting.hpp"
#include "opencv2/videostab/global_motion.hpp"
#include "opencv2/videostab/fast_marching.hpp"
#include "opencv2/videostab/ring_buffer.hpp"
#include "opencv2/opencv_modules.hpp"
namespace cv
{
namespace videostab
{
void InpaintingPipel... | TOOL | 0.89997 | 6.595628 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.