uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c97ebb44-37bd-466c-988b-408cbf0f4d66 | ange-yaghi/cereal-adventure | src/math_utilities.cpp | #include "../include/math_utilities.h"
ysVector c_adv::vector3d(const ysVector &b) {
return ysMath::Mask(b, ysMath::Constants::MaskOffW);
}
float c_adv::distance(const ysVector &a, const ysVector &b) {
ysVector d = ysMath::Sub(a, b);
return ysMath::GetScalar(ysMath::Magnitude(vector3d(d)));
}
float c_adv... | TOOL | 0.850481 | 5.825888 |
ab3cb3eb-612e-4fd2-b3ce-979aa89fe080 | barrettcolin/quake3.gpl.old | code/splines/math_quaternion.cpp | #include "math_quaternion.h"
#include "math_matrix.h"
void toQuat( idVec3_t &src, quat_t &dst ) {
dst.x = src.x;
dst.y = src.y;
dst.z = src.z;
dst.w = 0.0f;
}
void toQuat( angles_t &src, quat_t &dst ) {
mat3_t temp;
toMatrix( src, temp );
toQuat( temp, dst );
}
void toQuat( mat3_t &src, quat_t &dst ) {
floa... | ALGO | 0.933155 | 5.940045 |
49018b35-6140-4ee8-a57d-9d63299d5733 | Forrest-Z/navigation-3 | planning/frenet/src/frenet.cpp | #include "frenet/frenet.h"
namespace Frenet {
bool isPathInCollision(FrenetPath& path, const Input& input) {
for (auto& obstacle : input.obstacles) {
for (size_t i = 0; i < path.x.size(); ++i) {
double distance = std::sqrt(std::pow((path.x.at(i)-obstacle.x),2) +
... | ALGO | 0.999979 | 6.333346 |
459fcc20-edd8-4a68-868b-b078c156e8a9 | kadir001/CPP-code | expo-power.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main(){
int n=0, fx=0, i=0;
cin >> n;
for(int i; i >= -1000; i++){
if (i<n)
cout << pow ( 2, i) << ",";
else if (i==n)
cout << pow(2, n);
}
return 0;}
| ALGO | 0.999557 | 3.630601 |
561918e4-a064-45b2-aaf0-6db7e619ea8e | kautuk-desai/HackerRank | lonely-integer.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.999517 | 4.132843 |
72d09001-ca2a-4d8f-822f-1ffae5238a8b | ayushranjan002/DSA-Questions | BinaryTrees/top view of binary tree(GFG).cpp | class Solution {
public:
vector<int> topView(Node *root) {
vector<int> ans;
if (root == NULL) {
return ans;
}
map<int, int> mpp;
queue<pair<Node*, int>> q;
q.push(make_pair(root, 0));
while(!q.empty()){
pair<Node*,int> fro... | ALGO | 0.99999 | 5.79238 |
962dffc4-892d-4162-bf23-abe7e09ddaa2 | metehkaya/Algo-Archive | Topics/Graph/Network/Edmonds_Karp.cpp | #include <bits/stdc++.h>
#define maxn 103
#define pb push_back
using namespace std;
int n,m,bfs_cnt,ans;
int par[maxn];
int mark[maxn];
int minEdge[maxn];
int G[maxn][maxn];
bool var[maxn][maxn];
vector<int> adj[maxn];
int bfs(int src , int sink) {
queue<int> Q;
Q.push(src);
mark[src] = bfs_cnt;
minEdge[src] = IN... | ALGO | 0.999974 | 4.038939 |
c7737558-3de8-4285-8f6d-cd9b2c852a6f | SharifMAbdullah/CourseWorks | Information Security/polyAlphabeticWithTable.cpp | #include<bits/stdc++.h>
using namespace std;
char table[26][26];
void create_table()
{
for(int i=0;i<26;i++)
{
for(int j=0;j<26;j++)
{
table[i][j] = 'a' + (i+j)%26;
}
}
}
string encrypt(string s)
{
string enc = "";
for(int i=0;i<s.size();i++)
{
en... | ALGO | 0.999968 | 4.526784 |
e8c9c4cb-1a05-4c04-beb3-f3e3135b9031 | ang198/HDU | src/ripple/app/tx/impl/Transactor.cpp | //------------------------------------------------------------------------------
//==============================================================================
#include <ripple/app/main/Application.h>
#include <ripple/app/misc/LoadFeeTrack.h>
#include <ripple/app/tx/apply.h>
#include <ripple/app/tx/impl/Transactor.... | ALGO | 0.962911 | 6.926471 |
cd1c68d3-3262-48d7-9061-c19b3d737a30 | SenseLogic/MYST | BOOST/boost_1_76_0/libs/move/test/bench_merge.cpp | //#define BOOST_MOVE_ADAPTIVE_SORT_STATS
//#define BOOST_MOVE_ADAPTIVE_SORT_STATS_LEVEL 2
#include <algorithm> //std::inplace_merge
#include <cstdio> //std::printf
#include <iostream> //std::cout
#include <boost/container/vector.hpp> //boost::container::vector
#include <boost/config.hpp>
#include <cstdlib>
#inc... | ALGO | 0.980806 | 5.665975 |
735c484b-02f7-40b2-8120-85811fbf1e4b | zze-chen/zzee | math32.cpp | #include <iostream>
using namespace std;
int main(){
int a=0;
int save=0;
int sum=0;
cin >> a ;
if(a<100 || a>999){
return 0;
}
save=a;
int b=0, c=0, d=0;
b=a%10;
a/=10;
c=a%10;
a/=10;
d=a;
sum=(d*d*d)+(b*b*b)+(c*c*c);
if(sum==save){
cout << "... | ALGO | 0.999894 | 3.679308 |
440b2134-0d9a-4726-b2aa-d5aa496d6e82 | ImagoTrigger/tribes1 | rebirth/darkstar/Interior/code/itrbasiclighting.cpp | //----------------------------------------------------------------------------
//----------------------------------------------------------------------------
#include <stdlib.h>
#include <core.h>
#include <g_bitmap.h>
#include <bitstream.h>
#include "itrgeometry.h"
#include "itrcollision.h"
#include "itrlighting.h"... | TOOL | 0.904481 | 6.470559 |
fe346cc3-d5a1-4859-be80-e14ed29d3dfb | muschellij2/FSL6.0.0 | extras/include/boost/libs/graph/example/edge_connectivity.cpp | #include <boost/config.hpp>
#include <set>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/edge_connectivity.hpp>
using namespace boost;
int
main()
{
const int N = 8;
typedef adjacency_list<vecS, vecS, undirectedS> UndirectedGraph;
Und... | ALGO | 0.997248 | 6.446688 |
b81033e3-8b05-45ff-b9f9-e09066947d5b | alexpizarroj/competitive-programming | src/codility/2018-krypton/solution.cpp | #include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
const int kInfinity = 1000000007;
struct PrimeFactorsOfTen {
int powersOfTwo = 0;
int powersOfFive = 0;
PrimeFactorsOfTen() { }
PrimeFactorsOfTen(unsigned int x) {
if (x == 0) return;
while (x % 2 ==... | ALGO | 0.999972 | 6.047554 |
af324f85-68c4-4fa7-b10b-f56159cb5981 | has2/Problem-Solving | boj-solved.ac/Gold3/12785.cpp | #include <cstdio>
#include <cstring>
using namespace std;
int w,h,mod=1000007,ax,ay,dp[201][201];
int sol(int y,int x){
if(y==ay&&x==ax) return 1;
int& ret = dp[y][x];
if(ret!=-1) return ret;
ret=0;
if(y+1<=h) ret = sol(y+1,x);
if(x+1<=w) ret += sol(y,x+1);
return ret%=mod;
}
int main(){
... | ALGO | 0.999783 | 4.081619 |
39757496-dd5d-4719-b70b-51e983eabfef | raincross7/code-similarity | codes/train_code/problem157/problem157_318.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int64;
int main()
{
while(true) {
int n, m;
int64 ans = 0;
vector<pair<int, int> > dp;
scanf("%d%d", &n, &m);
if(n == 0)
break;
dp.resize(n);
for(int i = 0; i < n; ++i)
scanf("%d%d", &dp[i].second, &... | ALGO | 0.999846 | 3.561421 |
c4165a89-8691-4b11-b71d-332a8bf32b3c | qm1210/Tin-hoc-co-so-2-PTIT | C03042 - SỐ GIẢM.cpp | #include <stdio.h>
#include <math.h>
int check(int n){
int tmp = n % 10;
n /= 10;
while(n != 0){
if(tmp >= n % 10) return 0;
tmp = n % 10;
n /= 10;
}
return 1;
}
int main(){
int t;
scanf("%d", &t);
while(t--){
int a, b;
scanf("%d %d", &a, &b);
int cnt = 0;
for(int i = a; i <= b; i++){
if(chec... | ALGO | 0.99956 | 4.562122 |
9180727a-1496-49bd-9965-527cec598997 | gauravsingh2k21/Code | 543-diameter-of-binary-tree/543-diameter-of-binary-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.999834 | 6.64811 |
8afe28f4-d5b8-4e3d-892b-d80e2a30d320 | hanoi-boii/the-stacc | Lab Assignments: C++/menu_function.cpp | #include<stdio.h>
void fibonacci(int);
void odd(int);
void even(int);
void prime(int);
int main()
{ char opt;
choice:
int x,n;
printf("\n1.fibonacci series\n");
printf("2.odd series\n");
printf("3.even series\n");
printf("4.prime series\n");
scanf("%d",&x);
printf("how many terms you want? ");
scanf("%d",&n);
... | ALGO | 0.998591 | 3.232739 |
4e065f94-a750-4aa8-b6b4-7b7f0aecd9a7 | neha-mundase20/DSA_Problems_GFG | Difficulty: Medium/Remove all occurences of duplicates in a linked list/remove-all-occurences-of-duplicates-in-a-linked-list.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
/* Link list node */
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
// } Driver Code Ends
// User function Template for C++
/* Linked List node stru... | ALGO | 0.999927 | 6.197159 |
690104c7-63c5-4084-81f1-7c6dca882c71 | a00012025/Online_Judge_Code | Zerojudge/a042.cpp | #include <stdio.h>
main ()
{
int a,b ;
while (scanf ("%d",&a)==1)
{
b=a*(a-1)+2 ;
printf ("%d\n",b) ;
}
}
| ALGO | 0.997252 | 3.145779 |
c438f91f-e832-429f-b783-a75772501447 | Levi-coder07/ProjectEuler1-15 | projecteuler6.cpp | #include <iostream>
#include <conio.h>
using namespace std;
int main(){
int suma=0;
int sumaalcuadrado=0;
int sumadecuadrados=0;
int diferencia;
for (int i = 1;i<101;i++){
suma = suma + i;
}
sumaalcuadrado = suma*suma;
for (int i = 1;i<101;i++){
sumadecuadrados = sumadec... | ALGO | 0.995956 | 3.332261 |
c7a95b11-21f7-4c5b-9c06-eb479a907fe7 | Justake565/SKFU | LB4/2(6).cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
const int SIZE = 20;
string peaks[SIZE];
// Ввод названий горных вершин
cout << "Введите названия 20 горных вершин:" << endl;
for (int i = 0; i < SIZE; ++i) {
cout << "Вершина " << (... | ALGO | 0.998807 | 4.767572 |
e0b3a8ff-54be-4de5-9225-c3c0f9872831 | ajaxlt/OnlineProgram | LeetCode:cpp/0027. 移除元素.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
/*
* 来源: LeetCode
* 题目: 移除元素(Remove Element)
*
* 描述:
* 给定一个数组 nums 和一个值 val,你需要原地移除所有数值等于 val 的元素,返回移除后数组的新长度
* 不要使用额外的数组空间,你必须在原地修改输入数组并在使用 O(1) 额外空间的条件下完成
* 元素的顺序可以改变。你不需要考虑数组中超出新长度后面的元素
*
* 示例:
* 给定 nums = [3,2... | ALGO | 0.999594 | 5.612866 |
2420703d-e2ce-404d-a68b-4d65ed79923b | asd0012/ITSA | ITSA/C_MM27.cpp | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
int main()
{
int m,n;
int num;
//freopen("input.txt","r",stdin);
while(cin>>m>>n)
{
num=abs(m-n)+1;
cout<<num*(m+n)/2<<endl;
}
return 0;
}
| ALGO | 0.999933 | 3.467798 |
285d488b-e634-4075-a25a-dc67fb0c628d | benny5555/leetcode-problems | 2193.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int minMovesToMakePalindrome(string s) {
int ans = 0;
while (s.size()) {
int i = s.find(s.back());
if (i == s.size() - 1) {
ans += i / 2;
} else {
ans += i;
s.erase(i, 1);
}
s.pop_back... | ALGO | 0.999846 | 5.777847 |
7ce39fdc-217c-424b-a5b0-7141a062e355 | nameless931293/Leetcode | easy/605.cpp | //iH H1e᪺ˤlӫҩΥHڭ̭n"1"ӫ
class Solution {
public:
bool canPlaceFlowers(vector<int>& flowerbed, int n)
{
//pnTִNiXDɭP̫uإX2
//OUoifNѨMDæPforҼ{䤤@ӶWXdi
if(n==0) return true;
if(flowerbed.size()==1 && n==1)
{
if(flowerbed[0]==1)
{
retur... | ALGO | 0.999998 | 6.416695 |
99eb7f0b-13fe-4b75-a247-e3098c7a2641 | xiaohai-AI/slam_visual | opencv-4.5.3/modules/imgproc/src/featureselect.cpp | #include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "opencv2/core/openvx/ovx_defs.hpp"
#include <cstdio>
#include <vector>
#include <iostream>
#include <functional>
namespace cv
{
struct greaterThanPtr
{
bool operator () (const float * a, const float * b) const
// Ensure a fully determinis... | ALGO | 0.995906 | 6.696264 |
07dacaa9-d682-4400-9468-5aa3c78d8d21 | Tarequl-islam/Programming-competition | Codeforces/1459 b.Move and turn.cpp | #include<bits/stdc++.h>
using namespace std;
#define fo(i, n) for (i = 0; i < n; i++)
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define ll long long
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define ss(s) scanf("%s", s)
#define pi(x) printf("%d\n", x)
#define pl(x) printf("%lld\n", x)
#defi... | ALGO | 0.99966 | 4.488956 |
32c651a3-b971-4978-ae0b-3e06daf1d2a8 | JackyXu866/LeetCodeSoln | 0191_Numberof1Bits.cpp | class Solution {
public:
int hammingWeight(uint32_t n) {
int rt = 0;
while(n){
rt++;
n &= n-1;
}
return rt;
}
};
| ALGO | 0.999865 | 6.52638 |
6bdefbc6-738e-41e9-96af-a57dc2711fac | JikokuAice/Grocery-App | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
fc69c28f-dbec-4a19-bf58-adc8089625b8 | etnrlz/rtbkit-deps | boost_1_57_0/libs/algorithm/string/example/rle_example.cpp | // Boost string_algo library example file ---------------------------------//
// See http://www.boost.org for updates, documentation, and revision history.
/*
RLE compression using replace framework. Goal is to compress a sequence of
repeating characters into 3 bytes ( repeat mark, character and repetition... | ALGO | 0.999441 | 5.661903 |
1e6832b8-acd6-4fec-a3f2-0e3a394abac9 | JrodM/MCMC_Data_Association | MCMCDA.cpp | #include "MCMCDA.h"
MCMCDA::MCMCDA()
{
/*for ( int i = 0 ; i<proposal_list.size(); i++ ) { // also there is out of bounds access (usage of <=) in your code
( this->*proposal_list[i] ) (); // or (*this.*callist[i])();
}
bool Extend ( TNode * n );
bool Birth_Move();
... | ALGO | 0.995539 | 4.453712 |
dd586a0f-2f8d-4fa3-8096-bb7b36f091ab | tusikalanse/acm-icpc | cf/461/d.cpp | #include <bits/stdc++.h>
using namespace std;
string t[100005], s;
long long calc(string x){
long long res = 0, tot = 0;
for(int i = 0, l = x.length(); i<l; i++){
if(x[i] == 's') tot++;
else res+=tot;
}
return res;
}
bool cmp(string a, string b){
return calc(a+b) > calc(b+a);
}
int main(){
int n;
scanf("... | ALGO | 0.999778 | 3.958382 |
3b4a5687-b830-49c7-8790-4dedd43ca73a | serhiy-smirnov/CarND-Path-Planning-Project | src/main.cpp | #include <uWS/uWS.h>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include "Eigen-3.3/Eigen/Core"
#include "Eigen-3.3/Eigen/QR"
#include "helpers.h"
#include "json.hpp"
#include "spline.h"
// for convenience
using nlohmann::json;
using std::string;
using std::vector;
int main() {
uWS::... | WEB | 0.912103 | 3.998274 |
b078aa0e-6b76-4088-b782-c3118b59e0a9 | leopardshadow/LeetCode | m2086.cpp | // Biweekly Contest 66
// greedy
class Solution {
public:
int minimumBuckets(string street) {
street = "X" + street + "X";
int ans = 0;
for(int i = 1; i < street.length() - 1; i++) {
if(street[i] == '.' && street[i-1] == 'H' && street[i+1] == 'H') {
street[i] = ... | ALGO | 0.999821 | 4.564936 |
5fc6f0d1-88ed-4ffd-9753-fb03f8ff0e2f | gMarih/Atividade_Algoritmo | atividade3_Carro.cpp | #include <stdio.h>
#include <string.h> // Inclui a biblioteca para uso de strings
#include <locale.h> // Inclui a biblioteca para configurao do locale
// Define uma estrutura para representar um carro
typedef struct{
char modelo[50];
int ano;
double preco;
}Carro;
// Funo para modificar o preo de um carro
void mo... | TOOL | 0.943555 | 5.857821 |
f27ce96c-2814-4a43-b9dc-9a862d02619d | wynyibo/Thread-scheduling | References/learning_docs/openMP/examples/simd.cpp | #include <iostream>
#include <sys/time.h>
#include <cmath>
#define N 100000000
using namespace std;
int main()
{
timeval start, end;
int i;
double x, pi, sum = 0;
double step = 1.0 / N;
gettimeofday(&start, NULL);
#pragma omp parallel for reduction(+ : sum) private(x)
// g++ -O1 -fopenmp simd.cpp -... | ALGO | 0.999963 | 4.485882 |
ceb1559f-71bd-40c7-8f11-eec72f6ba984 | kristileka/leet-code | 2.0.remove_element_from_list/main.cpp | #include <iostream>
#include "vector"
using namespace std;
int remove_element(vector<int> &nums, int val) {
int index = 0;
for (int i = 0; i < nums.size(); i++) {
if (nums[i] != val) {
nums[index] = nums[i];
index++;
}
}
return index;
}
int main() {
vector<... | ALGO | 0.997479 | 5.302513 |
26186b04-fac0-4797-97d6-6da72a2c5890 | asavinov/Chelovek | Lk/LkCrispCNF.cpp | #include "stdafx.h"
#include "Lk.h"
void s() {
LkVector<LkCoord> V(3, 0, 1);
V.SetAt(0,3); V.SetAt(1,2); V.SetAt(2,3);
LkCrispCNF CrispCNF( V, 100, LkCoord_Null, LkCoord_Null, LkCoord_Null );
V.SetAt(0,0); V.SetAt(1,0); V.SetAt(2,0);
CrispCNF.ProcessPoint( V );
V.SetAt(0,0); V.SetAt(1,0); V.SetAt(2,1);
Cri... | ALGO | 0.991449 | 3.483737 |
db024ba9-804b-49bc-b0ba-2657f6eab2dc | shionhonda/AtCoder | 115/eve.cpp | #include<vector>
#include<algorithm>
using namespace std;
#define MAX 1000000000
int main(){
int N, K;
scanf("%d %d", &N, &K);
vector<int> v;
for (int i=0; i<N; i++) {
int tmp;
scanf("%d", &tmp);
v.push_back(tmp);
}
sort(v.begin(), v.end());
int L=N-K+1, m=MAX;
... | ALGO | 0.999775 | 3.622816 |
fbf95937-2825-4ebd-8355-23d07717783d | Coach-Academy/Fall-1-2024 | Level 1/CPU - Standard - L1 - C107/Practice G2/Week 02/problemK.cpp | #include <iostream>
using namespace std;
int main(){
long long n,k;
cin>>n>>k;
long long odd = (n+1)/2;
if(k<=odd){
cout<<(2*k)-1;
} else {
k-=odd;
cout<<2*k;
}
return 0;
} | ALGO | 0.999724 | 3.59998 |
192f25cf-1c8b-43d3-8a35-62bd20704cb0 | seoyeonkk/Algorithm | [BOJ] 1202 보석도둑(그리디).cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
struct jewel {
int weight; // 무게
int cost; // 가격
};
bool comp(jewel a, jewel b) {
return a.cost > b.cost;
}
int main () {
int N, K;
cin >> N >> K;
vector<jewel> a(N);
for(int i = 0; i < N; i++) {
... | ALGO | 0.999968 | 4.182328 |
47ce008e-5255-4e10-b185-c6828cca84cb | Khushal251/DSA_Codes | LBHeaps.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
// node = i
// left child = i*2
// right child = i*2 + 1
// parent= i/2
class heap
{
public:
int arr[100];
int size;
heap()
{
arr[0] = -1;
size = 0;
}
void insert(int val)
{
size++;
in... | ALGO | 0.999368 | 4.146641 |
19db1a38-decb-47bb-888a-c990b3461335 | yoosofan/slide | cpp/src/mystack/mystack01.wrong.cpp | #include<iostream>
using namespace std;
class myStack{
int a[100];
int top;
public:
void push(int b){
a[top++]=b;
}
int pop(){
return a[top--];
}
};
int main(){
myStack st1;
st1.push(2);
cout << st1.pop()
<< endl;
}
| ALGO | 0.867805 | 3.723321 |
f55729c9-81f9-4baa-983c-64d350bd089e | averyli290/usaco-cf-solutions | _codeforces/2113/d.cpp | /*
Problem link: https://codeforces.com/contest/2113/problem/D
*/
#include <bits/stdc++.h>
using namespace std;
#define sz(x) int((x).size())
#define all(x) begin(x), end(x)
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
const long long INF ... | ALGO | 0.999954 | 3.857084 |
b6946c93-5772-4e07-9f8a-6569040c4ff6 | SpencerL-Y/Z3-SLHV | src/math/lp/int_branch.cpp | #include "math/lp/int_solver.h"
#include "math/lp/lar_solver.h"
#include "math/lp/int_branch.h"
namespace lp {
int_branch::int_branch(int_solver& lia):lia(lia), lra(lia.lra) {}
lia_move int_branch::operator()() {
lra.move_non_basic_columns_to_bounds(true);
int j = find_inf_int_base_column();
return j == ... | ALGO | 0.998317 | 6.274957 |
fbb8661b-a6c9-4a71-a0c0-aa9f236f6933 | Yestercafe/HDOJ_Solutions | oj2098/demo.cpp | #include <iostream>
int main(void)
{
using namespace std;
ios::sync_with_stdio(false);
bool isPrime[10000];
isPrime[0] = false;
for (int i = 1; i < 10000; ++i) {
isPrime[i] = true;
}
for (int i = 2; i <= 10000; ++i) {
if (isPrime[i-1] == true) {
for (int j = 2; i... | ALGO | 0.999922 | 4.212354 |
d3f90d42-6347-4388-819d-6e86eb00c1f5 | runlnr/solid-octo-sniffle | Leetcode/704. Binary Search.cpp | class Solution {
public:
int binsr(int x, int n, vector<int> vc) {
int l = 0, r = n-1, ans = -1;
while(l <= r) {
int mid = l+(r-l)/2;
if(vc[mid] > x) r = mid-1;
else if(vc[mid] < x) l = mid+1;
else if(vc[mid] == x) return mid;
}
return ... | ALGO | 0.999977 | 6.291255 |
c5b53403-3171-4036-a09f-f1a35f3877e3 | Justi255/auto-pcb | vpcb/placer/AutoDMPPCB/DREAMPlacePCB/ops_src/weighted_average_wirelength/src/weighted_average_wirelength_atomic.cpp | #include "utility/src/torch.h"
#include "utility/src/utils.h"
#include "weighted_average_wirelength/src/functional.h"
DREAMPLACE_BEGIN_NAMESPACE
template <typename T, typename V>
int computeWeightedAverageWirelengthAtomicLauncher(
const T *pos, const int *pin2net_map, const int *flat_netpin,
const int *netpin... | ALGO | 0.99417 | 6.099866 |
4f4aa3e8-81b8-40b9-9961-747886f6f2b7 | tdelev/softversko-inzenerstvo | src/av5/transform.cpp | #include <iterator>
#include "algostuff.hpp"
using namespace std;
int main() {
vector<int> coll1;
list<int> coll2;
insert(coll1, 1, 9);
print(coll1, "coll1: ");
//negate all elements in coll1
transform(coll1.begin(), coll1.end(), coll1.begin(), negate<int> ());
//source range
//destination range
//operation
p... | TOOL | 0.890804 | 4.865468 |
7ea6b81a-fa5e-462c-bfbb-3113ec26aabd | Aswinash02/push_Notification | 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 |
edbad38c-280f-457f-bec2-7992359b2fc6 | halogenOS/android_packages_apps_OTAUpdates | jni/boost_1_57_0/libs/numeric/interval/examples/horner.cpp | #include <boost/numeric/interval.hpp>
#include <iostream>
// I is an interval class, the polynom is a simple array
template<class I>
I horner(const I& x, const I p[], int n) {
// initialize and restore the rounding mode
typename I::traits_type::rounding rnd;
// define the unprotected version of the interval ty... | ALGO | 0.979811 | 6.271902 |
60ee318b-f6b3-4f28-b95d-39b0f48cf5c9 | ishandutta2007/codeforces | shnirelman/normal/1436/A.cpp | #include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
using li = long long;
using ld = long double;
using pii= pair<int, int>;
const int INF = 1e9 + 13;
const int M = 998244353;
const int N = 40;
int sum(int a, int b) {
int res = a + b;
if(res >= M)
res -= M;
return res;... | ALGO | 0.999876 | 5.187564 |
dcfe920d-de30-4d69-8202-cd64f4732fa8 | raincross7/code-similarity | codes/train_code/problem114/problem114_153.cpp | #include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a),... | ALGO | 0.999877 | 3.764417 |
d3f24f56-44ed-4c6c-ae9a-092b5e121649 | pranganmajumder/code-templates | Data Structure/Segment Tree/Data Structure toph.cpp | /**OOO**/
//problem link : https://toph.co/p/data-structure
//hints : it can also be done using order set
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long ull;
using namespace std;
#define LL ll
#define mems(arr,VAL) memset(arr,VAL,sizeof(arr))
#define pii ... | ALGO | 0.999997 | 3.786478 |
53d6647a-5d84-44c4-9ca4-394ebe777a47 | DewanaGustavus/Seleksi-IEEEXtreme-17.0-ITB | Caffeine-Fighter/spec.cpp | #include <tcframe/spec.hpp>
#include <bits/stdc++.h>
using namespace tcframe;
using namespace std;
struct DSU{
vector<int> link, size;
int n, component;
DSU(int length){
n = length;
component = length;
link = vector<int>(n+1);
size = vector<int>(n+1, 1);
iota(link.be... | ALGO | 0.994666 | 4.779359 |
2edd1861-d92f-4934-9252-3a06471c4478 | souravdev33/SOURAV_CODES | Codeforces/The_Legend_of_Freya_the_Frog.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <Algorithm>
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define debug(x) cerr << #x << " = " << (x) << endl;
#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr);
using ll = long long;
using namespace std;
void dev() {
i... | ALGO | 0.999503 | 3.705189 |
33f1e174-60a7-493f-973e-a25aff635bbe | DACPC/CSES_Problemset | C04_Coin_Combinations_II.cpp | #import <iostream>
#include <vector>
using namespace std;
int main() {
const long long MOD = 1e9+7;
int n, x;
cin >> n >> x;
vector<int> coins(n);
for (int i = 0; i < n; i++) {
cin >> coins[i];
}
// We will use a dp approach to solve this problem
// Very similar to last proble... | ALGO | 0.999976 | 5.049905 |
c13ec6f1-f3c2-4978-99ae-1b1576b5e62a | vincent97198/competitve-programming-record | codeforce/1354B.cpp | #include<bits/stdc++.h>
#define ll long long
#define N 100000
using namespace std;
int main()
{
int t;
cin >> t;
while(t--){
string s;
cin >> s;
int tmp[3]={-2000000,-2000000,-2000000},ans=2e6;
for(int i=0;i<s.size();++i){
tmp[s[i]-'1']=i;
ans=min(an... | ALGO | 0.999834 | 3.8783 |
c98e5885-1d0d-466e-8803-8c7a4d059f69 | gaohongy/Algorithm-Competition-Code | pta/1011.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
using namespace std;
constexpr int N = 5;
double a[N][N];
char odd[3] = {'W', 'T', 'L'};
void solve() {
for (int i = 0; i < 3; ++i)
for (int j = 0; j < 3; ++... | ALGO | 0.999841 | 3.640948 |
420e642e-2660-4b3a-93e3-4a78cfdf1ce9 | anas3a/Online-Judge-Solutions | E_Guess_the_Cycle_Size.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vpi = vector<pii>;
using vpl = vector<pll>;
#define pb push_back
#define mp make_pair
#define... | ALGO | 0.999687 | 3.23484 |
e9bcd093-e1c7-4bc2-b078-fe1b2c6d9b8b | moin-zaman/CP | STL/List_find_insert_05/main.cpp | #include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
using namespace std;
int main()
{
int ar[5] = {5, 2, 1, 6, 3};
list <int> myList (ar, ar+5);
list <int> :: iterator it;
it = find(myList.begin(), myList.end(), 6);
myList.insert(it, 7);
myList.insert(it, 8);
c... | ALGO | 0.9862 | 3.097931 |
fad3e3d1-c811-474e-8811-e5bf524bdb2c | Wuffluv/Protect-Information | Lab3_Hill/Lab3_Hill.cpp | #include <iostream>
#include <vector>
#include <map>
#include "LibMatrix.h"
using namespace std;
int main() {
srand(static_cast<unsigned>(time(0))); // Инициализация генератора случайных чисел
setlocale(LC_ALL, "Rus");
string Alphabet = "АОУЫНТ_";
cout << "Алфавит: " << Alphabet << endl;
string ... | ALGO | 0.999725 | 3.767931 |
75e7440b-a050-4426-87e7-748c63f77bf0 | azmuth13/Leetcode | 1631-path-with-minimum-effort/1631-path-with-minimum-effort.cpp |
pair<int, int > dir[] = { {1,0}, {0, 1}, {-1,0}, {0, -1} };
class Solution {
public:
int minimumEffortPath(vector<vector<int>>& heights) {
int n = heights.size();
int m = heights[0].size();
vector < vector <int> > distance (n, vector <int> (m, INT_MAX));
dist... | ALGO | 0.999986 | 5.980511 |
9909feea-4750-42a8-a7f6-192e89f477b3 | learn-algorithm-from-nishkarsh/Data-Structure-and-Algoritms | Dynamic Programming/Fibonacci Number/Fibonacci.cpp | /***
* Code Written By: Nishkarsh Makhija
* Code Written for: Learn Algorithm
* Insta Handle : learn_algorithm
**/
#include <bits/stdc++.h>
using namespace std;
#define n 10
int nth_fibonacci_top_down_appraoch(int N, vector<int>& memo)
{
// Base case: if N is 0 or 1, return N
if (N <= 1) {
retur... | ALGO | 0.999984 | 5.322906 |
c8ca8549-cef0-41cb-b426-35957c929da6 | ACM-Obsidian/Obsidian | 2013-09-14/1002_practice.cpp | #ifdef unix
#define LL "%lld"
#else
#define LL "%I64d"
#endif
#include <cstdio>
#include <cstring>
#include <iostream>
#include <cctype>
#include <algorithm>
#define OK(a) cerr<<"OK at "<<a<<"!"<<endl;
using namespace std;
inline int ScanInt(void) {
int r = 0, c, d;
while (!isdigit(c = getchar()) && c !=... | ALGO | 0.999795 | 3.938837 |
4901d6f4-38fe-4656-a234-57018ecc0fde | Medhaj-Kulkarni013/DSA_Coding | C++/Functions/CombinationPandC.cpp | #include<iostream>
using namespace std;
int fact(int x){
int fact = 1;
for(int i=1; i<=x; i++){
fact *= i;
}
return fact;
}
int Combination(int n , int r){
int nCr = fact(n)/(fact(r)*fact(n-r));
return nCr;
}
int Permutation(int n , int r){
int nPr = fact(n)/fact(n-r);
return nP... | ALGO | 0.999561 | 4.324386 |
b8580cab-1439-46df-aa41-fd050fd72763 | airejtashfeen/Leetcode | (E)richest_customer_wealth.cpp | #include <iostream>
#include <vector>
#include <numeric> // For std::accumulate
#include <algorithm> // For std::max
using namespace std;
class Solution {
public:
int maximumWealth(vector<vector<int>>& accounts) {
int maxAns = 0;
for (const auto& account : accounts) {
i... | ALGO | 0.999774 | 6.487201 |
8657a310-372b-435f-af60-11a8bcbc8abf | RayChithra/cses_practice | sorting_and_searching/sum_of_four_nos.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long int n, reqdSum, input1;
vector<long long int> arr;
multimap<long long int, tuple<long long int, long long int>> sums;
cin >> n >> reqdSum;
for(long long int i = 0; i < n; i++)
{
cin >> input1;
arr.push_back(in... | ALGO | 0.99994 | 3.553998 |
40d34b44-3f95-4470-9f93-733b0bb32f61 | firewood/topcoder | atcoder/abc_227/c.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <vector>
using namespace std;
int64_t solve(int64_t N) {
int64_t ans = 0;
for (int64_t a = 1; a * a * a <= N; ++a) {
... | ALGO | 0.999832 | 4.097989 |
e45a01e8-bab5-4dfd-addb-9ec8dd5f827d | DuyLongg/DataStructure_Algorithms_PTIT | Algorithm/4. Dynamic Programing/So_ugly/So_ugly.cpp | #include <bits/stdc++.h>
using namespace std;
long long T,N,ugly[10005];
void UGLY (){
int x2,x3,x5;
ugly[1] = 1;
x2 = x3 = x5 = 1;
for (int i = 2 ; i <= 10005 ; i++){
ugly[i] = min (ugly[x2] * 2, min (ugly[x3] * 3, ugly[x5] * 5));
if (ugly[i] == ugly[x2] * 2) x2++;
if (ugly[i] == ugly[x3] * 3) x3++;
if (... | ALGO | 0.999958 | 4.153947 |
0355e52b-e282-49f7-ae51-4764f0f612d3 | alexandraback/datacollection | solutions_5738606668808192_1/C++/totoro97/C.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#define intl long long
using namespace std;
int pri[30] = { 0,
2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
73, 79, 83, 89, 97 };
int n,ans[12];
bool re_judge(intl t,int base,int p) {
int res = 0; int u = 1;
for (; t; t >>= 1)... | ALGO | 0.999602 | 3.444953 |
7630c421-0fa8-428c-a957-c2e4958a535f | thomasyu9393/Intro_to_OS | hw1.cpp | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
signed main() {
pid_t pid0, pid1;
signal(SIGCHLD, SIG_IGN);
string input_string;
while (1) {
cout << ">";
... | TOOL | 0.986143 | 3.441306 |
65a02178-8efd-4f3f-8b98-8543f1bd4115 | TatyanaRicketts/cplusplusPractice | evenDigits.cpp | /*This program reads an integer and prints the numbers that have more even digits than odd*/
#include <iostream>
using namespace std;
int main()
{
int n, number, digit;
int i;
int even, odd;
number = 1;
cout<<"Enter a positive integer: ";
cin>>n;
cout<<endl;
if(n < 0){
cou... | ALGO | 0.999747 | 4.133441 |
23d20ce6-b7be-4d66-b1ed-8d7af5c01c9b | DmytroYanush/Foxminded2023 | Project1/main.cpp | #include "pch.h"
void task_8();
void task_7();
void task_2_3_5();
int main() {
/*********************************** task #9 ************************/
Vector<Matrix> vm;
FileLoader<Matrix> fl("MyMatrices.txt");
vm.load(fl);
vm.print();
vm.load_actions("MyActions.txt");
Matrix m1 = vm.calculate();
std::cout << ... | TOOL | 0.893212 | 3.785513 |
983da5ae-2d26-41e2-9881-45d5d27189c6 | bobolpwnz/AdventOfCode | 2023/source/day07.cpp | #include "days.hpp"
#include "bblp/aoc/file_utils.hpp"
#include "bblp/aoc/point.hpp"
#include "bblp/aoc/string_utils.hpp"
#include <algorithm>
#include <array>
#include <cstdlib>
#include <iostream>
#include <numeric>
#include <optional>
#include <stdexcept>
#include <string_view>
#include <unordered_map>
#include <v... | ALGO | 0.999136 | 7.115813 |
8c12fdf4-c40a-43ee-8b22-bc52dcb8ffab | Kshitiz-b/Flutter-Projects | i_am_rich/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.997864 | 6.76073 |
7ef11455-84de-4b42-a26a-0de807bc522f | itamar-sh/Operating-Systems-Course | C_Tool_Kit/BasicOperation.cpp | //
// Created by itama on 18/09/2022.
//
#include <cstdlib>
#include <cstdio>
#include "BasicOperation.h"
int main() {
// basic_lst_manipulation
int lst1[] = {5 ,4,3,2,1,0,-1,-2}; // init
int* res1 = basic_lst_manipulation(lst1, 8);
for (int i = 0; i < 8; i++){
printf("%d ", res1[i]); // 25 1... | TOOL | 0.973298 | 3.33919 |
784bd0dd-a21f-4fc5-974a-dba59e927776 | kk77777/LeetCode-Solutions | q229.cpp | class Solution
{
public:
vector<int> majorityElement(vector<int> &nums)
{
unordered_map<int, int> mp;
vector<int> ans;
int maj = floor(nums.size() / 3);
for (int i : nums)
{
mp[i]++;
}
for (auto it = mp.begin(); it != mp.end(); ++it)
{
... | ALGO | 0.999951 | 5.66475 |
a12ae99f-b1e0-43ee-bce8-a3de156f9379 | mishaalnaeem/latticeSquareVisibility | latticeSquares.cpp | #include <limits>
#include <cstdint>
#include <iostream>
uint64_t squareCount(uint64_t n) {
if (n < 0) {
throw std::invalid_argument("Input must be a non-negative integer");
}
if (n > std::numeric_limits<uint64_t>::max() / (n + 1) / (2 * n + 1)) {
throw std::overflow_error("Overflow detected in s... | ALGO | 0.971455 | 5.861107 |
558b6246-ff6d-4d54-aa66-6ff486840dc1 | parth-kabra/DSA | LeetCode/705. Design HashSet.cpp | class MyHashSet {
public:
/** Initialize your data structure here. */
vector<bool> hash;
MyHashSet() {
hash=vector<bool>(1000001,false);
}
void add(int key) {
hash[key]=true;
}
void remove(int key) {
hash[key]=false;
}
/** Returns true if this s... | ALGO | 0.998537 | 5.097977 |
6a2b5389-355f-4614-9e33-c556ff54ec48 | Krrer-uni/4-sem | aisd/261742/lista_4/bst.cpp | #include <iostream>
#include <algorithm>
using namespace std;
long abc = 0;
long SWAP = 0;
class BST {
struct node{
int val;
node* left;
node* right;
node* parent;
node(int x) : val(x), left(NULL), right(NULL), parent(NULL){}
};
node* root;
int size;
char* left_trace;
ch... | ALGO | 0.999341 | 3.857699 |
5cde627b-d208-4052-97d3-d4f49403ddb1 | mdshihabshahriar/C-plus-plus | Module 5/stringstream.cpp | #include<iostream>
#include<sstream>
using namespace std;
int main()
{
string s;
getline(cin,s);
stringstream ss(s);
//ss<<s;
string word;
int cnt=0;
while (ss >> word)
{
//cnt++;
cout << word << endl;
}
//cout << cnt<<endl;
return 0;
}
| TOOL | 0.990379 | 3.841717 |
9d47d31f-898e-4aed-bc81-6a4d1237c9b3 | IqbalMahbub/First-project | bitManipulation.cpp | #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 SQ(a) a *a
#include <bits/stdc++.h>
using namespace std;
int getBit(int n, int pos)
{
return (n & (1 << pos) != 0);
}
int setBit(int n, int pos)
{
return (n | (1 << pos));
}
int ... | ALGO | 0.998006 | 3.247127 |
27551d1c-1fe9-443e-ae01-7902987a183f | Aniket-a14/CPP-DSA | Dsa/trees/bst.cpp | #include <iostream>
using namespace std;
class Node{
public:
int data;
Node *left, *right;
Node(int value){
data = value;
left = right = NULL;
}
};
Node *insert(Node *root, int target){
if (!root){
Node *temp = new Node(target);
return temp;
}
if (target <... | ALGO | 0.999982 | 5.548153 |
b0c1e801-b8a9-4d58-b27e-55320b158b8d | Charly-62/QtChessApp | schach/logik.cpp | /**
* @file logik.cpp
* @brief Implements the game logik.
*/
#include "logik.h"
#include "game.h"
#include "piece.h"
#include <memory>
#include<iostream>
bool Logik::isLegal(Game* chessGame, int s_col, int s_row, int e_col, int e_row, int promotion) const{
// Check if the source and destination are within bou... | ALGO | 0.8928 | 5.726907 |
6e81441a-9f63-47b6-9d4f-1f5d6f390d8c | hleesa/leetcode | 2677-cousins-in-binary-tree-ii/2677-cousins-in-binary-tree-ii.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.999976 | 6.212394 |
424dce81-a381-4c3c-b2c3-330dc362def7 | iamarghamallick/LeetCode-Solutions | 0011-container-with-most-water/0011-container-with-most-water.cpp | class Solution {
public:
int maxArea(vector<int>& height) {
int n = height.size();
int left = 0, right = n-1;
int ans = INT_MIN;
while(left < right) {
int capacity = height[left] < height[right] ?
height[left] * (right-left) : height[ri... | ALGO | 0.999981 | 6.828565 |
31ba5d84-066e-4ff7-8dca-1e38e7200415 | Kuro-orzz/CP | Codeforces/494815H.cpp | // #define _CRT_SECURE_NO_WARNINGS
// #pragma GCC optimize ("O3")
// #pragma GCC target ("sse4")
// #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>;
#inc... | ALGO | 0.999764 | 4.584357 |
10cc2cef-a37d-4437-80d2-7be352a2ba7c | akhilred36/coScheduling | apps/lammps/src/compute_heat_flux.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing authors: German Samolyuk (ORNL) and
Mario Pinto (Computational Research Lab, Pune, India)
------------------------------------------------------------------------- */
#include "comput... | ALGO | 0.987422 | 5.565597 |
33993a16-6640-464f-a045-b4d70cbc3dbc | efeslab/nvm-file-indexing | api/p-hot/boost_1_73_0/libs/graph/example/topo-sort2.cpp | int main()
{
using namespace boost;
const char* tasks[]
= { "pick up kids from school", "buy groceries (and snacks)",
"get cash at ATM", "drop off kids at soccer practice",
"cook dinner", "pick up kids from soccer", "eat dinner" };
const int n_tasks = sizeof(tasks) / size... | ALGO | 0.997632 | 5.149858 |
e7d37834-d5b8-45be-998d-d1a34f6f7896 | KanishAnand/CompetitiveCoding | CodeforcesContests/contest#721/1.cpp | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
#define lli long long int
#define llu unsigned long long int
#define pb push_back
#define rt return 0
#define endln "\n"
#define all(x) x.begin(), x.end()
#def... | ALGO | 0.999957 | 4.962347 |
14fe9c4a-5b66-4d44-9571-111762ba787e | KalaTushar/Rubik-s-Cube-solver | Model/PatternDatabase/Thistlethwaite/G2PatternDatabase.cpp | #include "G2PatternDatabase.h"
namespace busybin
{
/**
* Initialize the database storage.
*
* For the four edges, there are 12C4 combinations: 4 edges and 12
* positions, and the order does not matter.
*
* There are 8 corners, and the orientations of 7 dictate the orientation of
* the 8th (becau... | ALGO | 0.962637 | 7.902017 |
838fe0aa-f373-4f28-8154-6bbe4402c9f0 | HardKendo/Cycles1 | Ex4.cpp | #include <iostream>
int main()
{
int a = 0;
std::cout << "Enter any number 1 to 20 inclusive: ";
std::cin >> a;
while (a > 20 || a < 1)
{
std::cout << "Enter any number 1 to 20 inclusive: ";
std::cin >> a;
}
int multi = 1;
while (a <= 20)
{
multi *= a++;
... | ALGO | 0.997405 | 3.71447 |
4b504a88-4ea4-4616-98a7-090f22b2961a | m-eraf/DSApractice | Assignment 4/valid_palindrome.cpp | class Solution {
public:
bool isPalindrome(string s) {
transform(s.begin(), s.end(), s.begin(), ::tolower);
string c;
for(char a: s) {
if(isalnum(a))
c += a;
}
string b = c;
int n = c.size();
for (int j=0;j<n/2... | ALGO | 0.999707 | 6.101703 |
05f67147-896e-44de-8096-06e2c2d2b6fc | TilakAhmed/beecrowd | 1010.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int c1, n1, c2, n2;
double p1, p2;
cin >> c1 >> n1 >> p1 >> c2 >> n2 >> p2;
cout<< fixed<< setprecision(2) << "VALOR A PAGAR: R$ " << (n1 * p1) + (n2 * p2) << endl;
return 0;
}
| ALGO | 0.995143 | 3.767858 |
0edd292c-5056-463c-902f-944eabef44bc | manish511-github/DSA-Practise | 1537-maximum-score-after-splitting-a-string/1537-maximum-score-after-splitting-a-string.cpp | class Solution {
public:
int maxScore(string s) {
int n =s.length();
int zeros =0;
int maxi=0;
for(int i =0; i<n;i++)
{
if(s[i] =='0' )
{
zeros++;
}
}
int ones =0;
for(int i=n-1;i>=0;i--)
{
... | ALGO | 0.999945 | 5.458477 |
f2956c1f-b196-4a27-9d96-33bbab5b8a27 | moelwinhein/UVa-online-judge | 11459/main.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int tc, num_players, num_snala, num_rolls, from, to, move, run=1;
vector<int> pos(1000001, 1);
vector<int> snala(1000001, 0);
scanf("%d", &tc);
while(tc--) {
scanf("%d %d %d", &num_players, &num_snala, &num_rolls);
whil... | ALGO | 0.999187 | 3.625668 |
3254de18-2296-4098-bf71-28cd038ae0b7 | Monke457/advent | internal/2024/day4/cpp/main.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <vector>
int countXmasses(std::vector<std::vector<char>>, int, int);
bool hasXMas(std::vector<std::vector<char>>);
const int cardinalities[8][2] = {{-1, -1}, {-1,0}, {-1, 1}, {0, 1}, {1, 1}, {1, 0}, {1, -1}, {0, -1}};
int main() {
std::string file_pa... | ALGO | 0.990239 | 6.13269 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.