uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
171addbd-dc1c-46c3-a13e-17e13f29a42f | shu8Cream/atcoder-archive | atcoder.jp/arc074/arc074_a/Main.cpp | /**
* author: shu8Cream
* created: 17.02.2021 11:56:44
**/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll h,w;
cin >> h >> w;
... | ALGO | 0.999925 | 3.962618 |
17eb5ef3-0ea1-40bf-a31a-754cf23ef7bf | whehdwns/HackerRank_Coding_Practice | 30_Days_of_Code/Day_05_Loops.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
cin.ignore(numeric_limits<streamsize>::max(), '\n');
for(int i = 1; i<= 10; i++){
cout << n <<" x " <<i << " = " << (n*i) << endl;
}
return 0;
}
| ALGO | 0.997906 | 3.269057 |
c7b404fb-4dba-4095-8fd8-1c31d1643d93 | nabobery/PROJECT-MADS | LeetCode/3301 - 3400/3333.cpp | // 3333. Find the Original Typed String II
// Solution: Count Frequencies and Use Dynamic Programming
// Time Complexity: O(n * k) where n is the length of the string and k
// is the number of unique characters in the string
// Space Complexity: O(k) for the frequency array and DP arrays
class Solution {
public:
i... | ALGO | 0.999991 | 6.581372 |
17c181c2-566a-4764-99f4-06022d276bcb | SiyangShao/codes | nowcoder/Graph/04/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll inf = 1e16;
template <class Cap> struct dinic {
struct edge {
int from, to;
Cap w;
edge(int _f, int _t, Cap _w) : from(_f), to(_t), w(_w){};
};
vector<vector<int>> E;
vector<edge> edg;
vector<int... | ALGO | 0.999958 | 4.948084 |
ec03486c-e706-4850-b00d-202a7d15ac05 | meddimeister/laser-raytracer | lib/nomad3/examples/basic/batch/single_obj_sgtelib/bb.cpp |
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
// Crescent 10
#define N 10
#define N2 100
int main ( int argc , char ** argv ) {
if ( argc < 2 ) {
cout << 1e+20 << " " << 1e+20 << " " << 1e+20 << endl;
return 1;
}
double z , g1 = 0.0 , g2 = 0.0;
int i;
if ( a... | ALGO | 0.912571 | 3.029155 |
2f03d82f-f485-4417-b3d5-1edd8143a80d | gr790/Uva | 10812/program.cpp | #include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;
int main()
{
ifstream infile;
infile.open("./sample.txt");
int test;
infile >> test;
infile.ignore();
int s, d;
while(test--)
{
infile >> s >> d;
if( s < d)
{
cout <<"impossible"<< endl;
continue;
}
else if( (s+d... | ALGO | 0.999835 | 3.716138 |
bd32f44a-eb4a-4de0-a9f3-721f8e039338 | KamilKrauze/Honours-Project | OpenCV-CPP/thirdparty/opencv_install/sources/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp | /**
* @file MatchTemplate_Demo.cpp
* @brief Sample code to use the function MatchTemplate
* @author OpenCV team
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace std;
using namespace cv;
//! [declare]
/// Global Variables
bool us... | ALGO | 0.95839 | 7.019573 |
8159bb32-e7e2-4a97-b3df-a3f3e4781fca | kmjp/procon | atcoder/past001-040/past018/n.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999741 | 4.071905 |
8fb6e8b4-c802-4df2-9683-3aac3bdcd385 | utilForever/BOJ | 15000/15596 - The Sum of N Integers.cpp | #include <vector>
long long sum(std::vector<int>& a)
{
long long ret = 0;
for (int i = 0; i < a.size(); ++i)
{
ret += a[i];
}
return ret;
} | ALGO | 0.981263 | 4.233007 |
fa76b3f4-74e3-4a95-8251-a61fdc381b1b | tristanisham/cartographer | src/cartographer.cpp | #include "cartographer.hpp"
#include <ctime>
#include <sstream>
/**
* @brief Generates a 64 bit seed number as a long long.
*
**/
long long Cartographer::genSeed()
{
std::random_device dev;
std::mt19937 rng(dev());
std::uniform_int_distribution<std::mt19937::result_type> dist6(1, 9223372036854775807); //... | TOOL | 0.947863 | 5.069235 |
171b62b2-ae42-444e-a1cb-14d393d58d6a | animesh156/-6companies30days | Run Length Encoding.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
string encode(string src);
int main() {
int T;
cin>>T;
while(T--)
{
string str;
cin>>str;
cout<<encode(str)<<endl;
}
return 0;
}
// } Driver Code Ends
/*You are required to complete this function */
string encode(string src)
... | ALGO | 0.999962 | 6.335147 |
8439fb83-b7fe-49ce-9e8a-6e384b1ba060 | Sherlock-B221/LeetCode-Problems | 322-coin-change/322-coin-change.cpp | class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
int n = coins.size();
vector<vector<int>> dp(n+1, vector<int> (amount + 1, -1));
// 0 1 2 3 4 5 6 7 8 9 10 11
// 0 (int max - 1) because no coins are there / -1 acc to question
// 1 0
... | ALGO | 0.99989 | 5.777257 |
4d017349-d598-43fe-abc6-c007170cbef6 | xinfeng1i/AlgorithmSolution | Pat/basic/1019.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
int increaseOrder(int n)
{
vector<int> v(4, 0);
v[0] = n / 1000;
v[1] = (n % 1000) / 100;
v[2] = (n % 100) / 10;
v[3] = n % 10;
sort(v.begin(), v.end(), less... | ALGO | 0.99894 | 3.914769 |
75c04776-ca8d-47d2-a677-59943bc975aa | maikelangeloo/TFB2023_DSA_22011745 | L2/22012201745_mikhail_L2_easy.cpp | // A simple C++ program to find sum of diagonals
#include <bits/stdc++.h>
using namespace std;
const int MAX = 100;
void printDiagonalSums(int mat[][MAX], int n)
{
int principal = 0, secondary = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
// Condition for principal diag... | ALGO | 0.999609 | 5.137825 |
d4a3d4f9-fb98-4901-8627-116751d18455 | Shubham10kumar/DSA | lec29 Recursion-3/7_Permutations.cpp | #include<iostream>
#include<string>
#include<vector>
using namespace std;
void print(string original,string ans,vector<string>& final){
if(original.size()==0){
// cout<<ans<<endl;
final.push_back(ans);
return ;
}
for(int i=0;i<original.size();i++){
char ch=original[i];
... | ALGO | 0.999943 | 3.406945 |
601f967f-df35-41fd-9390-a122ee62a100 | KonstantIMP/cryptor | src/crypt.cpp | #include "../include/crypt.hpp"
std::string cryptor::crypt(const std::string & str, const bool & debug_out) {
std::string result = "";
if(debug_out) std::clog << "[DEBUG] Crypt start\n\n";
if(debug_out) std::clog << "[DEBUG] Encrypting string has " << str.length() << " symbol(s)\n\n";
if(debug_out) ... | ALGO | 0.996942 | 6.127482 |
4bc8fc48-b767-4172-bf62-f716ca8a2d3b | isangyoon-zz/Algorithm | Graph/scc-kosaraju.cpp | // find Strongly Connected Components in givien graph
// const int SIZE = 101;
// std::vector<int> adj[SIZE];
// std::vector<int> pred[SIZE];
int visited[SIZE];
int indices[SIZE];
int v_count, scc_count;
std::vector<int> components;
void dfs(int u, std::vector<int> const adj[])
{
visited[u] = v_count;
for (auto ... | ALGO | 0.999399 | 5.414839 |
4a160974-ecdb-4df8-8604-b58f20c9398f | zjl9959/GuillotineCut | Solver/data/source/PFSTree.cpp | #include "Solver/data/header/PFSTree.h"
#include <cassert>
#include <iostream>
#include "Solver/data/header/Global.h"
using namespace std;
namespace szx {
PfsTree::~PfsTree() {
// ɾʣĴչڵ㡣
for (auto it = live_nodes_.begin(); it != live_nodes_.end(); ++it) {
delete_node_recursive(it->second);
}
... | ALGO | 0.998809 | 3.256739 |
cc8ccb90-b9f0-44af-8789-9158dfcf34a8 | jeffyouwang/summer2012 | llvm/lib/Analysis/PostDominators.cpp | #define DEBUG_TYPE "postdomtree"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Instructions.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Analysis/DominatorInterna... | ALGO | 0.957361 | 6.842196 |
8302fa32-13aa-43cf-8080-28fe9d14101e | IsaacAU/LeetCode | codes/Factorial Trailing Zeroes.cpp | class Solution {
public:
int trailingZeroes(int n) {
int res=0;
while(n){
n/=5;
res+=n;
}
return res;
}
};
| ALGO | 0.999942 | 6.262491 |
0886ec8c-2d08-4be9-92ec-1fe209866a62 | koicy-ly/koicy-ly.github.io | assets/code/P1551.cpp | #include <iostream>
using namespace std;
template<unsigned size>
class di_set {
public:
unsigned* b = new unsigned[size];
inline void init(const unsigned& n) {
for (unsigned i = 1; (b[i] = i) <= n; i++);
}
inline unsigned find(const unsigned& f) {
return b[f] == f ? f : b[f] = find(b[f]);
}
inli... | ALGO | 0.999979 | 4.625226 |
eca1c7b2-6b50-45d7-b657-8531cedba245 | dib-lab/2020-paper-mqf-benchmarks | taggingTest.cpp | #include "gqf.h"
#include <stdio.h> /* printf, scanf, puts, NULL */
#include <stdlib.h>
#include<iostream>
#include <fstream>
#include "hashutil.h"
#include "kmer.h"
#include <vector>
#include <deque>
#include <chrono>
#include<cmath>
#include <random>
#include <algorithm>
#include "Benchmark_Utils_Script/generato... | ALGO | 0.963216 | 3.876792 |
379d0671-2dd6-496d-b770-42abe11deb76 | mialskywalker/CPPAdvanced | MultidimensionalArraysExercises/positionsOf/positionsOf.cpp | #include <iostream>
using namespace std;
int main()
{
int matrix[100][100] = {};
int R, C;
cin >> R >> C;
for (size_t row = 0; row < R; row++)
{
for (size_t col = 0; col < C; col++)
{
cin >> matrix[col][row];
}
}
int n;
cin >> n;
bool isFound = false;
for (size_t row = 0; row < R; row++)
{
fo... | ALGO | 0.999433 | 4.297088 |
7d4afe63-cbaf-45cf-a000-7b7d566759c7 | manikanta2901/ubuntu | random/answer.cpp | #include<stdio.h>
int main(){
int a[2][2], b[2][2], c[2][2], i, j;
int m1, m2, m3, m4 , m5, m6, m7;
for(i = 0;i < 2; i++)
for(j = 0;j < 2; j++)
scanf("%d", &a[i][j]);
for(i = 0; i < 2; i++)
for(j = 0;j < 2; j++)
scanf("%d", &b[i][j]);
printf("\nThe first matrix is\n");
for(... | ALGO | 0.999955 | 3.316492 |
5d3b77e1-914c-4e31-80b3-f0380a6acf04 | leisir966/tjuOJ | 19/7.15/统计字符数.cpp | #include<iostream>
#include<cstring>
using namespace std;
int main(){
int n,sum[26],i,max;
char str[1001];
cin>> n;
while(n--){
cin>>str;
for(i=0;i<26;i++)
sum[i]=0;
for(i=0;i<strlen(str);i++)
sum[str[i]-'a']++;//ַӦַ
max=0;
for(i=1;i<26;i++){//ҳsum[]ַ
if(sum[i]>sum[max])
max=i;
}... | ALGO | 0.999752 | 3.715926 |
e57eb904-6207-4702-83ca-a6f6529e157a | AshutoshXP05/CSES-Solutions | SLIDING_WINDOW/Sliding_Window_Sum.cpp |
// Sliding Window with huge Constraint --->
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
void solve();
#define MOD 1000000007 // MODULUS
#define PI 3.1415926535897932384626433832795
#define pb push_back // PUSH _ BACK
#define fi first // FIRST
#define se sec... | ALGO | 0.999987 | 3.420003 |
6698838f-0bbe-4356-81a1-b1b8838fdff1 | singhisking123/ProgramSnippets | leetcode/graph_snippits/dfs.cpp | #include<bits/stdc++.h>
using namespace std;
void dfs(int src, vector<vector<int>>&adj, vector<bool>&visited)
{
visited[src] = true;
for (auto x : adj[src])
{
if (visited[x] == false)
{
dfs(x, adj, visited);
}
}
} | ALGO | 0.999086 | 4.969522 |
dbd228d0-702a-4248-a058-5e0251156059 | myceworld/myce | src/myce-cli.cpp | #include "chainparamsbase.h"
#include "clientversion.h"
#include "rpcclient.h"
#include "rpcprotocol.h"
#include "util.h"
#include "utilstrencodings.h"
#include <boost/filesystem/operations.hpp>
#include <stdio.h>
#include <event2/event.h>
#include <event2/http.h>
#include <event2/buffer.h>
#include <event2/keyvalq_s... | WEB | 0.948519 | 6.551544 |
cc83e3e6-6815-43d7-a7d0-6acb2141e678 | ayushsaini12/DSA | stack_linklist.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
struct node *link;
};
struct node* top = NULL;
void push (int val)
{
struct node* newnode = (struct node* )malloc(sizeof(struct node));
newnode -> data = val;
newnode-> link = top;
top = newnode;
cout<<val <<" is been pushed"... | ALGO | 0.998776 | 4.21147 |
bfc03b54-8485-40ed-aba1-e3deff37132e | ShiYu0318/CP-Code | ZeroJudge/Basic Syntax/U5/e969.cpp | #include <iostream>
using namespace std;
int main()
{
int n,m,k,p[2]={32,55},t=0;
cin >> n >> m >> k;
if (n < p[k])
{
cout << "Wayne can't eat and drink.\n";
return 0;
}
while (n >= p[k])
{
cout << m * t << ": Wayne ";
if (k == 0) cout << "eats an Apple pie, ";
else cout << "drinks a Corn soup, ";
... | ALGO | 0.996233 | 3.37988 |
741f4b59-fd4c-4b5d-8b6b-2966d9958870 | RinCloud/TrickCatcher | Datasets/TrickyBugs/GenProgs/tc_generated_progs_cpp/p03325/p03325_num3_parsed.cpp | #include<iostream>
int main(){
int n,d,r;
std::cin>>n;
r = 0; // initialize r to zero
for(int i=0;i<n;i++){
std::cin>>d;
while(d%2==0) { // add brackets to include the whole block
++r; // increment r
d/=2; // divide d by 2
}
}
std::cout<<r;
}
| ALGO | 0.999437 | 4.243699 |
84ebcb40-9a1d-4d0e-9cab-e6f35bf7857c | billlin0904/xamp2 | src/thirdparty/chromaprint/src/fingerprint_matcher.cpp | #include <algorithm>
#include <numeric>
#include <iostream>
#include "fingerprint_matcher.h"
#include "fingerprinter_configuration.h"
#include "utils.h"
#include "utils/gaussian_filter.h"
#include "utils/gradient.h"
#include "debug.h"
namespace chromaprint {
/* fingerprint matcher settings */
#define ACOUSTID_MAX_BIT... | TOOL | 0.991477 | 5.625755 |
a4da152b-d1b9-423f-b6f6-f3939c6f745d | Malik786-git/DataStructure | 4_Queue/1_QueueCircular.cpp | // CIRCULAR QUEUE
#include <iostream>
using namespace std;
class CircularQueue
{
int size;
int f; // front
int r; // reare
int *arr;
public:
CircularQueue(int s)
{ //initialize array size and memory dynamically
size = s;
arr = new int(size);
f = r = 0;
}
~Circul... | ALGO | 0.992375 | 4.790705 |
6d5ca7d1-5d0d-4c59-b004-1e6e968f7387 | joakimgy/EulerC | E10.cpp | /*
* Project Euler problem 4
*/
#include <stdio.h>
/* Function declaration */
/* Main */
int main(void)
{
return 0;
}
| ALGO | 0.999659 | 3.396548 |
277fc397-3a0f-409e-b31b-97dc123414fd | CodingPO8/ORE | QuantExt/qle/cashflows/equitymargincouponpricer.cpp | #include <qle/cashflows/equitymargincouponpricer.hpp>
namespace QuantExt {
Rate EquityMarginCouponPricer::rate() const {
Calendar calendar = equityCurve_->fixingCalendar();
Date startDate = coupon_->fixingStartDate();
// the final date in the period is treated differently
Date endDate = equi... | ALGO | 0.953788 | 6.439041 |
37c87f36-9208-4ec8-a17b-a4b817b7932d | RonnP/PAT | GPLT/L1/017.cpp | /**
* L1-017. 到底有多二
* Created by Ronn on 3/4/18
*/
#include <iostream>
using namespace std;
int main() {
float towCnt = 0, cnt = 0, fu = 1, ou = 1;
char c;
while ((c = getchar()) != '\n') {
if (c == '-') {
fu = 1.5;
continue;
}
if (c == '2') towCnt++;
ou = (c - '0') % 2 ? 1 : 2;
cnt++;
}
pri... | ALGO | 0.996949 | 3.268693 |
8880e446-7aa9-472b-b6b7-6fe7e4943d1d | Zubax/eigen | blas/double.cpp | #define SCALAR double
#define SCALAR_SUFFIX d
#define SCALAR_SUFFIX_UP "D"
#define ISCOMPLEX 0
#include "level1_impl.h"
#include "level1_real_impl.h"
#include "level2_impl.h"
#include "level2_real_impl.h"
#include "level3_impl.h"
double BLASFUNC(dsdot)(int* n, float* x, int* incx, float* y, int* incy)
{
... | ALGO | 0.999193 | 5.138801 |
3b9d153f-b76e-43c3-9d09-8b7a3093316e | rockstarashish007/leetcode-solutions | algorithms/cpp/uniqueEmailAddresses/UniqueEmailAddresses.cpp | // Source : https://leetcode.com/problems/unique-email-addresses/
// Author : Hao Chen
// Date : 2020-07-26
/*****************************************************************************************************
*
* Every email consists of a local name and a domain name, separated by the @ sign.
*
* For example... | ALGO | 0.999649 | 6.038522 |
1cf33a28-fdc4-4b46-ae0d-24aa3494fc7c | ishandutta2007/codeforces | thienu/normal/1520/F2.cpp | #include <bits/stdc++.h>
using namespace std;
#define u_map unordered_map
#define u_set unordered_set
#define u_multiset unordered_multiset
using ll = long long;
using vvi = vector<vector<int>>;
using vi = vector<int>;
using vvll = vector<vector<long long>>;
using vll = vector<long long>;
using vd = vector<double>;
... | ALGO | 0.999955 | 3.70363 |
38e0802d-91d6-44ad-9af2-7552200e0ffa | boomzero/XMOJ | 6000-6999/6355.cpp | #include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ull = unsigned long long;
inline void read(int &x)
{
char ch = getchar();
int r = 0, w =... | ALGO | 0.999725 | 4.166902 |
53a92aa9-736f-4a4d-adf7-3774f29d1c07 | shreerampoudel/todolist | 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 |
428429b7-c163-42a8-85fe-6c1474a89c9c | KwonHyeokGyu/opencv_study | ch9/SIFTmatches.cpp | //#include <iostream>
//#include <vector>
//#include <opencv2/core.hpp>
//#include <opencv2/imgproc.hpp>
//#include <opencv2/highgui.hpp>
//#include <opencv2/features2d.hpp>
//#include <opencv2/xfeatures2d.hpp>
//#include <opencv2/objdetect.hpp>
//using namespace cv;
//
//int main()
//{
// Mat image1 = imread("C:/Users... | ALGO | 0.978004 | 4.089945 |
36971edb-3cbe-40b3-a0ff-ecb8b9a4fe22 | asmibug/leetcode | 159_longest_substring_with_at_most_two_distinct_characters/lib.cpp | /**
* Main approach: sliding window
*
* Approaches:
* 1) Shrinkable window, store last symbol change (specific for this task)
* 1.1) Store same char streak
* 1.2) Store indices
* 2) Shrinkable window, store last index for each symbol
* 3) Shrinkable window, store symbol frequencies
* 4) Monotonous window, sto... | ALGO | 0.999769 | 6.451447 |
5609ac34-afd8-4514-8195-6b2998b7486d | Ginakira/Code-Archive | Luogu/CF1006A-AdjacentReplacements.cpp | #include <iostream>
using namespace std;
int a[1010];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> a[i];
if (a[i] % 2 == 0) a[i]--;
}
for (int i = 0; i < n; ++i) {
if (i == 0) cout << a[i];
else cout << ' ' << a[i];
}
return 0;
} | ALGO | 0.999942 | 3.924548 |
d9455ed4-b317-41c8-9c69-69c5cc262460 | ToshihideMatsuda/atcoder | programs/ABC/ABC001-99/ABC080/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0; i < n; i++ )
#define reps(i,m,n) for(ll i = m; i < n; i++ )
#define max(a,b) (a>b?a:b)
#define max3(a,b,c) max(a,max(b,c))
#define min(a,b) (a<b?a:b)
#define min3(a,b,c) min(a,min(b,c))
#define INF 1 << 30
... | ALGO | 0.999945 | 4.97478 |
d44b0b10-b185-419e-98bb-002df3a41469 | devinlee1995/Radix-Sort-C- | Radix_Sort/RadixSort.cpp | #include "RadixSort.h"
#include "hashTable.h"
#include "Stack.h"
#include "node.h"
#include "Queue.h"
RadixSort::RadixSort() {
array_hash = new hashTable[2];
for (int i = 0; i < 2; i++) {
array_hash[i] = *new hashTable();
}
}
int RadixSort::hashFunction(string digit) {
index = stoi(digit);
... | ALGO | 0.999811 | 4.728686 |
bd1b0cbc-d076-4d47-828f-c9400d479d05 | manh610/document-c- | bai15thayson.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
using namespace std;
main ()
{
int test;
cin >> test;
while ( test-- ) {
long long n;
cin >> n;
int f1 = 1, f2 = 1;
long long ans = 0;
for ( int i=3; i<=n; i++) {
ans = f1+f2;
f1 = f2;
f2 = ans;
}
if ( n<3 ) cout << "... | ALGO | 0.99998 | 4.106927 |
9126decd-30f4-4c97-b88d-d04b66fc78d5 | ishandutta2007/codeforces | kmjp/normal/417/B.cpp | #include <cstdlib>
#include <cstring>
#include <memory>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <cmath>
#include <string>
#include <sstream>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
using namespace std;
typedef signed long long ll;... | ALGO | 0.999988 | 3.803842 |
ff545266-d328-4106-bd84-e77b25292798 | itz-Pratham/A2Z-DSA-Sheet-Solution | Step_14/Lec_2/Ceil in a Binary Search Tree.cpp | // GFG same ques
// User function Template for C++
// Function to return the ceil of given number in BST.
int findCeil(Node* root, int input) {
int ans = -1;
while (root != NULL) {
if (root->data == input) {
return root->data;
}
if (root->data > input) {
ans = r... | ALGO | 0.999977 | 4.471813 |
86bf916c-1162-4562-b65e-bd6c04e38a8f | ukmaurya/leetcode | 784-insert-into-a-binary-search-tree/insert-into-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.99999 | 6.148175 |
63b8cceb-f309-45e5-ac37-c40ddc498e89 | TheSkyEr4998/ALL_DSA_QUESTIONS | JAVA/37_Square Root of an Integer/Ideal Solution/squareRootOfAnInteger.cpp | #include<bits/stdc++.h>
using namespace std;
// Returns floor square root of x using binary search
int Sqrt(long long X){
if (X == 0 || X == 1)
return X;
int lo = 1, hi = X, ans;
while (lo <= hi){
int mid = (lo + hi) / 2;
// If x is a perfect square
if (mid*mid == X)
return mid;
// if mi... | ALGO | 0.99985 | 4.20534 |
1ea9a778-d32c-4abe-a464-cbffcb5ec660 | arturremizov/Leetcode | 129.Sum-Root-to-Leaf-Numbers.cpp | #include <iostream>
#include <stack>
using namespace std;
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), left... | ALGO | 0.999992 | 6.459024 |
e41ccb3f-3afb-4c78-834d-53ad1763a2c8 | aytr-so37/Problem-solving | 백준/Data_Structure/silver/boj1021.cpp | #include <iostream>
#include <deque>
#include <algorithm>
#include <iterator>
using namespace std;
int rotate(int, deque<int>&);
int main()
{
int N, M; cin >> N >> M;
deque<int>v;
for (int i = 0; i < N; ++i) {
v.push_back(i + 1);
} // 처음 deque setting
int result = 0;
for (int i = 0; i < M; ++i) {
int a; c... | ALGO | 0.999954 | 4.056721 |
fe789285-4390-49d9-9652-c9dd2ab961a2 | zahrayi/data-structure | arrayfinal.cpp | #include<iostream>
#include<string>
using namespace std;
class array {
public:
int find(int a[], int n, int key) {
for (int i = 0; i < n; i++) {
if (a[i]==key) {
return i;
}
}
return -1;
}
int insert(int a[],int add,int n,int c)
{
i... | ALGO | 0.999281 | 4.41282 |
e8a0e4f2-8908-4447-98ad-a68a926e32a0 | bunnyshell-repo-api/api | flutter-app/farmfield-dev/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.998856 | 6.785645 |
37394ea1-1356-431f-9915-7a1c866b0d2d | melonattacker/atcoder | contests/ABC/ABC228/c.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 1 << 30;
const long long INF = 1LL << 60;
#define ALL(a) (a).begin(),(a).end()
int main() {
int N, K;
cin >> N >> K;
vector<int> P(N);
vector<int> sP(N);
for(int i = 0; i < N; i++) {
int p1, p2, p3;
... | ALGO | 0.999974 | 4.006337 |
26856069-a0cd-4a09-96e1-bc4f0b4101cd | desik98/COMPETITIVE-PROGRAMMING | Practice/GRAPH THEORY/Cycles Topological Sorting Strongly Connected Component/1059 - Air Ports.cpp | /*I MAY NOT GET THE SUCCESS IMMEDIATELY BUT I WILL GET IT FOR SURE*/
#include<bits/stdc++.h>
#define opt std::ios_base::sync_with_stdio(false)
#define I int
#define li int32_t
#define lli long long
#define ulli unsigned long long
#define pn printf("\n")
#define nl cout<<'\n'
#define rep(i,a,b) for(i=a;i<b;i++)
... | ALGO | 0.999909 | 3.981867 |
c7f726fc-66bb-4ce9-83b3-e8ddab642602 | ishandutta2007/codeforces | hank55663/normal/1427/B.cpp | #include<bits/stdc++.h>
/*#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#define mp make_pair
#define pb push_back
#define pll pair<LL,LL>
#define pii pair<int,int>
#define y second
#define x first
#define LL long long... | ALGO | 0.999971 | 3.37139 |
1630c955-a577-44b1-8230-4420dca4dd7b | Inkln/Test | cproj/C-algorithms/fenwick_tree.cpp | #include <iostream>
#include <vector>
#include <iterator>
/*
Дерево Фенвика - это структура данных на массиве, позволяющая выполнять следующие операции:
1) Вычислять сумму элементов на некотором отрезке за O(log N)
2) Позволяет изменять значение произвольного элемента за O(log N)
3) Возвращает значение произвольного э... | ALGO | 0.999855 | 5.257966 |
db86ff22-3ad8-43e4-ba96-84d7cbb5b9b8 | da-x-ace/Misc | Run Length Encoding/prob.cpp | #include<iostream>
#include <math.h>
#include <stdio.h>
#include <cstring>
#include <cctype>
#include <string>
#include <stdlib.h>
using namespace std;
void rle(string& mystring)
//void rle(char *mystring)
{
char prev = mystring[0], curr = mystring[1];
char prev_old, curr_old;
int count = 1;
int k = 0;
int j=0;
... | ALGO | 0.999926 | 3.535258 |
9d6b3f83-b5e4-4c6b-944d-fca38654806b | tde-nico/cses | intro/coin_piles/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin >> T;
for (int t = 0; t < T; ++t) {
int a, b;
cin >> a >> b;
if ((a+b)%3 != 0 || a > 2*b || b > 2*a) {
cout << "NO\n";
} else {
cout << "YES\n";
}
}
return 0;
}
| ALGO | 0.999741 | 4.446561 |
e74a32d0-50ac-4cdd-9320-905df7651c9b | occlum/llvm | lib/CodeGen/LiveVariables.cpp | #include "llvm/CodeGen/LiveVariables.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Config/ll... | ALGO | 0.991241 | 7.939885 |
0238a6ef-c6aa-4ce1-932d-0dead4e95e95 | Gaurang-1402/NYC-Pedestrian-Counting | esp32/components/modules/eigen-3.4.0/doc/examples/TutorialLinAlgComputeTwice.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A, b;
LLT<Matrix2f> llt;
A << 2, -1, -1, 3;
b << 1, 2, 3, 1;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the right hand side b:\n" << b << endl;
cout << "Computing LLT... | ALGO | 0.999963 | 3.145425 |
021a7e22-58fc-4bc0-b832-c4b791d0d4ff | j2cheng/mygithub-gst-docs | AOSP/core/fs_mgr/fs_mgr_fstab.cpp | #include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <fnmatch.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <unistd.h>
#include <algorithm>
#include <array>
#include <utility>
#include <vector>
#include <android-base/file.h>
#include <android-base/parseint... | TOOL | 0.926991 | 7.148771 |
5f7d7fa2-77c7-4376-920d-c6e46280396f | shreyanzjain/zzz | dsa/recursive_revstr.cpp | #include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string recrev_string(string s, int place){
if(place == 0) {
// converting to string because otherwise it will return a 'char'
return string(1, s[place]);
}
return string(1, s[p... | ALGO | 0.999286 | 4.584626 |
b1c7e96b-aa3b-4ddc-aa6c-acb11c179f53 | DEEPANSHI558/cpp-codes | Striver/lis_length_printing.cpp | class Solution
{
public:
int lengthOfLIS(vector<int> &nums)
{
// longest increasing subsequence and print it also this has TC:O(n^2) SC:O(N)
// int n=nums.size();
// vector<int>hash(n);
// int index=0;
// vector<int>dp(n,1);
// in... | ALGO | 0.999978 | 5.696455 |
8fb0f7c3-5776-4403-8fb7-dc0c75b82870 | jck666666/Reversible-Logic-Circuit-Synthesis | QTS/circuit_alignment_PPTver.cpp | #include <iostream>
#include <string>
#include <stdlib.h>
#include <cmath>
#include <climits>
/* 0 → 0-control, 1 → 1-control, 2 → copy bit, 3 → not */
using namespace std;
#define rand_seed 114
#define population 100 // population 100
#define loop 5000 // generation 5000
#define test 1
#define delta 0.002
#def... | ALGO | 0.999726 | 3.936158 |
c6f824d5-f2b5-457e-930e-8b9d25108ac2 | thegamer1907/Code_Analysis | Codes/AC/1808.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define mod 1000000007
#define p push
#define pb push_back
#define mp make_pair
#define f first
#define s second
int f(int x, int n, int m){
int res = 0;
--x;
for(int i=1;i<=n;++i) res+=min((int)m, x/i);
return res;
}
signed mai... | ALGO | 0.999987 | 3.66171 |
df6a9a96-4e2c-4805-925c-273195b1eb74 | hgyuhyeon/Algorithm-old | Leetcode/509_Fibonacci_Number.cpp | class Solution {
public:
int fib(int n) {
if (n < 1)
return 0;
else if (n == 1)
return 1;
else
return fib(n - 1) + fib(n - 2);
}
}; | ALGO | 0.999986 | 6.151175 |
22ad27b8-ddbb-4288-bb9f-1421b99e3f44 | carl-221b/mds3d | ray_tracing/mds3d_td2/ext/nanogui/ext/eigen/doc/examples/TutorialLinAlgRankRevealing.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
A << 1, 2, 5,
2, 1, 4,
3, 0, 3;
cout << "Here is the matrix A:\n" << A << endl;
FullPivLU<Matrix3f> lu_decomp(A);
cout << "The rank of A is " << lu_decomp.rank() << endl;
c... | ALGO | 0.999793 | 3.720849 |
c91dfaf1-8f71-4b04-b700-bb71b9b8dfc4 | FernandoLucasDev/NexusFocus | 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 |
8885df60-59e0-438e-be61-855f4fb69fdb | dharanidhar233/DAA | DA26.cpp | #include <stdio.h>
#include <stdbool.h>
#define V 5
bool is_safe(int graph[V][V], int color[], int v, int c) {
for (int i = 0; i < V; i++) {
if (graph[v][i] && color[i] == c) {
return false;
}
}
return true;
}
bool graph_coloring_util(int graph[V][V], int m, int color[], int ... | ALGO | 0.999883 | 6.285492 |
e2a8ba90-10ab-4aaa-bf3c-4004dbac66c3 | OrebroUniversity/navigation_oru-release | orunav_mpc/src/trajectoryPool.cpp | #include "trajectoryPool.h"
//======================================================
// trajectoryChunk
//======================================================
/**
* @brief Constructor
*
* @param[in] param parameters.
*/
trajectoryChunk::trajectoryChunk(const swParameters ¶m) : constraints (param)
{
sequ... | TOOL | 0.857068 | 4.857522 |
0612ce1a-4a93-4903-94bc-772639c7126d | EthanKim8683/High-School-Competitive-Programming | USACO/Guide/Platinum/Binary Jumping/262144.cpp | #include<bits/stdc++.h>
using namespace std;
using I=int;
const I N=262144;
const I LOGN=18;
const I A=40;
const I MAX=1e9;
I a_arr[N];
I ancs[N][A+LOGN+1];
I main(){
#ifndef ETHANKIM8683
freopen("262144.in","r",stdin);
freopen("262144.out","w",stdout);
#endif
cin.tie(0)->sync_with_stdio(0);
fill(&ancs[0][0],&a... | ALGO | 0.999818 | 3.98037 |
c7e2765f-f1cb-4813-887a-40d4fe2c1bbd | vandreas19/POJ_sol | 3083/6729669_AC_0MS_244K.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
enum TurnType{
CLOCKWISE=1,ANTICLOCKWISE=3
};
class Direction{
public:
Direction(int value=0){
this->value=value;
}
Direction turn(TurnType turnType){
return Direction((value+turnType)%4);
}
int rowStep() const{
return ROW_STEP[value];
}
int colStep() co... | ALGO | 0.999869 | 3.153838 |
1a3b7a21-780b-4b00-8518-a222bb3603b3 | hehehwang/algoStudy | C++/Solved/BOJ/11967 불켜기.cpp | #include <bits/stdc++.h>
// 11967 불켜기
// https://www.acmicpc.net/problem/11967
using namespace std;
using PII = pair<int, int>;
int N, M, ans = 1;
bool rooms[102][102];
vector<PII> switches[102][102], turnOn;
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> N >> M;
rooms[1][1] = true;
... | ALGO | 0.999743 | 4.964609 |
8c83a971-6f5d-4ee3-8790-6fa541a2fe8f | shlock7/AlgorithmTricks | Algorithm/Sort_(Ten).cpp | #include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
void BubbleSort(vector<int> &array)
{
int length = array.size();
for(int i=0;i<length;i++){
for(int j=0;j<length-i-1;j++)
// 递增 increase
if(array[j] > array[j+1])
swap(array[j], array[j+1]);
// 递减 decrease
// ... | ALGO | 0.999943 | 4.649142 |
2c7ac5cc-be78-4731-b35e-5f7e81e87761 | pebblefoot31/leet_code | top_150/two_pointers/mostWater.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> height = {1,8,6,2,5,4,8,3,7};
//vector<int> height = {1,2,4,3};
//vector<int> height = {1,2,1};
int maxVol = 0;
int i = 0;
int j = height.size()-1;
int currVol = 0;
while (i ... | ALGO | 0.999422 | 4.572817 |
a0cb2204-4b1e-4923-a101-bd866fb18558 | Harshjain8363/DSA | L-13.cpp | /*
#include<iostream>
using namespace std;
void BinarySearch(int arr[],int size,int key){
int start=0,end=size-1,mid=start+(end-start)/2;
while(start<=end){
if(arr[mid]==key){
cout<<mid;
break;
}
else if(end==start && mid==end){
cout<<"Not found !";
... | ALGO | 0.99947 | 4.16081 |
4fb52b98-ed43-4cb0-a0ea-315b2151c1d3 | GISjingjie/DataStruct | DataStruct/181010shiyishi.cpp | #include <Stdio.h>
#include <stdlib.h>
#define MAXSIZE 20
typedef struct d{
int data[MAXSIZE];
int left,right;
}array;
array *build()
{
array *s=(array *)malloc(sizeof(array));
s->left=0;
s->right=13;
for(int i=0;i<s->right;i++)
{
s->data[i]=i*i;
}
for(int i=s->right;i<MAXSIZE;i++)
{
s->data[i]=i+i;
}
... | ALGO | 0.999556 | 3.281369 |
aa6f87ca-a2c6-42a9-8693-3612122b86e5 | MaxBubblegum47/LLVM_13_MBLAZE | llvm/tools/dsymutil/BinaryHolder.cpp | #include "BinaryHolder.h"
#include "llvm/Object/MachO.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
namespace llvm {
namespace dsymutil {
static std::pair<StringRef, StringRef>
getArchiveAndObjectName(StringRef Filename) {
StringRef Archive = Filename.substr(0, Filename.rfind('('));
... | TOOL | 0.918189 | 7.884395 |
64c464e1-c7f0-47d8-a6bd-693b7406a3da | youjin-43/Baekjoon | 00001_05000/1676/1676.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int cnt=0;
int i=1;
int five;
while(5*i<=n){
five =5*i;
while(five%5 ==0){
five/=5;
cnt++;
}
i++;
}
cout<<cnt<<endl;
} | ALGO | 0.999861 | 3.847683 |
bd998739-a72c-472f-9503-455d10b9ce40 | nitinkumar98/competitive-Programming | MatchedBrackets.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
void fastio()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
int main() {
fastio();
ll n,depth=0,depth_pos=0,max_depth=-1,length_pos=0,length=0,max_length=-1;
cin>>n;
ll ar[n];
for(int i=1;i<=n;i++)
cin>>ar[i];
for(int i=1;... | ALGO | 0.994189 | 3.550064 |
238c13e4-e933-4500-a84b-85949ef9140f | gavinsyw/LeetCodeCheck | 27.cpp | // 0ms, 8.5MB
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int cnt=0;
for (int i = 0; i < nums.size(); ++i)
if (nums[i] != val)
nums[cnt++] = nums[i];
return cnt;
}
}; | ALGO | 0.99992 | 5.876059 |
42f28d84-1d63-4e09-b769-71fbb361eae9 | yaswanth230755/neetcode-150-solutions | Top K Frequent Elements.cpp | class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k) {
// bucket sort why because freq of a element can not exceed nums.size()
// get freq of each ele then sort accor to freq using vector of pairs or multimap or minheap
unordered_map<int,int> unmap;
for(const ... | ALGO | 0.999984 | 6.021657 |
6daa23ee-f04f-459a-b4c8-896b1c4e30b0 | AlgorithmStudyLog/algogo | 상엽/백준/실버/백준1926_그림.cpp | #include <iostream>
#include <vector>
using namespace std;
const int dx[] = { -1, 1, 0, 0 };
const int dy[] = { 0, 0 ,-1, 1 };
int main()
{
int n, m, i, j;
cin >> n >> m;
vector<vector<int>>grid (n, vector<int>(m, 0));
for (i = 0;i < n;i++)
{
for (j = 0;j < m;i++) {
cin >> grid[i][j];
}
}
cout << cn... | ALGO | 0.999971 | 4.569757 |
03bdb469-a8a6-417f-8176-06db7d38ca5c | ishandutta2007/codeforces | waynetuinfor/normal/812/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, maxv = 1e7 + 10;
int a[maxn], s, x[2][maxv << 1], col[maxn], l;
vector<int> T[maxn];
void dfs(int, int, int);
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
int n; cin >> n;
for (int i = 1; i <= n; ++i) cin >> a[i];
... | ALGO | 0.999925 | 3.899482 |
85d9e6f2-fe9b-4eac-8cc0-0b48957b50fa | liardanc3/algorithm | cpp/1405.cpp | #include <bits/stdc++.h>
using namespace std;
int n, visited[31][31];
double u, r, l, d, poss = 0;
void f(int k, int y, int x, double rate) {
if (k == n) {
poss += rate;
return;
}
// r
if (!visited[x + 1][y] && r>0) {
visited[x + 1][y]++;
f(k + 1, y, x + 1, rate * r);
visited[x + 1][y]--;
}
// l
if (... | ALGO | 0.998746 | 3.445047 |
a2a858a1-852c-40bd-8b16-1ca645dd49e3 | imdominicreed/kattis-solutions | solutions/jollyjumpers/jollyjumpers.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <iterator>
#include <set>
#include <map>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <deque>
#incl... | ALGO | 0.999603 | 3.967681 |
016bee2e-0b3e-467f-9aa6-b723ebd9cc73 | cduckling/Competitive-Programming | Codeforces/tokenremoving.cpp | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
using namespace std;
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma,tune=native")
#define tc ll t; c... | ALGO | 0.999984 | 5.211163 |
d62d7a2f-38f4-409a-8c0f-c70ab19eaad9 | VeriConomy/vericoin | src/qt/transactionfilterproxy.cpp | #include <qt/transactionfilterproxy.h>
#include <qt/transactiontablemodel.h>
#include <qt/transactionrecord.h>
#include <cstdlib>
// Earliest date that can be represented (far in the past)
const QDateTime TransactionFilterProxy::MIN_DATE = QDateTime::fromTime_t(0);
// Last date that can be represented (far in the fu... | TOOL | 0.945532 | 6.60002 |
88b4e3e6-c783-412c-b3f3-d929b45bbc11 | dinhphanh2005/lcoj | VT16.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int a[1000];
int i = 0;
do {
i++;
cin >> a[i];
} while (a[i] != 0);
int count = 0;
for (int j = 0; j < i; j++) {
if (a[j] < 0) {
count++;
cout << a[j] << " ";
}
}... | ALGO | 0.999383 | 3.411407 |
47c048ae-40a1-4d8c-9b46-1962abc0a379 | meowka91155/To-be-named | Library/PackageCache/com.unity.ide.visualstudio@2.0.9/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.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 made to Visual Studio can fail after ... | TOOL | 0.939718 | 6.947423 |
eba36926-fa97-4ace-8731-3c9bf1f52366 | sairudraksh/DSA | 55-jump-game/jump-game.cpp | class Solution {
public:
vector<int>dp;
int find(vector<int>&nums,int i){
int n=nums.size();
if(i>=n) return false;
else if(i==n-1) return true;
else if(nums[i]==0) return false;
if(dp[i]!=-1) return dp[i];
for(int k=1;k<=nums[i];k++){
bool a=find(num... | ALGO | 0.999984 | 5.884722 |
d02fd429-45e6-4e9d-aee9-e5df4400bf14 | gopesh3652/DSA-Love-Babbar-Supreme-Batch | Recorded01/binaryToDecimal2.cpp | // Bitwise method
#include <bits/stdc++.h>
using namespace std;
int binaryToDecimal2(int number)
{
int decimal = 0, i = 0;
while (number)
{
int bit = number & 1;
decimal = decimal + bit * pow(2, i++);
number = number >> 1;
}
return decimal;
}
int main()
{
int number;
... | ALGO | 0.997266 | 5.834761 |
8e9b6e48-dc4f-411a-a4a4-0ab33b45bbfa | Nandani-koli/Striver-SDEsheet-Challange | Day-23/runningMedian.cpp | /*
You are given a stream of 'N' integers. For every 'i-th' integer added to the running list of integers, print the resulting median.
Print only the integer part of the median.
Sample Input 1 :
6
6 2 1 3 7 5
Sample Output 1 :
6 4 2 2 3 4
*/
#include<bits/stdc++.h>
using namespace std;
void insert(int num,priorit... | ALGO | 0.999996 | 5.079776 |
44ccdbff-c9b5-40ff-87cf-af36417e6c83 | SummerNagi/BaekJoonStudy | SummerNagi/CSL/13909.cpp | #include <iostream>
#include <cmath>
int b13909()
{
int N = 0;
std::cin >> N;
std::cout << (int)std::sqrt(N) << std::endl;
return (0);
} | ALGO | 0.999778 | 4.8997 |
c8596456-1a52-43e9-b8a6-c0e1982cdbcd | xuese0513/CYICE-DOMjudge | History/5th/A/Code/generator.cpp | # include <bits/stdc++.h>
using namespace std;
int main(){
mt19937 generator(time(NULL));
uniform_int_distribution<long long> unif(1, 1000);
uniform_int_distribution<long long> alpha(0, 25);
fstream input,output;
input.open("3.in",ios::out);
output.open("3.out",ios::out);
int T,l,x,y,max... | ALGO | 0.999887 | 3.283929 |
c5349011-6b23-40e8-a933-54e52455c981 | dontangg/tower-defense-tutorial | cocos2d/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp | #include <stdlib.h>
#include <jni.h>
#include <android/log.h>
#include <string>
#include "JniHelper.h"
#include "CCFileUtils-android.h"
#include "android/asset_manager_jni.h"
#include "deprecated/CCString.h"
#include "Java_org_cocos2dx_lib_Cocos2dxHelper.h"
#include "base/ccUTF8.h"
#define LOG_TAG "Java_org_cocos... | TOOL | 0.917763 | 6.274785 |
42780110-75f5-465e-8412-3695f7d3542f | abtinahmdi/olympiad-codes | anton and danik.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int x;
cin >> x;
string s;
cin >> s;
int a = 0, d = 0;
for (int i = 0; i < s.size(); i++){
if (s[i] == 'A'){
a++;
}
else{
d++;
}
}
if (a > d){
cout << "Anton";
}
else if (d > a){
cout << "Danik";
}
else{
cout << "Friendship";
}
... | ALGO | 0.999978 | 3.812213 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.