uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d78ef304-3711-43bd-b613-eee42c914332 | divyanshu1906/LeetCode | array/4sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
int n = nums.size();
vector<vector<int>> ans;
sort(nums.begin(), nums.end());
for(int i=0; i<n; i++){
if(i>0 && nums[i] == nums[i-1]) continue;
for(int j=i+1; j<n; j++){
... | ALGO | 0.999957 | 6.084191 |
72e5aae9-3192-440a-bd4c-fe7e97187874 | Piyush289kumar/DSA | TCS/PYQ/SRIT SHEET/Q9.cpp | /* Q9: TCS NQT Coding Question – 9
Problem Statement-An intelligence agency has received reports about some threats. The reports consist of
numbers in a mysterious method. There is a number “N” and another number “R”. Those numbers are
studied thoroughly and it is concluded that all digits of the number ‘N’ are summed ... | ALGO | 0.999976 | 6.346979 |
17bdf3f1-fa46-4515-ad6b-bd5cc4140c02 | mmatrosov/FKN2020 | home1/_by_users/Савинский Всеволод Сергеевич-82739746/D-34124441-gcc_docker2-OK.cpp | #include <iostream>
#include <sstream>
using namespace std;
int main() {
string keys;
getline(cin, keys);
string current_string;
int m = 0, l = 0, L = 0, w = 0;
while (getline(cin, current_string)) {
m += current_string.size();
l += 1;
... | ALGO | 0.988552 | 3.441486 |
b5e050d3-d072-43b5-af43-e303c280dd67 | avijitj14/sample | swap1.cpp | #include<iostream>
using namespace std;
void swap(int *a,int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
}
int main()
{
int p,q;
cin>>p>>q;
cout<<p<<" "<<q<<endl;
swap(&p,&q);
cout<<p<<" "<<q<<endl;
} | ALGO | 0.999579 | 3.491126 |
d6891687-dac3-4d61-b9da-420c7406b7a8 | brojuscode/Hallathon | carotene/src/integral.cpp | #include "common.hpp"
namespace CAROTENE_NS {
void integral(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u32 * sumBase, ptrdiff_t sumStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
uint32x4_t v_zero = vmovq_n_u32(0u);
// the first itera... | ALGO | 0.997461 | 5.721724 |
c0d98762-69e9-4894-9aaf-9c63f3b80934 | daranday/eecs467proj2 | src/a2/a2_ai.cpp | #include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <cmath>
#include "a2_ai.h"
AI::AI() {
board = ".........";
}
// returns 0 if winner not determined, 1 if red wins, 2 if green wins, 3 if tie
bool AI::checkEnd() {
int wins[8][3] = {{0,1,2},{3,4,5},{6,7,8},{0,3,6},{1,4,7},{2,5,... | ALGO | 0.972671 | 4.47567 |
db974985-347d-4737-959e-1f9478cab27f | tudelft3d/3D_Urban_Mesh_Annotator | CGAL/examples/RangeSegmentTrees/segment_tree_1.cpp | // Implementation: Testprogram for 1-dimensional Segment Trees
// A one dimensional Segment Tree is defined in this class.
// Ti is the type of each dimension of the tree.
#include "include/Tree_Traits.h"
#include <CGAL/Segment_tree_k.h>
#include <iostream>
#include <iterator>
#include <list>
#include <utility>
typed... | ALGO | 0.996915 | 6.122414 |
bc853491-3661-4578-8178-09465fc86421 | jinyizh/UtahMSD-Fall2022 | CS6010/Day4/RomanNumerals/RomanNumerals/main.cpp | //
// main.cpp
// RomanNumerals
//
// Created by Jinyi Zhou on 8/25/22.
// Boundary condition: number inputed is larger than 0.
//
#include <iostream>
#include <string>
#include <array>
using namespace std;
int main(int argc, const char * argv[]) {
int num;
string roman;
int nums[13] = {1000, 900, 500... | ALGO | 0.996727 | 6.292145 |
ed6c8855-59a2-47ba-9518-b6068493a06e | stackwild/gogogadget | leetcodes/2001. Number of Pairs of Interchangeable Rectangles/2001.cpp | class Solution {
public:
long long interchangeableRectangles(vector<vector<int>>& rectangles) {
long ans = 0;
unordered_map<double, int> ratioCount;
for (const vector<int>& rectangle : rectangles) {
const int width = rectangle[0];
const int height = rectangle[1];
++ratioCount[1.0 * wid... | ALGO | 0.999739 | 6.873514 |
57f0dbd5-05ab-4dba-877f-192e991a77c3 | iamwkatie/caffe-posenet | src/caffe/layers/conv_layer.cpp | #include <vector>
#include "caffe/layers/conv_layer.hpp"
namespace caffe {
template <typename Dtype>
void ConvolutionLayer<Dtype>::compute_output_shape() {
const int* kernel_shape_data = this->kernel_shape_.cpu_data();
const int* stride_data = this->stride_.cpu_data();
const int* pad_data = this->pad_.cpu_data... | ALGO | 0.911508 | 7.832802 |
c5f869fe-0734-41fe-b2d5-517e8be26565 | raincross7/code-similarity | codes/train_code/problem200/problem200_167.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<char, ll> pcl;
#define m0(x) memset(x, 0, sizeof(x))
#define all(x) x.begin(), x.end()
#define rep(i, n) for(int i = 0; i < (n); i++)
#d... | ALGO | 0.999995 | 4.568465 |
b96229c9-f8cd-40cd-8486-64ed1cad4f72 | caelen-feller/leetcode | problems/two_sum/solution.cpp | class Solution {
public:
vector<int> twoSum(vector<int> &nums, int target)
{
unordered_map<int, int> hash;
int a, b,diff;
for (int i = 0; i < nums.size(); i++) {
diff = target - nums[i];
if (hash.find(diff) != hash.end()) {
a = hash[diff];
... | ALGO | 0.999754 | 6.253025 |
36e2f51d-9b7a-45bb-b63a-38b40e256f04 | aakash2121995/Efficient-Algorithms | Sheet 01/k-means.cpp | #include <iostream>
#include <vector>
#include<stdio.h>
using namespace std;
int main(int argc, char const *argv[])
{
int n;
cin >> n;
long long sum=0;
for (int i = 0; i < n; ++i) {
long long x,y;
cin >> x >> y;
sum+= x*x + y*y;
}
cout<<sum<<".000000000000000000000000000000";
return 0;
} | ALGO | 0.98948 | 3.096121 |
20ea7770-845e-453a-8989-8cfbe1220087 | yuri410/Apoc3D | Apoc3D/Math/BoundingSphere.cpp | #include "BoundingSphere.h"
#include "Plane.h"
#include "BoundingBox.h"
#include "Ray.h"
namespace Apoc3D
{
namespace Math
{
bool BoundingSphere::IntersectsRay(const Ray& ray, Vector3* _p1) const
{
Vector3 sc = Center - ray.Position;
float slen = Vector3::Dot(ray.Direction, sc);
if (slen > 0)
{
... | ALGO | 0.990912 | 5.807605 |
05a8530d-2784-4a98-bca5-822a1ef15152 | chitradeidanka90/c-code | pre computation/1-fact.cpp | // Online C++ compiler to run C++ program online
#include <iostream>
using namespace std;
const int M=1e9+7;
// time complexity O(T*n);
int main() {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
long long fact=1;
for(int i=2;i<=n;i++){
fact=(fact*i)%M;
}
cout<<fact<<endl;
}
... | ALGO | 0.999915 | 4.983572 |
a86a30e5-ae94-44a7-b43e-b2e0ba3e9522 | md-qubais/DSA_solved_questions | leetcode_self_count.cpp | class Solution {
public:
void merge_and_count(vector<pair<int,int>>&p,int s,int mid,int e,vector<int>&ans){
int i=s;
int j=mid+1;
while(i<=mid and j<=e){
if(p[i].first>p[j].first){
j++;
}else{
ans[p[i].second]+=j-(mid+1);
i++;
}
}
while(i<=mid and j>e){
ans[p[i++].second]+=j-(mid+1);
}
sort(p.b... | ALGO | 0.999977 | 5.88626 |
286d3784-58a7-4010-8536-b6aa0b2a15d7 | Anish168/Placement | Trees/CreateTreeUsingPreInOrder.cpp | #include <iostream>
#include <queue>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
// constructor
node(int data)
{
this->data = data;
left = NULL;
right = NULL;
}
};
int pre[] = {8, 3, 16, 4, 7, 10, 14, 13};
int in[] = {1, 3, 4, 6, 7, ... | ALGO | 0.999995 | 5.088322 |
2e90de3c-00ec-4ad2-88d2-dc9eb23a873b | irff/cp-codes | SPOJ/GuessTheNumber.cpp | #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main(){
int a,b,guess;
string s;
scanf("%d%d", &a,&b);
do{
guess=(a+b)/2;
printf("%d\n", guess); fflush(stdout);
cin >> s;
if( s=="LOW") a=guess+1;
else b = guess-1;
} while(s!="W... | ALGO | 0.999337 | 3.337489 |
092ab9fb-d874-4e37-98d2-15d904e3155e | ishandutta2007/codeforces | maksim1744/normal/1637/C.cpp | /*
author: Maksim1744
created: 12.02.2022 17:46:20
*/
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define sum(a) ( accumulate ((a).begin(), (a).end(), 0ll))
#define mine(a) (*min_... | ALGO | 0.999479 | 5.09548 |
8bfc6efb-d9de-4df3-a9fb-c73090f85986 | camil0palacios/Competitive-programming | solutions/codeforce/Codeforces Round #722 (Div. 2)/c.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define fori(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define fore(i,a,b) for(int i = a; i <= b; i++)
#define ft first
#define sd second
#define all(v) v.begin(), v.end()
#define sz(v) (int) v.size()
#define mp make... | ALGO | 0.999768 | 4.240488 |
fb1d947d-b126-4c26-a427-d0825891058f | singhkunal01/Dynamic-Programming | DP on Stocks/Best Time to Buy & Sell stocks with Transaction Fees.cpp | #include<bits/stdc++.h>
using namespace std;
/*This is the tabulation method only we can also use memoization and space optimisation For the same problem */
int findMaxProfitCooldownSpaceOpt(vector<int> &profit, int fees) {
int n = profit.size();
vector<vector<int>> dp(n + 1, vector<int> (2, 0));
for (int i = n -... | ALGO | 0.999638 | 4.343524 |
73173f6e-7a11-453e-bd00-e2fbaa6523bc | aNMOL123961/Shared | Discrete Structure/19.cpp | #include<iostream>
using namespace std;
int conjuction(int a, int b){
if(a==1 && b==1)
return 1;
else
return 0;
}
int main(){
int a,b,k;
cout<<"Truth Table of Conjuction"<<endl;
cout<<"_________________"<<endl;
cout<<"a\tb\tk"<<endl;
for(a=0;a<=1;a++){
for(b=0;b<=1;b++){
k=conjuction(a,b);
cout<<a<<"... | ALGO | 0.997596 | 3.906774 |
944f4eb2-85ae-47b1-802e-a09d88458b55 | brunoNevess/LeetCode | Algorithms/22. Generate Parentheses.cpp | class Solution {
public:
vector<string> ans;
void fill(string s,int closed,int open,int n){
if(open == n and closed == n) {
ans.push_back(s);
return;
}
if(open < n){
s.push_back('(');
fill(s,closed,open+1,n);
... | ALGO | 0.999901 | 6.407536 |
6b2b55a7-9c92-4834-9dd1-245246e3cff0 | prashant-kr5117/Leetcode | 203-remove-linked-list-elements/203-remove-linked-list-elements.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* removeEleme... | ALGO | 0.999912 | 5.63721 |
a01d6922-3852-44fe-a0c2-9b3bd62f3200 | Abhi7026/Leetcode-Solutions | 0006-zigzag-conversion/0006-zigzag-conversion.cpp | class Solution {
public:
string convert(string s, int numRows) {
if (numRows <= 1)
return s;
const int len = (int)s.length();
string *str = new string[numRows];
int row = 0, step = 1;
for (int i = 0; i < len; ++i)
{
str[row].push_back(s[i]);
if (row == 0)
... | ALGO | 0.999985 | 6.163806 |
3943df92-d997-42a0-99c6-36a61a80dfa3 | rizk-omarsherif/cpp-modern-study | 01-basics/02-data-types/examples/ex4/src/ex4.cpp | #include <iostream>
#include <climits> // For INT_MAX, INT_MIN, UINT_MAX, LLONG_MAX
int main() {
// Use capital letters for constants as a convention
const double PI{3.14159};
// PI = 10; // Uncommenting this line will cause a compile-time error (cannot modify a const)
const int LUCKY{13}; // Using br... | CONFIG | 0.962191 | 6.09695 |
a01f14ca-eb99-42db-b4f0-a00ac8fb2707 | TimeSea05/LeetCode101 | 400-1000/474-findMaxForm.cpp | #include <iostream>
#include <vector>
using namespace std;
int findMaxForm(vector<string>& strs, int m, int n) {
int nStr = strs.size();
vector<int> zeros(nStr);
vector<int> ones(nStr);
for (int i = 0; i < nStr; i++) {
for (int j = 0; j < strs[i].size(); j++) {
if (strs[i][j] == '0') {
zeros[... | ALGO | 0.999782 | 5.547281 |
af75ac8a-a7aa-4dd3-959d-2e6efe6f7ec3 | ishandutta2007/codeforces | fanache99/normal/1530/C.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <stack>
#include <cassert>
#include <map>
#include <numeric>
#include <cstring>
#include <set>
#include <ctime>
#include <queue>
#include <cmath>
#include <iomanip>
#include <iterator>
#include <bitset>
#include <unordered_map>
#incl... | ALGO | 0.999794 | 3.903995 |
55585a43-38ed-43c3-ba29-cea5078ff240 | Class-17/AtCoder | Beginner/268/E.Chinese_Restaurant_Three-Star_Version.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n; cin >> n;
vector<int> p(n), pos(n);
for (auto &x : p) cin >> x;
for (int i = 0; i < n; ++i)
pos[p[i]] = i;
vector<ll> sk(n + 1), sb(n + 1);
auto add = [... | ALGO | 0.999984 | 3.780274 |
abfdf1ff-4ea4-4930-aa42-f0035165ea5e | IvanGrebenyukov/zad4_cpp | practci4.cpp | // practci4.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include <cmath>
#include <conio.h>
#include <stdio.h>
using namespace std;
struct Point {
double x, y, z;
};
int main()
{
setlocale(LC_ALL, "ru");
FILE* file;
if (fopen... | TOOL | 0.9712 | 3.178761 |
77ef8335-91a4-4a99-950b-c2d60a48f7a5 | bhavyawig/Competitive-Programming | Power Sequence codeforces.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main()
{
lli n;
cin>>n;
lli a[n];
for(lli i=0;i<n;i++)
{
cin>>a[i];
}
// 1 7 4 9
lli q=sizeof(a)/sizeof(a[0]);
sort(a,a+q);
lli count=0;
lli c=floor((double)sqrt(a[n-1]));
for(lli i=0;i<n;i++)
{
if(a[i]!=1... | ALGO | 0.99988 | 3.221858 |
9097f90c-fc90-49e6-bce0-7fbc15e3d157 | ishandutta2007/codeforces | uuzlovetree/normal/1263/F.cpp | #include<bits/stdc++.h>
#define maxn 2005
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<long long,long long>
#define mpr(a,b) make_pair(a,b)
using namespace std;
ll gcd(ll a,ll b){if(!b)return a;return gcd(b,a%b);}
ll fastpow(ll a,ll p,ll mod)
{
ll ans=1;
while(p)
{
... | ALGO | 0.999741 | 3.37868 |
c2921a2f-ceb6-4d57-8b8a-67b9c8ca3ffe | ShafkatSharif/Cplus | LabMannualCse225/prsheet3.cpp | /*Write a program that will keep taking inputs from the user until the user inputs -1. Finally
display the all numbers and also display all numbers excludes the odd number and find
the sum of them.*/
#include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int>v;
int sum=0, n;
cout<< ... | ALGO | 0.997962 | 3.825512 |
60c4c477-67a0-4524-97b8-2532842df76d | MeMrBerlin/Placement_help | Coding Platforms(codechef,codeforces,etc)/GeeksforGeeks/Rotate_by_degree.cpp | /*
* कर्मणये वाधिकारस्ते मां फलेषु कदाचन ।
* मां कर्मफलहेतुर्भू: मांते संङगोस्त्वकर्मणि ॥
*/
#include <bits/stdc++.h>
using namespace std;
#define bug(...) __f (#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template ... | ALGO | 0.999898 | 5.942361 |
9e63278a-2a0e-4c7d-9dfd-4f3b98bced21 | Anish-28/CPP-templates | Design Add and Search Words Data Structure (Trie).cpp | //https://leetcode.com/problems/design-add-and-search-words-data-structure/description/
class WordDictionary {
public:
struct Trie{
Trie* child[26];
bool isPossible;
Trie(){
isPossible=false;
for(int i=0;i<26;i++)
c... | ALGO | 0.999795 | 6.492467 |
06d346f0-3082-4791-bc18-9165848b65f0 | ShibhuRathore/Leetcode_dsa | 0953-reverse-only-letters/0953-reverse-only-letters.cpp | class Solution {
public:
string reverseOnlyLetters(string s) {
vector<char>letters;
for(auto &ch:s){
if(isalpha(ch)){
letters.push_back(ch);
}
}
string ans="";
// reverse(letters.begin(),letters.end());
for(int i=0;i<s.length();... | ALGO | 0.999827 | 6.570683 |
3028e15a-1df7-4a83-8fa7-44b84ce9c27a | MathieuCaro/Udemy | C++/Vecteurs/Vecteur_app2/vector_app2.cpp | #include "vector_app2.h"
int calculate_pairs(vector<int> vec) {
int result;
int taille = vec.size();
result = 0;
for (int i = 0; i < taille; i++) {
for (int j = i + 1; j < vec.size(); j++) {
result += vec.at(i) * vec.at(j);
}
}
return result;
} | ALGO | 0.96244 | 3.823256 |
e607e0c1-e72d-40fd-aad2-b545835c452d | NitaiBanik/My-algorithm | Dp/srz.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod 100000007
int main()
{
int t,n,k,s,w = 0;
scanf("%d",&t);
while(t--)
{
scanf("%d %d %d",&n,&k,&s);
int dp_now[s + 5];
int dp_prev[s + 5];
memset(dp_now,0,sizeof(dp_now));
memset(dp_prev,0,sizeof(dp_prev))... | ALGO | 0.999956 | 3.685886 |
70d0890d-9869-4be2-bb61-4ccffb6e987b | dev-jb-007/dev-cp | kickstart/google.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pbds tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long l;
typedef double db;
typedef long do... | ALGO | 0.994526 | 3.848766 |
174e9776-be5e-4b2d-a2c4-926f22d43c24 | PeizhongQiu/leetcode | 02/0222/1375.cpp | class Solution {
public:
int numTimesAllBlue(vector<int>& flips) {
int max = 0;
int count = 0;
for(int i = 0; i < flips.size(); ++i) {
if(flips[i] > max) max = flips[i];
if(i + 1== max) {
++count;
}
}
return count;
}
}; | ALGO | 0.999128 | 6.025335 |
f1de36ee-4ad4-4b31-bed1-38a597295a13 | arpan595jain/DSA | Leetcode 1509.cpp | class Solution {
public:
int minDifference(vector<int>& nums) {
sort(nums.begin(),nums.end());
int minVal = INT_MAX;
int n = nums.size();
if(n <= 4) return 0;
minVal = min(minVal, nums[n-4] - nums[0]);
minVal = min(minVal, nums[n-1] - nums[3]);
minVal = m... | ALGO | 0.999938 | 5.811553 |
d1bd298a-3ea1-466e-8dfc-f155b1623e5f | marinvhs/coding | regional/2004/hurry.cpp | #include <cstdio>
#include <cmath>
#include <list>
using namespace std;
int min(int a, int b) { return a < b ? a : b; }
#define foreach(i, c) for(typeof(c.begin()) i = c.begin(); i != c.end(); i++)
#define INF 1E16
#define EPS 1E-10
#define SOURCE 0
#define SINK 1
#define PLAYER(x) ((x) + 1)
#define FINISH(x) ((x) ... | ALGO | 0.997966 | 3.859049 |
44ff9f50-2c68-4896-b11d-ad775567c6da | arshlanali/DSA-Problems | 1738-maximal-network-rank/maximal-network-rank.cpp | class Solution {
public:
int maximalNetworkRank(int n, vector<vector<int>>& roads) {
vector<vector<int>> adj(n,vector<int>(n, 0));
vector<int> degree(n,0);
for(auto it: roads){
degree[it[0]]++;
degree[it[1]]++;
adj[it[0]][it[1]]=1;
adj[it[1]][i... | ALGO | 0.999909 | 5.629652 |
0657be88-025e-432c-90a4-f38f870c24f8 | jsouliss/DSA | MCS-DSA/02-Stack/ReverseString.cpp | //
// Created by Jerry on 7/29/2025.
//
#include <string>
#include <cstring>
#include <stdio.h>
#include <stdlib.h>
// #include <stack> // Stack from Standard Template Library (STL)
class Stack
{
private:
char A[101];
int top = -1; // Initialize top to -1 to indicate an empty stack
public:
void Push(int x);... | ALGO | 0.99844 | 5.663279 |
69cc1db7-2145-4056-9ff0-919eaebf3f21 | trailofbits/binjascripts | vtable-navigator/virtual-test.cpp | // Simple virtual function example, based on http://www.cplusplus.com/doc/tutorial/polymorphism/
// compiled with:
// x86_64 -> g++ virtual-test.cpp -o virtual-test
// arm -> arm-linux-gnueabi-g++ virtual-test.cpp -o virtual-test-arm
#include <iostream>
using namespace std;
class Polygon {
protected:
int width, ... | TOOL | 0.881068 | 6.465248 |
6bd6bb53-adf8-47ef-9557-d5d4b74d3d08 | swetanjal/Competitive-Programming | Codeforces/Solved Problems/898C.cpp | #include <bits/stdc++.h>
using namespace std;
int T,N;
string M;
map <string , set <string> > H;
string S;
vector <string> names;
vector <string> phone[1000005];
int chk(string a, string b)
{
int La=a.size();
int Lb=b.size();
if(La>Lb)return 0;
int c=La-1;
for(int i=Lb-1; ; i--)
{
if(c<0)return 1;
if(a[c]!=... | ALGO | 0.999474 | 3.915731 |
96f42fe0-59b3-457f-8cf3-6fe2cc3fde24 | JimmyCHWang/Elementary_Course_on_Cpp | Course1123/std/triangle.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int N;
cin>>N;
//int M = 2 * N - 1;
for (int i = 0; i < N; i++) {
int spaces = N - i - 1;
for (int j = 0; j < spaces; j++) cout<<" ";
for (int j = 0; j < 2 * i + 1; j++) cout<<"#";
for (int j = 0; j < spaces; j++) cout<<" ";
cout<<endl;
}
syst... | ALGO | 0.999959 | 3.45693 |
7124ad34-40c1-4329-a3a1-ec30a7e9ebbc | benzoinoo/RefactoringMinerPP | testdata/MoveMethod/Cpp/current/OrderProcessor.cpp | #include <vector>
class Item {
public:
double getPrice() const {
return price;
}
static double calculateTotal(const std::vector<Item>& items) {
double total = 0;
for (const Item& item : items) {
total += item.getPrice();
}
return total;
}
private:
... | ALGO | 0.983549 | 7.43986 |
59bcca68-1543-4e6c-be4d-d14103b4fd93 | yiyongc/BvhEditor | Middleware/boost_1_55_0/libs/spirit/example/qi/key_value_sequence_empty_value.cpp | // The purpose of this example is to show how to parse arbitrary key/value
// pairs delimited by some separator into a std::vector. The difference to
// the example 'key_value_sequence.cpp' is that we preserve the order of the
// elements in the parsed sequence as well as possibly existing duplicates.
// In addition ... | TOOL | 0.938398 | 6.341355 |
bdde82b4-92f1-41eb-bd5f-1e02d38242df | sina-cb/Monte-Carlo-HMM | src/MCHMM.cpp | #include "MCHMM.h"
#include <cmath>
#include "Sampler.h"
#include <random>
#include <chrono>
#include <glog/logging.h>
#include <cassert>
#include <boost/math/distributions/students_t.hpp>
using namespace std;
using namespace google;
MCHMM::MCHMM(){
pi = new vector<Sample>();
m = new vector<Sample>();
v = ... | ALGO | 0.998723 | 6.244247 |
307a44a7-ca36-4259-88aa-29dd5b8d7cfe | ishandutta2007/codeforces | denisson/normal/175/C.cpp | #define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <s... | ALGO | 0.999887 | 3.408443 |
8fa55911-b8b9-4517-ac42-a4bcdb5fafd9 | ishandutta2007/codeforces | molamola/normal/960/F.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include ... | ALGO | 0.999963 | 4.070394 |
cef2310d-e8a3-4521-81cc-7d730741e59d | Ezdras01/numero_secreto_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.998757 | 6.771107 |
0e35acc9-e746-4011-98ba-098f29aea02d | Jonahowns/oxpy_anm | src/Observables/PairEnergy.cpp | /*
* PairEnergy.cpp
*
* Created on: Feb 12, 2013
* Author: petr
*/
#include "PairEnergy.h"
//#include "../Interactions/RNAInteraction_V1.h"
#include <sstream>
#include <map>
PairEnergy::PairEnergy() {
_print_header = true;
}
PairEnergy::~PairEnergy() {
}
void PairEnergy::get_settings(input_file &my_inp... | TOOL | 0.866763 | 4.991822 |
74ed5676-06bb-4771-80f5-f457e791b1df | AmarjeetMohanty/Leetcode | 68-text-justification/68. Text Justification.cpp | class Solution {
public:
vector<string> fullJustify(vector<string>& words, int maxWidth) {
vector<string> res;
const int n = words.size();
int begin = 0, len = 0;
for (int i = 0; i < n; ++i) {
if (len + words[i].size() + (i - begin) > maxWidth) {
res.empla... | ALGO | 0.999942 | 6.473979 |
2d5d729c-b63a-456d-b8b6-5262901b946e | codemonkeyricky/lc | 998.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include <stack>
#include <queue>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <cmath>
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
... | ALGO | 0.999871 | 5.002039 |
734e102c-a176-4c70-aa4a-4cd0926d2636 | yogadwiprasetyo/belajar-cpp | MATERI BASIC/break-continue/break.cpp | #include <iostream>
using namespace std;
int main(){
int a = 1;
while( a <= 10){
a++;
if ( a == 5 ){
//continue;
break;
}
cout << "berhasil ";
cout << a << endl;
}
for (int i = 1; i <=10; ++i){
if ( i == 5 ){
//break;
continue;
}
cout << i << endl;
}
return 0;
}
| TOOL | 0.889359 | 3.382836 |
3b800a57-1ce1-4818-add0-8e8203df63ea | zinebzarda/challenges-Enaa-langague-C | Algo/es2_1.cpp | #include <stdio.h>
int main() {
int n;
printf("la table de multiplucation de 8 :\n");
for (int i=1 ; i <= 10 ; i++){
n = 8*i;
printf(" 8*%d =%d \n",i ,n);
}
return 0;
}
| ALGO | 0.956278 | 3.09797 |
dcd30afd-99b2-47f8-bcf2-b844b69e78ed | himanshugupta09/LEETCODE_SOLUTIONS | GFG_Problems/floydd-warshall.cpp | //{ Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution {
public:
void shortest_distance(vector<vector<int>>&matrix){
// Code here
int n=matrix.size();
for(int i=0;i<n;i++){
for(... | ALGO | 0.999613 | 6.051806 |
fc5b87c6-6470-472b-be6e-09ff8048570a | ishandutta2007/codeforces | axs7384/normal/679/D.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=405;
int a[N][N],n,m,x,y,u,v,q[N];
double sum,ans,t,s,b[N],c[N];
int main()
{
memset(a,0x3f,sizeof(a));
scanf("%d%d",&n,&m);
for (int i=1;i<=n;++i)
a[i][i]=0;
for (int i=1;i<=m;++i)
{
scanf("%d%d",&x,&y);
a[x][y]=a[y][x]=1;
}
for (int k=1;k<=n;++k)
... | ALGO | 0.999892 | 3.668146 |
6eaab3bd-d141-4e47-b728-460be8d25eb1 | mohitydv09/leetcode75 | 19_remove_nth_node.cpp | #include <iostream>
#include <vector>
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* removeNthFromEnd(ListNode* head, int n)... | ALGO | 0.999964 | 6.383687 |
4028c3b5-555a-4405-8752-c3a896b0cd82 | ishandutta2007/codeforces | mjhun/normal/220/A.cpp | #include <algorithm>
#include <iostream>
using namespace std;
int a[100005];
int s[100005];
int main(){
int n,i,r;
cin>>n;
for(i=0;i<n;++i) {
cin>>r;
a[i]=r;
s[i]=r;
}
sort(s,s+n);
i=0;
r=0;
while(i<n&&r<=2){
r+=a[i]!=s[i];
++i;
}
cout<<((r<=2)?"YES":"NO")<<endl;
return 0;
} | ALGO | 0.999966 | 3.642325 |
f9aa87fa-ed80-4ee4-b240-000d06f86f2f | ziqi-zhang/TAOISM | Include/eigen/unsupported/doc/examples/PolynomialUtils1.cpp | #include <unsupported/Eigen/Polynomials>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
Vector4d roots = Vector4d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,5,1> polynomial;
roots_to_monicPolynomial( roots, polynomial );
cout << "Polynomial:... | ALGO | 0.998809 | 4.015535 |
fa96ccef-f710-4fd6-b08b-103d349e9f31 | RF-Faisal/Onine-judge-solved-problems | Topic/Game Theory/HackerRank - Move the Coins.cpp | //https://www.hackerrank.com/challenges/move-the-coins/problem
//staircase nim
#include <bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define TC int tc; cin>>tc; for(int cn=1; cn<=tc; ++cn)
const int N = 5e4+2;
vector<int> adj[N];
int coin[N], sub_game[N][2];
bool ... | ALGO | 0.999873 | 4.909069 |
a0aa4c9d-35c6-4928-805f-f140904d2300 | Mindjolt2406/Competitive-Programming | Codeforces/Global/17/B.cpp | // clang-format off
#include<bits/stdc++.h>
// g++ -std=c++17 -Wl,-stack_size -Wl,0x10000000 main.cpp
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define EPS 1e-6
#define ll long long int
#define ld long double
#define fi first
#define se second
#define t1(x) c... | ALGO | 0.999762 | 5.016427 |
45565759-c963-426d-bbbb-ab082b87a7d9 | SandlerRodrigo/3DModeling-GC | lib/SOIL/image_DXT.cpp | /*
Jonathan Dummer
2007-07-31-10.32
simple DXT compression / decompression code
public domain
*/
#include "image_DXT.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
/* set this =1 if you want to use the covarince matrix method...
which is better than my method of using standard ... | TOOL | 0.962986 | 4.643344 |
37ff0f95-6b50-4538-832a-067092cb4b8f | wwkenwong/codeforces | 709A.cpp | #include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
const int maxn=200000;
//int o[maxn];
int n,b,d,garbage,ans;
bool juice_flag;
int main(){
std::ios::sync_with_stdio(false);
cin.tie(NULL);
cin>>n>>b>>d;
garba... | ALGO | 0.999885 | 3.399635 |
d83e5669-c4fc-48c8-bdb3-d07fd32f5676 | ishefalichopra/CPP | 111_intersectionOfArray.cpp | #include<bits/stdc++.h>
using namespace std;
int FindIntersection(int arr1[], int arr2[], int n, int m){
int i=0,j=0;
while(i<n && j<m){
if(arr1[i]<arr2[j]){
i++;
}
if(arr1[i]>arr2[j]){
j++;
}
if(arr1[i]==arr2[j]){
cout<<arr1[i]<<" ";
... | ALGO | 0.999972 | 3.287558 |
3300acd3-174d-46f6-8efe-4a2e14ed5e8a | Sadi-Hurayv/Competitive-Programming | DSA/Algorithm/Bit Manupulation/Bitmask/Generate all possible subset.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("/media/shuvra/New Volume/IIT/Programming/Competitive-Programming/IO/input.txt", "r", stdin);
freopen("/media/shuvra/New Volume/IIT/Programming/Compe... | ALGO | 0.999065 | 4.489985 |
b9af478f-dc6e-4711-ac24-abd255004a4f | tastydragons/NightEngine | NightEngine/src/NightEngine/Physics/CollisionSystem.cpp | #include "hzpch.h"
#include "CollisionSystem.h"
#include "NightEngine/ECS/ECS.h"
#include "NightEngine/ResourceManager/ResourceManager.h"
namespace Night
{
/*!*************************************************************************
This function initialises the system. As there are no data members that requ... | ALGO | 0.899497 | 5.711399 |
012c920c-0c91-44d5-b3bd-b4ceb71fa09e | PranitChawla/ACM-ICPC-Regionals-Codes | door_frames.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int a,b;
cin>>a>>b;
int max=0;
int i_max,j_max;
for (int i=0;i<=4;i++)
{
for (int j=0;j<=2;j++)
{
int val;
val=i*a+j*b;
if (val<=n)
{
if (val>max)
{
max=val;
i_max=i;
j_max=j;
}
}
}
}
if (... | ALGO | 0.99961 | 3.22952 |
412d4615-3b56-46ff-ba8e-6893fbbf6ada | ishandutta2007/codeforces | rfpermen/normal/958/F1.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
#define ll long long
#define ull unsigned long long
#define rep(i,n,N) for(int i=(n);i<=(N);++i)
#define For(i,n,N) for(int i=(n);i< (N);++i)
#define rap(i,n,N) for(int i=(... | ALGO | 0.999997 | 3.183762 |
674c51dd-ed2c-4e5a-bba7-024deb6b5b46 | Abhishekkumar2021/6th_Semester | Code/CountSetBits.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Example
n = 6
0 => 000
1 => 001
2 => 010
3 => 011
4 => 100
5 => 101
6 => 110
*/
int countBits(int n){
if(n==0) return 0;
int x = log2(n);
int ans = x*pow(2,x-1);
int rem = n - pow(2,x) + 1;
ans += rem + countBits(n-pow(2,x));
} | ALGO | 0.999858 | 4.700004 |
7a9516ac-1a9d-4fb4-946b-9590d7e615af | RolandTeodorowitsch/AlgoritmosEEstruturasDeDadosI | 03-algoritmos_de_ordenacao/src/insertionSort.cpp | void insertionSort(int *dados, int tam) {
for (int i=1; i<tam; ++i) {
int base = dados[i];
int j = i-1;
while ( j>=0 && base < dados[j] ) {
dados[j+1] = dados[j];
--j;
}
dados[j+1] = base;
}
}
| ALGO | 0.999838 | 4.584253 |
e7fb8d48-5e20-40a8-a5c2-ce6834273e36 | GiuseRiv/AP_GAP_UFLP_Solver | Solutions/GAP_Solution.cpp | #include "GAP_Solution.h"
#include <string>
#include <vector>
#include <memory>
#include <iostream>
GAP_Solution::GAP_Solution(const std::vector<int>& soluzione) : soluzione(soluzione) {}
//NB le soluzioni sono espresse con indici per agenti e compiti che partono da 0 (il primo agente è agente 0)
std::ostream& GAP_So... | ALGO | 0.989129 | 4.539697 |
82ab39f8-768b-43b2-b585-d81613489423 | FannyZhao123/leetCode | E_733.cpp | /*
733. Flood Fill
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535).
Given a coordinate (sr, sc) representing the starting pixel (row and column) of the flood fill, and a pixel value newColor, "flood fill" the image.
To perform a "flood fill", ... | ALGO | 0.985955 | 6.582345 |
d838e63e-50c7-4fd1-80b5-557ee2fcb19b | ishandutta2007/codeforces | shenmadongdong.qwq/normal/1499/A.cpp | #include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,avx,avx2")
#pragma GCC optimize("unroll-loops")
#define rep(i,a,b) for(ll i=(a);i<=(b);++i)
#define req(i,a,b) for(int i=(a);i>=(b);--i)
#define rep_(i,a,b) for(int i=(a);i<(b).size();++i)
#define F(a) rep(a,1,n)
... | ALGO | 0.999472 | 3.880596 |
19c9f4de-8bd8-4f26-aa04-7f3278337227 | zhavkk/OOP_labs | lab_01/func.cpp | #include <bits/stdc++.h>
std::string func(std::string s){
std::string ans = "";
std::string number = "";
for(char c : s){
if(std::isdigit(c)){
number+=c;
}
else{
if(!number.empty()){
ans=ans+number+" ";
number="";
... | ALGO | 0.99921 | 5.064175 |
b59d6a86-811b-4398-946b-7036737b4669 | limyunkai19/competitive-programming-codes | ACM_ICPC Live Archive/6906 - Cluster Analysis.cpp | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
int a[110], cluster;
vector<int> p;
void init(int n){
p.resize(n);
cluster = n;
for(int i = 0; i < n; i++){
p[i] = i;
}
}
int find_set(int x){
if(p[x] == x) return x;
return p[x] = find_set(p[x]);
}
void me... | ALGO | 0.999906 | 3.846961 |
bca15eaa-d2e0-4ade-84d3-19793668285b | Junaid7200/University-Labs | Data Structures/Stacks/.history/hadiahTester_20240419115310.cpp | using namespace std;
#include <iostream>
#include <stack>
#include <string>
//class CNode {
//private:
// char data;
// CNode* next;
//public:
// CNode() {
// next = nullptr;
// }
// CNode(char v) {
// data = v;
// next = nullptr;
// }
// char GetData() {
// return data... | ALGO | 0.99952 | 5.552867 |
fd36ce09-b472-4330-9386-06b183d6145c | guricerin/algo-method-submissions | src/14_various-data-structure/07_stack-and-queue/09.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (a); i >= (int)(b); i--)
#define all(x) (x).begin(), (x).end()
using i64 = int64_t;
int main() {
int q;
cin >> q;
queue<string> que;
rep(i, 0, q) {
int ty;... | ALGO | 0.988874 | 4.924231 |
ddb429c8-75a9-4d82-b1df-07666309a2f7 | EdwardChen28/Data-Structures | lab_huffman/huffman_tree.cpp | /**
* @file huffman_tree.cpp
* Implementation of a Huffman Tree class.
*
* @author Chase Geigle
* @date Summer 2012
*/
#include <algorithm>
#include <iostream>
#include <queue>
#include <utility>
#include "huffman_tree.h"
using namespace std;
HuffmanTree::HuffmanTree( vector<Frequency> frequencies ) {
std::s... | ALGO | 0.98817 | 5.673275 |
b5591b3a-bfdf-4053-9834-d371f955f61e | lovelybigduck/note | 代码练习/刷题/2018天梯赛兰州理工大学校内选拔赛 拯救007.cpp | //2018ѧУѡ 007
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iostream>
#include <cstring>
using namespace std;
#define ll long long
#define inf 0x3f3f3f3f
#define mem(a,b) memset(a,b,sizeof(a))
#define closeio std::i... | ALGO | 0.999982 | 3.866905 |
283c977a-924b-41df-a991-fcdbee66e02f | Zovube/Tasks-solutions | CF/rounds/526/D/sol.cpp | #include<bits/stdc++.h>
using namespace std;
string to_string(string s) {
return '"' + s + '"';
}
string to_string(const char * s) {
return to_string(string(s));
}
template < typename A, typename B >
string to_string(pair <A, B> p) {
return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template... | ALGO | 0.999779 | 4.017133 |
967f174a-5a75-4803-92f2-b26aad5a4115 | donmccaughey/fiends_and_fortune | libs/tvision/source/tvision/tvtext1.cpp | /*------------------------------------------------------------*/
/* filename - tvtext1.cpp */
/* */
/*------------------------------------------------------------*/
#define Uses_TScreen
#define Uses_TRadioButtons
#define Use... | TOOL | 0.963621 | 3.476334 |
db48a68d-f7be-4c55-a797-3fc64e1968cd | Sushmita272004/DSA | patterns/pattern3.cpp | #include<iostream>
using namespace std;
int main(){
int row=1;
int n;
cin>>n;
while(row<=n){
if (row%2==0){
int col=n;
while(col>=1){
cout<<col;
col-=1;
}
}
else{
int col=1;
while(col<=n)... | ALGO | 0.999997 | 3.691082 |
9d289f22-986f-4f4f-83e5-a97ac467523e | itskartik22/Cpp_Problem | Strings/missingchacinPangram.cpp | #include <iostream>
#include <string>
#include<vector>
std::string returnString(std::vector<bool> &mark)
{
std::string str;
for (int i = 0; i < 26; i++)
{
if (mark[i] == false)
{
str.push_back('a' + i);
}
}
return str;
}
std::string missingChar(std::string str)
{
... | ALGO | 0.999291 | 3.667127 |
4fe4944e-611f-423a-8bad-61c852652a4f | nobinov/image_resizer_server | include/boost_1_75_0/libs/multiprecision/performance/delaunay_test.cpp | #include <boost/multiprecision/cpp_int.hpp>
#include "arithmetic_backend.hpp"
#include <boost/chrono.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#include <fstream>
#include <iomanip>
template <class Clock>
struct stopwatch
{
typedef typename Clock::duratio... | TEST | 0.970796 | 6.547808 |
52eee66e-583c-4753-b730-3bdb04c8d5ec | xiyanykt/code | SCAU/2024_SCAU暑期个人排位赛2/Little Artem and Grasshopper.cpp | #include<bits/stdc++.h>
using i64 = int64_t;
#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#define debug(...) (void)42
#endif
int main(void) {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
std::cin >> n;
std::string s;
std::cin >> s;
s = " " + s;
std::vector<int>dis(n + 1);
for (int i =... | ALGO | 0.999721 | 3.904342 |
e25425f2-6730-4028-9e80-9dc7373f1b8b | Ishan-Chauhan/dsa-questions | 0199-binary-tree-right-side-view/0199-binary-tree-right-side-view.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999767 | 6.235128 |
4ac1305e-da3e-4f35-a60f-3a0f8d16121a | belsouza/backupexercises | antigos/questao8.7.2.cpp | /*
QUESTO 07:
Desenvolver uma funo que remova determinado elemento (todas as suas ocorrncias) de um vetor de float. Ao final, retornar o nmero de remoes realizadas.
*/
//No t certo :D
#include <stdio.h>
void gerar( int *vet, int size )
{
int i;
FILE *fp;
fp = fopen("vetor.txt", "w+");
if(fp)
{
for( i = 0; i <=... | ALGO | 0.997885 | 3.220505 |
c4715f0a-a653-4428-8c7d-1c863363b2f0 | aminjonshermatov/leetcode | algorithms/UniqueBinarySearchTrees/UniqueBinarySearchTrees.cpp | #include "bits/stdc++.h"
using namespace std;
class Solution {
public:
int numTrees(int n) {
vector<int> dp(n + 1, 1);
for (int i = 2; i <= n; ++i) {
int total = 0;
for (int j = 1; j <= i; ++j) {
total += dp[j - 1] * dp[i - j];
}
dp... | ALGO | 0.999971 | 5.820897 |
54cc63ee-37a3-4a4a-8de4-c8807ada60d4 | diegojoel301/Programacion_Competitiva | juezPatito/2115/main.cpp | #include<bits/stdc++.h>
#define M 100001
using namespace std;
bool prime[M];
vector<int> v(M);
void criba()
{
memset(prime, true, sizeof(prime));
for(int p = 2; p * p <= M; p++)
{
if(prime[p] == true)
{
for(int i = p * 2; i <= M; i += p)
prime[i] = false;
}
}
prime[1] = false;
}
void gen()
{
int... | ALGO | 0.999963 | 3.865879 |
7de6383a-f594-46ca-8d1d-aad93d2c450f | kunal2812/CP | codeforces/954/D.cpp | #pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define pf push_front
#define... | ALGO | 0.999711 | 4.371428 |
0f24e62e-9cc4-4bac-a74a-016e2e3ac668 | flxcsx/Cf_solved | 275A.cpp | /* ALTXT */
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 1e9 + 5;
const int64_t INF = 1e18 + 5;
void solve()
{
vector<int> a(9), b(9, 0);
for (int i = 0; i < 9; i++)
{
cin >> a[i];
}
cout << !((a[0] + a[1] + a[3]) % 2) << !((a[0] + a[1] + a[2] + a[4])... | ALGO | 0.999228 | 3.378343 |
80cf97b8-3f75-44ca-b46e-6165665d0127 | Sotozu/Solutions-Cpp-From-Control-Structures-through-Object-Eight-Edition | Chapter03Solutions/03_21 How Many Pizzas.cpp | #include <iostream>
#include <iomanip>
using namespace std;
//21. How Many Pizzas?
int main() {
const float PI = 3.14159;
const float sliceSize = 14.125;
float diameter, radius, pizzaArea, numberOfPizzas;
float slicesPerPizza, numberOfPeople, slicesRequired;
cout << "This program determines the number of pizza... | ALGO | 0.999013 | 5.610783 |
08b81971-96d3-4134-bcdb-d85fd2cea840 | imWhS/ProblemSolving | SWEA_1952/main.cpp | #include <iostream>
using namespace std;
int plan[13] = {0, };
int plan_avail = 0;
int ticket_d, ticket_1m, ticket_3m, ticket_y;
int first_month = 0;
int best_value = 99999;
int result;
int dfs(int month, int sum) {
cout << "month " << month << ", sum " << sum << endl;
if(plan[month] == 0) {
cout <<... | ALGO | 0.999604 | 3.832538 |
ab6de503-26d8-48de-8923-8c2cf09547cd | rocmnavi/magma | sparse/src/zftjacobi.cpp | /*
-- MAGMA (version 2.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date
@author Hartwig Anzt
@precisions normal z -> s d c
*/
#include "magmasparse_internal.h"
#define RTOLERANCE lapackf77_dlamch( "E" )
#define ATOLER... | ALGO | 0.999968 | 6.545516 |
5a741e5c-6ddb-4f71-9ff3-ce26a7a4faea | gitchaofang/leetcode | 347.cpp | struct cmp{
bool operator()(const std::pair<int,int>& p1, const std::pair<int,int>& p2){
return p1.second > p2.second;
}
};
class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k) {
std::priority_queue<std::pair<int,int>, std::vector<std::pair<int,int>>, cmp> pq;
... | ALGO | 0.999997 | 5.971931 |
04fe203b-3e47-4c3e-85d5-0bf466613063 | ViderStar/Fraction | frac/Fraction.cpp | #include "Fraction.h"
using namespace std;
void Fraction::setNumerator(long m_numerator)
{
numerator = m_numerator;
}
long Fraction::getNumerator()
{
return numerator;
}
void Fraction::setDenominator(long m_denominator)
{
denominator = m_denominator;
}
long Fraction::getDenominator()
{
return denominator;
}
voi... | TOOL | 0.860586 | 4.825644 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.