uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
47119e1a-6453-4b24-ba9f-3f47fc086635 | raincross7/code-similarity | codes/train_code/problem018/problem018_79.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
string s;
cin>>s;
int ans = 0;
int ma = INT_MIN;
for(int i=0;i<s.size();i++) {
if(s[i] == 'R') {
ans++;
}
else {
ma = max(ma, ans);
ans = 0;
}
}
... | ALGO | 0.999565 | 3.819339 |
d5b34d7e-a3fb-4018-be4c-d611f6b5ab87 | tanus786/CP-Codes-HackOctober-Fest-2023 | Other files/100. Same Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999952 | 6.32278 |
76fa1109-f9bf-428a-988c-3ebf0131d85f | michalzaw/vbcpp | libs/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp | #include "btSphereSphereCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionDispatch/btCollisionObjectWrapper.h"
btSphere... | ALGO | 0.999293 | 6.541942 |
02d86fa5-d99e-476f-9e0a-1416a91409a8 | illuz/leetcode | solutions/031.Next_Permutation/AC_fractional_1.cpp | /*
* Author: illuz <iilluzen[at]gmail.com>
* File: AC_fractional_1.cpp
* Create Date: 2015-01-20 09:33:08
* Descripton: Just like the next_permutation.
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 0;
class Solution {
public:
void nextPermutation(vector<int> &num) {
if (... | ALGO | 0.999978 | 3.924168 |
47451856-7667-4c3f-b255-f2d096bd1e3c | deveshv-99/llvm-project | libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval_param.pass.cpp | // <random>
// template<class IntType = int>
// class discrete_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <cassert>
#include <cstdlib>
#include <random>
#include <vector>
int main(int, char**)
{
{
typedef std::discrete_distribution<> D;
... | TEST | 0.957792 | 4.1026 |
4bf8570d-0ba8-4998-96e6-f480ff9f10ff | Girish-1-Goyal/Algorithm | rotate_arr.cpp | /*
*
* Author : Girish Kumar Goyal.
*
*/
#include <bits/stdc++.h>
#include "debug_utils.h"
using namespace std;
vector<int> rotate_m1(vector<int> &arr, int &k){
int n = arr.size();
//handle when k > n
k %= n;
//array to store rotated version of an array
vector<int> temp(n);
//copy last ... | ALGO | 0.999981 | 3.918987 |
89cfac79-076d-4bf5-a73e-bfdb086b2b94 | Sebachin86/EstructurasDeControl | verificaPositivo.cpp | // Proyecto: EstructurasDeControl
// Archivo: verificaPositivo.cpp
// Este programa evalúa si un número ingresado por el usuario es positivo, negativo o cero,
// utilizando una estructura de control condicional (if-else).
// Autor: Profesorcito
// Fecha: 28/ene/2025
#include <iostream>
using namespace std;
int main()... | ALGO | 0.995056 | 4.542442 |
d48cfadb-296b-4c4a-82be-a4aca3b0155b | tae796/algorithm | algorithm/0x02/13.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int arr[9];
int sum=0;
for(int i=0; i<9; i++){
cin >> arr[i];
sum = sum + arr[i];
}
sort(arr,arr+9);
for(int i=0; i<8; i++){
for(int j=i+1; j<9;j++){
if... | ALGO | 0.99964 | 3.851881 |
55fd605b-e1b2-4901-82e6-7f119a5e3276 | pianfeng1943/QmlGraphics | BGraphics/bspline.cpp | #include "bspline.h"
bspline::bspline()
{
}
void bspline::spline(const QVector<QPointF> &src, QVector<QPointF> &des)
{
int order = 3;
if (src.count() < 4) {
des = calculate(src, order);
}
else
{
QVector<QPointF> v;
QVector<QPointF> tail;
v = calculate(src.mid(src.cou... | ALGO | 0.999084 | 5.16421 |
c17c637f-e7c8-4012-97da-967987ad6a77 | junstat/CppLearning | LeetCode/Q2799/Q2735/Solution.cpp | #include <vector>
using namespace std;
class Solution {
public:
long long minCost(vector<int> &A, int x) {
int n = A.size();
vector<long long> res(n);
for (int i = 0; i < n; i++) {
res[i] += 1L * i * x;
int cur = A[i];
for (int k = 0; k < n; k++) {
... | ALGO | 0.999964 | 5.568095 |
26b73338-c00f-4fea-aeeb-c98b723c8695 | krishna-raj007/BodhiTree-Annotation | CS101_Spring2020-21 /LAB4_L1/uncategorized/mod/Submissions/61_mod.cpp | #include<simplecpp>
main_program{
long int n,m;
n<=10^5 , m<= 10^9;
cin >> n>> m;
long int product = 1 ;
int i=1;
repeat (n){
product = ((product%m) * (i %m))%m;
i++;
}
cout << product;
}
| ALGO | 0.999992 | 4.040308 |
fe78f39e-e672-4414-ada3-1f14d3801102 | firasdimashki/Chess-Game | ChessGame/stockfish/src/uci.cpp | #include <cassert>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include "benchmark.h"
#include "evaluate.h"
#include "movegen.h"
#include "position.h"
#include "search.h"
#include "thread.h"
#include "timeman.h"
#include "tt.h"
#include "uci.h"
#include "syzygy/tbprobe.h"
#include "nnue/e... | ALGO | 0.989905 | 7.42889 |
d43be56c-e398-4b86-9b87-8b3b58bdb4b1 | bizzehdee/wasabi | src/draw/convolve.cpp | #include "precomp.h"
#include "convolve.h"
#include <bfc/std.h>
#include <draw/argb32.h>
#include <draw/drawpoly.h>
#include <bfc/util/profiler.h>
Convolve3x3::Convolve3x3(ARGB32 *_bits, int _w, int _h) : bits(_bits), w(_w), h(_h) {
setStdType(IDENTITY);
outputmask = MKARGB32(255,255,255,255);
oobcolor = MKARG... | ALGO | 0.956709 | 6.40945 |
d0687877-344e-45f2-83c9-e2de59c221be | ishandutta2007/codeforces | ideology/normal/1612/B.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>
#include <algorithm>
#include <random>
#include <bitset>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <l... | ALGO | 0.999893 | 4.437569 |
aa7ac3ab-75fa-4211-8a9d-b74d11fece95 | hieu-ln/IT81-15 | CodeC5/PhanTThuUyen_C5_Bai5.cpp | //#include <stdio.h>
//#include <iostream>
//#include <fstream>
//#include <sstream>
//using namespace std;
//
//#define MAX 20
//struct Node {
// int info;
// Node *link;
//};
//Node *First[MAX];
//int n;
//char vertex[MAX];
//Node *sp;
//Node *front, *rear;
//void InitStack()
//{
// sp=NULL;
//}
//int isEmptyS()
//{
... | ALGO | 0.998933 | 3.339827 |
d2858b54-e366-4d21-9336-e716dd2d7e01 | ishandutta2007/codeforces | belonogov/normal/263/B.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <cstring>
#include <cassert>
#include <ctime>
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#ifdef DEBUG
#defin... | ALGO | 0.999986 | 3.885663 |
47f70d49-aab0-4ddd-abc1-23fb949def06 | nfrik/hardyplus | eigen-eigen-36bf2ceaf8f5/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp | MatrixXd A = MatrixXd::Random(6,6);
cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
EigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
complex<double> l... | ALGO | 0.999349 | 3.088587 |
def99743-e413-4eca-b0ce-609c79141f0b | DeltaGroupNJUPT/QVina-W-GPU | lib/coords.cpp | #include "coords.h"
fl rmsd_upper_bound(const vecv& a, const vecv& b) {
VINA_CHECK(a.size() == b.size());
fl acc = 0;
VINA_FOR_IN(i, a)
acc += vec_distance_sqr(a[i], b[i]);
return (a.size() > 0) ? std::sqrt(acc / a.size()) : 0;
}
std::pair<sz, fl> find_closest(const vecv& a, const output_container& b) {
std::... | ALGO | 0.983985 | 5.250844 |
723bff4c-6a17-4686-b005-39a25e90a7a0 | bobur554396/PPI2018FALL | week11/G1/10.cpp | #include <iostream>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
using namespace std;
void show(queue<int> q){
while(!q.empty()){
cout << q.front() << " ";
q.pop();
}
}
int main(){
queue<int> q;
q.push(2);
q.push(10);
q.push(5);
q.push(3);
// show(q);
cout << q.si... | ALGO | 0.980235 | 4.072668 |
83f12ada-5659-4352-ba84-227c9c5b1afa | dfbrasil/CPP | AtividadesIF/Atividade1/q3.cpp | #include <iostream>
using namespace std;
int main(){
float tc, tf;
cout << "\n\nDigite a temperatura em °C: \n\n";
cin >> tc;
tf = ((9*tc)+160)/5;
cout << "\n\nA conversão de " << tc << "°C em Fahrenheit é: "<< tf << "°F\n\n";
return 0;
}
| ALGO | 0.981949 | 4.635538 |
b2307a2d-c5b8-4d3d-9e46-73b2f88e887b | MangeshTak/LeetCode_Practice | LeetCode_C++/string_compression.cpp | #include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
using namespace std;
int main()
{
map<char,bool> track;
string str="abc",str_new="";
int count=0,i,j;
for(i=0;i<str.length();i++)
{
if(!track[str[i]])
{
track[str[i]]=true;
... | ALGO | 0.999948 | 3.504834 |
179da7ed-52b1-4328-9c3f-2c38b4c2a09b | xmoezzz/ShinkuToolset | FVPCompress_v5/FVPCompress/FVPCompress.cpp | #include "stdafx.h"
#include <cstdio>
#include <string>
#include <map>
#include <vector>
#include <windows.h>
#include <string>
#include <Algorithm>
#include "zlib128\zlib-1.2.8\zlib.h"
#pragma comment(lib,"zlib1.lib")
using namespace std;
typedef unsigned char u8;
typedef DWORD HashType;
HashType CalHashVa... | TOOL | 0.934394 | 3.799241 |
d920e352-56cb-483f-b841-aae2bc10568a | sanyagoyal2000/leetcode | 1963-minimum-number-of-swaps-to-make-the-string-balanced/1963-minimum-number-of-swaps-to-make-the-string-balanced.cpp | class Solution {
public:
int minSwaps(string s) {
stack<int>o;
int res=0;
for(int i=0;i<s.size();i++){
if(s[i]=='[')o.push(i);
else{
if(!o.empty()){
o.pop();
}
else res++;
}
... | ALGO | 0.999711 | 5.643766 |
86b564f3-7f2f-441b-b807-1b4495d8d0f6 | vinyas03/Data-structures | Stacks and Queues/Stack applications/Prefix to Infix.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
// Function to check if a character is an operator
bool isOperator(char c) {
return (c == '+' || c == '-' || c == '*' || c == '/' || c == '^');
}
// Function to convert prefix to infix
string prefixToInfix(string prefix) {
stack<strin... | ALGO | 0.999739 | 7.190572 |
bbd23263-bab2-4ed1-9738-87acb1854c3b | supercaowei/test | template.cpp | #include <iostream>
template<typename T>
class A {
public:
A(const T& t) : t_(t) {
}
virtual void func1(T t) {
std::cout << "t: " << t << std::endl;
}
virtual void func2() {
std::cout << "t_: " << t_ << std::endl;
}
int compare(T t1, T t2) {
if (t1 < t2) {
... | TOOL | 0.981548 | 5.81656 |
0f885687-b8fe-40dd-b486-974bba6b6ff0 | Luakkk/ADS2023 | Lab10/G.cpp | #include <bits/stdc++.h>
#include <bits/stdc++.h>
using namespace std;
vector <int> vec[100001];
vector <int> used(1001);
int a, b;
bool flag;
void dfs(int g){
used[g] = 1;
for(int i : vec[g]){
if(g == a && i == b) {
continue;
}
else if(used[i] == 0) {
dfs(i);
}
else ... | ALGO | 0.999983 | 4.171507 |
af1dd0e8-6a3a-4a7a-8436-4b92682b6ae1 | MonkeyRi/SlotGame | cocos2d/extensions/Particle3D/PU/CCPUInterParticleCollider.cpp | #include "CCPUInterParticleCollider.h"
#include "extensions/Particle3D/PU/CCPUParticleSystem3D.h"
NS_CC_BEGIN
// Constants
const float PUParticle3DInterParticleCollider::DEFAULT_ADJUSTMENT = 1.0f;
const PUParticle3DInterParticleCollider::InterParticleCollisionResponse PUParticle3DInterParticleCollider::DEFAULT_COLLIS... | TOOL | 0.885891 | 6.876832 |
35bf4d4a-f050-4a52-a40d-7bb00120f9a4 | chelGomes/Estrutura_Dados | Aula8/main.cpp | #include <iostream>
#include "PilhaEncad.h"
#include "FilaEncad.h"
using namespace std;
int main()
{
//
// TESTE COM PILHA
//
PilhaEncad p;
for(int i=0; i<5; i++) p.empilha(i);
cout << "Pilha apos inserir 5 valores" << endl;
p.imprime();
for(int i=20; i<25; i++) p.empilha(i);
co... | ALGO | 0.988253 | 4.683232 |
f11c72ca-b221-4817-9e86-8983ddb8f7bd | gradientspace/UnrealMeshProcessingTools | UE4.26/IGLMeshProcessingProject/Plugins/MeshProcessingPlugin/ThirdParty/libigl/include/igl/copyleft/cgal/point_segment_squared_distance.cpp | template < typename Kernel>
IGL_INLINE void igl::copyleft::cgal::point_segment_squared_distance(
const CGAL::Point_3<Kernel> & P1,
const CGAL::Segment_3<Kernel> & S2,
CGAL::Point_3<Kernel> & P2,
typename Kernel::FT & d)
{
if(S2.is_degenerate())
{
P2 = S2.source();
d = (P1-P2).squared_length();
r... | ALGO | 0.999792 | 5.482746 |
8d825500-77b8-4222-919f-500b5d13cb51 | Suresh-Chelani/100-Day-s-Coding-Challenge | Array/Average_Waiting_Time.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
double averageWaitingTime(vector<vector<int>> &customers)
{
int n = customers.size();
double waiting = customers[0][1];
double total = customers[0][0] + waiting;
for (int i = 1; i < n; i++)
... | ALGO | 0.999784 | 5.628304 |
9cb02251-e9a1-43a1-b365-458e291c5381 | smngo100/Personal | Notes/random.cpp | #include <chrono> // For timing the simulation
#include <iostream> // For input/output
#include <random> // For random number generation
#include <thread> // For parallel execution
/**
* Monte Carlo simulation to estimate Pi
*
* @param numberOfTrials - N... | ALGO | 0.999464 | 7.051789 |
e0a2bd25-e93d-43cd-91ff-a991ed7d9dbb | Immraannn/DSA2-CPLUS | reversepalindromestring13.cpp | #include<iostream>
using namespace std;
bool checkpalindrome(char a[],int n){
int s=0;
int e=n-1;
while(s<=e){
if(a[s]!=a[e]){
return 0;
}else{
s++;
e--;
}
return 1;
}
}
int length(char name[]){
int i=0,length=0;
while(name[i]!='\0'){
length++;
i++;
}
return leng... | ALGO | 0.999113 | 4.204678 |
71ac18e0-29d5-4b3a-9e5d-0d5ad6ca2c71 | svetlana024/NM | Lab1/1.5.cpp | #include <iostream>
#include <vector>
#include <cmath>
typedef struct Complex{
double real;
double imag;
} Complex;
void PrintMatrix(std::vector<std::vector<double>>& Matrix)
{
for(int i = 0; i < Matrix.size(); i++){
for(int j = 0; j < Matrix[0].size(); j++)
std::cout << Matrix[i][j] <... | ALGO | 0.999933 | 3.422635 |
1df71955-65c0-4746-bb68-9b6c8ae4e84e | minseobii/Baekjoon | problem archive/수학/책 페이지.cpp | #include <iostream>
using namespace std;
int N;
int visit[10];
int subarr[10] = {1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000};
int DP[10][2];
int ans[10];
int init() {
for (int i=1;i<10;i++) {
if (i == 1) {
DP[i][0] = 1;
DP[i][1] = 1;
}
else {
... | ALGO | 0.999059 | 3.58884 |
06eb9302-530d-4577-864e-6867e0dfc0c9 | Linsanity81/TileableShell | ext/libigl/tests/include/igl/copyleft/cgal/hausdorff.cpp | #include <test_common.h>
#include <CGAL/Simple_cartesian.h>
#include <igl/copyleft/cgal/hausdorff.h>
#include <igl/copyleft/cgal/point_mesh_squared_distance.h>
#include <igl/upsample.h>
TEST_CASE("hausdorff: knightVScheburashka", "[igl/copyleft/cgal]")
{
Eigen::MatrixXd VA,VB;
Eigen::MatrixXi FA,FB;
igl::read_t... | TEST | 0.951329 | 6.741005 |
fdbd398f-825b-40b5-83d1-c5fd9a7bdb89 | hamza372/2024RealtimeFaceRecognitionFlutter | 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.998809 | 6.763549 |
b5805cbb-6cf9-43ef-9866-52f16fb46673 | ishandutta2007/codeforces | qaqaqaqaq/normal/1326/A.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<(int)(n);++i)
#define rep1(i,n) for (int i=1;i<=(int)(n);++i)
#define range(x) begin(x), e... | ALGO | 0.999601 | 4.12731 |
ad36a56b-b667-408f-abf2-63127fd69012 | vitorloures/airplane-opengl | myproj/include/Bullet3/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp | /*! \file gim_box_set.h
\author Francisco Leon Najera
*/
#include "btGImpactQuantizedBvh.h"
#include "LinearMath/btQuickprof.h"
#ifdef TRI_COLLISION_PROFILING
btClock g_q_tree_clock;
float g_q_accum_tree_collision_time = 0;
int g_q_count_traversing = 0;
void bt_begin_gim02_q_tree_time()
{
g_q_tree_clock.reset();
}... | ALGO | 0.999098 | 7.063347 |
847cc176-4c5c-43a5-91d0-3fbf76942777 | tabib-e-alahi/Basic-Data-Structures | Singly Linked List/print_linked_list/linked_list_reverse_printing.cpp | #include <bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node* next;// pointing the whole next node not the node value
Node(int val){
this->val = val;
this->next = NULL;//initially null for all nodes
}
};
void insert_at_tail(Node* &head,Node* &tail, int val){
... | ALGO | 0.999779 | 4.856709 |
b54eb454-376b-44be-be75-72a4673f7424 | TheGreenHacker/Cracked | Cracked/main.cpp | #include "provided.h"
#include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <cctype>
#include <random>
#include <algorithm>
#include <numeric>
#include <cassert> //testing purposes. Remember to comment out.
#include "MyHash.h" //testing MyHash purposes only. Remember to comment out after ... | TOOL | 0.897679 | 4.425358 |
c6c675a2-bc34-49d1-b42d-33e4896f5b59 | sahilgupta0607/Data-Structures-Algorithms | Stacks/stackImplementation.cpp | #include<iostream>
using namespace std;
template < class t>
class stack{
t array[100];
int idx;
public:
stack(){
idx=-1;
}
void push(int val){
if(idx==99){
cout<<"Stack Overflow"<<endl;
return;
}
array[++idx] = val;
}
int size()... | ALGO | 0.999269 | 4.742147 |
08864b0b-291e-4c09-93e8-f8a85b7faf92 | polyester-CTRL/procon-archive | atcoder.jp/keyence2020/keyence2020_a/Main.cpp | #include<iostream>
using namespace std;
int main(){
int h, w, n;
cin >> h >> w >> n;
int ans;
if (h > w)
{
ans = n / h;
if(n%h!=0){
ans++;
}
}else{
ans = n / w;
if(n%w!=0){
ans++;
}
}
cout << ans << endl;
return 0;
} | ALGO | 0.999898 | 4.082645 |
5e153f04-6df2-4cc8-9a24-a62928b518a8 | Lord-Lava/Codechef-Contests | 12 STARTERS - 2/3.cpp | #include <bits/stdc++.h>
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define int long long
const int mod = 1e9 + 7;
void solve(){
int n,k;
cin>>n>>k;
if(k<n/2){
k=n/2-k;
int ans =0;
if(n%2==0){
if(k%2==0)... | ALGO | 0.999731 | 4.621393 |
447e5012-d1ef-4110-987d-c3a08ebc1163 | o7q/particle-engine | src/ParticleEngine/ParticleEngine/include/particle/particle_world/physics/materials/explosive.cpp | #include <iostream>
#include "particle/particle_world.hpp"
#include "particle/particle_sounds.hpp"
#include "tools/tools.hpp"
#include "tools/random.hpp"
void ParticleWorld::calculate_explosive(int row, int col, Ruleset ruleset)
{
// define self, this value is used whenever a pixel moves, it acts as a copy of all t... | ALGO | 0.944604 | 5.54227 |
c41f484d-1286-4d80-929b-95cb2552051e | anonymous7495/Delegation-Space-Saving | src/sketch_compare.cpp | #include "relation.h"
#include "xis.h"
#include "sketches.h"
#include <sys/time.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
unsigned int Random_Generate()
{
unsigned int x = rand();
unsigned int h = rand();
return x ^ ((h & 1) << 31);
}
int main(int argc, char** argv)
{
... | TEST | 0.905814 | 4.603848 |
19a2cc72-48a8-4a18-a701-2fab1782f74a | Tomo-bit/Atcoder_Problems | 163_a.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main()
{
double r;
cin >> r;
double ans = 2 * r * 3.1415;
cout << std::fixed << std::setprecision(15) << ans << endl;
}
| ALGO | 0.985558 | 3.734585 |
656cdadd-be07-4b8b-9af0-eb648ae3661b | ishandutta2007/codeforces | sooke/normal/1208/A.cpp | #include <bits/stdc++.h>
inline int read() {
char c; int x; for (c = getchar(); !isdigit(c); c = getchar());
for (x = 0; isdigit(c); c = getchar()) { x = x * 10 + c - '0'; } return x;
}
int a, b, n;
int main() {
for (int T = read(); T; T--) {
a = read(); b = read(); n = read();
switch (n ... | ALGO | 0.99994 | 3.979497 |
aabe6ed8-7ac5-4a5e-83d8-206041e3095c | Vishal262526/flutter_blog_app_with_clean_arc_and_bloc | 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.998733 | 6.76775 |
af42511f-8fac-468d-96df-ba956433568f | Sookmyung-Algos/2021algos | algos_assignment/team_pratice/ucpc/가보자고/week2/2792.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int n, m; // n:학생 수, m:색상 수
cin >> n >> m;
vector<int> color(m); // 보석
for (int i = 0; i < m; i++) {
cin >> color[i];
}
int right =... | ALGO | 0.999943 | 4.733334 |
82c45840-a431-4302-92a4-2ee739945d18 | kminami0/AtCoder | atcoder.jp/typical90/typical90_bx/Main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define all(v) begin(v), end(v)
#define sz(v) v.size()
#define INF 1e18+999999
#define EPSILON 1e-14
template <typename T>
bool chmax(T &a, cons... | ALGO | 0.999991 | 3.982677 |
a077b2b7-32ad-4059-b066-4db012f01e4c | Zhengzhong-You/RouteOpt | packages/rank1_cuts/separation/src/rank1_memory_finder.cpp | #include <numeric>
#include <iostream>
#include "rank1_macro.hpp"
#include "rank1_memory_finder.hpp"
#include "helper_rank1_node_based_memory.hpp"
#include "helper_rank1_arc_based_memory.hpp"
namespace RouteOpt::Rank1Cuts::Separation {
void MemGenerator::findMemory4Cuts() {
const auto &rank1CutsDataShared ... | ALGO | 0.985566 | 4.973098 |
8b2ff074-92c5-4a68-ba16-670ba2eb26cb | travp624/frameworks_base | media/libstagefright/codecs/amrnb/common/src/norm_s.cpp | /*
Pathname: ./gsm-amr/c/src/norm_s.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the norm_s function. Sync'ed up
with the current template and fixed tabs.
Description: Updated input/output definition and module... | ALGO | 0.986865 | 5.856066 |
e59d83b0-23f3-4eab-859d-7e0516b527a4 | gnipun05/CPP | Arrays/RemoveDuplicatesfromSortedArray.cpp | // Observe that the array is sorted
#include <bits/stdc++.h>
using namespace std;
int removeduplicates(int *arr, int n)
{
int index=1;
for(int i=1; i<n; i++)
if(arr[index-1]!=arr[i]){
arr[index]=arr[i];
index++;
}
return index;
}
int main()
{
int n... | ALGO | 0.999928 | 4.173584 |
3908a07f-dbdb-484e-b0f1-945fe63b4a16 | kamal-stark-dev/Learning | LeetCode/166. Add one to a number represented by LL.cpp | // Add one to a number represented by LL
#include <iostream>
using namespace std;
class Node {
public:
int val;
Node* next;
Node(int data = 0, Node* next_ptr = nullptr) {
val = data;
next = next_ptr;
}
};
void printList(Node* head) {
Node* temp = head;
while (temp) {
... | ALGO | 0.999842 | 5.781552 |
9288ab9f-ad3a-4e37-8d27-181d411f622c | Sarthakdtu/Interview_Preparation | hashmaps/Important_Questions/subarrays_sum_equals_k.cpp | class Solution {
public:
int subarraySum(vector<int>& arr, int k) {
int n = arr.size();
int count = 0;
vector<int> pre(n);
unordered_map<int, int> occ;
pre[0] = arr[0];
for(int i=1;i<n;i++)
pre[i] = pre[i-1] + arr[i];
occ[0] = 1;
for(int j=0;j<n;j++){
int diff = ... | ALGO | 0.999865 | 5.911453 |
1b8344ba-0918-4904-a003-4b3e9a957e5c | BeastBoyAsh/C- | 176.cpp | #include<iostream>
using namespace std;
void sum(int a[]){
int s=0,i;
for(i=1;i<=5;i++){
s=s+a[i];
}
cout<<"Sum is "<<s;
}
void max(int a[]){
int s,i;
s=a[0];
for(i=1;i<=5;i++)
{
if(a[i]>s)
s=a[i];
}
cout<<"\nMax is "<<s;
}
void min(int a[]){
int s,i;
s=a[0];
for(i=1;i<=5;i++)
{
if(a[i]<s)
... | ALGO | 0.996487 | 3.054141 |
6c2e0ef7-3670-45f0-8c82-a21647b6e3c7 | algorithm004-03/algorithm004-03 | Week 05/id_373/week05_373_homework/64.cpp | public class Solution {
public int minPathSum(int[][] grid) {
int[][] dp = new int[grid.length][grid[0].length];
for (int i = grid.length - 1; i >= 0; i--) {
for (int j = grid[0].length - 1; j >= 0; j--) {
if(i == grid.length - 1 && j != grid[0].length - 1)
... | ALGO | 0.999891 | 3.90579 |
81818e90-5560-443f-9db3-431722d33a29 | hmkang/facerec | Face Recognition Library/ThirdParty/OpenCV/modules/stitching/blenders.cpp | #include "blenders.hpp"
#include "util.hpp"
using namespace std;
using namespace cv;
static const float WEIGHT_EPS = 1e-5f;
Ptr<Blender> Blender::createDefault(int type, bool try_gpu)
{
if (type == NO)
return new Blender();
if (type == FEATHER)
return new FeatherBlender();
if (type == MUL... | TOOL | 0.88135 | 6.509313 |
932b89d3-e6af-4e51-872b-64f29d1f7c97 | vuphuong1794/data-structures-algorithms | test2.cpp | //#include<iostream>
//#include <vector>
//using namespace std;
//
//vector<int> adj[1001];
//bool visited[1001];
//vector<int> path;
//
//void printPath() {
// for (int i = 0; i < path.size(); i++)
// cout << path[i] << ' ';
// cout << endl;
//}
//
//void DFS(int s, int d) {
// visited[s] = true;
// ... | ALGO | 0.999897 | 4.552653 |
c68c843d-b8a3-4a9c-b5a0-9aa57146b2ac | kmjp/procon | leetcode/251-300/259/2013.cpp | typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) me... | ALGO | 0.999251 | 4.865043 |
ebd26e32-0187-4880-abad-fd33d03b3ccd | Salildahiwalkar/Data-Structures-and-Algorithms | Step 3/Easy/move-all-0-to-end-2.cpp | #include <bits/stdc++.h>
using namespace std;
// Optimal Solution
// Time Complexity = O(n)
// Space Complexity = O(1)
vector<int> moveZeros(int n, vector<int> a) {
// Write your code here.
int j = -1;
for(int i=0; i<n; i++){
if(a[i]==0){
j=i;
break;
}
}
if(j... | ALGO | 0.99997 | 5.103915 |
dfa6c141-68ce-4357-94ea-ec365914f6b7 | ishandutta2007/codeforces | sert/normal/593/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int N = 1e6 + 34;
ll n, x1, x2, k, b;
vector <pair<pair<ll, ll>, int > > e1, e2;
int main() {
//freopen("a.in", "r", stdin);
//freopen("a.out", "w", stdout);
cin >> n >> x1 >> x2;
for (int i = 0; i < n; i... | ALGO | 0.999973 | 3.51844 |
79cb19a9-a59f-435d-8fc3-3dd6548d11c1 | raj-jondhale/Strivers-A2Z-DSA-Sheet | 1 learn the basics/1.4 _ Know Basic Maths/06 check prime.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
bool isPrime(int N){
// code here
if(N==1)
return false;
for(int i=2;i<=sqrt(N);i++){
if(N%i==0)
return false;
}
return true... | ALGO | 0.999861 | 5.512998 |
7a0ff9de-13ad-4a66-9b09-41560b86fdad | CelesTrak/fundamentals-of-astrodynamics | software/cpp/SGP4DC/SGP4DC.cpp | /* -----------------------------------------------------------------------------
*
* sgp4DC.cpp
*
* this file contains the differential corrections routines using the sgp4
* analytical propagation code.a detailed discussion of the theory and history
* may be found in the 2008 aiaa... | ALGO | 0.999415 | 4.877912 |
c335020c-4834-445c-b182-17e0fc438768 | HekpoMaH/Olimpiads | jboi2012/DOB 2/Подготовка за областен кръг 2008/cifri_a.cpp | //zad cifri 22.02.2008
#include<iostream>
using namespace std;
int main()
{
long long int a;
cin>>a;
int c;
int br=0;
while(a!=0)
{
c=a%10;
if(c%2==0){
br++;
cout<<c<<" ";
}
a=a/10;
}
c... | ALGO | 0.999591 | 3.571261 |
8d7f30e7-8b69-4c08-896e-d99cb6f6e1be | karthikeyan2022/leetcode_problems | reference/doubly_linked_list.cpp | /*
* doubly linked list implementation
*
* ListInitialize
* addToHead
* isListEmpty
* removeNode
*/
#define DEBUG 1
#if(DEBUG)
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
using namespace std;
#endif
struct node
{
int key;
int value;
struct node* next;
struct ... | ALGO | 0.999675 | 6.042247 |
80c07011-7bc5-4cab-b842-2293a1a6abef | C-2024-1-3/8209240216cuiyijian | D b 1 3.cpp | #include <iostream>
using namespace std;
void f(char* st, int i) {
st[i] = '\0';
cout << st << endl;
if (i > 1) {
f(st, i - 1);
}
}
int main() {
char st[] = "abcd";
f(st, 3); // עӦ3Ϊ±0ʼ
return 0;
} | ALGO | 0.998157 | 3.157862 |
95f0167f-19dc-4ccd-a5ab-88dc284868ad | ishandutta2007/codeforces | moonight/normal/1558/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define X first
#define Y second
#define rep(i,a,b) for(register int i=(a);i<=(b);++i)
#define rep0(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
#define fore(i,a) for(register int i=0;i<a.size();++i)
inli... | ALGO | 0.999958 | 3.305562 |
47c802f5-7c15-44f8-8af2-565f786f873c | Noppadol35/Algorithm | Mid-term/LAB/LAB_1_3/LAB_1_3.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int time_s[1000000];
int main()
{
int n, max_v = 0, k;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> k;
time_s[k] += 1;
}
for (int i = 0; i < n; i++)
{
cin >> k;
time_s[k + 1] -= 1;
... | ALGO | 0.999949 | 3.712948 |
954e7339-181b-4c62-ab44-37f65952c313 | a-bean-sprout/Leetcode_notebook | 981.基于时间的键值存储.cpp | /*
* @lc app=leetcode.cn id=981 lang=cpp
*
* [981] 基于时间的键值存储
*/
// @lc code=start
class TimeMap {
public:
TimeMap() {
}
void set(string key, string value, int timestamp) {
}
string get(string key, int timestamp) {
}
};
/**
* Your TimeMap object will be instantiated and called... | ALGO | 0.965356 | 7.141695 |
e870c813-84fb-4327-b7d2-1f72ff1d6fb2 | Forrest-Z/ros2-sgd4.0 | sgd_hardware_driver/uwb/lib/src/levmarq.cpp | #include "levmarq.hpp"
namespace sgd_hardware_drivers
{
LevMarq::LevMarq()
{
last_pose(0) = 0.0;
last_pose(1) = 0.0;
}
std::pair<double, double>
LevMarq::estimatePose()
{
//std::cout << "Received " << measuredRanges.size() << " ranges." << std::endl;
LMFunctor functor;
functor.tags = tags;
functor.... | TOOL | 0.996223 | 5.616088 |
f98f524e-6d2a-4670-a167-b29655475c2e | NimishToshniwal/Codeforces-Solved | 1000-1499/1285B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rep1(i, n) for (ll i = 1; i <= n; i++)
int main()
{
ios::sync_with_stdio(false);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
ll a[n], l = 0, r = 0;
... | ALGO | 0.999546 | 4.827112 |
94ae7871-5474-4acc-8c7d-c3ebce396675 | tuero/torch_thread_test | src/main.cpp | #include <iostream>
#include <memory>
#include <thread>
#include <vector>
#include "rnd/stonesngems_base.h"
#include "search.h"
#include "model_evaluator.h"
#include "thread_pool.h"
#include "types.h"
const int NUM_THREADS = 8;
const int ENV_WIDTH = 16;
const int ENV_HEIGHT = 16;
const int ENV_CHANNELS = 36;
const in... | ALGO | 0.995713 | 6.24578 |
def63509-a1f1-47cb-8dfd-7f6c012c5f97 | Khanlimon29/siaod_mirea | Dynamic Programming/siaod 8/Brute force.cpp | #include <iostream>
#include <string>
#include <algorithm>
int permutationsCount = 0;
using namespace std;
bool isPalindrome(const string& s) {
int left = 0;
int right = s.length() - 1;
while (left < right) {
if (s[left] != s[right]) {
return false;
}
left++;
ri... | ALGO | 0.999967 | 6.181733 |
72e72740-6404-4623-acab-d7a0f7118af2 | IDA-TUBS/CC_LinkMonitor | thirdparty/boost_1_73_0/libs/spirit/classic/example/fundamental/calc_plain.cpp | ////////////////////////////////////////////////////////////////////////////
//
// Plain calculator example demostrating the grammar and semantic actions.
// This is discussed in the "Grammar" and "Semantic Actions" chapters in
// the Spirit User's Guide.
//
// [ JDG 5/10/2002 ]
//
/////////////////////////////////... | TOOL | 0.905301 | 7.491669 |
7b3bd2c9-f2cf-4f8a-81fc-c82a3348c48d | thanh-hin/LaiThiThanhHien_monC | chapter 9/challenge/cha12.cpp | #include <bits/stdc++.h>
using namespace std;
//khai báo hàm
int *createOneNewElement(int *, const int);
void displayArray(int *, const int);
int main() //hàm chính
{
const int SIZE = 5;//khai báo kích thước mảng
int numbers[SIZE] = { 2, 4, 6, 8, 10};//khai báo mảng cho trước
int *oneElementAdded = create... | ALGO | 0.928421 | 3.899865 |
4651b68a-6b67-428e-81ca-7593792d58a0 | HasnathJami/Problem-Solving | CODECHEF/Problems/ChefAndOperators.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin>>T;
long long A,B;
while(T--)
{
cin>>A>>B;
if(A<B)
cout<<"<"<<endl;
else if(A>B)
cout<<">"<<endl;
else if(A==B)
cout<<"="<<endl;
}
return 0;
}
| ALGO | 0.999926 | 4.107716 |
1b015335-7e5a-4c8a-bc5e-8b9519e3a0d9 | ShreyanshRaj22/AllCP | Tree/leftView.cpp | #include<bits/stdc++.h>
using namespace std;
int maxlvl=0;
struct node
{
int key;
node *left;
node *right;
node(int x)
{
key=x;
left = NULL;
right = NULL;
}
};
void lvltr(node *head,int l)
{
if(head == NULL) return;
if(maxlvl<l)
{
cout<<head->key<<" "... | ALGO | 0.999914 | 3.947872 |
1ae5b0ce-0750-4941-b253-f41803b44594 | Saavrm26/mycppprogs | codechef/julycookoff/accuracy.cpp | #include <bits/stdc++.h>
using namespace std;
//datatype snippets
typedef long long ll;
//stl snippets
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<char,int>> vpci;
typedef vector<pair<long long,long l... | ALGO | 0.999923 | 3.731742 |
bcbf634d-c809-4282-a62e-57ef99791f59 | guoliqiang/coding | third_part/boost/boost_1_53_0/libs/spirit/example/karma/num_list2.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demonstrates a generator for a comma separated list of numbers.
// No actions. It is based on the example qi/num_lists.cpp for reading in
// some numbers to generate.
//
/////////////////////////////////////////////////... | TOOL | 0.851741 | 6.721799 |
c9c626db-070a-455b-9e82-d5693d85860c | stefdasca/CompetitiveProgramming | Codeforces/Educational Round 52/CF1065-D12-D.cpp | /// the ginger empire has risen
#include<bits/stdc++.h>
#pragma GCC optimize("O3")
#define mod 1000000007
#define fi first
#define se second
using namespace std;
long long n, a[12][12];
long long dp[12][12][4];
long long rep[12][12][4];
bool viz[12][12][4];
struct v
{
int L, C;
};
v pp[102];
struct plm
{
int L... | ALGO | 0.999617 | 3.362931 |
b5077109-026e-4e32-9485-e6733335e9aa | vkvd/polyedit | include/imgui/extra_fonts/binary_to_compressed_c.cpp | // ImGui - binary_to_compressed_c.cpp
// Helper tool to turn a file into a C array.
// The data is first compressed with stb_compress() to reduce source code size.
// Then encoded in Base85 to fit in a string so we can fit roughly 4 bytes of compressed data into 5 bytes of source code (suggested by @mmalex)
// (If we u... | TOOL | 0.980876 | 6.107502 |
344deead-6dfa-424a-9028-f8e10d5aaa1d | chetan0402/CodeForces | 2074/2074D.cpp | #include<iostream>
#include<vector>
#include<unordered_map>
#include<cmath>
#define int long long
using namespace std;
void solve(){
int n,m;
cin>>n>>m;
vector<int> x(n);
vector<int> r(n);
for(int i=0;i<n;i++) cin >> x[i];
for(int i=0;i<n;i++) cin >> r[i];
unordered_map<int,int> maxY;
f... | ALGO | 0.999953 | 4.489704 |
00d21e6f-825e-44fc-a227-8bb048cc9430 | ShawnTSH1229/SimNanite | MiniEngine/SimNaniteCore/IndexOptimizePostTransform.cpp | // modified from original source to improve performance (especially in debug builds), memory allocations, etc.
#include "../Core/Utility.h"
#include <stdint.h>
#include <ASSERT.h>
#include <math.h>
#include <algorithm>
#include "IndexOptimizePostTransform.h"
namespace
{
// code for computing vertex score was ta... | ALGO | 0.999908 | 7.709513 |
45e9edc4-8256-464f-9853-a12d6954b43e | Altu-Bitu-7/Altu-Bitu-KimMinsol | 02_스텍_큐_덱/4949.cpp | #include <iostream>
#include <string>
#include <stack>
using namespace std;
bool isBalanced(string& str) {
stack<char> s;
for(int i = 0; i < str.length(); i++) {
char c = str[i];
if(c == '(' || c == '[') { //문자가 ( 또는 [이면 스택에 push
s.push(c);
}
else if (c == ')... | ALGO | 0.999834 | 5.557965 |
b7838cdd-4ab2-47db-9144-3cc397390cdf | rgyhuang/Competitive_Coding | DMOJ/CCC/CCC'16 J1.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(){
char a;
int score = 0;
for(int i = 0; i < 6; i++){
cin>>a;
if(a == 'W') score++;
}
if(score>=5){
cout<<1;
} else if(score>=3){
cout<<2;
} else if (score>=1){
cout<<3;
} else {
cou... | ALGO | 0.999722 | 4.074375 |
91fd4039-5169-4ead-9740-00c875bb998f | Vaibhav10sept/DSA | MICSELLANEOUS/binary_tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
Node(int val) {
data = val;
left = NULL;
right = NULL;
}
};
void inorder ( Node* node) {
if (node == NULL) return;
inorder(node->left);
cout << node->data << " ";
inorder(node->right);
}
int main() {
Node* ... | ALGO | 0.999996 | 5.13824 |
09a922a9-5399-44ed-b1dd-585d3c391f09 | luanaamorim04/competitive_programming | cses/meet_in_the_middle.cpp | #include <iostream>
#include <map>
#include <stdio.h>
#include <algorithm>
#define ll long long
std::map<ll, int> sums;
int n, k, i, j;
ll arr[41], soma, resp, m;
int main()
{
scanf("%d%lld", &n, &m);
k = (n>>1);
for (i = 0; i < n; i++) scanf("%lld", &arr[i]);
std::sort(arr, arr+n);
for (i = 0; i < (1<<k); ... | ALGO | 0.999992 | 3.802294 |
a34601d0-7c00-4603-8452-c084fc26a91e | BrongSkuy/Ujian-Akhir-Semester-Algo-II | UAS-4.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
void profile(){
cout <<"Nama: Muhammad Faiz Rabbani"<< endl;
cout <<"NIM : 231011402539"<< endl;
cout <<"Kelas: 03TPLP029"<< endl<< endl;
}
// Radix Sort
void countingSort(std::vector<int>& arr, int exp) {
int n = arr.... | ALGO | 0.999986 | 5.317867 |
365768c8-1c49-42d2-b934-594fd1f28bb8 | julianapena/ee382c_git | src/trafficmanager.cpp | // $Id$
#include <sstream>
#include <cmath>
#include <fstream>
#include <limits>
#include <cstdlib>
#include <ctime>
#include "booksim.hpp"
#include "booksim_config.hpp"
#include "trafficmanager.hpp"
#include "batchtrafficmanager.hpp"
#include "random_utils.hpp"
#include "vc.hpp"
#include "packet_reply_info.hpp"
Tr... | TOOL | 0.879446 | 5.603513 |
1a2d2bf6-1fcd-4440-a229-a316e89897d2 | guilhermebs/AOC2018 | src/day19.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <chrono>
#include <vector>
#include <array>
#include <unordered_map>
#include <algorithm>
#include "helper.hpp"
using registers = std::array<uint, 6>;
using operation = std::tuple<std::string, uint, uint, uint>;
using op_func = void ... | ALGO | 0.995961 | 4.560071 |
8693796e-8c02-4346-90be-214d8453f6a7 | cubercsl/The-road-to-ACMer | Misc/STEED2017/Donghua Onsite/G.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int m, n;
while (cin >> m >> n)
{
if ((m + n) % 2)
if (m > n + 1 || n > m + 1)
cout << "YES" << endl;
else
cout << "NO" << endl;
else
cout << "YES" << endl;
}
... | ALGO | 0.999994 | 3.272059 |
97fff1b0-4134-4145-bc8e-cad9713219ca | Apress/learn-cocos2d-game-dev-w-ios-5 | CH05_code/ScenesAndLayers07/libs/Box2d/Collision/b2Collision.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/b2Distance.h>
void b2WorldManifold::Initialize(const b2Manifold* manifold,
const b2Transform& xfA, float32 radiusA,
const b2Transform& xfB, float32 radiusB)
{
if (manifold->pointCount == 0)
{
return;
}
switch (manifold->type)
{
... | ALGO | 0.999617 | 7.767238 |
c6f6beb0-f38a-4078-ad14-5443097a4b5a | sharmakavya7/Leetcode_solutions | 695-max-area-of-island/695-max-area-of-island.cpp | class Solution {
public:
int helper(vector<vector<int>>& grid, int i, int j) {
if(i<0 || j<0 || i>=grid.size() || j>=grid[0].size() || grid[i][j]!=1) {
return 0;
}
grid[i][j]=0; // mark water, i.e. visited
return 1 + helper(grid, i+1, j) + helper(grid, i-1, j) + helper... | ALGO | 0.999974 | 6.121943 |
4e2566c5-d997-4eac-994f-d3cb5019daae | Akshay-C-A/GoodWillShare | goodwillshare/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.997889 | 6.76775 |
e19de34f-5d95-4288-a3f4-54427317c3ab | tomn2804/Kanalysis | External Dependencies/boost_1_74_0/libs/algorithm/test/search_test1.cpp | #include <boost/algorithm/searching/boyer_moore.hpp>
#include <boost/algorithm/searching/boyer_moore_horspool.hpp>
#include <boost/algorithm/searching/knuth_morris_pratt.hpp>
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <iostream>
#include <string>
#include <vector>
namespace ba = boost::algo... | TEST | 0.890022 | 6.434797 |
5fcf8e9d-38ee-465a-a1b6-2e5ba1f1ddd9 | TheEmeraldDerpLeader/SymbolicCalculator | Source/SymExp.cpp | #include "SymExp.hpp"
#include <sstream>
#include <iomanip>
#include <Helpers.hpp>
#define float float
template<typename T>
inline T&& mov(T& t) { return reinterpret_cast<T&&>(t); }
static thread_local Vector<float> _testValue;
static thread_local Vector<float> _lastValue;
static thread_local Vector<float> _difVec;... | ALGO | 0.992416 | 4.716323 |
58192cd6-4e0c-467f-a168-056c47e8c619 | DannyFirmin/leetcode | cpp/q763.cpp | //
// Created by Danny Feng on 10/21/24.
//
class Solution {
public:
vector<int> partitionLabels(string s) {
int last[26];
int length = s.size();
for (int i = 0; i < length; i++) {
last[s[i] - 'a'] = i;
}
vector<int> partition;
int start = 0, end = 0;
... | ALGO | 0.999641 | 6.356996 |
54fdd5fc-a925-4d1b-83db-2fc657949332 | ishandutta2007/codeforces | johnchen902/normal/327/E.cpp | #include <iostream>
using namespace std;
// I almost done in python, I just need a faster language and a clean
// bottom-up way, although it is still O(size*2**size)
const int size = 24;
const int modulo = 1000000007;
int dp[1 << size];
int steps[1 << size]; // only 1 << i is used... for speed
int unlucky[2] = {-1, ... | ALGO | 0.999931 | 3.830598 |
fc4267a2-bb26-4496-8561-66478beca468 | Zi-Gao/OI-Templates | Templates/Algorithms/Tree algorithms/lca.cpp | #define ln(x) 31^__builtin_clz(x)
int cntDfn,dfn[100010],parsour[100010],depsour[100010];
#define ST_DATA_TYPE int
#define ST_TYPE >
const int ST_MAXI=100010;
const int ST_MAXJ=30;
ST_DATA_TYPE ST_CALC(ST_DATA_TYPE a,ST_DATA_TYPE b){return depsour[a]<depsour[b]?a:b;}
struct ST{
ST_DATA_TYPE f[ST_MAXJ][ST_MAXI];
void... | ALGO | 0.999773 | 3.855569 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.