uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4e3debe4-775a-4374-8a4e-27326e8ee152 | InwooLeeme/Algorithm | Boj/11066.cpp | //////////////////////////////////////////////////////////////////////////////
/*
_____ ______ _
/ ___| | ___ \ (_)
\ `--. _ __ __ _ ___ ___ | |_/ / ___ _ __ __ _ _ _ _ _ __
... | ALGO | 0.999922 | 5.168416 |
c07691e0-244b-4ad9-bb01-9b7fa84e0dca | blockchaincavs/LeetCode | DeleteNodeinaBST_450/main.cpp | #include <iostream>
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
};
/*
* FindMinNode helper function
* Can always replace deleted node with its right childs smallest node
* this is because we know the deleted nodes right is greter than its left
*/
TreeNode* findMinNode(TreeNode* root) {... | ALGO | 0.9999 | 6.617133 |
735664b6-0254-4303-a486-2317f233da58 | AterCorvus/IdentifyFigure | IdentifyFigure/IdentifyFigure.cpp | // Identify Figure.cpp: .
//
#include "stdafx.h"
#include <fstream>
#include <iostream>
#include <string>
#include <memory>
#include <math.h>
#include "IdentifyFigure.h"
#define Matrix vector<vector<char>>
// Struct Coordinate
bool operator==( Coordinate& first_coord, Coordinate& second_coord )
{
if( ( first_... | TOOL | 0.988431 | 3.862513 |
cd73d5ed-3a52-4a97-9f5e-fbf9e4da3a48 | georgi2012/Cpp | CharStrings/string14.cpp | #include <iostream>
using std::cin;
using std::cout;
using std::endl;
using std::nothrow;
int getSentenceLenght(const char *sentence)
{
int i = 0;
while (sentence[i] != '.')
{
i++;
}
return i;
}
void printSentenceBackwards(const char *sentence)
{
const int size = getSentenceLenght(sen... | TOOL | 0.975358 | 4.584969 |
33979b5d-ef9f-4338-bc7e-378ba1455bf1 | kennent/for_scsc_code_save2 | atcoder/ABC349/d.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using pll = pair<int, int>;
using pll = pair<ll, ll>;
ll m = 0;
vector<pll> v1, v2, v3;
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
ll l, r;
cin >> l >> r;
int ri = 0, l... | ALGO | 0.999483 | 3.157819 |
dc39ea17-5e5c-453e-a917-75c785076c3c | sarvex/leetcode-chez | solution/1500-1599/1510.Stone Game IV/Solution.cpp | class Solution {
public:
bool winnerSquareGame(int n) {
int f[n + 1];
memset(f, 0, sizeof(f));
function<bool(int)> dfs = [&](int i) -> bool {
if (i <= 0) {
return false;
}
if (f[i] != 0) {
return f[i] == 1;
}
... | ALGO | 0.999983 | 6.18347 |
b0b5a07e-9238-49b6-a073-52e728ca4ac7 | ceoca-ovidiu/c-plus-plus | 1/exercise1.cpp | // Print if the entered number is prime or not
#include <iostream>
using namespace std;
int isPrimeNumber(int a) {
int div = 1;
for (int i = 2; i <= a / 2; i++) {
if (a % i == 0) {
div++;
break;
}
}
if (div == 1)
cout << "The number is prime";
else
... | ALGO | 0.999236 | 4.572248 |
ea5b37e6-9514-4f86-aaaa-31e76eb40447 | SH-MooDy/DataStructure | week8~9/prob3.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int MAX_CAPACITY = 1000000;
class Stack {
private:
char stack[MAX_CAPACITY];
int top_pos = -1;
public:
bool full() { return top_pos == MAX_CAPACITY - 1; }
bool empty() { return top_pos == -1; }
void push(char i) {
... | ALGO | 0.999803 | 6.077937 |
785fe1e8-862c-4f13-b274-ddafe40061b4 | amineleghouil/LeetCode | 17844-934-215-kth-largest-element-in-an-array/17844-934-215-kth-largest-element-in-an-array.cpp | class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
priority_queue<int> q;
for(auto & a : nums)q.push(a);
k--;
while(k--)q.pop();
return q.top();
}
}; | ALGO | 0.999895 | 5.158326 |
af27d49e-db07-494c-9209-673bc5528109 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3438_17.cpp | #include <iostream>using namespace std;int main(void){int a,b;cin >> a>>b;cout <<a*b <<" "<<a*2+b*2<<endl;}
| ALGO | 0.998902 | 3.534039 |
b89b9c26-783c-448e-b79d-8c26ef40d8aa | jdbaracho/Assingment5_Shader_Project | Assingment5_Shader_Project/dependencies/glm/test/core/core_func_integer_find_lsb.cpp | #include <glm/glm.hpp>
#include <cstdio>
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
int nlz(unsigned x)
{
int pop(unsigned x);
x = x | (x >> 1);
x = x | (x >> 2);
x = x | (x >> 4);
x = x | (x >> 8);
x = x | (x >>16);
return pop(~x);
}
int pop(unsigned x)
{
x = x - ((x >> 1) & 0... | ALGO | 0.997817 | 4.807957 |
ba749464-20a7-4c56-8244-8caf5b43f4a4 | kgpmnc/ORLab | 11_game_theory.cpp | #include<iostream>
#include<iomanip>
#include<cmath>
#define FORN(i,n) for(int i=0;i<n;i++)
#define MAX 10
#define m 2 // Player A
#define n 2 // Player B
float pay[MAX][MAX] = {{-5, 10},{20, -5}};
float mat[MAX][MAX];
float temp[MAX][MAX];
int eqn=0, var=0;
bool infinite, unbounded;
using namespace std;
void print... | ALGO | 0.999898 | 3.594964 |
5590f197-b48d-4a8b-886c-13bd42408bf8 | JN513/codigosc- | c++/sequenciadefibonacci.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void){
int n, v[20];
v[0] = 0;
v[1] = 1;
cin >> n;
cout << v[0] << " "<< v[1]<<" ";
for(int i = 2; i < n; i++){
v[i] = v[i-1]+v[i-2];
cout << v[i] << " ";
}
cout << endl;
} | ALGO | 0.999851 | 3.00891 |
463c409d-8868-4cbc-9b20-d57e572c3735 | AjayShukla1212/Data-Structures | Queues/Reverse Queue.cpp | #include<iostream>
#include<stack>
#include<queue>
using namespace std;
void reverseQueue(queue<int> &q)
{
queue<int> q2;
while(!q.empty())
{
q2.push(q.front());
q.pop();
}
q = q2;
}
int main()
{
queue<int> q;
int size;
cin >> size;
int val;
for(int i=0;i<size;i++)
{
cin >> val;
... | ALGO | 0.999873 | 3.85086 |
b8c2e797-27ad-4363-95bd-b42084ad7fed | Blackdveil/deccord-coin | src/test/fuzz/system.cpp | #include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <util/system.h>
#include <cstdint>
#include <string>
#include <vector>
namespace {
std::string GetArgumentName(const std::string& name)
{
size_t idx = name.find('=');
if (idx == std::string::npos) {
... | TEST | 0.884175 | 5.879777 |
eefddae2-fe08-46a9-8dc7-2fa548165443 | MdHamzaHossain/competitive-programming | solves/toph/0100. Who Is The Champion/CPP Who Is The Champion.cpp | #include <bits/stdc++.h>
using namespace std;
#define FAST \
ios::sync_with_stdio(0); \
cin.tie(0);
#define cinline(s) getline(cin, s);
#define ENDL "\n"
#define SCANINT(A) scanf("%d", &A);
#define SCANSTR(A) scanf("%s", &A);
#define SCANLL(A) scanf("%lld", &A);
#define SCANLD(A) scanf("%Ld", &A... | ALGO | 0.999985 | 3.095433 |
69ff4d2b-b225-40c2-bc32-4346c8b29f89 | lekimson/BT07 | LeKimSon_BT07/Challenge_01.cpp | #include <iostream>
using namespace std;
int main() {
const int size = 10;
int numbers[size];
cout << "Nhap 10 gia tri vao mang:\n";
for (int i = 0; i < size; i++) {
cout << "Gia tri " << i+1 << ": ";
cin >> numbers[i];
}
int smallest = numbers[0];
int largest = numbers[0]... | ALGO | 0.998724 | 3.698146 |
6cbe1455-0ae9-400c-8287-d61f7d767533 | aygong/srsRAN_Project_Low_Latency | lib/phy/upper/channel_processors/pdsch/pdsch_modulator_impl.cpp | #include "pdsch_modulator_impl.h"
#include "srsran/phy/support/resource_grid_mapper.h"
#include "srsran/srsvec/bit.h"
#include "srsran/support/math/math_utils.h"
using namespace srsran;
const bit_buffer& pdsch_modulator_impl::scramble(const bit_buffer& b, unsigned q, const config_t& config)
{
temp_b_hat.resize(b.si... | ALGO | 0.9225 | 6.265776 |
e5f56496-3844-4dc2-b22d-ac1e8b961386 | ugochukwujesse/chat_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.998733 | 6.76775 |
12f18a85-8f6b-4b51-9cd7-10a5f87e09bc | Gaurav-Mahaur/Leetcode-Submission | 20-valid-parentheses/20-valid-parentheses.cpp | class Solution {
public:
bool isValid(string s)
{
int n = s.size();
stack<int>st;
for(int i=0;i<n;i++)
{
if(!st.empty()&&s[i]==')'&&st.top()=='(')
st.pop();
else if(!st.empty()&&s[i]=='}'&&st.top()=='{')
st.pop();
... | ALGO | 0.999412 | 6.382358 |
fa582aac-d6c7-433e-bb0d-a7b9895db361 | amarvenna/dsabyabdulbari | 02_recursion/01_tailRecursion.cpp | #include<iostream>
using namespace std;
void tailRecursion(int n)
{
if(n>0)
{
cout<<n<<endl;
tailRecursion(n-1);
}
}
int main()
{
int n=3;
tailRecursion(n);
return 0;
}
| ALGO | 0.999857 | 4.388546 |
750dfdfd-ef7a-44d1-8a60-f0f98b030c42 | JideGuru/tiny_expr_flutter | example/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.998848 | 6.76073 |
7a7cb110-ca3b-4e82-a21f-1b0cfd57995e | pyllq/pyllq | gfx/skia/skia/src/pathops/SkPathOpsLine.cpp | #include "SkPathOpsLine.h"
SkDPoint SkDLine::ptAtT(double t) const {
if (0 == t) {
return fPts[0];
}
if (1 == t) {
return fPts[1];
}
double one_t = 1 - t;
SkDPoint result = { one_t * fPts[0].fX + t * fPts[1].fX, one_t * fPts[0].fY + t * fPts[1].fY };
return result;
}
double... | ALGO | 0.994676 | 5.690316 |
58dbc0c3-e499-44aa-bb24-0d9b66a9226c | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_2432_4.cpp | #include <bits/stdc++.h>
using namespace std;
int num[100010];
long long res[100010];
long long sum[100010];
int cmp(const void* a, const void* b) {
return *(long long*)b - *(long long*)a;
}
int main() {
long long n, q;
int i, j;
long long ans, k;
while (cin >> n) {
memset(res, 0, sizeof(res));
memset... | ALGO | 0.999888 | 3.198066 |
a5bfb49c-69b3-498b-b925-e6e0db57eb8c | u7-c/leetcode-problems | recursion/sortedarray.cpp | #include<iostream>
using namespace std;
bool isSorted(int arr[], int size) {
//base case
if(size == 0 || size == 1 ){
return true;
}
if(arr[0] > arr[1])
return false;
else {
bool remainingPart = isSorted(arr + 1, size - 1 );
return remainingPart;
}
}
int main... | ALGO | 0.999962 | 5.415977 |
bf91982e-9832-4b79-a5a8-eb954bc65a19 | aditya-sengupta/simea | lib/boost_1_70_0/libs/compute/perf/perf_stl_partition_point.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
bool less_than_20(int value)
{
return value < 20;
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::c... | ALGO | 0.982358 | 6.115492 |
78a8e2b2-ec46-4688-9cda-3d179691f9e7 | glglwty/leetcode | 10.cpp | #include <iostream>
#include <vector>
#include <algorithm>
class Solution {
public:
bool isMatch(const std::string& s, const std::string& p) {
std::vector<std::vector<bool>> f(s.size() + 1, std::vector<bool>(p.size() + 1, false));
f[0][0] = true;
for (int j = 1; j <= p.size(); j ++) {
if (p[j - 1] =... | ALGO | 0.998272 | 4.91503 |
9f9eef11-4346-4f6f-8dfe-048cf898b38c | mr-ilin/oop | Class materials/oop_2020_07/lambda_5.cpp | #include <iostream>
#include <functional>
template <typename T, typename ...Ts>
auto concat(T t, Ts ...ts)
{
if constexpr (sizeof...(ts) > 0) {
return [=](auto ...parameters) {
return t(concat(ts...)(parameters...)); };
} else {
return t;
}
}
int plus(int a,int b){
std::cout... | TOOL | 0.940734 | 5.981001 |
394c7009-d6eb-4c83-b4be-0fe300e57e9b | Zovube/Tasks-solutions | CF/rounds/hello-2019/B/sol.cpp | #include<bits/stdc++.h>
using namespace std;
string to_string(string s) {
return '"' + s + '"';
}
string to_string(const char * s) {
return to_string(string(s));
}
template < typename A, typename B >
string to_string(pair <A, B> p) {
return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template... | ALGO | 0.999953 | 3.462064 |
fcbc502e-d1d9-4f85-897a-b2ac9cc49a7d | Soveer-Shah18/Cpp-basic_questions | DtoB.cpp | //Decimal to Binary
#include<iostream>
using namespace std;
int main(){
int num=13,ans=0,rem,place=1;
while(num>0){
rem = num % 2;
num /= 2;
ans = rem * place + ans;
place *= 10;
}
cout<<ans;
} | ALGO | 0.999884 | 4.908286 |
fef8273a-89ee-46b0-891a-7f227bbd1ad9 | FelicityTomato/FHJH_CSC | mora/mora.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
srand(time(0));
cout << "剪刀0 石頭1 布2\n";
while(1){
int people; cin >> people;
if(people>2 || people<0){
cout << "cin error\n";
continue;
}
int computer=rand()%3;
cout << computer;
if(computer==people){
cout << " 平手\n";
}
else if(comp... | ALGO | 0.999778 | 3.331125 |
7d7d137e-1713-4871-9aee-0f85a858ab5d | AymenRumi/COMP322-Intro-to-C-plus-plus | functions.cpp | #include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <cctype>
using namespace std;
void countLetter()
{
string sentence;
char lowerCase;
char upperCase;
int count=0;
cout <<"Please enter a sentence: ";
getline(cin,sentence);
cout <<""<<endl;
cout <... | TOOL | 0.983352 | 4.220613 |
89056a03-283b-46a0-a928-f3ec99dda0da | xxalsgh0203/Algorithms | SSAFY_STUDY/5/20/정곤이의단조증가하는수.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int TC;
cin >> TC;
for (int testcase = 1; testcase <= TC; testcase++) {
int N;
cin >> N;
int max_num = -1;
vector<int> v;
for (int i = 0; i < N; i++) {
int numbe... | ALGO | 0.99982 | 5.533292 |
8a85b3a9-54cd-4449-a1f7-9d27e7280a6a | ishandutta2007/codeforces | ivan100sic/normal/864/D.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int a[200005];
int c[200005];
int last[200005];
set<int> nula;
bool uzeto[200005];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cerr.tie(nullptr);
cin >> n;
for (int i=1; i<=n; i++) {
cin >> a[i];
c[a[i]]++;
las... | ALGO | 0.999994 | 3.864897 |
e0326ea3-ba0e-491c-9ec3-4b8da11f91e5 | vfolunin/archives-solutions | LeetCode/2550.cpp | class Solution {
long long binPow(long long x, long long p, long long mod) {
if (!p)
return 1;
if (p % 2)
return binPow(x, p - 1, mod) * x % mod;
long long r = binPow(x, p / 2, mod);
return r * r % mod;
}
public:
int monkeyMove(int n) {
... | ALGO | 0.999993 | 5.776661 |
54b6df61-ceb8-4bcf-ab5d-6f8bfb4f0e28 | aroslhy/acm | Code/Codeforces/385A.cpp | N, C = map(int, raw_input().split())
a = map(int, raw_input().split())
b = [a[i]-a[i+1] for i in xrange(N-1)]
c = max(b)
print c-C if c > C else 0
| ALGO | 0.998172 | 3.018344 |
0492241d-f093-46b6-ab5d-7ff6b345b98a | ShikenNuggets/GadgetEngine | GadgetEngine/ConfigParser.cpp | #include "ConfigParser.h"
#include <algorithm>
#include "Debug.h"
#include "Core/FileSystem.h"
#include "Math/Math.h"
#include "Utils/Utils.h"
using namespace Gadget;
ErrorCode ConfigParser::ParseConfigFile(const std::string& path_, EngineVars& vars_){
GADGET_BASIC_ASSERT(!path_.empty());
if(!FileSystem::FileExis... | CONFIG | 0.900628 | 7.058328 |
27c8cae3-a657-46a3-9e61-157a07b4493a | PruthviKatna/DynamicProgrammingAlvin | fibonacci/recFib.cpp | #include<iostream>
using namespace std;
int fib(int n){
if(n == 0 || n==1)
return 1;
return fib(n-1)+fib(n-2);
}
int main(){
int n;
cin >> n ;
cout << fib(n) <<endl;
} | ALGO | 0.999989 | 4.680288 |
3af5712e-0f81-40fb-910e-2bd33393af27 | kyzyx/project-euler | pe287.cpp | #include <iostream>
#define M 24
using namespace std;
const long long MM = 1<<(M-1);
enum {
BLACK,
WHITE
};
int bw(long long x, long long y) {
if ((x-MM)*(x-MM) + (y-MM)*(y-MM) > MM*MM) return WHITE;
return BLACK;
}
long long slen(int x, int y, int dim, int q) {
if (q == 0) { // lower left
... | ALGO | 0.996717 | 3.048537 |
bafb555e-1c3b-4f2b-908f-84acd9ecd5cc | ManthanSharma298/DSA-Problems-Arsh-Goyal | Tree/all-nodes-distance-k-in-binary-tree.cpp |
// BFS from target node and DFS for storing parent node
// O(n+n), O(n+h+n+n)->queue, dfs, par, vis
class Solution {
unordered_map<TreeNode*, TreeNode*> par;
public:
void dfs(TreeNode* node){
if(node == NULL) return;
if(node->left){
par[node->left] = node;
dfs(... | ALGO | 0.999997 | 5.659002 |
881e3045-ae70-46ef-b54c-54d43a117cfc | aditya-agr/LeetCode-POTD | 1352. Product of the Last K Numbers.cpp | class ProductOfNumbers {
public:
vector<int> v;
ProductOfNumbers() {
}
void add(int num) {
v.push_back(num);
}
int getProduct(int k) {
int n = v.size();
int prod = 1;
for(int i=n-1; i>=n-k; i--)
prod *= v[i];
return prod;
}
};
/*... | ALGO | 0.999863 | 5.652567 |
8059c6ff-5092-43f0-b12e-4bb22313a4af | seddon-software/cpp | A10_STL_Miscellaneous/03.UsingPointersAsIterators.cpp | #include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
/*
* Although it is now customary to use STL iterators in C++ code we shouldn't forget that
* iterators are generalized pointers. Conversely, pointers meet all the criteria required
* to be defined as iterators themselves and can be ... | TOOL | 0.991529 | 4.848577 |
365b847f-0803-4484-aa0e-7563da0fc219 | sergrigordeev/yandex-cpp-courses | 01-white/exercises/10-fibbonacci/main.cpp | #include <iostream>
int Factorial ( int for_number )
{
if ( for_number < 2 ) {
return 1;
}
return for_number * Factorial ( for_number - 1 );
}
int main ( int argc, char **argv )
{
int a = 0;
std::cin >> a;
std::cout << Factorial ( a );
return 0;
}
| ALGO | 0.999633 | 4.888911 |
e675d694-745f-40fa-b23a-46e44c07e440 | greenfox-zerda-sparta/tataiferenc89 | week-02/day-3/task13/task13.cpp | #include <iostream>
#include <string>
using namespace std;
int prtwords(string sentence){
for(unsigned int i = 0 ; i<sentence.length() ; i++){
if(sentence[i]==' '){
cout << endl;
}
else{
cout << sentence[i];
}
}
return 0;
}
int main(int argc, char **argv){
string sentence="e... | TOOL | 0.983444 | 3.703776 |
57cf8058-5180-4a86-bfb2-a5670101e97a | spex66/RTSP-Camera-for-Android | RtspCamera/jni/m4v_h263/dec/src/idct.cpp | /*
------------------------------------------------------------------------------
MODULE DESCRIPTION
This file contains the functions that transform an 8r8 image block from
dequantized DCT coefficients to spatial domain pirel values by calculating
inverse discrete cosine transform (IDCT).
------------------------... | ALGO | 0.998879 | 4.652601 |
2771d4d0-80b3-4dad-ad78-3fe0bef841d1 | pavan-patel-93/Data-Structures-and-Algorithms | Trees/01_inOrderTraversal.cpp | #include<bits/stdc++.h>
using namespace std;
struct TreeNode{
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x) {
val = x;
left = nullptr;
right = nullptr;
}
};
class Solution{
public:
vector<int> inOrderTraversal(TreeNode* root){
vector<int>... | ALGO | 0.999995 | 6.047849 |
9121f8d3-aee0-48c8-93b3-817af44ee2f0 | PulsarSearchSoft/astrotypes | src/cpp/thirdparty/boost/1.65/libs/regex/src/cregex.cpp | /*
* LOCATION: see http://www.boost.org for most recent version.
* FILE: cregex.cpp
* VERSION: see <boost/version.hpp>
* DESCRIPTION: Implements high level class boost::RexEx
*/
#define BOOST_REGEX_SOURCE
#include <boost/regex.hpp>
#include <boost/cregex.hpp>
#if !defined(BOOST_NO_STD_... | TOOL | 0.910265 | 5.293292 |
f2db0de8-4820-4adb-8cfc-93e1516f751a | FadyAhmed/Nexus-Market-Place | 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.998693 | 6.797273 |
67973514-7790-4cdc-b683-fc5d0ba96d50 | AbdulMalek-swe/problem_solving_club | contest/codeforce_contest/Intercepted Inputs.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
map<int,int> mp;
int n;
cin>>n;
int k = n-2;
for(int i=0; i<n; i++) {
int x;
... | ALGO | 0.999801 | 3.232262 |
56945175-83e8-449d-8423-2e66b3d01f60 | abeesh/llvm-wine-patched | llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp | #include "llvm/Transforms/Utils/RelLookupTableConverter.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "l... | TOOL | 0.907484 | 7.8783 |
d23ca2a8-9fba-455d-a355-24eb00a12695 | Tushar-mn/dsa_practice | pattern5.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
for(int i=1; i<=n; i++){
for(int j=1; j<=n-i; j++){
cout << " ";
}
for(int j=1; j<=i; j++){
cout <<"*";
}
cout << endl;
}
} | ALGO | 0.999953 | 3.964368 |
8bdef7a1-209b-4a30-a89a-590b74ad892f | extremelydangerous/netbsd8 | pkgsrc/devel/umbrello/patches/patch-umbrello_widgets_associationline.cpp | $NetBSD: patch-umbrello_widgets_associationline.cpp,v 1.1 2016/07/16 03:36:51 markd Exp $
make gcc6 happy
--- umbrello/widgets/associationline.cpp.orig 2014-11-04 06:47:37.000000000 +0000
+++ umbrello/widgets/associationline.cpp
@@ -859,8 +859,8 @@ QPainterPath AssociationLine::createOrth
if (points.size() > 1) ... | TOOL | 0.91072 | 5.658534 |
9fd38047-62a7-41ca-9a48-0010e669c239 | Arunkumar0176/Basic_DSA | OOPS/passingClassToFunc.cpp | #include<iostream>
using namespace std;
class car{
public:
int price;
string name;
};
void change(car x){
x.name = "Honda Amaze";
x.price = 800000;
}
//its a pass by value
int main(){
car c1 = {1200000, "kia sonet"};
cout<<c1.name<<" "<<c1.price<<endl;
change(c1);
//car c2 = {800000... | TOOL | 0.920699 | 4.596889 |
606b5b0d-c7a0-46c9-b6e2-95fe4d58dc39 | waliallah19/PFweek07 | task6.cpp | #include <iostream>
using namespace std;
int calculateGCD(int number1, int number2);
int calculateLCM(int number1, int number2, int gcd);
main()
{
int number1, number2;
int gcd, lcm;
cout << "Enter 1st number: ";
cin >> number1;
cout << "Enter 2nd number: ";
cin >> number2;
gcd = calculateGC... | ALGO | 0.997171 | 3.930438 |
82a64430-edc9-404b-8999-2dccdd78004e | SaadHusayn/leetcode | 0203-remove-linked-list-elements/0203-remove-linked-list-elements.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* removeElem... | ALGO | 0.999935 | 5.848469 |
73621be1-4e21-401f-9ec5-bb8e75f609c6 | Sam-Han2020/Data-Structure | C++STL/stack.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
int main()
{
stack<double> stk;
stk.push(1.0);
stk.push(1.4);
cout<<stk.size()<<endl;
cout<<stk.top()<<endl;
stk.pop();
cout<<stk.top()<<endl;
stk.pop();
cout<<stk.empty()<<endl;
// vector模拟栈
vecto... | ALGO | 0.982163 | 3.846178 |
d3e7abac-3680-4542-b703-2d3f4a6464e1 | jimlin2004/LeetCode | PrefixSum/1769/1769.cpp | #include <bits/stdc++.h>
using namespace std;
// class Solution
// {
// public:
// // O(n ^ 2)解法,非常之簡單
// vector<int> minOperations(string boxes)
// {
// vector<int> res;
// int n = boxes.size();
// for (int i = 0; i < n; ++i)
// {
// int total = 0;
// ... | ALGO | 0.999969 | 5.285481 |
5dc58e08-8d41-48e2-b421-a1e66312e628 | KimAnh148/CPP | ct-3.cpp | #include <iostream>
#include <set>
using namespace std;
int main() {
int N;
cin >> N;
int A[N][N];
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
cin >> A[i][j];
}
}
set<int> uniqueNumbers;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N... | ALGO | 0.999167 | 3.990911 |
cd5eda4e-d53d-44f1-90a9-838f01d04e26 | mehak0108/Programming | Codeforces/259B.cpp | #include <bits/stdc++.h>
#define ONLINE_JUDGE freopen("../input","r",stdin); freopen("../output","w",stdout);
#define MAX 100001
#define ll long long
#define ld long double
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define all(a) (a).begin... | ALGO | 0.999453 | 3.056495 |
58bdc141-12fc-4602-a719-8be8181ed82d | CodeB3nder/Data_Structures_and_Algorithms- | alg_DIVIDE_AND_CONQUER/inv.cpp | # include <iostream>
using namespace std;
int inv(int arr[], int n)
{
for(int i = 0; i < n; i++)
{
for(int j = i+1; j < n; j++)
{
if(arr[i] > arr[j])
cout << "(" << arr[i] << "," << arr[j] << ")" << endl;
}
}
}
int main()
{
int arr[] = {2,4,1,3,5};
inv(arr,sizeof(arr)/sizeof(arr[0]));
return 0;
}
| ALGO | 0.999505 | 4.023677 |
13153c06-b950-478c-984b-88ce79fc0936 | NicolaCiliberti/HLL-WENO | Grid.cpp | #include "Grid.h"
#include "Print.h"
#include <iostream>
#include <valarray>
Grid::Grid(int nx, int ny, double dx, double dy, std::string & prob)
: nx(nx), ny(ny), dx(dx), dy(dy), prob(prob) {
// Inizializzazione dei vettori per densità, velocità e pressione
rho_.resize(nx * ny, 0.0);
u_.resize(nx ... | ALGO | 0.998734 | 4.216594 |
8f9c34ff-5cb1-4ecf-a163-9b2610e20b1d | turneja123/competitive-programming-library | Algorithm/Data Structures/Lazy Propagation - Range Update Queries.cpp | //solution for https://cses.fi/problemset/task/1651/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define endl "\n"
#define ll long long
#define IOS ios_base::sync_with_stdio(false); cin.tie(nullptr);
const int N = 2e5 + 5;
ll a[N];
ll segtree[4 ... | ALGO | 0.999713 | 5.577733 |
0c438e58-3725-430f-a41a-01e31ca75930 | AdrianRicoy/Tareas_de_cpp_1 | Calificación/main.cpp | // ******************* Incluir libreras *******************
#include "iostream"
#include "string"
#include <stdlib.h>
#include <time.h>
using namespace std;
// ******************* Variables *******************
int calficaiones[50], concurencia[11];
int mayor = 0, frecuencia = 0, index, num;
int i, j, lim = 50;
/... | ALGO | 0.999284 | 5.26719 |
412d6993-75a7-492b-b88c-21d28d2080de | ms303956362/myexercise | Cpp/LeetCode/dwc95_3.cpp | #include "usual.h"
class Solution {
public:
int xorBeauty(vector<int>& nums) {
int ans = 0;
long long n = nums.size();
for (int k = 0; k < 31; ++k) {
long long c0 = 0, c1 = 0;
for (int i = 0; i < n; ++i) {
if (nums[i] & (1 << k)) {
... | ALGO | 0.999923 | 5.527128 |
18f7a831-40dd-4db5-b6bc-ec5bba6f86a7 | chinmayajha/Code | 1294C.cpp | #include "bits/stdc++.h"
using namespace std;
#define int long long
int first_prime_factor(int n, int diff) {
for(int i = diff + 1; i * i <= n; i++) {
if(n % i == 0) return i;
}
return -1;
}
signed main() {
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); // for shuffle(...... | ALGO | 0.999696 | 4.632411 |
af944d82-8660-448f-8ff8-1245a2d3ad87 | Yif1999/MiniEngine | engine/thirdparty/oidn/mkl-dnn/src/cpu/matmul/gemm_x8s8s32x_matmul.cpp | #include <atomic>
#include <assert.h>
#include <float.h>
#include <math.h>
#include "common/c_types_map.hpp"
#include "common/dnnl_thread.hpp"
#include "common/memory_tracking.hpp"
#include "common/type_helpers.hpp"
#include "common/utils.hpp"
#include "cpu/cpu_primitive.hpp"
#include "cpu/gemm/gemm.hpp"
#include ... | ALGO | 0.95451 | 7.619194 |
6c85c953-d5e4-464c-a5b1-39d137e5fd4d | Elliotshui/leetcode_solution | 724.find-pivot-index.cpp | /*
* @lc app=leetcode id=724 lang=cpp
*
* [724] Find Pivot Index
*/
// @lc code=start
class Solution {
public:
int pivotIndex(vector<int>& nums) {
int sum = 0;
vector<int> sums(nums.size() + 1, 0);
sums[0] = 0;
for(int i = 0; i < nums.size(); ++i) {
sum += nums[i];
... | ALGO | 0.999982 | 6.575334 |
35c07e42-2600-4b25-beb9-663c0296b490 | klishevich/cpp-algorithms2 | adventofcode2024/day13_claw_contraption/main.cpp | // https://adventofcode.com/2024/day/8
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <stdexcept>
#include <iterator>
using namespace std;
string input1();
int main()
{
string str;
int res = 0;
unordered_map<char, vector<... | ALGO | 0.989416 | 5.416908 |
61a25d00-7b88-4c85-9fa8-19b3e7ba0dbb | tajmone/tads-sources | tads3/msgcomp.cpp | #ifdef RCSID
static char RCSid[] =
"$Header$";
#endif
/*
Name
msgcomp.cpp - T3 Message Compiler
Function
Notes
Modified
05/14/00 MJRoberts - Creation
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "t3std.h"
#include "vmerr.h"
#include "charmap.h"
#include "resload.h"
#include "vmregex.... | TOOL | 0.905288 | 7.07094 |
7806ebe9-a3db-4ea1-bd66-1964ec3c1757 | MahirSez/problem-solving | codeforces/1202/D.cpp | #include <bits/stdc++.h>
#define ll long long int
#define PI acos(-1)
#define read freopen("in.txt","r",stdin)
#define uu first
#define vv second
#define write freopen("out.txt","w",stdout)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define INF ... | ALGO | 0.999822 | 4.198043 |
89b89bf4-dd18-4bed-8765-041b44c1595a | Redleaf23477/ojcodes | codeforces/edu13/B.cpp | //
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long int ll;
int y;
void init();
void process();
int main()
{
ios::sync_with_stdio(false); cin.tie(0);
init();
process();
cout.flush();
return 0;
}
void init()
{
cin >> y;
}
bool isleap(int y)
{
if(y % 4 !=... | ALGO | 0.999931 | 4.041192 |
1ed8d650-54fb-4fed-9cb8-340d94029152 | zoetian/bustub | src/buffer/lru_k_replacer.cpp | #include "buffer/lru_k_replacer.h"
#include <limits>
#include <mutex>
#include <optional>
#include <unordered_map>
#include <vector>
#include "common/config.h"
#include "common/exception.h"
namespace bustub {
/**
* @brief a new LRUKReplacer.
* @param num_frames the maximum number of frames the LRUReplacer will be r... | ALGO | 0.901989 | 7.379868 |
a472487d-ba4d-40d2-b65c-6c50528e577f | sourav-islam/XPSC | Week 8/Day 5/Starters 134/Rock_Paper_Scissors.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int max_games_won(string A)
{
int cnt = 0;
for (int i = 0; i < A.size(); i++)
{
if (A[i] == A[i + 1])
{
cnt++;
i++;
}
}
return cnt;
}
int main()
{
int t;
cin >> t;
while (t--)... | ALGO | 0.999942 | 4.670546 |
851e48bb-3d67-4662-987b-a3f5e6cc817a | nirvana369/UVA-problem-solved | 12356.cpp | /*
Hoang Linh
*/
#include <cstdlib>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <map>
#include <queue>
#include <iostream>
#define fi "12356.inp"
#define fo "12356.out"
/**/
using namespace std;
/**/
long trai[100100],phai[100100];
long l,r;... | ALGO | 0.999707 | 3.274456 |
7e50365a-9c53-409a-a470-c0b3e3054e84 | SujalSinghNegi/All-DSA-C-plus-plus-_- | 15. Dp/q1_climbing_stairs/ans.cpp | // just like a fibnacci series
class Solution {
public:
int climbStairs(int n) {
n=n+1;
if(n<=1) return n;
int pre=0, pre2=1;
for(int i=2; i<=n; i++){
int cur = pre+pre2;
pre= pre2;
pre2=cur;
}
return pre2;
}
}; | ALGO | 0.999984 | 5.439535 |
9a4d4072-0e2a-4043-8fa7-80f083753fb5 | jiwoo0629/Baekjun_Algorithm | algorithm/DP/가장 긴 증가하는 부분수열.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int arr[1005];
int len[1005];
int main(void) {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> arr[i];
len[i] = 1;
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < i; j++)
... | ALGO | 0.999961 | 3.940337 |
60b39392-cdff-48ab-a563-1fe662276b09 | VineetKurapati/LeetCode-Solutions | 153-find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array.cpp | class Solution {
public:
int findPivot(vector<int>& nums){
int start = 0;
int end = nums.size() - 1;
int mid = 0;
while(start <= end){
int mid = start + (end-start)/2;
//Not Rotated
if(nums[start] < nums[end]) return (nums.size()-1);
... | ALGO | 0.999995 | 5.356119 |
c701e0c6-3668-4ad1-8aca-1b7f4ef43ad2 | anilkrrana/Leetcode-Problem-Solved | 0207-course-schedule/0207-course-schedule.cpp | class Solution {
using vi = vector<int>;
public:
template <typename Tmp, typename Tv>
bool iscycle(Tmp& adj, Tv& vis, int id){
if (vis[id] == 1) return true;
if (vis[id] == 0) {
vis[id]=1;
for (auto& edge : adj[id])
if (iscycle(adj,vis,edge)) return t... | ALGO | 0.99993 | 6.14219 |
d7bfe2ff-4f75-4b82-b951-194fb9319ec9 | Devansh968/LEET-CODE-SOLUTIONS | 1790-check-if-one-string-swap-can-make-strings-equal/1790-check-if-one-string-swap-can-make-strings-equal.cpp | class Solution {
public:
bool areAlmostEqual(string s1, string s2) {
int a=s1.length();
int b=s2.length();
int i,j;
for(i=0;i<a;i++){
if(s1[i]!=s2[i]){
break;
}
}
for(j=i+1;j<a;j++){
if(s1[j]!=s2[j]){
s... | ALGO | 0.999969 | 6.189854 |
848f776a-bc59-416d-bf47-953f94597e95 | iagoCL/ActorFramework | examples/Squirrels-Simulation/src/Squirrel.cpp | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "../../../ActorFramework/include/Logger.h"
#include "../include/RandomGenerator.h"
#include "../include/Squirrel.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define BIRTH_PROBABILITY 100.0f // Decrease this to ... | ALGO | 0.994609 | 5.300526 |
70c2f750-4fe0-4310-a05c-f6097b80a43d | manikanta2901/CCC | .history/Day 3/Practice/Answers/Caesar Cipher_20210307163240.cpp | // // #include <cmath>
// // #include <cstdio>
// // #include <vector>
// // #include <iostream>
// // #include <algorithm>
// // using namespace std;
// // int main(){
// // int size,k;
// // string s;
// // cin >> size >> s >> k;
// // for (int i = 0; i <= size; i++) {
// // if (s[i] >= 'ma... | ALGO | 0.999924 | 4.598487 |
60daf302-56f0-42dc-8499-90a391ed3686 | sherryshare/blaze-2.0 | blazemark/src/blitz/Mat6TMat6Mult.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.997653 | 4.986374 |
48e1a0a9-6eb3-4d9c-9ccd-5f69c5668e5f | ishandutta2007/codeforces | nantf/normal/1223/D.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn=300030,mod=998244353;
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
#define MEM(x,v) memset(x,v,sizeof(x))
inline int read(){
int x=0,f=0;char ch=getchar();
while... | ALGO | 0.999924 | 4.969943 |
3dac1db6-3019-4767-8d37-658c5817e410 | sarvex/leetcode-s | solution/0200-0299/0239.Sliding Window Maximum/Solution.cpp | class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k) {
deque<int> q;
vector<int> ans;
for (int i = 0; i < nums.size(); ++i) {
if (!q.empty() && i - k + 1 > q.front()) {
q.pop_front();
}
while (!q.empty() && nums[q... | ALGO | 0.999996 | 6.458154 |
f5b946b0-dbe1-4d72-8d7d-a0d1d47444b0 | ABB00717/leetcode | problems/cpp/3264.Final-Array-State-After-K-Multiplication-Operations-I.cpp | #include <queue>
#include <vector>
class Solution {
private:
struct Num {
int val;
int index;
Num(int val, int index) : val(val), index(index) {}
bool operator<(const Num &other) const {
return this->val > other.val ||
(this->val == other.val && this->index > other.index);
}
... | ALGO | 0.999987 | 5.174572 |
d73c4402-b675-44ee-82d3-40cb5d895265 | shhjwu5/DataStructure | homework8/1056_old.cpp | #include <iostream>
#include <cstdio>
using namespace std;
struct node{
int number;
node* big;
node* small;
node():number(1),big(NULL),small(NULL){};
};
const int maxn = 500000+10;
node* myData[maxn] = {NULL};
int main()
{
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n,m;
cin>>n>>m;
for(int i ... | ALGO | 0.999582 | 3.949533 |
726c29e8-cee7-4bfb-b131-182299cef22d | ElderTree/Anycubic_i3-_BLTouch | Referenzen/Marlin-AI3M-BLTouch/Marlin/planner_bezier.cpp | /**
* planner_bezier.cpp
*
* Compute and buffer movement commands for bezier curves
*
*/
#include "MarlinConfig.h"
#if ENABLED(BEZIER_CURVE_SUPPORT)
#include "planner.h"
#include "language.h"
#include "temperature.h"
#include "Marlin.h"
// See the meaning in the documentation of cubic_b_spline().
#define MIN_S... | ALGO | 0.999709 | 7.901816 |
e4e8c7d5-be1e-470b-898d-79a7869bc4fe | Mwako/deps | boost/libs/exception/src/clone_current_exception_non_intrusive.cpp | //This MSVC-specific cpp file implements non-intrusive cloning of exception objects.
//Based on an exception_ptr implementation by Anthony Williams.
#ifdef BOOST_NO_EXCEPTIONS
#error This file requires exception handling to be enabled.
#endif
#include <boost/exception/detail/clone_current_exception.hpp>
#if defined(... | TOOL | 0.868663 | 6.606876 |
824fc12e-de51-4d73-a464-c860c55e8368 | DyhaCreator/programming_tasks | smena/smena2/0100/a.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
const int INF = 1e9 + 7;
void solve() {
int a, b;
cin >> a >> b;
cout << a * b << endl;
}
int main() {
int t;
cin >> t;
while (t--) solve();
return 0;
} | ALGO | 0.999711 | 5.599927 |
257c2de3-6630-4bb6-8542-4e45462f86fa | skyline-emu/audio-core | renderer/command/effect/reverb.cpp | #include <range/v3/algorithm.hpp>
#include <numbers>
#include <ranges>
#include <audio_core/renderer/adsp/command_list_processor.h>
#include <audio_core/renderer/command/effect/reverb.h>
#include <audio_core/common/polyfill_ranges.h>
namespace AudioCore::AudioRenderer {
constexpr std::array<f32, ReverbInfo::MaxDelay... | ALGO | 0.912752 | 7.611139 |
891c2529-d5ed-4b80-8c7b-56cdb65ad63e | ysfkymz/my-c-codes | c_DERS/fonksiyon/fonksiyon+toplama.cpp | #include <stdio.h>
#include <conio.h>
int topla(int a,int b){
return a+b;
}
int carp(int a,int b){
int i,toplam=0;
for(i=0;i<b;i++)
{
toplam = topla(toplam,a);
}
return toplam;
}
int main() {
printf("%d",carp(3,5));
getch();
return 0;}
| ALGO | 0.998531 | 3.518279 |
c7257f46-3294-4498-9786-e17c54bff5b2 | anishasharma-web/Strivers-SDE-Sheet-Challenge | 10)Find_duplicate_in_array.cpp | #include<bits/stdc++.h>
using namespace std;
int findDuplicate(vector < int > & nums,int n) {
int slow = nums[0];
int fast = nums[0];
do {
slow = nums[slow];
fast = nums[nums[fast]];
} while (slow != fast);
fast = nums[0];
while (slow != fast) {
slow = nums[slow];
fast = nums[fast];
}
r... | ALGO | 0.999866 | 5.020961 |
47fb5927-419c-4ac5-8e82-e5b1d71d2bed | AnkitBanerjee007/BinaryTreesDay1 | LevelOrder.cpp |
// Level order Traversal -- Breadth First Search
// Using QUEUE
#include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
struct Node* left;
struct Node* right;
};
void levelOrder(Node* root){
// Base Case
if(root == NULL){
return ;
}
// Creating a queue
queue<Node*> q;
// Put the root in... | ALGO | 0.999982 | 5.317206 |
4f5f7aad-d700-4161-8e6b-e1c27c0f997a | tofergregg/CodeReview | course/cs106b/1176/midterm/p2/student_168.cpp | string decode(string seq) {
int length = seq.size()+1;
string str;
int increases;
int decreases;
Queue<int> queue;
Stack<int> stack;
Vector<int> values;
for (int i = 1; i <= length; i++) {
queue.enqueue(i);
stack.push(i);
values.add(i);
}
for (int i = 0; i < seq.size(); i++) {
if (seq[i] == 'I') {... | ALGO | 0.99991 | 5.669923 |
272a9e67-a6de-442d-a090-52c19ae6b4ed | heavenMOJANG/ICPC | .history/AtCoder/abc381/F_20241130193808.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
constexpr int N = 2e5 + 10;
int n, a[N], dp[(1ll << 20)], nxt[N][20];
void solve() {
cin >> n;
for (int i = 0; i < n; ++ ... | ALGO | 0.999794 | 4.572493 |
71989d53-24e2-4dd7-890a-28ca43c9efa7 | namnguyen16082008/VNOJ | fc134_gcd.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
const ll N=200005;
ll n,m,a[N],b[N],ans=0;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>n>>m;
for (ll i=1;i<=n;i++) cin>>a[i];
for (ll i=1;i<=m;i++) cin>>b[i];
sort(a+1,a+n+1);
for (ll i=1;i<n;i++) ... | ALGO | 0.999975 | 3.122254 |
79c6187d-d465-471d-9fc5-c59f2ca37efb | Dulon18/Pattern-Printing-Program | pattern-8.cpp | #include <iostream>
void pattern(int n)
{
// Upper half of the diamond (including the middle row)
for(int row = 0; row < n; row++)
{
for(int space = n; space > row + 1; space--)
{
std::cout << " ";
}
for(int col = 0; col <= row * 2; col++)
{
... | ALGO | 0.997204 | 7.168874 |
5b12b5a9-39d2-4cb4-abf1-284d54de700f | khanhtran219/DSA | dichuyentrongmatranqueue.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t; cin >> t;
while(t--){
int m,n,ok=0; cin >> m>>n;
int a[m+5][n+5];
for(int i = 1; i <= m; i++){
for(int j = 1; j <= n; j++){
cin >> a[i][j];
}
}
queue<pair<int,int> > q;
q.push({1,1});
int f[m+5][n+5] = {0};
while(!q.empty()){
... | ALGO | 0.999804 | 3.878318 |
48126eb1-b17f-4325-8ed4-519d1ef0ded0 | bayashi-cl/procon-submission | atcoder/abc002/abc002_3/24551692.cpp | #include <atcoder/math>
#include <atcoder/modint>
#include <boost/range/irange.hpp>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <valarray>
#i... | ALGO | 0.999752 | 5.054266 |
3fd090f5-f52b-46d9-a247-3ae234a459c3 | woshigerunze/DataStructure | ACoj/03.cpp | //
// Created by 葛润泽 on 2020/7/14.
//
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> weight{1,2,3,4};
vector<int> value{2,4,4,5};
int volume=6;
vector<int> dp(volume+1,0);
for(int i=0;i<weight.size();i++)
{
for(int j=weight[i];j<=volume;j++) {
... | ALGO | 0.999609 | 4.785385 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.