uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7d9e520b-4d8b-44d9-b0c9-ecc28d99e0cb | gaurnikhil/daily_coding_problems | 41-50/41(itinerary).cpp | unordered_map<string, multiset<string> > travel;
vector<string> ans;
void dfs(string current){
while(travel[current].size() ){
string next = *travel[current].begin();
travel[current].erase(travel[current].begin());
dfs(next);
... | ALGO | 0.999989 | 6.242948 |
14630182-ccbd-4c15-bc08-87cfdd4c6137 | miaojior/code | cpp/DUTstar/20230514/D.cpp | #include <iostream>
#include <vector>
#include <random>
#include <numeric>
using namespace std;
using ll = long long;
// 生成随机数
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand_int(int l, int r) {
return uniform_int_distribution<int>(l, r)(rng);
}
// 求 x 的二进制表示中最高位的幂次
int get_highest_... | ALGO | 0.999726 | 4.431467 |
69ccb44a-b61b-4d32-b984-d0ba11b1a103 | Gao-Group/lammps-3Mar20-atomdnn | src/hashlittle.cpp | // Hash function hashlittle()
// from lookup3.c, by Bob Jenkins, May 2006, Public Domain
// <EMAIL>
#include "hashlittle.h"
// if the system defines the __BYTE_ORDER__ define,
// we use it instead of guessing the platform
#if defined(__BYTE_ORDER__)
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
# define HASH_LITTL... | ALGO | 0.999255 | 5.820017 |
73506cff-1b26-4285-b0fa-cc27ea272d44 | aarifkhan7/gfg | rotatearrrevalgo.cpp | #include <bits/stdc++.h>
// Aarif Khan
// Codechef: https://www.codechef.com/users/aarifkhan_7
// Github: https://github.com/aarifkhan7
#define pi (3.141592653589)
#define MOD 1e9+7
#define ll long long int
#define all(x) x.begin(), x.end()
#define range(a, b) for(int i = a; i < b; i++)
#define range1(a, b) for(int j... | ALGO | 0.999474 | 3.93501 |
15e290e1-bc3e-4242-a1a4-e5f629f3f413 | daniel-ankit/Leetcode | 0092. Reverse Linked List II.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
struct TreeNode {
int val;
TreeNode *left;
... | ALGO | 0.999983 | 5.169387 |
ac63169c-1975-4deb-bb81-6be48f6b5713 | 3agwa/CompetitiveProgramming | UVA/UVA 12369.cpp | /*
* for the given input, we'll pick a card, multiply it by its probability and move to the next state
* we try to matck Joker1 to a suit, we'll do the same with Joker2
* we'll have to minimize over the Joker cards to optain our solution
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#de... | ALGO | 0.998919 | 3.811284 |
457e7b6e-13fa-4e21-ad23-815c7a694ec6 | afterthat97/acm-solutions | CODEVS/5037.cpp | #include <stdio.h>
#include <cmath>
int bkt[450][201005], addv[450], size, kk, a[200005], n, m;
void add(int l, int r, int v) {
int idx1 = l / size, idx2 = r / size;
if (idx1 == idx2) {
for (int k = l; k <= r; ++k) {
bkt[idx1][a[k]]--;
a[k] = (a[k] + v) % kk;
bkt[id... | ALGO | 0.999825 | 4.156257 |
56de65e5-9990-40db-b419-be8d289dce39 | hereket/inkscape-unity-build | src/3rdparty/2geom/src/2geom/orphan-code/chebyshev.cpp | #include <2geom/chebyshev.h>
#include <2geom/sbasis.h>
#include <2geom/sbasis-poly.h>
#include <vector>
using std::vector;
#include <gsl/gsl_math.h>
#include <gsl/gsl_chebyshev.h>
namespace Geom{
SBasis cheb(unsigned n) {
static std::vector<SBasis> basis;
if(basis.empty()) {
basis.push_back(Linear(... | ALGO | 0.999199 | 4.890239 |
628ef21e-05a0-4aa1-bfd5-510ec44f412b | rushikeshk1411/Preparation | GRAPH/rushikesh.cpp | #include<iostream>
using namespace std;
#include<vector>
int findParent(vector<int>& parent, int node){
if(parent[node] == node){
return node;
}
cout<<" node is: "<<node<<" parentNode: "<<parent[node];
return parent[node] = findParent(parent, parent[node]);
}
int main(){
vector<int>parent(5);
... | ALGO | 0.999918 | 4.685437 |
5c760138-3f13-43d1-90bc-b1fa814e7cff | tynnp/CP-Practice | UPCODER/LTNC25_OnTap_29.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, n, m, ans = 0;
cin >> n >> m;
vector<int> v(n);
for (int i = 0; i < n; i++)
cin >> v[i];
for (int i = 0; i < m; i++) {
cin >> x;
if (find(v.begin(), v.end(), x) == v.end())
ans++;
}
... | ALGO | 0.999931 | 3.64421 |
cecb7a33-4e55-4753-88b9-e4ff0ac70a9d | liweiwang1993/Algorithm | longestCommonPrefix.cpp | //最长共有string
string longestCommonPrefix(vector<string>& strs) {
string prefix="";
for(int idx=0;strs.size()>0;prefix+=strs[0][idx],idx++)
for(int i=0;i<strs.size();i++)
if(idx>strs[i].size()||(i>0&&strs[i-1][idx]!=strs[i][idx]))
return prefix;
return prefix;
}
| ALGO | 0.999634 | 4.918341 |
8a8686fb-4d8b-4766-baa7-ec45f980e58c | Sunny-Saurya/Cpp_Programming | Heap_Revision/Questions/kthLargestElement.cpp | #include <bits/stdc++.h>
using namespace std;
int findKthLargest(vector<int>& nums, int k) {
// Write your code here
// 1st - BRute Force
// sort(nums.begin(), nums.end());
// for(int i = 1; i < nums.size(); i++){
// if(nums[i-1] == nums[i]){
// continue;
// }
// return nums[nums.size()... | ALGO | 0.99997 | 4.404496 |
16099e5f-ebcb-4b3e-aaa3-1806e02b4f1c | sarvex/leetcode-scopes | solution/0500-0599/0530.Minimum Absolute Difference in BST/Solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999991 | 6.764758 |
9c8939dc-6d8d-4dc6-8ab9-b71bbc5c608b | SRaresP/old-code-archive | ex3/ex3.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <conio.h>
#include <iostream>
#include <windows.h>
using namespace std;
void div(unsigned int fn)
{
unsigned int i;
if (fn != 0) printf("divizori : ");
else printf("0 nu are divizori.");
for (i = 1; i <= fn; ++i)
{
if (fn % i == 0) printf("%d ", i);
}... | ALGO | 0.998154 | 4.058373 |
3be8b68c-23f6-4973-9e70-960609186263 | jadeshu/gamesrc | login_list_service/CLogic.cpp |
/* author : liuxu
* date : 2015.03.18
* description : login_list 主逻辑实现
*/
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <time.h>
#include <unistd.h>
#include "CLogic.h"
#include "base/Function.h"
#include "_LoginListConfig_.h"
enum RetValue
{
LoadConfigErr = 1,
CreateUDPErr = ... | WEB | 0.94328 | 4.230362 |
fb273a36-dd84-41d3-bb67-1831dc13c85a | g-akca/hackerrank | Algorithms/Game Theory/Game of Stones/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
/*
* Complete the 'gameOfStones' function below.
*
* The function is expected to return a STRING.
* The function accepts INTEGER n as parameter.
*/
string gameOfStones(int n) {
if (n % 7 < 2) {
... | ALGO | 0.999869 | 5.949226 |
e333690e-733b-436c-b5a7-1f6242649d4b | raysjoshua/UnrealEngine | Engine/Source/ThirdParty/IntelTBB/IntelTBB-4.0/src/old/concurrent_queue_v2.cpp | #include "concurrent_queue_v2.h"
#include "tbb/cache_aligned_allocator.h"
#include "tbb/spin_mutex.h"
#include "tbb/atomic.h"
#include <cstring>
#include <stdio.h>
#if defined(_MSC_VER) && defined(_Wp64)
// Workaround for overzealous compiler warnings in /Wp64 mode
#pragma warning (disable: 4267)
#endif
#defi... | TOOL | 0.941372 | 6.705224 |
5b7e9dc3-977c-4469-9432-a1eeba6457ff | bokutotu/atcoder | ABC/151/b.cpp | //参考:http://ehafib.hatenablog.com/entry/2015/12/23/164517
//インクルード
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<m... | ALGO | 0.999951 | 3.63741 |
e4620db1-31aa-4e95-abd0-928c2803aaff | lacie-life/visual-slam | Basic/RGB-D-SLAM-Tutorial/RGBD-5/src/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
#include "../include/slamBase.h"
// Given index, read a frame of data
FRAME readFrame( int index, ParameterReader& pd );
// measure the size of the movement
double normofTransform( cv::Mat rvec, cv::Mat tvec );
int main( int argc, char** ... | DATA | 0.968224 | 5.815821 |
a6171e6a-4ac3-42d5-a895-bcab4bebc864 | rua-creeper-233/Coding | 4.9考核/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
int t;
int main() {
cin >> t;
while (t--) {
ull n, ans = 1;
cin >> n;
if (n % 2) {
cout << "0" << endl;
continue;
}
for (int i = 2; i <= n / 2; i++) {
ans *= i * i;
ans %= 998244353;
}
cout << ans << endl;
}
}
| ALGO | 0.999946 | 5.033458 |
4ea21f28-af08-4e14-9585-7a3460c49112 | Kenny3Shen/MyLeetcode | leetcode_by_cpp/1217.玩筹码.cpp | /*
* @lc app=leetcode.cn id=1217 lang=cpp
*
* [1217] 玩筹码
*
* https://leetcode-cn.com/problems/minimum-cost-to-move-chips-to-the-same-position/description/
*
* algorithms
* Easy (68.88%)
* Likes: 61
* Dislikes: 0
* Total Accepted: 13.8K
* Total Submissions: 20K
* Testcase Example: '[1,2,3]'
*
* 数轴上... | ALGO | 0.999803 | 5.601857 |
b85a9fc7-9f5d-4e43-ba42-95cf4fac074d | KurisZ/leetcodeC- | algorithms/cpp/4Sum/4Sum.cpp | // Source : https://oj.leetcode.com/problems/4sum/
// Author : Hao Chen
// Date : 2014-07-03
/**********************************************************************************
*
* Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target?
* Find all unique quadruplet... | ALGO | 0.999907 | 5.418997 |
eb9a2062-b8c3-430c-86f4-6c6b805de254 | adilhamid/Practice-Leetcode | RobbersDp.cpp | class Solution {
public:
int rob(vector<int>& nums) {
int numsSize = nums.size();
if(numsSize < 2) return numsSize ? nums[0] : 0;
return max(robberChamp(nums, 0, numsSize-2) , robberChamp(nums,1,numsSize-1));
}
int robberChamp(vector<int> nums... | ALGO | 0.999905 | 5.888747 |
a7588fd0-0fa3-4e19-a222-f2d1356f9be4 | aredjil/euler_project | problem_930/.history/src/main_20250209184209.cpp | #include "gather.hpp"
std::random_device dv;
std::mt19937 gen(dv());
void step(std::vector<int> &balls, std::vector<int> &bowls, std::mt19937 &gen)
{
int m = balls.size();
int n = bowls.size();
int rd_ball;
int rd_dir;
// Choosing a random ball
std::uniform_int_distribution<int> choose_ball(0... | ALGO | 0.999902 | 4.961561 |
a73a9273-ed54-421f-a9ef-c951c2ca400a | sudhanshu6324/algorithms | josephusProblem.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define boost1 ios::sync_with_stdio(0)
#define boost2 cin.tie(0)
#define size1 1005
#define mod 1000000007
#define vll vector < ll >
#define vpll vector < pair < ll ,ll> >
#... | ALGO | 0.999954 | 4.094135 |
1db9eb08-ea75-4689-80d7-4f599b534125 | RoshanSharma20/leetcode_answers | 804.cpp | class Solution
{
public:
int uniqueMorseRepresentations(vector<string> &words)
{
vector<string> arr = {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."};
set<st... | ALGO | 0.999712 | 6.348616 |
0bdc7413-9d7e-4919-a0e2-0878ff5d6ed1 | BlancaCC/cultutrilla | cpp_aprendizaje/metodología_programación/practicas/practica_2/practica2/src/intervalo.cpp | /**
@file intervalor.cpp
@brief Implementación de la clase intervalo
@author Blanca Cano Camarero
*/
#include <iostream>
#include <assert.h>
#include "intervalo.h"
using namespace std;
Intervalo::Intervalo()
{
cotaInf = 0;
cotaSup = 0;
cerradoInf = false;
cerradoSup = false;
}
Intervalo::Intervalo(doub... | TOOL | 0.948154 | 4.493724 |
bfb7b4b3-eedb-433a-98da-8181d6430aa8 | anujrmohite/ondc-bfb | osrm-backend-master/src/partitioner/bisection_to_partition.cpp | #include "partitioner/bisection_to_partition.hpp"
namespace osrm::partitioner
{
namespace
{
struct CellBisection
{
std::uint32_t begin;
std::uint32_t end;
std::uint8_t bit;
bool tabu; // we will not attempt to split this cell anymore
};
static constexpr std::size_t NUM_BISECTION_BITS = sizeof(Bisectio... | ALGO | 0.999813 | 7.214248 |
f0a06619-3a52-47b4-9363-9b0c77632cf0 | hejiangda/PAT_Study | 2019/A1003_Emergency/main.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int n,m,c1,c2;
// e[i][j]表示图中某边的权,i和j分别为结点
// dis[i]表示从出发点到i结点最短路径的路径⻓度
// num[i]表示从出发点到i结点最短路径的条数
// w[i]表示从出发点到i点救援队的数⽬之和
int e[510][510], weight[510],dis[510],num[510],w[510];
bool visit[510];
const int inf = 99999999;
int main(){
// 读入数据
scanf("%... | ALGO | 0.999968 | 3.636194 |
2a34733f-6a80-42c3-b3f1-de3a45fae3a0 | kasakhare/CPP-Practice | functions.cpp | #include<iostream>
using namespace std;
int myfunction(int x,int y){
if (x>y)
return x;
else
return y;
}
int main(){
int a,b,c;
cout<<"Enter two number"<<endl;
cin>>a>>b;
cout<<"Greatest value:";
c=myfunction(a,b);
cout<<c;
} | ALGO | 0.999926 | 3.857857 |
e590fae5-79d8-44a7-88e5-cb6cc666b247 | catercode/uds_security_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.9988 | 6.76073 |
7973c4b8-592d-425e-b3b8-03bc5cc50aaf | MidhaShrey/DSA-Practice | Lec 9 Arrays/findUnique.cpp |
// Problem statement
// You have been given an integer array/list(ARR) of size N. Where N is equal to [2M + 1].
// Now, in the given array/list, 'M' numbers are present twice and one number is present only once.
// You need to find and return that number which is unique in the array/list.
// Note:
// Unique elemen... | ALGO | 0.999852 | 5.440681 |
f729d30a-1309-4fa3-9538-066ae9073b37 | elena2012/AlgorithmProblemsCodes | CodeForces/474A.cpp | #include <bits/stdc++.h>
using namespace std;
char a[3][11] = {
"qwertyuiop",
"asdfghjkl;",
"zxcvbnm,./"
};
char _index(char k, int op) {
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 10; j++) {
if(a[i][j] == k) {
return a[i][j+op];
}
}
}
}
... | ALGO | 0.998983 | 3.506321 |
ca9ab1d4-7775-4bde-b614-a0ab25bceacb | MahajanYashasvi156/LeetCoding | 1035-uncrossed-lines/1035-uncrossed-lines.cpp | class Solution {
public:
int maxUncrossedLines(vector<int>& nums1, vector<int>& nums2)
{
vector<vector<int>> dp(nums1.size()+1,vector<int>(nums2.size()+1));
for(int i = 1;i<=nums1.size();i++)
{
for(int j = 1;j<=nums2.size();j++)
{
if(nums... | ALGO | 0.999994 | 6.340315 |
d38129e3-aea4-43a7-808b-1d28d430fe71 | protickcse22/Uva_problem | 12372 - Packing for Holiday.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n, l, w, h;
cin >> n;
for ( int i = 0; i < n; i++ )
{
cin >> l >> w >> h;
if ((l<=20) && (w<=20) && (h<=20))
{
cout << "Case " << i + 1 << ": good" << endl;
}
else
cout << "Case... | ALGO | 0.986758 | 4.340001 |
4db85ca9-7299-44b9-a3a2-87fd33af52b8 | adityanjr/code-DS-ALGO | Patterns/advanced_patterns/Pattern-5.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter the value of (n) : ";
cin>>n;
for (int i = 0; i <= n/2; i++)
{
for (int j = 0; j < n; j++)
{
if((j >= (n/2)-i) && (j <= (n/2)+i))
cout<<" ";
else
cout<<"*";
}
cout<<endl;
}
for (int i = 0; i < n/2; i++)
{
f... | ALGO | 0.99991 | 3.419352 |
37bc72a8-5ef9-4554-97f4-878d4ebdad1a | BharathiInstitute/manjula | 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 |
795daa8b-8dc2-432f-83ac-a871323855fb | martin0327/LeetCode | 2785-sort-vowels-in-a-string/2785-sort-vowels-in-a-string.cpp | class Solution {
public:
string sortVowels(string s) {
string t = "AEIOUaeiou";
set<char> sc(t.begin(), t.end());
t.clear();
for (auto c : s) {
if (sc.count(c)) {
t += c;
}
}
sort(t.rbegin(), t.rend());
for (auto &c : s)... | ALGO | 0.999289 | 6.421033 |
6aa23eb6-af6b-45c5-9dfe-e69a70fbf713 | ishandutta2007/codeforces | black_horse2014/normal/1118/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 220000;
int sum[2][N], a[N];
int main() {
int n; cin >> n;
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < n; i++) {
for (int j : {0, 1}) sum[j][i+1] = sum[j][i];
sum[i&1][i+1] += a[i];
}
int ans = 0;
for (int i = 0; i < n; i++) {
i... | ALGO | 0.999905 | 3.900892 |
9e9dbd12-2035-4b1d-b75d-1551085f954c | kyduke/Coding | HackerRank/HourRank14/BeautifulDaysAtTheMovies.cpp | // https://www.hackerrank.com/contests/hourrank-14/challenges/beautiful-days-at-the-movies
#include <iostream>
using namespace std;
typedef unsigned long long UINT64;
UINT64 reverse(UINT64 n) {
UINT64 r;
r = 0;
while (n) {
r = r * 10 + n % 10;
n /= 10;
}
return r;
}
int solve(UINT64 i, UINT64 j, UINT64 ... | ALGO | 0.999775 | 4.421082 |
82409feb-4d1c-40fe-8365-a898f3bee48a | FirstAfterGod2501/Siaod-2023 | task6/ColorizeGraph/ColorizeGraph.cpp | //
// Created by first on 21.11.23.
//
#include "ColorizeGraph.h"
ColorGraph::ColorGraph(int V) {
this->V = V;
adj = new std::list<int>[V];
}
void ColorGraph::addEdge(int v, int w) {
adj[v].push_back(w);
adj[w].push_back(v);
}
void ColorGraph::greedyColoring() {
std::map<int, int> result;
st... | ALGO | 0.997294 | 6.09645 |
552323cf-efef-4109-a0b6-880e35b9035a | Syifaall/PBMTugas1 | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
9a91301f-23f7-42f8-a186-80a554fc97b4 | minjunkim0205/Algorithm-BaekjoonProblemSolving | Rank/Bronze/2577.cpp | //
// Created by mjk on 2024-01-30.
//
#include <iostream>
using namespace std;
int main(){
/*Input*/
int a, b, c;
cin >> a >> b >> c;
int trg = a*b*c;
/*Solve*/
int ans[10] = {0, };
while(trg!=0){
ans[trg%10]++;
trg=trg/10;
}
/*Output*/
for (auto e : ans) {
... | ALGO | 0.999926 | 4.934383 |
472c5442-372b-4224-9c00-57e8255de635 | BesserAlsSchule/JuliansAufgabe | Array Programm September/src/j_zusammenstellungVonHintenNachVorneAuflisten.cpp | #include "main.h"
#include <iostream>
using namespace std;
/// <summary>
/// bubblesort in die andere richtung?
/// </summary>
/// <param name="values"></param>
/// <returns></returns>
int *j_zusammenstellungVonHintenNachVorneAuflisten(int *values)
{
int numberOfValues = values[0];
cout << "Die Daten werden... | ALGO | 0.998436 | 3.354218 |
cccf8d4a-4bdc-4616-8574-8edfdbeaf373 | md-khadimul-islam/weatherApp | 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 |
0e94069d-2d8d-49ef-9ed9-f0ec077464c1 | ThoseBygones/ACM_Code | CodeForces/CodeForces 1528B.cpp | /*
********************************************************************************
* Author: ThoseBygones
* Version: V1.0
* Date: 2023-10-05
* Subject: ACM-ICPC
* Language: C/C++14
* OJ: CodeForces
* Algorithm: dp + 因子统计
********************************************************************************
... | ALGO | 0.999992 | 5.701705 |
b55633de-5cdd-4807-9352-0835fa31ca31 | vixiv0418/CodeTree | 250416/선택 정렬 구현/implement-selection-sort.cpp | #include <iostream>
using namespace std;
int n;
int arr[100];
void SelectionSort() {
for(int i=0; i<n-1; i++) { // 비교 하는 값을 min으로 둠
int min =i;
for(int j= i+1; j<n; j++) // i+1의 의미 = 이미 앞에는 정렬 되어 있으니 제외
if(arr[min]>arr[j]) // 제일 작은 값의 인덱스를 찾아서 min에 넣는다.
min = j;
... | ALGO | 0.999958 | 4.857095 |
cb33ddef-86e9-40f1-8e33-8c834adaabdd | inj-krish19/CPP-Programs | C++ by Me/Mixed Questions/prg 5.cpp | #include<iostream>
#include<iomanip>
using namespace std;
class Date{
private :
int day;
int month;
int year;
public :
Date(){
day = 19;
month = 2;
year = 2023;
}
Date(int d,int m,int y){
day = d;
month = m;
year = y;
}
string getMonth(int m){
if(m == 1) return "J... | TOOL | 0.894519 | 4.128962 |
d03e6fca-e3cd-4e28-9456-e2e53377a767 | Winemaker-Circle/leetcode-master | test/yzc/0619/169.MajorityElement.cpp | #include <unordered_map>
#include <iostream>
#include "vector"
using namespace std;
// 169. 多数元素
class Solution {
public:
// 使用哈希表实现 O(n)
static int majorityElementHash(vector<int>& nums) {
unordered_map<int,int> freq;
for(int num:nums){ // 计算频次
freq[num]++;
}
int ... | ALGO | 0.999917 | 5.269727 |
6a253f66-cb5b-4f38-9975-2cc64767de50 | AmmyYou/contest | Project1/源.cpp | #include "iostream"
#include "string"
#include "stack"
#include "algorithm"
using namespace std;
class Solution {
public:
bool backspaceCompare(string S, string T) {
if (S.empty() && T.empty()) return true;
if (S.empty() || T.empty())return false;
stack<char> q1, q2;
//q1.push(*S.begin());
for (char ch : S)... | ALGO | 0.999563 | 5.379788 |
e6f431fa-0ae1-43f2-87c6-32ca37ce9bd6 | CrazyMrAll/codefiled_cpp | 中国大学MOOC-陈越、何钦铭-数据结构-2022夏/03-树3 Tree Traversals Again again.cpp | #include <iostream>
#include <cstring>
using namespace std;
#define MAXN 30
int stack[MAXN], top = -1;
int PostOrder[MAXN];
typedef struct node {
int left = -1, right = -1;
} Node;
Node node[31];
int Push(int t) {
stack[++top] = t;
return t;
}
int Pop() {
int t = stack[top];
stack[top--] = 0;
... | ALGO | 0.99998 | 4.069535 |
6a05c0c5-f831-4ff6-8a9b-0073de6c0c7e | YourName0729/competitive-programming | Kattis/knightsfen.cpp | // dicision_tree DFS
// https://open.kattis.com/problems/knightsfen
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define For(i, n) for (int i = 0; i < n; ++i)
#define Forcase int __t = 0; cin >> __t; while (__t--)
#define pb push_back
#define ll long long
#defi... | ALGO | 0.99994 | 5.400701 |
f4de4305-2848-48f3-89f4-7f4274c94118 | xuebai5/TheZombieEngine | ode/OPCODE/OPC_AABBCollider.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... | ALGO | 0.997514 | 7.576468 |
d5ff8272-e34b-452d-a2bb-07be1918cb0f | aospX/platform_external_llvm | lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp | using namespace llvm;
STATISTIC(NumEdgesInserted, "The # of edges inserted.");
namespace {
class OptimalEdgeProfiler : public ModulePass {
bool runOnModule(Module &M);
public:
static char ID; // Pass identification, replacement for typeid
OptimalEdgeProfiler() : ModulePass(ID) {
initializeOptima... | TOOL | 0.854042 | 7.394688 |
5f2cd550-f810-4efe-a6c5-49d225cc52e7 | JuiceVodka/BlastJumper2 | Library/PackageCache/com.unity.ide.visualstudio@2.0.12/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.96573 | 6.969462 |
f766c9c7-068d-4de8-9712-84d655848eb0 | revyos-rocm/rocm-rocsolver | library/src/lapack/roclapack_sytf2_batched.cpp | #include "roclapack_sytf2.hpp"
ROCSOLVER_BEGIN_NAMESPACE
template <typename T, typename U>
rocblas_status rocsolver_sytf2_batched_impl(rocblas_handle handle,
const rocblas_fill uplo,
const rocblas_int n,
... | ALGO | 0.9706 | 6.785205 |
2f4c45ba-bd13-4280-aee6-f7ce482e9e99 | 1uc/ZisaFVM | src/zisa/math/newton.cpp | #include <zisa/math/basic_functions.hpp>
#include <zisa/math/newton.hpp>
namespace zisa {
double newton(const std::function<double(double)> &f,
const std::function<double(double)> &df,
double x_guess,
double atol,
int max_iter) {
return newton(
[&f, &df... | ALGO | 0.999885 | 6.200335 |
d9fb6369-c488-4e00-b16f-5c049b1f3330 | datmieu204/DSA | DSA_UET_LEC/Lecture1/1.cpp | #include<iostream>
using namespace std;
int main(){
string user_in;
getline(cin,user_in);
for(int i=user_in.size()-1; i>=0; i--){
cout << user_in[i];
}
return 0;
} | ALGO | 0.998265 | 3.570164 |
712905ee-2a55-464e-ae75-10ea7b143744 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_5948_5.cpp | #include <bits/stdc++.h>
using namespace std;
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long l;
string s;
cin >> l;
cin >> s;
long long d = 1;
cout << s[0];
for (long long i = 0; i < l;) {
i = i + d;
d++;
cout << s[i];
}
}
| ALGO | 0.999982 | 3.379962 |
9b2ee4ca-9c55-42ef-a4e3-4de1c48270b6 | firstimedeveloper/neetcode | 05_top_k_frequent_elements.cpp | /*
Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1,2]
*/
#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
if (a.second == b.... | ALGO | 0.999997 | 5.976932 |
3881a400-96dd-4efb-b3ee-9dd212eda452 | apksherlock/cpp_refresher | dynamicArrays.cpp | // dynamicArrays.cpp
#include <iostream>
using namespace std;
void addItem(int newItem, int *&scores, int &numItems, int &capacity);
int main()
{
int capacity = 10;
int numItems = 5;
int *scores = new int[capacity];
for (int i = 0; i < 100; i++)
{
addItem(i * 2 + 3, scores, numItems, cap... | ALGO | 0.982265 | 5.549346 |
2f5ae91e-cdad-4890-a700-c14cb85210f8 | anuragpratap05/DSA | GRAPH/graph_revision/class5/684_redundant_connections.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int>par;
vector<int>size;
int find(int i)
{
if(par[i]==i)
{
return i;
}
par[i]=find(par[i]);
return par[i];
}
void unite(int p1,int p2)
{
if(size[p1]<size[p2])
{
par[p1]=p2;
size[p2]+=size[p1];
}
else{
... | ALGO | 0.999718 | 4.49625 |
95268a18-3f27-4802-8b61-60812de81e56 | saifabrar-cp/xpsc | week-1/day-7/First-negative-integer-in-every-window-of-size-k.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
vector<long long> printFirstNegativeInteger(long long int arr[],
long long int n, long long int k);
// Driver program to test above functions
int main()
{
long long int t, i;
cin >> t;
while (t... | ALGO | 0.999943 | 5.318569 |
02559f7a-7211-4527-b1bd-ca3d58c1f217 | AhmedSelim04/Leetcode-Daily-challenge-solutions | 2665-minimum-time-to-repair-cars/2665-minimum-time-to-repair-cars.cpp | class Solution {
public:
long long repairCars(vector<int>& ranks, int cars) {
long long s=0,e=pow(cars,2)*(*max_element(ranks.begin(),ranks.end())),ans=-1,sum=0;
while(s<=e){
long long mid=(s+e)/2;
for(auto i:ranks){
sum+=sqrt(mid/i);
}
... | ALGO | 0.999971 | 5.700758 |
105fc92d-91ce-469e-ba89-a760873d0670 | Anup-001/Codeforces-solved | A_Short_Sort.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string s;
cin>>s;
if(s[0]=='a' || s[1]=='b' || s[2]=='c'){
cout<<"YES"<<endl;
}
else cout<<"NO"<<endl;
}
} | ALGO | 0.999213 | 3.909133 |
d856dc35-971f-49b5-b989-51a624ba94a4 | Cryszzz/FluidFoam | SPlisHSPlasH/Utilities/PoissonDiskSampling.cpp | #include "PoissonDiskSampling.h"
#include <algorithm>
#include <limits>
#include <iostream>
#include <fstream>
#include <string>
#define _USE_MATH_DEFINES
#include "math.h"
using namespace std;
using namespace Eigen;
using namespace SPH;
PoissonDiskSampling::PoissonDiskSampling()
{
}
void PoissonDiskSampling::sam... | ALGO | 0.999212 | 3.638354 |
040f9916-aeca-429b-a1c5-5750b7dfd648 | okuraofvegetable/AtCoder | atcoder.jp/abc016/abc016_3/Main.cpp | // #pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline")
// #pragma GCC option("arch=native", "tune=native", "no-zero-upper")
// #pragma GCC target( \
// "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
ty... | ALGO | 0.999883 | 4.400637 |
9b08f5a2-58fb-4522-90b7-de0e8c097b3d | SrinivasuluCharupally/leetcode_questions_answers | 143_reorder-list.cpp | #include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node* next;
};
struct Node* newNode(int key)
{
struct Node* temp = (Node*)malloc(sizeof(struct Node));
temp->data = key;
temp->next = NULL;
return temp;
}
void printlist(struct Node* head)
{
while (head) {
pr... | ALGO | 0.999984 | 4.607606 |
ae776a2d-db20-4de6-bf7e-3c5c2f9c2aa4 | ishandutta2007/codeforces | pavement/normal/1452/A.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 int long long
#ifdef WIN_32
#define getchar_unlocked _getchar_nolock
#endif
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_fron... | ALGO | 0.99983 | 4.473546 |
3439a1d8-9706-4229-8204-e9ff31eeae8a | protonaosp-gsi/android_frameworks_av | media/codecs/amrnb/common/src/shr.cpp | /*
Filename: /audio/gsm_amr/c/src/shr.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the shr function. Sync'ed up with
the current template and fixed tabs.
Description: 1. Modified code by seperating var2=0 condi... | ALGO | 0.992757 | 6.573509 |
9a8f9621-f85a-463c-be16-12dbad450bdc | cai880210/PhotographicMosaic | RGBGridPatchDatabase.cpp | #include "RGBGridPatchDatabase.h"
#include <stdlib.h> // rand
RGBGridPatchDatabase::RGBGridPatchDatabase() : images_(), PatchDatabase() {
}
RGBGridPatchDatabase::~RGBGridPatchDatabase() {
}
/*
Adds an image to the databse and a descriptor for that image.
*/
void RGBGridPatchDatabase::add(const cv::Mat image) ... | TOOL | 0.969482 | 5.486346 |
3f4e384e-9dbe-4498-a111-98f373c45d35 | raincross7/code-similarity | codes/train_code/problem106/problem106_275.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, a; cin >> n;
vector<int> nums;
for (int i = 0; i < n; ++i) {
cin >> a;
nums.push_back(a);
}
auto res = 0ll;
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n; ++j) {
res += ... | ALGO | 0.999947 | 5.073192 |
0a2ed5b6-747b-43b0-acf7-ff79dbb2dd01 | BreeDurbin/leetcode-solutions | contest/contest_393/2.cpp | class Solution {
public:
int maximumPrimeDifference(vector<int>& nums) {
int first = -1, second = -1;
bool flag = false;
for(int i=0; i<nums.size(); i++){
bool prime = isPrime(nums[i]);
if(!flag && prime){
first = i;
second = i;
... | ALGO | 0.999915 | 5.380865 |
b077f3df-621d-462a-9030-1b57177bcda7 | finyle/algo_ds | algo_acm_tedukuri/tedukuri/1_basic_ds/8_exp/12_Phone List.cpp | /*
给定一列电话号码,判断在没有emergency前缀时, 它们是否相同
input: 2
3
911
97625999
91125426
5
113
12340
123440
12345
98346
output:NO
YES
*/
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int N = 10006, L = 12;
int trie[N*L][10], tot;
bool ed[N*L];
char s[N][L];
bool Phone_List() {
int n;
cin >> n;
... | ALGO | 0.999177 | 4.588998 |
6d64b26c-8606-4151-893c-7d580184f81b | dringakn/ROSExamples | src/example_cpp_polymorphism.cpp | #include <fstream> // file operations
#include <iostream> // cout, etc.
#include <memory> // make_shared, etc.
/*
C++ polymorphism refers to the ability of objects of different classes to be
treated as objects of a common base class. It allows you to write code that
can work with objects of different types... | TOOL | 0.980878 | 7.404869 |
a9fd3e7f-0b29-4d3a-b3f4-22485556b251 | rudalsd/Algorithm-Study | 백준/그래프/16509. 장군.cpp | #include<iostream>
#include<queue>
using namespace std;
int R1, C1, R2, C2;
int visited[10][9];
int dy[8][3] = {
-1,-1,-1,
0,-1,-1,
0,1,1,
1,1,1,
1,1,1,
0,1,1,
0,-1,-1,
-1,-1,-1
};
int dx[8][3] = {
0,1,1,
1,1,1,
1,1,1,
0,1,1,
0,-1,-1,
-1,-1,-1,
-1,-1,-1,
0,-1,-1
};
struct node {
int y;
int x;
int ... | ALGO | 0.999952 | 4.014385 |
4e03fcb6-f49f-4f65-8a62-c5cc444c7543 | Vaibhav-Kumar10/50-Days-Coding-Challenge | Day 14 - 13-05-2025/Q1/Q1.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution
{
public:
ListNode *partition(L... | ALGO | 0.999995 | 5.340029 |
bbac1ba9-a873-402b-971f-f0a040a2c441 | Kshitij-24/Interview-Preperation | 2. Pairing elements - GFG/2.-pairing-elements.cpp | // { Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
/*
array_of_Pairs(arr, N): function which returns the array of pairs
arr[]: contains elements of given array
N: sze of array
*/
vector<pair<int, int>> array_of_Pairs... | ALGO | 0.997143 | 6.096473 |
03013b13-a58c-41ac-acc2-e6adc6863e50 | zodiacon/QuickAsm | QuickAsm/Helpers.cpp | #include "pch.h"
#include "Helpers.h"
#include "..\x64Types\x64Types.h"
std::wstring Helpers::GetTempFilePath(PCWSTR name) {
WCHAR path[MAX_PATH]{};
::GetTempPath(_countof(path), path);
::GetTempFileName(path, name, 0, path);
return path;
}
std::vector<BYTE> Helpers::ReadFileContents(PCWSTR path) {
... | TOOL | 0.869442 | 5.840178 |
32b8c7c0-a29c-47f5-bb8b-aee242936eea | yinzm/LeetCodeSolution | 剑指offer/08_跳台阶.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int jumpFloor(int number) {
if (number <= 2) return number;
int a = 1, b = 2;
int val;
for (int i = 3; i <= number; ++i) {
val = a+b;
a = b;
b = val;
}
return b... | ALGO | 0.999833 | 5.513946 |
de347178-eb82-46f4-b213-5d61a96cfb91 | relokin/parsec | pkgs/libs/tbblib/src/examples/parallel_do/parallel_preorder/parallel_preorder.cpp | /* Example program that shows how to use parallel_do to do parallel preorder
traversal of a directed acyclic graph. */
#include "tbb/parallel_do.h"
#include "tbb/atomic.h"
#include <vector>
#include <algorithm>
#include <cstring>
#include "Graph.h"
using namespace std;
//! Number of trials. Can be changed from c... | ALGO | 0.999321 | 6.488686 |
10e7c0be-2a14-4f65-b0b5-c4a74e819cf8 | ishandutta2007/codeforces | andreysergunin/normal/958/E2.cpp | #include <iostream>
#include <fstream>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <cmath>
#include <algorithm>
#include <assert.h>
#include <vector>
#include <cstring>
#include <random>
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define pb push_back
using namesp... | ALGO | 0.999921 | 3.558402 |
5d483d86-7f14-442f-9016-940571fd5c5e | ishandutta2007/codeforces | briansu/normal/777/A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(int i=0;i<n;i++)
#define FILL(i,n) memset(i,n,sizeof(i));
#define SZ(A) ((int)A.size())
#define ALL(A) A.begin(),A.end()
#define X first
#define Y second
#define pb push_back
#ifdef brian
#... | ALGO | 0.999973 | 3.519184 |
ab0c667e-151a-41b7-9a4c-c97fb35ff011 | lZiinl/codetree-TILs | 241008/루돌프의 반란/rudolph-rebellion.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N, M, P, C, D;
int t=1;
int map[52][52];
int dx[4] = { 0,1,0,-1 };
int dy[4] = { -1,0,1,0 };
int d_cnt;
struct Santa {
int num, y, x;
};
vector<Santa> s;
Santa rd;
int score[32];
int stun[32];
int... | ALGO | 0.999894 | 4.209356 |
f16fc5d3-ff4a-45f0-a17e-e8441b7c4bae | LaxmanSingh07/DSA | DS/BINARY_SEARCH/Striver/_01_bs.cpp | /*
Binary Search is a technique used to search for an element in a sorted array. It works by repeatedly dividing the search interval in half. If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half. Otherwise narrow it to the upper half. Repeatedly chec... | ALGO | 0.999958 | 6.4815 |
f99e174e-62d4-4834-bd0a-81e19f47cace | sreepadh-sandilya/dsa_problems | leetcode/linked list/61. Rotate List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* rotateRight... | ALGO | 0.999982 | 5.700047 |
822b233b-fcaa-4751-b527-c1f0f09f54c3 | STMicroelectronics/STM32CubeL4 | Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.914648 | 7.471897 |
11a96cd3-156b-4870-bce2-91a01829bd4b | krishna-y2000/My_DSA_Sheet | arrays/2D/MaxRectangleOfBinaryMatrix.cpp |
class Solution{
public:
// to get max width for helper func we can also do right[] - left[] - 1
int helper( vector<int> v )
{
stack<int> s ;
v.push_back(-1);
int i=0;
int n = v.size() , res = 0;
for(int i = 0 ; i < n ; i++)
{
while(!s.empty(... | ALGO | 0.99996 | 5.206413 |
3af31b4d-6973-4921-b2f3-6aaf5721f3a0 | yash-pratap-singh/fjf | Contest/3/Q4.cpp | #include<iostream>
#include<vector>
#include<map>
#include<climits>
#include<algorithm>
#include<math.h>
#include<queue>
#include<stack>
#include<set>
#define pb push_back
#define vi vector<int>
#define vl vector<long long>
#define vvi vector<vector<int> >
#define vvl vector<vector<long long> >
#define ll long long
usi... | ALGO | 0.999463 | 4.913219 |
534fff8c-977f-48f4-9650-914419e496f7 | roytam1/mypal68-changes | modules/fdlibm/src/e_sqrt.cpp | /* @(#)e_sqrt.c 1.3 95/01/18 */
/* __ieee754_sqrt(x)
* Return correctly rounded sqrt.
* ------------------------------------------
* | Use the hardware sqrt if you have one |
* ------------------------------------------
* Method:
* Bit by bit method using integer arithmetic. (Slow, b... | ALGO | 0.999976 | 4.566104 |
3ad7f775-7586-448e-a95f-a588fdb859a5 | Apress/learn-cocos2d-game-dev-w-ios-5 | CH08_code/ShootEmUp02/libs/Box2d/Dynamics/Joints/b2DistanceJoint.cpp | #include <Box2D/Dynamics/Joints/b2DistanceJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// 1-D constrained system
// m (v2 - v1) = lambda
// v2 + (beta/h) * x1 + gamma * lambda = 0, gamma has units of inverse mass.
// x2 = x1 + h * v2
// 1-D mass-damper-spring system
// m (v2 - v1... | ALGO | 0.998221 | 6.97783 |
b8e8ccba-c91d-4301-a030-067502b5f245 | algoboy101/note_blog_leetcode | delete/source/cpp/[312]戳气球.cpp | //有 n 个气球,编号为0 到 n-1,每个气球上都标有一个数字,这些数字存在数组 nums 中。
//
// 现在要求你戳破所有的气球。每当你戳破一个气球 i 时,你可以获得 nums[left] * nums[i] * nums[right] 个硬币。 这里的
//left 和 right 代表和 i 相邻的两个气球的序号。注意当你戳破了气球 i 后,气球 left 和气球 right 就变成了相邻的气球。
//
// 求所能获得硬币的最大数量。
//
// 说明:
//
//
// 你可以假设 nums[-1] = nums[n] = 1,但注意它们不是真实存在的所以并不能被戳破。
// 0 ≤ n ≤ 500... | ALGO | 0.999986 | 5.3914 |
94c7ec58-d010-4b4f-a552-873a8f98f5f1 | RockieBoy/apotek-cirea | 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 |
2cedcab7-455e-4a18-975a-95a48cb71f8b | AhmedAltunisi/BoostPush | boost_1_82_0/libs/mpl/example/inherit_multiply.cpp | // $Id$
// $Date$
// $Revision$
#include <boost/mpl/inherit.hpp>
#include <boost/mpl/inherit_linearly.hpp>
#include <boost/mpl/list.hpp>
#include <iostream>
namespace mpl = boost::mpl;
using namespace mpl::placeholders;
template< typename T >
struct tuple_field
{
typedef tuple_field type; // note the typedef
... | ALGO | 0.95275 | 5.400237 |
baf355c7-9e3d-4090-a9da-b49436271641 | SMiles02/CompetitiveProgramming | Codeforces/CF 1600 - 1699/CF1690/CF1690B.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n, x = 0;
cin >> n;
int a[n], b[n];
for (int i = 0; i < n; ++i)
cin >> a[i];
for (int i = 0; i < n; ++i)
cin >> b[i];
for (int i = 0; i < n; ++i)
x = max(x, a[i] - b[i]);
for (int i = 0; i < n; ++i)
... | ALGO | 0.999927 | 3.963406 |
801478f9-6daa-463a-be34-4640098a9bf2 | ahmedredaooooo/Problem-Solutions | CodeForces/29C/45304241_AC_342ms_21232kB.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "Debug.cpp"
#define FileI(fileName)
#define FileO(fileName)
#else
#define FileI(fileName) freopen(#fileName, "r", stdin);
#define FileO(fileName) freopen(#fileName, "w", stdout);
#define debug(...) 1
#define Time(i, x...) x
#endif
#define un u... | ALGO | 0.999968 | 4.943573 |
d8a6118a-67a8-4486-a3fa-628ef2ecf68b | viveky1794/viveky1794_Competitive_Programming | Cpp_Questions/Leet_Code_Problems/BIT_MASKING/atoi.cpp |
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
using namespace std;
int myAtoi(string s) {
if( !s.length() ) return 0;
int sum=0, negativeflag=1;
int flag = 1;
for(int i=0; i < s.length(); i++)
{
if( s[i] == ' ') contin... | TOOL | 0.986516 | 3.747946 |
3041b099-c9d4-4cdf-9828-dc9930453a2b | buranv5/ForResume | tz for resume(16.02)/Library/PackageCache/com.unity.ide.visualstudio@2.0.11/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.971029 | 6.947423 |
d95faba3-d9b0-4728-b7ab-c223a008fef1 | Tomhawkstorm55557/solutions | 1713-minimum-operations-to-make-a-subsequence/1713-minimum-operations-to-make-a-subsequence.cpp | class Solution {
public:
int minOperations(vector<int>& target, vector<int>& arr) {
unordered_map<int, int> index_map;
for (int i = 0; i < target.size(); ++i) {
index_map[target[i]] = i;
}
vector<int> lis;
for (int num : arr) {
if (in... | ALGO | 0.999969 | 6.13236 |
cf97878c-9882-4e1d-aea5-0ea868907a80 | jiangjianping/opencore-amr | opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/bgnscd.cpp | /*
------------------------------------------------------------------------------
Filename: bgnscd.cpp
Functions:
Bgn_scd_reset
Bgn_scd
------------------------------------------------------------------------------
MODULE DESCRIPTION
Background noise source characteristic detector (SCD)
--... | ALGO | 0.938635 | 6.963638 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.