uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
af2a4bcc-5a27-49ea-99d7-4061655c1fa8 | opomerenk/cs2 | LineAlgorithm.cpp | /**
* @file
* @author The CS2 TA Team
* @version 1.0
* @date 2013-2014
* @copyright This code is in the public domain.
*
* @brief Student implementation of line algorithm.
*
*/
#include "LineAlgorithm.hpp"
/**
* TODO: Implement a line algorithm of your choice here.
*/
vector<Tuple> line(Tuple p1, Tuple p2)
... | ALGO | 0.997178 | 4.090102 |
5dde9239-2aab-4a43-a108-53fa39bce10a | squaresLab/BatFix | results/transcoder/results/python/syntax/MAXIMUM_CONSECUTIVE_REPEATING_CHARACTER_STRING.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <numeric>
#include <algorithm>
using namespace std;
char f_gold ( string str ) {
int len = str . l... | ALGO | 0.999865 | 5.460552 |
5b6209c7-89be-439b-b3e3-bd126ed89113 | Shaunak04/Striver-SDE-Sheet | Day 13/SortStack.cpp | void sortedInsert(stack<int> &stack, int key)
{
if(stack.empty() || key > stack.top())
{
stack.push(key);
return;
}
int top = stack.top();
stack.pop();
sortedInsert(stack, key);
stack.push(top);
}
void sortstack(stack<int> &stack)
{
if(stack.empty())
{
re... | ALGO | 0.999972 | 4.992221 |
9b1a561a-0259-4e29-87c0-0f1ef1a8acef | raincross7/code-similarity | codes/train_code/problem311/problem311_451.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF 2147483647//int max
const int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
int n;
cin >> n;
vector<pair<string,int>> data(n,pair<string,int>());
rep(i,n)cin >> data.... | ALGO | 0.999548 | 3.941618 |
5b2faca4-58bb-4325-a6e5-a6d7318e0934 | mirasac/algonume | 2022-11-24/matrix.cpp | #include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include "../mclib/mclib.h"
int main() {
using namespace std;
cout << fixed << setprecision(1);
int const N = 4;
// Native method.
cout << "Native method" << endl;
double m_nat[N][N] = { {11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, ... | ALGO | 0.999067 | 4.07424 |
c465e068-e4ff-422d-a84c-e3779771b989 | cuhk-seclab/MdPerfFuzz | src/tree_mutation/runtime/src/atn/PredictionMode.cpp | #include "atn/RuleStopState.h"
#include "atn/ATNConfigSet.h"
#include "atn/ATNConfig.h"
#include "misc/MurmurHash.h"
#include "SemanticContext.h"
#include "PredictionMode.h"
using namespace antlr4;
using namespace antlr4::atn;
using namespace antlrcpp;
struct AltAndContextConfigHasher
{
/**
* The hash code is o... | ALGO | 0.990116 | 4.109624 |
e9a98c48-b274-449a-93f4-00681d0a73d1 | WilliamVernaschi/URI-beecrowd | C++/1807.cpp | #include <iostream>
using namespace std;
typedef long long ll;
ll MOD=2147483647;
ll mypow(ll b, int n){
if(n == 0){
return 1;
}
if(n % 2){
return (b*(mypow(b, n-1)%MOD))%MOD;
}
else{
return ((mypow(b, n/2)%MOD)*(mypow(b, n/2)%MOD))%MOD;
}
}
int main(){
int n; cin >> n;
cout << (mypow(3, n) ... | ALGO | 0.999961 | 4.618275 |
f417daa8-6687-4204-875c-a2eba097a9b8 | mominchaudhry/Algorithms | Schedule_Checker/schedule_checker.cpp | //CPS616 lab 5
//Momin Chaudhry 500831162
#include <iostream>
int canBook(int* arrive_dates, int* leave_dates, int n);
int main() {
int arrive_dates[] = {1,3,5,6,6};
int leave_dates [] = {2,6,8,7,8};
int n = 3;
int t = canBook(arrive_dates,leave_dates,n);
printf("%d \n", t);
return 1;
}
in... | ALGO | 0.996788 | 4.421036 |
151eb9c6-2c15-495e-9a3d-8b4d5350e118 | crxcrxcrx/kaoyan | 408/swap/main.cpp | #include <stdio.h>
#include <stdlib.h>
#define Maxsize 50
typedef int ElemType;
typedef struct {
ElemType data[Maxsize];//规范写法
int length;
} Sqlist;
//typedef struct {
// int data[MaxSize];
// int length;
//} Sqlist;
void List_insert(Sqlist &L, int pos, ElemType insert_value) {
if (pos < 1 || pos > L.le... | ALGO | 0.999725 | 3.53771 |
a03d1562-b142-4e9e-b7de-ed74bdbec635 | dushmi/informatics | infoarena/kreg.cpp | #include <fstream>
using namespace std;
ifstream in("kreg.in");
ofstream out("kreg.out");
int l, k, n;
char s[10000000];
inline void add(int x) {
if (x == 0)
return;
add(x / 10);
s[l++] = x % 10 + '0';
}
void solve() {
int next;
k /= 2;
for (int i = 1; i <= n; ++i)
for (int j = 1; j <= k; +... | ALGO | 0.999818 | 3.625953 |
2865893e-9937-402c-a669-800b01d9c526 | Sabbir185/URI_Problem_Solution | URI_1115.cpp | #include <iostream>
using namespace std;
int main() {
int x,y;
while (1) {
cin>>x;
cin>>y;
if (x>0 && y>0)
cout<<"primeiro"<<endl;
else if( x>0 && y<0)
cout<<"quarto"<<endl;
else if( x<0 && y<0 )
cout<<"terceiro"<<endl;
else if(x<0 && y>0)
cout<<"segundo"<<endl;
else
... | ALGO | 0.9999 | 3.148292 |
ec436241-7192-4349-9944-8770b64b7807 | princebansal7/DSA-Sheets-Code | 450-DSA-Sheet/01.Arrays/07.CyclicallyRotateArrayBy1.cpp | #include <iostream>
using namespace std;
void RotateByOne(int a[], int n)
{
//________way-1________________________
for (int i = 0; i < n - 1; i++)
swap(a[i], a[n - 1]);
/*__________Way-2_________________________
int temp = a[n - 1];
for (int i = n - 1; i > 0; i--) {
a[i... | ALGO | 0.999783 | 4.094317 |
02af8800-f819-4c5d-85d3-be949fbc0fad | CLDP/ACM-ICPC | Regional-2011/North-America-ECNA/A.cpp | #include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN = 1001;
int n;
string p, q;
int x[MAXN];
long long cal(int lenA) {
long long ans = 0, total = 0;
vector<pair<int, int> > A, B, C;
for (int i = 0; i < n; ++i) {
if (p[i] == '1' && q[i]... | ALGO | 0.999911 | 4.070876 |
55eb4385-dd26-4b6f-bc33-3e757d67c602 | FabioMaione/Domjudge_Cpp | N22.cpp | #include <iostream>
using namespace std;
int main()
{
char x;
bool ok=false;
cin>>x;
while(x!='.')
{
if((x>='a' && x<='z') || (x>='A' && x<='Z'))
ok=true;
cin>>x;
}
if(ok==true)
cout<<"SI";
else
cout<<"NO";
return 0;
}
| ALGO | 0.998066 | 3.448143 |
4764df2e-4a37-4882-ae35-18054b9e7ba0 | yku/Competition | TopCoder/srm544/ElectionFraudDiv2.cpp | #include <iostream>
#include <sstream>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
/**
* 値X %は四捨五入できられているのでとりうる範囲は
* X-0.5 <= X < X+0.5
*
* 下限値の%の合計人数と上限値の合計人数の間に10000がふくまれていれば正しい。
* そうでないなら不正あり。ただし負数にならないことに注意(これが抜けてSystemFail)
* ex) X=12なら
* 11.5 <= X < 12... | ALGO | 0.998774 | 4.436493 |
5de98740-7bea-4d53-be41-573ae2797ed7 | vaishdho1/DSA | Graphs/Minimum Score After Removals on a Tree.cpp | /*
There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.
You are given a 0-indexed integer array nums of length n where nums[i] represents the value of the ith node. You are also given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicates that there is an ed... | ALGO | 0.999983 | 5.701563 |
85b58801-cd21-4eb8-a07d-d28beaf35038 | manikanta2901/ubuntu | .history/SRM/elab/OOPS/ExceptionHandling.cpp/NumberException_20200928173338.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
float a;
cin >> a;
int b = a;
try{
if(a == b){
cout << "Number of exceptions: " << b/4 << endl;
}else{
throw(a);
}
}
return 0;
} | ALGO | 0.981511 | 3.317363 |
7ccfaf97-1500-46cd-9355-1c1d028fc0f5 | iagozag/competitive_programming | contests/cf/contest/1834/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define int ll
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
const int MAX = 2e5+10, MOD = 1e9+7;
void solve(){
int n; cin >> n; int cnt = 0, cnt2 = 0;
vect... | ALGO | 0.999982 | 4.339291 |
15f99639-c609-4e8c-8e6b-3d4ec1503217 | ayush-1560/DSA | 2473-max-sum-of-a-pair-with-equal-sum-of-digits/max-sum-of-a-pair-with-equal-sum-of-digits.cpp | class Solution {
public:
int sumD(int n){
int sum=0;
while(n>0){
sum+=n%10;
n/=10;
}
return sum;
}
int maximumSum(vector<int>& nums) {
int mp[82]={0};
int ans=-1;
for(int i=0;i<nums.size();i++){
int digitSum=sumD(num... | ALGO | 0.999984 | 6.29101 |
d730d1a1-0c0d-4d32-91e7-17a9844b0157 | waqasaslam718/C-Practice | OOP/polymorphysim/exercise10.cpp | #include <iostream>
#include <stack>
#include <sstream>
#include <cctype>
using namespace std;
class Token {
public:
virtual float getNumber() const = 0;
virtual char getOperator() const = 0;
virtual ~Token() {}
};
class Operator : public Token {
private:
char op;
public:
Operator(char oper) : o... | ALGO | 0.998143 | 6.520155 |
7bcaee99-53db-4628-be86-43760bccc46f | alexandrcoin/ferumcoin | tests/Difficulty/Difficulty.cpp | #include <cstddef>
#include <cstdint>
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include "CryptoNoteConfig.h"
#include "CryptoNoteCore/Difficulty.h"
#include "CryptoNoteCore/Currency.h"
#include "Logging/ConsoleLogger.h"
using namespace std;
int main(int argc, char *argv[]) {
... | TOOL | 0.896223 | 5.363525 |
29e77fa4-2a7d-41de-98cf-b0fd7eff228b | paragishere/cpp-project | task3.cpp | #include <iostream>
using namespace std;
char board[3][3] = { {'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'} };
char currentPlayer = 'X';
void displayBoard() {
cout << "Tic-Tac-Toe Board: " << endl;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++)... | ALGO | 0.999046 | 5.677001 |
301dd00d-8bd8-4f10-b2ff-e923e4a7806c | ketherinfr27/Laporan-Prak-SD-ketherin | jobsheet 7/latihan/Queue menggunakan array.cpp | //Created by 23343072_ketherin fathur rahma
#include<stdio.h>
#include<stdlib.h>
#define ukuran 5
void tambah();
void hapus();
void display();
int front = -1, rear = -1;
int queue[ukuran];
int main ()
{
int pilihan;
while(pilihan != 4) {
printf("\n*************************Main Menu*****************... | ALGO | 0.998689 | 4.066524 |
fe1540a9-42f0-40b5-a7f8-feba4d6d9c5f | programmer-mursalin/Competetive-Programming | 1100/greddy/D_Stay_or_Mirror.cpp | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
#define int long long
#define gcd __gcd
#define ALL(x) (x).begin(), (x).end()
#define py cout << "YES\n";
#define pm cout << "-1\n";
#define pz cout << "0\n";... | ALGO | 0.999664 | 5.369097 |
55231d31-5078-42b8-942b-bd89b8c3f127 | wsbjwjt/TanksWar | cocos2d/cocos/platform/winrt/CCWinRTUtils.cpp | #include "CCWinRTUtils.h"
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <Windows.h>
#include <wrl/client.h>
#include <ppl.h>
#include <ppltasks.h>
#include <sstream>
NS_CC_BEGIN
using namespace Windows::Graphics::Display;
using namespace Windows::Storage;
using namespace concurrency;
using... | TOOL | 0.904392 | 5.680194 |
3204a46e-fd57-455a-96e4-19404e75d9d2 | RaquelBehrens/marathon-training | dfs/hedge_mazes.cpp | #include <bits/stdc++.h>
#define maxn 10001
using namespace std;
int r, c, q, a, b;
vector<int> corridors[maxn];
int isImpossible = false;
bool search(int s, int t) {
if(isImpossible) {
return false;
}
int next = s+1;
if(next == t && std::find(corridors[s].begin(), corridors[s].end(), next) != corrid... | ALGO | 0.999694 | 3.606478 |
3c65cb9a-93b0-4fd6-8851-215651b35e61 | Project-3T/external_libcxx | test/std/containers/associative/map/map.modifiers/insert_initializer_list.pass.cpp | // UNSUPPORTED: c++98, c++03
// <map>
// class map
// void insert(initializer_list<value_type> il);
#include <map>
#include <cassert>
#include "min_allocator.h"
int main()
{
{
typedef std::pair<const int, double> V;
std::map<int, double> m =
{
... | TEST | 0.861871 | 5.842242 |
f978d942-d8e7-4e15-be91-06f45b49b808 | UESTC-NDSL-CPS/SylixOS-ROS | libfastrtps-master/src/Fast-DDS/src/cpp/rtps/transport/TCPv4Transport.cpp | #include <rtps/transport/TCPv4Transport.h>
#include <utility>
#include <cstring>
#include <algorithm>
#include <asio.hpp>
#include <fastdds/dds/log/Log.hpp>
#include <fastdds/rtps/transport/TCPv4TransportDescriptor.h>
#include <fastrtps/utils/IPLocator.h>
using namespace std;
using namespace asio;
namespace eprosim... | TOOL | 0.859225 | 7.526122 |
65329d91-8607-4d47-b56e-814d68f6c2bf | neko-huang/oi-code | P2141.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int list[127];
int cnt[20005];
int main(){
int n,ans=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>list[i];
}
for(int i=1;i<=n;i++){
for(int j=i+1;j<=n;j++){
cnt[list[i]+list[j]]++;
}
}
for(int i=1;i<=... | ALGO | 0.999921 | 3.629711 |
4a4d9d13-2a28-4a53-b86d-a9405ba205c9 | FariaTabassum/Numerical-Method | Eular's method.cpp | #include<stdio.h>
#include<math.h>
#define f(x,y) (1-y)
int main()
{
float x0,y0,h,xn,z,x,y;
printf("\nEnter x0,y0,h,xn:\n ");
printf("initial value of: x0 = ");
scanf("%f", &x0);
printf("initial value of: y0 = ");
scanf("%f", &y0);
printf("step size: h = ");
scanf("%f", &h);
printf(... | ALGO | 0.999985 | 3.388598 |
a529cee1-2908-4fba-97d3-eac76dc3d1f7 | yhuanghamu/GPU-DATA-PLACEMENT | convolution for profiler/main.cpp | /*
* This sample implements a separable convolution filter
* of a 2D image with an arbitrary kernel.
*/
// CUDA runtime
#include <cuda_runtime.h>
// Utilities and system includes
#include <helper_functions.h>
#include <helper_cuda.h>
#include "convolutionSeparable_common.h"
/////////////////////////////////////////... | TEST | 0.873104 | 6.989376 |
e30bd482-cdc8-4d66-bff9-29efc7194a49 | anshratn1997/Competitive-Programming-DS-Algo | DP/ghost.cpp | // There is nothing in a caterpillar that tells you its going to be a butterfly --------------------- !
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <iomanip>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#... | ALGO | 0.999947 | 3.341108 |
4f5fcfb2-6190-4f99-a694-14d8e22d9ac2 | black-shadows/Cracking-the-Coding-Interview | Solutions/Chapter 9 Sorting and Searching/9.1.0.cpp | /*
* Q 9.1 You have two sorted arrays,A and B,and A has a large enough buffer at the end to hold B.
* Write a method to merge B into A in sorted order.
*/
#include <iostream>
using namespace std;
void merge(int a[], int b[], int n, int m)
{
int k = n + m - 1;
int i = n - 1, j = m - 1;
while (i <= 0 && j >= 0)
... | ALGO | 0.999067 | 4.516707 |
1778bb35-e35f-420e-9946-5f9cbc41f809 | perosofic420/cpp-aes-encryptor | cryptopp/panama.cpp | // panama.cpp - originally written and placed in the public domain by Wei Dai
// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM panama.cpp" to generate MASM code
#include "pch.h"
#ifndef CRYPTOPP_GENERATE_X64_MASM
#include "panama.h"
#include "secblock.h"
#include "misc.h"
#include "cpu.h"
NAMESPACE_BEGIN(CryptoPP)
... | ALGO | 0.99015 | 6.97496 |
e5e9fda0-e2b7-4f15-a032-bbb0a567d90f | KINGORITHM/Stack-Queue | siyeon/stock.cpp | //
// Created by 양시연 on 2019/10/24.
//
#include <vector>
#include <stack>
using namespace std;
vector<int> solution(vector<int> prices) {
vector<int> answer;
int temp[100001];
stack<pair<int,int>> s;
int index = 0;
while(index < prices.size()){
if(!s.empty() && prices[index] < s.top().f... | ALGO | 0.999986 | 5.311959 |
fa3bfb98-ac16-440a-8790-02fd6cbc44d0 | bokutotu/atcoder | ABC/123/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //s... | ALGO | 0.999975 | 3.308629 |
eedfa541-ac8f-4c08-b7d3-0178159ce035 | mahmoudmokhiamar/Competitive-Programming-Solving | Random solving Day 14/iloveusername2.cpp | #pragma GCC optimize "trapv"
#include <bits/stdc++.h>
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define el '\n'
using namespace std;
const int N = 1e5+5;
void solve()
{
int n ; cin >> n;
int ans= 0;
vector<int> contest(n);
int min = *min_element(contest.b... | ALGO | 0.999909 | 4.139913 |
f3ab1357-3999-4de4-8541-7038f1aee330 | mariaaktermukti/CodeChef | Starters_181_Breaking_Sticks.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin >> T;
while(T--){
int N;
cin >> N;
long long sum = 0;
for(int i = 0, a; i < N; i++){
cin >> a;
sum += a;
}
cout... | ALGO | 0.999709 | 3.98136 |
b68d48a4-9345-454e-920d-1b3477558040 | happybaoliang/poj | solved/1004.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main(){
double balance;
double sum=0;
for(int i=0;i<12;i++){
cin>>balance;
sum+=balance;
}
cout<<"$"<<setiosflags(ios::fixed);
cout<<setprecision(2)<<(sum/12)<<endl;
return 0;
}
| ALGO | 0.989976 | 3.877913 |
7938a8e5-d555-4bdd-ac76-4cdd9dcac6e2 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4929_11.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 61;
int n, m, q, g[N][N][N], dp[N][N][N];
int main() {
scanf("%d%d%d", &n, &m, &q);
for (int car = 0; car < m; ++car) {
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j) scanf("%d", &g[car][i][j]);
for (int k = 0; k < n; ++k)
for ... | ALGO | 0.999916 | 4.265094 |
367e9fe4-7b75-4c4c-8890-5f936ea3fa60 | artiam99/GeeksforGeeks | 14 Bit Magic Algoritms/3 Hard/13 Count Pairs with Atleast One Digit Same.cpp | #include<bits/stdc++.h>
using namespace std;
int Count_Pairs(vector<int> &a,int n)
{
int freq[1025]; memset(freq,0,sizeof(freq));
for(int i = 0 ; i < n ; i++)
{
int num = a[i] , digit = 0;
while(num)
{
digit |= (1 << (num % 10));
num /= 10;
}
freq[digit]++;
}
int ans = 0;
for(int... | ALGO | 0.999859 | 5.216183 |
9d9631a2-1575-4976-8400-79240bc116db | qualious/dailyprogrammerchallange | dailyprogrammer[easy]#90.cpp | #include <iostream>
#include <fstream>
#include <cstdlib>
#include <vector>
using namespace std;
/*
In this challenge, we propose a simple image file format for binary (2 color)
black-and-white images.
Rather than describing the image as a sequence of bits in a row, instead we
describe it in a little bit of a non-stand... | ALGO | 0.999705 | 4.141893 |
17fe8a45-e5d6-4a9c-8c37-20ce0cd5c514 | Haneesha-kandi/Object-oriented-programming-with-c- | vowels or consonants.cpp | #include<iostream>
using namespace std;
int main()
{
char str;
cout<<"enter a string: ";
cin>>str;
if (str=='A' || str == 'E' || str == 'I' || str == 'O' || str == 'U' || str=='a' || str == 'e' || str == 'i' || str == 'o' || str == 'u')
{
cout<<"vowels";
}
else
{
cout<<"consonants";
}
return(0);
}
| ALGO | 0.992068 | 3.882332 |
0eca88b6-6f5c-4d57-b158-0bbede4d865f | dcode2004/TLE_CP-31_Sheet | A_Reverse_a_Substring.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define f(i,s,e) for(int i = s; i < e; i++)
#define fi(i,s,e) for(int i = s; i <= e; i++)
#define pii pair<int, int>
#define vi vector<int>
#define vpii vector<pair<int,int>>
#define mii map<int,int>
#define umii unordered_map<int,int>
#define si set<... | ALGO | 0.999787 | 3.431502 |
c1141a3b-96d8-4064-b28c-04180a79ed7d | yogeswari-123/CSA5141-CNS-Lab- | 16.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ALPHABET_SIZE 26
#define MAX_TEXT_SIZE 10000
const double english_freq[ALPHABET_SIZE] = {
8.167, 1.492, 2.782, 4.253, 12.702, 2.228, 2.015, 6.094, 6.966, 0.153,
0.772, 4.025, 2.406, 6.749, 7.507, 1.929, 0.095, 5.987, 6.327, 9.056,
2.758, 0... | ALGO | 0.999795 | 5.427625 |
d17e125a-2602-4d33-a54e-3ba480bb7b0f | anishacharya/Cracking-Coding-Interviews | Leetcode/House_Robber.cpp | //You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the
//only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will
//automatically contact the police if two adjacent houses were broken i... | ALGO | 0.999952 | 5.35901 |
f3f0bf8b-6d6f-43d0-9925-ad7c075966fd | Md-Rakib-Hassan/PROBLEM-SOLVING | Two_Knights.cpp | // https://cses.fi/problemset/task/1072
#include <bits/stdc++.h>
using namespace std;
#define nl "\n"
#define ll long long
void solve()
{
int n;
cin >> n;
cout << 0 << nl;
for (ll i = 2; i <= n; i++)
{
ll total_position = i * i;
ll total_moves = total_position * (total_position - 1... | ALGO | 0.999842 | 3.860219 |
5eab629e-3e39-4c03-aa57-b70c94d81807 | Licheam/Codes | [SPOJ]7258_SAM.cpp | #include <bits/stdc++.h>
#define MAXN 1000005
#define LL long long
using namespace std;
struct SAM {
int len,link;
int ch[26];
}sam[MAXN<<1];
int sz,last;
void sam_init() {
sam[0].len=0;
sam[0].link=-1;
memset(sam[0].ch,0,sizeof(sam[0].ch));
sz=0;
last=0;
}
void sam_extend(int c) {
i... | ALGO | 0.999958 | 3.990139 |
53ce2cfc-7f1b-404f-8dd7-425dcfd8f5ed | GustaBeholder/Prog-Mobile | My project/Library/PackageCache/com.unity.ide.visualstudio@2.0.16/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.949246 | 6.943344 |
0bb1e40e-ff20-45c7-96d1-da25467f5408 | watashi/AlgoSolution | leetcode/weekly-268/2079.cpp | class Solution {
public:
int wateringPlants(vector<int>& plants, int capacity) {
int ret = 0, rem = capacity;
for (int i = 0; i < (int)plants.size(); ++i) {
if (rem < plants[i]) {
rem = capacity;
ret += 2 * i;
}
rem -= plants[i];
... | ALGO | 0.999966 | 6.075867 |
4e2411d1-1737-4c63-9fbb-0b4edf3e659c | KevinAz999/cpp1 | IfElseHWNum5.cpp | #include <iostream>
using namespace std;
int main() {
double n;
cout<<"Imput a number: ";
cin>>n;
if(n < 0){
cout<<n<<" is a negative number!"<<endl;
}
else if(n > 0){
cout<<n<<" is Positive number!"<<endl;
}
return 0;
}
| ALGO | 0.981863 | 3.583179 |
b57279cd-ccc7-4877-a133-a1d767f8f284 | raincross7/code-similarity | codes/train_code/problem439/problem439_450.cpp | // بِسْمِ ٱللَّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ
// لآ اِلَهَ اِلّا اللّهُ مُحَمَّدٌ رَسُوُل اللّهِ
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
const int MOD = 1000000007;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int a;
cin >> a;
int ara[a];
... | ALGO | 0.998977 | 3.631192 |
7ba5063f-1f1a-49ab-a56f-da540fcedb7e | VijayPandey08/LeetCode | 1171-shortest-path-in-binary-matrix/shortest-path-in-binary-matrix.cpp | class Solution {
public:
int n,m;
typedef pair<int,pair<int,int>> P;
vector<vector<int>> directions{{0,1},{0,-1},{1,0},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};
bool isSafe(int x_, int y_){
return (x_>=0 && y_>=0 && x_<n && y_<m);
}
// yeh isliye banaya q ki, hume priority_queue mein {distance, {cell ke coordinates sto... | ALGO | 0.999998 | 6.128741 |
f295c2c0-31be-439f-8067-7321ecd04d1a | armync/bacalaureat | Informatica C++/Bac/2009/V11 II 5.cpp | #include <iostream>
using namespace std;
int main()
{
int m, n, i, j, a[11][11], min;
cin >> m >> n;
for(i=1; i<=m; i++)
{
for(j=1; j<=n; j++)
{
cin >> a[i][j];
}
}
for(i=1; i<=m; i++)
{
min = 10000;
for(j=1; j<=n; j++)
{
... | ALGO | 0.999935 | 3.823388 |
8b5c9677-b451-45ab-8dfd-2dd64b014c21 | cewatlac/MSA-S3-Beginner | Sheet 3 (Loops)/C.cpp | // Online C++ compiler to run C++ program online
#include <iostream>
using namespace std;
int main() {
int t , c = 0;
cin >>t;
while (t--){
int a , b;
cin >> a >> b;
if (a+2 <= b)c++;
}
cout << c;
return 0;
}
| ALGO | 0.999499 | 4.400415 |
4b48a2f0-429d-4db7-ade8-ce779d693214 | Hinski2/CP | codeforces/problems/Preparing Olympiad/cpp1273.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v){
for(const auto &u: v){
os << u << ' ';
}
return os;
}
te... | ALGO | 0.999821 | 4.470229 |
8579c229-e047-4c9b-abf3-c8e6fa6ea182 | ishandutta2007/codeforces | andreasyan/normal/1228/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 255, M = 1000000007;
int n, k;
int c[N][N];
int ast[N], astmm[N];
void pre()
{
ast[0] = 1;
astmm[0] = 1;
for (int i = 1; i <= n; ++i)
{
ast[i] = (ast[i - 1] * 1LL * k) % M;
astmm[i] = (astmm[i - 1] * 1LL * (k - 1)) % M;
}
... | ALGO | 0.999986 | 4.512506 |
d40863b0-d34a-488c-92ba-71a53f8566ca | 0-jij-0/CompetitiveProgramming | Problems Archive/0000 - 0999/0691 - Again About Distancing.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string s; getline(cin, s); bool b = true;
int i = 0, j = 1, n = (int)s.size();
while (j != n) {
if (s[j] == ' ') { j++; continue; }
if (j - i + 1 < 4) { b = false; break; }
i = j; j++;
}
cout << (b ? "safe" : "unsafe") << endl;
cin.ign... | ALGO | 0.997127 | 3.762257 |
4dc09d03-aaaf-447a-a3da-616190f6212d | MelodicTechno/suanfa | huisu/tsp.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
int n; // 城市数量
vector<vector<int>> graph; // 城市之间的距离图
vector<bool> visited; // 访问标记数组
int bestCost = INT_MAX; // 最优解
void tsp(int currPos, int count, int cost) {
if (count == n && graph[currPos][0]) {
bestCost = min(bestCost, c... | ALGO | 0.99999 | 5.447431 |
94c159cb-07c7-4e07-aa9d-54b91f8276e2 | lyswty/PAT-Advanced-Level-Solutions | 1064/1064 Complete Binary Search Tree (30 分).cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<utility>
using namespace std;
vector<int>tree, level;
void BFS() {
queue<pair<int, int>>q;
q.push(pair<int, int>(0, tree.size() - 1));
while (!q.empty()) {
int left = q.front().first, right = q.front().second;
q.pop(... | ALGO | 0.999996 | 4.169036 |
5c6a71bd-7ea5-4278-b1f6-bc820d832122 | Hyonchori/yolox_byte | YOLOx/demo/OpenVINO/cpp/yolox_openvino.cpp | #include <iterator>
#include <memory>
#include <string>
#include <vector>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <inference_engine.hpp>
using namespace InferenceEngine;
/**
* @brief Define names based depends on Unicode path support
*/
#define tcout std::cout
#define file_name_t... | DATA | 0.894731 | 5.702583 |
4e9f9dff-e543-4550-87a4-d1cf56b61ded | WYK15/swift-Ollvm10 | llvm/lib/Transforms/Utils/CloneFunction.cpp | #include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfo.h"... | TOOL | 0.969876 | 7.570512 |
d229c131-d2f4-4040-9489-30231a8310fb | Evolution-X-AOSP/frameworks_av | media/module/codecs/amrnb/common/src/div_s.cpp | /*
Pathname: ./gsm-amr/c/src/div_s.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the div_s function. Sync'ed up
with the current template and fixed tabs.
Description: Making changes based on review meeting.
Des... | ALGO | 0.999713 | 5.724687 |
ae262394-20a8-452b-8f5a-a0f640e6fa87 | stoimenoff/up16-17 | week02/tasks/solutions/task7.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
double a, b, c;
cin >> a >> b >> c;
double p = (a + b + c) / 2;
double area = sqrt( p * (p - a) * (p - b) * (p - c) );
cout << area << endl;
return 0;
}
| ALGO | 0.999639 | 4.204038 |
01a13e11-a2d6-40b4-9526-0cd57967e93a | VaxGold/Prueba_Tecnica | PRUEBA DE PROGRAMACION GENERAL/inversionTexto.cpp | #include <iostream>
#include <string.h>
int main()
{
char str[] = "Este es un TEXTO de prueba.";
int len = strlen(str);
int i = 0;
while (i < (len) / 2)
{
char aux = str[i];
str[i] = str[(len - 1) - i];
str[(len - 1) - i] = aux;
i++;
}
std::cout << "El nuevo... | ALGO | 0.987977 | 3.525947 |
ad673a39-67c3-4a90-9ba7-8bb2f6748708 | XaiZew/C- | TIC_TAC_TOE/TTT _functions.cpp | #include <iostream>
void displayGrid(std::string grid[3][3])
{
for (int i = 0; i < 3; i++)
{
for (int y = 0; y < 3; y++)
{
std::cout << grid[i][y] << "|";
}
std::cout << "\n";
}
std::cout << "\n";
}
void loop(std::string grid[3][3])
{
int row;
int collumn;
int turn = 1;
while (tr... | TOOL | 0.986844 | 3.531844 |
9f346d79-34a9-4a8b-b876-66cd89a8d1f8 | cmx-Y/Cminus_Compiler | src/cminusfc/cminusfc.cpp | #include "cminusf_builder.hpp"
#include "PassManager.hpp"
#include "LoopSearch.hpp"
#include "Dominators.h"
#include "Mem2Reg.hpp"
#include "LoopSearch.hpp"
#include "LoopInvHoist.hpp"
#include "ActiveVars.hpp"
#include "ConstPropagation.hpp"
#include "SelDAGNodes.hpp"
#include "AsmPrinter.hpp"
#include <iostream>
#inc... | TOOL | 0.962069 | 4.28177 |
f495f469-1525-4938-8af3-89333493b746 | tony9402/baekjoon | solution/graph_traversal/2636/main.cpp | // Authored by : bsoomin8734
// Co-authored by : tony9402
// Link : http://boj.kr/a7f85eb725a6477a919287e9e506db7b
#include <bits/stdc++.h>
using namespace std;
bool visited[101][101];
int Map[101][101];
int dir[4][2] = {{0, 1},{1, 0},{-1, 0},{0, -1}};
int N, M;
queue<pair<int, int> > q;
int cnt = -1;
int result = 0;
... | ALGO | 0.999969 | 4.338543 |
1866060f-80df-4b77-9df9-45f3a661278b | MaTianmao/src | src/boost/libs/hana/example/define_struct.cpp | #include <boost/hana/accessors.hpp>
#include <boost/hana/assert.hpp>
#include <boost/hana/core/to.hpp>
#include <boost/hana/define_struct.hpp>
#include <boost/hana/equal.hpp>
#include <boost/hana/find.hpp>
#include <boost/hana/first.hpp>
#include <boost/hana/map.hpp>
#include <boost/hana/not_equal.hpp>
#include <boost/... | ALGO | 0.894285 | 6.965676 |
30221e86-6c11-4ae9-a659-d1e64bd92efa | nilay2207/CP | missing_number.cpp | #include<bits/stdc++.h>
using namespace std;
int Missing(int n,int arr[],int i){
while(i<n){
int correctindex=arr[i];
if(arr[i]!=arr[correctindex]){
swap(arr[i],arr[correctindex]);
}else{
i++;
}
}
for(int i=0;i<n;i++){
if(arr[i]!=i){
c... | ALGO | 0.999967 | 3.639208 |
3615b660-e783-4e1f-9945-5ec5a5d5f3d4 | J0SAL/6Companies30days | Walmart/9.cpp | // submission link: https://leetcode.com/submissions/detail/629532039/
int helper(int low, int high, vector<vector<int>> &dp){
if(low>=high) return 0;
if(dp[low][high]!=-1) return dp[low][high];
int ans = INT_MAX;
for(int i=low; i<=high; i++){
//max of curr+ left or right
int flag=i... | ALGO | 0.999971 | 6.749499 |
bf12d786-f4c8-4fb6-a417-c75f340083bd | Gambitdutku/Linux-Process-Monitor | src/cpu_usage.cpp | #include "../include/cpu_usage.h"
#include <iostream>
#include <fstream>
#include <string>
#include <thread>
#include <chrono>
// To calculate CPU usage
struct CpuData {
unsigned long long idleTime, totalTime;
};
// gonna read from /proc/stat
CpuData getCpuData() {
std::ifstream statFile("/proc/stat");
s... | TOOL | 0.935517 | 4.782678 |
f1bcd276-46ae-4b14-bccf-a37d5c7ec434 | raincross7/code-similarity | codes/train_code/problem492/problem492_171.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string _... | ALGO | 0.999966 | 3.994103 |
e57bd7b6-50f1-4970-91a8-98c5a72293d0 | dalihub/android-dependencies | glslang/glslang/MachineIndependent/limits.cpp | //
// Do sub tree walks for
// 1) inductive loop bodies to see if the inductive variable is modified
// 2) array-index expressions to see if they are "constant-index-expression"
//
// These are per Appendix A of ES 2.0:
//
// "Within the body of the loop, the loop index is not statically assigned to nor is it used as t... | ALGO | 0.863895 | 8.209042 |
50900675-cb79-4d9f-95d6-7670f3c675a6 | 192110266balakumar/DSA0179-C- | factorial of int and float OL.cpp | #include <iostream>
#include <cmath>
unsigned long long factorial(int n) {
if (n < 0) {
std::cerr << "Factorial is not defined for negative integers." << std::endl;
return 0;
}
unsigned long long result = 1;
for (int i = 2; i <= n; ++i) {
result *= i;
}
return result;
}
... | ALGO | 0.997242 | 6.355751 |
41c5ff6c-0d6c-4ad5-8e83-a0879463ad44 | kshitijayamgar/CPP | must-know-prgs-in-cpp/armstrong.cpp | #include <iostream>
int main()
{
int n,r,sum=0,temp;
std::cout<<"Enter the Number:"<<std::endl;
std:: cin>>n;
temp=n;
while(n>0){
r=n%10;
sum=sum+(r*r*r);
n=n/10;
}
if(temp==sum)
std::cout<<"Armstrong Number."<<std::e... | ALGO | 0.999833 | 4.206001 |
d5e6f8cd-c860-48ca-bf3a-b4b9088d2a99 | Kim0914/AlgoGYM | JINSEOP/백준_혼자_풀기/DP/호텔.cpp | #include <iostream>
#include <vector>
using namespace std;
#define pii pair<int, int>
#define INF 987654321
int goal = 0, num = 0, cost = 0, increased_pop = 0;
int pops[1001];
vector<pii> cities;
void init_pops() {
for (int i = 1; i <= goal; i++)
pops[i] = INF;
}
int main() {
cin >> goal >> num;
for (int i = 1; ... | ALGO | 0.999962 | 3.906682 |
d36b74d3-a988-4e77-b8a3-3e1f836d645a | Vitor-labs/Trabalhos_ufc | testes/Grafos/Grafo.cpp | #include <iostream>
#include <list>
#include <algorithm>
using namespace std;
/* Matriz de Adjacência: O(n)^2 -> É mais rápida para detectar a
existencia de alguma aresta
int grafo[5][5]{
{0, 0, 1, 0, 0},
{0, 0, 1, 0, 0},
{1, 1, 0, 1, 1},
{0, 0, 1, 0, 1},
{0, 0, 1... | ALGO | 0.999561 | 5.400397 |
e2e6761b-5c43-4a6e-9d49-5677e2d21067 | ishandutta2007/codeforces | qaqautomaton/normal/1628/B.cpp | /*
Author: QAQAutoMaton
Lang: C++
Code: B.cpp
Mail: <EMAIL>
Blog: https://www.qaq-am.com/
*/
#include<bits/stdc++.h>
#define debug(qaq...) fprintf(stderr,qaq)
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define Debug debug("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define all(x) x.b... | ALGO | 0.999807 | 4.061448 |
57f9252c-6e4d-44e9-a8b8-275df3e2f161 | Drakcap/usaco | 4/4.1/cryptcow.cpp | /*
ID: drakcap1
PROG: cryptcow
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <list>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <vector>
using namespace std;
ofstream fout("cryptcow... | ALGO | 0.999731 | 3.510687 |
9c8d24a8-24af-4488-9d7d-7fd823414585 | abhik2003/my_cp | codeforces/D_Neutral_Tonality.cpp | #include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
#define endl '\n';
#define __builtin_popcount(x) __builtin_popcountll(x)
#define ll long long
using namespace std;
#ifdef LOCAL
#include "debuglib.h"
#else
#endif
const int INF=1e8;
const int M=1e9+7;
vector<int> LIS(vector<int>& a... | ALGO | 0.999963 | 3.422886 |
38709639-66d2-41b2-b733-085d688fa704 | jlallas384/ioi-solutions | 2020/d2/biscuitss/bitscuits.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int can(ll x, ll y, vector<long long> a){
for(int i = 0; i < a.size(); i++){
if(y & (1LL << i)){
if(a[i] < x) return 0;
a[i] -= x;
}
if(i + 1 < a.size()){
a[i + 1] += a[i] / 2;
}
}
return 1;
}
long long count_tastiness(long long x,... | ALGO | 0.999265 | 4.274931 |
b6ed21db-a819-4f8a-884e-870402154e37 | Felipe174/C-ex- | Struct/struct de array.cpp | #include<stdio.h>
#include<locale.h>
#include<string.h>
//declarao struct
struct dados{
char nome[40];
char sexo;
int idade;
float vencimento;
char residencia[30];
};
//declarao do array
struct dados trabalhadores[5];
int main(){
setlocale(LC_ALL,"portuguese");
int i,homens,mulheres,soma,media;
for(i=0;i<5... | TOOL | 0.877016 | 3.378649 |
92e605b8-1bcf-4440-8e68-8650a3f1bef8 | coin3d/coin | src/projectors/SbLineProjector.cpp | /*!
\class SbLineProjector SbLineProjector.h Inventor/projectors/SbLineProjector.h
\brief The SbLineProjector class projects 2D points to 3D points along a line.
\ingroup coin_projectors
The 3D projection of the 2D coordinates is for this projector class
constrained to lie along a predefined line.
Among ... | ALGO | 0.954616 | 6.608965 |
54044fff-25b2-4f2b-bf9f-9766bc52a88c | dhanushbabuk/Leetcode | Medium/2470-removing-stars-from-a-string/removing-stars-from-a-string.cpp | class Solution {
public:
string removeStars(string s) {
stack<int>st;
for(int i =0;i<s.size();i++)
{
if(s[i] == '*')
{
st.pop();
}
else
st.push(s[i]);
}
string ans;
while (!st.empty()) {
... | ALGO | 0.999959 | 6.190196 |
4b58bb74-596f-4c63-81f0-ae43653bede6 | PacktPublishing/Software-Architecture-with-Cpp | Chapter01/philosophy/algorithms/bad_dots.cpp | #include <cstddef>
int count_dots(const char *str, std::size_t len) {
int count = 0;
for (std::size_t i = 0; i < len; ++i) {
if (str[i] == '.') count++;
}
return count;
}
| ALGO | 0.881757 | 5.599282 |
04f76efd-1cdf-4613-a856-533d726c225b | daniel-bytes/JSDSP | JuceLibraryCode/modules/juce_graphics/native/juce_win32_Fonts.cpp | namespace FontEnumerators
{
static int CALLBACK fontEnum2 (ENUMLOGFONTEXW* lpelfe, NEWTEXTMETRICEXW*, int type, LPARAM lParam)
{
if (lpelfe != nullptr && (type & RASTER_FONTTYPE) == 0)
{
const String fontName (lpelfe->elfLogFont.lfFaceName);
((StringArray*) lParam)->addIf... | TOOL | 0.925945 | 6.617234 |
12db93b5-adae-4396-9597-9db9cd6851a1 | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8_formatted/akulsareen/8294486_5681755159789568_akulsareen.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
const double INF = 1e18;
int maxd[MAXN], vel[MAXN];
long long int dist[MAXN][MAXN];
double min_time[MAXN][MAXN];
bool vis[MAXN];
int main() {
int t;
scanf("%d", &t);
for (int case_num = 1; case_num <= t; ++case_num) {
int n, q;
scanf("%d ... | ALGO | 0.999614 | 4.155007 |
67fe77be-01d0-419e-9d1c-19a7ba528bbc | ishandutta2007/codeforces | kdvinit/normal/1070/J.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
int32_t main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin>>t;
while(t--)
{int n,m,k;
cin>>n>>m>>k;
string s;
int a[26];
cin>>s;
memset(a,0,sizeof(a));
for(auto x:s)
{a[x-'A']++;
}
int nice[27]... | ALGO | 0.999949 | 3.412393 |
d59daa21-955d-4623-98c1-62781de9639c | nothpy/gfg160days | Day-60 Product array puzzle.cpp | // User function template for C++
class Solution {
public:
vector<int> productExceptSelf(vector<int>& arr)
{
int leftProduct =1,rightProduct =1, n=arr.size();
vector<int>ans(n, 1);
for(int i=0; i<n; i++)
{
ans[i] = leftProduct;
leftProduct *= arr[i];
... | ALGO | 0.999969 | 5.736217 |
161e0c89-d420-4f09-bbee-69707ffaf9fc | prajithravisankar/array_Practice | arrayHomework2_sortingNumbers.cpp | #include <iostream>
using namespace std;
int main() {
// IDEA:
// use frequency array to put the frequency of value (index). Using this frequency array, print the
// number of times the value is present. if freq[3] = 5 print ... 3 3 3 3 3 ... like wise go in order
// from value (index) 0 to 500 if th... | ALGO | 0.999922 | 4.127761 |
b4374755-2051-42cc-84ae-92db1e42be33 | yashsinha0206/Arrays | #215kThLargestEleInArr.cpp | class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
int n = nums.size();
sort(nums.begin(),nums.end());
int c = 0;
if(n==1)
return nums[0];
for(int i=n-1;i>=0;i--)
{
c++;
if(c==k)
retu... | ALGO | 0.999989 | 5.091618 |
717141e8-6a4a-4868-9c43-f6f56a1576e0 | ghozt777/cp | leetcode/c++/heaps/sort-characters-by-frequency/main.cpp | // link : https://leetcode.com/problems/sort-characters-by-frequency/
class Solution {
string getString(char x){
string s(1, x);
return s;
}
public:
string frequencySort(string s) {
unordered_map<char , int> hm ;
priority_queue<pair<int , char>> pq;
for(char x : s)... | ALGO | 0.999989 | 5.907578 |
aa9eacb4-392c-4d69-ba8e-ffa7f2cca2db | ibiaalice/marvel-app | marvel_app/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998905 | 6.785645 |
4013dd4b-c427-471c-9d22-ecf5c9e7cabc | VatsalBambhania/AirMouse | opencv/opencv/modules/photo/src/seamless_cloning_impl.cpp | #include "seamless_cloning.hpp"
using namespace cv;
using namespace std;
void Cloning::computeGradientX( const Mat &img, Mat &gx)
{
Mat kernel = Mat::zeros(1, 3, CV_8S);
kernel.at<char>(0,2) = 1;
kernel.at<char>(0,1) = -1;
if(img.channels() == 3)
{
filter2D(img, gx, CV_32F, kernel);
}... | ALGO | 0.997428 | 3.827562 |
168ca517-9c0e-4d24-9a45-cdede5acb4a6 | taj8zg/CS2150-PDR | Lab3/Postlab/postfixCalculator.cpp | //Name: Ashley Nguyen - apn2my
//PostLab03 - postfixCalculator.cpp
//2.9.16
#include <iostream>
#include <stack>
#include <cstdlib>
#include "postfixCalculator.h"
using namespace std;
//Default Constructor
postfixCalculator::postfixCalculator(){
theStack = new stack<int>;
sizeOfStack = 0;
}
//Destructor
p... | ALGO | 0.955959 | 3.735301 |
22b91ee9-2458-4174-b0fe-4955627adc33 | umang537/Recursion | CPP Recursion Practice Ques/9_Tower_of_Hanoi.cpp | // Tower of Hanoi
#include <iostream>
using namespace std;
void tower_of_Hanoi(int n, char src, char dest, char helper)
{
if (n == 0)
return;
tower_of_Hanoi(n - 1, src, helper, dest);
cout << "Move " << src << " to " << dest << endl;
tower_of_Hanoi(n - 1, helper, dest, src);
}
int main()
{
... | ALGO | 0.999865 | 6.056629 |
d58e11b9-b25c-4d14-ba84-ebc888c46563 | leoner90/jarekAiProject | game/source/PathFinder.cpp | #include "stdafx.h"
#include "PathFinder.h"
#include "Map/Map.h"
//!!!!!!!!!!!!!!!!!!!!!!!!!!!to see all the nodes on the map
bool EnableNodes = false;
//CONSTRUCTOR
PathFinder::PathFinder(Map& m) : map(m)
{
//NODES pivot points
float Coords[][2] = {
// Bathroom (5 points)
{370, 65}, {370, 235}, {627, 115}, {6... | ALGO | 0.989604 | 3.002063 |
d9d029b0-f669-49a6-8963-dc68676fe634 | Aman2241/Self-Driving-Car | project_10_MPC_control/src/Eigen-3.3/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A;
A << 1, 2, 2, 3;
cout << "Here is the matrix A:\n" << A << endl;
SelfAdjointEigenSolver<Matrix2f> eigensolver(A);
if (eigensolver.info() != Success) abort();
cout << "The eigenvalues of A ... | ALGO | 0.998923 | 3.833302 |
26d22b49-078b-44cd-83f1-5568d08a847b | AmaanShaikh04/Programming | C++/Overload_Decrement_Operator(--).cpp | //Write a program to overload decrement operator (--) operator to decrement the value of an object.
#include <iostream>
using namespace std;
class Ovr
{
private:
int a=5;
public:
Ovr* operator -- ()
{
//Ovr tp;
a=--a;
return this;
}
Ovr* operator -- (int)
{
... | TOOL | 0.960594 | 5.173501 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.