uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
18bad6ef-a46b-46e6-a3ca-6c5d3815d7c0 | jookbooin/Algorithm | 10week_Algorithm/ch1/B_11655/m11655.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* 65 ~ 90
* 97 ~ 122
*
* 빮 -> 빮
* (((input - 'A') + 13 ) % 26 ) + 'A'
* ҹ -> ҹ
* (((input - 'a') + 13 ) % 26 ) + 'a'
*
*/
string input;
int main(void){
getline(cin, input);
for(int i =0; i<input.size(); i++){
if('A'<=input[i] &&... | ALGO | 0.999937 | 4.986074 |
421a843c-5534-43b5-974c-d91cfe3ddc7b | BogdanEgorov336/P13024Lesson50Solution-master | Task02/logic.cpp | // Сумма элементов [The sum of elements]
//
// Дана математическая квадратная матрица размером N.
// Необходимо разработать функцию (или программу),
// которая вычисляет сумму элементов матрицы,
// расположенных на главной и побочной диагоналях.
#include "logic.h"
int sum_main_diagonale_elements(int** matrix, int ... | ALGO | 0.998238 | 4.922111 |
5e49a2f1-be40-41fc-ae45-0b38c47a79fc | creamsjk/Algorithmic-learning | leecode/lecode3151.cpp | /*************************************************************************
> File Name: lecode3151.cpp
> Author: sunrie
> Mail: <EMAIL>
> Created Time: 2024年08月13日 星期二 09时18分33秒
方法:
使用位运算符来判断是不是特殊数组
************************************************************************/
#include<ios... | ALGO | 0.99949 | 4.418768 |
a6a3867b-88ca-43e3-b818-8df1141a1eee | sarvex/leetcode-clisp | solution/0400-0499/0455.Assign Cookies/Solution.cpp | class Solution {
public:
int findContentChildren(vector<int>& g, vector<int>& s) {
sort(g.begin(), g.end());
sort(s.begin(), s.end());
int m = g.size(), n = s.size();
for (int i = 0, j = 0; i < m; ++i) {
while (j < n && s[j] < g[i]) {
++j;
}
... | ALGO | 0.999919 | 6.010449 |
69917421-5e53-432e-b476-5a53747ec517 | Nikolay-23/Exercise-2 | ConsoleApplication1/ConsoleApplication1.cpp |
#include <stdio.h>
int main()
{
int n;
scanf_s("%d", &n);
int num1 = 1;
int num2 = 1;
while (num1 <= n) {
for (int i = 0; i < num2 && num1 <= n; i++) {
printf("%d ", num1);
num1++;
}
printf("\n");
num2++;
}
}
| ALGO | 0.999927 | 4.077307 |
07d30a11-c6cd-4f6e-963c-5afd2ca332a8 | AbhinavTuli/Code-Jam-2020 | Qualification Round/3.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<numeric>
#include<fstream>
#include<queue>
#include<unordered_map>
// #define INT_MAX 2147483647
// #define INT_MIN (-__INT_MAX__ -1)
using namespace std;
int main(){
int t;
cin>>t;
for(int cas=1;cas<=t;cas++){
... | ALGO | 0.999709 | 4.158346 |
b6a275c6-ed0e-48b6-a7a1-020041a27474 | idivanshu/6Companies30days | PerfectRectangle.cpp | class Solution
{
public:
bool isRectangleCover(vector<vector<int>> &rectangles)
{
if (rectangles.size() == 0 || rectangles[0].size() == 0)
return false;
int x1 = INT_MAX;
int x2 = INT_MIN;
int y1 = INT_MAX;
int y2 = INT_MIN;
unordered_set<string> se... | ALGO | 0.999335 | 5.810056 |
bdc84eff-57d1-4551-8a89-8122e560155b | raincross7/code-similarity | codes/train_code/problem259/problem259_250.cpp | //Date and time of submission:
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=1e5+5;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll r;
cin>>r;
if(r<1200)
cout<<"ABC";
else if(r<2800)
cout<<"ARC";
else
cout<<"AGC";
return 0;
}
| ALGO | 0.997534 | 3.815001 |
9e8a5049-449f-407e-9ba0-ca2ed13a8f39 | vishweshjatala/registersharing_hpdc16 | RegisterSharing_GPGPU-Sim/v3.x/src/intersim/maxsize.cpp | #include "booksim.hpp"
#include <iostream>
#include "maxsize.hpp"
// shortest augmenting path:
//
// for all unmatched left nodes,
// push node onto work stack
// end
//
// for all j,
// from[j] = undefined
// end
//
// do,
//
// while( !stack.empty ),
//
// nl = stack.pop
// for each edge (nl,j),... | ALGO | 0.994152 | 5.394179 |
353096f6-300c-4f26-81ca-13c6e6c6cc74 | ishandutta2007/codeforces | sirrembocodina/normal/500/B.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <cassert>
using namespace std;
#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define ford(i,n) for (int i =... | ALGO | 0.999977 | 3.574419 |
c0424677-8ce1-4903-bc9a-cc2cd308798e | moevm/oop | 6304/kovynev/3/m_vector/vector.cpp | #include <assert.h>
#include <algorithm> // std::copy, std::rotate
#include <cstddef> // size_t
#include <initializer_list>
#include <stdexcept>
#include <iostream>
using namespace std;
namespace stepik
{
template <typename Type>
class vector
{
public:
typedef Type* iterator;
typedef const Type* const_iterator... | TOOL | 0.933407 | 4.478311 |
ce743c9e-afb0-42a2-aeb3-e4e0d1f954e7 | spinos/aphid | flr/linreg/main.cpp | /*
* linear model estimation test
*/
#include <iostream>
#include <math/linearMath.h>
#include <math/miscfuncs.h>
#include <math/LinearRegression.h>
#include <QApplication>
#include <QDesktopWidget>
#include <QtCore>
#include "window.h"
using namespace aphid;
void testVVt()
{
std::cout<<"\n test vvt";
DenseV... | TEST | 0.866148 | 5.961925 |
83b705c9-3ade-4fbf-a572-59dcf8906fdc | machinadominus/cses | Sorting and Searching/Distinct Numbers/yo.cpp | #include <iostream>
#include <cmath>
#include <set>
using namespace std;
#define ll long long
int main()
{
int t;
cin >> t;
set<int> yo;
while(t--){
int n;
cin >> n;
yo.insert(n);
}
cout << yo.size() << "\n";
return 0;
}
| ALGO | 0.99804 | 4.519374 |
65973607-f7c1-4842-9587-f5f059bf99e5 | hanzlikhan/cppp | seclarg.cpp | // second largest elemnt in the array
// #include <iostream>
// using namespace std;
// int large(int arr[],int size){
// int max= arr[0];
// int maxindex = -1;
// for(int i=0;i<size;i++){
// if(arr[i]>max){
// max = arr[i];
// maxindex = i;
// ... | ALGO | 0.999869 | 4.113688 |
b4ae99b3-7c43-47ff-b511-bec999b34e43 | raincross7/code-similarity | codes/train_code/problem238/problem238_72.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, q;
cin >> n >> q;
vector<vector<int>> G(n);
for (int i = 0; i < n - 1; i++)
{
int a, b;
cin >> a >> b;
a--;b--;
G[a].push_back(b);
G[b].push_back(a);
}
vector<int> ans(n, 0);
f... | ALGO | 0.999952 | 4.638143 |
f353fd00-58c1-4195-be12-3d35fd3f3953 | Xacapak/VM_sem4 | Matrix.cpp | #include "Matrix.h"
#include <iostream>
#include <cmath>
//
void printArray(double arr[N]) {
for (int i = 0; i < N; ++i) {
std::cout << arr[i] << " ";
}
std::cout << std::endl;
}
//
void simpleIterationsMethod(double a[N][N], double b[N], double x[N]) {
double temp[N]; //
... | ALGO | 0.999943 | 4.662713 |
087da20c-0983-4d5d-beba-f447026a9733 | ishandutta2007/codeforces | teja349/normal/1000/E.cpp |
//teja349
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
//setbase - cout << setbase (16); cout << 100 << en... | ALGO | 0.999343 | 3.996828 |
b73b41b3-a76e-44bc-8dc6-df7af0ccdd42 | miven/nlp4 | 一些nlp常用的库包看看/mosesdecoder/moses/FF/LexicalReordering/LRModel.cpp | #include "LRModel.h"
#include "moses/Range.h"
#include "moses/Bitmap.h"
#include "moses/InputType.h"
#include "HReorderingForwardState.h"
#include "HReorderingBackwardState.h"
#include "PhraseBasedReorderingState.h"
#include "BidirectionalReorderingState.h"
#include "SparseReordering.h"
namespace Moses
{
bool
IsMonot... | CONFIG | 0.980179 | 4.385217 |
3fbd78c7-fb46-4c81-96ff-73795168b483 | raymonwang/opencore-amr-forXcode | opencore-amr/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr_r.cpp | /*
Filename: shr_r.cpp
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Inputs:
var1 = 16 bit short signed integer (Word16) whose value falls in
the range : 0xffff 8000 <= var1 <= 0x0000 7fff.
var2 = 16 bit short signed integer (Word16)... | ALGO | 0.99928 | 6.31642 |
01cdbe91-0992-4976-b4be-d4d3b9f83bfb | tanjil-islam/Introduction-to-C-Plus-Plus | Self Practice/pattern/Alphabetic_2_Pattern_3.cpp | #include <iostream>
using namespace std;
int main()
{
int n,row,col;
cout<<"Enter your number: ";
cin>>n;
for(row=0; row<=n; row++)
{
for(col=1; col<=row; col++)
{
char ch(row+64);
cout<<ch<<" ";
}
cout<<endl;
}
for(row=n-1; row>=1; r... | ALGO | 0.996683 | 3.415494 |
3a538471-f1c9-48dc-a201-6611c9f4a86d | NKDfoolish/exercise_CPlusPlus | De_quy/Source.cpp | #include <iostream>
using namespace std;
int tong_1(int n) {
if (n == 1) {
return 1;
}
else {
return n + tong_1(n - 1);
}
}
int tich(int n) {
if (n == 1) {
return 2;
}
else {
return 2 * n * tich(n - 1);
}
}
float tong_2(int n) {
if (n == 0) {
return 1;
}
else {
return ((1 / float((2 * n + 1)))... | ALGO | 0.999752 | 3.46244 |
29cff53e-ece4-44c2-8aeb-49b4605d5df4 | AmanAssassin/DSA | Arrays/LeetCode/Reverse_integer.cpp | class Solution
{
public:
int reverse(int x)
{
int res = 0;
while (x != 0)
{
if (res > INT_MAX / 10 || res < INT_MIN / 10)
{
return 0;
}
res = res * 10 + x % 10;
x = x / 10;
}
return res;
}
}; | ALGO | 0.99985 | 5.884568 |
cc1fd94b-2dff-4abb-88a6-dd90d7f9e277 | behitek/acm-epu | SPOJ/cpp/spoj-ptit/P141SUMA.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
long long ccw(long long ax, long long ay,
... | ALGO | 0.999978 | 3.909779 |
dfc5b7a9-efbb-49bf-acd8-b7978980f255 | Gupta-Nikhil85/striverSDESheetChallenge | day 2/reversePairs.cpp | #include <bits/stdc++.h>
int merge(vector<int> &arr, vector<int> &temp, int s, int mid, int e){
int i=s,j=mid+1;
int ans=0;
for(i=s; i<mid+1; i++){
while(j<=e && arr[i]>2LL*arr[j]){
j++;
}
ans+=j-mid-1;
}
i=s;j=mid+1;
int c=s;
while(i<=mid && j<=e... | ALGO | 0.999875 | 5.687886 |
f507dec4-ab18-467b-b8c5-26f702ed5950 | Jatin-Shihora/LeetCode-Solutions | 2336-smallest-number-in-infinite-set/2336-smallest-number-in-infinite-set.cpp | class SmallestInfiniteSet {
//We use counter cur so we do not have to track all numbers in the set. We only use set to track added back numbers.
public:
int cur = 1;
set<int> added;
int popSmallest() {
if (!added.empty()) {
int res = *begin(added);
added.erase(begin(adde... | ALGO | 0.998671 | 5.812512 |
63a6633f-9618-4d2d-9b3e-06453273f68d | rsk9607/MY-PRATICE | Range Sum (1).cpp | #include<iostream>
using namespace std;
int main(){
long long t;
cin>>t;
while(t>0){
t--;
int a;
long b;
cin>>a>>b;
long long k;
k=long long((b*(b+1))/2)-(((a-1)*a)/2);
cout<<k<<endl;
}
return 0;
} | ALGO | 0.998889 | 4.040117 |
a96fb26a-5e8b-4016-b826-b18e6784afd5 | Elviexe/CPE | 1star/13.a012. 10055 – Hashmat the Brave Warrior.cpp | //cpe 13
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
long long int a,b;
while(cin>>a>>b)
{
cout << abs(a-b)<<endl;
}
}
| ALGO | 0.998244 | 3.080985 |
35d87347-7386-411a-9185-8644f17d4180 | Akhil960641/bloc-test-App | StudioProjects/pranavam_customer/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.996665 | 6.76073 |
99e7d66a-b05b-44fa-a13c-7ccceba8bd3f | raincross7/code-similarity | codes/train_code/problem114/problem114_217.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
int main()
{
int N;
int cnt = 0;
cin >> N;
vector<int> a(N);
rep(i, 0, N)
{
cin >> a[i];
}
rep(i, 0, N)
{
if (i == a[a[i] - 1] - 1)
{
... | ALGO | 0.999891 | 4.14863 |
e8cd3531-2ac4-47e7-8b60-2eec3698fced | allanmax/a_jsoncpp_android | jsoncpp/src/jsontestrunner/main.cpp | /* This executable is used for testing parser/writer using real JSON files.
*/
#include <json/json.h>
#include <algorithm> // sort
#include <stdio.h>
#if defined(_MSC_VER) && _MSC_VER >= 1310
#pragma warning(disable : 4996) // disable fopen deprecation warning
#endif
static std::string normalizeFloatingPointStr(dou... | TEST | 0.881128 | 6.969632 |
ec0c00d4-3ca2-494d-9d56-a453269819a8 | AshishRangra/vscodefile | countdistincteleofwindowk.cpp | #include<iostream>
#include<unordered_map>
using namespace std;
void count(int a[],int n,int k){
unordered_map<int,int>map;
int count=0;
for(int i=0;i<k;i++){
if(map[a[i]]==0){
count++;
}
map[a[i]]+=1;
}
cout<<count<<endl;
for(int i=k;i<n;i++){
... | ALGO | 0.99988 | 3.90981 |
17263998-250b-4af5-adfa-85a2df248096 | t1jsh111/ParityGameSolver | gameAlgorithms/src/FixedOrdering.cpp | //
// Created by s164009 on 3-1-2022.
//
#include "FixedOrdering.h"
#include "Node.h"
#include <random>
#include <algorithm>
#include <iostream>
std::vector<std::shared_ptr<Node>> FixedOrdering::inputOrder(const std::vector<std::shared_ptr<Node>> nodes) {
return nodes;
}
std::vector<std::shared_ptr<Node>> Fixed... | ALGO | 0.999799 | 6.031082 |
f321cd4a-f9b7-4528-9272-35ed186acaf1 | ag-wnl/usaco | silver/max_sumarray_sum.cpp | #include<bits/stdc++.h>
using namespace std;
//https://cses.fi/problemset/task/1643
#define ff first
#define ss second
#define ll long long
#define zerobits(x) __builtin_ctzll(x)
#define setbits(x) __builtin_popcountll(x)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define vi vector<int>
#define inve... | ALGO | 0.999968 | 4.146339 |
0ad13717-86cc-4fd7-9929-0b7c3e07f283 | kupian/monte-carlo | boost_1_82_0/libs/thread/example/shared_monitor.cpp | #include <iostream>
#include <boost/thread/mutex.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <boost/thread/lock_algorithms.hpp>
#include <boost/thread/thread_only.hpp>
#if defined BOOST_THREAD_DONT_USE_CHRONO
#include <boost/chrono/chrono_io.hpp>
#endif
#include <cassert>
#include <vector>
#define EXCLUSIVE... | TEST | 0.938503 | 5.465959 |
7d1780be-9659-4861-b3a1-6fca9a505071 | rathoresrikant/interviewbit | Strings/matrix_permutations.cpp | /*
Matrix Permutation
Given a matrix of integers A of size N x N.Find whether all rows are circular rotations of each other or not. Return "YES",if all rows of A are circular rotations of each other, else return "NO". Note: Rows are numbered from top to bottom and columns are numbered from left to right.
Input Format
T... | ALGO | 0.999948 | 4.758219 |
8e1a2fb8-ca33-4907-8c2e-5e6dbb954665 | Tomcruseal/dImageProcessor | include/boost_1_77_0/libs/graph_parallel/test/distributed_rmat_pagerank.cpp | // Authors: Brian Barrett
// Nick Edmonds
// Andrew Lumsdaine
#include <boost/graph/use_mpi.hpp>
#include <boost/config.hpp>
#include <boost/throw_exception.hpp>
#include <boost/graph/distributed/adjacency_list.hpp>
#include <boost/graph/distributed/compressed_sparse_row_graph.hpp>
#include <boost... | ALGO | 0.993833 | 5.563242 |
39efe867-c9f2-4410-a49f-8d20a5739de0 | KartikKhariwal/CODING-NINJAS | 13.Dynamic Programming1/Alyona and spreadsheet.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,m,k;
cin>>n>>m;
vector< vector<int> > v(n,vector<int>(m)),dp(n,vector<int>(m,0));//this dp stores consecutive increasing seq indexes
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
cin>>v[i][j];
}
}
for(int... | ALGO | 0.999966 | 3.603693 |
4ef7f478-5790-4ece-984a-ef32301fd925 | aryans2003/Data-Structures-CS-225 | mp_schedule/src/schedule.cpp | /**
* @file schedule.cpp
* Exam scheduling using graph coloring
*/
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <string>
#include "schedule.h"
#include "utils.h"
#include <algorithm>
#include <fstream>
#include <vect... | ALGO | 0.931808 | 5.485398 |
66631bf3-1cdc-4cc6-8720-1b9bf395b061 | JeetGupta2506/LeetCode | 0160-intersection-of-two-linked-lists/0160-intersection-of-two-linked-lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
ListNode* temp1=headA,*temp2=headB;
int a=0,b=0;
... | ALGO | 0.999949 | 5.395449 |
db1eb631-b682-463f-b5ec-88d7e4c967a1 | min1902z/C-Level-up | Assignment1/Q2.cpp | #include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int n,i,j,s;
cout << "Enter n: ";
cin >> n;
for(i = 1; i <= n; i++){
for(j = i; j < n; j++)
cout << " ";
for(s = 1; s <= (2*i -1); s+... | ALGO | 0.99927 | 3.212975 |
2d039c10-5e32-48b5-917e-2167cf4a4b88 | Rohansejwal64/DSA-GFG | Difficulty: Easy/Binary Tree Representation/binary-tree-representation.cpp | // User function Template for C++
/*struct node {
int data;
struct node *left;
struct node *right;
};
struct node *newNode(int data) {
struct node *node = (struct node *)malloc(sizeof(struct node));
node->data = data;
node->left = NULL;
node->right = NULL;
return (node);
}*/
class Solution {
publ... | ALGO | 0.999871 | 5.621958 |
c325d8aa-7eca-4d11-bc19-584264642893 | Hitansh1G/Code_forces | Odd Subarrays.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<stack>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<unordered_map>
#include<unordered_set>
#define Fast ios_base::sync_with_stdio(false); cin.tie(NULL);
typedef lo... | ALGO | 0.999228 | 4.436622 |
b15822db-76bb-43a6-b91d-99326f130ce6 | Ksawery4567/Programowanie-2D-grupa-2-2025-2026 | ArrayConsoleApplication/ArrayConsoleApplication.cpp | // ArrayConsoleApplication.cpp
#include <iostream>
// Napisz program, który wczyta np. 5 liczb
// a następnie wyświetli je w odwrotnej kolejności.
void task1()
{
/*
int number0, number1, number2, number3;
std::cout << "Podaj 1 liczbę\n";
std::cin >> number0;
std::cout << "Podaj 2 liczbę\n";
std::cin >> numbe... | ALGO | 0.992611 | 3.747772 |
6ef9a7fd-4ae9-4d3f-a365-8b2a19e5dbb2 | elixir67/Sandbox | C++/Questions/54_8Queens/54_8Queens.cpp | // 54_8Queens.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <vector>
#include <math.h>
#include <iostream>
using namespace std;
bool isConflict(const vector<int> & states, int nextX)
{
int nextY = states.size();
for(auto i = 0; i < nextY; ++i)
{
if(abs(nextX - states[... | ALGO | 0.999732 | 4.89243 |
1497e462-b49c-46bb-81b9-ba2288658d7b | tsh-xx/folio100_frameworks_base | tools/localize/ValuesFile.cpp | #include "ValuesFile.h"
#include "XMLHandler.h"
#include <algorithm>
#include <fcntl.h>
#include <expat.h>
#include <unistd.h>
#include <errno.h>
using namespace std;
const char* const ANDROID_XMLNS = "http://schemas.android.com/apk/res/android";
const char* const XLIFF_XMLNS = "urn:oasis:names:tc:xliff:document:1.... | TOOL | 0.892374 | 5.320488 |
2585f66f-9227-4e9f-9ec0-351a3c0f2e5b | u-noob-i/contest | Codeforces/882 div2/A.cpp | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <queue>
#include <climits>
#include <sstream>
#include <tuple>
#include <iomanip>
using namespace std;
int n, m, i, j, k;
string s;
long long M = ... | ALGO | 0.99981 | 4.45516 |
9672932d-bdb3-467f-a8cb-6b261d7d2041 | mnsccoin/src | src/policy/fees.cpp | #include "policy/fees.h"
#include "policy/policy.h"
#include "amount.h"
#include "primitives/transaction.h"
#include "streams.h"
#include "txmempool.h"
#include "util.h"
void TxConfirmStats::Initialize(std::vector<double>& defaultBuckets,
unsigned int maxConfirms, double _decay)
{
... | ALGO | 0.932564 | 6.03512 |
9191ac96-a279-4e44-b28f-a300b7ce9145 | ib13/Coding-Practice | Coding Ninjas/A10/A10-5.cpp | #include <cmath>
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
#define modval (1000000007)
int countBST(int n)
{
int arr[n + 1] = {0};
arr[0] = 1;
arr[1] = 1;
for (int i = 2; i <= n; i++)
{
int count = 0;
for (int j = 1; j <= i; j++)
{
... | ALGO | 0.999989 | 5.016448 |
87d92372-5b6d-4335-91eb-f5c54862af90 | Khairul-Anam-Mubin/UVa-Solutions | 10738 - Riemann vs Mertens.cpp | /***
** Author: Khairul Anam Mubin
** Bangladesh University of Business and Technology,
** Dept. of CSE.
***/
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <iterator>
#include <vector>
#include <map>
#include <s... | ALGO | 0.999378 | 3.229 |
006501a3-03a8-44c3-9dfb-86621897831c | ishandutta2007/codeforces | okwedook/normal/1553/D.cpp | #pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("sse4.2")
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <sstream>
#include <deque>
... | ALGO | 0.999601 | 4.436345 |
a0802e47-9e36-4c74-af6d-b79996b8a940 | koicy-ly/koicy-ly.github.io | assets/code/CF1077A.cpp | #include <iostream>
using namespace std;
using tp = intmax_t;
signed main() {
tp t;
cin >> t;
while (t--) {
tp a, b, k;
cin >> a >> b >> k;
cout << (k >> 1) * (a - b) + (k & 1) * a << '\n';
}
return 0;
} | ALGO | 0.999735 | 4.111091 |
7a06217b-aca7-4de9-a68a-90b37f1a9552 | gulcemehmet/first-flutter-project | 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.99887 | 6.783439 |
4a80c16b-e7ab-4ad1-a220-5057ba535d28 | kanaryayi/Stereo-Reconstruction-22S | FivePoint.cpp | #include "FivePoint.h"
FivePointExecuter::FivePointExecuter(std::pair<KeyPoints, KeyPoints> setPair, ImagePair sample) {
std::cout << "FivePointExecuter >> Initialization Start." << std::endl;
assert(setPair.first.size() == setPair.second.size());
m_numPoint = setPair.first.size();
m_pointSet1 = setPair.first;
m... | ALGO | 0.996237 | 5.733287 |
1336a97d-c59d-4abd-9a87-17c249c397a1 | Oracynx/Source-Code | Contest/AtCoder/ABC380/E.cpp | #include <cstdio>
#include <set>
#include <tuple>
constexpr int MaxN = 5e5 + 5;
int n, q;
int cnt[MaxN];
std::set<std::tuple<int, int, int>> set;
int main()
{
scanf("%d%d", &n, &q);
for (int i = 1; i <= n; i++)
{
set.insert({i, i, i});
cnt[i] = 1;
}
for (int i = 1; i <= q; i++)
{... | ALGO | 0.999311 | 4.104935 |
05e572e7-c1e8-4e1f-8d2b-ac50e99731ca | hiberabyss/LeetCode | cpp/1512.number-of-good-pairs.cpp | /*
* @lc app=leetcode.cn id=1512 lang=cpp
*
* [1512] 设计地铁系统
*
* https://leetcode-cn.com/problems/number-of-good-pairs/description/
*
* algorithms
* Easy (85.02%)
* Total Accepted: 37.6K
* Total Submissions: 44.2K
* Testcase Example: '[1,2,3,1,1,3]'
*
* 给你一个整数数组 nums 。
*
* 如果一组数字 (i,j) 满足 nums[i] == ... | ALGO | 0.999892 | 5.743283 |
9201f2aa-7af9-43f4-b450-7ed4a8c8b851 | yuruofeifei/Interview | leetcode/RemoveNthNodeFromEndOfList.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
/*ListNode *remove(ListNode *head, int n, int &i) {
if (head == 0) {
i = 0;
return NULL;
}
... | ALGO | 0.999995 | 5.80518 |
21668037-aaf4-460b-9a2c-432b2e9786f7 | looyer/idiscover | learning/leetcode/problem-6364-mouse-cheese.cpp | #include <cstdlib>
#include <cstring>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <algorithm>
#include <memory>
#include <string>
using namespace std;
//
class Solution {
publi... | ALGO | 0.999939 | 4.203939 |
b702e3da-fb14-4183-90a4-9f6b696c5a89 | TomasMerva/Panda_LGP | panda_motion_planning/src/komo.cpp | #include <ros/ros.h>
#include <sensor_msgs/JointState.h>
#include <panda_gazebo_controllers/JointPosition.h>
#include <panda_motion_planning/komo_lib.h>
#include <gnuplot_module/gnuplot_module.h>
std::vector<double> q_start(7);
void JointStateCallback(const sensor_msgs::JointStateConstPtr& msg)
{
for (int idx=0;... | TOOL | 0.897832 | 5.762792 |
a428e4c4-6c0c-4ac0-bc0d-713dbf923f10 | Code-N-Code/competitive_programming_course | CSES/CPP solutions/Company Queries II.cpp | #include<bits/stdc++.h>
#define REP(i,n) for (int i = 1; i <= n; i++)
#define mod 1000000007
#define pb push_back
#define ff first
#define ss second
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<ii>
#define lli long long int
#define INF 1000000000
#define endl '\n'
const double PI = 3.1415926535897... | ALGO | 0.999978 | 4.316866 |
cb780fc0-09bb-4999-b20f-7e4c35e6d63c | kedidoima/CTDL-GT | fixbai/bai8 (ct7).cpp | #include<iostream>
#include<stack>
#include<string>
using namespace std;
void solve(string s){
stack <char> st;
stack <char> tmp;
int n = s.length();
int i = n-1;
char dau;
while(i>=0) {
if(s[i] != '('){
st.push(s[i]);
}
else if(s[i] == '('){
cha... | ALGO | 0.999812 | 4.470828 |
bf93e45a-687b-4cd4-bc0b-58b02f0385d6 | vaishnavi2699/CPP-Logical-programs | 1914 strong.cpp | #include<iostream>
using namespace std;
void strong()
{
int num,rem,fact=1,sum=0,temp;
cout<<"enter number to find strong number or not: ";
cin>>num;
temp=num;
while(num!=0)
{
rem=num%10;
while(rem>=1)
{
fact=fact*rem;
rem--;
}
sum=sum+fact;
fact=1;
num=num/10;
}
if(sum==temp)
{
cout<<"st... | ALGO | 0.999925 | 3.774219 |
dacc34d0-2e97-4625-a991-ed3db211830c | sage26Ayano/competitive-programming | codechef/Total_Score.cpp | #include <bits/stdc++.h>
using namespace std;
#define speedio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tlp int tc; cin >> tc; while (tc--)
#define rep(i, a, b) for(int i = a; i < b; ++i)
#define sp ' '
#define nl '\n'
#define newline cout << '\n'
#define ll long long int
#define vi vector <int>
#defin... | ALGO | 0.999801 | 4.025694 |
ef4ec6a4-e012-4c1d-acae-9131494d0b2f | lewissbaker/llvm | libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter>
// requires ShuffleIterator<Iter>
// && LessThanComparable<Iter::value_type>
// void
// push_heap(Iter first, Iter last);
#include <algorithm>
#include <random>
#include <cassert>
std::mt19937 randomness;
void test(int N)
{
int* ia = new int [N... | TEST | 0.992571 | 5.025942 |
26e0825e-9544-4bd7-bf43-6402459ea3e1 | thisizaro/Lab | d4/q2.cpp | // Write a program to represent the polynomial equation of a single variable using a single linked list and perform the addition of two polynomial equations
#include <bits/stdc++.h>
int main()
{
} | ALGO | 0.998397 | 3.95454 |
9734b571-8487-4e7c-9b06-8e2826b8dae5 | W0nee/Coding_Test | Baekjoon/Backtracking/2661-좋은수열/B2661.cpp | #include <stdio.h>
#include <iostream>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <string.h>
#include <vector>
#include <algorithm>
using namespace std;
int N;
int arr[100];
bool Flag = false;
int check(int cnt)
{
for(int k = 2; k <= cnt/2; k++)
{
int forCnt = 0;
int sameCnt = 0... | ALGO | 0.999976 | 3.527499 |
29b8b27c-0aa7-4346-a067-3f19d1f2f0f7 | Franch-Toast/Daily-algorithm-training | Source/240.搜索二维矩阵-ii.cpp | /*
* @lc app=leetcode.cn id=240 lang=cpp
*
* [240] 搜索二维矩阵 II
*/
// @lc code=start
#include "vector"
using namespace std;
class Solution
{
public:
bool searchMatrix(vector<vector<int>> &matrix, int target)
{
int row = matrix.size();
int col = matrix[0].size();
int i = 0, j = col - ... | ALGO | 0.999884 | 6.540298 |
3e6e310e-0723-4dac-aa66-111966edf48d | tec-csf/TC2017-T3-Otono-2019-danielroa98 | Camionero.cpp | /*
* El Camionero con Prisa
* Daniel Roa
* A01021960
* Entrega: 4 de octubre del 2019
*
* Complejidad del algoritmo: O(n)
*
* Este algoritmo fue obtenido de: https://www.geeksforgeeks.org/number-of-refills-to-complete-the-journey-of-n-km/
*
* La solución a este problema se realizó utilizando programaci... | ALGO | 0.999897 | 4.165968 |
e07889af-3b03-416c-8c4a-cd31ceaf0ae5 | ishandutta2007/codeforces | timsei/normal/601/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
const int M = N * 2;
int ch[N][26], n, m, x, y, sz, c[N], dep[N], fir[N], ne[M], to[M], cnt, Si[N], S[N];
char s[N];
void add(int x, int y) {
ne[++ cnt] = fir[x];
fir[x] = cnt;
to[cnt] = y;
}
void link(int x, int y) {
add(x, y); add(y, x);... | ALGO | 0.999934 | 3.746014 |
fd690143-9a22-4eec-b428-739cca756aa0 | ishandutta2007/codeforces | avinashkartik/normal/1612/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define GODSPEED ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(15);
#define f first
#define s second
#define newl cout<<"\n";
#define pb push_back
#define mset(a,x) memset(a,x... | ALGO | 0.999927 | 4.844837 |
93644702-5616-4913-92d1-c7c26061c603 | kangsw1025/TIL | SolveProblem/20/20.11/20_11_10/201110_3184_양.cpp | #include<iostream>
#include<queue>
using namespace std;
int sheep, fox;
char arr[251][251];
bool check[251][251];
int x, y;
int n_x[4] = { 0,1,0,-1 };
int n_y[4] = { 1,0,-1,0 };
void solve(int w, int h) {
check[w][h] = true;
int sh = 0, fo = 0;
queue<pair<int, int>> q;
q.push({ w,h });
while (!q.empty()) {
... | ALGO | 0.999667 | 4.487776 |
7d2e922b-269b-4c4a-b195-29b9b1aa3ad3 | rogi-bogi/IMS-Projekt | src/main.cpp | #include <iostream>
#include <opencv2/highgui.hpp>
#include "helpers.hpp"
#include "image_processing.hpp"
#include "wavelets.hpp"
/*
TODO: cv::butterworthFilter or cv::chebyshevFilter ??
TODO: Make some console program logic:
* Image as path argument - for different images
... | TOOL | 0.988235 | 4.737991 |
324ab3ef-8c7a-42dd-9aa7-1c7d503d9313 | ARsenic100/Competetive-Programming-X-DSA | GFG/Dynamic Programming/2_Minimal_Cost_FrogJumpKdist.cpp | //https://www.geeksforgeeks.org/problems/minimal-cost/0?ref=gcse_ind
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int minimizeCost(int k, vector<int>& arr) {
// Code here
int n= arr.size();
vector<int> dp(n, -1);
return f(arr , n-1 , dp , k);
... | ALGO | 0.999933 | 5.527177 |
5f9a7634-71b1-4d4b-9623-b9fe6ff512a5 | AnonMiraj/Competitive-solving | Virtual Judge/bug-contest-1/E - Fedor and New Game.cpp | // ﷽
// Contest: contest-1
// Judge: Virtual Judge
// URL: https://vjudge.net/contest/609578#problem/E
// Memory Limit: 256
// Time Limit: 1000
// Start: Mon 12 Feb 2024 06:17:24 PM UTC
//
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <iomanip>
... | ALGO | 0.999746 | 4.404826 |
9ed5fef7-44de-4aae-8206-02d0bb5ff160 | ishandutta2007/codeforces | acrush/normal/1466/E.cpp | #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <bits/stdc++.h>
using namespace std;
#define POW2(X) (1LL<<(X))
#define CKBIT(S,X) (((S)&POW2(X))!=0)
const double pi=acos(-1.0);
const double eps=1e-11;
template<class T> inline void ckmin(T &a,T b){ a=min(a,b); }
template<class T> inline void ckmax(T ... | ALGO | 0.999346 | 4.186422 |
49cd2c4e-7b58-46b0-a4c9-b58524a1860f | mahmudulhaquequdrati/XPSC | week2/Day2/K_Cumulative_Sum_Query.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int ar[n];
for (int i = 0; i < n; i++)
{
cin >> ar[i];
}
int pre[n];
pre[0] = ar[0];
for (int i = 1; i < n; i++)
{
pre[i] = pre[i - 1] + ar[i];
}
int t;
cin >> t;
while... | ALGO | 0.99985 | 4.225338 |
ce16610a-1b95-4449-88bc-67d6b3b84826 | thearpitanand/Data-Structures-and-Algorithms-in-cpp | Recursion/03_Power.cpp | #include <bits/stdc++.h>
using namespace std;
int pow(int n, int power)
{
// Base Case
if (power == 0)
return 1;
// pow(n, power - 1) is a recursive case
// Calculation
return n * pow(n, power - 1);
}
int main()
{
cout << "5 ^ 0 = " << pow(5, 0) << endl;
cout << "5 ^ 1 = " << pow(... | ALGO | 0.999212 | 5.430618 |
76bb53e9-77f6-4afd-9e66-2dd3072ecbbd | pratikac/pomdp | sarsop/src/Parser/Cassandra/POMDP.cpp | /********** tell emacs we use -*- c++ -*- style comments *******************
$Revision: 2.28 $ $Author: duyanzhu $ $Date: 2009/01/07 05:10:04 $
@file POMDP.cc
@brief No brief
Copyright (c) 2002-2005, Trey Smith. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may
not u... | ALGO | 0.927707 | 5.250719 |
427b49e6-19c9-4b02-b3cb-017ac49691b1 | Gamer64ytb/DroidSX2 | app/src/main/cpp/pcsx2/SPU2/ADSR.cpp | #include "PrecompiledHeader.h"
#include "Global.h"
static const s32 ADSR_MAX_VOL = 0x7fffffff;
static const int InvExpOffsets[] = {0, 4, 6, 8, 9, 10, 11, 12};
static u32 PsxRates[160];
void InitADSR() // INIT ADSR
{
for (int i = 0; i < (32 + 128); ++i)
{
int shift = (i - 32) >> 2;
s64 rate = (i & 3) + 4;
if ... | TOOL | 0.951172 | 5.209781 |
d2bbdb4d-23f0-4716-aa63-4cb6703cc04d | rickyqin005/DMOJ-Solutions | main/segtree 12.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> struct segment_tree {
const T INF = ((T)1<<(8*sizeof(T)-1))-1;
int N = 0,minp = 0,L,R;
vector<T> st;
void set_range(int n) {
N = n; minp = (1 << (31-__builtin_clz((N-1) << 1)));
}
segment_tree(int n) {
... | ALGO | 0.999929 | 4.200574 |
61962590-16f1-4996-b92d-cc00417ad921 | 97joseph/C_Algortihms | Assignments-421a7280ff809a15ded9dd4246a21afaef4eebdd (1)/Assignments-421a7280ff809a15ded9dd4246a21afaef4eebdd/Object-oriented programming methodologies in Cpp/a3_2.cpp | /*
Name: Dillon Pinto
Class: CS 2A
Date: 6/9/2016
File name: a3_2.cpp (assignment 3, part 2)
Description: This program uses decsision
control flow including else-if
statements to handle several cases of
decsision making. The objective is to determine what
stage of education the user has completed d... | TOOL | 0.904931 | 3.793873 |
46a1e306-c5fc-49dd-bdf0-f3162603b721 | ankurgupta255/Data-Structure-and-Algorithms | BinarySearch.cpp | #include<iostream>
using namespace std;
int main(){
int a[100]={};
int n=0;
cout<<"Enter the size of array: ";
cin>>n;
cout<<"Enter the array Elements: ";
for(int i=0;i<n;i++){
cin>>a[i];
}
int el=0;
cout<<"Enter the element to be found: ";
cin>>el;
int med=0;
int beg=0;
int end=n;
int flag=0;
whi... | ALGO | 0.999105 | 4.111503 |
dac3a8d8-f374-4e20-9f03-b51c819e7425 | malvinval/leetcode-answers | easy/30-longest-common-prefix/app.cpp | #include <iostream>
#include <string>
#include <vector>
std::string longestCommonPrefix(std::vector<std::string>& strs) {
if (strs.size() == 1) return strs[0];
if (strs.empty()) return "";
std::string commonprefix {""};
/**
* i is used to handle only first string element in strs vector
* j ... | ALGO | 0.997006 | 5.667925 |
62ea8be9-aa12-4d18-8bb2-c0bd8fe0938d | chifangg/freshman_programming | codes/13410.cpp | #include"function.h"
int hash(block* b)
{
int res=0;
//H(B) = (((sum(all transaction money in block B))2 ⊕ link(B)) + link(B)2) % 1000 + 1
res=b->t[0].val+b->t[1].val;
res=res*res;
res=res^b->link;
res=res+b->link*b->link;
res=res%1000+1;
return res;
}
// TODO: create a block with the given information and ret... | ALGO | 0.900838 | 3.101562 |
6dd96492-65bd-4875-878e-53767f5d385d | Himanshu962005/C-Plus-Plus-Code-College. | Main34.cpp | // Write a C++ program to find sum of 2 numbers with different sets using function overloading.
#include <iostream>
#include <conio.h>
using namespace std;
void Sum(int A, int B)
{
int S = A + B;
cout << "\nSum of two interger numbers = " << S;
}
void Sum(float A, float B)
{
float S = A + B;
cout << "\n... | ALGO | 0.989459 | 4.470609 |
2a263aae-b38e-41ce-b1e1-a699359fd039 | Santosh276124/LeetCode-Solutions | Rat in a Maze Problem - I - GFG/rat-in-a-maze-problem-i.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:
bool isValid(int i, int j, int n, vector<vector<int>> &mat){
if(i < 0 || i >= n || j < 0 || j >= n || mat[i][j] == 0)
... | ALGO | 0.999887 | 6.461954 |
2afee85c-b39c-4718-a26f-2025ce375dc5 | coin-or/DyLP | examples/odsi+dylp.cpp | /*
This file contains a main program and support routines sufficient to build
a stand-alone lp solver using dylp working through OsiDylpSolverInterface.
After processing any command line options, the program will deal with the
.spc file, if specified, then call ODSI::readMps to read the MPS file.
ODSI::ini... | TOOL | 0.855972 | 6.515963 |
78c549f7-79c9-4f84-a3dd-3c6c65e9c26f | cleuton/hogcomparator | cplusplus/dlib/filtering/kalman_filter.cpp | #include "kalman_filter.h"
#include "../global_optimization.h"
#include "../statistics.h"
namespace dlib
{
// ----------------------------------------------------------------------------------------
momentum_filter find_optimal_momentum_filter (
const std::vector<std::vector<double>>& sequences,
... | ALGO | 0.99752 | 7.223012 |
64d626d9-5de0-48c5-8056-0b48f599f0d0 | thesaravanakumar/projecteuler | 12-Highlydivisibletriangularnumber.cpp | #include <bits/stdc++.h>
#define ll long long int
#define w(t) int t; cin>>t; while(t--)
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mii map<int,int>
#defin... | ALGO | 0.999354 | 3.951064 |
10190b74-d456-49de-9e99-da28b838d51f | The-Jay-Aher/Placement | Practice/Strivers A2ZDSA Course/Step - 1/Step - 1.6/code.cpp | #include <bits/stdc++.h>
using namespace std;
bool comp(pair<int, int> a, pair<int, int> b)
{
return a.second < b.second;
}
void findFrequency(vector<int> arr)
{
unordered_map<int, int> map;
for (int i = 0; i < arr.size(); i++)
{
map[arr[i]]++;
}
for (auto x : map)
{
cout ... | ALGO | 0.999912 | 5.080972 |
07fecae4-1e05-4109-8be2-170e846aa4f2 | amazur03/design-and-analysis-of-algorithms | project2/BucketSort.cpp | #include "BucketSort.hpp"
#include <iostream>
void BucketSort::sort() {
bucketSort();
}
void BucketSort::show() {
std::cout << "Bucket sort data:\n";
Upload::show();
}
void BucketSort::bucketSort() {
// Find the maximum grade to determine the range of buckets
int maxGrade = 0;
for (int i = 0;... | ALGO | 0.998959 | 5.366815 |
a9de723f-02c7-4d3a-a27e-6732baff20c4 | ishandutta2007/codeforces | halyavin/normal/873/A.cpp | #ifdef __GNUC__
#pragma GCC target("sse4,avx")
#endif
#include <immintrin.h>
#include <algorithm>
#include <string>
#include <iostream>
#include <vector>
#include <cstdint>
#include <numeric>
void run(std::istream &in, std::ostream &out) {
int n, k, x;
in >> n >> k >> x;
std::vector<int> as(n);
for (in... | ALGO | 0.999749 | 3.978145 |
2616ab73-8901-4bc5-b8fa-82640b549e9d | deepdarshan21/leetcode-solutions | 45. Jump Game II/DP(Memorization).cpp | #include <bits/stdc++.h>
using namespace std;
/*
Approach: Memorization on recursion
Edge Cases:
Time Complexity: O(n^2) Space: O(n)
Status: Accepted
Runtime: 877 ms faster than: 19.27%
Memory Usage: 18.4 MB less than: 6.40%
Remarks:
*/
class Solution {
public:
int jump(vector<int> &nums... | ALGO | 0.999986 | 5.284305 |
8fdecc0b-aa5e-482c-890c-6f60d0adaab1 | ibrahimhabibeg/codeforces | problems/1728/D/sol.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
string s;
int main(){
int TC;
cin >> TC;
while (TC--)
{
cin >> s;
int n = s.length(), dp[n][n];
for (int i = 0; i < n-1; i++){
if(s[i]==s[i+1]) dp[i][i+1] = 1;
else dp[i][i+1] = 2;
}
for (int L = 4; L <= n; L+=... | ALGO | 0.999886 | 4.174977 |
f6487353-8087-429b-9d59-31905d3fe1b2 | siddiqui-zeeshan/Leetcode | Code/Predict the Winner.cpp | class Solution {
public:
int dfs(vector<int> &nums, int r, int l, int turn) {
if(l == r)
{
return nums[l] * turn;
}
int a = turn * nums[l] + dfs(nums, r, l + 1, -turn);
int b = turn * nums[r] + dfs(nums, r - 1, l, -turn);
return turn * max(turn * ... | ALGO | 0.999997 | 5.630235 |
1b87bbb0-70d3-423a-b90d-8df7e324b0aa | Csehyoung/Algorithm | 10797_10부제.cpp | #include <iostream>
using namespace std;
int main()
{
int D;
int car;
cin >> D;
int count = 0;
for (int i = 0; i < 5; i++)
{
cin >> car;
if (D == car)
count++;
}
cout << count << endl;
} | ALGO | 0.997683 | 3.64673 |
c00e5fea-f795-4539-b42c-cad9e8706035 | cooluks2/iot | 02.device/c++/chapter3/ex_05_2_array_func.cpp | #include <iostream>
using namespace std;
// int array[] = {1, 2, 3, ...};
void initArray(int array[], int size, int value = 0) {
for(int i=0; i < size; i++) {
array[i] = value;
}
}
// 배열1 = 배열2; // 값 복사 x --> 배열은 call by value가 안됨.
void printArray(int array[],int size) {
for(int i=0; i < size; i... | TOOL | 0.91129 | 4.376069 |
d4ea8f60-5918-46d3-884e-828013ac09df | webdeveloper4gupta/c-basic-level | template/multiple_template_function.cpp | #include<iostream>
using namespace std;
template<class t>
t add(t a,t b){
return a+b;
}
template<class t>// we can also give declaration
t sub(t a,t b){
return abs(a-b) ;//abs used as mod function in c++;
}
template<class t,class t1>
void display(t a,t1 b){
cout<<a<<" "<<b<<endl;
}
int main()
{
int a,b;... | ALGO | 0.996678 | 3.617624 |
dab033de-aed4-441f-9933-da43b48ed3b2 | Casanova-Licence/Havannah | Havannah/src/Plateau.cpp | #include "../include/Plateau.h"
using namespace std;
Plateau::Plateau() {
pair<int, int> ptmp;
N=4; //Taille
T=new int *[(N*2)-1];
for (int i=0; i<(N*2)-1; i++) {
T[i]=new int [(N*2)-1];
for (int j=0; j<(N*2)-1; j++) {
if (j>=N+i || j<=i-N)
{
T[i][j]=-1; //Les cases en dehors dé l'hexagone sort à ... | ALGO | 0.997621 | 3.185526 |
45699b34-236d-4ae2-898b-fa1f968c258c | ishandutta2007/codeforces | jhin/normal/1382/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int mod=998244353;
vector<long long> p;
int ho,mi,se,ho1,mi1,cnt;
void fix_time()
{ if(se>59)mi+=se/60,se=se%60;if(se<0)se+=60,mi--;
if(mi>59)ho+=mi/60,mi=mi%60;if(mi<0)mi+=60,ho--;
if(ho<0)h... | ALGO | 0.999972 | 4.774592 |
b017e4d1-74dc-41f0-8c4e-442b9a5154cc | oeddyo/algorithm | tc/srm197_div2/1000.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | ALGO | 0.99987 | 4.896425 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.