uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7ab35dd0-1029-480e-a8c7-c354c343feb5 | kinshuk-dewari/STL | STL/algorithm header file/algorithm_1.cpp | // A C++ program to demonstrate working of sort(),
// reverse()
/*
1 sort(first_iterator, last_iterator) – To sort the given vector.
2 reverse(first_iterator, last_iterator) – To reverse a vector.
3 *max_element (first_iterator, last_iterator) – To find the maximum element of a vector.
4 *min_element (first_ite... | ALGO | 0.999803 | 5.431354 |
5bad8c08-d647-448f-b45e-b80355e78ed7 | ayegenberdiyeva/cpp_pp1_labs | lab7/lab7_4.cpp | #include <iostream>
using namespace std;
int sum = 0;
void sum_of_digits(string s, int i){
if (s.size()==i){
cout << sum << endl;
return;
}
sum += s[i]-48;
sum_of_digits(s, ++i);
}
int main(){
string num;
cin >> num;
sum_of_digits(num, 0);
return 0;
} | ALGO | 0.999811 | 4.62875 |
419b8c73-19e7-4b7a-8ea2-ddbf6f72c0d1 | XingXingXudong/LeetCodePractice | 05_search/BFS/test.cpp | #include <iostream>
#include <vector>
#include <string>
int main(int argc, char* argv[]) {
auto strs = std::vector<std::string>{"abc", "aaa", "bbb"};
auto back = strs.back();
back[2] = 'C';
std::cout << "back: " << back << std::endl;
for (const auto& x: strs) {
std::cout << x << ", ";
}
... | TOOL | 0.932252 | 5.083714 |
d2a0e3bf-5ecd-43fe-b442-5afe00e4d12a | raincross7/code-similarity | codes/train_code/problem337/problem337_324.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
signed main() {
int n;
string s;
cin >> n >> s;
vector<int> R, G, B;
rep(i,n) {
if(s[i] == 'R') R.push_back(i);
if(s[i] == 'G') G.push_back(i);
if(s[i] == 'B') B.push_back(i);
}
long long ans ... | ALGO | 0.997449 | 3.914649 |
f8f75ddd-f6b9-4489-9991-b46d46690297 | Md-Rakib-Hassan/PROBLEM-SOLVING | 46_Permutations(LeetCode).cpp | //https://leetcode.com/problems/permutations
class Solution {
public:
// Helper function to generate all permutations recursively
void perm(vector<int>& nums, vector<vector<int>>& ans, int sz, int idx) {
// Base case: If the current index is equal to the size, a complete permutation is formed
i... | ALGO | 0.999996 | 6.963331 |
8ca35718-4290-42f0-ae8b-e701723be153 | Aashish-creates/Competitive-Coding | Leetcode/2278.cpp | class Solution {
public:
int percentageLetter(string s, char letter) {
map<char,int>mp;
for(int i=0;i<s.size();i++)
{
mp[s[i]]++;
}
int n=s.size();
int aa=0;
for(auto rt:mp)
{
if(rt.first==letter)
{
aa=... | ALGO | 0.999432 | 5.057259 |
525b1fc6-89ba-4121-a13e-41492ffff5b7 | jimm9Tran/DSA | Codeforces/112A.cpp | #include <iostream>
#include <vector>
#include <string>
#include <iomanip>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
string s1, s2;
cin >> s1 >> s2;
transform(s1.begin(), s1.begin(), s1.begin(), ::tolower);
transform(s2.begin(), s2.begin()... | ALGO | 0.999992 | 4.23524 |
30ea4b15-969d-4d3f-8b58-d5d914e5bfdd | thangitus/LeetCode-Solution | C++/Two Pointers/3Sum With Multiplicity.cpp | #include <bits/stdc++.h>
using namespace std;
/*
* https://leetcode.com/problems/3sum-with-multiplicity/
*/
class Solution {
public:
int threeSumMulti(vector<int> &nums, int target) {
unordered_map<int, int> map;
int res = 0, mod = 1e9 + 7;
for (int i = 0; i < nums.size(); i++) {
... | ALGO | 0.999972 | 5.810308 |
34a5fd49-775a-483b-9b95-e6da589b7ccb | GabrielFrizzo/competitive-programming | treinos/2021/22jun/E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int,int>;
const int MxN = 11234;
const int MOD = 1e9 + 7;
int imp[MxN];
int g[MxN][MxN];
int N, C;
int dfs(int u, int p) {
int total = 0;
for (int v = 1; v <= N; ++v) {
if (v != p && g[u][v]) {
total ... | ALGO | 0.999911 | 3.849881 |
907ca5ff-201b-4121-90e8-6d0efba694ac | jack06215/programming_exercises | LeetCode/Binary Search/240. Search A 2D Matrix II.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
int n = matrix.size();
int m = matrix[0].size();
// start from the most upper-left element
int i = 0;
int j = m - 1;
whi... | ALGO | 0.999925 | 6.005466 |
b3225a3a-c3fc-45eb-97f8-0ece5912e035 | AbhijayKrishna01/PLACEMENT-PREPARATION-MODULE | WEEK 3/DAY 20/Find LCA of two nodes in BST.cpp | /**
* 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:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if(root==NU... | ALGO | 0.999971 | 6.177017 |
60a00fcd-300e-4455-9478-9247872b670b | thisisaman408/DSA | DSAinC++/Lecture05/evennumbers.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
char a;
cout << "Do you want to print odd(o) or even(e) number : " << endl;
cin >> a;
cout << "Enter number up to which you want to print the even or odd numbers : " << endl;
cin >> n;
if (a == 'e')
{
cout << "Even nu... | ALGO | 0.976036 | 4.461131 |
6c656420-1fcc-45a7-8fc2-6f2ae548ebcb | alexandraback/datacollection | solutions_5708284669460480_0/C++/TwoTonTunic/B.cpp | #include <iostream>
using namespace std;
int T;
int K, L, S;
string board;
int freq[26];
string target;
int main(){
cin >> T;
for(int t=1; t<=T; t++){
cin >> K >> L >> S >> board >> target;
int most = S / L;
for(int o=1; o<L; o++){
if(target.substr(L-o) != target.substr(0... | ALGO | 0.998484 | 3.318056 |
ca4c59ae-8c17-471d-9a76-13d2cc603d30 | ishandutta2007/codeforces | unused/normal/148/D.cpp | #include <bits/stdc++.h>
using namespace std;
long double dp1[1001][1001];
long double dp2[1001][1001];
bool v1[1001][1001];
bool v2[1001][1001];
long double D(int, int); long double E(int, int);
long double D(int w, int b)
{
if (w == 0) return 0;
if (b == 0) return 1;
if (v1[w][b] == false)
{
... | ALGO | 0.999554 | 4.040492 |
bcd719f4-bd3f-4207-8163-ea542ff9d016 | 21prnv/video-sharing-app-flutter | 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 |
0ee8481f-2fa3-435d-943d-1e562451e745 | Bhanupriya-art/DSA-Coding-Practice | Strings/Counting_Vowels_And_Consonents_In_String.cpp | #include <iostream>
using namespace std;
const int MAX_SIZE = 100;
void VowelsCount(char A[]){
int i, vcount = 0, ccount = 0;
for(i = 0; A[i]!='\0';i++){
if(A[i] == 'a' || A[i] == 'e' || A[i] == 'o'
|| A[i] == 'i' || A[i] == 'u' || A[i] == 'A' ||
A[i] == 'E' || A[i] == 'O' || A[i] == '... | ALGO | 0.999007 | 5.19323 |
46b7cbca-4efe-4e67-b812-3134d7c5be46 | Maniekkk/Marlin-2.0.5.3_skr_1_4_turbo | Marlin/src/lcd/menu/game/maze.cpp | #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(MARLIN_MAZE)
#include "game.h"
int8_t move_dir, last_move_dir, // NESW0
prizex, prizey, prize_cnt, old_encoder;
fixed_t playerx, playery;
// Up to 50 lines, then you win!
typedef struct { int8_t x, y; } pos_t;
uint8_t head_ind;
pos_t maze_walls[50] = {
... | ALGO | 0.929765 | 5.047589 |
bfb5e228-2717-4873-b64d-a45c36736a97 | hzfsls/leetcode-supercrawl | data/2220.minimum-bit-flips-to-convert-number/code_snippets/sol.cpp | class Solution {
public:
int minBitFlips(int start, int goal) {
}
}; | ALGO | 0.999931 | 5.510666 |
2c936704-e864-438b-aaa1-3af95a02348f | rhy2106/Desafios-de-programacao | YouKn0wWho/lca/Distance_Query.cpp | #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define iPair pair<int,int>
#define iTuple tuple<int,int,int>
#define uset unordered_set<int>
#define umap unordered_map<iPair,int>
const int INF ... | ALGO | 0.999993 | 4.24383 |
bbd7f801-dc1f-4d3f-ab7d-772223f58057 | richardyrh/llvm | llvm/lib/Analysis/ConstraintSystem.cpp | #include "llvm/Analysis/ConstraintSystem.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Debug.h"
#include <string>
using namespace llvm;
#define DEBUG_TYPE "constraint-system"
bool ConstraintSystem::elimi... | ALGO | 0.999528 | 7.256644 |
b90ea38a-a270-4922-a73c-5e832779aad9 | Riya79hp/bruteforcecodes | prims_algo.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <cstdlib>
using namespace std;
struct node {
int data;
int weight;
struct node *next;
};
priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > pq;
bool vg(vector<int> v, int n) {
int h = 0;
for (int i = 0... | ALGO | 0.999821 | 4.335867 |
98de0e0c-cd27-4223-b5dc-c9f79dc8e96b | billiwason/algo_summary | practices/algo_history/lazy_segtree/lazy_basic.cpp | #include <limits.h>
#include <iostream>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <set>
#include <functional>
#include <cmath>
#include <stack>
#include <tuple>
#include <cassert>
#include <list>
#include <bitset>
#include <numeric>
#include <type_traits>
#include <iomanip>
#includ... | ALGO | 0.999833 | 3.624922 |
77263ce9-43de-4f26-bb18-1e8ad825c2e9 | KhaledAbdelgalil/competitive-programming-book | chapter 3/problems/Dynamic Programming/Max 2D Range Sum/00108_sol2.cpp | #include <bits/stdc++.h>
using namespace std;
int mat[105][105];
int running_rows[105];
int main()
{
std::ifstream in ("input");
std::streambuf * cinbuf = std::cin.rdbuf (); //save old buf
std::cin.rdbuf (in.rdbuf ()); //redirect std::cin to in.txt!
int n;
while(cin>>n){
//mat[i][j] co... | ALGO | 0.999878 | 3.757016 |
e3c0c90c-17f1-46de-8beb-97663918f475 | fyzel527/UnrealEngine-4.24Toon | Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/openexr/IlmBase/Half/toFloat.cpp | //---------------------------------------------------------------------------
//
// toFloat
//
// A program to generate the lookup table for half-to-float
// conversion needed by class half.
// The program loops over all 65536 possible half numbers,
// converts each of them to a float, and prints the result.
//
//-----... | TOOL | 0.905747 | 5.550715 |
564a3da5-f7ad-4536-9d5a-5bd6b77c0fbf | paolaguarasci/domJudge | n44.cpp | /*
b c d r t s e f a i o p q m n u z j k l x w y g h v 6 5 9 13 10 14 8 simona
b c d r t s e f a i o p q m n u z j k l x w y g h v 8 32 5 9 13 10 14 8 26 simona
b c d r t s e f a i o p q m n u z j k l x w y g h v 8 32 55 49 103 100 64 98 26 (niente)
*/
#include <iostream>
... | ALGO | 0.999779 | 3.971128 |
c045b060-5a25-465a-b0d4-dd625a0639e5 | Sachin-Kushwaha22/Cpp-DSA | C++ DSA/PATTERN PROBLEMS/numberPattern3.cpp | #include <bits/stdc++.h>
using namespace std;
// creating a function to print number pattern
void numPattern3(int n){
int num=1;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= i; j++)
{
cout<<num<<" ";
num++;
}
cout<<endl;
}
}
int main(... | ALGO | 0.999932 | 4.078982 |
a0060200-e95b-423e-b7bb-37914ff2bffd | yzzupgo/MFTCG | Data/abc136_b/Maydaytyh/ac/6694548.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<stack>
#include<algorithm>
using namespace std;
#define INF 0x3f3f3f3f
#define MAXN 100000+50
#define MAXM 30000
#define ll long long
#define rep(i,n,m) for(int i=n;i<=m;++i)
#define mod 1000000000 + 7
#define mian main
#def... | ALGO | 0.99988 | 3.982727 |
59e3999d-8263-4eea-b151-6841db3c795c | ishandutta2007/codeforces | dqa2021/normal/1268/D.cpp | #include<bits/stdc++.h>
#define pb push_back
using namespace std;
#define G getchar()
int read()
{
int x=0; bool flg=false; char ch=G;
for (;!isdigit(ch);ch=G) if (ch=='-') flg=true;
for (;isdigit(ch);ch=G) x=(x<<3)+(x<<1)+(ch^48);
return flg?-x:x;
}
#undef G
#define fi first
#define se second
typedef long long ll;... | ALGO | 0.999971 | 3.655864 |
34ef9f78-d7dc-4633-9897-df4c54a08fba | RibahDev/Flutter-Projects | dev/counter/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.998703 | 6.76775 |
7336d0bd-7ca6-404f-8870-2439b9fe8305 | alexandraback/datacollection | solutions_5769900270288896_0/C++/Mastojun/main.cpp | #include <cstdio>
#include <cmath>
#include <cstring>
#include <vector>
#include <string>
#include <unordered_map>
#include <queue>
#include <algorithm>
using namespace std;
int T;
int N, R, C;
int result = 0;
int apartments[16][16];
void solve(int r, int c, int now, int tenatns) {
if(r == R || tenatns == 0) {
if... | ALGO | 0.999026 | 3.924975 |
6ec8a205-85b9-4b81-8a09-20e749a0029b | dlwogns/PS | ~2024/succ/3665.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
int T;
int main(){
cin>>T;
while(T--){
int n, m;
cin>>n;
vector<int>dist(n+1);
vector<int>rank(n+1);
int arr[501][501]={0};
vector<int>v;
for(int i=1; i<=n; i+... | ALGO | 0.999964 | 4.190376 |
ef1192f5-14ea-4510-afaf-d155581a1cb4 | funnysunny08/Algorithm_cpp | 분할정복/1629.cpp | // 1629번: 곱셈
#include <bits/stdc++.h>
using namespace std;
long long a, b, c, k;
long long power(long long b) {
if (b == 0) return 1;
if (b == 1) return a % c;
k = power(b / 2) % c;
if (b % 2 == 0) return k * k % c;
return k * k % c * a % c;
}
int main(void) {
// 입력 받기
cin >> a >> b >> c... | ALGO | 0.999983 | 4.289462 |
dd434bc5-fbd0-41e9-8546-6a4a33acf8e4 | Haritha-E/Leetcode-Problem-Solving | 967-minimum-falling-path-sum/minimum-falling-path-sum.cpp | class Solution {
private:
int minPathSum(vector<vector<int>>& matrix, int i, int j,vector<vector<int>>& memo) {
//cout << "i:" << i << " j:" << j << endl;
int sum = matrix[i][j];
if (i == (matrix.size() - 1)) {
return sum;
}
int leftSum = INT_MAX;
int cent... | ALGO | 0.999992 | 5.890134 |
687aadc3-2859-4056-858b-a7338bdc7804 | boody500/Assignment_1_OOP | Bigint_Functions.cpp | // bigint with oop
// Author: abdelrahman elsayed korany mohamed , farah walid ahmed , marwan ahmed abdelmonem
// ID's: 20210222 , 20210290 , 20210378
// Date: 25 october 2022
// Version: 4.0
#include "Bigint.h"
using namespace std;
bool BigInt::is_valid(string &b)
{
... | ALGO | 0.995935 | 4.381477 |
59d8eb87-5c4b-4a92-a96e-eefd7bdbc275 | hzhang2001/CS | Cpp/practice/chapter05/exercise5_9.cpp | #include <iostream>
#include <string>
int main() {
using namespace std;
int word_count = 0;
string ch;
cout << "Enter a word (type 'done' to stop the program.): \n";
do {
cin >> ch;
if (ch != "done") {
word_count++;
}
} while (ch != "done");
cout << "... | TOOL | 0.973316 | 5.627884 |
da907e42-e9fe-4dc7-abfb-f68146985ad6 | Radhika094-design/codes | 0002-add-two-numbers/0002-add-two-numbers.cpp | class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
ListNode* dummy = new ListNode(0); // dummy head // when u dont know where your ll start take dummy node
ListNode* temp = dummy; // pointer to form new list
int carry = 0;
while (l1 != nullptr... | ALGO | 0.999813 | 6.208295 |
47bfe1e0-3575-4b3d-8820-223803231919 | Saiyangodgoku1/start-450 | Step-12(Binary Trees)/3.hard/08.construct_from_inorder_preorder.cpp | /*
QUESTION:
Given the preorder and inorder traversal of a binary tree, build the binary tree and return its root.
EXAMPLE:
Input:
preorder = [3, 9, 20, 15, 7]
inorder = [9, 3, 15, 20, 7]
Output:
The constructed binary tree is:
3
/ \
9 20
/ \
15 7
APPROACH:
1. Create a map to st... | ALGO | 0.999999 | 7.418147 |
04a36900-369b-49ac-8166-6634a1286c0d | stg0123/baekjoonlearn | graph/tree/baekjoon1774.cpp | #include <iostream>
#include <vector>
#include <math.h>
#include <queue>
using namespace std;
struct _node{
int parent;
int x,y;
};
struct compare{
bool operator()(pair<int,double>& a,pair<int,double>& b){
return a.second>b.second;
}
};
class unionfind_prim{
private:
vector<_node> node;
... | ALGO | 0.999916 | 4.100249 |
a63155d3-d79e-4c35-a3bc-ca8dfb60e864 | xiang123456778/Framwork8.1 | frameworks/base/core/jni/android_os_VintfObject.cpp | #define LOG_TAG "VintfObject"
//#define LOG_NDEBUG 0
#include <android-base/logging.h>
#include <vector>
#include <string>
#include <nativehelper/JNIHelp.h>
#include <vintf/VintfObject.h>
#include <vintf/parse_string.h>
#include <vintf/parse_xml.h>
#include "core_jni_helpers.h"
static jclass gString;
static jclass ... | TOOL | 0.916481 | 6.402408 |
a4d52f2f-0bd0-41ed-91a6-a9a6727c0be9 | rudra2110/30_days_of_code | delete_duplicate_node.cpp | // 83. Remove Duplicates from Sorted List
// Solved
// Easy
// Topics
// Companies
// Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well.
// Example 1:
// Input: head = [1,1,2]
// Output: [1,2]
// Example 2:
// Input: head = [... | ALGO | 0.999937 | 5.935913 |
abc7772f-4950-4dcd-8b94-c1da4af1dab7 | ritikajagtap/ATOZ | linkedList/ll.cpp | #include <bits/stdc++.h>
#include <conio.h>
using namespace std;
class ListNode
{
public:
int val;
ListNode *next;
};
void inputlist(ListNode *&head, int x);
void printlist(ListNode *head);
int main()
{
ListNode *head = NULL;
inputlist(head, 4);
inputlist(head, 3);
inputlist(head, 8);
inpu... | ALGO | 0.999631 | 4.280066 |
81e88b0a-0053-4eb4-aec3-21966ae1cec8 | geralt-tian/SEAF-VOLE-AF | networks/main_multiplexer.cpp | #include <iostream>
#include <string>
#include "utils/emp-tool.h"
#include "SCI/src/BuildingBlocks/aux-protocols.h"
#include <chrono>
using namespace std;
using namespace sci;
int party = 0, port = 8000;
string address = "127.0.0.1";
int dim = 1024;
int bw_x = 8;
int bw_y = 8;
int main(int argc, char **argv) {
A... | TOOL | 0.920574 | 4.600947 |
b7e43568-61f8-46d8-b6dd-12b026d66f3e | Brandon-J-Navarro/Arduino-Learning | inventr.io/30 Days Lost in Space(TinkerCAD)/Day_18.cpp | // C++ code
//
#include <Adafruit_GFX.h>
#include "Adafruit_LEDBackpack.h"
Adafruit_7segment lander_display = Adafruit_7segment();
const unsigned int KEYS[] = { 23, 353, 1688 };
const byte DEPTH_CONTROL_CLK_PIN = 2;
const byte DEPTH_CONTROL_DT_PIN = 3;
const byte BLINK_COUNT = 3;
const int INITIAL_DEPTH = -60;
c... | TOOL | 0.877831 | 7.545081 |
e0b14f80-9b4b-4dc9-bf88-2629992f8858 | LeePenn/Competitive-Programming | AOAPC-II/_book/ch5/UVa230.cpp | // Joker
#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator << (ostream& os, vector<T> v) {
for (int i = 0; i < v.size(); i++) {
os << v[i] << ' ';
}
return os;
}
struct Book {
string title, author;
Book(const string& t, const string& a) : title(t), autho... | ALGO | 0.998931 | 4.544386 |
4777ee9a-4a4c-47f4-9867-a01ef0959ace | shRamim13/geeksFORgeeks | Palindrome Linked List.cpp | class Solution
{
public:
Node *reverse(Node *head)
{
if (head == nullptr || head->next == nullptr)
{
return head;
}
Node *prev = nullptr;
Node *cur = head;
Node *next = nullptr;
while (cur != nullptr)
{
next = cur->next;
... | ALGO | 0.999382 | 6.091474 |
b394a704-47f8-43af-92a1-f634b4e95a7e | Lucasian-z/PAT | PTA_Basic/PTA_Basic1055 集体照.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef struct
{
string name;
int height;
}Stu;
bool compare(Stu a, Stu b)
{
if (a.height != b.height)
return a.height < b.height;
return a.name > b.name;
}
int main()
{
int N = 0, K = 0, i = 0, j = 0;
cin >> N ... | ALGO | 0.999627 | 3.483835 |
09bb25e7-14b1-4cb1-b00e-1e615683a97c | Omarthiside/Leetcode | 3001-apply-operations-to-maximize-score/3001-apply-operations-to-maximize-score.cpp | class Solution {
public:
int maximumScore(vector<int>& nums, int k) {
const int n = nums.size();
const int mx = ranges::max(nums);
const vector<int> minPrimeFactors = sieveEratosthenes(mx + 1);
const vector<int> primeScores = getPrimeScores(nums, minPrimeFactors);
int ans = 1;
vector<int> lef... | ALGO | 0.999974 | 6.141937 |
57825fe0-dbbd-4ff5-80ff-86796c78f4fb | khageshsingh/ASSIGNMENT-OF-C | 24. C program to print all Strong Numbers between 1 to n.cpp | #include <stdio.h>
#include <stdbool.h>
int main(void) {
int n, i, j, last_digit, sum;
bool is_strong;
printf("Enter a positive integer: ");
scanf("%d", &n);
printf("All strong numbers between 1 and %d are:\n", n);
for (i = 1; i <= n; ++i) {
sum = 0;
j = i;
is_strong = true;
while (j > ... | ALGO | 0.999231 | 4.523512 |
35deadbc-bec2-4cd9-8441-a1ed90126904 | JeongHyeon-Kim/Algorithms | Problem Solving/Algorithms/Implementation/Viral Advertising.cpp | // problem source: https://www.hackerrank.com/challenges/strange-advertising/problem
#include <bits/stdc++.h>
using namespace std;
// Complete the viralAdvertising function below.
int viralAdvertising(int n) {
int init = 5;
int cumulative = 0;
for (int i = 0; i < n; i++) {
int liked = init / 2;
... | ALGO | 0.999993 | 5.495696 |
2afee6cb-f10b-41e5-a6f7-b2191abafc19 | rares-gh-pisoi/pbinfo | Clasa9/meditatie info/lectii/7.05.2024/#1749/main.cpp | #include <iostream>
using namespace std;
int a[201][201];
int main() {
int n,z;
cin>>n>>z;
int s1=0;
int s2=0;
int s3=0;
int s4=0;
for(int i=1; i<=n; i++) {
for(int j=1; j<=n; j++) {
cin>>a[i][j];
if(j>i && j+i<n+1) {
s1+=a[i][j];
... | ALGO | 0.999673 | 3.211787 |
c3d810f0-1f02-4108-8864-d5bf9225ad86 | nobdefender/ICPC_TRD | src/05.stringology/05.suffix-array.cpp | // Theme: Suffix array
// Algorithm: Binary Algorithm With Count Sort
// Complexity: O(N*log(N))
void count_sort(vector<int> &p, vector<int> &c) {
int n = p.size();
vector<int> cnt(n), p_new(n), pos(n);
for (auto &x : c) cnt[x]++;
pos[0] = 0;
for (int i = 1; i < n; i++)
pos[i] = pos[i - ... | ALGO | 0.999698 | 5.52512 |
21b2a413-7442-4b54-973d-a7fc29ab4912 | somya1210/Leetcode-Grinding | find-k-pairs-with-smallest-sums/find-k-pairs-with-smallest-sums.cpp | class Solution {
public:
#define pii pair<int,pair<int,int>>
vector<vector<int>> kSmallestPairs(vector<int>& nums1, vector<int>& nums2, int k) {
priority_queue<pii, vector<pii>, greater<pii>>vecs;
for(int i=0;i<nums1.size();i++)
{
for(int j=0;j<nums2.size();j++)
... | ALGO | 0.999987 | 5.625395 |
64bd98b8-c1fd-4513-b507-ba5d2a726c61 | Lorenzo-Pappalardo/programming | coinChange.cpp | #include <iostream>
#include <vector>
using namespace std;
class Unit {
string name;
int valueInCents;
public:
Unit(string name, int valueInCents) {
this->name = name;
this->valueInCents = valueInCents;
}
const string getName() const { return name; }
const int getValueInCents() const { return v... | ALGO | 0.998085 | 5.973351 |
4515c95e-b184-4c35-a5c9-1d3984d3b235 | rakibul23n28/c-cpp | c_c++/DSA problem/easy_problem/array and string/counting_sort_string.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
#define RANGE 255
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
//Function to arrange all letters of a string in lexicographical
//order using Counting Sort.
string countS... | ALGO | 0.999963 | 5.984539 |
c1b4c5e4-b3ad-4c11-80d4-11ef3ff77b32 | leopardshadow/LeetCode | e1337.cpp |
// 2022.3.27
/*
其實只要 top K 的話用 heap 比較有效率
*/
class Solution {
public:
vector<int> kWeakestRows(vector<vector<int>>& mat, int k) {
vector<pair<int, int>> rows;
for (int r = 0; r < mat.size(); r++) {
int rowSum = 0;
for (int c = 0; c < mat[0].size(); c++) {
r... | ALGO | 0.999974 | 6.484081 |
72276173-af12-409a-8fd3-5abfee220a41 | JayTheCoder77/Striver-Dsa | PATTERNS/seven/main.cpp | #include <bits/stdc++.h>
using namespace std;
void printPattern(int n){
for (int i = 0; i < n; i++)
{
for (int j = 0; j<n-i-1 ;j++)
{
cout << " ";
}
for (int j = 0; j < 2*i+1;j++)
{
cout << "*";
}
for (int j = 0; j<n-i-... | ALGO | 0.999907 | 4.398598 |
047041b4-e22a-4678-8e2f-8cb1e9768048 | NII-o9i2/AutoPilotMath | polyfit/spline_smoothing/src/spline/spline_2d.cpp | /**
* @file spline_2d.cc
**/
#include <algorithm>
#include <iostream>
#include "spline_smoothing/include/spline/spline_2d.hpp"
namespace PolyFit {
Spline2d::Spline2d(const std::vector<double> &t_knots, const uint32_t order)
: t_knots_(t_knots), spline_order_(order) {
if (t_knots.size() > 1) {
for (uint3... | ALGO | 0.999019 | 7.054867 |
b23d4b8c-e654-45f5-83e3-5a0a8c78e1cb | ishandutta2007/codeforces | danya.smelskiy/normal/566/F.cpp | #include <bits/stdc++.h>
using namespace std;
int ans,n;
vector<int> v[1000005];
int a[1000005];
int dp[1000005];
int kol[1000005];
int main(){
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin>>n;
for (int i=1;i<=n;++i){
cin>>a[i];
++kol[a[i]];
++dp[a[i]];
}
f... | ALGO | 0.999915 | 3.389705 |
a8ed35d6-a8fe-4d28-bdcf-6ae1abdd63af | IGwenQin/STM-No_Accuracy | build_hololens/Il2CppOutputProject/IL2CPP/libil2cpp/mono/ThreadPool/threadpool-ms.cpp | #include "il2cpp-config.h"
#include <stdlib.h>
#define _USE_MATH_DEFINES // needed by MSVC to define math constants
#include <algorithm>
#include <cmath>
#include <complex>
#include "math.h"
#include "il2cpp-api.h"
#include "gc/GarbageCollector.h"
#include "gc/GCHandle.h"
#include "gc/WriteBarrier.h"
#include "icalls... | TOOL | 0.975106 | 5.932903 |
932453d1-729a-4f4b-b8ff-795c4ac336f1 | ishandutta2007/codeforces | mr_spade/normal/1458/E.cpp | #include<cstdio>
#include<algorithm>
#include<utility>
#include<vector>
#include<set>
#include<map>
#define int long long
#define mp make_pair
#define fi first
#define se second
using std::max;
using std::min;
using std::sort;
using std::unique;
using std::pair;
using std::mp;
using std::vector;
using std::set;
using s... | ALGO | 0.999984 | 3.849162 |
ec46ab2f-c6c4-45b4-86ba-248ae6de9da2 | VadimFarutin/SPbAU-CPP | lab15/lab_15/lab_15/smoke_test.cpp | #include "linq.h"
#include <math.h>
#include <assert.h>
#include <vector>
#include <sstream>
#include <iterator>
void example1() {
int xs[] = { 1, 2, 3, 4, 5 };
std::vector<int> res =
from(xs, xs + 5) // xs
.select([](int x) { return x * x; }) //
.where_neq(25) // != 25
.where([](int x) { retur... | TOOL | 0.957723 | 4.008824 |
eeebff7f-c80f-4ac1-85a9-e2976f879d8d | AllAlgorithms/cpp | algorithms/dynamic-programming/rod_cutting.cpp | #include<iostream>
#include<climits>
using namespace std;
int rodCutting(int n, int value[])
{
int i,j;
int result[n+1];
result[0]=0;
for(i=1;i<=n;i++)
{
result[i]=INT_MIN;
for(j=0;j<i;j++)
{
result[i]=max(result[i],value[j]+result[i-(j+1)]);
}
... | ALGO | 0.999922 | 4.060406 |
cff214f6-e79b-44cb-ac64-fb48559aeae7 | nucleargezi/acm-icpc | codeforces/edu/80-89/1354 edu87 -ak/1354G.cpp | #include "MeIoN_Lib/MeIoN_all.hpp"
void before() {}
#define tests
NAME MeIoN_is_UMP45() {
const meion quis = [](const vector<int> &a,
const vector<int> &b) -> int {
UL("?", len(a), len(b));
UL(a);
UL(b);
std::cout.flush();
S(str);
iroha str... | ALGO | 0.999573 | 4.486531 |
3acb502d-cbb1-4561-9d74-aef8686a5c6b | khalilrefai/mesh-viewer | include/igl/infinite_cost_stopping_condition.cpp | IGL_INLINE void igl::infinite_cost_stopping_condition(
const decimate_cost_and_placement_callback & cost_and_placement,
decimate_stopping_condition_callback & stopping_condition)
{
stopping_condition =
[&cost_and_placement]
(
const Eigen::MatrixXd & V,
const Eigen::MatrixXi & F,
const Eigen::... | ALGO | 0.991955 | 3.680804 |
5f46780a-01a3-49bc-9da8-abd61e342142 | Altu-Bitu/Notice | 10월 12일 - 투 포인터/라이브 코딩/1644.cpp | //
// Created by iw040 on 2021-10-12.
//
#include <iostream>
#include <vector>
using namespace std;
//에라토스테네스의 체로 n 이하인 모든 소수 구하기
vector<bool> isPrime(int n) {
vector<bool> is_prime(n + 1, true); //소수 여부 저장
is_prime[0] = is_prime[1] = false;
for (int i = 2; i * i <= n; i++) {
if (is_prime[i]) { ... | ALGO | 0.999971 | 5.281506 |
9bf71d96-a95c-471e-a7ee-1870d36ef42e | EthanKim8683/High-School-Competitive-Programming | Codeforces/Problemset/DP/1743c.cpp | #include<bits/stdc++.h>
using namespace std;
using I=int;
using S=string;
const I N=2e5;
const I MIN=-2e9;
I a_arr[N];
I dp[N][2];
I main(){
cin.tie(0)->sync_with_stdio(0);
I t;cin>>t;
while(t--){
I n;cin>>n;
S s;cin>>s;
for(I i=0;i<n;i++)cin>>a_arr[i];
for(I i=0;i<n;i++)dp[i][0]=dp[i][1]=MIN... | ALGO | 0.999679 | 4.229354 |
86004f17-9743-48f6-b4ba-bf3ebbae2098 | Meet118/LeetCode | 2周赛/LeetCode2050.cpp | class Solution {
public:
int minimumTime(int n, vector<vector<int>>& r, vector<int>& time) {
vector<int> dis(n + 1, 0);
vector<int> d(n + 1);
vector<vector<int>> g(n + 1, vector<int>());
for (auto i : r) {
d[i[1]] ++ ;
g[i[0]].push_back(i[1]);
... | ALGO | 0.99996 | 5.460615 |
d7581a52-37b4-40d5-8e3f-e91d86176fad | son-of-Altay/leetcode | 282-Expression Add Operators/solution.cpp | void get(vector<string> &res,int cur,int len,string ans,string num,long long now,long long last,int target)
{
if(cur==len)//字符串已取完
{
if(now==target)res.push_back(ans);//结果等于目标值,将构造出的串加入答案
}
else
{
for(int i=cur;i<len&&(num[cur]!='0'||i==cur);i++)//从当前位置开始取,如果第一位为0则只能取一位
{
... | ALGO | 0.999986 | 4.717754 |
4dd2b787-4912-4649-b894-984ebad4ad23 | orleantum/cpp | Sem_1/2_7/2.7.1.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int N, S;
cin >> N;
if(N < 4)
{
cout << "number > 3\n";
}
else
{
S = sqrt(N);
for (int i=0;i<S;i++)
{
for (int j=0;j<S;j++)
{
cout << "* ";
... | ALGO | 0.99996 | 3.476277 |
2285e3ee-3479-441e-a474-a6b491190821 | xufei1006/cpp_primer | excersize/ch14/exercise14_43.cpp | #include <iostream>
#include <string>
#include <functional>
#include <algorithm>
int main()
{
auto data = { 2, 3, 4, 5 };
int input;
std::cin >> input;
std::modulus<int> mod;
auto predicator = [&](int i) { return 0 == mod(input, i); };
auto is_divisible = std::any_of(data.begin(), data.end(), predicator);
std::... | ALGO | 0.999915 | 5.158241 |
0acad478-ded5-4e2e-904d-48c786e4c906 | ishandutta2007/codeforces | lily/normal/653/B.cpp | /* Never Say Die. */
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <ctime>
#include <cstdlib>
using namespace std;
int _c = 0;
template <class _T> inline void read(_T &_a) {
_a = 0; bool _f = 0;
while (_c < '0' || _c > '9') _f |= _c == '-', _c... | ALGO | 0.999933 | 3.737942 |
d0ea68b3-04e3-4ef3-8d9d-7172d1dcb5df | seobing/CppConsoleTeamProject | main.cpp | #include "canvas.h"
#include "parabola.h"
#include <conio.h>
#include <time.h>
using namespace std;
void PlayGame(Canvas&);
void printHP(Canvas& , Player& , Player& );
void printgauge(Canvas&, Player&, int, Player&, int );
void checkBomb(Bomb**, int&, Player&, Player&);
int main() {
Canvas can;
PlayGame(can)... | TOOL | 0.950275 | 4.161701 |
01d5be56-9bbf-4a2e-b967-7859a689d915 | Lanly109/Solution-Markdown-Template-For-Algorithm-Contest | code/nowcoder/contests/49259/l/l.cpp | /*
* Author: Lanly
* Time: 2022-12-17 15:02:23
*/
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define FOR(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define FORD(i, x, y) for (decay<decltype(x)>::type i = (x), _##i = (y); i > _##i; --i)
#ifndef ONLINE_JUDGE
#i... | ALGO | 0.999856 | 3.903732 |
b5c2c09d-ca5c-4cb4-a0ce-a48e1cdb2bac | sheyua/LAMMPS-QTB | src/KOKKOS/pair_tersoff_mod_kokkos.cpp | /* ----------------------------------------------------------------------
Contributing author: Ray Shan (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "pair_tersoff_mod_kokkos.h"
#include "kokko... | ALGO | 0.997288 | 7.057309 |
648ee6a1-17a6-4dde-aa2a-e10fbd30d4d7 | Iam-Sodhi/TLE_Elimiators_Sheet | 900/18_MakeAP.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{ int t;
cin >> t;
while(t--){
int a,b,c;
cin >> a>>b>>c;
if(2*b == (a+c))cout<<"YES"<<endl;
else if( (2*b -c )%a==0 && ((2*b -c )/a)>0)cout<<"YES"<<endl; // a*m b c -> 2b= a*m +c
else if( (a+c)%(2*b)==0)cout<<"YES"<<endl; // a m*b... | ALGO | 0.999907 | 4.070021 |
7c06f576-87a5-44a2-a3bc-d0299f98564e | ArchanPatel890/CompetitiveProgramming | Codeforces/Official/GlobalRound11/B.cpp | /*
* Note: This template uses some c++11 functions , so you have to compile it with c++11 flag.
* Example:- $ g++ -std=c++11 c++Template.cpp
*/
/******** All Required Header Files ********/
#include <bits/stdc++.h>
using namespace std;
/******* All Required define Pre-Processors and typedef Constants ***... | ALGO | 0.999928 | 4.143058 |
74ddbb74-5b52-4bc8-8a24-a1da44550f5a | shivam-tripathi/code | ds/C++/arrays/shuffle.cpp | // www.geeksforgeeks.org/shuffle-a-given-array
#include <bits/stdc++.h>
using namespace std;
#define NUM (rand()/(double)RAND_MAX)
void print(int arr[], int size) {
for(int i=0; i<size; i++) cout << arr[i] << " ";
cout << endl;
}
int main(int argc, char const *argv[]){
int size;
cin >> size;
srand(time(NULL));
... | ALGO | 0.998686 | 4.7631 |
c90133da-5cf0-4769-a0b2-f49e436b7efd | satya-supercluster/DSA | 12-bit-manipulation/problems/problems/problem0009.cpp | /*
Problem 0009: Subtract using Bitwise
Description:
Implement subtraction using only bitwise operators.
Difficulty: Medium
Topics: Problems
Example:
Input:
Output:
Constraints:
-
Approach:
1.
2.
3.
Time Complexity: O()
Space Complexity: O()
*/
#include <bits/stdc++.h>
using namespace std;
class Solution ... | ALGO | 0.99971 | 6.033523 |
f26bdd77-bc6d-45fa-835f-8e20cb816f40 | Deepak20y/automatic-memory | GCD_to_1_Easy.cpp | #include<bits/stdc++.h>
using namespace std;
using ll =long long int;
using ull=unsigned long long;
/*I liked you once but not anymore now
She's wearin' dresses on the border line
(Lookin' good)
Oh wakin' senses that were lost in time
(Make amends)
This liberation is the one they'll love for ages
(Hey man, I see them c... | ALGO | 0.999774 | 3.785227 |
82067ec7-d98a-47c3-a312-e1fa5caac972 | WHOLEACS/LeetCode | 34/code.cpp | class Solution {
public:
int my_lower(const vector<int>& nums, const int& target) {
int l = 0, r = nums.size();
while (l < r) {
int mid = l + ((r - l)>>1);
if (nums[mid] >= target) r = mid;
else l = mid + 1;
}
return l < nums.size() && nums[l] == target ? l : -1;
}
int my_upper(const vector<int>& nu... | ALGO | 0.999955 | 6.059051 |
b17eec08-5aab-4fc9-8d73-a8132375c593 | yawn831/leetcode | 1791. 找出星型图的中心节点.cpp | class Solution {
public:
int findCenter(vector<vector<int>>& edges) {
int n = edges.size() + 1;
vector<int> hash(n + 1);
for (auto edge : edges) {
if (++hash[edge[0]] > 1)
return edge[0];
if (++hash[edge[1]] > 1)
return edge[1];
}
... | ALGO | 0.999946 | 5.559452 |
f8452729-8e62-4a4e-bccf-572ca29df9e8 | ishandutta2007/codeforces | danya.smelskiy/normal/317/D.cpp | #include <bits/stdc++.h>
using namespace std;
const long long f[100] = {0,1,2,1,4,3,2,1,5,6,2,1,8,7,5,9,8,7,3,4,7,4,2,1,10,9,3,6,11,12};
long long n;
bool used[1000005];
int main(){
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin>>n;
long long kol=0;
long long ans=0;
for (long long ... | ALGO | 0.999996 | 4.499578 |
dca39bde-dcb2-4d3b-b49d-4e2539ff7473 | raincross7/code-similarity | codes/train_code/problem147/problem147_110.cpp |
/* monkukui 競技プログラミング用のテンプレート (ここから) */
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <li... | ALGO | 0.999529 | 4.267168 |
1808aa20-ca5c-4919-90a3-b862f2d4d843 | camillerodriguees/exercises | II Unidade - C++/questao_8f.cpp | #include <iostream>
using namespace std;
int power (int base, int expo){
int result = base;
if (expo == 0){
return 1;
}
else{
for (int i=1; i<=expo; i++){
result = result * base;
}
return result;
}
}
int main () {
int x, y;
cout << "Digite o valor da b... | ALGO | 0.999104 | 5.280738 |
0441557d-381a-46e1-89bd-220ea3e83f46 | kMahtab1/cpp | ncr.cpp | #include<iostream>
using namespace std;
int factorial(int n){
int fact=1;
for(int i=1;i<=n;i++){
fact=fact*i;
}
return fact;
}
int nCr(int n,int r){
int numer=factorial(n);
int denom=factorial(r)*factorial(n-r);
int ans=numer/denom;
return ans;
}
int main(){
int n,r;
cin>>n>>r;
... | ALGO | 0.999922 | 5.451648 |
0d0becb7-f191-4666-915e-df175e59f505 | fuhailin/show-me-cpp-code | leetcode_cc/518coin-change-2.cpp | #include <iostream>
#include <vector>
using namespace std;
#define MAX_Integer 0x7fffffff;
class Solution
{
public:
int change(int amount, vector<int> &coins)
{
}
};
int main(int argc, char const *argv[])
{
return 0;
} | ALGO | 0.999156 | 4.392287 |
79f47ad2-3f1d-4541-8db1-ac87b901c009 | JPhilippot/FaceRecognition | Code/eigen-3.4.0/doc/examples/Tutorial_BlockOperations_vector.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::ArrayXf v(6);
v << 1, 2, 3, 4, 5, 6;
cout << "v.head(3) =" << endl << v.head(3) << endl << endl;
cout << "v.tail<3>() = " << endl << v.tail<3>() << endl << endl;
v.segment(1,4) *= 2;
cout << "after 'v.segment(1,4) *= 2', v... | ALGO | 0.995903 | 3.093805 |
dea55166-612c-4fa3-8720-3cadb5bdabd3 | omarsalem33/problems-of-Leetcode | 1534-count-good-triplets/1534-count-good-triplets.cpp | class Solution {
public:
int countGoodTriplets(vector<int>& arr, int a, int b, int c) {
int cnt = 0 ;
for(int i = 0 ; i < arr.size() - 2 ; i ++){
for(int j = i + 1 ; j < arr.size() - 1 ; j++)
{
if(abs(arr[i] - arr[j] ) <= a)
for(int ... | ALGO | 0.999734 | 5.66775 |
8831be8c-7f42-4ce0-bbf0-aa3e4c6f8938 | YinWenAtBIT/LeetCode | Remove Linked List Elements/version_1.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* removeElements(ListNode* head, int val) {
if(!head)
return NULL;
if(head->val == val)... | ALGO | 0.999844 | 5.69126 |
a383e9b1-92f2-4697-841e-a2138904677b | ishandutta2007/codeforces | natsugiri/normal/566/G.cpp | #include<complex>
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=... | ALGO | 0.999969 | 3.696135 |
0bc43765-9ea3-4c96-a8c5-4863ee2cddb1 | TrebledJ/attack-of-the-zip | 01-playground/app/juce/modules/juce_box2d/box2d/Dynamics/Joints/b2FrictionJoint.cpp | #include "b2FrictionJoint.h"
#include "../b2Body.h"
#include "../b2TimeStep.h"
// Point-to-point constraint
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-ry i + rx j)
// Angle constraint
// Cdot = w2 - w1
// J = [0 ... | ALGO | 0.99548 | 7.607123 |
c7d56661-2247-4761-94b0-c28424953cab | LLNL/psuade | Src/FuncApprox/PWLinear.cpp | // ------------------------------------------------------------------------
// system includes
// ------------------------------------------------------------------------
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
// ------------------------------------------------------------------------
// local includ... | TOOL | 0.971567 | 5.508154 |
8635bf64-84a2-4be9-8f3f-4d0bbc283448 | AscCrs/Competitive-Training | GP/Repechaje/M.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<vector<int>> c(n, vector<int>(n));
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cin >> c[i][j];
}
}
vector<vec... | ALGO | 0.999921 | 4.281148 |
6184c5e9-eb75-44c9-8253-d7aaaacee0dc | DimaGashko/VSProjects | other/Other/Postindustria/SchoolPostindustria2019/Minesweeper.cpp | #include <iostream>
#include <vector>
#include <string>
void fillMinesMap(std::vector<std::string>& minesMap);
void incrementMapCell(std::vector<std::vector<int>>& map, int i, int j);
void writeMinesMap(std::vector<std::string>& minesMap, int n, int m);
void printMinesMap(std::vector<std::string> &minesMap);
int mai... | ALGO | 0.999145 | 5.82605 |
a524895c-accd-4ad2-9904-bf47356bf510 | MaiLinhLinh/CodePTIT_DSA | Hoanvigiuac1c2.cpp | #include <bits/stdc++.h>
#define ll long long
#define mod int(1e9 + 7)
#define nmax int(1e6 + 7)
using namespace std;
int n, m, a[100], f[100];
void in()
{
for (int i = 1; i <= m - n + 1; i++)
cout << (char)(a[i] - 1 + 'A');
cout << "\n";
}
void Try(int i)
{
for (int j = n; j <= m; j++) { // moi vi ... | ALGO | 0.999798 | 3.169196 |
64da3045-eae6-4e1d-ab7b-e7774b13bea3 | iizaghz/148_ConditionalStatement | file2.cpp | #include <iostream>
using namespace std;
float Panjang, Lebar;
float FungsiHitungLuas(){
return Panjang * Lebar;
}
int main()
{
cout << "Masukkan panjangnya : ";
cin >> Panjang;
cout << "Masukkan lebarnya : ";
cin >> Lebar;
cout << "Luas Persegi Panjang : " << FungsiHitungLuas();
} | TOOL | 0.917063 | 3.542646 |
ce5e4bec-56cd-4768-84e7-69b5bf366188 | Atem2069/GLPong | libs/glm-0.9.9-a2/test/gtx/gtx_fast_trigonometry.cpp | #define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/fast_trigonometry.hpp>
#include <glm/gtx/integer.hpp>
#include <glm/gtx/common.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/ulp.hpp>
#include <glm/gtc/vec1.hpp>
#include <glm/trigonometric.hpp>
#include <cmath>
#include <... | TEST | 0.882105 | 6.223037 |
1428dd6e-0362-46f3-a4aa-59ea6425b498 | lokeshwar777/cp | cpp/templates/inclusion_exclusion.cpp | #include "bits/stdc++.h"
using namespace std;
int n;
int inclusion_exclusion(vector<int> vec,int limit){
int count=0;
for(int mask=1;mask<(1<<n);++mask){
int set_bits = __builtin_popcount(mask), comb_lcm=1;
for(int i=0;i<n;++i){
if(((1<<i)&mask) != 0){ // checking if the element is... | ALGO | 0.999961 | 3.787623 |
1f28e760-1e49-4de7-ba66-34f7857ba539 | JambitX/CPP_Learning_Luogu | b2049.cpp | #include <iostream>
#include "stdio.h"
#include <algorithm>
using namespace std;
int main(){
int a,b,c;
cin >> a >> b >> c;
// if (a >= b && a >= c) cout << a << endl;
// else if (b >= a && b >= c) cout << b << endl;
// else cout << c << endl;
// int max = a;
// if (b > max) max = b;
// if (c > max) ma... | ALGO | 0.999816 | 3.778493 |
69d68ecc-e31c-4623-9007-fbea03b98adb | xiaohai-AI/slam_visual | opencv-4.5.3/samples/cpp/tutorial_code/gapi/porting_anisotropic_image_segmentation/porting_anisotropic_image_segmentation_gapi.cpp | /**
* @brief You will learn how port an existing algorithm to G-API
* @author Dmitry Matveev, <EMAIL>, based
* on sample by Karpushin Vladislav, <EMAIL>
*/
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_GAPI
//! [full_sample]
#include <iostream>
#include <utility>
#include "opencv2/imgproc.hpp"
#include ... | ALGO | 0.968343 | 6.573453 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.