uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
99ec4c37-2e4d-41dc-9382-5e85ba4f4642 | AyanDas-99/Learning-Dsa | recursion/sumOfN.cpp | #include <iostream>
using namespace std;
long sum(int n){
if(n==1)
return 1;
return n+sum(n-1);
}
int main()
{
// int a;
// cin>>a;
cout << sum(cin);
return 0;
}
| ALGO | 0.997999 | 3.416049 |
1d529d3a-e645-4891-9e02-8c366d14e04e | SmrutiSucharitaMishra/30-days-of-code | DAY-28/PERMUTATION.CPP | #include<bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
// your code goes here
int a;
cin>>a;
while(a--){
int n;
cin>>n;
int a[n];
{for(int i=0;i<n;i++)
cin>>a[i];
}
int sum=0,k=0;
sort(a,a+n);
for(int i=0;i<n;i++){
if(a[i]> i+1)
... | ALGO | 0.999288 | 3.888903 |
7d25bef8-3188-46d7-8697-bf1eadc1987b | Danielbook/TNG033_-_Programmering_i_C- | Lectures/Lecture13/exemple1.cpp | /***************************************************************************
* TNG033: F 13 *
* 1. Read a sequence of user given integers *
* 2. Store the user given values in a vector, but without repeated values *
* 3. Display ... | ALGO | 0.999791 | 5.464789 |
b551d656-8790-4e3e-a9ae-8583fc22153a | Yugg007/-SdeSheetChallenge | Day5/Delete Kth node From End.cpp | #include <bits/stdc++.h>
template <typename T>
class LinkedListNode
{
public:
T data;
LinkedListNode<T> *next;
LinkedListNode(T data)
{
this->data = data;
this->next = NULL;
}
};
LinkedListNode<int>* removeKthNode(LinkedListNode<int>... | ALGO | 0.99994 | 4.640848 |
c3116cf8-94d7-4e5a-8e7a-ba6866dee2bd | NG-Geeks/Leetcode_POTD | December_2023/1422. Maximum Score After Splitting a String.cpp |
1422. Maximum Score After Splitting a String
Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. left substring and right substring).
The score after splitting a string is the number of zeros in the left substring plus the number of ones in the... | ALGO | 0.999943 | 5.560305 |
23ca7d01-2922-448d-858c-503f7a8d1f70 | faisalkn-71/XPSC | Week-6/Day-3/C_Save_More_Mice.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--){
ll n, k;
cin>>n>>k;
vector<ll> ara(k);
for(int i=0; i<k; i++) cin>>ara[i];
sort(ara.r... | ALGO | 0.999812 | 3.647711 |
569ba276-b290-4a5f-be0b-92ddee5bf511 | LANSGANBS/MyCppCode_Vscode | Codeforces/个人训练赛20241206/D_Mark_and_Lightbulbs.cpp | #include <bits/stdc++.h>
// #include <bits/extc++.h>
using namespace std;
// using namespace __gnu_pbds;
#define i64 long long
#define i128 __int128
#define endl '\n'
#define buff ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define ture true
#define flase false
#define pow power
#define all(x) begi... | ALGO | 0.999933 | 5.455647 |
74927bb0-81d0-4e96-9d64-78304f90aebf | woozway/PAT | 团体程序设计天梯赛-练习集/L1-029 是不是太胖了 (5分).cpp | #include <iostream>
using namespace std;
int main() {
int h;
scanf("%d", &h);
printf("%.1f", 1.8 * (h-100));
return 0;
}
| ALGO | 0.998457 | 3.242345 |
c7166d0c-3089-4d24-8f6d-12bc0be73c63 | isaac56/Algorithm_Cpp | 공부/공부/여행경로.cpp | #include <string>
#include <vector>
#include <stack>
#include <algorithm>
#include <iostream>
using namespace std;
struct situation {
int usingTicket = -1;
vector<string> history;
vector<bool> consume;
};
bool compare(vector<string> v1, vector<string> v2) {
return v1[1] > v2[1];
}
vector<string> sol... | ALGO | 0.99976 | 6.088814 |
60a208eb-27ef-415a-b573-5ed51d78d4b2 | bajajvinamr/HacktoberFest2020 | Competitive Programming/AdvancedCppTemplate.cpp | /*---------koolgax99---------------*/
#include <bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i, n) for (i = 0; i < n; i++)
#define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define ll long long
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#def... | ALGO | 0.999512 | 4.160419 |
f73e2454-e455-4587-b06f-1bd1a963f6f2 | Asif-Iqbal-Gazi/LeetCode | ebay/medium/dynamic-programming/416.partition_equal_subset_sum.cpp | /*
* @lc app=leetcode id=416 lang=cpp
*
* [416] Partition Equal Subset Sum
*/
// @lc code=start
class Solution {
private:
/* Approach 1 -- Recursion + Memoization
int dp[201][20001];
bool solveRec(int ind, int subOneSum, vector<int> &nums) {
// Base Case
if (subOneSum == 0)
... | ALGO | 0.999899 | 6.333853 |
7ade1562-123d-48d2-a255-3030e946e125 | lee-jeong-geun/ps | boj/9536.cpp | #include <cstdio>
#include <iostream>
#define NULL 0
#define Mod 9991
using namespace std;
typedef struct node
{
char word[105];
node *link;
}Node;
char sound[20005];
Node Sound[105], chk[10005];
int sidx;
/*
각 문자열들을 빠르게 매칭시키기 위해 해시를 사용 하였다.
충돌 방지를 위해 연결리스트를 사용하였다.
해시 테이블에 저장 되어있지 않은 문자열만 출력을 하면 된다.
*/
int strl... | ALGO | 0.998823 | 3.609664 |
ce2c55f9-cae0-4d5f-873c-2d54664d06ab | commitIrshad/LinkedList | insertElementAtBegin.cpp | // Inserting element at the Begining of the Node
//output : 78->67->55->34->10
#include <iostream>
#include<algorithm>
using namespace std;
class Node{
public : int val;
Node *next;
//Constructor
Node(int val){
this->val = val;
this->next = NULL;
}
};
void insert... | ALGO | 0.999713 | 4.144305 |
f14a1293-60fa-448b-a7ce-443e55ba9e75 | Bipul-Harsh/Practice-GeeksForGeeks | ShortestPathBetweenCities.cpp | // { Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
int shortestPath( int x, int y){
// code here
vector<int> x_ancestors = {x};
vector<int> y_ancestors = {y}... | ALGO | 0.999957 | 5.975907 |
c7e04a1f-636a-41fe-a0e7-9314196ca19a | seungHoon0422/programmers | 다리를지나는트럭.cpp | #include <string>
#include <vector>
#include <queue>
#include <iostream>
using namespace std;
int solution(int bridge_length, int weight, vector<int> truck_weights)
{
int answer = 0;
int total = 0;
int count = 0;
queue<int> q;
while (true)
{
answer++;
if (q.size() == bridge_len... | ALGO | 0.999921 | 5.533116 |
f1d9a4e4-8fab-4140-b54d-62e6621fba92 | r-ex/LegionPlus | cppnet/cppkore/CRC32.cpp | #include "stdafx.h"
#include "CRC32.h"
namespace Hashing
{
// The table of precalculated CRC32 primes.
static constexpr uint32_t CRC32LookupTable[] =
{
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
0x09b64c2b, 0x... | ALGO | 0.992316 | 6.772072 |
72c67173-7b98-435c-8dbc-421c1b38747d | iAbhayRajput/DSA | C++/290-300/291.cpp | class Solution {
public:
bool solve(vector<int>& arr, int sum, int i, vector<vector<int>> &dp){
if(sum==0) return true;
if(i==arr.size()) return false;
if(dp[i][sum]!=-1) return dp[i][sum];
bool pick = false, nopick=false;
if(arr[i]<=sum) pick=solve(arr,sum-arr[i],i+1,dp);... | ALGO | 0.999949 | 5.757598 |
2c1cf7b9-9a85-479f-9abe-c6d4278a21eb | Gurmeet-20/Basics-01 | June 27/June 27/Lab 11.cpp | #include <iostream>
#include <string>
using namespace std;
class NumDays {
private:
double WorkHrs;
double WorkDays;
public:
void setWorkHrs(double);
void setWorkDays(double);
double getWorkHrs() const;
double getWorkDays() const ;
void input();
void output();
NumDays();
NumDays(double a, double b= 2)... | TOOL | 0.963265 | 3.423504 |
9fe3f335-d14f-406f-be19-4da244164477 | ishandutta2007/codeforces | alex9801/normal/657/B.cpp | #include <stdio.h>
#include <algorithm>
int arr[200010];
long long two[100];
long long ab(long long x)
{
return x<0 ? -x : x;
}
int main()
{
int n, k, p = 0, r = 0, i, j;
bool u;
long long s, t, x, y;
scanf("%d%d", &n, &k);
for(i = 0; i<=n; i++)
scanf("%d", &arr[i]);
two[0] = 1;
for(i = 1; i<63; i++)
tw... | ALGO | 0.999974 | 3.598428 |
e66abd42-85c0-480b-a741-626a55ace955 | lsjtcdxp/LegionCore-7.3.5 | src/server/game/Entities/Player/KillRewarder.cpp | #include "Creature.h"
#include "Formulas.h"
#include "Group.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "InstanceScript.h"
#include "KillRewarder.h"
#include "Player.h"
#include "ScenarioMgr.h"
// == KillRewarder ====================================================
// KillRewarder incapsulates logic of reward... | TOOL | 0.97475 | 6.096309 |
5df2b98f-7482-4a3f-84f7-1ce073ff80a7 | xubin1994/parallel-stereo-matching-using-belief-propagation | stereo-matching-using-belief-propagation/MarkovRandomField.cpp | #include "pch.h"
#include "MarkovRandomField.h"
void initializeMarkovRandomField(MarkovRandomField& mrf, const string leftImgPath, const string rightImgPath,
const MarkovRandomFieldParam param) {
Mat leftImg = imread(leftImgPath, 0);
Mat rightImg = imread(rightImgPath, 0);
mrf.heig... | ALGO | 0.99933 | 4.557004 |
3ffdd90e-b99c-48cd-995f-2eef2336f09f | Mahudesh/Data-Structures-And-Algorithms | Heap And Priority Queue/Min Heap Implementation.cpp | class minHeap {
public:
vector<int>arr;
int size=0;
void heapify_up(vector<int>& arr, int ind)
{
int parent=(ind-1)/2;
if(ind>0)
{
if(arr[ind]<arr[parent])
{
swap(arr[ind],arr[parent]);
heapify_up(arr,parent);
}
... | ALGO | 0.999369 | 5.708379 |
cdf9294e-e16c-4022-8914-d449946d5820 | Lightyagami1/training | spoj/invcnt.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define endl "\n"
#define cerr if(1)cerr //make me 0 before submitting
#define eb emplace_back
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin... | ALGO | 0.999675 | 4.276529 |
0aa97789-2cdb-4283-b579-a4faaa459324 | MatgoAyato/Lab2_RPBO | Lab3/RBPO.LAB2.Variant22.Task2.cpp | #include <iostream>
module RBPO.LAB2.Variant22.Task2;
namespace RBPO {
namespace Lab2 {
namespace Task2 {
double f1(double x) {
return (4 - pow(x, 2)) / 2;
}
double f2(double x) {
if (x > 3.0) {
return 1.2 * pow(x, 2) - 3 * x - 9;
}
else {
return 12 / (2 * pow(x, 2) + 1);
}
... | ALGO | 0.999913 | 4.269224 |
2c5a649d-8583-4515-874d-91bdbafb8b53 | aa940249tw/UNIX-Programming | HW4/debugger.cpp | #include <bits/stdc++.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/ptrace.h>
#include <sys/user.h>
#include <sys/reg.h>
#include <capstone/capstone.h>
#include <string.h>
#include <limits.h>
#include <elf.h>
#include <inttype... | TOOL | 0.917456 | 3.063643 |
029c3bee-37b6-4f6d-908f-4721a6165697 | duynhan39/Kattis | fridge.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
string input;
cin >> input;
int arr[10];
for(int i=0; i<10; i++)
arr[i]=0;
for(int i=0; i<input.size(); i++)
arr[input[i]-'0']++;
arr[0]++;
int smallest=arr[0], num=0;
for(int i=0; i<10; i++)
... | ALGO | 0.999967 | 4.493793 |
94c6a5bb-2aa7-4cfa-ac0e-1ef919c7182f | idityaGE/DSA | 05. LinkedList/05. Hard problem LL/06. sortLL.cpp | #include <bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int val)
: data(val), next(nullptr) {}
Node(int val, Node* nextNode)
: data(val), next(nextNode) {}
};
void print(Node* head) {
if (head == nullptr) return;
Node* temp = head;
while (temp != nullpt... | ALGO | 0.999991 | 5.667664 |
dbd3bfa1-4599-484b-8a97-8efcf6cc406e | Kungpao/Studied-Materials | C++/BinaryTree/BinaryTree_v2/BinaryTree_Main.cpp |
#include "stdafx.h"
#include "BinaryTree.h"
#include <stdio.h>
#include <time.h>
#include <conio.h>
int main()
{
// for restarting program. appointing ESC as exit button to press
int exit = 0;
while (exit != 27)
{
//Generating random unique values to add to our tree
//-----------------------------------------... | TOOL | 0.93942 | 4.270764 |
a0f77e41-97bb-4c27-9d73-419aea1b5d71 | zhaogaowei/algorithms | algorithms/Tree.cpp | #include <iostream>
#include "BSTree.h"
using namespace std;
int main() {
BSTree<int> b;
b.insert(4);
b.insert(1);
b.insert(2);
b.insert(8);
b.insert(5);
b.insert(6);
b.insert(9);
b.printTree(cout);
cout << endl;
b.remove(2);
b.printTree(cout);
system("pause");
return 0;
} | ALGO | 0.985023 | 4.648613 |
e91dd2d6-3fee-4db6-96c1-66b2164b33e4 | shivangiphilic/Cpp | NQueens.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 8
int ld[30] = { 0 };
int rd[30] = { 0 };
int cl[30] = { 0 };
void printSolution(int board[N][N])
{
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++)
cout<<" "<< board[i][j]<<" ";
cout<<endl;
}
}
bool solveNQUtil(int board[N][N], int col)
{
if (... | ALGO | 0.999894 | 3.862083 |
1eec0fdb-1abf-460b-b603-f0449042e05b | tege3000/codeforces-algorithmic-challenges | rating<1300/Wrong/jzzhuAndChildren.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
/*
* TODO: Need to rethink this problem through later
*
*/
int main() {
int n;
cin >> n;
int m;
cin >> m;
if(n == 1) {
cout << 1 << endl;
}
else {
int val;
ve... | ALGO | 0.999549 | 4.340474 |
2889f516-3d55-48fc-a392-585f74289eef | tanvii-17/DSA | 0783-search-in-a-binary-search-tree/0783-search-in-a-binary-search-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999987 | 5.960604 |
2af47bad-ef0a-4d11-a314-dac012685a1e | Deepak22903/PP | recursion/sumOfNNumbers_functional.cpp | #include <iostream>
using namespace std;
int sum(int n) {
if (n == 0)
return 0;
return n + sum(n - 1);
}
int main(int argc, char *argv[]) {
int n{};
cin >> n;
cout << sum(n) << endl;
return 0;
}
| ALGO | 0.999941 | 5.691206 |
a912c3ae-3643-45e4-9686-7edfc0240ced | wxianxin/orderbook | OrderBook.cpp | //author: Steven Wang Date: 20151028
#include "OrderBook.h"
using namespace std;
OrderBook::OrderBook() {
map<double, queue<Order>> buy;
map<double, queue<Order>> sell;
queue <Order> orders;
}
void OrderBook::TakeOrder(string data) {
ifstream infile;
infile.open(data);
if (infile.fail()) {
cerr << "Error ... | ALGO | 0.97934 | 4.378157 |
efea7cef-7b93-467c-bb6b-23683a16b3db | ishandutta2007/codeforces | sdya/normal/168/B.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <stack>
#include <ctime>
#include <unordered_map>
#include <unordered_set>
#pragma comment (linker, "/STACK:2560000... | ALGO | 0.999812 | 3.748238 |
a9af68e3-bad4-4100-b56e-f9427bea4a00 | Shubhamm1211/LeetCode | 893-all-nodes-distance-k-in-binary-tree/all-nodes-distance-k-in-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
void inorder(TreeNode *root, map <TreeNode*,TreeNode*> &mp){
if(!root) return;
... | ALGO | 0.999997 | 5.714757 |
d160ff72-384e-42bf-bf6b-ed74a0f91084 | medohkl98/todonew | 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.9988 | 6.76073 |
1c5d4dc0-2fbb-4b06-91e7-3289097144d6 | ShivaanjayNarula/LeetCode | 1208) Get Equal Substrings Within Budget.cpp | class Solution {
public:
int equalSubstring(string s, string t, int maxCost) {
int n = s.size();
vector<int> cost(n, 0);
for(int i = 0; i < n; i++)
{
cost[i] = abs(s[i] - t[i]);
}
vector<int> prefixSum(n+1, 0);
for(int i = 1; i <= n; i++)
{... | ALGO | 0.99999 | 6.079741 |
d35ceb1c-f6c7-4aa8-93d6-f5d70bd6ad6a | MayankPratap/my-spoj-solutions | MIXTURES-14364245-src.cpp | #include<iostream>
#include<sstream>
#include<cstdio>
#include<climits>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<deque>
#include<bitset>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<vector>
#include<queue>
#include<iterator>
#include<assert... | ALGO | 0.999033 | 3.557991 |
00db96f3-c745-45e1-a827-bffdd231c576 | HermanChen/Rockchip_4.2_release_libstagefright | 4.2_jb_release/libstagefright/codecs/mp3dec/src/pvmp3_framedecoder.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_framedecoder.cpp
Functions:
pvmp3_framedecoder
pvmp3_InitDecoder
pvmp3_resetDecoder
Date: 09/21/2007
--------------------------------------------------... | TOOL | 0.884374 | 6.046528 |
cbc122e8-e0de-4691-bccc-5865f66969c5 | plenilune3/problem_solving_cpp | beakjoon/삼성 SW 역량 테스트 기출 문제/14891_톱니바퀴.cpp | #include <iostream>
using namespace std;
int K, answer;
bool gear[4][8];
void rotate(bool gear[8], int d);
int main(int argc, char const *argv[])
{
ios_base::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);
for (int i = 0; i < 4; i++)
{
string g; cin >> g;
for (int j = 0; j <... | ALGO | 0.99979 | 4.637735 |
8f23686a-95f1-4a0b-9fc6-28e4528086fd | 33sakib33/Building-Information-Theoretic-Libraries-for-Matlab-Using-C | merge.cpp | #include<bits/stdc++.h>
#include"matrix.h"
#include"mex.h"
using namespace std;
void normalize(double *arr,long long *state,long long size1){
long long min1=arr[0];
long long max1=arr[0];
for(int itr1=0;itr1<size1;itr1++){
min1=(min1>arr[itr1])?arr[itr1]:min1;
max1=(max1<arr[itr1])?arr[itr1... | ALGO | 0.999789 | 3.517238 |
119df0b4-a4fc-4128-b51b-6c9701e3b06e | shvmsh20/GFG_POTD | Feb and March 2022/Matrix Operations.cpp | bool check(int x, int y, int r, int c){
if(x < 0 || r <= x) return true;
if(y < 0 || c <= y) return true;
return false;
}
pair<int,int> endPoints(vector<vector<int>> matrix){
//code here
int i = 0, j = 0;
int r = matrix.size();
int c = matrix[0].... | ALGO | 0.999776 | 3.591142 |
b7d985d2-3f8f-47af-ba2a-50f2d55499b4 | nasim67reja/Stack_queue-DS | C++/stack.cpp | #include <stdio.h>
#include <iostream>
// #include <stack>
using namespace std;
/////////////////////////////////// Createing Stack using array /////////////////////////////
class Stack
{
public:
int *arr;
int size;
int top;
Stack(int size)
{
this->size = size;
arr = new int[size... | ALGO | 0.999526 | 4.853689 |
8d945026-11b7-417a-98f7-4a156612acca | tastycrayon/compiler | cfg.cpp | #include <iostream>
using namespace std;
class CFG1 {
private:
string state = "state_0", finalState = "state_1", dummyState = "state_2",
language = "";
bool output;
void setStateToDummy() { this->state = this->dummyState; }
void state_0(char character) {
switch (character) {
case '\0':
... | ALGO | 0.98179 | 5.820926 |
63943f3c-be54-4370-86eb-7291c2eb1a9b | OsrHu/algorithm | pat/2021-03/7-3_Structure_of_Max-Heap.cpp | #include<iostream>
#include<cstring>
#include<algorithm>
#include<string>
#include<unordered_map>
using namespace std;
const int N = 1010, M = 20;
int n, m;
// int h[N];// idx从1开始
unordered_map<int, int>h ;
void up(int u)
{
while(u > 1)
{
if(h[u] > h[u / 2])
{
swap(h[u], h[u / 2])... | ALGO | 0.999754 | 3.672844 |
2566d0d3-f0c8-49c9-b77d-65ffb9c17acd | AUV-IITK/auv2017 | task_handler_layer/task_line/src/line_angle.cpp | int w = -2, x = -2, y = -2, z = -2;
bool IP = true;
bool flag = false;
bool video = false;
int t1min, t1max, t2min, t2max, t3min, t3max, lineCount = 0;
void callback_dyn(task_line::lineConfig &config, double level)
{
t1min = config.t1min_param;
t1max = config.t1max_param;
t2min = config.t2min_param;
t2max = co... | TOOL | 0.988243 | 5.186687 |
d7b0ce43-e29c-47fa-b46b-2e50f0beab21 | MasterIceZ/archive | book/Sort/03.cpp | #include <bits/stdc++.h>
using namespace std;
int a[1010];
int main(){
int n;
cin >> n;
for(int i=1; i<=n; ++i){
cin >> a[i];
}
sort(a + 1, a + n + 1);
for(int i=1; i<=n; ++i){
cout << a[i] << " " ;
}
cout << "\n"
return 0;
}
| ALGO | 0.999828 | 3.384144 |
1351421c-c8d1-48ea-97c9-bea842d6f297 | CodeWithIsmail/Competitive-Programming | Codeforces/C_2_Skibidus_and_Fanum_Tax_hard_version.cpp | /// *** --- || In the name of ALLAH ||| --- *** ///
/// *** --- || Author: Code_with_Ismail ||| --- *** ///
#include <bits/stdc++.h>
using namespace std;
// Data Type:
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typede... | ALGO | 0.999958 | 3.858018 |
db661c15-d3d1-45f0-9ee0-4bae7fc24b37 | Ahmed-Mohmed-Sakr/Problem-Solving | AtCoder/dp_c/40014182_AC_42ms_15948kB.cpp | /// by:Ahmed Sakr (sakr_) with AZA ///
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int long long
using namespace std;
using namespace __gnu_pbds;
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define inf INT_MAX
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_or... | ALGO | 0.999948 | 4.026793 |
27cda46f-f02c-4e49-8ac1-add4493ffd95 | 06suraj/GeekforGeeks-And-Leetcode | 687. Longest Univalue Path.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999957 | 5.862163 |
d5425133-32be-4467-8ac6-5ee33c58017f | sy117/SPOJ-Solutions | GCD2.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
ll gcd(ll a, ll b)
{
if (b==0)
return a;
else
return gcd(b,a%b);
}
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
ll a,b,i,k,d,m,ans;
char s[252];
scanf("%lld%s",&a,s);
k = strlen(s);
if(a==0)
printf("%s\n",s);... | ALGO | 0.999241 | 3.274529 |
d1394f20-d812-45d7-b779-d37d3ac6b94b | Lazeenakathoon/C- | Vector/Linearsearch.cpp | #include <iostream>
#include <vector>
using namespace std;
int linearSearch(const vector<int>& arr, int target) {
for (int i = 0; i < arr.size(); ++i) {
if (arr[i] == target) {
return i; // Return the index where the target is found
}
}
return -1; // Return -1 if the target is... | ALGO | 0.998412 | 5.89414 |
211f80e2-2706-41ef-98ea-8046bdcfc107 | arpitsharma6074/Leetcode_solution | solution_in_cpp/leetcode1005.cpp | class Solution {
public:
int largestSumAfterKNegations(vector<int>& nums, int k) {
sort(nums.begin(),nums.end());
vector<int>positive;
vector<int>negative;
for(int i=0;i<nums.size();i++){
if(nums[i]<0){
negative.push_back(nums[i]);
}
... | ALGO | 0.999982 | 5.349935 |
404a9805-2aea-4660-a194-97d9ee4c6421 | adarshmishra1310/Coding | C++_Programming/Codeforces Questions/C_Showering.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(v) (v).begin(), (v).end()
const int inf = (int)1e18;
const int mod = 1e9 + 7;
void runCase()
{
int n, s, m;
cin >> n >> s >> m;
vector<pair<int, int>> v(n);
for (int i = 0; i < n; i++)
cin >> v[... | ALGO | 0.99986 | 4.125437 |
25516519-6afe-4129-a3db-8fe2e2de8932 | betterafter/problem-solving | study_upload_file/keykat/210417_programmers_42883/programmers_42883.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
// 큰 수 만들기
string solution(string number, int k) {
string answer = "";
int prev = -1;
int next = k + 1;
while(next <= number.length()){
int MAX = 0;
for(int i = prev + 1; i < n... | ALGO | 0.999971 | 4.989231 |
28d4c76e-07d3-4070-8d04-cd814943c468 | AryamanKalia/LEETCODE-SOLVED | Union of Two Sorted Arrays - GFG/union-of-two-sorted-arrays.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// arr1, arr2: the arrays
// n, m: size of arrays
// Function to return a list containing the union of the two arrays.
vector<int> findUnion(int arr1[], int arr2[], int n, int m)
{
... | ALGO | 0.999974 | 5.755565 |
c3a41cdd-ab5d-426d-ad07-b32380586bd6 | 2745518585/code | 【模板】数据结构-线段树合并.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
const int N=10000001,M=100000;
struct str
{
int x,s;
friend str max(str a,str b)
{
if(a.s!=b.s) return a.s>b.s?a:b;
return a.x<b.x?a:b;
}
};
int n,m,rt[N],tot,p=1,t[N];
struct tree
{
int f,s,d,t,z;
}T[N];... | ALGO | 0.999986 | 4.169462 |
24145031-9431-4136-9596-66a06769c681 | Liesegang/Procon | AtCoder/agc004/b.cpp | #include <iostream>
#include <cstdio>
#include <bitset>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <utility>
#include <string>
#include <algorithm>
#include <cmath>
#include <limits>
using namespace std;
using ll=long long;
using vint=vector<int>;
using p... | ALGO | 0.999946 | 4.020894 |
e4065624-e4eb-4c46-8d23-392fe59fb8ef | arul2810/Algo-and-DS | Leetcode/Algorithm_Prep/Move_Zeros.cpp | /*
Move Zeros
------------------------------------------------------------------------------
By: Arul Prakash Samathuvamani | <EMAIL>
For : Leet Code Algorithm Prep
Date : 27th January 2022
Module Description:
Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the no... | ALGO | 0.999767 | 4.787915 |
d2190f7d-8ced-4693-854e-b5d09fcc5da8 | Hinski2/CP | codeforces/problems/Shooting/cpp1979.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v){
for(const auto &u: v){
os << u << ' ';
}
return os;
}
template<typename T> istream& operator>>(istream& is, vector<T>& v){
for(auto& u : v){
is >> u;
}
retur... | ALGO | 0.999912 | 3.473043 |
a5f5859f-853e-49da-be5d-c95f8b1dafa0 | kushagra7589/Semester5 | CG/Lab1/ext/glm/test/core/core_func_integer_find_msb.cpp | // This has the programs for computing the number of leading zeros
// in a word.
// Max line length is 57, to fit in hacker.book.
// Compile with g++, not gcc.
#include <cstdio>
#include <cstdlib> // To define "exit", req'd by XLC.
#include <ctime>
#define LE 1 // 1 for little-endian, 0 for big-endian.
... | ALGO | 0.998966 | 3.19451 |
623cdd77-1166-455c-9fcc-535fb89977d3 | shreejitverma/SDE-Interview-Prep | LeetCode/C++/fair-distribution-of-cookies.cpp | // Time: O(k * 3^n)
// Space: O(2^n)
// dp, submask enumeration
class Solution {
public:
int distributeCookies(vector<int>& cookies, int k) {
vector<int> total(1 << size(cookies));
for (int mask = 0; mask < (1 << size(cookies)); ++mask) {
for (int i = 0; i < size(cookies); ++i) {
... | ALGO | 0.999946 | 5.279777 |
fded6bd1-27bc-4e26-bfe4-1238a3351b79 | llodds/ecsg | update_vel.cpp | #include "field.hpp"
#include <omp.h>
void UpdateVel(Field *sim, const Field &buoy, real **coeff, int radius,
int top ,int bottom, int top_bc)
{
Field *vx = sim;
Field *vy = sim+1;
Field *vz = sim+2;
Field *sxx = sim+3;
Field *syy = sim+4;
Field *szz = sim+5;
Field *syz = sim... | ALGO | 0.999621 | 5.177282 |
9aa52ed3-84cd-482c-a20e-ccdc815115f4 | AjaySingh8923/LLVM | libc/src/math/generic/fromfpx.cpp | #include "src/math/fromfpx.h"
#include "src/__support/FPUtil/NearestIntegerOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(double, fromfpx, (double x, int rnd, unsigned int width)) {
return fputil::fromfpx</*IsSigned=*/true>... | TOOL | 0.876984 | 5.977674 |
a6834da4-5f0e-42f4-9bba-e86883ff8234 | krishna-raj007/BodhiTree-Annotation | CS101_Spring2020-21 /LAB4_L1/uncategorized/stream/Submissions/98_stream.cpp | #include<simplecpp>
main_program {
int q,r, a;
r=1;
cin >> q;
repeat(q) { cin>> a ;
if(r>a) r = r;
else r = a;}
cout << r;
}
| ALGO | 0.999559 | 3.412838 |
5441e025-79e3-453f-8d14-1e6e4575e3dc | Mitali-Potdar/LeetCode | 2337-remove-digit-from-number-to-maximize-result/2337-remove-digit-from-number-to-maximize-result.cpp | class Solution {
public:
string removeDigit(string number, char digit) {
int n = number.size();
int cnt = 0;
for(int i = 0; i < n; i++){
if(number[i] == digit)
cnt++;
}
string res = "";
for(int i = 0; i < n; i++){
if(number[i] =... | ALGO | 0.999977 | 6.348701 |
1ac05bc3-0de3-487b-b836-7c0ca218ec0a | vpaldev/vpal20 | src/ripple/validators/impl/Utilities.cpp | //------------------------------------------------------------------------------
//==============================================================================
#include <boost/regex.hpp>
namespace ripple {
namespace Validators {
struct Utilities::Helpers
{
// Matches a validator info line.
//
static b... | TOOL | 0.927657 | 7.497288 |
8802cc82-ffcb-4a37-ab7b-962e66506e07 | sonhl0723/algorithm | BOJ/1389.cpp | #include <iostream>
#include <cstdio>
#include <queue>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
int N, M;
bool check[101][101];
queue<int> q;
int step[101];
void bfs(int start){
q.push(start);
step[start] = step[start] + 1;
while(!q.empty()){
int q_size = q.size();
... | ALGO | 0.999965 | 3.980636 |
30201c09-2657-47b5-a146-4c3df34fd5d8 | sarvex/leetcode-s | solution/0100-0199/0115.Distinct Subsequences/Solution.cpp | class Solution {
public:
int numDistinct(string s, string t) {
int m = s.size(), n = t.size();
vector<vector<unsigned long long>> dp(m + 1, vector<unsigned long long>(n + 1));
for (int i = 0; i <= m; ++i) {
dp[i][0] = 1;
}
for (int i = 1; i <= m; ++i) {
... | ALGO | 0.999992 | 6.521086 |
dadddcfd-67b3-4794-828b-5e21b5c1d636 | kamal2806/CPP | DataStructures-Algorithms/Library/DS/ConvexHulDynamicMin.cpp | struct cht{
struct Line{
int a;
long long b;
long long val;
double xLeft;
bool type;
Line(long long _a = 0 , long long _b = 0){
a = _a;
b = _b;
xLeft = -1e16;
type = 0;
val = 0;
}
long long va... | ALGO | 0.999658 | 4.337799 |
39b1f2cb-fcb1-465a-ae89-74167e0a1574 | freedomDR/coding | codeforces/p1312D.cpp | #include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
long long power(long long a, long long b)
{
long long res = 1;
while(b>0)
{
if(b&1) res = (res*a)%mod;
a = a*a%mod;
b>>=1;
}
return res;
}
int main()
{
int n, m;
cin >> n >> m;
// C(m, n... | ALGO | 0.999992 | 5.02791 |
0e6c1560-6228-4840-a4c6-be69353d2bd6 | flwmxd/LuxGI | Code/Maple/lib/imgui/src/ImGradient.cpp | namespace ImGradient
{
#ifndef IMGUI_DEFINE_MATH_OPERATORS
static inline ImVec2 operator*(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x * rhs, lhs.y * rhs); }
static inline ImVec2 operator/(const ImVec2& lhs, const float rhs) { return ImVec2(lhs.x / rhs, lhs.y / rhs); }
static inline ImVec2 operato... | TOOL | 0.889142 | 6.801831 |
aaabc72f-266d-4e22-91be-0fe8b18c9a9f | Mohammad-Sabbir-Ahmed/Competitive-Programming-1 | All Online Judge Problem/Codeforces/A - Vitya in the Countryside.cpp | #include<iostream>
#include<cstdio>
#include<string>
#include<ctype.h>
#include<conio.h>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include <map>
#include <set>
#include <bitset>
#include <math.h>
#include <sstream>
#include <stdlib.h>
using namespace std;
int main()
{
int n;
cin>>n... | ALGO | 0.999967 | 3.549098 |
40eec688-e2fc-4417-a70b-566137fbc51c | asad-tyb0000/PF | PD WEEK6/PD6/task5.cpp | #include <iostream>
using namespace std;
float calculateFruitPrice(string fruit,string dayOfWeek,double quantity);
main()
{
string fruit,dayOfWeek;
float answer;
double quantity;
cout << "Enter the fruit name: ";
cin >> fruit;
cout << "Enter the day of the week (e.g., Monday, Sunday): ";
cin... | TOOL | 0.857552 | 5.312245 |
f9b89d2c-3575-4323-bd3c-3508f0bb351d | arthurcadore/eng-telecom-workbook | semester-3/PRG2/classes/chapter_01/saturday_homework.cpp | #include <fstream>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
using namespace std;
void separator(const string& input, char separator, queue<string>& line) {
int space = 0;
string stringSeparator, aux;
stringSeparator += separator;
while (space != string::npos) {
... | TOOL | 0.993053 | 4.427602 |
f0ba5a85-f897-4467-8dd4-a0389ba65e3c | BinomialSheep/CompetitiveC-- | AtcoderContest/ARC139/A3.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
//#include <atcoder/all>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MAX 10000
#define INFTY (1 << 29)
// 浮動小数点の誤差を考慮した等式
#define EPS (1e-10)
#define equal(a, b) (fabs((a) - (b)) < EPS)
ll llMax(ll x, ll y) { return (x >= y) ? x : y; }... | ALGO | 0.999965 | 4.162745 |
4039c73f-671a-41b6-82f6-5f69d0302849 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_12690_5.cpp | #include <iostream>
using namespace std;
int main(){
int a[5],sum=0;
for(int i=0;i<5++i){
cin>>a[i];
if(a[i]<40) a[i];
sum+=a[i];
}
cout << sum/5 << endl;
return 0;
} | ALGO | 0.999586 | 3.797044 |
45aa98ae-0413-403d-9ff6-7472facd74ca | menaehab/Codeforces-Solutions | 0 - 1000 problems/A_Problemsolving_Log.cpp | #include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <iomanip>
#include <string>
#include <set>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define el '\n'
#define all(arr) arr.begin(), arr.end()
#define allr(arr) arr.rbegin... | ALGO | 0.999928 | 5.002563 |
828bfa8e-a094-4bb9-812d-c33d5e1c1a06 | jheisonxxx/paralelos | productorconsumidor.cpp | #include <iostream>
#include <pthread.h>
#include <stdio.h>
using namespace std;
#define MAX_elem_prod_cons 50 /* tamao del elem_prod_cons */
void* Productor(void*);
void* Consumidor(void*);
pthread_mutex_t mutex; /* mutex para controlar el acceso al "elem_prod_cons" compartido */
pthread_cond_t no_lleno; ... | ALGO | 0.994008 | 4.638352 |
45bc220e-5412-49af-8352-517f10ebd05e | eligere/eligere | FAHPcore/eigen/unsupported/doc/examples/MatrixExponential.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(3,3);
A << 0, -pi/4, 0,
pi/4, 0, 0,
0, 0, 0;
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix exponential ... | ALGO | 0.999848 | 3.706936 |
c4d3cfeb-181e-4b5b-a88b-e44425e9dc2c | Natasha0206/Cpp | Conditional_Statements.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int in;
string num[10] = {"Greater than 9", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
cin >> in;
if(in > 9){
cout << num[0];
}
else{
cout << num[in];
}
return 0;
} | ALGO | 0.997752 | 3.865507 |
28cc8217-2951-404d-ad83-8eecd050a266 | jibinghu/leetcode | CLASSFICATION/Array/minimum_size_subarry_sum/violence.cpp | #include <vector>
#include <iostream>
#include <climits>
using namespace std;
// O(n^2)
class Solution
{
public:
int minSubArrayLen(int s, vector<int> &nums)
{
int sign = INT_MAX, current = 0, sum = 0;
for (int i = 0; i < nums.size(); i++)
{
sum = nums.at(i);
if (... | ALGO | 0.999931 | 5.018524 |
a3e2d84a-1cef-4250-a0c1-4b9e48da7f4f | lclpsoz/competitive-programming | ARCHIVE/2018-06-22-0840/313B.cpp | #include <bits/stdc++.h>
using namespace std;
////////////// Prewritten code follows. Look down for solution. ////////////////
#define x first
#define y second
#define pb push_back
#define foreach(x, v) for (typeof (v).begin() x=(v).begin(); x !=(v).end(); ++x)
#define For(i, a, b) for (int i=(a); i<(b); ++i)
#define ... | ALGO | 0.999841 | 4.132333 |
e5ba3586-2487-4717-9953-9d243b404e0a | ashpsycho/CP | topcoder/676/250.cpp | #include <bits/stdc++.h>
using namespace std;
class WaterTank{
public:
bool isp(vector<int> t, vector<int>x, int C,double mid){
double curr=0.0,rate;
for(int i=0;i<t.size();i++){
rate=x[i];
rate-=mid;
curr=curr+(rate*t[i]);
if(curr<0)curr=0;
if(curr>C)return false;
}
return true;
}
double min... | ALGO | 0.999749 | 4.115539 |
3371ba3a-f2cb-4367-82b6-f2be84a4ba7f | Mulab11/cntt2016-hw1 | TC-SRM-589-div1-450/zsyzzsoft.cpp | #include <algorithm>
using namespace std;
const int inf = 2147483647;
struct Edge
{
int v, f;
Edge *next, *rest;
};
int mc, level[5000], que[5000];
Edge memory[50000], *edge[5000];
class GearsDiv1
{
public:
int s, t;
void AddEdge(int u, int v, int f)
{
Edge *p = &memory[mc++], *q = &memory[mc++];
p->v = v, p->... | ALGO | 0.999404 | 4.537228 |
1e6e3d30-d2b7-4908-9a7c-2283bfd7be27 | ssun-g/solution | BOJ/16435.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
int fruit[1001];
int main() {
int n, l;
scanf("%d %d", &n, &l);
for (int i = 0; i < n; i++) {
scanf("%d", &fruit[i]);
}
sort(fruit, fruit + n);
for (int i = 0; i < n; i++) {
if (fruit[i] <= l) l++;
}
printf("%d\n", l);
return 0;
} | ALGO | 0.999972 | 3.147456 |
33298546-34dc-41a3-af9f-c4b74155b5a5 | Ihtml/PAT | AdvancedLevel_C++/1105-Spiral-Matrix-[矩阵模拟]-25.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
bool cmp(int a, int b) {
return a > b;
}
int main() {
int N, m, n;
cin >> N;
n = sqrt((double)N);
for (int i = n; i >= 1; i--) {
if (N % i == 0) {
n = i;
m = N / n;
break;
}
}
vector<... | ALGO | 0.999979 | 3.404243 |
718c7a70-fc25-4a90-b119-ee7a7436f362 | Cuibaby/HWLane | runner/evaluator/culane/lane_evaluation/src/evaluate.cpp | /*************************************************************************
> File Name: evaluate.cpp
> Author: Xingang Pan, Jun Li
> Mail: <EMAIL>
> Created Time: 2016年07月14日 星期四 18时28分45秒
************************************************************************/
#include "counter.hpp"
... | ALGO | 0.986013 | 5.261713 |
eb9fdefb-156f-43cd-a038-52549476d074 | EsraelSousa/Online-Judge | Codeforces/rasc.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string.h>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <cmath>
#include <numeric>
#include <string>
#include <ctype.h>
#include <tuple>
// feito em celular
// #include <bits/stdc++.h>
using namespace std;
#define fas... | ALGO | 0.999687 | 4.019867 |
59ea00e9-6ca7-4f54-95a2-c24f709b2ef2 | Divyanshu-Patel/Programming | Striver - Recursion/subset sums.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution
{
public:
void myfunc(int index, int sum, vector<int> &arr, int N, vector<int> &ans){
if(index==N){
ans.push_back(sum);
return;
}
myfunc(index+1, sum + arr[index], arr, N, ans);
myfunc(index+1, s... | ALGO | 0.999931 | 5.698033 |
1d71524d-eca9-42fd-83b3-584e1bf5fbe7 | Quincious/School-Code | CS515/lab2/printnum.cpp | /** CS515 Lab 2
File: debug1.cpp, debug2.cpp, results, myatoi.cpp, printnum.cpp
Name: Jonathan Hart
Section: 2
Date: 9/4/13
Collaboration Declaration: Bradley Snay
*/
#include <iostream>
#include <string>
using namespace std;
void PrintLargestofNDigits(int n) {
char arr[101];
for(int i = 0; i < n ; i++){
... | ALGO | 0.995316 | 4.485565 |
b6d17bbb-2d50-40bf-b725-0045db0478e0 | Shinbatsu/N-Queens | QueenCombinations.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;
const int N = 8;
typedef vector<vector<string>> vvs;
vvs board(N, vector<string>(N, "X"));
auto collisionCheck = [](int column, int row) -> bool
{
for (int i = 0; i < row; i++)
if (board[i][column] == "Q"... | ALGO | 0.99763 | 4.424584 |
8947db77-44ff-43bf-bec5-ac456b91ac16 | mrAnderson2159/formazione_vim | flutter/quiz_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.998096 | 6.76775 |
fc0ceb24-fc2e-4407-bd2f-ccb6ad58fcf5 | AruzhanBazarbai/algo | labs/lab2/additional/llCycle.cpp | /**
* 141. Linked List Cycle
Given head, the head of a linked list, determine if the linked list has a cycle in it.
There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that ta... | ALGO | 0.999838 | 4.878536 |
74c38472-cde9-446a-957b-c6f1e1c6b9bb | gregatjhu/bootcamp24 | gem5/src/systemc/tests/systemc/examples/aes/aes.cpp | #include <systemc.h>
#define USE_TABLE 1
#if DEBUG
void
Dump_R(char *s, sc_uint<8> X[4][4])
{
printf("%s R\n", s);
for(int i = 0; i < 4; i++){
printf("|");
for(int j = 0; j < 4; j++){
printf("%02x|", (int)X[i][j]);
}
printf("\n");
}
}
void
Dump_rk(char *s, sc_uint<8> X[11][4][4])
{
printf("%s rk\n", s... | ALGO | 0.99888 | 4.296526 |
62d2a468-860f-48b5-937f-7af8b05e353a | gtkn/atcoder | ABC_307_F.cpp | //title
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define rep1(i,n) for (ll i = 1; i <= (n); ++i)
#define repr(i,n) for (ll i = (n)-1; i >= 0; --i)
#define rep1r(i,n) for (ll i = (n); i > 0; --i)
#define bit(n,k) ((n>>k)&1... | ALGO | 0.999973 | 4.593423 |
e89e71ae-f17c-4b38-8623-4c0b3c8a9e21 | saloni0144/lab7 | 7.7.cpp | //include library
#include<iostream>
using namespace std;
//checking ki koi number palindrome hai ya nahi using recursion
//declare function
int pal(int a,int b, int c)
{
if(a%10==0)
{cout<<c<<endl;
return c;}
else
{b=a%10;
a=a/10;
c=c*10+b;
pal(a,b,c);
}
}
//main function
int main()
{ int a,b;
co... | ALGO | 0.999813 | 3.626786 |
aeaec99e-bb9a-4f18-8eb1-e2364c88ddca | unicode-Ind/DSA_Final_Prep | 00.CB-FAANG/11. Graphs/06. Rotten_Oranges.cpp | /*
Given a 2D array of dimension r*c where each cell in the array can have values 0, 1 or 2 which has the following meaning: 0 : Empty cell 1 : Cells have fresh oranges 2 : Cells have rotten oranges
So, we have to determine what is the minimum time required to rot all oranges. A rotten orange at index [i,j] can rot ot... | ALGO | 0.999939 | 5.409139 |
47de98b8-e43c-48da-8b1a-6b9cbe2323c9 | Tastypotato245/boj | 2/24723/main.cpp | // https://www.acmicpc.net/problem/24723
// github/Tastypotato245/boj
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int N;
void Solve()
{
cin >> N;
cout << pow(2, N);
}
int main(void)
{
ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
Solve();
return (0);
}
| ALGO | 0.99955 | 4.988225 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.