uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c5cbcf2a-f680-4290-a5d3-1c9411b14adf | vishalsahare/TLE-Eliminator | Concepts/primeFactorsSieveOfEratosthenes.cpp | #ifndef ONLINE_JUDGE
#include "../debugger.hpp"
#else
#include <bits/stdc++.h>
using namespace std;
#endif
//------------
#define endl "\n"
#define uint uint64_t
#define int int64_t
const int MOD = 1e9 + 7;
const int INF = LONG_MAX > 1;
//------------
void solve() {
uint n;
cin >> n;
vector<bool> isPr... | ALGO | 0.999836 | 5.239171 |
3a63d92c-91ee-4aed-b5fc-379c53c66a13 | YBenPan/Competitive-Programming | Codeforces/1324B.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
int a[5005];
a[0] = -1;
a[5001] = -1;
int cnt[5005] = {0};
for (int i = 1; i <= n; ++i)
... | ALGO | 0.999875 | 4.106843 |
8bfde47c-9f31-49e1-929a-32ab42ac8e84 | Xandones/VectorInverter | VectorInverter.cpp | #include <iostream>
using namespace std;
void ShowVector(int *Vector, int VectorSize); // Uses a pointer to the 1st array element to display the whole array.
int *InvertVector(int *Vector, int VectorSize); // Returns a pointer for the 1st element of the inverted array.
int main()
{
int Array[] = { 2, 4, 6, 8, 10, 12... | ALGO | 0.975425 | 5.33541 |
cec656c7-914f-49e6-abc0-fa17850ca1c9 | Simply-divine/Competitive | codeforces/cf634/e.cpp | // Author : Hardik Upadhyay
// college: SVNIT
// slogan : Ab to phod dunga
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define rrep(i,a,b) for(int i = a ; i >= b; i--)
#define debu... | ALGO | 0.999608 | 3.940168 |
2d7baf9d-44ed-4ba7-902b-78aaa3d3cfdb | ishandutta2007/codeforces | risujiroh/normal/793/A.cpp | // #pragma GCC optimize("Ofast")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt")
// #define NDEBUG
#include <bits/extc++.h>
#include <x86intrin.h>
struct rep {
struct iter {
int i;
constexpr void operator++() { ++i; }
constexpr int operator*() const { return i; }
friend constexpr bool operator!=(iter a... | ALGO | 0.999939 | 4.087121 |
fea8a871-b35d-42b8-a6f9-8a48dc8fa990 | Williamarvin/innonautics_moos_dev | moos-ivp/ivp/src/uHelmScope/IterBlockHelm.cpp | /*****************************************************************/
/* NAME: Michael Benjamin */
/* ORGN: Dept of Mechanical Engineering, MIT, Cambridge MA */
/* FILE: IterBlockHelm.cpp */
/* DATE: Apr 12th 2008 ... | ALGO | 0.885432 | 3.599441 |
ca7047c9-58f0-4099-a0fe-db7e5bf8b5d2 | oahiroaki/aoj | c++/0026.cpp | #include <cstdio>
using namespace std;
const int MAX = 10;
int map[MAX][MAX] = {0};
const int def[12][2] = {
{1, 0}, {-1, 0}, {0, 1}, {0, -1},
{1, 1}, {-1, 1}, {1, 1}, {1, -1},
{2, 0}, {-2, 0}, {0, 2}, {0, -2}
};
void drop(int *p, int size) {
int x , y;
for (int i = 0; i < size * 4; i++) {
x = p[0] +... | ALGO | 0.995285 | 3.90575 |
4c14b04e-b699-4398-b387-9ce6774c694f | jasleon/Inverted-Pendulum | src/riccati_solver.cpp | /*
// solvers for Algebraic Riccati equation
// - Iteration (continuous)
// - Iteration (discrete)
// - Arimoto-Potter
//
// author: Horibe Takamasa
*/
#include <riccati_solver.h>
bool solveRiccatiIterationC(const Eigen::MatrixXd &A, const Eigen::MatrixXd &B,
const Eigen::MatrixXd &Q, cons... | ALGO | 0.999987 | 6.121538 |
767ee2da-d526-435d-9882-f6a7c56bf046 | polardb/polardbx-engine | extra/icu/icu-release-69-1/source/i18n/search.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION
#include "unicode/brkiter.h"
#include "unicode/schriter.h"
#include "unicode/search.h"
#include "usrchimp.h"
#include "cmemory.h"
// public constructors and destructors -----------------------------------
U_NAMESPACE_BEGIN
SearchIt... | TOOL | 0.852438 | 4.234629 |
64349fbc-f43c-48d3-b00b-7ec14ac43f5a | AlyssaChen2003/Data-Security | 零知识实践证明/libff-176f3f42fdef791f12b24417a400c4b6d386863c/libff/algebra/curves/bn128/bn128_pp.cpp | /** @file
*****************************************************************************
* @author This file is part of libff, developed by SCIPR Lab
* and contributors (see AUTHORS).
* @copyright MIT license (see LICENSE file)
***********************************************************************... | ALGO | 0.988714 | 6.815325 |
de9b01b4-b634-451f-8390-85414bd47ecc | EnzoIdk/Programacion-2-24-1 | Proyectos Programación 2/Examen Parcial/OrdenaColaRecursivo/main.cpp | /*
* File: main.cpp
* Author: Enzo
*
* Created on 13 de mayo de 2024, 11:39 PM
*/
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
#include "BibliotecaColaGenerica.h"
#include "PilaGenerica.h"
#include "FuncNumeros.h"
int main(int argc, char** argv) {
void *cola;
... | ALGO | 0.988375 | 4.342761 |
902b9c37-4253-4350-abfb-b4b941949e96 | chetan0402/CodeForces | 1950/1950B.cpp | #include<iostream>
using namespace std;
int main(){
int times;
cin >> times;
for(int ignored=0;ignored<times;ignored++){
int scale;
cin >> scale;
scale*=2;
for(int i=0;i<scale;i++){
for(int j=0;j<scale;j++){
if((i/2+j/2)%2){
... | ALGO | 0.999654 | 3.512542 |
260941dc-19d9-44f0-abf9-ced412e1cbe7 | ishandutta2007/codeforces | 3.141592653/normal/464/D.cpp | #include<cstdio>
typedef double db;
db dp[1111];
int n,k;
int main()
{
scanf("%d%d",&n,&k);
for(register int i=n,ii;i;i--)
for(ii=1;ii<=1000;ii++)
{
int a=k*(ii+1);
dp[ii]=(dp[ii]*(a-1)+(ii+1)*.5*ii+(dp[ii+1]+ii))/a;
}
printf("%.12lf\n",dp[1]*k);
} | ALGO | 0.999567 | 3.177014 |
52a3d123-798d-4b15-8c92-71acfd1d2299 | prasenjal07/Coding_C- | erucrsive.cpp | #include<iostream>
using namespace std;
void reverse(string s){
if(s.length()==0){
return;
}
string reststring = s.substr(1);
reverse(reststring);
cout<<s[0];
}
int main(){
string s;
cin>>s;
reverse(s);
return 0;
} | ALGO | 0.999897 | 3.864298 |
8594759f-7c15-4897-a7ed-80f1039b5990 | ParkDaeYi/Algorithm_Study | 1865.cpp | #include <iostream>
#include <vector>
#define INF 1e9
using namespace std;
typedef pair<int, int> pii;
int t, n, m, w, s, e, dist[501];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> t;
while (t--) {
cin >> n >> m >> w;
fill(dist, dist + n + 1, INF);
vector<pii> graph[501];
fo... | ALGO | 0.999681 | 4.799999 |
bf555a48-1ad0-410f-8fab-2fa4f417b791 | jylin34/Cpp | Codeforces/Educational Codeforces Round 118 (Rated for Div. 2)/B_Absent_Remainder.cpp | /*******************************************************/
/* https://codeforces.com/contest/1613/problem/B */
/* B. Absent Remainder */
/* Author: Jinyulink */
/* Date: 2021/12/02(WEN) */
/*****************************... | ALGO | 0.999791 | 3.862776 |
f6b4ff68-42d4-439d-ac58-0c15cee14ff9 | ishandutta2007/codeforces | eddy1021/normal/908/F.cpp | // eddy1021
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
#define mod9 1000000009LL
#define mod7 1000000007LL
#define INF 1023456789LL
#define INF16 10000000000000000LL
#define... | ALGO | 0.999733 | 4.159266 |
7686a64a-ee99-42b4-ba7c-71d1f6b08c83 | Ford-z/Nowcoder | Netease/圆环切割.cpp | #include<iostream>
using namespace std;
const int maxn=1e5+5;
long long a[maxn];
int main(){
int t,n;
cin>>t;
while(t--){
cin>>n;
long long sum=0;
for(int i=0;i<n;i++){
cin>>a[i];
sum+=a[i];
}
if(sum%2!=0){
cout<<"NO"<<endl;/*若为奇数... | ALGO | 0.999868 | 3.748175 |
90fadc89-c1af-4757-81c2-e8f9e28c1c59 | mwang98/leetcode-practice | 2498-frog-jump-ii/2498-frog-jump-ii.cpp | /*
* @lc app=leetcode id=2498 lang=cpp
*
* [2498] Frog Jump II
*/
// @lc code=start
#include <vector>
using namespace std;
class Solution {
public:
int maxJump(vector<int>& stones) {
int max_dist = 0;
int forward_prev = stones[0];
int backward_prev = stones[0];
for (int i = 1; ... | ALGO | 0.999354 | 5.731504 |
1624a2d0-e8de-41ef-8306-9da3325c65db | felipetsantos/opengl-game-bloxorz | Source/main.cpp |
/****************************************
* I N C L U D E S
****************************************/
#include "bibutil.h"
#include <list>
#include <vector>
#include <fstream>
#include <sstream>
#include <string.h>
#include <time.h>
#include "FrameTimer.h"
/****************************************
* D E F I N E ... | TOOL | 0.96295 | 3.357465 |
39c09a01-bbdc-45ab-b404-fd205e58dbeb | LiangYingC/itemhub | firmware/particle-io-photon/mbedtls/aesni.cpp | /*
* [AES-WP] http://software.intel.com/en-us/articles/intel-advanced-encryption-standard-aes-instructions-set
* [CLMUL-WP] http://software.intel.com/en-us/articles/intel-carry-less-multiplication-instruction-and-its-usage-for-computing-the-gcm-mode/
*/
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
... | ALGO | 0.998436 | 3.98719 |
1f0ed3cc-7473-4513-a1cf-785b71f6d68c | PiyushMahamuni/cpplearning | Learning/Coding_challenge/main.cpp | #include<iostream>
#include<string>
#include<sstream>
#include<iomanip>
using namespace std;
struct cursor{
static const string up;
static const string rw_line;
static const string bold;
static const string reset;
};
const string cursor::up{"\033[A"};
const string cursor::rw_line{"\r"};
const string c... | ALGO | 0.975913 | 5.176149 |
86653365-55bb-44ec-a990-177f113745cd | MolokanovAD/OOP | Project2/Strophoid.cpp | #include "Strophoid.h"
#include <strstream>
#include <stdio.h>
#include <string.h>
double const PI = 3.1415926535;
namespace Project2 {
Strophoid::Strophoid(double par){
if(par == 0)
throw std::exception("Invalid parameter");
a = par;
}
double plus() { return 2 + PI / 2; }
double minus() { return 2 - PI / 2... | ALGO | 0.995426 | 5.19545 |
2e0752ae-b6b0-4d58-83c6-c5801e4a5488 | zzFon/Algorithm-Templates_Cpp | all/高精度-加法.cpp | #include<iostream>//+ O(max(lenA,lenB))
using namespace std;//ûʲôģģӷŻΪ10000
#include<cstdio> //ע⣺1.
#include<cstring>
#define maxl 500+5
string a1,b1;
unsigned short a[maxl],b[maxl],c[maxl+1];//c[maxl+1]
int la,lb,l;
void init()
{
la=a1.length();lb=b1.length();
memset(a,0,sizeof(a));memset(b,0,sizeof(b));// ... | ALGO | 0.999933 | 3.548319 |
2d7e4bea-83e1-42ec-a701-61c9bf10a0e1 | palilo815/ps | baekjoon/11000/11653.cpp | #include <stdio.h>
int main()
{
int n; scanf("%d", &n);
int mod = 2;
while (n > 1) {
while (n % mod == 0) {
n /= mod;
printf("%d\n", mod);
}
++mod;
}
return 0;
} | ALGO | 0.999974 | 3.6023 |
31fe5cd0-070b-4939-94c0-89fe5c85bcb7 | Didarul342/Problem-Solving | C++/Beecrowd/1245.cpp | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int direita[70], esquerda[70];
int main() {
int n;
while (scanf("%d", &n) != EOF) {
memset(direita, 0, sizeof(direita));
memset(esquerda, 0, sizeof(esquerda));
while (n--) {
int tamanho;
... | ALGO | 0.999642 | 3.701806 |
b83e6a0c-c436-4238-867b-a1efb76fb6f8 | Martinho672/mini_curso_flutter_loginApp | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
608a0570-e98e-44c9-811e-1e10db4058f3 | CyberBoyAyush/gfg | Difficulty: Easy/Kth largest element in BST/kth-largest-element-in-bst.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node {
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// Function to Build Tree
Node* buildTree(string str)
{
// Corner Case
if(str.length(... | ALGO | 0.999864 | 6.083736 |
8651fc78-789c-4a66-9dff-f1809ce63d59 | VladiqDanilov/Vdanilov_CPP-control-tasks | Control Task9.1/Control Task9.1.cpp | #include <iostream>
#include <cmath>
#include <stdexcept>
using namespace std;
class TriangleError : public exception
{
public:
TriangleError(const string& message) : message(message) {}
const char* what() const
{
return message.c_str();
}
private:
string message;
};
class Triangle
{
... | ALGO | 0.943053 | 5.372758 |
30d9a8f0-4af6-4b76-9124-3c8b8cb6b10b | sstuqtd/vocal | thridparty/boost/libs/hana/example/tutorial/integral-branching.cpp | #include <boost/hana.hpp>
#include <boost/hana/ext/std/integral_constant.hpp>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>
namespace hana = boost::hana;
namespace ns1 {
//! [make_unique.if_]
template <typename T, typename ...Args>
std::unique_ptr<T> make_unique(Args&&... args) {
ret... | TOOL | 0.87435 | 7.461731 |
a38378c8-7c77-4d0f-bbf5-646b2c0b2810 | cannontwo/cannon | scripts/project_euler/euler_problem_37.cpp | #include <iostream>
#include <cassert>
#include <cmath>
#include <algorithm>
#include <cannon/log/registry.hpp>
#include <cannon/math/primes.hpp>
#include <cannon/math/digits.hpp>
using namespace cannon::log;
using namespace cannon::math;
/*!
* The number 3797 has an interesting property. Being prime itself, it is
... | ALGO | 0.999661 | 6.387688 |
50113c71-2ef1-4d8c-bf14-5ec9e5e153bb | Kikashii/oop-lab | Lab 11 12 13/131_L12_T02.cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
T amax(T *arr, int size, int n)
{
T brr[size];
copy(arr, arr + size, brr);
sort(brr, brr + size, greater<T>());
return brr[n - 1];
}
int main()
{
int x;
// int arr1[15];
// for (int i = 0; i < 15; i++) //insert elements
/... | ALGO | 0.992553 | 3.333558 |
41bb43f9-c318-4132-9af2-8f4c8e874df1 | lazy-chess-player/daily_problem | Problem_CodeForces/2024/08/20/Slimes.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <cstring>
#include <cstdio>
#include <string>
#include <queue>
#include <stack>
#include <map>
#include <list>
#include <bitset>
#include <cmath>
#include <nu... | ALGO | 0.99991 | 3.711716 |
4482acfa-0b3a-4616-a25d-40c1fde807b4 | akshaybaviskar/mlir | libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound_comp.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T, class Compare>
// constexpr Iter // constexpr after c++17
// lower_bound(Iter first, Iter last, const T& value, Compare comp);
#include <algorithm>
#include <functional>
#include <vector>
#include <cassert>
#include <cstddef>
#include "test_macros.h"
#... | TEST | 0.996408 | 6.993325 |
df0db165-e909-44d5-adc1-6036f4d15386 | InvictrixRom/system_core_old | adb/client/usb_libusb.cpp | #include "usb.h"
#include "sysdeps.h"
#include <stdint.h>
#include <atomic>
#include <chrono>
#include <memory>
#include <mutex>
#include <string>
#include <thread>
#include <unordered_map>
#include <libusb/libusb.h>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/quick_exit... | TOOL | 0.930892 | 4.953814 |
8cff34c6-b4c2-4a0c-93c8-6e07015d3d39 | pandabcd/algorithmic_code | codeforces/892_c.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
int getGCD(int a, int b){
int A = min(a,b), B = max(a,b);
if(A==0){
return B;
}
return getGCD(B%A, A);
}
int main() {
int n;
cin>>n;
int a[n], count_zeros = 0, gcd, ans = 100000;
for(int i=0;i<n;i++){
cin>>a[i];
count_zeros += (a[i]==1? ... | ALGO | 0.999961 | 4.009769 |
2ac7f223-78c0-4440-8864-97fab2db3326 | SakolB/PracticeProgramSolving | playlist.cpp | #include <iostream>
#include <map>
using namespace std;
int main()
{
//solved using sliding windows
//This is a longest non repeating subsequence problem
//create a map called played and mark all element to false
//then use the left and right pointer to slide the windows
//then start by sliding the... | ALGO | 0.999974 | 3.943607 |
53924a9d-2751-4c32-8325-649bdd2c164e | R-Cramer4/AdventOfCode | Advent2022/day9/day9.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
int moveTail(int * tailLoc, int * headLoc, std::vector<std::vector<int> > * spacesVisated){
// moves tail in reference to where the head is
// check if tail and head are the same
if(tailLoc[0] == headLoc[0] && tailLoc[1] == headLoc[1]){
... | ALGO | 0.999521 | 4.929531 |
ecfffde5-885c-45cb-bdb7-9b321d126a0d | foreloner87/Guvi-player | stringdifferby1.cpp | #include<iostream>
using namespace std;
int main()
{
string s1,s2;
cin>>s1>>s2;
int cmp,count=0;
if((s1.length())>= (s2.length()))
cmp=s1.length();
else
cmp=s2.length();
count=cmp;
for(int i=0;i<cmp;i++)
if(s1[i]==s2[i])
--count;
if(count==1)
cout<<endl<<"Yes";
else
cout<<endl<<"No";
return 0;
}
| ALGO | 0.999992 | 3.214368 |
93f98532-bb0e-476a-a3ea-ffde85b85a45 | dnr2/maratona | UVa/11902 - Dominator.cpp | //http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=229&page=show_problem&problem=3053
//#tag graph / grafos
//#tag BFS / DFS
//#sol test for each node if it's reachable from the node 0, now for each node x = 0 .. N test if the other nodes can be
//reached if you remove the node x from the ... | ALGO | 0.999589 | 3.657881 |
ca3f8950-0429-451b-aee9-49fa1ae8e1f9 | lvirgili/programming_challenges | rosalind/rosalind_GC.cpp | #include <iostream>
#include <map>
#include <string>
#include <iomanip>
using namespace std;
int main() {
char ch;
string name, greater_name;
double max = 0;
cin >> ch;
while (cin >> name) {
//cout << name << endl;
map<char, int> nt;
unsigned total = 0;
... | ALGO | 0.996145 | 3.92159 |
18571459-c5fc-4b80-b261-3eeb09afb93e | eh2ll/algorithm | 40-49/bj2742.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int N; cin >> N;
assert(N == 5);
for(int i = N; i > 0; i -= 1){
cout << i << '\n';
}
return 0;
} | ALGO | 0.999843 | 3.620131 |
93f7ea77-d53a-433c-b491-12f9bb32be66 | akhilr007/Leetcode-problems | Count Inversions - GFG/count-inversions.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// arr[]: Input Array
// N : Size of the Array arr[]
// Function to count inversions in the array.
long long int ic=0;
vector<long long> merge(vector<long long>& left, vector<... | ALGO | 0.999783 | 5.858443 |
63b18669-52e8-47ca-9941-e4ac7c976a8c | sarvex/leetcode-zsh | solution/0100-0199/0108.Convert Sorted Array to Binary Search Tree/Solution.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.999998 | 7.195937 |
f5569e7f-b5c6-4e8f-953a-39616b3f725a | RuddyGuerrero/Competitive-Programming | Competitions/Codeforces/contest_894/D. Ralph And His Tour in Binary Country.cpp | /*
2017-11-21 06:07:28
https://codeforces.com/contest/894/problem/D
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int64;
const int MAX = 1e6 + 5;
int n, m, x, y;
int64 a[MAX];
vector <int64> d[MAX], t[MAX];
int64 Query (int x, int64 y){
int64 dis = 0, sol = 0;
while (x > 0){
... | ALGO | 0.999854 | 3.883083 |
86735b64-af7a-41c9-bd7a-7ee01c3e3909 | dustingarner/LeetcodeProblems | Leetcode1701.cpp | class Solution {
public:
double averageWaitingTime(vector<vector<int>>& customers) {
double totalWaitingTime = 0.0;
int currentTime = customers[0][0];
for(int i = 0; i < customers.size(); ++i){
currentTime = currentTime > customers[i][0] ? currentTime : customers[i][0];
... | ALGO | 0.999807 | 6.17146 |
2b590323-ad32-413f-b1a8-14c6f1602fbd | barryZZJ/Data-Structure-Hmwk-Prjct | project/project_1/2-dLink.cpp | #include "1.cpp"
#include <iostream>
using namespace std;
const int MAXTERM = 1024;
struct term
{
int coeff;//系数
int expo;//指数
term() {}
term(int _coeff, int _expo) {
coeff = _coeff;
expo = _expo;
}
term(const term & t) {
coeff = t.coeff;
expo = t.expo;
}
};
//return sum of a, b
Link<term>* sum(Link<... | ALGO | 0.998865 | 3.545347 |
082a11a8-42ba-4040-9ab0-e8303806467a | sjm150/ps | baekjoon/2346/solution.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
int n; cin >> n;
deque<pair<int, int>> dq;
for (int i = 1; i <= n; i++) {
int c; cin >> c;
dq.emplace_back(i, c);
}
while (!dq.empty()) {
auto [i, c] = dq.front(); dq.po... | ALGO | 0.999998 | 4.021745 |
e8c17cab-921c-4a09-9a63-e59d1fa71d2f | Aarnachauhan/DSA- | sorting algorithms/bubble sort recursive.cpp | #include <bits/stdc++.h>
using namespace std;
void bubblesort(int input[], int endindex){
if(endindex==0) return;
for(int i=0;i<endindex;i++){
if(input[i]>input[i+1]){
int temp=input[i];
input[i]=input[i+1];
input[i+1]=temp;
}
}
bubblesort(input, endin... | ALGO | 0.999579 | 4.534999 |
b3a879f5-89af-4c4f-9b53-ded7d12e209b | dvaitam/codeforces | 0-999/0-99/20-29/28/solE.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
using namespace std;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(in... | ALGO | 0.999965 | 3.522101 |
f7e1afb5-cf83-4e7b-810b-0b3207045bca | SCgeeker/lsj-book-zh_tw | renv/library/R-4.2/x86_64-w64-mingw32/Rcpp/examples/Misc/piSugar.cpp |
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
double piSugar(const int N) {
NumericVector x = runif(N);
NumericVector y = runif(N);
NumericVector d = sqrt(x*x + y*y);
return 4.0 * sum(d < 1.0) / N;
}
| ALGO | 0.99143 | 5.799429 |
4e43eefc-d49e-4024-b324-d6e4253828b0 | tianyicaii/leetcode | cpp/selected/0004-median-of-two-sorted-arrays.cpp | #include <algorithm>
#include <cstddef>
#include <vector>
// eliminate k/2 elements on each iteration (quick select)
int find_kth(
std::vector<int>::iterator begin_a,
std::vector<int>::iterator end_a,
std::vector<int>::iterator begin_b,
std::vector<int>::iterator end_b,
int k) {
size_t size_a... | ALGO | 0.999975 | 6.380281 |
38353203-81c0-445a-971e-af348571617b | sumayan7477/C.Tutorial- | learncpp.com#1.0#1/arrays__strings__pointers__and_references/arrays_and_loops/source9.cpp | #include <iostream>
int main()
{
using namespace std;
int nNumber;
do
{
cout << "Enter a number: ";
cin >> nNumber;
} while (nNumber < 1 || nNumber > 9);
int anArray[9] = { 4, 6, 7, 3, 8, 2, 1, 9, 5 };
for (int iii=0; iii < 9; iii++)
cout << anArray[iii] << " ";
... | ALGO | 0.948491 | 3.956942 |
4530c728-1a0b-409a-9d9a-85d4b7eac084 | takamtd/deepmimic | bullet3/examples/ThirdPartyLibs/BussIK/Node.cpp | /*
*
* Mathematics Subpackage (VrMath)
*
*
* Author: Samuel R. Buss, <EMAIL>.
* Web page: http://math.ucsd.edu/~sbuss/MathCG
*
*
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is gr... | ALGO | 0.920006 | 5.781992 |
377ddd2d-37da-4ca0-8ace-68fac0effe1f | New-bottle/training | 2016fall/160914/C.cpp | #include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long double ldb;
const ldb pi = acos(-1);
int n;
int main(){
int cs = 0;
while(scanf("%d",&n) != EOF && n) {
printf("Menu %d: ", ++ cs);
ldb mn = 1e10;
int ans = 0, d, c;
... | ALGO | 0.999531 | 3.005877 |
fe281d13-1e29-4c0d-b10e-b2fc72fe13f7 | Tangshitao/Semi-supervised-Adaptive-Distillation | caffe2/third_party/eigen/doc/examples/Tutorial_BlockOperations_vector.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::ArrayXf v(6);
v << 1, 2, 3, 4, 5, 6;
cout << "v.head(3) =" << endl << v.head(3) << endl << endl;
cout << "v.tail<3>() = " << endl << v.tail<3>() << endl << endl;
v.segment(1,4) *= 2;
cout << "after 'v.segment(1,4) *= 2', v... | ALGO | 0.99726 | 3.093805 |
a085ba7e-dbaf-48c4-9891-70584d14e74d | Izas-Ahamed/dsa-cpp | insertion_sort.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> v = {-1, -4, -2, 4, 6, 2, 3, 1};
int n = v.size();
for (int i = 1; i < n; i++)
{
int previousElementIndex = i - 1;
int currentElement = v[i];
while (previousElementIndex >= 0 and v[previousElementIndex] > cur... | ALGO | 0.999987 | 4.545356 |
4b09da82-cfed-4850-9044-aba40f984379 | karolhof/PROGRAMACION-II | GUIA TP/TP2(punteros)/ej11.cpp | #include <iostream>
using namespace std;
void carga(int tama, float *vector){
for (int i=0;i<tama;i++){
cout<<"Ingrese el elemento "<<i+1<<": ";
cin>>vector[i];
}
}
float encontrarMaximo(float *vector, int tama) {
int maximo=vector[0];
for (int i=1; i<tama; ++i) {
if (vector[i]... | ALGO | 0.92846 | 3.1591 |
8a06d809-8ac9-44ec-94a3-52091ccd7f49 | renantarouco/furgbol2016 | libs/box2d/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp | #include <Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <new>
b2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem = allocator->All... | ALGO | 0.978912 | 7.291923 |
f7ea7f20-bcc5-46c0-8aa1-ee8e6513e11e | Symom-Hossain-Shohan/Competitive_Programming | StartAnew/A_-_Find_the_Median.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve()
{
ll n;
cin >> n;
vector<ll> v(n);
for(auto &i: v) cin >> i;
sort(v.begin(), v.end());
cout << v[n/2] << endl;
}
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
ll tc = 1;
//cin >> tc... | ALGO | 0.999913 | 4.979894 |
c71f1d04-5ff1-499b-aaa7-c10a90332571 | RuddyGuerrero/Competitive-Programming | Competitions/USACO/banner.cpp | /*
Ruddy Guerrero Alvarez
Villa Clara -> Caibarien
USACO\Problems\2010-11\November\Problems\Silver
Pancarta\banner
*/
#include <cstdio>
#include <algorithm>
using namespace std;
int nf, nc, a, b, dis;
long long s;
int gsd(int a, int b){
while (a){
swap(a, b);
a %= b;
}
return b;
}... | ALGO | 0.998007 | 3.441013 |
74ea5fb5-2c40-47c1-91c0-031d11af1437 | paulgorai/test | constOverload.cpp | #include <iostream>
using namespace std;
class constChecker
{
int age;
public:
constChecker(int i) : age(i)
{
}
int fun(int i)
{
cout<<"This is non const function:"<<age<<endl;
}
int fun(int i) const
{
int x = 0;
age = age + 10;
x = x+10;
cout<<"T... | TOOL | 0.861329 | 4.927114 |
c7582539-94f3-42d7-949e-fb59c0261c32 | toskip/leetcode | 78_Subsets_iter.cpp | class Solution {
public:
vector<vector<int>> subsets(vector<int>& nums) {
vector<vector<int>> result(1,vector<int>());
vector<int> temp;
int n = nums.size();
int m;
for(int i = 0;i<n;i++)
{
m = result.size();
for(int j =0;j<m;j++)
{... | ALGO | 0.999759 | 6.2355 |
b3eec876-41a3-466a-956e-9c0d2ccad12d | algozenith-iiitsonepat/coding-quest | November2023/04th November/1503-D.cpp | class Solution {
public:
/*
The ants changing their direction is same as if they continue moving in the same direction so we just have to calculate how much time it will take for one ant to fall off the plank.
*/
int getLastMoment(int n, vector<int>& left, vector<int>& right) {
int ans=0;
for(auto i... | ALGO | 0.999834 | 5.428786 |
8e186573-49a5-466f-9e72-65bfc33aaa8d | Kuro-orzz/CP | Codeforces/education/dsu/B1.cpp | // #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// using ordered_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD (ll)(1e9+7)
#define ... | ALGO | 0.999912 | 4.893174 |
039210a2-470c-424a-ac0b-e454faa9d0a1 | scala-network/scala-hashing | panthera/src/superscalar.cpp | #include "configuration.h"
#include "program.hpp"
#include "blake2/endian.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdexcept>
#include <iomanip>
#include "superscalar.hpp"
#include "intrin_portable.h"
#include "reciprocal.h"
#include "common.hpp"
namespace defyx {
static bool isMultipl... | CONFIG | 0.872093 | 6.35687 |
fbf8a599-9b79-48f0-b644-f08da37400d2 | izhuhaoran/GraTuner | third_party/graphit_gpu/src/midend/vertex_edge_set_lower.cpp | //
// Created by Yunming Zhang on 7/24/17.
//
#include <graphit/midend/vertex_edge_set_lower.h>
namespace graphit {
void VertexEdgeSetLower::lower() {
//a stmt block that contains the initilization of global variables
//it would be inserted at the beginning of the main function later
mir... | TOOL | 0.913994 | 5.271647 |
25a6ebef-aaf1-4393-9096-01f5e0a367cf | Nilay1007/Postfix-Calculator | node.cpp | #include <iostream>
#include <stdexcept>
#include "node.h"
using namespace std;
Node::Node(bool sentinel) {
this->is_sentinel = sentinel;
if (this->is_sentinel == true) {
this->prev = NULL;
this->next = NULL;
}
}
Node::Node(int v, Node *nxt, Node *prv) {
this->is_sentinel = false;
this->prev = prv;... | TOOL | 0.879423 | 4.185631 |
fa7c6486-2aa7-4e8d-b818-80bf6b6609da | pius338/BOJ | 20230713/_28113.cpp | #include <iostream>
using namespace std;
int main()
{
int n, a, b;
cin >> n >> a >> b;
if(n > b)
b = n;
if(b > a)
cout << "Bus";
else if(b == a)
cout << "Anything";
else
cout << "Subway";
} | ALGO | 0.992676 | 3.557311 |
040d20d2-e39b-48c6-9d54-fbe978f06503 | yzcmf/Interview | LeetCode-Solutions/C++/4sum-ii.cpp | // Time: O(n^2)
// Space: O(n^2)
class Solution {
public:
int fourSumCount(vector<int>& A, vector<int>& B, vector<int>& C, vector<int>& D) {
unordered_map<int, int> A_B_sum;
for (const auto& a : A) {
for (const auto& b : B) {
++A_B_sum[a + b];
}
}
... | ALGO | 0.999533 | 6.617218 |
45a8d158-ac03-411f-85fa-6becb1681e28 | ilyasher/legendary-checkers | ui.cpp | #include <iostream>
#include "position.h"
#include "legend_AI.h"
/**
* Print out the list of possible moves to the user.
* Returns the function the user chooses.
*/
Move prompt_move(Position & pos) {
std::cout << "Move Choices:\n";
std::vector<Move> all_moves = pos.get_all_legal_moves();
int num_moves ... | ALGO | 0.991623 | 5.693215 |
351a01ff-3d01-4c13-af34-fe4dedf9798b | Blaster2398/Leetcode_practice | 3950-maximum-k-to-sort-a-permutation/maximum-k-to-sort-a-permutation.cpp | class Solution {
public:
int sortPermutation(vector<int>& nums) {
int temp = ~0;
for(int i = 0; i < nums.size(); i++){
if(nums[i] != i) temp &= nums[i];
}
if(temp == ~0) return 0;
return temp;
}
}; | ALGO | 0.999971 | 5.456301 |
922270c8-1e97-4c3b-8126-0ec4f8625910 | VenkataAnilKumar/LeetCode | Solutions/combinations/combinationSum.cpp | // Source : https://oj.leetcode.com/problems/combination-sum/
// Author : Venkata Anil Kumar
/**********************************************************************************
*
* Given a set of candidate numbers (C) and a target number (T), find all unique combinations
* in C where the candidate numbers sums to T... | ALGO | 0.999977 | 6.192782 |
ec1ff17b-c23c-4c4a-b372-aaf5afe5646f | dragosArs/RayTracer | RayTracer/src/Calculation_utility.cpp | #include "Calculation_utility.h"
#include <iostream>
#include <immintrin.h>
/*
void intersectSphere(Ray& ray, const Sphere& sphere, BasicHitInfo& hitInfo) {
glm::vec3 d = ray.direction;
glm::vec3 o = ray.origin - sphere.center;
float P1, P2;
float A = glm::dot(d, d);
float B = 2.0f * glm::dot(d, o)... | ALGO | 0.998224 | 6.640096 |
5236afd9-a7ff-4cf4-881b-db3e656c3fe9 | Rabbi1067/atcoder-solutions | B - Restaurant Queue.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int Q;
cin >> Q;
queue<int> line;
for (int i = 0; i < Q; ++i) {
int type;
cin >> type;
if (type == 1) {
int X;
cin >> X;
line.push(X);
} else if (type == 2) {... | ALGO | 0.998471 | 4.92562 |
bd7d63fa-eff2-470b-bf30-7cef1f87943b | nishgpt/competitive_programming | codeforces/88_educational/D.cpp | /*
Author : Nishant Gupta 2.0
*/
#include<bits/stdc++.h>
#define LL long long int
#define getcx getchar_unlocked
#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define MAX 100005
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL (LL(1e18))
#define chk(a) cerr << endl << #a << "... | ALGO | 0.999941 | 3.900684 |
84ab7b70-d8ed-4f7b-8a0f-4d65f1b1f74f | M-Jawad-Ch/Projects | torus.cpp | #include<iostream>
#include<math.h>
#include<conio.h>
#include<windows.h>
const int screen_height = 40,screen_width = 2*screen_height;
const int center_height = screen_height/2, center_width = screen_width/2;
float screen[screen_height][screen_width][screen_height] = {{{0}}};
float r,R;
float pi = 3.1415;
std :: stri... | ALGO | 0.932405 | 3.163851 |
a26ec554-8be4-46d2-b53e-af5175bed782 | BaharSlmn/storm-bn | bn-mc-transformer/src/storm/utility/AutomaticSettings.cpp | #include "storm/utility/AutomaticSettings.h"
#include <sstream>
#include "storm/logic/Formula.h"
#include "storm/logic/FormulaInformation.h"
#include "storm/storage/SymbolicModelDescription.h"
#include "storm/storage/jani/Property.h"
#include "storm/storage/jani/traverser/InformationCollector.h"
#include "storm/exce... | ALGO | 0.951803 | 7.32679 |
95e252ec-d969-45c5-b6c5-4eb9209b47dc | viv-india/Viv_lib | graphs/bfs.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
void bfs(vector <int> a[],int i,bool f[])
{
vector <int> ::iterator it;
queue <int> q;
q.push(i);
while(!q.empty())
{
int u=q.front();
q.pop();
cout<<u<<" ";
for(it=a[u].begin();it!=a[u].end();it++)
if(!f[*it])
{
f[*it]=true;
... | ALGO | 0.999982 | 4.060434 |
bd7a5645-2109-4021-8064-7c0c108f886c | jhinkoo331/leetcode | solution/0063____Unique_Paths_II.cpp | #include "util\frequently_included.h"
class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
return _1(obstacleGrid);
}
private:
/**
* @brief
* @perf: 92, 72
* @param grid spaces are marked as 0
* @return i... | ALGO | 0.999889 | 5.869894 |
31f4dfb0-6f18-4476-a48b-9e2d97e0e02b | psornsiri/UltrasoundSimulator-FinalProject | sdk-3.15.0/externals/Eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
m << 1,-2,
-3,4;
cout << "1-norm(m) = " << m.cwiseAbs().colwise().sum().maxCoeff()
<< " == " << m.colwise().lpNorm<1>().maxCoeff() << endl;
cout << "infty-norm(m... | ALGO | 0.999651 | 4.076589 |
d59de17a-1998-4313-b27f-1f0e96be6ddd | nerdola-de-cartola/TAP2 | Listas/lista2/k.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main(void) {
int n, total, num_matches;
int i, j, k;
int p1, p2;
cin >> n;
total = pow(2, n);
int arr[total];
for(i = 0; i < total; i++) {
cin >> arr[i];
}
num_matches = total / 2;
for(i = 0; i < n; i++) {
p1 ... | ALGO | 0.99996 | 3.429475 |
b6b9a148-3db6-461c-b9b0-a4e23defd482 | iakov/blink_tree | implementation/tree-implementations/blink-tree/palm/worker.cpp | #define _POSIX_C_SOURCE 200112L
#include <assert.h>
#include <stdlib.h>
#include <string.h>
// TODO: remove this
#include <stdio.h>
#include "my_compiler.h"
#include "worker.h"
// a magic number for pointer, no valid pointer will be equal with it.
// used in point-to-point synchronization
#define magic_pointer ((nod... | ALGO | 0.998175 | 3.051337 |
74f2d26e-e8b3-4495-898b-eb7508840e4f | yihsunphys/Competitive_Programming | 2024Fall_CP_Course/Hive.cpp | #include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
int ans = 1e9+7;
int mp[105][105] = {}, vis[105][105] = {}, deg[105][105] = {};
int dx[6] = {-1,0,1,1,0,-1};
int dy[6] = {1,2,1,-1,-2,-1};
int n,m,t;
// x是奇數時 y 從 1, 3, 5... x是偶數時 y 從 2, 4, 6...
pii f(int x,int y){
return make_pair(x,(y-1)*2+(x... | ALGO | 0.999703 | 4.808252 |
ca6cf1e4-bf8a-4b2f-a239-ae0b0e1014cf | GNuSeekK/SSAFY_10_class11_algorithm | 20240501/cpp/wonjae.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int max_arr[3] = { 0, };
int min_arr[3] = { 0, };
int main() {
int n;
cin >> n;
int a, b, c;
int mx[3];
int mn[3];
for (int i = 0; i < n; i++) {
cin >> a >> b >> c;
mx[0] = max(max_arr[0], max_arr[1]) + a;
mn[0] = min(min_arr[0], min_arr[1]) + ... | ALGO | 0.999701 | 3.707528 |
400cb28c-a09a-4bc3-8ccd-ef796d62b2c9 | eohyemin/Algorithm_works | DfsBfs/p49189.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
vector<vector<int>> graph;
vector<bool> visited;
vector<int> cnt;
void dfs(int n, int dist) {
cnt[n] = (cnt[n] == 0 ? dist : min(dist, cnt[n]));
visited[n] = true;
vector<int> v = graph... | ALGO | 0.999521 | 5.069323 |
fdab8ac4-c72d-4b24-b33a-0341c201e54b | ladakarimullina/HPC_HW_2 | *Problems_with_an_Asterisk/LeastSquares.cpp |
#include <iostream>
#include <vector>
#include <cmath>
#include <omp.h>
const int N = 1000;
const double alpha = 0.001;
// Function f(x,a,b)
double f(double x, double a, double b) {
return a * x + b;
}
// Compute the sum of squared residuals
/*double computeResidualSum(const std::vector<double>& x, const std::v... | ALGO | 0.999869 | 5.735252 |
3d722bee-4712-4a81-aac4-e59282014c72 | 9kight/WoWSourceV9 | dep/g3dlite/source/PrecomputedRandom.cpp | #include "G3D/PrecomputedRandom.h"
#include "G3D/System.h"
namespace G3D {
PrecomputedRandom::PrecomputedRandom(int dataSize, uint32 seed) :
Random((void*)NULL),
m_hemiUniform(NULL),
m_sphereBits(NULL),
m_modMask(dataSize - 1),
m_freeData(true) {
alwaysAssertM(isPow2(dataSize), "dataSize must be a power of... | ALGO | 0.963608 | 6.49234 |
769b79a8-bea2-4dc3-a349-5086d6409412 | ZJU-FAST-Lab/Implicit-SVSDF-Planner | src/utils/include/igl/mode.cpp | // Implementation
#include <vector>
template <typename T>
IGL_INLINE void igl::mode(
const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> & X,
const int d,
Eigen::Matrix<T,Eigen::Dynamic,1> & M)
{
assert(d==1 || d==2);
using namespace std;
int m = X.rows();
int n = X.cols();
M.resize((d==1)?n:m,1);
... | ALGO | 0.9995 | 5.312963 |
4773de6f-a78d-46b4-8bc1-53d4532d5086 | calvinckfong/leetcode | 4000/3045.cpp | // 3045. Count Prefix and Suffix Pairs II
struct TrieNode {
bool isWord = false;
int counter = 0;
unordered_map<int, TrieNode*> children;
};
class Solution {
public:
long long countPrefixSuffixPairs(vector<string>& words) {
long long result = 0;
TrieNode* root = new TrieNode();
... | ALGO | 0.999819 | 5.825784 |
c9ec1b09-6536-4596-8f68-3b0443047baf | xKristee29/1nfo | .history/8_cosuri_20210307085025.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream f("cosuri.in");
ofstream g("cosuri.out");
multiset<int> s;
int n,cerinta,x;
int main(){
f>>cerinta>>n;
if(cerinta==1){
int min1=1000005,
min2=1000005,mins,
max1=-1,
max2=-1,maxs;
for(int i=1;i<=2*n;++i... | ALGO | 0.9999 | 3.432348 |
45bcd6df-0de5-4320-8ab9-aa4a4f6a980a | shivoHum2021/surveillanceSystem | PredictionProcessor.cpp | #include "PredictionProcessor.hpp"
#include <algorithm>
#include <iostream>
/**
* @brief Constructor for PredictionProcessor.
* @param objectBoxes Vector of bounding boxes.
* @param roi Region of interest as a polygon.
* @param isNormalized Flag indicating if the coordinates are normalized.
* @param frameWidth Wi... | ALGO | 0.993118 | 7.460968 |
a6a71ec1-a981-49e1-a1d2-4e59f184dfd4 | rwightman/boost | libs/geometry/doc/src/examples/strategies/buffer_join_miter.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[buffer_join_miter
//` Shows how the join_miter strategy can be used as a JoinStrategy to create sharp corners
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/geometries.hpp... | TOOL | 0.985593 | 6.690625 |
138f3d74-d733-49cd-b0f6-bb4dd9803f92 | kgokul03/Hacktoberfest2021 | Placement Prep/Daily Works/July/27-7-20/atoms.cpp |
// https://www.spoj.com/problems/ATOMS/
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
void solve(){
unsigned long long int n,k,m;
cin>>n>>k>>m;
int time=0;
if(m>n){
while(m/n >=k){
time++;
n*=k;
}
}
cout<<time<<endl;
}
int main() {
int t;
cin>>t;
... | ALGO | 0.999908 | 3.761807 |
9d38806d-7f99-4539-9e05-0bf167a58792 | Veereshym44/Leetcode-Solutions | 0729-my-calendar-i/0729-my-calendar-i.cpp | class MyCalendar {
map<int, int> mp; // <endTime, statIme>
public:
bool book(int start, int end) {
auto itr = mp.upper_bound(start);
if(itr == mp.end() || end<= itr->second) {
mp[end]=start;
return true;
}
else return false;
}
}; | ALGO | 0.999952 | 5.462977 |
2f530f61-f4a0-407b-924a-bc82ac6212c3 | sungmen/Solve_Algorithms | Acmicpc/C++/BOJ14921.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// freopen("input.txt", "r", stdin);
ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int n; cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
int l = 0, r = n-1, MIN = a[l] + a[r];
while(l < ... | ALGO | 0.999996 | 4.687833 |
50b5c5da-2418-4aa0-80d3-b3668fb261c6 | Mephisto1024/MFST_Engine | Engine/Source/ThirdParty/astcenc/4.2.0/Source/astcenc_mathlib.cpp | #include "astcenc_mathlib.h"
/**
* @brief 64-bit rotate left.
*
* @param val The value to rotate.
* @param count The rotation, in bits.
*/
static inline uint64_t rotl(uint64_t val, int count)
{
return (val << count) | (val >> (64 - count));
}
/* See header for documentation. */
void astc::rand_init(uint64_t s... | ALGO | 0.97579 | 6.298872 |
92bba3eb-4afb-4933-b619-ae681d6b52cc | qlcal/qlcal-r | src/ql/time/calendars/thailand.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/time/calendars/thailand.hpp>
namespace QuantLib {
Thailand::Thailand() {
// all calendar instances share the same implementation instance
static ext::shared_ptr<Calendar::Impl> impl(new Thailand::SetImpl)... | TOOL | 0.964742 | 6.08281 |
4a3fb710-70c8-40ac-af3a-7f9b081999d3 | OpenDigitalTwin-Dev/FENGSim | toolkit/Tools/kokkos/algorithms/unit_tests/TestStdAlgorithmsTeamFindIfNot.cpp | #include <TestStdAlgorithmsCommon.hpp>
namespace Test {
namespace stdalgos {
namespace TeamFindIfNot {
namespace KE = Kokkos::Experimental;
template <class ValueType>
struct GreaterEqualFunctor {
ValueType m_val;
KOKKOS_INLINE_FUNCTION
GreaterEqualFunctor(ValueType val) : m_val(val) {}
KOKKOS_INLINE_FUNCTI... | TEST | 0.99072 | 7.11915 |
ba7e3904-b4af-497d-ad8b-4af8d6500cfc | andongmin94/algorithm | 프로그래머스/0/120876. 겹치는 선분의 길이/겹치는 선분의 길이.cpp | #include <string>
#include <vector>
using namespace std;
int solution(vector<vector<int>> lines) {
int answer = 0;
//
vector<int> line(201, 0);
for (const auto& l : lines)
for (int i = l[0]; i < l[1]; i++)
line[i + 100]++;
for (int i = 0; i <= 200; i++)
{
... | ALGO | 0.998794 | 5.227644 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.