uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ec606e25-68e4-40e4-bb81-0219b21f20f5 | leverimmy/Codes | 比赛/学校/2019-11-13测试/source/HB-00258/prd/prd.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
vector<int> v;
void dfs(int sum){
if(sum*10+4<=1000){
v.push_back(sum*10+4);
dfs(sum*10+4);
}
if(sum*10+7<=1000){
v.push_back(sum*10+7);
dfs(sum*10+7);
}
}
int T;
signed main(){
freopen("prd.in", "r", stdin);
freopen("prd.out", "w", stdou... | ALGO | 0.998665 | 4.339518 |
8f53e702-5bf0-4ed6-a5a6-8b7581bf082a | harimedasani/Programs | Area.cpp | #include <iostream>
using namespace std;
int area(int b,int h){
float A;
A=(b*h)/2;
cout<<"The area of triangle :" << A;
}
float area(float r){
float A;
A=3.14*r*r;
cout<<"The area of Circle :" << A;
}
double area(double x,double y){
float A;
A=x*y;
cout<<"The area of rectangle :" << A;
}
int main(){
are... | ALGO | 0.987827 | 3.632096 |
def58318-261a-4484-aa03-32d79dfa1c7b | Mihir-Panjikar/CPP | Classes and Objects/2. Constructers/Program_11.cpp | /*
A class Clock has the following members:
Private data members:
● Hour of type integer
● Minute of type integer
Public member functions:
● A parameterised constructor to initialise both the data members.
● Showtime() - function to display time
● Add time (Clock T1, Clock T2)- function to add two clock objects T1 ... | ALGO | 0.984591 | 4.934853 |
c0c1ed7e-4449-46ee-a7b7-3abb6789ea45 | ishandutta2007/codeforces | gamegame/normal/131/F.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
#define fi first
#define se second
int n,m,z;
char c[502][502];
bool d[502][502];
ll p[502][502];
ll f[502];
ll pf[502];
int main(){
ios::sync_with_stdio(false);cin.tie(0);
cin >> n >> m >> z;
for(int i=1; i<=n ;i++){
for(int j=... | ALGO | 0.999562 | 3.45784 |
1af6649f-36e3-4d12-8624-bbbdedd547bd | ishandutta2007/codeforces | andreasyan/normal/1407/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define fi first
#define se second
typedef long long ll;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rnf(2106);
const int N = 10004;
int n;
int a[N];... | ALGO | 0.999977 | 3.389925 |
7f8cc083-c6e9-46a7-814d-afbcce9b1e06 | fwilliams/surface-reconstruction-benchmark | pbrt/src/materials/translucent.cpp | // materials/translucent.cpp*
#include "stdafx.h"
#include "materials/translucent.h"
#include "spectrum.h"
#include "reflection.h"
#include "paramset.h"
#include "texture.h"
// TranslucentMaterial Method Definitions
BSDF *TranslucentMaterial::GetBSDF(const DifferentialGeometry &dgGeom, const DifferentialGeometry &dgSh... | TOOL | 0.853242 | 6.313391 |
f93e4994-f695-424a-8a24-551acf083ccf | privateos/RewritingOfSTL | beauty_test/algorithm/other/partial_sort.cpp | /*
#ifndef include___beauty__iterator__iterator_traits___iterator_traits_hpp
#define include___beauty__iterator__iterator_traits___iterator_traits_hpp
#include<./beauty/iterator/iterator_traits/iterator_traits.hpp>
#endif
#ifndef include___beauty__algorithm__heap___make_heap_hpp
#define include___beauty__algorithm_... | ALGO | 0.999718 | 5.261014 |
6d28fb71-2848-4f36-af57-0e933508ce70 | kuretru/Programming-Learning | PAT/Basic-Level/1053 住房空置率.cpp | #include <iostream>
int main()
{
int N = 0, D = 0, may = 0, must = 0;
float e = 0, f = 0;
std::cin >> N >> e >> D;
for (int i = 0; i < N; i++)
{
int count = 0, days = 0;
std::cin >> count;
for (int j = 0; j < count; j++)
{
std::cin >> f;
if (f... | ALGO | 0.998992 | 3.871845 |
b8953f7a-6ec3-4b94-ac91-65616e5001f6 | Nasir-1310/Codeforces-Problem-Solve. | A Series/702A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n];
int index[n];
// memset(index, 0, n);
for(int i=0;i<n;i++)
index[i]=0;
for(int i=0;i<n;i++)
cin>>arr[i];
for(int i=0;i<n-1;i++)
{
if(arr[i]<arr[i+1])
index[i+1]=ind... | ALGO | 0.999956 | 3.656771 |
11ea20a7-03d6-4938-bf59-411d6398cb4c | Mayuresh7482/CPP | c++ Console IO/q38_mutliply.cpp | /* 38.Write a single function “Multiply” to multiply two or three or four integers passed depending on call. Use default value arguments.
*/
#include <iostream>
using namespace std;
int Mutliply(int a, int b, int c = 0, int d = 0)
{
int result = a * b;
if (c != 0)
{
result = result * c;
}
... | TOOL | 0.943224 | 4.395608 |
6240bafc-c7fd-4da8-a7d6-2d0d459649fb | Hridoy51/Operating_System-LAB-3-2- | FCFS_1.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x;
cin >> n;
vector<pair<int, int>> Burst;
vector<int> BT(n + 1);
map<int, int> TurnOver;
for (int i = 1; i <= n; i++) {
cin >> x;
BT[i] = x;
Burst.push_back({x, i});
}
int turn = 0;
for (auto a : Burst) {
turn += a.fi... | ALGO | 0.999923 | 3.692523 |
6678a7ee-38f9-41f5-bdd2-e8f2f9961f13 | watemus/cp-prog | tinkoff2020/distur4/C.cpp | //
// Created by watemus on 29.10.2020.
//
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
#pr... | ALGO | 0.999909 | 4.813449 |
32d8aa7f-b02b-4fe4-a853-f7f66190fc04 | Dajtbaeva/ADS_2022 | labz_informatics/lab3/c.cpp | // Задача №228. Номер максимального элемента массива
// https://informatics.msk.ru/mod/statements/view.php?id=54422&chapterid=228#1
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, x, res = 0;
cin >> n;
vector<int> v;
for(int i = 0; i < n; i++){
cin >> x;
v.push_back(x... | ALGO | 0.999742 | 4.274653 |
ef5d976d-776e-45ce-ada0-15999b64dc4a | pravinargade18/CP-world | CodeChef/Medium/HelloEquation.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define fast_io \
ios::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL);
#define all(v) v.begin(), v.end()
#define pb push_back
#define eb emplace_back
#define po pop_back
void solve()
{
int x;
cin>>... | ALGO | 0.999749 | 4.927018 |
41eb7bbd-93f4-43f8-ac42-d0f0a8e1609a | zhoujian89/STL | code/20_unique.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;
int main(){
int a[7] = {1,1,1,1,2,2,3};
int *e = unique(a, a + 7);
cout << "END: " << (e - a) << endl;
for (int i = 0; i < 7; ++i){
cout << a[i] << endl;
}
int b[7] = {1,1,1,1,2,2,... | ALGO | 0.999278 | 3.522034 |
1b02b9f6-44f7-46b0-b0c2-4aa838a793ac | sabers13/bachelor-projects | semester 1/next_prime_matching_sum.cpp | #include <iostream>
using namespace std;
int main()
{
int n, s,tmp,a,nontrivial,i,j,prime;
cin >> n;
tmp = n;
s = 0;
while (tmp / 10)
{
s = s + (tmp % 10);
tmp = tmp / 10;
}
a = s + tmp;
i = n;
nontrivial = 0;
prime = 0;
while (prime!=a)
{
i++;
{
for (j = 2; j < i; j++)
{
if (i%j == 0)... | ALGO | 0.999468 | 3.410511 |
a5d9e4c3-b87d-44b2-9ab9-b6902ba9fe8e | Arijit1809/Leetcode | binary-tree-right-side-view/binary-tree-right-side-view.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.999486 | 6.36501 |
59b1dd6b-d3ff-422e-a6fb-d6f6e8de5f0d | BillyLjm/LeetCode-Problems | 0779-Kth_Symbol_in_Grammar.cpp | /*******************************************************************************
* 0779-Kth_Symbol_in_Grammar.cpp
* Billy.Ljm
* 25 October 2023
*
* =======
* Problem
* =======
* https://leetcode.com/problems/k-th-symbol-in-grammar/
*
* We build a table of n rows (1-indexed). We start by writing 0 in the 1st r... | ALGO | 0.999984 | 7.287786 |
b4b30916-55d5-46cb-9c39-0b88a474cd39 | jsren/llvm-detex | mlir/lib/Conversion/SCFToStandard/SCFToStandard.cpp | #include "mlir/Conversion/SCFToStandard/SCFToStandard.h"
#include "../PassDetail.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/BlockAndValueMapping.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/IR/Module.h"
#include "mlir/IR/Patter... | TOOL | 0.878821 | 8.071303 |
bd6765e1-9391-4f5f-a8a4-4d25271c3136 | seo-bo/ProblemSolving | 백준/Gold/1958. LCS 3/LCS 3.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int main(void)
{
cin.tie(0)->sync_with_stdio(0);
string A, B, C;
cin >> A >> B >> C;
int alen = A.size(), blen = B.size(), clen = C.size();
vector<vector<vector<int>>>dp(101, vector<vector<int>>(101, vector<int>(101, -... | ALGO | 0.999963 | 4.645744 |
52254ce2-d97b-4b86-a805-f80a6b259478 | DMHACYJ/work1 | acm训练2/isap,最短路条数.cpp | #include<iostream>
#include<cstring>
#include<queue>
using namespace std;
const int maxn=407;
const int maxm=20211;
const int inf=0x3f3f3f3f;
int cnt=0;
int head[maxn];
int dep[maxn];
int gap[maxn];
int s,t;
int n;
struct Node
{
int v;
int next;
int val;
}node[maxm];
void add(int u,int v,int val)
{
node[++cnt].v=v;... | ALGO | 0.999975 | 4.586064 |
71312ad0-5e31-4565-8b4c-a9468dfd23d9 | saikat-007/DSA | 26-remove-duplicates-from-sorted-array/26-remove-duplicates-from-sorted-array.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums)
{
if(nums.size() == 0) return 0;
int res=1;
for(int i=1;i<nums.size();i++)
{
if(nums[i] != nums[res-1])
{
nums[res]=nums[i];
res++;
}
}
... | ALGO | 0.999968 | 6.273452 |
f904de3e-1d89-4b08-b876-791d2d86dc5b | hugochougt/homework | C++/Expression_evaluation.cpp | //Expression evaluation
#include<iostream>
#include<cstdio>
#include<cctype>
using namespace std;
int prr[7][7] = { 1, 1, -1, -1, -1, 1, 1,
1, 1, -1, -1, -1, 1, 1,
1, 1, 1, 1, -1, 1, 1,
1, 1, 1, 1, -1, 1, 1,
-1, -1, -1, -1, -1, 0, 4,
... | ALGO | 0.999922 | 3.57947 |
4eaf4c7d-2d28-4722-983e-bf0cce1d6405 | jeffrey-22/gmc-winter-jam | src/map.cpp | #include <cassert>
#include <queue>
#include "main.hpp"
static const int ROOM_MAX_SIZE = 12;
static const int ROOM_MIN_SIZE = 4;
static constexpr int MAX_ID_SCROLL_BY_FLOOR[20] = {7, 6, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static constexpr int MIN_TOTAL_ITEMS_BY_FLOOR[20] = {14, 12, 10, 7, 7, 5, 5,... | TOOL | 0.91904 | 3.000506 |
5b5faebe-0ee4-492b-8677-960fa3d432b6 | ProgramTraveler/leetcode | Leetcode_Question/236.二叉树的最近公共祖先.cpp | /*
* @lc app=leetcode.cn id=236 lang=cpp
*
* [236] 二叉树的最近公共祖先
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool df... | ALGO | 0.999987 | 6.511432 |
56582f71-03c3-41b0-a4ca-b4d88bc204d2 | Kyan820815/leetcode | lc02xx/lc0278.cpp | //--- Q: 0278. First Bad Version
// Forward declaration of isBadVersion API.
bool isBadVersion(int version);
//--- method 1: binary search
public:
int firstBadVersion(int n) {
int left = 1, right = n;
while (left < right) {
int mid = left + (right-left)/2;
if (!isBadVersion... | ALGO | 0.999699 | 6.829477 |
3e9eca53-591a-4445-939d-1dc110759d24 | alibaba/nann | blaze-benchmark/thirdparty/boost_1_53_0/libs/numeric/odeint/examples/lorenz_point.cpp | #include <iostream>
#include <cmath>
#include <boost/operators.hpp>
#include <boost/numeric/odeint.hpp>
//[point3D
class point3D :
boost::additive1< point3D ,
boost::additive2< point3D , double ,
boost::multiplicative2< point3D , double > > >
{
public:
double x , y , z;
point3D()
: x( 0... | ALGO | 0.999835 | 5.099187 |
a681ad66-caf9-4beb-b4ab-a1261ec4bbf5 | Yashkothari9/CPP-CODES | cyclic_rotation.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> a;
for(int i=0;i<n;i++)
{
int x;
cin>>x;
a.push_back(x);
}
int temp;
temp=a[n-1];
for(int i=n-1;i>0;i--)
{
a[i]=a[i-1];
}
a[0]=temp;
for(int i=0;i<n;i+... | ALGO | 0.99998 | 3.940065 |
99cb39be-f11b-476c-816a-8eecbb018583 | alexflint/manhattan-vision | source/progs/kinect_dp.cpp | #include "kinect_device.h"
#include <pthread.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <cmath>
#include <vector>
#include <boost/format.hpp>
#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <Eigen/Core>
#include <Eigen/Array>
#include <TooN/so3.h>
#include <TooN/de... | ALGO | 0.918869 | 6.937226 |
8de00fd8-f306-4b74-9436-7a1c0121e647 | dboglobal/DBOGLOBAL | DboClient/Tool/NtlPathEngine/FullSource/code/libs/Content_Processing/ConnectConnectingEdges_Exact.cpp | #include "platform_common/Header.h"
#include "ConnectConnectingEdges_Exact.h"
#include "ConnectingEdgeInfo.h"
#include "common/Containers/BitVector.h"
#include "common/interface/Error.h"
typedef tMesh_3D_FaceTracked tMesh;
typedef tFace_3D_FaceTracked tFace;
typedef tEdge_3D_FaceTracked tEdge;
typedef tVertex_3D_FaceT... | ALGO | 0.981843 | 6.259179 |
1318b086-c140-4dea-9979-b6ca71b5afe3 | evialbert/LeetCode | 1603-design-parking-system/1603-design-parking-system.cpp | class ParkingSystem {
public:
int big,medium,small;
ParkingSystem(int big, int medium, int small) {
this->big=big;
this->medium=medium;
this->small=small;
}
bool addCar(int carType) {
if(carType==1){
if(big>0){
big--;
return t... | ALGO | 0.974252 | 5.907043 |
63cc3845-6610-4050-8ba4-b60dcc870078 | DHRUVSHARM/CPP_codes | string_meme.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
/*
to get unique elements in sorted order
sort(fun_values.begin(),fun_values.end());
fun_values.erase(unique(fun_values.begin(),fun_values.end()),fun_values.end());
for(ll&x:fun_values)
cout<<x<<" ";
*/
/*
vector<int> primelist;
for(... | ALGO | 0.999528 | 5.287776 |
4c72f464-348c-4749-8361-5ef08ef6e179 | Sasho80/5.1.Loops | 07.LeftAndRightSum.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
cin >> n;
n = n * 2;
int leftSum=0;
int rightSum=0;
for (int i = 0; i < n/2; i++)
{
int num;
cin >> num;
leftSum += num;
}
for (int i = 0; i < n/2; i++)
{
int num;
cin >> num;
rightSum += num;
}
if (abs(leftSum-rightSu... | ALGO | 0.999994 | 3.239849 |
4e6995b4-155c-4c9a-9197-697dd5711826 | Midas847/Competitive-Coding | LeetCode Submissions/remove-element/Accepted/11-11-2021, 11_05_31 AM/Solution.cpp | // https://leetcode.com/problems/remove-element
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
vector<int> v;
for(int i=0;i<nums.size();i++){
if(nums[i]!=val){
v.push_back(nums[i]);
}
}
nums = v;
return v.size... | ALGO | 0.999718 | 6.239315 |
0ae80ce9-e661-4203-ab14-06b0055cfd87 | iprosenjitp/Online-Judge | Codeforces/1789B-Serval and Inversion Magic.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
int t;
cin >> t;
while(t--){
int n;
cin >> n;
string s;
cin >> s;
int V[100005];
bool ans = true;
for(int i = 0, j = n-1, k = 0; i < n/2; i++, j--){
if(s[i] !... | ALGO | 0.999956 | 4.366155 |
d33d7fc3-5f48-4e3c-9431-0c750993aeeb | prityd825/ProblemSolving | A.short sort.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
string a;
cin >> a;
if (a == "abc" || a == "acb" || a == "bac" || a == "cba") {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
retur... | ALGO | 0.99986 | 4.411668 |
fdd9e4ec-ff66-42c9-a3a4-fa83ef496ae0 | akhil-maker/DSA-Practice | Tree/checkBST.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node* left, *right;
};
Node* newNode(int data){
Node* p = new Node;
p->data = data;
p->left = p->right = NULL;
return p;
}
bool isBST(Node* root){
if(root==NULL)
return true;
if(root->left!=NULL && root->left->da... | ALGO | 0.999992 | 3.574598 |
b5a315f0-cd08-45b7-80c8-dc16b1cddccf | Hasebul21/Dsa-Implementation | DSU.cpp | #include<bits/stdc++.h>
using namespace std;
void makeset(int arr[],int Sizes[],int n){
for(int i=0;i<n;i++) {
arr[i]=i;
Sizes[i]=1;
}
}
int Find(int arr[],int x){
if(arr[x]==x) return x;
return arr[x]=Find(arr,arr[x]);
}
void Union(int arr[],int Sizes[],int a,int b){
a=Find(arr,a);
... | ALGO | 0.999708 | 4.013724 |
11a2a416-4ac2-445c-b449-0ebef6eacae9 | bsc-mem/Mess-Paraver | libs/boost_1_79_0/libs/polygon/test/gtl_boost_unit_test.cpp | #include <iostream>
#define BOOST_POLYGON_NO_DEPS
#include <boost/polygon/polygon.hpp>
namespace gtl = boost::polygon;
using namespace boost::polygon::operators;
#include <time.h>
#include <stdlib.h>
void assert_s(bool c, std::string msg) {
if(!c) {
std::cout << msg << std::endl;
exit( 1);
}
}
namespace ... | ALGO | 0.979642 | 5.405974 |
8c702cde-5ab5-4d6f-b782-69372c665ddf | lxiao217/study428 | 深度学习/源码/OpenCV/opencv_contrib/modules/text/samples/textbox_demo.cpp | #include <opencv2/text.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/dnn.hpp>
#include <sstream>
#include <iostream>
#include <fstream>
using namespace cv;
namespace
{
std::string getHelpStr(const std::string& progFname)
{
std::stringstream out;
out << " Demo of t... | TOOL | 0.934317 | 5.770368 |
db6c7931-11ab-4560-ae61-b14c8ccd8564 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/CodeLlama/top0-100/minimum-subarrays-in-a-valid-split-Solution.validSubarraySplit/177767_DoS.cpp | static bool decode_openldap_dereference(void *mem_ctx, DATA_BLOB in, void *_out)
{
void **out = (void **)_out;
struct asn1_data *data = asn1_init(mem_ctx);
struct dsdb_openldap_dereference_result_control *control;
struct dsdb_openldap_dereference_result **r = NULL;
int i = 0;
if (!data) return false;
control = ... | TOOL | 0.971734 | 4.216198 |
c8a54dc9-4f8c-482f-b15f-633836be0f6e | beb0/problems | CodeForces/236A/49423123_AC_30ms_148kB.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
unordered_set<char> name;
string inp;
cin >> inp;
for (char i : inp)
name.insert(i);
if(name.size() % 2)
cout << "IGNORE HIM!";
else
cout << "CHAT WITH HER!";
}
| ALGO | 0.999877 | 4.257063 |
23bf1274-3836-4920-9ed7-99d88b05dfb7 | julkar-naim/Uva-Solutions | 10107.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define input freopen("input", "r", stdin)
#define output freopen("output", "w", stdout)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define all(var) var.begin(), var.end()
#define vi vector<int>
int const MOD = 1e9+7;
typedef long long ll;
usin... | ALGO | 0.999954 | 3.878353 |
550a7a02-74de-4543-9b76-1a3e699540a6 | ssram4298/kattis_solutions | basketballoneonone.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
getline(cin, s);
int a=0,b=0;
for(int i=0;i<s.length();i+=2){
if(s[i] == 'A'){
a+= s[i+1] - '0';
}
else{
b += s[i+1] - '0';
}
}
char result = (a>b)?'A':'B';
cout<... | ALGO | 0.999966 | 4.315071 |
78c574c8-48e5-424e-9921-37ebcb74bece | polyethylene/OJ-Note | 1053_二哥的内存/1053.cpp | #include <iostream>
const int max_size = 1e5 + 7;
typedef std::pair<std::pair<int, int>, int> dot;
dot li[max_size];
int x[max_size];
int y[max_size];
int size;
template<typename T>
void swap(T &a, T &b) {
T tmp = a;
a = b;
b = tmp;
}
int find(int x, int y) {
for (int i = 0; i < size; i++) {
... | ALGO | 0.999958 | 4.558043 |
a187ba6e-52f0-4a68-88f4-c05e0718e4e6 | spacefarers/cp | problems/USACO/2018-jan/s-3.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <queue>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef vector<vi> vvi;
#define trav(a,x) for (auto& a: x)
#define p... | ALGO | 0.999474 | 3.996616 |
8aa146b9-2b07-4e78-98c0-bced29cd7ff8 | alexandraback/datacollection | solutions_5751500831719424_1/C++/Kuros/problem.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <queue>
#include <map>
#include <vector>
#include <string>
#include <iomanip>
#include <fstream>
using namespace std;
#define mo 321555123
#define eps 1e-6
#define inf 1000000
struct hammer
{
c... | ALGO | 0.999787 | 3.452132 |
091322bd-6db5-451d-9de3-739e6bc23138 | axellokrantz/02393-programming-in-cpp | 09-exercise/reverse.cpp | #include <vector>
#include <iostream>
using namespace std;
void reverseSequence(vector<int>& sequence, int start, int end){
if(start >= end)
return;
int tmp = sequence[start];
sequence[start] = sequence[end];
sequence[end] = tmp;
reverseSequence(sequence, start + 1, end - 1);
}
int main(in... | ALGO | 0.999881 | 4.935061 |
a0892a3b-ad38-4ddb-8d28-39de586f0c69 | orel1108/hackerrank | practice/cpp/introduction/pointer.cpp | #include <stdio.h>
void update(int *a,int *b) {
int mn = *a < *b ? *a : *b;
*a = *a + *b;
*b = *a - 2 * mn;
}
int main()
{
int a, b;
int *pa = &a, *pb = &b;
scanf("%d %d", &a, &b);
update(pa, pb);
printf("%d\n%d", a, b);
return 0;
}
| ALGO | 0.999944 | 3.504035 |
6fa4b4af-4567-487d-8c2a-79fd8da60c88 | Anamicca23/GFG---DSA-code | Difficulty: Medium/Nine Divisors/nine-divisors.cpp | class Solution {
public:
int bins(const vector<int>& arr, int mult, int target)
{
const int n = arr.size();
if(n <= 0) return 0;
int left = 0, right = n - 1, out = n;
while(left <= right)
{
int mid = left + ((right - left) >> 1);
if((arr[mid] * m... | ALGO | 0.999966 | 5.659768 |
56c1b7b3-67d8-4692-9433-434ae9ae1032 | zephyr-fun/LeetCodeSolution | union_find_set/827_Making_A_Large_Island.cpp | // 2022.07.05
class UnionFindSet {
public:
UnionFindSet(int n, vector<vector<int>>& grid) : rank(n + 1, 0), parent(n + 1, 0), size(n + 1, 0) {
for(int i = 0; i < parent.size(); i++) {
parent[i] = i;
}
for(int i = 0; i < grid.size(); i++) {
for(int j = 0; j < grid[0].s... | ALGO | 0.999876 | 6.217495 |
7a6e78d9-8d68-4e04-9a74-dc923c8e71f3 | adrian-budau/work | infoarena/progresii3/brut90.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
static const int kModulo = 1000 * 1000 * 1000 + 9;
int main() {
ifstream cin("progresii3.in");
ofstream cout("progresii3.out");
int64_t V; int N, K; cin >> V >> N >> K;
vector<int64_t> ... | ALGO | 0.999952 | 3.818618 |
d3b1cc1d-9a70-42fa-8e6f-6979881bec0d | DenizIsikli/Codeforces | Problemsets/Rating1000/HelmetsinNightLight1876A.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
// Macros and optimizations
#pragma GCC optimize ("O3")
#define FAST_IO std::ios::sync_with_... | ALGO | 0.999858 | 4.514993 |
b80a747b-5641-4a35-844e-958a04a73bb4 | cdegree/ACM | 日常/8-10/03(THINKPAD--THINKPAD--2013-08-10-13,13,09).cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iostream>
#include <string>
#include <set>
#define X first
#define Y second
#define sqr(x) (x)*(x)
using namespace std;
const doubl... | ALGO | 0.999956 | 3.841185 |
f339fca7-eb13-4a23-a4ba-4f7722fdc484 | yhmun/OpenKODE-Framework | 01_Develop/libXMBullet/Source/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp | #include "XMBullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h"
#include "XMBullet/BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "XMBullet/BulletCollision/CollisionShapes/btCompoundShape.h"
#include "XMBullet/BulletCollision/BroadphaseCollision/btDbvt.h"
#include "XMBullet/LinearM... | ALGO | 0.99899 | 6.724407 |
b5a06652-e8e4-42ea-ba03-e2e1e44e7adc | BrylSerhii/all_labs | lab_2.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <ctime>
/*
Програма автодоповнення: реалізуйте програму, яка надає пропозиції автодоповнення тексту для заданої вхідної фрази
за допомогою моделі ланцюга Маркова. Програма має використовувати масив для зберігання вхідних текстових
даних... | ALGO | 0.972619 | 5.572886 |
87fce0c1-a545-4d96-9262-6ce07948da27 | face4/yukicoder | Level3/0001.cpp | #include<iostream>
#include<vector>
using namespace std;
static const int INF = 1<<29;
int main(){
int n, c, v;
cin >> n >> c >> v;
int s[v], t[v], y[v], m[v];
for(int i = 0; i < v; i++) cin >> s[i];
for(int i = 0; i < v; i++) cin >> t[i];
for(int i = 0; i < v; i++) cin >> y[i];
for(in... | ALGO | 0.999987 | 3.947157 |
4b146bb5-8873-43e7-919b-2fe38f808430 | hsahu615/Coding_Practice | LinkedList/Singly/Search.cpp | #include <iostream>
using namespace std;
struct Node{
int data;
Node *next;
Node(int x){
data = x;
next = NULL;
}
};
// int search(Node *head, int x){
// int res = 0;
// int count = 1;
// Node *curr = head;
// if(head==NULL){
// return -1;
// }
// while(curr!=NULL ... | ALGO | 0.999639 | 4.01028 |
0555bd77-bf48-418c-88a1-67d329813b9b | hppcoin/hppcoin | src/bloom.cpp | #include "bloom.h"
#include "primitives/transaction.h"
#include "hash.h"
#include "script/script.h"
#include "script/standard.h"
#include "random.h"
#include "streams.h"
#include <math.h>
#include <stdlib.h>
#include <boost/foreach.hpp>
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
#defi... | ALGO | 0.957255 | 7.079843 |
e13922a8-ba1a-4abe-b078-392504cda6b0 | monkeydluffy8120/si | subarray sum zero.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void maxSubArraySum(int* arr, int n)
{
int max_so_far = -1000, max_ending_here = 0;
int start = 0, end = 0, s = 0;
for (int j = 0; j < n; j++)
{
max_ending_here += arr[j];
if (max_so_far < max_e... | ALGO | 0.999182 | 4.092507 |
a29699b3-7219-4681-9306-0c734d3dfa69 | akshita1204/StriverSheetChallenge | BinarySearch/OnAnswer/13.cpp |
//median of two sorted array
//https://leetcode.com/problems/median-of-two-sorted-arrays/
/*class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int n=nums1.size();
int m=nums2.size();
if(n>m) return findMedianSortedArrays(nums2,nums1);
i... | ALGO | 0.999801 | 5.972012 |
f6fd9925-8866-4f00-a1c4-17686b68cdf8 | Prathyusha465/leetcode | 0238-product-of-array-except-self/0238-product-of-array-except-self.cpp | class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
int num=1;
int z=0;
for(auto it:nums)
{
if(it!=0)
num=num*it;
else
z++;
}
vector<int>v;
for(int i=0;i<nums.size();i++)
{... | ALGO | 0.999956 | 5.711803 |
ac8f81ad-34ce-46ed-8e6b-5ea3ba391a9a | WhiteBite/SpaceGame | tree.cpp | #include "tree.h"
sTree::~sTree()
{
this->clear();
}
void sTree::clear()
{
this->clear(root);
root = nullptr;
levels = 0;
}
void sTree::clear(sNode* st)
{
if (st)
{
if (st->right)
clear(st->right);
if (st->left)
clear(st->left);
delete st;
}
}
void sTree::add(CEntity* value, float key)
{
if (!fi... | ALGO | 0.915553 | 3.437477 |
3b4f553d-c510-412c-bc62-fab49743b15e | ishandutta2007/codeforces | vepifanov/normal/101/A.cpp | #include <cstdio>
#include <numeric>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
#include <deque>
using namespace std;
#define mp make_pair
#define ... | ALGO | 0.999983 | 3.224786 |
4f2d025c-6e44-4403-bf32-3b5803c80ff3 | Bhaveshpetkar3/leetcode | 0028-find-the-index-of-the-first-occurrence-in-a-string/0028-find-the-index-of-the-first-occurrence-in-a-string.cpp | class Solution {
public:
int strStr(string h, string n) {
int hs=h.size();
int ns=n.size();
int i=0;
while(i<=hs-ns+1)
{
int j=0,k=i+1;
while(j<ns && h[i]==n[j])i++,j++;
if(j==ns)return i-ns;
i=k;
}
return -1;
... | ALGO | 0.999943 | 5.593983 |
5a13d9a2-cf0d-49bf-9912-39eb2b92cbcd | romagnolimarco/TuringArena | mastermind/solutions/LoZo_solution.cpp | int combinazioni[1296][4]; //Tutte le possibili combinazioni
int codice[4]; //Ultimo codice proposto
int black, white;
int num=0; //Numero di valori certamente presenti finora individuati
int presenti[4]; //Lista dei valori certamente presenti finora individuati
//Emula il crittatore:
bool mastermind(int indice){
... | ALGO | 0.999664 | 3.430219 |
a51e7541-e705-4629-ac35-b7157e4fb1db | Yunji0000/Java_test | 프로그래머스/1/12906. 같은 숫자는 싫어/같은 숫자는 싫어.cpp | #include <vector>
#include <iostream>
using namespace std;
vector<int> solution(vector<int> arr)
{
vector<int> answer;
if (arr.empty()) return answer;
answer.push_back(arr[0]);
for(int i = 1; i < arr.size(); ++i) {
if(arr[i] != arr[i-1]) {
answer.push_back(arr[i]);
... | ALGO | 0.999282 | 5.243555 |
3d4fad50-4b5c-4dbf-94f9-1f25ba3ccd6e | aboerzel/Path-Planning | src/Eigen-3.3/test/denseLM.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template<typename Scalar>
struct DenseLM : DenseFunctor<Scalar>
{
typedef DenseFunctor<Scalar> Base;
typedef typename Base::JacobianType JacobianType;
typed... | TEST | 0.985406 | 5.886445 |
c4ea2bed-9662-4460-bc72-4b0c92d0b8fe | TheCoderRaman/roblox-hitius-sourcecode | App.BulletPhysics/BulletCollision/CollisionShapes/btOptimizedBvh.cpp | #include "stdafx.h"
#include "btOptimizedBvh.h"
#include "btStridingMeshInterface.h"
#include "LinearMath/btAabbUtil2.h"
#include "LinearMath/btIDebugDraw.h"
btOptimizedBvh::btOptimizedBvh()
{
}
btOptimizedBvh::~btOptimizedBvh()
{
}
void btOptimizedBvh::build(btStridingMeshInterface* triangles, bool useQuantizedAa... | ALGO | 0.965776 | 6.585952 |
94b60d36-2289-48e6-b01c-eb5b85ed0122 | corona10/Simple-MiniC-Compiler | lib/llvm-3.5.0.src/lib/CodeGen/MachineSink.cpp | #include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Support/CommandLine.h"
#include "llv... | ALGO | 0.998585 | 7.642641 |
2b47969d-1fb8-4ec8-b2d5-083fe1c039ec | lethic/dlib | examples/max_cost_assignment_ex.cpp | /*
This simple example shows how to call dlib's optimal linear assignment problem solver.
It is an implementation of the famous Hungarian algorithm and is quite fast, operating in
O(N^3) time.
*/
#include <dlib/optimization/max_cost_assignment.h>
#include <iostream>
using namespace std;
using namespace dlib;
i... | ALGO | 0.999567 | 6.981745 |
49d49eba-b431-4d24-9ee6-b4800a89c958 | Maksasj/megaboost | libs/algorithm/test/find_backward_test.cpp | #include <iostream>
#include <boost/algorithm/find_backward.hpp>
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <vector>
#include <list>
namespace ba = boost::algorithm;
template <typename Container>
struct dist_t
{
dist_t(Container & cont) : cont_(cont) {}
template<typename Iter>
... | TEST | 0.854514 | 6.945155 |
9f6f7297-ec75-48ef-b18f-696354ab4a54 | Ajay-kulkarni951/CPP | Program71.cpp | // 1. Write generic program which accept one value and one number from user. Print
// that value that number of times on screen.
// Input : M 7
// Output : M M M M M M M
// Input : 11 3
// Output : 11 11 11
// Input : 3.7 6
// Output : 3.7 3.7 3.7 3.7 3.7 3.7
#include<iostream>
using namespace std;
template<c... | TOOL | 0.990139 | 4.218074 |
3c1ca57b-6844-4abf-af4f-4033ac1262ea | Notiooo/Google-Benchmark-Plotter | BPlotter/benchmarks/benchmarks/src/SampleFibonacciBenchmark.cpp | #include <benchmark/benchmark.h>
int FibonacciIterative(int n)
{
if (n <= 1)
{
return n;
}
int a = 0, b = 1, c = 0;
for (int i = 2; i <= n; ++i)
{
c = a + b;
a = b;
b = c;
}
return c;
}
static void BM_FibonacciIterative(benchmark::State& state)
{
int... | TEST | 0.979484 | 7.187769 |
51ebb705-4108-45eb-acc4-98afdf51061f | deepin-community/rapidfuzz-cpp | test/distance/tests-Jaro.cpp | #include "../../rapidfuzz_reference/Jaro.hpp"
#include <catch2/catch_approx.hpp>
#include <catch2/catch_test_macros.hpp>
#include <rapidfuzz/distance/Jaro.hpp>
#include "../common.hpp"
using Catch::Approx;
template <typename Sentence1, typename Sentence2>
double jaro_similarity(const Sentence1& s1, const Sentence2& ... | TEST | 0.876493 | 6.342672 |
aac04c03-1d03-4548-9ae5-7742bbae9640 | Junaid7200/University-Labs | Data Structures/Stacks/.history/LabEvalPractice_20240419053513.cpp | #include <iostream>
#include <cmath>
using namespace std;
class int_Node {
public:
int data;
int_Node* next;
int_Node(int data) {
this -> data = data;
this -> next = NULL;
}
void setData(int data) { this -> data = data; }
void setNext(int_Node* node) { this -> next = node; }
int getDat... | ALGO | 0.999269 | 4.207812 |
83d3f114-7362-4b33-ac63-6981bdc06e46 | romeokil/DSA | 957-minimum-add-to-make-parentheses-valid/minimum-add-to-make-parentheses-valid.cpp | class Solution {
public:
int minAddToMakeValid(string s) {
// without extra space
int open=0,close=0;
for(int i=0;i<s.size();i++){
if(s[i]=='(') open++;
else {
if(open>0) open--;
else close++;
}
}
return open... | ALGO | 0.999389 | 6.135149 |
721da971-403a-462a-9a13-ffdb13f511db | Shantanu9799/GFG_Problem_Solution_Repo | RemoveAllDuplicatesFromString.cpp | class Solution{
public:
string removeDuplicates(string str) {
// code here
string s;
unordered_map<char, int> isPresent;
for(int i = 0; i < str.size(); i++) {
if(isPresent[str[i]] == 0) {
s += str[i];
isPresent[str[i]] = 1;
}
}
return s;
}
}; | ALGO | 0.999966 | 6.412702 |
f9079467-4cfe-4392-a22a-0626b5fd2e88 | md-jonayed/Phitron_Course | Semester 1/C++/Module 3.5(practice)/2.problem2.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
char s,q;
cin>>a>>s>>b>>q>>c;
if(s=='+'){
if(a+b==c){
cout<<"Yes"<<endl;
}
else{
cout<<a+b<<endl;
}
}
else if(s=='-'){
if(a-b==c){
cout<<"Yes"<<endl;
... | ALGO | 0.999919 | 3.712745 |
41bfa7aa-7ad4-4ea6-9139-41763cc583b6 | Rolight/ACM_ICPC | Topcoder/SRM 636 Div2/ChocolateDividingHard.cpp | // BEGIN CUT HERE
// END CUT HERE
#line 5 "ChocolateDividingHard.cpp"
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack... | ALGO | 0.99982 | 4.704168 |
286e7f5f-2447-431c-91ec-0117067d56aa | polossk/Code-Archive | CodeForces/codeforces388B.cpp | // <!--encoding UTF-8 UTF-8编码--!>
/*****************************************************************************
* ----Stay Hungry Stay Foolish---- *
* @author : Shen *
* @name : codeforces 388B ... | ALGO | 0.999828 | 3.022592 |
cf8d71ea-4e78-4d47-b84e-e23a485d0980 | smedegaard/composable_kernel | example/65_gemm_multiply_multiply/gemm_multiply_multiply_xdl_fp8.cpp | #include <iostream>
#include <numeric>
#include <initializer_list>
#include <cstdlib>
#include "ck/ck.hpp"
#include "ck/tensor_operation/gpu/device/gemm_specialization.hpp"
#include "ck/tensor_operation/gpu/device/impl/device_gemm_multiple_d_xdl_cshuffle_v3.hpp"
#include "ck/tensor_operation/gpu/element/element_wise_o... | ALGO | 0.968789 | 6.543161 |
21115446-96cb-4079-bb2b-8d1f6386ada5 | willzunker/lammps_mdr | lib/linalg/dlasq6.cpp | #ifdef __cplusplus
extern "C" {
#endif
#include "lmp_f2c.h"
int dlasq6_(integer *i0, integer *n0, doublereal *z__, integer *pp, doublereal *dmin__,
doublereal *dmin1, doublereal *dmin2, doublereal *dn, doublereal *dnm1,
doublereal *dnm2)
{
integer i__1;
doublereal d__1, d__2;
doubler... | ALGO | 0.999564 | 3.361566 |
4a2b0160-c1b3-4710-ba24-094c0a9d4ffa | JulioCz36/Unidad-6---MAVI | Space/Space/main.cpp | #include <SFML/Graphics.hpp>
using namespace sf;
int main() {
const int ancho = 800;
const int alto = 600;
const float radio = 30.0f;
Vector2f velocidad(0.0f, 0.0f);
const float aceleracion = 50.0f;
const float frenado = 10.0f;
const float velocidadMaxima = 300.0f;
CircleShape ci... | TOOL | 0.871515 | 5.197182 |
c601fe01-784d-4006-8145-0875ec5c377f | Fabio752/OOP | C++/Polynomial/labeled_point.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <fstream>
#include "labeled_point.hpp"
using namespace std;
LabeledPoint::LabeledPoint(){
x_ = 0;
y_ = 0;
label_ = "A";
distance_ = 0;
}
LabeledPoint::LabeledPoint(double x, double y, string label){
x_ = x;
y_ ... | ALGO | 0.945925 | 3.567967 |
1f9b22bc-ff58-451a-a3a5-44a344faadbe | superboyyy/2024_NUIST_OJ | 运动会开幕式入场.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
while (cin >> n) {
vector<string> countries;
string country;
for (int i = 0; i < n; i++) {
cin >> country;
if (country == "China")
continue;
countries.push_back(country)... | ALGO | 0.99981 | 4.721246 |
f8f7fae2-aa29-46f0-b74b-ca0a7152985a | XManu07/SudokuSolver | SudokuSolver/SudokuSolver.cpp | #include "SudokuSolver.h"
std::vector<int> SudokuSolver::PuzzleStringToVector(const std::string& sudokuString)
{
std::vector<int> puzzle(81, 0);
int i = 0;
for (char c : sudokuString) {
if (i >= 81)
break;
if (c >= '0' && c <= '9') {
puzzle[i++] = c - '0';
... | ALGO | 0.976339 | 6.261693 |
1a232aad-017c-454f-a366-4707e6ca4a2c | xuewz/leetcode | 9_e.cpp | #include <iostream>
using namespace std;
//˼·Ƚϼжϴ0ַתǷԭ
class Solution
{
public:
bool isPalindrome(int x)
{
if(x<0)return 0;
int t=x;
int sum=0;
while(x!=0)
{
sum=sum*10+x%10;
x/=10;
}
if(t==sum)
return 1;
else
return 0;
}
};
int main()
{
Solution dx;
int x;
cin>>x;
cout << dx.isPa... | ALGO | 0.999853 | 4.482595 |
15cbf12b-bb1e-466c-9252-96a4ec143d08 | franko/graph-toolkit | src/utils.cpp | #include "utils.h"
agg::trans_affine identity_matrix;
/* Mnemonic: a.premultiply(b) means a * b in terms of matrix multiplication */
void
trans_affine_compose (agg::trans_affine& a, const agg::trans_affine& b)
{
double a_tx = a.tx, a_ty = a.ty;
a.premultiply(b);
a.tx = b.sx * a_tx + b.shx * a_ty + b.t... | TOOL | 0.909526 | 6.056187 |
efa496af-0939-4a7e-92e7-f8d4ab825978 | tetrisroyale/a_tetrisroyale_godot_3.1 | thirdparty/bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp | #include "btQuantizedBvh.h"
#include "LinearMath/btAabbUtil2.h"
#include "LinearMath/btIDebugDraw.h"
#include "LinearMath/btSerializer.h"
#define RAYAABB2
btQuantizedBvh::btQuantizedBvh() : m_bulletVersion(BT_BULLET_VERSION),
m_useQuantization(false),
//m_traversalMode(TRAVERSAL_STACKLESS_CACHE... | ALGO | 0.997933 | 7.041304 |
53faf6e1-f723-4cef-a091-32abd4ea3b72 | kaorulego5x/comp | sky/islands_war.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define repd(i, n) for(ll i = n-1; i >= 0; i--)
#define ford(i, a, b) for(ll i = a; i >= ll(b); i--)
#define fora(i, I) for(const auto& i:I)
#define all(x) x.begin(), x.end()
#define PB push_back
#define ... | ALGO | 0.999959 | 4.308955 |
df762e48-44d5-43ae-8d6f-e6aff07d7189 | chauhan-akshay123/Leetcode | Easy/Move Zeroes.cpp | /*
---LINK--- https://leetcode.com/problems/move-zeroes/
*/
void moveZeroes(vector<int>& nums) {
for(int i=0,j=0; i<nums.size(); i++){
if(nums[i]!=0){
int temp = nums[i];
nums[i]=nums[j];
nums[j]=temp;
j++;
}
}
}
| ALGO | 0.999894 | 6.042929 |
79f58611-a16a-4c1c-98e4-304f5fb75179 | shubhamsingh94/SPOJ | spoj/GSS1.cpp | /*
Author : SHUBHAM SINGH
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector... | ALGO | 0.999938 | 4.239145 |
3af0bf47-d548-4eef-aef4-c723da357e68 | FladderKatten/advent_of_code_2024 | day-19/main.cpp | #include "../common/util.h"
struct Solver
{
std::vector<std::string> combos;
std::vector<std::string> designs;
Solver() {}
Solver(const std::vector<std::string>& lines) {
for(auto& t : tokenize(lines.front(), ", "))
combos.push_back(t);
std::copy(lines.begin() + 2, lines.... | ALGO | 0.995848 | 6.389246 |
19e4bf73-bad2-4b28-a752-c45fcdf64c48 | krbittu2024/Leetcode-Solution | 344. Reverse String.cpp | class Solution {
public:
void reverseString(vector<char>& s) {
int l=0;
int r=s.size()-1;
while(l<r)
swap(s[l++], s[r--]);
}
}; | ALGO | 0.999038 | 6.197066 |
20430dde-8d62-41c1-bcfc-7fc30ae26c02 | mCodingLLC/VideosSampleCode | videos/081_cache_and_branch_prediction/src/BranchPrediction.cpp | #include <benchmark/benchmark.h>
#include "common.h"
template<typename Vec, typename Real = typename Vec::value_type>
auto get_product(Vec const &v, Real thresh) {
Real p = 1.0;
for (auto x: v) {
Real f = x > thresh? 2 : 1.5;
p *= f * x;
}
return p;
}
constexpr std::size_t len = 1024;
... | TEST | 0.934792 | 6.154396 |
3b65aa53-2a69-415a-9600-f9c6cc5c920a | Danilka108/sanya_rgz | src/operations/divide.cpp | #include "divide.hpp"
Str_num *divide_remainder(Str_num **dividend, Str_num *divisor)
{
auto one = new_str_num_from_str("1");
auto quotient = new_str_num_from_str("0");
auto remainder = new_str_num_from_str("0");
Compare compare;
do
{
update_str_num("ient, sum_str_nums(quotient... | ALGO | 0.988667 | 5.361266 |
3fd46df0-2c1e-4e7b-8295-ac4530e579bb | yaaassmeen/Striver-DSA-Sheet--Practice | 02Array-Medium/03. Majority Element(Moore's Voting Algo).cpp | //{ Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
// Function to find majority element in the array
// a: input array
// size: size of input array
int majorityElement(int a[]... | ALGO | 0.999671 | 5.58477 |
9b90234e-28f2-41a7-b064-d916fab66b3d | ryotgm0417/AtCoder | contests/ABC/ABC157/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using P = pair<int, int>;
int main(){
int n,m,k;
cin >> n >> m >> k;
VVI ... | ALGO | 0.999993 | 3.918324 |
ba5697d0-c9d6-49a3-90ea-4acb9051b200 | arshitcc/LeetCode | 2163-kth-distinct-string-in-an-array/2163-kth-distinct-string-in-an-array.cpp | class Solution {
public:
string kthDistinct(vector<string>& arr, int k) {
map<string, pair<int,int>> m;
int n = arr.size();
for(int i=0; i<n; i++){
if(m.count(arr[i])){
auto x = m[arr[i]];
m[arr[i]] = {i, x.second+1};
}
... | ALGO | 0.999961 | 5.934474 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.