uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
460407cd-9e97-403f-81d6-39304dbafaaf | olexandryipz/OPLab7 | OPLab7.2/OPLab7.2.cpp | #include <stdio.h>
#include <math.h>
#include <Windows.h>
int main() {
int x, y, z, result, min_value;
printf("Введіть значення x: ");
scanf_s("%d", &x);
printf("Введіть значення y: ");
scanf_s("%d", &y);
printf("Введіть значення z: ");
scanf_s("%d", &z);
min_value = (x + y) < (y +... | ALGO | 0.999555 | 4.073819 |
63f98253-e3dc-43e4-9e3f-cb9831a0d63a | BinomialSheep/Competitive | AtcoderContest/ABC257/D.cpp | #include <bits/stdc++.h>
// デバッグ用マクロ:https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<lo... | ALGO | 0.999932 | 4.235458 |
860186ce-6193-4e8f-9231-76db18f632f7 | namhai0510/C-- | C--/gcdmax.cpp | #include <bits/stdc++.h>
using namespace std;
#define nothing ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl "\n"
#define ll long long
#define ull unsigned long long
#define fi first
#define se second
#define pb push_back
const ll oo = 1e13;
const ll modd = 1e9 + 7;
const int maxn = 1e6... | ALGO | 0.999987 | 4.408275 |
2d192e6f-6dd9-4fd4-a91d-f95192de58d7 | Tapesh-Vashisth/Leetcode_Solutions | 1219_Path_with_Maximum_Gold.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <map>
using namespace std;
vector <int> xs = {1, -1, 0, 0};
vector <int> ys = {0, 0, 1, -1};
int helper(int x, int y, vector <vector <int>> & grid, map <pair <int, int>, int> & hold) {
// [score, mask, x, y]
priority_queue <vector <int>> store;
... | ALGO | 0.99971 | 5.193965 |
7fa7ef7b-6518-4003-8348-204e3feafdad | Jessica276/code-signal | test09.cpp | #include<iostream>
#include<vector>
#include<map>
#include<string>
#include<stdexcept>
#include<algorithm>
using namespace std;
int solution(string s1,string s2){
int solutions=0;
map<char,int> occurrence_s1;
map<char,int> ::iterator im;
map<char,int> occurrence_s2;
map<char,int> ::iterator it;
... | ALGO | 0.999833 | 4.82468 |
fe60ce81-a7f5-421d-af0e-a0c21b74d5a6 | MySuperSoul/pat-advanced | 1126.cpp | #include <bits/stdc++.h>
#include <cstdio>
using namespace std;
#define maxn 505
int n, m;
int graph[maxn][maxn];
int degrees[maxn];
int visit[maxn];
void dfs(int position){
visit[position] = 1;
for (int i = 1; i <= n; i++){
if (visit[i] == 0 && graph[position][i] == 1) dfs(i);
}
}
bool valid()... | ALGO | 0.999907 | 4.314639 |
0e8d1e6d-be9a-40d9-954f-f10f515d0c26 | ashtonvalasko/UnrealEngine4.15.1 | Engine/Source/ThirdParty/ICU/icu4c-53_1/source/tools/genrb/prscmnts.cpp | // Safer use of UnicodeString.
#ifndef UNISTR_FROM_CHAR_EXPLICIT
# define UNISTR_FROM_CHAR_EXPLICIT explicit
#endif
// Less important, but still a good idea.
#ifndef UNISTR_FROM_STRING_EXPLICIT
# define UNISTR_FROM_STRING_EXPLICIT explicit
#endif
#include "unicode/regex.h"
#include "unicode/unistr.h"
#include "un... | TOOL | 0.867383 | 5.533516 |
07ac9f9d-a924-4ac5-ae64-759f70e75c7a | Zannatul-Naim/Competitive-Programming | Codeforces/Indivisible.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define in cin >>
#define out cout <<
#define pb push_back
#define YES 1
#define NO 0
void fastIO() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
void print(bool f) {
if(f) cout << "YES" << endl;
else cout << "... | ALGO | 0.999718 | 4.89813 |
b88c5fb1-6f9e-4253-898e-aca24e894f46 | tryeverything36/dlib_source | examples/custom_trainer_ex.cpp | /*
This example program shows you how to create your own custom binary classification
trainer object and use it with the multiclass classification tools in the dlib C++
library. This example assumes you have already become familiar with the concepts
introduced in the multiclass_classification_ex.cpp ex... | DATA | 0.932634 | 7.83565 |
244ca32f-f9d8-4338-9f81-3775b73251b5 | adityajamwal02/LeetcodeProblemSet1 | RestoreIPAddresses.cpp | /*
A valid IP address consists of exactly four integers separated by single dots. Each integer is between 0 and 255 (inclusive) and cannot have leading zeros.
For example, "<IP_ADDRESS>" and "<IP_ADDRESS>" are valid IP addresses, but "0.011.255.245", "192.168.1.312" and "192.168@1.1" are invalid IP addresses.
Given a s... | ALGO | 0.999908 | 6.373671 |
0aa05ef5-6d02-4755-8ab8-d0d4ecb99ddb | cqbzkrx/cqbzkrx | c++/模板/图论/Tarjan (边双连通分量的缩点).cpp | vector dfn (n + 1, 0), low (n + 1, 0), blo (n + 1, 0);
int cnt2 = 0;
auto dfs = [&](auto &&self, int u, int fa, int &cnt, vector <int> &q) -> void {
low[u] = dfn[u] = ++cnt;
q.push_back (u);
for (auto v : e[u]) if (v != fa) {
if (!dfn[v]) {
self (self, v, u, cnt, q);
cmin (l... | ALGO | 0.999194 | 4.752756 |
e920a397-9743-4723-bd7b-9f83e2f1ab8a | ishandutta2007/codeforces | mip182/normal/1560/F1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define fi first
#define se second
#define si set... | ALGO | 0.999426 | 3.650691 |
649ae71e-12c3-4cea-8a79-42b2481a957f | cy0713/SMeta | boost/libs/spirit/example/x3/num_list/num_list3.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demontrates a parser for a comma separated list of numbers.
//
// [ JDG May 10, 2002 ] spirit1
// [ JDG March 24, 2007 ] spirit2
// [ JDG May 12, 2015 ] spirit X3
//
/////////////////////////////////////////////... | TOOL | 0.961122 | 6.796435 |
cb8d431a-6c6a-40f8-a398-288772bed309 | klast/magma_test | main.cpp | // This is a simple standalone example. See README.txt
#include <stdio.h>
#include <stdlib.h>
#include "cublas_v2.h"
#include "magma_v2.h" // also includes cublas_v2.h
#include "magma_lapack.h" // if you need BLAS & LAPACK
// ------------------------------------------------------------
// Replace with your cod... | ALGO | 0.99014 | 6.6746 |
beeed716-d36e-46a7-bfe0-bf9042451ec4 | Pryanshu963/DAA-Assign | bipartite_dfs.cpp | /*
Problem Link: https://practice.geeksforgeeks.org/problems/bipartite-graph/1
*/
class Solution {
public:
/*
bipartite graph is a graph that can be colored with exactly 2 colors
such that no 2 adjacent nodes have the same color.
*/
// helper function using dfs
bool check_bipartite(... | ALGO | 0.9997 | 5.94501 |
650d3b89-782a-4e5a-a2f3-73c680ac6605 | vidsinghal/Cornucopia | HashEnabledLLVM/llvm/tools/llvm-xray/xray-graph.cpp | #include "xray-graph.h"
#include "xray-registry.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/XRay/InstrumentationMap.h"
#include "llvm/XRay/Trace.h"
using namespace llvm;
using namespace llvm::xray;
// Setup llvm-xray graph subcommand and its options.
static cl::SubCommand GraphC("graph", "Generate funct... | CONFIG | 0.940073 | 7.612909 |
4debd734-2006-41ed-b79d-8b55874112cb | kirilliliych/Algorithms | 4sem/3contest/e-chsquare.cpp | #include <cmath>
#include <iostream>
#include <vector>
template<typename Type>
class Point2d
{
template<typename AnotherType>
friend class Point2d;
public:
//---------------------------------------------------------------------------------
Point2d()
: Point2d(0, 0)
{}
Point2d(Type x, Type y... | ALGO | 0.999917 | 5.158442 |
7497196f-20b0-4606-b63b-ad84518dada2 | Srishti013/Data-Structures-and-Algorithms-Questions | recursion/digital_root.cpp | int digitalRoot(int n)
{
int x=0;
if(n>=0 && n<=9)
return n;
else
{
while(n>0)
{
x+=n%10;
n/=10;
}
return digitalRoot(x);
}
}
| ALGO | 0.999238 | 4.603138 |
0807390e-7c46-4e06-a374-a392ebed48c7 | kidclone3/CP | olp/week3/nksgame.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#define pb push_back
#define vi vector<int>
#define vl vector<long long>
#define vb vector<bool>
#define ll long long
#define ... | ALGO | 0.999984 | 3.857676 |
4bc8ea00-4a03-4639-9fc0-600e8eb07584 | matteocarde/patty | benchmarks/planners/z3-4.6.0/src/tactic/ufbv/ufbv_rewriter.cpp | #include "util/uint_set.h"
#include "ast/ast_pp.h"
#include "ast/for_each_expr.h"
#include "ast/rewriter/var_subst.h"
#include "tactic/ufbv/ufbv_rewriter.h"
ufbv_rewriter::ufbv_rewriter(ast_manager & m):
m_manager(m),
m_match_subst(m),
m_bsimp(m),
m_todo(m),
m_rewrite_todo(m),
m_rewrite_cache(m... | ALGO | 0.985639 | 6.566659 |
3ca629c5-11e5-4241-b8b1-8ccc7eab48e4 | rharshit82/DSA | 402-remove-k-digits/402-remove-k-digits.cpp | class Solution {
public:
string removeKdigits(string num, int k) {
if (num.length() == k) return "0";
vector<char> s;
for(int i=0;i<num.size();i++){
while(k > 0 && !s.empty() && s.back() > num[i]){
s.pop_back();
k--;
}
s.pus... | ALGO | 0.999991 | 6.528096 |
fdbd5fdf-68db-4794-8c9e-4169f96ad6fc | 2019331099-Rabbi/Online-Judges-Problems-Solution | LeetCode/Random/721.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define PI acos(-1)
#define sz 1001
#define inf 1e9 + 9
#define mod 100000000
#define RUN_FAST
using namespace std;
// int row[] = {0, 0, -1, 1, -1, 1, -1, 1};
// int col[] = {1, -1, 0, 0, -1, 1, 1, -1};
vector <int> par;
void makeSet(int len)
{
for (int i = 0; i < len... | ALGO | 0.999953 | 4.954248 |
289693aa-f130-47d0-a045-6c403669e321 | ibadus/ft_irc | server/parsing/parsing.cpp | #include "parsing.hpp"
#include "utils.hpp"
#include <string>
static std::string parsePassword(std::string password) {
if (password.length() < 1) {
return "";
}
return password;
}
static int parsePort(std::string port) {
if (port.length() < 1) {
return -1;
}
for (size_t i = 0; i < port.length(); i++) {
... | TOOL | 0.896506 | 4.519804 |
6d2e2c57-341a-4cfa-8c6d-7517f970d304 | EstebanRojas123/Taller3 | main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <limits>
#include "Grafo.h"
#include <sstream>
#include <cmath>
using namespace std;
// Función para leer nodos desde el archivo servidores.csv
void leerNodosDesdeArchivo(const std::string& nombreArchivo, Grafo& grafo) {
std::ifstream archivo(nombre... | DATA | 0.867811 | 4.212339 |
42153398-5bdd-4ca7-881d-1b8b640624b4 | ishandutta2007/codeforces | krijgertje/normal/1106/B.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <cstring>
#include <list>
#include <cassert>
#include <climits>
#inclu... | ALGO | 0.999896 | 3.13352 |
d66e92d1-f7b9-40d1-bd26-34d21d9058c6 | codeonwort/pathosengine | projects/PathosEngine/src/badger/math/convex_hull.cpp | #include "convex_hull.h"
#include "aabb.h"
namespace badger {
// #todo-physics: It seems lots of util functions here are O(NN) when they can be O(N).
static vector3 safeNormalize(const vector3& v) {
if (v == vector3(0.0f)) return v;
return glm::normalize(v);
}
// Returns array index of the point.
static si... | ALGO | 0.99918 | 6.988788 |
aaf77328-6971-43f9-85c2-2342c45e08b6 | Omegahelkarex/striver-dsa-solutions | striver c++ codes/Sorting/Selection_sort.cpp | #include<iostream>
using namespace std ;
int main (){
int n ;
cout<<"Enter the no of elements in the array";
cin>>n;
int arr[n];
cout<<"Enter the elements of the array"<<endl;
for (int i = 0 ; i < n ; i++){
cin>>arr[i];
}
for (int i = 0 ; i < n - 1 ; i++){
for (int j = ... | ALGO | 0.999561 | 3.988541 |
98dacc04-e90a-405f-9ea9-e6ff3b681db0 | alxbckr/aoc2024 | day04/day04.cpp | #include <filesystem>
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
enum class Parts{
All,
Part1,
Part2
};
void parse_input(ifstream& input, vector<vector<char>>& words) {
string line;
while(getline(input, line)) {
std::vector<char> words_line(line.begin(),... | ALGO | 0.988011 | 5.592607 |
a7b2df3a-0d87-44ac-ae61-8e680a1faebb | vikramkbgs/CP | betweenTwoelement_merge_linklist.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 *mergeInBetw... | ALGO | 0.999985 | 5.062024 |
b1ec7bc5-eb1b-4512-a574-a79935c08511 | RyanL123/Competitive-Programming | Leetcode/567.cpp | class Solution {
public:
bool checkInclusion(string s1, string s2) {
int n = s1.size(), m = s2.size();
if (m < n) return false;
int frq1[30], frq2[30];
memset(frq1, 0, sizeof(frq1));
memset(frq2, 0, sizeof(frq2));
for (int i = 0; i < n; i++) frq1[s1[i]-'a']++;
... | ALGO | 0.999969 | 6.158396 |
b3aeab24-33d2-408a-a527-abaaf3415fc1 | rg665n/Strings | PerfectReversibleString.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int T,N;
cin >> T ;
cin.ignore();
string str, rstr;
for (int i=1;i<=T;i++) {
cin >> N;
//cin.ignore();
cin >> str;
string rstr(str);
reverse(rstr.begin(),rstr.end());
//cout << rstr << ... | ALGO | 0.99997 | 3.88998 |
5b082b37-add1-4b38-a477-d84336a97d9f | amenotiomoi/template | template/ds_seg1.cpp | #include<bits/stdc++.h>
using namespace std;
template<typename node> class segment1 {
private:
int l,z;vector<node> t;
struct p{segment1& segTree;int d;p(segment1& st,int i):segTree(st),d(i){}operator node()const{return segTree.t[d];}p& operator=(const node& val){segTree.change(d,val);return *this;}};
... | ALGO | 0.999943 | 4.962407 |
3a859ed6-19a0-43c2-aeb5-167a2af8b7f5 | mvg01/ps | baekjoon cpp/01253(two_pointer).cpp | #include <bits/stdc++.h>
using namespace std;
int n, ans = 0, a[2001];
void solve() {
sort(a, a + n);
for (int i = 0; i < n; i++) {
int l = 0, r = n - 1;
while (l < r) {
if (a[l] + a[r] == a[i]) {
if (l == i) l++;
else if (r == i) r--;
... | ALGO | 0.999965 | 4.628723 |
76110756-da69-4a65-8bae-a7a8ef311b0b | mamodul-kabir/cp-solutions | CSES-Increasing-Subsequence.cpp | /*
Note : Had to take a hint to become sure that an O(NlogN) solution exists. Didn't see the solution. Can say that it's full OC. Hashing + Segment Tree + DP.
Link :
Boka hoye gelum...
*/
#include "bits/stdc++.h"
#define sp <<" "
#define el <<"\n"
#define S second
#de... | ALGO | 0.999944 | 4.440783 |
359ff798-781f-42f4-a5bb-a2274402c2f0 | akshatj2209/LeetProblems | 55-jump-game/55-jump-game.cpp | class Solution {
public:
bool canJump(vector<int>& nums) {
int n=nums.size();
int i;
int max_reach=0;
for(i=0;i<n;i++){
if(i>max_reach){
return false;
}
else if(max_reach>=n-1){
return true;
}
... | ALGO | 0.999978 | 6.187383 |
f95dd819-14c2-458a-b1ea-000c830e4374 | Loayelshall/OS_Schedular | Core/SJF.cpp |
#include "SJF.h"
void SJF::get_input_burst_and_arrival_time(QVector<process> &sjf_process, int num_of_proceses)
{
for (size_t i = 0; i < num_of_proceses; i++)
{
int burst_time, arrival_time;
cout << "Enter burst time for task " << i + 1 << ": \n";
cin >> burst_time;
cout << "En... | ALGO | 0.999988 | 3.421815 |
4e7f13d2-b930-4846-8bbe-788028e545e6 | gio3k/godot-switch-libnx | thirdparty/bullet/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp | #include "btConvexConcaveCollisionAlgorithm.h"
#include "LinearMath/btQuickprof.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
#include "BulletCollision/CollisionShapes... | ALGO | 0.999735 | 7.468039 |
233b0241-791f-4344-a50b-5033c0d6f1ba | lunim00/graph_project | src/hashing.cpp | #include <cmath>
#include "hashing.hpp"
unsigned int hashing::hashingFunction(const unsigned int& num, const std::size_t& size)
{
unsigned int hashedNum = 0;
unsigned int n = num;
unsigned int count = 0;
unsigned int currentNum;
while (n != 0)
{
++count;
n /= 10;
}
curr... | ALGO | 0.999377 | 5.991488 |
6578baed-3f41-4e9e-8cc4-d2d436383ee9 | AnthonyDugarte/competitive-programming | CodeForces/TechnogobletOfFire.cpp | // Codeforces Round #543 (Div. 2, based on Technocup 2019 Final Round)
#include <bits/stdc++.h>
template <typename T, typename U>
using p_t = std::pair<T, U>;
template <typename... T>
using s_t = std::set<T...>;
template <typename T>
using us_t = std::unordered_set<T>;
template <typename T>
using v_t = std::vector<T>... | ALGO | 0.999903 | 4.754791 |
0c938387-eed3-4d73-94f0-60d2fcfbb33c | Pulkith/Competitive | CodeForces/1547/b/b.cpp | /**
* author: DespicableMonkey
* created: 07.10.2021 10:35:14
* Potatoes FTW!
**/
#include<bits/stdc++.h>
#if LOCAL
#include <DespicableMonkey/Execution_Time.h>
#include <DespicableMonkey/Debug.h>
#define debug_active 1
#endif
using namespace std;
#define pb push_back
#define f first
#define s secon... | ALGO | 0.99974 | 4.479315 |
c06d450d-e4d7-4992-84ef-0c9f8bce7038 | isaaclo97/programacion-competitiva | Problemas/Acepta el Reto/249.cpp | #include <bits/stdc++.h>
#define INF 0x3F3F3F3F
using namespace std;
int main() {
int cases;
cin>>cases;
while(cases--)
{
int burro,sacos;
cin>>burro>>sacos;
vector<int> bu;
for(int i=0;i<sacos;i++)
{
int num; cin>>num;
bu.push_back(num);
}
sort(bu.begin(),bu.end());
int res = 0;
for(int i=... | ALGO | 0.999561 | 3.673114 |
353bca5f-db31-4fc9-adfe-d8f527fb96c8 | apktool/Test | 207.cpp | // 207.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
#define N 10
void platform(int a[N], int n)
{
int k, i = 0, j = 0, len = 1;
while (i < n - 1)
{
while (i < n - 1 && a[i] == a[i + 1])
{
i++;
}
if (len < i - j + 1)
{
len = i - j + 1;
k = j;
}
i++; ... | ALGO | 0.994691 | 3.670054 |
a8c953ad-3090-4642-9343-ea20f6c8129d | ishandutta2007/codeforces | dreamoon_love_aa/normal/1674/B.cpp | /*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).be... | ALGO | 0.999927 | 3.238185 |
0028a681-a3bb-45e4-9775-6d7d0fab0e6f | zfleaves/flutter-my-bili | 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 |
6fde42bf-bec3-403e-9bf3-ee443080108c | mamunur1296/C-learning | Data Stracture/module-7/print_recaply.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int value)
{
this->value = value;
this->next = NULL;
}
};
void print_Recursion(Node * head)
{
if(head==NULL) return;
print_Recursion(head->next... | ALGO | 0.999328 | 4.188522 |
0252a5a3-2a7c-4191-8d31-0468f6e8965d | paldeshubham/C-_practice | c++_practice_code/Conversion.cpp | #include<iostream>
using namespace std;
class stack{
char data[20];
int top;
public:
stack()
{
top=-1;
}
char topdata()
{
return (data[top]);
}
void push(char x)
{
data[++top]=x;
}
char pop()
... | ALGO | 0.999919 | 4.225299 |
794df75c-4c3c-41a7-97ae-f23c9ede191b | SU-IN-LEE/codetree-TILs | 240309/2021년 날짜의 유무/with-or-without-2021.cpp | #include <iostream>
using namespace std;
bool IsExit(int m, int d) {
if(m > 12) {
return false;
}
if (d > 31) {
return false;
}
if (m == 2 && d > 28) {
return false;
}
if ((m == 4 || m == 6 || m == 9 || m == 11) && d > 30) {
return false;
}
return tr... | ALGO | 0.999925 | 3.87645 |
ffb597b1-df2c-430b-af1f-53e56e811707 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_13266_12.cpp | #include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000000ll;
const long long inf64 = inf * inf;
const long long N = 100100;
bool solve() {
long long n, m, b;
cin >> n >> m >> b;
vector<pair<pair<long long, long long>, pair<long long, long long> > > f(n);
for (int i(0); i < n; i++) {
cin... | ALGO | 0.999204 | 4.042603 |
735e00f9-6005-466a-b7a0-494fe525391d | serbantasss/Competitive-Programming | OTHER/Fise/Fisa 1'/10)/main.cpp | #include <iostream>
using namespace std;
bool VerifBaza2(int a)
{
long long int p=0,pit=1;
while(a)
{
if(a%2==1)
p=p+pit;
pit*=10;
a/=2;
}
int nrz=0,nru=0;
do
{
if(p%10==0)
nrz++;
else
nru++;
p/=10;
}whi... | ALGO | 0.999738 | 3.601192 |
6e286d20-4d57-47d6-9734-c21f5436bc1a | Chufan1990/HLBC | src/control/common/interpolation_1d.cpp | #include "control/common/interpolation_1d.h"
#include <algorithm>
#include "common/macro.h"
namespace {
const double kDoubleEpsilon = 1e-6;
}
namespace autoagric {
namespace control {
bool Interpolation1D::Init(const DataType& xy) {
if (xy.empty()) {
AERROR("empty input.");
return false;
}
auto da... | ALGO | 0.967679 | 6.851703 |
2bd1f54c-de0d-41ca-a967-ebe9056aed30 | alexandraback/datacollection | solutions_1483485_0/C++/SiNZeRo/A.cpp | #include<iostream>
#include<string>
#include<map>
#include<hash_map>
using namespace std;
hash_map<char,char> Mapping;
void GETMapping()
{
string END[3] = {
"ejp mysljylc kd kxveddknmc re jsicpdrysi",
"rbcpc ypc rtcsra dkh wyfrepkym veddknkmkrkcd",
"de kr kd eoya kw aej tysr re ujdr lkgc jv"
};
string REAL[3] ... | ALGO | 0.999469 | 3.8505 |
aa3e691a-09f9-4129-a4be-39cffbca01be | jadonsooraj/Coding-Problems | LeetCode/2149.Rearrange_Array_Elements_by_Sign.cpp | class Solution {
public:
vector<int> rearrangeArray(vector<int>& nums) {
int posindex=0,negindex=1;
int n=nums.size();
vector<int> ans(n,0);
for(int i=0;i<n;i++){
if(nums[i]<0){
ans[negindex]=nums[i];
negindex=negindex+2;
}
... | ALGO | 0.999974 | 5.613165 |
fafd63e8-d8c0-4ac8-8498-ab2e3fb57a62 | Nafyaz/my-codes | UVA/00200(2).cpp | #include<bits/stdc++.h>
using namespace std;
int vis[26], pr[26];
stack<int> st;
vector<int> adj[26];
void dfs(int s)
{
vis[s] = 1;
for(auto u : adj[s])
{
if(vis[u] == 0)
dfs(u);
}
st.push(s);
}
int main()
{
// freopen("out.txt", "w", stdout);
int i;
string s, t;
... | ALGO | 0.999923 | 3.853667 |
293bfce5-cb5a-4f41-9476-92e0db455444 | k-nautresurrect/STL | vector/sampleProb2.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
bool cmp(pair<int, int> &a, pair<int, int> &b) {
return (a.first > b.first);
}
int main() {
vector<int> marks;
vector<int> rollno;
vector<pair<int, int>> list;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
... | ALGO | 0.99986 | 4.223002 |
65021973-21ee-4de9-8c7f-2e175eb5f1de | HarpsealCC/note | 学习笔记/面试/代码片段/find_num_in2darray.cpp | /**
* @file find_num_in2darray.cpp
* @brief
* @author liuchengzhuo (<EMAIL>)
* @version 1.0
* @date 2023-11-26
*
* @copyright Copyright (c) 2023
*
* @par 修改日志:
* <table>
* <tr><th>Date <th>Version <th>Author
* <tr><td>2023-11-26 <td>1.0 <td>liuchengzhuo
* <th>Description
* <td>在二维数组中寻找一个数
* </t... | ALGO | 0.999256 | 5.887554 |
ab5f0452-1ab8-4cbe-b63f-442ce2bf6da0 | FuHongbao/OJ_Code | 88.cpp | /*************************************************************************
> File Name: 88.cpp
> Author: victoria
> Mail: <EMAIL>
> Created Time: 2019年06月05日 星期三 19时50分27秒
************************************************************************/
#include <iostream>
#include <algorithm>
#include <string.h>
using ... | ALGO | 0.999778 | 3.113891 |
5dce796f-03a2-41bc-a228-403e3b0b0a56 | paulnewman1979/edocteel | 074/748/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <unordered_map>
#include <iterator>
#include "../../template/common/Input.hh"
#include "../../template/common/Output.hh"
using namespace std;
class Solution {
public:
string shortestCompletingWord(string licensePlate, vector<st... | ALGO | 0.999764 | 6.105464 |
b88b74bf-6aa0-47f9-a9d9-6edab7094b90 | takashi247/webserv | srcs/config/config.cpp | #include "config.hpp"
Config::Config(const char *config_file) : config_file_(config_file) {
if (config_file != NULL) {
ConfigParser cp;
cp.ParseConfigFile(vec_server_config_, config_file);
}
}
Config::~Config() {}
Config::Config(Config const &rhs) { *this = rhs; }
Config &Config::operator=(Config const... | CONFIG | 0.962144 | 5.805035 |
55ff2ec3-5ecc-4894-9ba0-1cddcb23de0e | udayTanthetaa/a2z-dsa-sheet | 03/easy/05_linear_search.cpp | #include <bits/stdc++.h>
using namespace std;
void stayTORO() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
class Solution {
public:
bool search(const vector<int>& nums, const int nu... | ALGO | 0.999952 | 5.677262 |
f7eb6d89-bfed-44c8-a643-e9abc306fc26 | purveshjambhulkar/Strivers-DSA-Sheet | 11.Greedy Algorithms/02.Medium Hard/08.Insert Interval.cpp | class Solution {
public:
vector<vector<int>> insert(vector<vector<int>>& intervals,
vector<int>& newInterval) {
vector<vector<int>> result;
int n = intervals.size();
int i = 0;
// Add all intervals before newInterval
while (i < n && intervals[... | ALGO | 0.99997 | 6.52829 |
70cc0f5a-6a5f-46d8-a0a4-c074041b20d6 | pingchungchang/CP | ABC246B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ld long double
int main(){
int a,b;
cin>>a>>b;
ld x = sqrt(a*a+b*b);
cout<<fixed<<setprecision(1... | ALGO | 0.995601 | 3.616905 |
d4651934-bbdf-4c3b-8f7d-a170f2ddfd1a | algebra1415011/programming | kickstart f/translieration.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll n;
string s;
cin>>n;
map<string , ll > mp;
while(n--)
{
cin>>s;
for(ll i=0;i<s.length();i++)
{
if(s[i]=='u')
{
s[i]='#';
}
else if(i<s.length() and s[i]=='o' and s[i+1]=='o')
{
s[i]='#';
s[i+1]... | ALGO | 0.998512 | 3.898317 |
f5d35c19-7d69-41a9-a552-156916ec5231 | Harpreet-ui/Travel_Ai | 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 |
65001f8a-280e-4c05-8176-bff121462181 | pointer-authentication/pcan-llvm | libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_range.pass.cpp | // <forward_list>
// template <class InputIterator>
// iterator insert_after(const_iterator p,
// InputIterator first, InputIterator last);
#include <forward_list>
#include <cassert>
#include "test_iterators.h"
#include "min_allocator.h"
int main()
{
{
typedef int T;
... | TEST | 0.940783 | 5.213295 |
b3acf78f-6546-4be8-8171-e769a673b8c4 | ravnoorsingh/leetcode-solutions | problems/0725-split-linked-list-in-parts/solution.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:
vector<ListNode*> spl... | ALGO | 0.999884 | 5.416085 |
d278d83c-d9e0-4d06-8d3a-63343b2a6c82 | karayuumac/procon-archive | atcoder.jp/abc168/abc168_c/Main.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define rep(i, n) for(int i = 0; i < (int) n; i++)
#define repd(i, n) for(int i = (int) (n - 1); i >= 0; i--)
#define FOR(i, a, b) for(int i = a; i <= (int) b; i++)
#define FORD(i, a, b) for(int i = a; i >= (int) b; i--)
template<typename T>
vo... | ALGO | 0.999903 | 3.932889 |
424de924-6abf-41da-9015-278575fb64e8 | ashwanisingh1/leetcode-sol | medium/237.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
void deleteNode(ListNode* node) {
ListNode *next=node->next;
int temp = next->val;
next->val=node->val;
... | ALGO | 0.999908 | 5.555753 |
f1681574-ab18-44ea-bdef-1fd13ed8082a | CubicMC/cubic-server | cubic-server/utility/random_tick_block_functions/Farmland.cpp | #include "Dimension.hpp"
#include "Server.hpp"
#include "blocks.hpp"
#include "types.hpp"
#include "utility/RandomTickBlockFunctions.hpp"
#include "world_storage/ChunkColumn.hpp"
#include <memory>
bool checkWater(const world_storage::ChunkColumn &chunkColumn, const Position &absolutePosition)
{
auto dim = chunkCol... | ALGO | 0.936753 | 5.972094 |
f49bb184-8a6c-437a-8546-2fe5b1b1674a | Inryu/algorithm | 삼성 SW 역량 테스트 기출 문제/삼성 SW 역량 테스트 기출 문제/19238 스타트택시.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
int dx[4] = { -1,0,1,0 }; //
int dy[4] = { 0,1,0,-1 };
int n, m, fuel; // ũ(n*n), մ ,
int tr, tc; //ý ġ
int map[21][21];
//BFS ̿ ִܰŸ
int dis[21][21]; //distance
bool visit[21][21]; //湮 ߴ
vector <pair <int, int>> endp... | ALGO | 0.999803 | 4.955553 |
85d87874-5aad-4e59-9e99-f64e2ef510fe | lichkkkk/LeetCode_G-C | 257-BinaryTreePaths/257BinaryTreePaths.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
vector<string> res;
vector<int> path;
class Solution {
public:
vector<string> binaryTreePaths(TreeNode* root) {
... | ALGO | 0.99978 | 6.231955 |
45f8b0f0-ac40-4dca-a862-646f5a652c28 | onlyet/DirectShowSamples | directshow/baseclasses/dllsetup.cpp | #include <streams.h>
#include <strsafe.h>
//---------------------------------------------------------------------------
// defines
#define MAX_KEY_LEN 260
//---------------------------------------------------------------------------
// externally defined functions/variable
extern int g_cTemplates;
extern CFactoryT... | TOOL | 0.868695 | 3.906943 |
9667dbb3-d2df-4f30-b581-8f6cdb32bddc | alexandraback/datacollection | solutions_1483485_0/C++/bswig/qual-a.cpp | #include <cstdio>
char key[] = "yhesocvxduiglbkrztnwjpfmaq";
char line[105];
int ntest;
int main()
{
sscanf(gets(line), "%d", &ntest);
for(int test = 1;test <= ntest;++test)
{
gets(line);
for(int i = 0;line[i];++i)
if(line[i] != ' ')
line[i] = key[line[i] - 'a'];
printf("Case #%d: %s\n", test, line);
... | ALGO | 0.994756 | 3.750237 |
d5e438fe-2ab2-4a31-bd19-33f174574d1f | hafizeogut/Deitel_C- | DEITEL_C++_How_to_Program_Soru_Cozumleri/D2_38_C.cpp | //Exercise 2.38 Part A Solution
#include<iostream>
using std::cout;
using std::endl;
using std::cin;
using std::ios;
#include <iomanip>
using std::setw;
using std::setprecision;
using std::setiosflags;
int main(){
int n=0,accuracy=15,x=3.0,times=0,count;
double e=1.0,exp=0.0,fact=1.0;
while(n++ <=accuracy){
co... | ALGO | 0.9998 | 3.49101 |
0c32a35a-e354-45ac-846f-7f07d658bfe3 | Arshjeet-Singh/DSASheet2022 | Graph/Practice/Dijkstra's shortest path.cpp | #include <bits/stdc++.h>
vector<int> dijkstra(vector<vector<int>> &vec, int vertices, int edges, int source) {
unordered_map<int,list<pair<int,int>>> adj;
for(int i=0;i<edges;i++)
{
int u=vec[i][0],v=vec[i][1],w=vec[i][2];
adj[u].push_back(make_pair(v,w));
adj[v].push_back(make_pair... | ALGO | 0.999965 | 4.978996 |
f31984f8-711c-4a71-8616-cbcd3be680c4 | IqraHabib1/DSA-Task-week-1 | 17.write a program to check if two arrays are same or not.cpp | #include<iostream>
using namespace std;
int main()
{
int i,j;
int arr[5];
for(i=0;i<5;i++)
{
cout<<"enter number for first array "<<" "<<i+1<<" : "<<" ";
cin>>arr[i];
}
for(j=0;j<5;j++)
{
cout<<"\n enter numbers for second array "<<" "<<j+1<<" : "<<" ";
cin>>arr[j];
}
bool flag;
for(i=0;i<5;i... | ALGO | 0.999501 | 3.001569 |
9e6dbc09-8ad9-4504-aff6-e159e188d276 | julcia106/Stephen-Prata-Primer-Plus | Rozdział 11/1/Source.cpp | #include "pch.h"
#include <iostream>
#include "vector.h"
#include <cstdlib>
#include <ctime>
int main () {
using namespace std;
using VECTOR::Vector;
srand (time (0)); //inicjalizacji liczb pseudolosowych
double direction;
Vector step;
Vector result (0.0, 0.0);
unsigned long steps = 0;
double target;
double d... | ALGO | 0.985841 | 3.424101 |
902c1cd6-b0fc-42d9-8cc7-4628281216e6 | iorais/COEN79 | hw1/p1_procederal.cpp | #include <iostream>
#include <math.h>
float area(float radius) {
return 3.14 * pow(radius, 2);
}
int main() {
float r = 1;
float my_circle = area(r);
} | ALGO | 0.978358 | 3.837881 |
6fb5122f-4a04-48f8-8532-98d8472f4183 | lht06/openGauss-server | src/gausskernel/storage/access/heap/pruneheap.cpp | #include "postgres.h"
#include "knl/knl_variable.h"
#include "access/heapam.h"
#include "access/transam.h"
#include "access/xlog.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "storage/buf/bufmgr.h"
#include "utils/rel.h"
#include "utils/rel_gs.h"
#include "commands/vacuum.h"
#include "catalog/catalog.h"
#incl... | ALGO | 0.987487 | 5.207458 |
8682731c-ca24-4916-bdd1-cd2b31e77620 | Lynn-real/opencv | sources/modules/video/perf/opencl/perf_optflow_farneback.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | TEST | 0.906109 | 7.686371 |
8e265cdc-d2df-44df-8b24-20533fa0c503 | Lchuxian/SLAM-Environment | OpenCV3_and_OpenCV4_coexist/opencv-4.5.5-build/opencv_contrib-4.5.5/modules/quality/samples/brisque_eval_tid2008.cpp | #include <fstream>
#include "opencv2/quality.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/ml.hpp"
/*
BRISQUE evaluator using TID2008
TID2008:
http://www.ponomarenko.info/tid2008.htm
[1] N. Ponomarenko, V. Lukin, A. Zelensky, K. Egiazarian, M. Carli,
F. Battisti, "TID2008 - ... | ALGO | 0.994871 | 7.058199 |
eb3a1643-9356-492b-953d-745cc07216c2 | ICraZZyBoY/Algorithms-Trainings | UNIVERSITY (ICPC, codeforces, contests, etc.)/17.11.2023/Дорешка/E.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector <int> a(n);
for (int i = 0; i < n; ++i)
cin >> a[i];
int indMin = 0;
for (int i = 1; i < n; ++i)
if (a[... | ALGO | 0.999959 | 4.328446 |
d0a66d4c-5199-448e-84b8-ea9e4c82b7fa | f2015537/Competitive-Programming | Virtuals/7Jan_2022/E.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ull, ull> pul;
typedef pair<ld, ld> pld;
typedef pair<double,double> pd;
typedef vecto... | ALGO | 0.999539 | 5.029254 |
209bccbf-c777-412d-9eae-9355895f7b3f | MiniCaos/sudoku_solver_project | SudokuForwardChecking.cpp | #include "SudokuForwardChecking.h"
#include <cstring> // Para usar std::memcpy
namespace SudokuSolver {
// Inicializa la matriz de candidatos
void SudokuForwardChecking::inicializarCandidatos() {
for (int fila = 0; fila < SIZE; ++fila) {
for (int col = 0; col < SIZE; ++col) {
if (grid[fila][co... | ALGO | 0.999953 | 6.441561 |
39dc35d0-4c38-4e00-a59f-bf0107ee7789 | rajdeepsri/DSA_cpp | Searching/book_allocation_problem.cpp | //arr[i] represents no. of pages in ith book. there are m students and task is to allocate
//all books to their students such that
//each student get at least one book
//each book allocated to a student
//book allocated in contiguos manner
//allocate such that max no of pages assigned to a student is minimum
#include<... | ALGO | 0.99999 | 4.577405 |
d097f7d3-5f01-4417-b861-222594bf186e | ufz/ogs | MaterialLib/MPL/Properties/WaterTemperatureIAPWSIF97Region1.cpp | #include "WaterTemperatureIAPWSIF97Region1.h"
#include <cmath>
#include "BaseLib/Error.h"
namespace MaterialPropertyLib
{
static constexpr std::array n_T = {
-0.23872489924521e3, 0.40421188637945e3, 0.11349746881718e3,
-0.58457616048039e1, -0.15285482413140e-3, -0.10866707695377e-5,
-0.13391744872602... | ALGO | 0.999344 | 5.152443 |
0548d956-cdb3-42e3-9f61-a1fca1d7b8fa | TakeOver5/My-C-Notes | demo/Chapter-08/030.MultitypeVariableSwap/MultitypeVariableSwap.cpp | /*
* 時間:2018/04/23
* 功能:
* 多型變數交換。
* 目的:
* 練習指標操作。
*/
#include <stdio.h>
#include <stdlib.h>
void swap(void *, void *, int);
int main(void){
int a = 252117761, b = 666;
double c = 3, d = 6;
swap(&a, &b, sizeof(int));
swap(&c, &d, sizeof(double));
printf("a = %d, b = %d\... | ALGO | 0.897118 | 3.974978 |
f50a3578-ea18-4121-becd-d1fbe60d3131 | dangtrunghieukg/GiaiDeThi_HSG_TinHoc_THPT_KG_byCPP | 2011_2012_HSG_TinHoc_KG_Lop11_12/Bai1_hsgKG_THPT_Y11_12_hsChan.cpp | #include <iostream>
#include <fstream>
#define MAX 20
using namespace std;
bool arrDanhDau[20];
int arrDayHoanVi[20];
int N;
int dem=0;
ifstream MyRead("HOANVI.INP");
ofstream MyOut("HOANVI.OUT");
void XuatHoanVi(){
bool xuatOk=true;
for(int i=1; i<=N; i++){
if(i==arrDayHoanVi[i]){
xuatOk... | ALGO | 0.999868 | 3.189005 |
fdf58dd8-b56f-4615-9f2c-2f49d8a65fbf | ycfangcs/DS | 08_Hard/01_KMP.cpp | /**
* KMP
*/
#include <iostream>
#include <string>
using namespace std;
// 计算next数组
void getNext(string s, int next[]) {
int i = 0, j = -1;
next[0] = -1;
while (i < s.length() - 1) {
while (j >= 0 && s[i] != s[j]) {
j = next[j];
}
i++;
j++;
next[i... | ALGO | 0.999884 | 4.588991 |
3820a26f-ff4a-43f8-b0d1-b68d307c0bf7 | JoshWolper/MountStHelens | computeSurfaceDistance.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <vector>
#include <stdlib.h>
#include "eigen/Eigen/Dense"
using namespace std;
//ASSUMPTIONS
//1. we won't try to query two contiguous pixels since that calculation is done more easily by hand
//2. this kernel method will work :)
vector<int> PointToGri... | DATA | 0.994355 | 3.832532 |
f66e1e10-2003-42e9-bc0d-7b1e5d830945 | kunyavskiy/competitive-programming-archive | opencup/18-19/190202/J.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>... | ALGO | 0.99914 | 3.677975 |
92c2e178-fd42-42b5-8dc0-095e6e756a31 | grzelo728/PEA2 | PEA_2_release/src/Graph.cpp | //
// Created by Jakub Grzegocki on 29.11.2023.
//
#include <fstream>
#include <time.h>
#include <ctime>
#include <string>
#include <iostream>
#include <vector>
#include "Graph.h"
Graph::Graph() {}
Graph::~Graph() {}
void Graph::ustawSciezke(vector<int> sciezka){
sciezkaPomocnicza = sciezka;
}
vector<int> Grap... | ALGO | 0.976624 | 4.235589 |
2ee14c45-10d4-4c29-aaba-31d6582c83b7 | prathamshirol/Codes | 0342-power-of-four/0342-power-of-four.cpp | class Solution {
public:
bool isPowerOfFour(int n) {
if (n > 0 && (n & (n - 1)) == 0) { // Check if n is a power of two
if (__builtin_ctz(n) % 2 == 0) { // Check if the number of trailing zeros is even
return true;
}
}
return false;
}
}; | ALGO | 0.999192 | 6.478141 |
a71270f5-4656-467a-af5f-d4e330ad1514 | ankit039/Competitive_Programming_Solutions | HackerRank/Super_Reduced_String.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
stack<char> op;
op.push(s[0]);
for(int i=1;i<s.size();i++){
//push if stack is empty "or" s[i] is not equal to the top element of satck
if(op.empty() || s[i]!=op.top()){
op.push(s[i]);
}... | ALGO | 0.999991 | 5.160525 |
07ec543c-5422-4a08-82ae-f3e5f109cf78 | ishandutta2007/codeforces | a_g/normal/1680/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main () {
ios_base::sync_with_stdio(0); cin.tie(0);
int T;
cin >> T;
while (T--) {
int l1, r1, l2, r2;
cin >> l1 >> r1 >> l2 >> r2;
if (l2 <= r1 && l1 <= r2) {
cout << max(l1, l2) << '\n';
continue;
}
cout << l1+l2 << '\n';
}
} | ALGO | 0.999738 | 3.425684 |
30b0d90d-695a-4ada-902a-757c276b5878 | sampritipanda/IOI_Repository | Codeforces/NEERC_2015/I.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int N, K; cin >> N >> K;
int colors[K + 1];
for(int i = 0; i <= K; i++) colors[i] = 0;
int each = N/K;
for(int i = 0; i < N; i++) {
int c; cin >> c;
colors[c]++;
}
int ans = 0;
for(int i = 1; i <= K; i++) {
if(col... | ALGO | 0.99989 | 3.93382 |
16ace3d1-ea8c-4839-9d35-d53047ff73d8 | sifat-hossain-niloy/CodeForces-Solutions | B_Two_Buttons.cpp | #include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define TC(t) int t;cin >> t;while(t--)
#define FL(t) for(int i=0;i<t;i++)
#define Y cout << "YES\n"
#define N cout << "NO\n"
#define ff first
#define ss second
#d... | ALGO | 0.999952 | 3.797379 |
5c5d48a8-6efe-4dc9-bb89-f3ba77f7b3b8 | takashigoto1207/atcoder | abc1xx/abc164/abc164_b.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using namespace atcoder;
using ll = long long;
int main() {
int A, B, C, D;
cin >> A >> B >> C >> D;
if ((A + D - 1) / D >= (C + B - 1) / B)
cout << "Yes" << endl;
else
cout << "No" << e... | ALGO | 0.999894 | 3.979753 |
5fde0050-7af0-4367-94cc-b2f9f4a4e09a | zilinli0130/leetcode_algorithm_solution | BFS/Basics/1091. Shortest Path in Binary Matrix/1091. Shortest Path in Binary Matrix.cpp | class Solution {
public:
int shortestPathBinaryMatrix(vector<vector<int>>& grid) {
int n = grid.size();
// if starting or ending cell is blocked then return -1
if (grid[0][0] == 1 || grid[grid.size()-1][grid.size()-1] == 1)
return -1;
queue<pair<int, int>> q;
q.... | ALGO | 0.999992 | 6.389627 |
6340422a-361b-419c-b6c9-d63181693869 | priyanshimaurya/leetcode-Solution2 | 2293 - Copy.cpp | #include<bits/stdc++.h>
using namespace std;
int minMaxGame(vector<int>& nums) {
while(nums.size()>1){
int n=nums.size()/2;
for(int i=0;i<n;i++){
if(i%2==0){
nums[i]=min(nums[2*i],nums[2*i+1]);
}
else {
nums[i]=max(nums[2*i],nums[2*... | ALGO | 0.999963 | 5.002424 |
f54c3fc1-de41-4bbf-a136-c1994d0de91a | yzxo/leetcode | LeetCode6/LeetCode6/234. Palindrome Linked List.cpp |
#include"common.h"
using namespace std;
ListNode* reverseLinkedList(ListNode* head) {
if (head && head->next) {
ListNode* median = head->next, *last = median->next;
head->next = NULL;
while (median) {
median->next = head;
head = median;
median = last;
if (last) last = last->next;
}
} ... | ALGO | 0.999732 | 5.002175 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.