uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
2aa6e895-f32a-4e18-812b-2c57ae92dd80 | siddhant139/Coding | binaryexponential.cpp |
#include<bits/stdc++.h>
using namespace std;
const int M=1e9+7 ;
int binExpRecur(int a, int b){
if (b==0) return 1;
long long res = binExpRecur(a, b / 2);
if (b&1){
return (a*(res * res )% M) % M;
}
else{
return (res * res) % M;
}
}
// x power n
int binExp(int64_t x,int64_t n... | ALGO | 0.999871 | 3.520973 |
3d20ff60-8f38-407b-af0e-85447e009538 | gnobisP/beecrowd | URI/bee2293.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 105;
vector<vector<int>> M(MAX, vector<int>(MAX));
int main()
{
int qLinha, qColuna;
cin >> qLinha >> qColuna;
for (int i = 0; i < qLinha; i++)
{
for (int j = 0; j < qColuna; j++)
{
cin >> M[i][j];
}
... | ALGO | 0.999633 | 4.336596 |
3b2ec03e-48ce-4374-81e2-bff42aa5878d | sourav600/Problem-Solving | Codeforces/1797B.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long ulong;
#define nl '\n'
#define For(i,n) for(int i=0; i<n; i++)
#define vi vector<int>
#define vs vector<string>
#define vl vector<ll>
#define mi map<int,int>
#define umi unordered_map<int,int>
#define pb(x) push_back(x)
#define pi ... | ALGO | 0.999946 | 3.753692 |
49bd29ba-87cc-4ef9-8874-5e37b076a265 | angelf25/ejerciciosclsefunda-06-05-24 | main.cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run a... | ALGO | 0.997235 | 3.67867 |
6aca2bda-7016-4f4c-bcd6-2e7a26ee0834 | Leodicap99/leetcode | Dynamic Programming/139. Word Break.cpp | /*
The way we are going to tackle this problem is by first checking each substring is present in the dictionary or not.
We should make sure no substring overlap occurs thats why we will be using dp here.
We also have to make sure if the full string is partioned or not.
*/
bool wordBreak(string s, vector<string>& wo... | ALGO | 0.999558 | 6.192459 |
aeb088b6-81d6-4621-aef6-fff6860d2330 | CSUBioGroup/MMCT-Loop | scripts/bedpe_merge.cpp | #include <bits/stdc++.h>
using namespace std;typedef long long ll;typedef pair<int,int> pii;
template<class orz>inline void read(orz &x){x=0;bool f=0;char ch=getchar();while(ch<'0'||ch>'9')(ch=='-')&&(f=1),ch=getchar();while(ch>='0'&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();f&&(x=-x);}
template<class orz>inline voi... | ALGO | 0.998106 | 3.961701 |
7248f39c-dbc7-4b17-bef2-9400276ab215 | Dasti-dev/DSA_codes | 5. Left rotate an array by one place.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
int main() {
vector<int> v = {3, 3, 5, 7, 9, 9, 11, 13, 13, 17, 17, 19, 22, 22, 14, 9, 4};
sort(v.begin(),v.end());
// print array
for(int i = 0 ; i < v.size() ; i++)
{
cout << v[i] << " ";... | ALGO | 0.999942 | 4.225471 |
ddda191b-8440-45ae-a609-76aac74cbc7c | nowhash/OnlineJudge_problems | Codeforces/PetyaAndStrings.cpp | #include <bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
string str1,str2;
cin>>str1>>str2;
transform(str1.begin(),str1.end(),str1.begin(),::tolower);
transform(str2.begin(),str2.end(),str2.begin(),::tolower);
if((str2.compare(str1))<0)
cout<<'-1'<<endl;
}
| ALGO | 0.999971 | 3.439205 |
d73294bb-7f72-4921-b839-afbcf5abf7c4 | Fei-Work/ESKF_NDT_LOCALIZATION | Thirdparty/oneTBB-2020_U3/examples/test_all/fibonacci/Fibonacci.cpp | /* Example program that computes Fibonacci numbers in different ways.
Arguments are: [ Number [Threads [Repeats]]]
The defaults are Number=500 Threads=1:4 Repeats=1.
The point of this program is to check that the library is working properly.
Most of the computations are deliberately silly and not expected ... | ALGO | 0.999703 | 5.115915 |
f605935a-291f-43e7-897f-3ba83d61f077 | SJMA11723/Problem-solving | codeforces/Codeforces Round 570 (Div. 3)/A.cpp | /**
* Author: Jorge Raul Tzab Lopez
* Github: https://github.com/SJMA11723
*/
#include <bits/stdc++.h>
using namespace std;
int sum(int n){
int res = 0;
while(n){
res += n % 10;
n /= 10;
}
return res;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
... | ALGO | 0.999597 | 3.995692 |
9f21fff0-00ee-4158-9cf9-84ac71b9ceec | inaik4/projects | binarysearchtree.cpp |
#include "BSTree.h"
#include "show9.cpp"
using namespace std;
//Constructor
template <typename DataType, class KeyType>
BSTree<DataType, KeyType>::BSTreeNode::BSTreeNode(const DataType &nodeDataItem, BSTreeNode *leftPtr, BSTreeNode *rightPtr)
{
dataItem = nodeDataItem;
left = leftPtr;
right = rightPtr;
}... | ALGO | 0.992395 | 4.902958 |
360b5525-7f94-4ac0-9a0e-c2b8e23cb931 | avivyeho/Covid-19-Virus-spread-Simulator | src/PDA.cpp |
#include "PDA.h"
#include <algorithm>
PDA::PDA() {}
PDA::PDA(std::vector<std::string> alph, State *start) : alphabet(move(alph)), start_state(start) {}
bool PDA::delta(State *q,std::string w) { // RETURN BOOL
/* CFG to implement:
* ({S,H},{I},R,{S})
* where R :
* S --> HIII (with # I's... | ALGO | 0.997727 | 5.948161 |
230d64fb-9e7e-49bb-983d-7d6d46f66d74 | hoshinon57/Algorithm | AtCoder/ABC201-300/ABC291-300/ABC296-D.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long ll;
const ll INF64 = 1LL << 60;
const int INF32 = 0x3FFFFFFF; // =(2^30)-1 10^9より大きく、かつ2倍しても負にならない数
#define YesNo(T) cout << ((T) ? "Yes" : "No") << endl; // T:bool
// ABC296 https://... | ALGO | 0.999965 | 4.612381 |
dfd81b4f-67f5-4bd5-b321-168a785fb4c0 | kritsid/competetive-programming | subset_sum_prblm.cpp | // A Dynamic Programming solution for subset sum problem
#include <stdio.h>
// Returns true if there is a subset of set[] with sun equal to given sum
bool isSubsetSum(int set[], int n, int sum)
{
// The value of subset[i][j] will be true if there is a
// subset of set[0..j-1] with sum equal to i
bool subs... | ALGO | 0.999964 | 5.510605 |
f6f39d67-517b-4431-9819-15188c6ed405 | Munawertaj/Codeforces | A_Madoka_and_Strange_Thoughts.cpp | // https://codeforces.com/contest/1717/problem/A
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vii vector<int>
#define vll vector<ll>
#define vull vector<ull>
#de... | ALGO | 0.999801 | 4.151093 |
bd281290-2fdd-4195-bc66-a9e7c722768b | geeosp/PGProject1 | MinQuadrados_V2/include/eigen-eigen-6b38706d90a9/bench/sparse_cholesky.cpp | // #define EIGEN_TAUCS_SUPPORT
// #define EIGEN_CHOLMOD_SUPPORT
#include <iostream>
#include <Eigen/Sparse>
// g++ -DSIZE=10000 -DDENSITY=0.001 sparse_cholesky.cpp -I.. -DDENSEMATRI -O3 -g0 -DNDEBUG -DNBTRIES=1 -I /home/gael/Coding/LinearAlgebra/taucs_full/src/ -I/home/gael/Coding/LinearAlgebra/taucs_full/build/lin... | ALGO | 0.997068 | 4.147974 |
0c08d194-20ac-4bf8-9733-b70201bdfdeb | denishadaslani/DSA | pr-2/que2.cpp | #include<iostream>
using namespace std;
main(){
int num,count=0;
cout<<"Enter the number : ";
cin>>num;
while(num!=0){
num=num/10;
count++;
}
cout<<"Total number of digits : "<<count;
} | ALGO | 0.998298 | 3.226914 |
0fb3393a-51a0-45ec-a935-789b37028401 | divcs/DSA-Practice-Learning | Platforms/Strivers/Step 1/Basic maths/prime_num.cpp | #include <iostream>
using namespace std;
int prime(int num)
{
int count = 0;
for (int i = 1; i <= num; i++)
{
if (num % i == 0)
{
count++;
}
}
if (count == 2)
{
return true;
}
else
{
return false;
}
}
int main()
{
int num;
cout << "Enter the number: ";
cin >> num;
bool isPrime = prime(num)... | ALGO | 0.999693 | 4.167228 |
66ba693a-5dbe-4612-ab03-07dfd5da32cf | kwx4github/facebook-hackercup-problem-sets | 2015/round_1/4.Corporate_Gifting/solutions/sources/1.Alex.cpp | #pragma comment (linker, "/STACK:128000000")
//#include "testlib.h"
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <bitset>
//#include <unordered_map>
//#include <unordered_set>... | ALGO | 0.99938 | 3.4724 |
1d6e11fb-8a74-4d8f-8d00-69cbe5b7c34a | Jihunn-Kim/Coding-Test-Practice | BAEKJOON/3430.cpp | #include <iostream>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <algorithm>
#include <cstring>
#include <climits>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
using namespace std;
// ڵ (?) - chttps://beginthread.tistory.com/58
const int LEN = 1e6 + 1;
... | ALGO | 0.999943 | 3.660553 |
57d737d5-e19c-476c-b8de-6ddecd1abb56 | tb-rules10/Hacktoberfest_2022 | q5.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int a,b,c,d,e;
cout<<"Please enter the coordinates of the point: "<<endl;
cin>>a>>b;
cout<<"Please enter the constant of the equation: "<<endl;
cin>>c>>d>>e;
float num= ((c*a)+(d*b)+e);
float den= sqrt((pow(c,2)+pow(d,2)));
cout<<"The distance between... | ALGO | 0.999661 | 3.316876 |
706cfd83-cb81-4e3e-81c0-e6ccedb25bb8 | BelottiHenrique/Porcentagem | Juros Compostos_cod_1/Juros Compostos_cod_1.cpp | #include "pch.h"
#include <iostream>
#include <cmath>
#include <limits>
using namespace std;
double ConvertePorcentagem();
void Calcular(double porcentagem);
double ConvertePorcentagem() {
double ValorPorcentagem; // valor que é recebido pelo usuario, um valor de porcentagem EXEMPLO: O DIGITO FOI 5 ENTAO SERA... | ALGO | 0.965719 | 4.385974 |
3cfacf4f-54fe-4894-a6ae-7d2ca2574810 | DsThakurRawat/Codeforces-divyanshthakur594 | 1669A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int n;
cin >> n;
if(n <= 1399){
cout << "Division 4" << endl;
}
else if( n >= 1400 && n <= 1599){
cout << "Division 3" << endl;
}
else if(n ... | ALGO | 0.999226 | 3.737203 |
0d283e15-d545-4150-b479-127459bccece | fallencrow19/Program | Laba13/main.cpp | #include <iostream>
#include <locale>
// Функция для возведения числа в степень.
int power(int base, int exponent) {
// Статическая переменная для подсчета количества вызовов рекурсивной функции.
static int callCount = 0;
// Увеличиваем счетчик вызовов.
callCount++;
// Базовый случай: если степ... | ALGO | 0.997465 | 6.033999 |
0d935cbc-709a-4b44-9004-3995e4a7cb3f | VidhanAgrawa-l/DSA_90Days | Lecture-004/28_Pattern.cpp | #include <iostream>
using namespace std;
int main() {
/*
*
* *
* * *
* * * *
* * * * *
*/
int n;
cout<<"Enter the value of n : ";
cin>>n;
int row = 1;
while(row <= n) {
int col = 1;
while(col <= n-row) {
cout<<" ";
c... | ALGO | 0.999163 | 3.985694 |
ba2dc5dd-a503-4c84-85d9-63af15f125fb | tusharmukherjee01/Striver-A-Z-DSA | 12. Binary Search Trees/2. Practice Problems/04. Delete from BST.cpp | /*
Question:
Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST.
Basically, the deletion can be divided into two stages:
1. Search for a node to remove.
2. If the node is found, delete the node.
Approach:
To dele... | ALGO | 0.999996 | 6.821719 |
45bc028c-089d-4807-9e74-136811248c62 | Harshjs-Gupta/DSA | Array/CheckShortedOrNot/checkArrayIsShorted.cpp | // write a program to check if an elements of an array is shorted or not
#include <iostream>
using namespace std;
struct Array
{
int A[8];
int length;
};
void shorted(struct Array *arr)
{
int i;
for (i = 0; i < arr->length - 1; i++)
{
if (arr->A[i] > arr->A[i + 1])
{
co... | ALGO | 0.998783 | 5.251443 |
751e795c-2522-4847-b057-315a423a50ff | jeffhammond/old-tbb | src/test/test_parallel_while.cpp | #include "tbb/parallel_while.h"
#include "harness.h"
const int N = 200;
typedef int Element;
//! Representation of an array index with only those signatures required by parallel_while.
class MinimalArgumentType {
void operator=( const MinimalArgumentType& );
long my_value;
enum {
DEAD=0xDEAD,
... | TEST | 0.949791 | 5.083052 |
fc238b60-2288-4ea3-bdad-d24eb396cdee | e1810/kyopro | ac/dp/dp_a/14468566.cpp | #pragma target("avx")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using PP = std::pair<ll,P>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>>;
#define REP(i,b,e) ... | ALGO | 0.99997 | 3.688562 |
5699d216-6d3b-4ed0-9a6d-fbd101194453 | Jumpat/SegAnyGAussians | submodules/diff-gaussian-rasterization/third_party/glm/test/core/core_func_integer_find_msb.cpp | #include <glm/glm.hpp>
#include <cstdio>
#include <cstdlib> // To define "exit", req'd by XLC.
#include <ctime>
#define LE 1 // 1 for little-endian, 0 for big-endian.
int pop(unsigned x) {
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = (x + (x >> 4)) & 0x0... | ALGO | 0.998694 | 3.60046 |
f2323a7e-2272-4075-b267-a72374ea20c8 | wcsanders1/LeetCode | WordBreak/CPP/WordBreak.cpp | #include <vector>
#include <string>
#include <unordered_set>
using namespace std;
class Solution
{
public:
bool wordBreak(string s, vector<string> &wordDict)
{
unordered_set<string> set(wordDict.begin(), wordDict.end());
return wordBreak(s, set, 0);
}
private:
bool wordBreak(string &s, unordered_set<... | ALGO | 0.999491 | 6.139519 |
81d64ed0-8a78-464f-adb3-2069c2a1b5a4 | multijam/godot | thirdparty/icu4c/common/unisetspan.cpp | #include "unicode/utypes.h"
#include "unicode/uniset.h"
#include "unicode/ustring.h"
#include "unicode/utf8.h"
#include "unicode/utf16.h"
#include "cmemory.h"
#include "uvector.h"
#include "unisetspan.h"
U_NAMESPACE_BEGIN
/*
* List of offsets from the current position from where to try matching
* a code point or a ... | TOOL | 0.953034 | 7.200292 |
a9483fc5-2852-43ef-a54a-7e4baeb5509f | msalahuddin267/XPSC | Week 16/Day 5/Card Game.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while(t--)
{
ll n;
cin >> n;
vector<ll> v(n);
ll ans = 0;
for(int i = 0; i < n; i++)
{
... | ALGO | 0.999984 | 4.484487 |
cd13fd92-e113-44fc-b677-5928f24227ac | milmillin/comp-prog | CodeForces/731F_VideoCards.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
int tbl[200100];
int cnt[400100];
bool mark[200100];
int main () {
int n;
scanf("%d",&n);
for (int i=0;i<n;i++) {
scanf("%d",&tbl[i]);
cnt[tbl[i]]++;
}
int cur=0;
for (int i=1;i<=200000;i++) {
cur+=cnt[i];
cnt[i]=cur;
//printf("%d\n",cnt[i])... | ALGO | 0.999933 | 3.237726 |
ca6c212a-6d08-4d4b-b389-df9abd0b295b | thegamer1907/Code_Analysis | CodesNew/1258.cpp | #include <iostream>
#include <algorithm>
using namespace std;
#define MAX_N 100000
#define INF 2000000000
int N;
int arr[MAX_N+1];
int x=INF, y=INF;
int main(){
scanf("%d", &N);
for(int i=0; i<N; i++){
scanf("%d", &arr[i]);
arr[i]-=i;
if(y>(arr[i]+(N-1))/N){
y=(... | ALGO | 0.999914 | 3.549205 |
9fc0febc-7a35-40b3-86d7-75a19cdb6508 | k352ex/Problem-Solving | BOJ/1000 ~ 2000/1260.cpp | // DFS와 BFS 알고리즘 문제
#include <iostream>
#include <queue>
#include <cstring>
using namespace std;
int map[1001][1001], visited[1001];
int n,m,v;
int v1, v2;
queue<int> que;
void dfs(int v) {
cout << v << ' ';
visited[v] = 1;
for(int i=1; i<=n; i++) {
if(map[v][i] == 1 && !visited[i]) {
dfs(i);
}
}
}
void ... | ALGO | 0.999987 | 4.428499 |
80d3c06d-ef26-46cb-a20e-e81a2b696788 | Abhisheksingh734/summer-dsa-cp | absakeCodes/winterPEP/prefixSum.cpp | #include <bits/stdc++.h>
using namespace std;
int findSum()
{
int n;
cin >> n;
vector<int> arr(n, 0);
int m;
cin >> m;
while (m--)
{
int i, j, k;
cin >> i >> j >> k;
arr[i] += k;
arr[j + 1] -= k;
}
for (int i = 1; i < n; i++)
{
arr[i] +=... | ALGO | 0.999614 | 3.955533 |
72df0d7d-3c69-4788-8448-7b3cf0d5ade5 | KKamJi98/algorithm | backjoon/c++/1003_fibo/main.cpp | #include <iostream>
using namespace std;
int global_fiboarr[42] = {0, 1,};
int Fibo(int num){
if (num == 0 || num == 1)
return global_fiboarr[num];
else if(global_fiboarr[num] == 0)
global_fiboarr[num] = Fibo(num-1) + Fibo(num-2);
return global_fiboarr[num];
}
int main(){
int repeat_n... | ALGO | 0.999858 | 4.393852 |
802a855e-9a3b-43e0-bab8-55d662803b3d | GrootTheDeveloper/OLP-ICPC | 800+BAI_CODE_HAY/Code/hsg_vinhphuc_2024_c1.cpp | #include <bits/stdc++.h>
using namespace std;
signed main()
{
int m, n; cin >> m >> n;
long long ans = 1ll * (m + n - 2) + 1ll *2 * (min(m, n) - 1);
if (n % 2 == 0 && m == n) ans--;
cout << ans;
} | ALGO | 0.99998 | 3.333631 |
6cccf1cc-433e-46d8-acb9-696b5425530c | aryarockstar/CSCE-625 | AI_HW3/houses.cpp | #include<iostream>
#include<stdio.h>
#include<vector>
#include<string.h>
#include<map>
using namespace std;
int nodes_explored=0;//Number of nodes explored
static int solfound=0;//Flag to check if solution reached
int sum_arr(int a[25])//Calculate sum of an array
{
int sum=0;
for(int i=0;i<25;i++)
sum=sum+a[... | ALGO | 0.999754 | 3.429101 |
60d1147b-2bb2-4af8-8ad2-7eb9955296aa | Ezhilan271/Competitve_Programming | Algorithm/IsBinaryTreeHeap.cpp | bool isHeap(Node * tree)
{
// Your code here
if(tree==NULL)
return true;
if((tree->left!=NULL&&tree->data<tree->left->data)
||(tree->right!=NULL&&tree->data<tree->right->data))
return false;
return isHeap(tree->left)&&isHeap(tree->right);
}
| ALGO | 0.999876 | 4.556753 |
1de1890b-4f11-4a20-9e66-210ea9ecd2ff | masood-muneer/Assignment-02 | Additional task06.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
double bread = 100.0, cake = 150.0, donuts = 120.0;
int quantityA, quantityB, quantityC;
double total, totaldis, totalWithTax, AfterPayment;
int location, pmethod;
double transactionFee;
int stockA = 10, stockB = 8, stockC... | TOOL | 0.944677 | 4.714719 |
ffb2a751-4661-4ad5-9bcc-e01dda8cb161 | StatixOS-Extended/android_frameworks_native | libs/gui/IConsumerListener.cpp | #include <gui/IConsumerListener.h>
#include <gui/BufferItem.h>
namespace android {
namespace { // Anonymous
enum class Tag : uint32_t {
ON_DISCONNECT = IBinder::FIRST_CALL_TRANSACTION,
ON_FRAME_AVAILABLE,
ON_FRAME_REPLACED,
ON_BUFFERS_RELEASED,
ON_SIDEBAND_STREAM_CHANGED,
ON_FRAME_DEQUEUED,
... | TOOL | 0.887725 | 7.459782 |
a87f403b-c8da-4b92-939c-0618517a9f62 | lxiao217/study428 | 深度学习/源码/OpenCV/opencv/modules/imgproc/src/templmatch.cpp | #include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
////////////////////////////////////////////////// matchTemplate //////////////////////////////////////////////////////////
namespace cv
{
#ifdef HAVE_OPENCL
/////////////////////////////////////////////////// CCORR ///////////////////////////////////////... | ALGO | 0.99509 | 3.10474 |
cf309bd4-37f1-4bf2-88bc-a33f04c5f89a | vivek7mehta/Udacity-CarND-MPC-Project | src/Eigen-3.3/doc/examples/tut_arithmetic_matrix_mul.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d mat;
mat << 1, 2,
3, 4;
Vector2d u(-1,1), v(2,0);
std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
std::cout << "Here is mat*u:\n" << mat*u << std::endl;
std::cout << "Here is u^T*mat:\n" << u.transpo... | ALGO | 0.998531 | 3.818773 |
83889eee-a73d-4c20-a588-83cbf7928cd9 | alexandraback/datacollection | solutions_5648941810974720_0/C++/zyac/a.cpp | #include<bits/stdc++.h>
using namespace std;
char str[2010];
int vis[10],xx[30];
int main()
{
freopen("A-small-attempt0.in","r",stdin);
freopen("out.txt","w",stdout);
int n,m;
int T,Case=1;
scanf("%d",&T);
while(T--)
{
memset(vis,0,sizeof vis);
memset(xx,0,sizeof xx);
... | ALGO | 0.999752 | 3.773642 |
d4efcdcb-3db4-45b7-b692-76def452d4fd | hansikarajakaruna20/On-Road-Pay | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
29cf86ec-3bf4-48e4-9769-f5bcfd58a1d1 | asad-tyb0000/PF | week3/task1.cpp | #include <iostream>
using namespace std;
main()
{
int sides;
int angle;
cout << "Enter the number of sides of the polygon: ";
cin >> sides;
angle = (sides - 2) * 180;
cout << "The sum of internal angles of a " << sides << "-sided polygon is: " << angle << " degrees";
} | ALGO | 0.943727 | 3.604494 |
4b9ae610-64b5-453d-96dc-9e3cb26f0689 | Artickatz/Coding_Using_C | shape.cpp | #include<iostream>
#include<cmath>
using namespace std;
class Shape {
public:
virtual double calculateArea() const = 0;
virtual double calculatePerimeter() const = 0;
};
class Circle : public Shape {
private:
double radius;
public:
Circle(double r) : radius(r) {}
double calculateArea() const ove... | ALGO | 0.993113 | 5.210957 |
e936bb30-037a-427c-b72f-a1c0c94b9c23 | Cao-Quang-Minh/UIT-IT003-DSA | 7. Binary Search Tree (Beginner)/[tree] Counting 1 (bonus)/[tree] Counting 1 (bonus).cpp | #include <iostream>
using namespace std;
struct Node
{
int info;
Node* left;
Node* right;
};
typedef Node* Tree;
Node* getNode(int x)
{
Node *p = new Node;
if (p!=NULL)
{
p->info = x;
p->left=NULL;
p->right=NULL;
}
return p;
}
//////////////////////////////////... | ALGO | 0.999662 | 3.962137 |
85013f96-e88e-494c-9a32-ed3d3c507103 | danny-wang/leetcode | 91. Decode Ways.cpp | /**
91. Decode Ways
A message containing letters from A-Z is being encoded to numbers using the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine the total number of ways to decode it.
For example,
Given encoded message "12", it could be decoded as "AB" (1 2) ... | ALGO | 0.999959 | 5.258726 |
279e533f-2966-4d16-928c-8c049e2fbdb5 | anshulkumarx7/DSA-General-Questions | decimalToBinary2.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int rem,n,answer=0,i=0;
cout<<"Enter the decimal number:"<<endl;
cin>>n;
while(n!=0){
rem=n%2;
answer=(rem* pow(10,i))+answer;
i++;
n=n/2;
}
cout<<"The binary conversion is: "<<answer;
retur... | ALGO | 0.999899 | 4.929682 |
a843cc18-40d0-4009-9a9b-c504382bfa08 | estpoc/android_frameworks_base | media/libstagefright/codecs/aacdec/ps_applied.cpp | /*
Filename: ps_applied.c
------------------------------------------------------------------------------
REVISION HISTORY
Who: Date: MM/DD/YYYY
Description:
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
-----------... | ALGO | 0.999074 | 6.151505 |
9d196256-b606-48e0-8922-0dff4707705e | AbdulMalek-swe/problem_solving_weak_5 | bitwiseoperation/light_of_on.cpp | #include <bits/stdc++.h>
using namespace std;
#define ln endl
#define FASTIO \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
int kth_value_on_off(int n,int k){
return (n>>k)&1;
}
void check_every_bit(int n){
for(int k=30;k>=0;k--){
cout<<... | ALGO | 0.999737 | 3.956428 |
27b52609-c324-471a-bfb0-9fa875b70b89 | f20500909/study_note | cpp/online_judge/leetcode/editor/cn/路径总和 III.cpp | //给定一个二叉树,它的每个结点都存放着一个整数值。
//
// 找出路径和等于给定数值的路径总数。
//
// 路径不需要从根节点开始,也不需要在叶子节点结束,但是路径方向必须是向下的(只能从父节点到子节点)。
//
// 二叉树不超过1000个节点,且节点数值范围是 [-1000000,1000000] 的整数。
//
// 示例:
//
// root = [10,5,-3,3,2,null,11,3,-2,null,1], sum = 8
//
// 10
// / \
// 5 -3
// / \ \
// 3 2 11
// / \ \
//3 -2 ... | ALGO | 0.99999 | 6.17118 |
5f84e318-d24d-4bf0-86c4-b08102b0a14a | ifradK/Competitive-Programming-Solutions | C++ Programs/Cards for Friends.cpp | #include<iostream>
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl '\n'
using namespace std;
int main()
{
fastio;
long long t,w,h,n;
cin>>t;
while(t--)
{
long long cnt=1;
cin>>w>>h>>n;
while(w%2==0)
{
... | ALGO | 0.999792 | 3.737618 |
f9ca68ff-40ef-4f95-a5ae-77cd99b373fc | emorcos0/CSCI | fall21/csci_110/topic_4/lab4/FantasticFive.cpp | // who: emorcos
// what: Fantastic Five lottery program
// why: Lab 3b: Modules and Functions
// when: 9/26
#include <iostream>
#include <cstdlib>
int inputMax(std::string);
int main()
{
int max{inputMax("Enter the maximum allowed lottery number: ")};
std::cout << "Your numbers are: ";
for (size_t i = 0; i... | TOOL | 0.942512 | 4.074304 |
ae88f06e-4254-463b-a565-87e56e9fd9e7 | colinmccormick/CarND-MPC-Project | src/Eigen-3.3/bench/sparse_dense_product.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.99348 | 4.386344 |
753b9589-bb9a-4c49-b8bb-20e2af0fbaa7 | Ujjwal2017099/leet-code | 0290-word-pattern/0290-word-pattern.cpp | class Solution {
public:
bool wordPattern(string p, string s) {
map<char,string> mp;
map<string,char> mx;
int prev=0;
s += ' ';
int cnt=0;
for(char c:p){
cnt++;
for(int i=prev;i<s.length();i++){
if(s[i]==' '){
... | ALGO | 0.998992 | 5.653541 |
e0c59c57-0b36-40ce-bb31-521c93fe8fd8 | ghd5890/Algorithm | Algo_23.cpp | /*
αӽ LEVEL 3( ﰢ)
*/
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int solution(vector<vector<int>> tirangle);
int main()
{
vector<vector<int>> triangle; // ﰢ
int height; // ﰢ
// ﰢ Է
cin >> height;
triangle = vector<vector<int>>(height);
for (int i = 0... | ALGO | 0.99995 | 4.418305 |
c1ff6d45-07ca-47ee-aa59-8f3af92f7d51 | WillWang426/CLEARLab | Common/src/Utilities/filters.cpp | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Utilities/filters.h"
#define BUDDA_Q_SCALE 6.f
template <typename T>
moving_average_filter<T>::moving_average_filter(int num_data)
: num_data_(num_data), idx_(0), sum_(0.0) {
buffer_ = new T[num_data_];
memset((void *)buff... | ALGO | 0.960787 | 4.100608 |
f48d6c2f-bf5e-455a-84ee-9fdaf0086598 | Mehedihasan444/compititive-programming | leetcode/remove-duplicates-from-sorted-array.cpp | #include <bits/stdc++.h>
using namespace std;
int removeDuplicates(vector<int> &nums)
{
for (int i = 0; i < nums.size() - 1; i++)
{
for (int j = i+1 ; j < nums.size(); j++)
{
if (nums[i] == nums[j])
{
nums.erase(nums.begin() + j);
j--;
... | ALGO | 0.999904 | 5.377676 |
6239b719-e462-4ff6-bcfb-ab85c79d8b6b | ayush-1-2-0-5/DSA | 3558-find-a-safe-walk-through-a-grid/3558-find-a-safe-walk-through-a-grid.cpp | #include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define fr(a,b) for(int i = a; i < b; i++)
using namespace std;
class Solution {
public:
bool findSafeWalk(vector<vector<int>>& grid, int health) {
int n = grid.size();
int m = grid[0].size();
... | ALGO | 0.9999 | 5.105833 |
73910f12-ffbf-4a81-a7af-d1b07c32acd2 | muskan184/DSA_problem | count primes.cpp | class Solution{
public:
int countPrimes(int n){
if(n<=2)return 0;
vector<bool>is_prime(n,true);
is_prime[0]=is_prime[1]=false;
for(int p=2;p*p<n;++p){
if(is_prime[p]){
for(int multiple=p*p;multiple<n;multiple+=p){
is_prime[multiple]=false;
}
}
}
return count(is_prime.begin(),is_prime.end(),true);
}
};
| ALGO | 0.999968 | 5.816732 |
c3778d04-102d-43af-9798-a5bba4de9bf6 | mohitGitHxb/DataStructuresAndAlgo | Contests Upsolving Leetcode and GFG/Searching Sorting/binary search/Maximum Frequency of an Element After Performing Operations I.cpp | #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;
/*
* CUSTOM hash function which avoids collisions and hence makes unordered maps / sets faster
*/
struct custom_hash
{
static uint64_t splitmix64(uint64_t x)
... | ALGO | 0.999763 | 5.206569 |
b7aa48b0-3284-47a9-9d53-5eb86280c560 | rkcraushan333/leetcode | 0464-can-i-win/0464-can-i-win.cpp | // Good memoization question
class Solution {
public:
int dp[1<<20][2];
bool f(int mx,int t,int mask=0,bool b=0)
{
int &rkc = dp[mask][b];
if(rkc!=-1) return rkc;
int curr = 0;
for(int i=0;i<mx;i++)
{
if(mask&(1<<i))
{
curr += ... | ALGO | 0.999845 | 5.791315 |
b89db27d-3ba0-4a9c-a52c-ea6d68b7194b | raincross7/code-similarity | codes/train_code/problem429/problem429_337.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j,... | ALGO | 0.999527 | 3.369167 |
bcb1c2b5-cea9-4860-ba58-bb98e56e5546 | sumitsojha88/Placement-Preparation | Geeks For Geeks Solutions/Stack/Immediate Smaller Element.cpp |
using namespace std;
int main() {
//code
int t;
cin >> t;
while(t--)
{
int n , i;
cin >> n;
int a[n];
for(int i=0;i<n;i++)
{
cin >> a[i];
}
for(int i=0;i<n-1;i++)
{
if(a[i]>a[i+1])
cout<<a[i+1]<< " ";
else
cout<< "-1" << " " ;
}
cout << "-1" <<"\n";
}
return 0;
}
| ALGO | 0.999915 | 3.607583 |
656887d4-43bd-4257-aba2-57e5112b0f0d | oxanafedorova09/to-do-list-apk | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
930d2861-db04-4de8-a312-6d7d4d88270f | ab-atiq/Phitron-6 | C-3-DS/module18.5/Maximum_depth_of_binary_tree.cpp | // https://leetcode.com/problems/maximum-depth-of-binary-tree/solutions/7006797/simple-clean-recursion-beats-100-by-piaa-gpiu/
class Solution
{
public:
int max_depth(TreeNode *root)
{
if (root == NULL)
return 0;
if (root->left == NULL && root->right == NULL)
return 1;
... | ALGO | 0.999723 | 6.382244 |
7ec1eb05-ac83-441d-8b28-61c4de116b63 | Hamsik2rang/Today-I-Solved | Problems/Greedy/11047/11047.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
unsigned int coin[11];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
//freopen("input.txt", "r", stdin);
int n, k;
cin >> n >> k;
for (int i = 0; i < n; i++)
{
cin >> coin... | ALGO | 0.99968 | 3.645252 |
965fc6c1-fd5b-40da-bdbc-fe4c9e5beffe | Shreya241/Cpp-problems | CF solutions/Mahmoud and Ehab and the even-odd game.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int n;cin>>n;
if(n%2!=0){
cout<<"Ehab";
}else{
cout<<"Mahmoud";
}
} | ALGO | 0.999835 | 3.48465 |
95440739-b48d-4107-ada1-f471204bbd07 | itsme-swe/DSA-25_PW_Cplusplus | 04_Array/1D_Arrays/TwoSum_LeetCode/SolutionUsingMap.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
vector<int> twoSum(vector<int> &nums, int target)
{
vector<int> ans;
int n = nums.size();
unordered_map<int, int> m;
for (int i = 0; i < n; i++)
{
int rem = target - nums[i];
if (m.find(rem) != m.end())
{
... | ALGO | 0.99987 | 6.033001 |
4f4a171c-bf85-49ea-826c-5378c22daf88 | fonkvan/BTrees | Main.cpp | #include <iostream>
#include "Node.h"
#include "BTree.h"
int main()
{
int N = 0;
int M = 5;
std::cout << "How many elements do you want in your B-Tree?" << std::endl;
while (N < 400)
{
std::cin.clear();
std::cout << "Please enter a value greater than or equal to 400" << std::endl;
std::cin >> N;
}
BTree B... | ALGO | 0.998085 | 4.31622 |
848ce8a1-02b1-4aae-afdf-950306628b66 | wnxy/LeetCode | 84.largest_rectangle_in_histogram.cpp | /**
* @file 84.largest_rectangle_in_histogram.cpp
* @author your name (<EMAIL>)
* @brief 柱状图中的最大矩形
* @version 0.1
* @date 2022-03-29
*
* @copyright Copyright (c) 2022
*
*/
#include <iostream>
#include <vector>
using namespace std;
/**
* @brief 暴力解法,枚举每一个元素,寻找当前元素前一个更小的元素,寻找当前元素后一个更小的元素
*
*/
class Solut... | ALGO | 0.999979 | 5.771114 |
1984fa89-ee2b-47d6-ac80-d612daa791da | AmirBR996/C-PROGRAMS | email.cpp | #include<iostream>
#include<stdexcept>
using namespace std;
int main() {
string email;
cout << "Enter your email: " << endl;
cin >> email;
try {
bool foundAt = false;
for (char c : email) {
if (c == '@') {
foundAt = true;
break;
... | TOOL | 0.858705 | 6.194722 |
635400ac-b023-4972-953a-0f5c173f6478 | Tarun-dammu/ADS-lab | dictionary.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
# define max 10
typedef struct list {
int data;
struct list *next;
} node;
node *ptr[max], *root[max], *temp[max];
class Dictionary {
public:
int index;
Dictionary();
void insert(int);
void search(int);
void del(int);
};
Dictiona... | ALGO | 0.999611 | 3.916456 |
47711a44-9ee7-4418-9e81-c312a2e9d8b6 | SuYuxi/yuxi | Algorithms/Binary Search/441. Arranging Coins.cpp | class Solution {
public:
int arrangeCoins(int n) {
//return floor((sqrt(8 * long(n)+ 1) - 1) / 2);
return (sqrt(8 * long(n)+ 1) - 1) / 2);
}
};
| ALGO | 0.99995 | 6.187221 |
ca23c4c0-3ddf-4522-bc68-af475f6913a6 | Ranadipgithub/leetCode | 0542-01-matrix/0542-01-matrix.cpp | class Solution {
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& mat) {
int n = mat.size();
int m = mat[0].size();
vector<vector<int>> dist(n, vector<int>(m, -1));
vector<vector<int>> direction{{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
queue<pair<int, int>> q;
... | ALGO | 0.999983 | 6.829569 |
5f3a9b09-13fc-476b-aaf3-625397687b13 | HoseonLee123/Programmers | Lv1/38_삼총사.cpp | #include "pch.h"
int solution(vector<int> number)
{
int sum{ 0 };
int trio{ 0 };
int numberOfTrio{ 0 };
for (size_t i = 0; i < (number.size() - 2); ++i)
{
for (size_t j = i + 1; j < number.size() - 1; ++j)
{
for (size_t k = j + 1; k < number.size(); ++k)
{
if (number[i] + number[j] + number[k] == t... | ALGO | 0.999444 | 5.68034 |
6da76138-b0ce-4f68-9002-acedcb328ec3 | yashwanthguguloth24/Cpp-Practice | FINAL450/subarray_with_0_sum.cpp | // https://practice.geeksforgeeks.org/problems/common-elements1132/1#
// If subarray sum is zero, then there will be an element in set already store which is same as of arr[i]
// set contains all continous sum
// if sum = 0
// then prevSum_in_set+sum = prevSum_in_set(which is already present).
class Solution{
pub... | ALGO | 0.999748 | 5.660147 |
6f47207a-2306-42c4-941a-9f91a9857cc1 | Hong-kee/Algorithm-Study | Hongki/BFS/Leetcode20220212.cpp | class Solution {
public:
int ladderLength(string beginWord, string endWord, vector<string>& wordList) {
//Exception Logic
bool isContain = false;
for (int i = 0; i < wordList.size(); i++) {
if (endWord == wordList[i]) {
isContain = true;
break... | ALGO | 0.99995 | 5.735332 |
4132107a-5225-497d-8375-d5fcd83ae2c5 | 237K/ProblemSolving | BOJ#14889_dfs.cpp | //
// OS Windows
// 2020.10.10
//
// [PS][BOJ[#14889] ŸƮ ũ
// DFS
//
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <memory.h>
using namespace std;
const static int SZ = 22;
static int map[SZ][SZ], N, check[SZ], sum[2], team[2][SZ / 2], ret;
inline void print()
{
register int i, j;
for (i = 0; i < 2; ++... | ALGO | 0.999957 | 3.67072 |
2c6aa639-061c-49c8-a30f-16ef139ab115 | DreamyCecil/CecilBotMod | Sources/Bots/PathFinding/PathPolygon.cpp | #include "StdH.h"
#include "PathPolygon.h"
#include "Navmesh.h"
// Constructor & Destructor
CPathPolygon::CPathPolygon(void)
{
};
CPathPolygon::~CPathPolygon(void) {
bppo_avVertices.Clear();
};
// Copy constructor
CPathPolygon::CPathPolygon(const CPathPolygon &bppoOther) {
bppo_bpoPolygon = bppoOther.bppo_bpoPol... | TOOL | 0.935652 | 5.482908 |
bdc4ba90-0229-4bbc-90d6-2487af7368c5 | SHANMUGHAx20/Major-progs-in-C | amstrong num.cpp | #include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
int a=0;
int r=0;
int temp=n;
while(n!=0)
{
r=n%10;
a=a+(r*r*r);
n=n/10;
}
if(temp==a)
printf("the amstrong number is %d",a);
else
printf("its not a amstong number");
}
| ALGO | 0.999926 | 3.858267 |
7f3efe70-d383-42dc-8ac3-264838fc98fc | cpi-llvm/llvm | lib/Analysis/BranchProbabilityInfo.cpp | #include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "ll... | ALGO | 0.972645 | 7.718498 |
92764b35-ea88-4489-9f63-3fe890f86e68 | ronsaldo/bullet-pharo | src/bullet-2.82-r2704/UnitTests/BulletUnitTests/btCholeskyDecomposition.cpp | #include "btCholeskyDecomposition.h"
int choleskyDecompose(const btMatrix3x3& A, btMatrix3x3& L)
{
// TODO Check that the A matrix is symmetric
// Iterate over the elements of the upper triangle of A
for (unsigned int i = 0; i < 3; ++i)
{
for (unsigned int j = i; j < 3; ++j)
{
btScalar sum = A[i... | ALGO | 0.99895 | 5.856176 |
6be5062d-fe76-4cc1-b869-c56d2cd79225 | mjolewis/Advanced-CPP-and-Modern-Design | Level 7/src/Exercise 5/StatefulPoint/main.cpp | //
// Modern C++ Strategy Pattern
//
// Uses universal function wrappers instead of traditional inheritance associated with GOF Strategy Pattern.
//
// Created by Michael Lewis on 8/24/23.
//
#include <cmath>
#include <future>
#include <iostream>
#include "DistanceStrategy.hpp"
#include "Point.hpp"
// Alias
using St... | ALGO | 0.993049 | 7.875784 |
ba19843a-2a15-4419-a0e3-def7692f2899 | Notmanik/DSA_Progress | LinkedList/Single_LL/deletion.cpp | #include<iostream>
using namespace std;
class LinkedList{
private:
class Node{
public:
int data;
Node* next;
Node(int val){
this->data = val;
this->next = nullptr;
}
};
Node* head;
public:
LinkedList(){
head = nullptr... | ALGO | 0.998148 | 5.723571 |
70b08513-0660-425b-8dd0-f0d6a59655f2 | tsainez/examples | c++/matrixMultiplication.cpp | #include <iostream>
#include <climits>
using namespace std;
void printMatrices(int** s, int i, int j) {
if (i == j) {
cout << "A" << i - 1;
} else {
cout << "(";
printMatrices(s, i, s[i - 1][j - 1]);
printMatrices(s, s[i - 1][j - 1] + 1, j);
cout << ")";
}
}
void m... | ALGO | 0.999971 | 4.356729 |
bf7e1201-53fc-467c-9118-89d67b00ef0f | manikanta2901/ubuntu | .history/practice/cpp/Codechef/playingWithTheStrings_20200724175827.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999889 | 3.801143 |
ba01d530-333b-4da4-8fdf-388d4c0151e4 | hamkasatria/praktikum | struktur_data/game_solitare.cpp | #include <iostream>
#include <malloc.h>
#include "stdlib.h"
#include <math.h>
using namespace std;
void input_nilai();
void output_nilai();
void push_main(int IB);//saat permainnan dimulai
void interface();
void bermain();
int cek();
void peraturan();
/////////deklarasi stack///... | ALGO | 0.997681 | 3.358162 |
e2229d17-b706-4358-b0d8-d8d784fad18b | knuu/competitive-programming | atcoder/arc/arc097_c.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
//typedef tuple<int, int, int> T;
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++)
#define REP(i,x) FOR(i,0,x)
#define ALL(c) c.begin(), c.end()
#define DUMP( x ) cerr << #x... | ALGO | 0.999781 | 3.927795 |
5ed6eb45-92c4-4a9b-a8bb-1c720a2c427e | DonnyTheTalker/Huffman_Archiver_cpp | Encoder.cpp | #include "Encoder.h"
#include "BitWorker.h"
#include "BitWriter.h"
#include "HuffmanTree.h"
#include "ServiceSymbols.h"
#include <algorithm>
#include <exception>
#include <fstream>
#include <queue>
void Encoder::EncodeArchive(const std::vector<std::string>& input_stream_names, std::ostream& out_stream)
{
BitWrite... | TOOL | 0.969767 | 6.88315 |
5ab9ba71-b70e-4fc8-834f-093a22ba9722 | Angus-Liu/Algorithm-in-Action | LeetCode/CPP/2288 Apply Discount to Prices/main.cpp | #include <iomanip>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
class Solution {
public:
string discountPrices(string sentence, int discount) {
ostringstream out;
out << fixed << setprecision(2);
// split sentence
double discountFact = (100.0 - disc... | ALGO | 0.985136 | 5.133983 |
08aa10d7-6db3-4a93-b105-6cabc158ed12 | alexvelea/competitive | infoarena/stalpi2/stalpi2.cpp | #include <cmath>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;
#ifdef __APPLE_
#define DEBUG 1
#else
#define DEBUG 0
#endif
#define fi first
#define se second
#define int64 long long
ifstream in("stalpi2.in");
ofstream out("stalpi2.out");
const int inf = 0x3f3f3... | ALGO | 0.999925 | 3.243378 |
b90369a4-fafc-44de-bc47-b526dca67d80 | deniscostadsc/playground | solutions/beecrowd/1016/1016.cpp | #include <cmath>
#include <cstdint>
#include <cstdio>
int main() {
std::int16_t n;
scanf("%d", &n);
printf("%d minutos\n", 150 / 60 * n);
}
| ALGO | 0.993722 | 4.304631 |
290401d1-c760-4ad0-a73c-6cb4f000b14c | cthbst/Competitive-Programming | zerojudge/d670.cpp | #include<stdio.h>
char lib[]="22233344455566677778889999" ;
char in[50] ;
int main(){
while (~scanf("%s",in)){
for (int i=0 ; in[i] ;i++ ){
if ('A'<=in[i] && in[i]<='Z')in[i]=lib[ in[i]-'A' ] ;
}
puts(in) ;
}
}
| ALGO | 0.998085 | 3.362425 |
b2dd1686-76e5-4116-8a77-7967209a6132 | delicm/cses | Dynamic Programming/Increasing Subsequence/main.cpp | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, x;
cin >> n;
vector <int> d;
for(int i = 0; i < n; i++)
{
cin >> x;
auto j = lower_bound(d.begin(), d.end(), x);
if(j == d.end())
{
d.push_back(x);
... | ALGO | 0.999906 | 4.5369 |
69fc7f36-8512-412a-adfd-fdfcb04d7714 | hssik508/baekjoon | 2024/2412/12852.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
vector<pair<int, int>> dp(1000001); // 1을 만드는데 걸리는 횟수, 최소 횟수를 만들어주는 이전 숫자
dp[1] = {0, 0};
for (int i = 2; i <= 1000000; i++)
{
// 기본적으로 1을 빼는 경우로 초기화
dp[i].first = dp[i - 1].first + 1;
... | ALGO | 0.999992 | 4.381453 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.