uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b24fe360-2e43-426e-aed6-fdb5a23f916a | SeSACAlgorithm/AlgorithmStudy | 백준/수학/2581) 소수/재원.cpp | #include<iostream>
using namespace std;
bool isPrime(int x)
{
if (x == 1)
return false;
int i = 2;
while (i<x)
{
if (x % i == 0)
return false;
i++;
}
return true;
}
int main()
{
int N ,M,sum,min;
sum=0;
min=0;
cin>>N>>M;
for(N;N<=M;N++)
{
if(isPrime(N))
{
... | ALGO | 0.999987 | 4.099822 |
8f770b48-84e6-409c-b896-69626d47e234 | sarvex/leetcode-rockstar | solution/0200-0299/0238.Product of Array Except Self/Solution.cpp | class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
int n = nums.size();
vector<int> ans(n);
for (int i = 0, left = 1; i < n; ++i) {
ans[i] = left;
left *= nums[i];
}
for (int i = n - 1, right = 1; ~i; --i) {
ans[i] ... | ALGO | 0.999987 | 6.609976 |
6208321c-02aa-4251-b65d-99a777f27966 | abhay-sen/codechef | Mario_and_Bullet.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;cin>>t;
while (t--)
{
int v,s,time;
cin>>s>>v>>time;
int result = time-v/s;
if (result<0) cout<<"0\n";
else
cout<<result<<"\n";
}
return 0;
} | ALGO | 0.999587 | 3.68005 |
39f6d498-883c-4ae4-9231-8e2fd8d40f97 | miku272/CUHP-MCA-Practical | 502_DSA_Practicals/practical_9.cpp | /*
Perform Queue Operation using Linked list implementation.
*/
#include <iostream>
#include "queue.h"
int main(int argc, char const *argv[])
{
Queue *q = new Queue();
q->enqueue(1);
q->enqueue(2);
q->enqueue(3);
q->enqueue(4);
q->enqueue(5);
while (!q->is_empty())
{
std::co... | TOOL | 0.980014 | 5.041081 |
d5268cf0-6cd7-452e-997d-676b16ecbcfe | amit77t/CPP-Problems | functions/calculator.cpp | #include<iostream>
using namespace std;
int add(int a, int b)
{
return a+b;
}
int main()
{
int a,b;
cout<<"enter the first no : \n";
cin>>a;
cout<<"enter the second no : \n";
cin>>b;
cout<<add(a,b);
return 0;
} | TOOL | 0.995549 | 3.556696 |
2cb3429a-5cfa-48bf-a4d6-0b77a41c5d9b | hhslam/kalibr | kalibr/aslam_optimizer/aslam_backend/src/LinearSystemSolver.cpp | #include <aslam/backend/LinearSystemSolver.hpp>
#include <boost/thread.hpp>
#include <aslam/backend/ErrorTerm.hpp>
#include <boost/ref.hpp>
namespace aslam {
namespace backend {
LinearSystemSolver::LinearSystemSolver() {}
LinearSystemSolver::~LinearSystemSolver() {}
void LinearSystemSolver::evaluateErr... | TOOL | 0.874405 | 6.890459 |
051dbd2e-00dc-4ae3-9cb7-e6672ab4b267 | dorleosterode/snegl | process_text.cpp | #include <sdsl/suffix_arrays.hpp>
#include <sdsl/suffix_trees.hpp>
#include <fstream>
#include <cstdlib>
#include <climits>
#include "process_text.hpp"
class mem_iterator_text
{
private:
// arguments from the caller
cst_huff& p_cst;
std::string& p_pattern;
unsigned long p_l;
bool p_mums;
bool... | ALGO | 0.994262 | 5.444677 |
72ec9f6b-a574-4beb-ab45-ba31d65ed0b1 | PritomPaul99/CodesFromVScode | C++_programming/NEUB_CP_CLUB/Contest_1/4_sum_of_digits_of_5_digit_number.cpp | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
int n;
scanf("%d", &n);
int sum = 0;
while (n != 0)
{
sum += (n % 10);
n /= 10;
}
printf("%d", sum);
return 0;
} | ALGO | 0.99994 | 4.227299 |
c2f8ad13-7116-49a6-b3c9-f73f84f81a12 | bvarela27/SystemC_ams | filter.cpp | #include "filter.h"
void filter::set_gain(double gain_) {
gain = gain_;
}
void filter::set_cutoff_frequency(double fc_) {
fc = fc_;
den(1) = 1.0 / ( 2.0* M_PI * fc );
}
void filter::initialize() {
num(0) = 1.0;
den(0) = 1.0;
den(1) = 1.0 / ( 2.0* M_PI * fc );
}
void filter::processing() {
... | ALGO | 0.984467 | 4.213336 |
24ffc872-da00-4aa9-804d-63e837bc02a8 | Xelerezex/learning-space | coursera-courses/specialization-algorithms-data-structures/01-algorithmic-toolbox/week-4/07-closest-points/Example/closest.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <cmath>
using std::vector;
using std::string;
using std::pair;
using std::min;
double minimal_distance(vector<int> x, vector<int> y) {
//write your code here
return 0.;
}
int main() {
siz... | ALGO | 0.999859 | 3.942443 |
baaff98b-02df-40a5-9fd7-4b2c621aedfe | VibhuKothiya/Cpp-language | Multiprocessor/binary_operator_overloading.cpp | //5. WAP to add two distances using binary plus (+) operator overloading.
#include<iostream>
using namespace std;
class Distance{
private:
int feet, inch;
public:
void set(int feet, int inch){
this -> feet = feet;
this -> inch = inch;
}
void get(){
cout<<feet<<" feet "<<inch<<" inch"<<endl;
}
Dista... | ALGO | 0.890438 | 4.999982 |
df9ddac7-8b77-4dfc-9b18-9fb8629d35d2 | V-Sekai-fire/TOOL_godot_cage_deformer | thirdparty/eigen/doc/examples/QuickStart_example2_dynamic.cpp | #include <iostream>
#include <Eigen/Dense>
using Eigen::MatrixXd;
using Eigen::VectorXd;
int main() {
MatrixXd m = MatrixXd::Random(3, 3);
m = (m + MatrixXd::Constant(3, 3, 1.2)) * 50;
std::cout << "m =" << std::endl << m << std::endl;
VectorXd v(3);
v << 1, 2, 3;
std::cout << "m * v =" << std::endl << m ... | ALGO | 0.999111 | 3.794172 |
a079435e-a171-41d9-8af6-370e773d7f35 | nikhil16072003/LeetCode | 496. Next Greater Element I.cpp | class Solution {
public:
vector<int> nextGreaterElement(vector<int>& nums1, vector<int>& nums2) {
int n1=nums1.size();
int n2=nums2.size();
int m;
int i,j,k;
vector<int>ans;
for(i=0;i<n1;i++){
m=-1;
for(j=0;j<n2;j++){
if(nums1[i... | ALGO | 0.999992 | 5.796499 |
50691729-ed47-4e65-a21c-4d861eea0cf9 | KiwiFlow/Algorithms | 0和5.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
int five = 0,zero = 0;
int n;
cin>>n;
for(int i=0;i<n;i++){
int j;
cin>>j;
j==0?(zero++):(five++);
}
if(zero==0){
cout<<"-1"<<endl;
}else{
if(five/9){
cout<<string((five/9... | ALGO | 0.999841 | 3.881793 |
42634cf7-0c6a-454a-86ee-1cf129ac33f1 | aalogancheney/cs103 | lab/lab10/test2.cpp | #include "bigint.h"
#include <iostream>
using namespace std;
int main() {
BigInt a("13");
BigInt b("42");
b.add(a); // increase b by a
b.println(); // prints 55
b.add(a); // increase b by a
b.println(); // prints 68
/*a.println(); // prints 13
a.add(a); // a = 13 + 13 = 26
a.add(a);... | ALGO | 0.97708 | 4.468645 |
fbb6a751-82ba-4546-b0e5-b63ac07da9ea | jefferyyuan/AlgorithmPractices | Leetcode-cpp/contains_duplicate_2.cpp | class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
unordered_map<int, int> record;
for (int i = 0; i < nums.size(); ++i) {
if (record.find(nums[i]) != record.end()) {
if (i - record[nums[i]] <= k) return true;
}
recor... | ALGO | 0.999952 | 6.272139 |
13226ead-43ca-439f-a97a-ed10342b7964 | afperry12/Game-Programming-3113 | Pong Clone/Pong Clone/main.cpp | /**
* Author: Peter Perry
* Assignment: Pong
* Date due: 2024-10-12, 11:59pm
* I pledge that I have completed this assignment without
* collaborating with anyone else, in conformance with the
* NYU School of Engineering Policies and Procedures on
* Academic Misconduct.
**/
#define GL_SILENCE_DEPRECATION
#defin... | TOOL | 0.958548 | 3.450201 |
db9b0da5-4fed-40b1-8646-4d52bd33f0d8 | krantirk/-self-driving-car | project_11_path_planning/src/Eigen-3.3/bench/sparse_transpose.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
// -DNOGMM -DNOMTL
// -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef... | ALGO | 0.988279 | 5.110691 |
f0697013-8c41-4227-ad52-d87dc5f342e0 | Dadibudesandesh/All-CPP-Concepts | cpp assignment/practice Assignment3/Assignment_7.cpp | #include<iostream>
using namespace std;
int main()
{
// 7. C++ Program to Calculate Power Using Recursion.
return 0;
} | ALGO | 0.999308 | 4.452532 |
a7d3b516-f513-4cf6-b91e-69b20574677f | yusifaliyevpro/Competitive-Programming | LeetCode/Hard/1416. Restore The Array.cpp | // 1416. Restore The Array
// https://leetcode.com/problems/restore-the-array/
#include <iostream>
using namespace std;
class Solution {
public:
int numberOfArrays(string s, int k) {
}
}; | ALGO | 0.999419 | 5.182395 |
1140e570-e653-47b0-9f82-52e617ab0427 | Clybius/fmtconv-personal | src/fmtcl/ContFirGauss.cpp | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
#include "fmtcl/ContFirGauss.h"
#include "fstb/fnc.h"
#include <cassert>
#include <cmath>
namespace fmtcl
{
/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
ContFirGauss::ContFirGauss (int taps, double p)
:... | ALGO | 0.956531 | 6.454132 |
293e957b-0b1d-4109-868a-e7980873ad59 | GoldAndRabbit/leetcode | code/191.NumberOf1Bits.cpp | /*
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).
For example, the 32-bit integer ’11' has binary representation 00000000000000000000000000001011, so the function should return 3.
思路:
不停的用&操作,直到原数字为0;
*/
class Solution {
public:
... | ALGO | 0.999932 | 6.240375 |
802b76e9-23dd-4a06-8c0a-ccda04bc19fd | jina47/Algorithm_TIL | leetcode/2215 find the difference of two arrays.cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<vector<int>> findDifference(vector<int>& nums1, vector<int>& nums2) {
vector<int> result1(nums1.size());
vector<int> result2(nums2.size());
set<int> num1(nums1.beg... | ALGO | 0.999962 | 5.670449 |
1455df66-4ac1-490a-a07e-b460eb350b2d | alamin-hossain1/Coffe-App-Ui-Flutter | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998693 | 6.797273 |
39de2bc9-d05f-4752-8b67-1f4fb0a5e7e1 | PrinceJain1608/DSA | codestudio questions/Topological Sort.cpp | #include <bits/stdc++.h>
void topSort(int node,vector<bool> &visited,stack<int> &s,unordered_map<int,list<int>> &adj){
visited[node]=1;
for(auto neighbour:adj[node]){
if(!visited[neighbour]){
topSort(neighbour,visited,s,adj);
}
}
s.push(node);
}
vector<int> topologicalSort(v... | ALGO | 0.999993 | 5.213718 |
f942e7a6-81e4-4f80-b19d-225d65d93596 | hamsolt/Coding | C++ Tutorial/Solutions/W2/P06.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
double t, l, h, average;
string name;
cout << "Nhap ho va ten: ";
getline(cin, name);
cout << "nhap diem toan" << endl;
cin >> t;
cout << "nhap diem ly " << endl;
cin >> l;
cout << "nhap diem hoa" << endl;
cin >> h;
average = (t + l + h... | TOOL | 0.946646 | 3.073188 |
dbe9dda7-98e9-4b51-9934-59f63590525c | microsoft/openjdk-jdk21u | src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp | #include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "runtime/os.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/byteswap.hpp"
// Implementation of the platform-specific part of StubRoutines - for
// a description of how to extend it, see the stubR... | TOOL | 0.947203 | 6.106747 |
750dba36-6a04-43a0-8161-bdbb07e9cdf0 | LONGDKZdev/training-cpp-main_MySelf | DEV/Condition/Advance condition/OnlyCaculateEvenNumbers.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
cout<< "Enter value even numbers =";
int value1;
int valueOut=0;
cin >> value1;
if(value1 % 2 == 0)
{
for(int value2 =1; value2 < value1 ; value2++)
{
// cout <<"value2="<< value2 <<endl;... | ALGO | 0.997274 | 3.921192 |
65b24bd9-abda-41bb-a8ac-84df3668330d | BALLcoin/1x2coin | src/crypto/hmac_sha256.cpp | #include "crypto/hmac_sha256.h"
#include <string.h>
CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen)
{
unsigned char rkey[64];
if (keylen <= 64) {
memcpy(rkey, key, keylen);
memset(rkey + keylen, 0, 64 - keylen);
} else {
CSHA256().Write(key, keylen).Finalize(rke... | ALGO | 0.985362 | 5.856034 |
60faa8ec-9135-4b0d-9e6e-c84b3707feaa | jonuhthin/ender5-config | Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp | #include "../../../inc/MarlinConfig.h"
#if ENABLED(AUTO_BED_LEVELING_UBL)
#include "../bedlevel.h"
#include "../../../module/planner.h"
#include "../../../module/motion.h"
#if ENABLED(DELTA)
#include "../../../module/delta.h"
#endif
#include "../../../MarlinCore.h"
#include <math.h>
//#define DEBUG_UBL_MOTION
#d... | ALGO | 0.990794 | 7.554648 |
476a4ab1-1fd1-42e7-8144-90849efe3c45 | forked-llvm/Polaris-Obfuscator | libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.copy.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// <copyable-box>& operator=(<copyable-box> const&)
// ADDITIONAL_COMPILE_FLAGS: -Wno-self-assign-overloaded
#include <ranges>
#include <cassert>
#include <type_traits>
#include <utility> // in_place_t
#include "test_macros.h"
#include "types.h"
constexpr bool test() {
... | TEST | 0.890812 | 7.217104 |
dd0518f4-3c29-48bb-8d7c-43c3ad5189c1 | Cmput416F21/PyGlueTokenizer | CodeGen-main/data/transcoder_evaluation_gfg/cpp/DIVISIBILITY_BY_12_FOR_A_LARGE_NUMBER.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
bool f_gold ( string num ) {
if ( num . length ( ) >= 3 ) {
int d1 = ( int ) num [ num . length ( ) - 1 ];
if ( d1 % 2 != 0 ) return ( 0 );
int d2 ... | ALGO | 0.998074 | 5.39054 |
5304966c-6ae9-4799-8325-c85eb815ea12 | keshavgupta1304/DSA-QUESTIONS | 1293-three-consecutive-odds/three-consecutive-odds.cpp | class Solution {
public:
bool threeConsecutiveOdds(vector<int>& arr) {
int n=arr.size();
if(n<3) return false;
int odds=0;
for(int i=0;i<n;i++)
{
if(arr[i]&1) odds++;
if(i>=2){
if(odds==3) return true;
else
... | ALGO | 0.999865 | 5.521512 |
8c4564f2-d48c-4e1b-9b0c-4a6a30b1ef88 | Li-Zhaoyuan/KappaCOMG | Assignment3/Common/Source/Mtx44.cpp | /******************************************************************************/
/*!
\file Mtx44.cpp
\author Wen Sheng Tang
\par email: tang_wen_sheng\@nyp.edu.sg
\brief
Matrix 4 by 4 use for affine transformation
*/
/******************************************************************************/
#include "Mtx44.h"
/**... | ALGO | 0.981339 | 6.081598 |
c2c25544-30c2-49da-a721-a6d9bb7448d9 | meichengzhong/libfuzzer | libc/src/math/generic/nearbyintf.cpp | #include "src/math/nearbyintf.h"
#include "src/__support/FPUtil/NearestIntegerOperations.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(float, nearbyintf, (float x)) {
return fputil::round_using_current_rounding_mode(x);
}
} // namespace __llvm_libc
| ALGO | 0.991599 | 6.352951 |
bb810511-1fc3-49c7-8e57-52a3dbb0efa6 | MiguelABatista/icpc-training | codeforces/105535/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p64;
typedef vector<ll> v64;
#define forn(i, s, e) for(ll i = (s); i < (e); i++)
#define ln "\n"
#if defined(DEBUG)
#define _ (void)0
#define debug(x) cout << __LINE__ << ": " << #x << " = " << x << ln
#else
#define... | ALGO | 0.999872 | 3.84556 |
002e7953-c485-4ac6-b473-a90bbc74e2c2 | tangjz/Three-Investigators | 2017-08-17/H.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
const int maxn = 1001;
int t, n, m, a[maxn], mx, low, upp;
bool vis[maxn << 1 | 1];
int main() {
scanf("%d", &t);
while(t--) {
scanf("%d%d", &n, &m);
mx = 0;
for(int i = 1; i <= n; ++i) {
scanf("%d", a + i);
mx = std::max(mx, a[i]);
}
low = upp... | ALGO | 0.999619 | 4.018867 |
06a5d84f-52da-4bf9-bdbb-60fd1fe07cbe | pbysu/BOJ | ~2017/1260.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int n, m, v;
vector<vector<int>> adj;
vector<bool> visited;
int s, e;
void dfs(int node) {
visited[node] = true;
printf("%d ", node);
for (int i = 0; i < adj[node].size(); i++) {
int next = adj[node][i];
if (visite... | ALGO | 0.999975 | 4.204976 |
4f246ea3-168e-4a57-86ea-0eb165e02155 | ShahidKhan18/DSA_LB-Paid- | Recursion/printDigit.cpp | #include<bits/stdc++.h>
using namespace std;
void printDigit(int n){
if(n==0)
{
return;
}
printDigit(n/10);
cout<<n%10<<" ";
}
int main()
{
int num=123900897;
printDigit(num);
return 0;
} | ALGO | 0.999603 | 4.327117 |
1cc8281a-770b-4ba4-8c9d-a61d4dcfb08f | Isabella373/UBC-CPSC221 | lab_linkedlists/part2/linked_list.cpp | // linked_list.cc -- functions for linked_list lab (cs221)
#include "linked_list.h"
/**
* Inserts a new Node (with key=newKey) at the head of the linked_list.
* PRE: head is the first node in a linked_list (if NULL, linked_list is empty)
* PRE: newKey is the value for the key in the new Node
* POST: the new Node ... | ALGO | 0.997246 | 4.770288 |
ca2928dc-ce47-4d5a-81ed-26c7242166b5 | jewelzqiu/opencv-android-library | opencv_contrib/modules/face/src/predict_collector.cpp | #include "opencv2/face/predict_collector.hpp"
namespace cv {namespace face {
static std::pair<int, double> toPair(const StandardCollector::PredictResult & val) {
return std::make_pair(val.label, val.distance);
}
static bool pairLess(const std::pair<int, double> & lhs, const std::pair<int, double> & rhs) {
re... | ALGO | 0.993862 | 6.683693 |
fadeb7e7-a9a0-4733-9683-2ff154ba05a7 | AbhinavKalsi/velox | third_party/unsupported/doc/examples/MatrixFunction.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
std::complex<double> expfn(std::complex<double> x, int)
{
return std::exp(x);
}
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::... | ALGO | 0.999742 | 4.353816 |
752661d5-484a-407b-91a8-e32ae853e409 | khushal-sahni/Code | Dynamic Programming/minimumNumberOfJumps.cpp | #include <iostream>
#include <algorithm>
#include <climits>
#include <cstring>
using namespace std;
long int minSteps(int i, long int minimumSteps[], int arr[], int n){
if(minimumSteps[i] != -1) return minimumSteps[i];
if(arr[i] == 0) return minimumSteps[i] = INT_MAX;
long int minimumStep = INT_MAX;
for(int j ... | ALGO | 0.999649 | 4.182129 |
528f33f6-9049-42b3-a139-3dc7a4e685e0 | ishandutta2007/codeforces | wasa855/normal/1324/F.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define Fast_IO ios::sync_with_stdio(false);
#define fir first
#define sec second
#define mod 998244353
#define INF 0x3fffffff
#define ll long long
inline int read()
{
char ch=getchar(); int nega=1; while(!isdigit(ch)) {if(ch=='-') ... | ALGO | 0.999976 | 4.588688 |
383a091a-aac0-45d9-a559-09b6cba843b6 | kevinoduan/Kattis | dicecup.cpp | #include <iostream>
using namespace std;
int main(){
int a, b, c, d;
cin >> a >> b;
if(a < b){
c = a + 1;
d = b + 1;
}
else{
c = b + 1;
d = a + 1;
}
for(int i = c ; i < d + 1; ++i){
cout << i << endl;
}
return 0;
} | ALGO | 0.999897 | 3.409346 |
a758d1d1-7805-4c76-a898-15f683f03ed8 | phrock/acm | spoj/CANTON/1.cpp | #include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstr... | ALGO | 0.999284 | 3.852847 |
0c6321dc-c936-4878-b1ed-d237b6d692cf | lmmqxyx404/PAT_A_Level | 1155_dfs/main.cpp | #include "bits/stdc++.h"
using namespace std;
int n, num[1024];
vector<int> store;
bool max_heap = true, min_heap = true;
void dfs(int root = 1)
{
store.push_back(num[root]);
if (root * 2 <= n)
{
if (root * 2 + 1 <= n)
dfs(root * 2 + 1);
dfs(root * 2);
}
else
{
for (size_t i = 0; i < stor... | ALGO | 0.999499 | 4.100821 |
7f1f51c1-519f-4485-bb52-0a9f2ce118ac | bfigueroa99/figuini_eda_tarea4 | trees/tests/test.cpp | #include <iostream>
#include "trees/tree.hpp"
#include <cstring>
int main(int nargs, char** vargs){
trees::Tree tree;
tree.setRoot(new trees::TreeNode(10));
tree.insert(5,10);
tree.insert(6,5);
tree.insert(7,10);
tree.insert(17,7);
tree.insert(71,7);
tree.insert(41,7);
tree.traverse();
std::cout<<"Mostrar lo... | ALGO | 0.918324 | 3.656258 |
68f9ac01-3aa0-4073-816c-3c4afe6f2d8c | surajmate007/700_Topicwise_DSA_Solved_Problems | 14_Dynamic_Programming/51_Word_Wrap_Problem.cpp | // Using DP approach:
int solveWordWrap(vector<int>nums, int k){
int n = nums.size();
vector<vector<int>> dp(n,vector<int> (k+1,0));
for(int i=0;i<=nums[n-1];i++){
if(i>nums[n-1]){
dp[n-1][i] = 0;
}else{
dp[n-1][i] =i*i ;
}
... | ALGO | 0.99991 | 5.660472 |
17a0dc25-4e2f-45e6-b25c-ef8e835a42ae | nickchen111/Leetcode | Bit_Manipulation/136. Single Number.cpp | /*
136. Single Number
*/
class Solution {
public:
int singleNumber(vector<int>& nums) {
int res = 0;
for(int num:nums){
res ^=num;
}
return res;
}
};
| ALGO | 0.999943 | 5.620255 |
d54e1b7f-53e1-4c1a-b426-1eb35cd7b10d | Adit0507/LeetCode | 0997-find-the-town-judge/0997-find-the-town-judge.cpp | class Solution {
public:
int findJudge(int n, vector<vector<int>>& trust) {
if(trust.empty() && n==1)
return 1;
vector<int> out(n +1, 0);
vector<int> in(n +1, 0);
for(auto e: trust){
out[e[0]]++;
in[e[1]]++;
}
... | ALGO | 0.999879 | 5.298522 |
a8a0eb4a-e890-4870-9756-e7a83f549545 | safrastyan/PuzzlingClarity | resources/cp/LeetCode/1557. Minimum Number of Vertices to Reach All Nodes.cpp | class Solution {
public:
vector<int> findSmallestSetOfVertices(int n, vector<vector<int>>& edges) {
vector<int> mark(n, 0);
for (auto& elem: edges) {
mark[elem[1]] = 1;
}
std::vector<int> res;
for (int i = 0; i < mark.size(); ++i) {
if (mark[i] == 0) {... | ALGO | 0.999763 | 6.212684 |
cfdf1e10-75db-48d4-a1c2-8f9338bf071d | Math-O5/competitive-programming | OBI/2016/gincana.cpp | #include <iostream>
using namespace std;
long long int mdc(long long int n,long long int m){
return (m==0? n : mdc(m,n%m));
}
int main(){
long long int n,m, ans;
cin>>n>>m;
while((ans = mdc(n,m)) > 1){
(--m);
}
cout <<m<<endl;
return 0;
} | ALGO | 0.999912 | 3.845879 |
23405f38-9694-41e3-95e5-459cd5acd53f | SujitP8901/Development | 1486-xor-operation-in-an-array/1486-xor-operation-in-an-array.cpp | class Solution {
public:
int xorOperation(int n, int start) {
int i = 0, ans = 0;
for(i = 0; i < n; i++)
{
ans = ans ^ (start + 2 * i);
}
return ans;
}
}; | ALGO | 0.999937 | 5.318516 |
d4009f46-b5a0-4aea-9d68-05d2c3d01d43 | Soukhya7834/Coding-LeetCode- | 1185. Day of the Week.cpp | class Solution {
public:
string dayOfTheWeek(int day, int month, int year) {
int daysInMonths [12] = {31,28,31,30,31,30,31,31,30,31,30,31};
string daysInWeek [7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
int sumOfDays = 0;
// add the d... | ALGO | 0.999581 | 5.105785 |
7b67e269-ffc4-4cee-918e-114068d58e07 | Iann1978/Explore-To-OpenCV | thirdparty/opencv-3.4.2-vc14_vc15/opencv/sources/modules/calib3d/src/solvepnp.cpp | #include "precomp.hpp"
#include "upnp.h"
#include "dls.h"
#include "epnp.h"
#include "p3p.h"
#include "ap3p.h"
#include "opencv2/calib3d/calib3d_c.h"
#include <iostream>
namespace cv
{
bool solvePnP( InputArray _opoints, InputArray _ipoints,
InputArray _cameraMatrix, InputArray _distCoeffs,
... | ALGO | 0.998239 | 6.733467 |
0158d5f9-883e-4441-91f9-f28ca2170ad1 | cesarqui2021/trabajos-de-zinjal | positivo negativo y par o impar.cpp | #include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
cout << "Por favor ingrese un numero para verificar si es positivo o negativo y si es par o impar:\n";
int numero;
cin >> numero;
if (numero >= 1){
cout << "El nmero es positivo\n";
if ( numero % 2 == 0 ){
cout << "numero par";
... | ALGO | 0.98679 | 3.308966 |
ab30785b-37cd-4d5f-915d-3e56daf02f8a | AyushOJOD/DSA-codes | CodeForces/scale.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1000 + 20;
int n, k;
string s[N];
int main()
{
int t;
cin >> t;
while (t--)
{
cin >> n >> k;
for (int i = 0; i < n; i++)
cin >> s[i];
for (int i = 0; i < n; i += k)
{
for (int j = 0; j... | ALGO | 0.999573 | 3.361152 |
85f7fb2b-4279-4a15-9b1b-0f660df6d82c | Bungmint/competitiveprogramming | contest/boj/11727.cpp | using namespace std;
#pragma region TEMPLATE
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using vpi = vector<pii>;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vpl = vector<pll>;
using ld = long double;
template <typename T, size_t SZ>
using ar = array<T, SZ>;
template <typename... | ALGO | 0.999982 | 5.428401 |
e58c083e-9ee3-4cd2-9118-21595d77e5f6 | luckyman2907/CPP_PTIT | Duong di theo BFS voi do thi co huong.cpp | #include<bits/stdc++.h>
using namespace std;
int n, m, parent[1001];
bool visited[1001];
vector<int> adj[1001];
void init(){
memset(parent, 0, sizeof(parent));
memset(visited, false, sizeof(visited));
for(int i = 0; i <= 1001; i++) adj[i].clear();
for(int i = 0; i < m; i++){
int x, y;
cin >> x >> y;
adj[x].pu... | ALGO | 0.99992 | 4.443795 |
754a2c51-1e75-4086-b047-df4738e18eb4 | Robbbert/mameui | 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.cpp | #include "source/opt/simplification_pass.h"
#include <set>
#include <unordered_set>
#include <vector>
#include "source/opt/fold.h"
namespace spvtools {
namespace opt {
Pass::Status SimplificationPass::Process() {
bool modified = false;
for (Function& function : *get_module()) {
modified |= SimplifyFunction... | ALGO | 0.946965 | 7.745663 |
ed79c17c-5a38-494a-a78b-a68ca266c3da | Abhishek-k30/DSA | 0037-sudoku-solver/0037-sudoku-solver.cpp | class Solution {
private:
bool isValid(int row, int col, vector<vector<char>>& board, char c){
for(int i =0; i<9; i++){
if(board[i][col] == c)
return false;
if(board[row][i] == c)
return false;
if(board[3*(row/3) + i/3][3*(col/... | ALGO | 0.999634 | 6.859483 |
b569afcf-43f8-4d70-be95-c7b412a30e55 | hyunwoo0318/Algorithm | Algorithm/11047.cpp | //#include<iostream>
//#include<deque>
//
//using namespace std;
//
//int main()
//{
// int n, k;
//
// cin >> n >> k;
// deque<int> dq;
// for (int i = 0; i < n; i++)
// {
// int a;
// cin >> a;
// dq.push_front(a);
// }
// int ans = 0;
// int i = 0;
// while (k != 0)
// {
// if (dq[i] > k)
// i++;
// else
// ... | ALGO | 0.999973 | 4.008411 |
a4b95ef5-97d9-4b50-9a6d-d627432ff6de | yash3001/Competitve-Programming | Codeforces/Practice/0. Contests/70) C-II/D_Bicolorings.cpp | // @author ↓
//
// ▄████ ▄▄▄ ███▄ ▄███▓ ███▄ ▄███▓ ▄▄▄
// ██▒ ▀█▒▒████▄ ▓██▒▀█▀ ██▒▓██▒▀█▀ ██▒▒████▄
//▒██░▄▄▄░▒██ ▀█▄ ▓██ ▓██░▓██ ▓██░▒██ ▀█▄
//░▓█ ██▓░██▄▄▄▄██ ▒██ ▒██ ▒██ ▒██ ░██▄▄▄▄██
//░▒▓███▀▒ ▓█ ▓██▒▒██▒ ░██▒▒██▒ ░██▒ ▓█ ▓██▒
// ░▒ ▒ ▒▒ ▓▒█░░ ▒░ ░ ░░ ▒░ ░ ░ ▒▒ ▓▒█░... | ALGO | 0.999575 | 4.588583 |
e440b4d2-7a9b-4438-9cde-b72031da930f | Sonal997199/Leetcode | 0209-minimum-size-subarray-sum/0209-minimum-size-subarray-sum.cpp | class Solution {
public:
int minSubArrayLen(int target, vector<int>& nums) {
/*int i=0,j=0,sum=0;
int mn=INT_MAX;
bool flag=0;
int n=nums.size();
while(j<n)
{
sum+=nums[j];
if(sum>=target)
{
flag=1;
m... | ALGO | 0.999995 | 6.440515 |
c87bc92f-24eb-443e-984f-a840003eedff | 0-jij-0/CompetitiveProgramming | Problems Archive/0000 - 0999/0417 - Distinct Characters Queries.cpp | #include <iostream>
#include <string>
#include <set>
using namespace std;
set<int> idx[26];
string s;
int main() {
int q; cin >> s >> q;
for (int i = 0; i < (int)s.size(); i++)
idx[s[i] - 'a'].insert(i);
while (q--) {
int t; cin >> t;
if(t == 1) {
int id; char c; cin >> id >> c;
id--; idx[s[id] - 'a'].... | ALGO | 0.999712 | 4.314444 |
8fd5a5d1-39ff-4f76-926e-10b2d88f9adb | ThanakritW/ocom2021 | HELPTEMP/Kittdebug.cpp | #include<bits/stdc++.h>
using namespace std;
int binarySearch(int arr[], int l, int h, int x)
{
int mid=(h+l)/2;
if (arr[mid]==x)
return mid;
if (h>l)
{
else if (arr[mid]>x)
return binarySearch(arr,mid+1,h,x);
else
return binarySearch(arr,l,mid-1,x);
... | ALGO | 0.999928 | 4.635163 |
e30a48c5-42f0-47ef-9b2e-57b2dc91740e | taatzz/LeetCode | 2245.转角路径的乘积中最多能有几个尾随零.cpp | /*
* @lc app=leetcode.cn id=2245 lang=cpp
*
* [2245] 转角路径的乘积中最多能有几个尾随零
*/
// @lc code=start
#include <vector>
using namespace std;
class Solution {
public:
int maxTrailingZeros(vector<vector<int>>& grid) {
int m = grid.size(), n = grid[0].size();
vector<vector<int>> two(m, vector<int>(n)), fi... | ALGO | 0.999953 | 6.652802 |
14b56efb-1261-4ed6-a287-ffb8b9dec654 | hjiang13/LLMs-in-IR | POJ-104/89/771.cpp | #include <iostream>
using namespace std;
// ??????.cpp : Defines the entry point for the console application.
//
int main(int argc, char* argv[]){
int i,j,n,hang=1,sz[10000][2],renshita,tarenshi,mingliu=0;
cin >> "%d",&n);
i=0;
cin >> "%d%d",&sz[0][0],&sz[0][1]);
while(sz[i][0]!=0||sz[i][1]!=0){
i++;
cin >> "%d%d",&sz[... | ALGO | 0.9999 | 3.369394 |
6126a31c-68d8-448e-91f2-3027da5ebc5d | JRgit03/Algorithm | acwing/kuangbin-questions/4341.cpp | #include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
using namespace std;
const int N = 1e4 + 10;
int n,m;
int res;
bool st[N];
struct Node{
int l,r;
int val,lazy;
}tr[N*16];
void build(int u,int l,int r){
if(l==r) tr[u] = {l,r,0,0};
else{
tr[u] ... | ALGO | 0.999788 | 4.099557 |
e42cd2de-3dc5-46ae-906d-694c8fc18cad | ishandutta2007/codeforces | mohamedabookail/normal/1003/A.cpp | /**
* author: Mohamed.Abo_Okail
* created: 24/11/2019
**/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
int main()
{
std::ios_base::sync_with_stdio(0);
int n; cin >> n;
map <int, int> mp;
int ans = -1;
for (int i = 0; i < n; i++)
{
int a; cin >> a;
mp[a]++;... | ALGO | 0.999759 | 4.134486 |
78a27f71-617d-444b-864b-314a3686c80f | abhishek18124/PPCPPJanuary2024 | Lecture 39/001Heaps_TopKInRunningStream.cpp | /*
Given an infinite stream of non-negative integers, design an algorithm to output the
top-K integers every time you encounter -1.
Example : Input = 4, 1, 2, -1, 3, -1 7 0 1 2 -1 8 -1 . . . ; K = 3
Output = 1 2 4
2 3 4
3 4 7
4 7 8
... | ALGO | 0.999924 | 4.455973 |
0a8b7e36-67b6-41be-ae65-22677180a955 | nilaykansagara/Advanced_Algorithms_Codes | Lab 8/kmp.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
//pi table
cout << "Enter Pattern: " << endl;
string pattern;
cin >> pattern;
cout << "Enter Text" << endl;
string text;
cin >> text;
int n = text.length();
int m = pattern.length();
int cnt = 0;
int arr[m+1] = {0};... | ALGO | 0.999602 | 4.396319 |
36568aee-478f-4a08-8022-ebc50ee9cf5a | sumit-gade/DSA-Problem-Solving-Repository | STACK/reverseStackUsingRec.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:
void insertAtBottom(stack<int> &s, int element) {
if(s.empty()) {
s.push(element);
return;
}
... | ALGO | 0.999947 | 6.267082 |
26932ec3-ed39-4e49-884e-0bcf5afbfe13 | Munbin-Lee/PS | BOJ/2744.cpp | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
string s;
cin >> s;
for (char &c: s) {
if (isupper(c)) c = tolower(c);
else c = toupper(c);
}
cout << s;
return 0;
}
| ALGO | 0.994419 | 5.478545 |
1d762e7c-a975-4405-ac7a-d6cd628e080a | leeeeeyeon/Problem-Solving | Before-BaekjoonHub/Implementation/boj14499.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, x, y, k;
int board[20][20];
vector<int> dice = vector<int>(7);
int command;
int dx[5] = {0, 0, 0, -1, 1};
int dy[5] = {0, 1, -1, 0, 0};
int nx, ny;
vector<int> tumble(int cmd) {
vector<int> newDice = vector<int>(7);
switch (command) {
case 1: //... | ALGO | 0.99998 | 5.285112 |
f93939a3-1292-4c82-9ea0-0e767f089a0b | Aditya30december2003/Leetcode-GFG | Difficulty: Medium/Palindrome Linked List/palindrome-linked-list.cpp | //{ Driver Code Starts
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <ios>
#include <iostream>
#include <random>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
struct Node {
int data;
struct Node *next;
Node(int x) {
data = ... | ALGO | 0.993785 | 6.039696 |
7c5246ae-ac15-41fd-8394-716e9690874c | tmorajk/dsa | cpp/PowerOf3Editorial.cpp | #include <bits/stdc++.h>
using namespace std;
void print_vector(vector<int> v) {
for (int num : v)
cout << num << " ";
cout << endl;
}
int power(int x, int y, int p) {
int res = 1; // Initialize result
x = x % p; // Update x if it is more than or
// equal to p
while (y > 0) {
/... | ALGO | 0.99995 | 4.43894 |
2e58c2d0-1f98-4348-9c8b-1848bfd81be1 | Ayush29Ayush/leetcode-gfg-problems | 0205-isomorphic-strings/0205-isomorphic-strings.cpp | // By observation, Isomorphic tabhi bann sakta hai if dono map ke size same ho that means equal abount of characters hai, and unn characters ki freq bhi same honi chahiye
// class Solution {
// public:
// bool isIsomorphic(string s, string t) {
// unordered_map<char,int> mp1;
// unordered_map<char,i... | ALGO | 0.999901 | 6.206093 |
ae57ff0e-92da-42b9-82b6-4b11d2cf1a19 | sharc-lab/LightningSim | llvm-project/openmp/runtime/test/tasking/kmp_task_modifier_simple_par_new.cpp | // RUN: %libomp-cxx-compile-and-run
#include <stdio.h>
#include <omp.h>
#define NT 4
#define INIT 10
/*
The test emulates code generation needed for reduction with task modifier on
parallel construct.
Note: tasks could just use in_reduction clause, but compiler does not accept
this because of bug: it mistakenly req... | TEST | 0.872518 | 5.614787 |
21e262da-1ab8-4281-bc8f-90ac25344e79 | AgenLuo/RM_RPS_SentinelSense_Deploy | utils/utils.cpp | #include"../utils/utils.h"
#include "../include/serialport.h"
void utils::saveBinaryFile(float *vec, size_t len, const std::string &file) {
std::ofstream out(file, std::ios::out | std::ios::binary);
if (!out.is_open())
return;
out.write((const char *) vec, sizeof(float) * len);
out.close();
}
... | TOOL | 0.937199 | 4.933058 |
3627c806-9a1d-4fe5-a0b7-5a8cbd299fd9 | TiffyPox/LearnCPP | LearnCPP/whileStatement.cpp | #include <iostream>
#include <vector>
int main()
{
// A while statement repeatedly executes a target statement as long as a condition is true
// the condition can be an expression or an initalized variable declaration
// to prevent an infinite loop, the condition or the loop body must change the value of t... | ALGO | 0.999294 | 4.135082 |
570ab48d-66d0-42f0-b196-10bd8af77219 | mnhtng/C-plus-Algorithm | C++/Char and String/soNguyenLonChiaHet2,3,5.cpp | #include <bits/stdc++.h>
using namespace std;
int check( string s ){
if( (int)s[s.size() - 1] - 48 != 0 )
return 0;
int sum = 0;
for( char x : s ){
sum += (int)x - 48;
}
if( sum % 3 == 0 )
return 1;
return 0;
}
int main(){
int t;
cin >> t;
while( t-- ){
... | ALGO | 0.999597 | 4.376139 |
dfa4d3d4-8fe1-43e4-8532-1c05e366347d | IAkashMondal/MASTER_DSA_C- | Pact_2/02_Searching_sort/05_FIND_Missing_elem.cpp | #include <iostream>
#include <vector>
using namespace std;
int findMissingElement(const vector<int> &arr)
{
int start = 0;
int end = arr.size() - 1;
while (start <= end)
{
int mid = start + (end - start) / 2;
// If the difference between the element and its index is not equal
... | ALGO | 0.999818 | 5.663964 |
816b3627-581d-46ea-9bcc-f2a3262683b6 | Ishrakul-Tahmid/Complete-DSA | Pattern/17.Upper_Triangle_ABCBA.cpp | /*
A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
*/
#include<bits/stdc++.h>
using namespace std;
void pattern17(int n)
{
for(int i=0;i<n;i++)
{
char ch = 'A';
for(int j=0; j<n-i-1; j++)
{
cout<<" ";
}
int breakpoint = (2*i)/2;
for(int j=1; j<=(2*... | ALGO | 0.999858 | 3.861582 |
43b37974-2484-4fd9-882d-1c60d17f8cf4 | Pandasic/LeetCode | CPP/203 移除链表元素.cpp | #include "include.hpp"
using namespace std;
/*
题目描述
203. 移除链表元素
删除链表中等于给定值 val 的所有节点。
示例:
输入: 1->2->6->3->4->5->6, val = 6
输出: 1->2->3->4->5
通过次数85,772提交次数187,658
*/
class Solution {
public:
ListNode* removeElements(ListNode* head, int val) {
ListNode* front = new ListNode(0);
ListNode* rfron... | ALGO | 0.999884 | 5.29434 |
b9017a6a-b519-43ab-bb07-810706652736 | AdnanMuzavor/PDS | BST/Even_odd_tree.cpp | /*
1609. Even Odd Tree
Medium
577
36
Add to List
Share
A binary tree is named Even-Odd if it meets the following conditions:
The root of the binary tree is at level index 0, its children are at level index 1, their children are at level index 2, etc.
For every even-indexed level, all nodes at the level have odd in... | ALGO | 0.99999 | 6.156994 |
bca25d52-b374-468a-832e-c5dce2ab3ca6 | someshjoyguru/dsa-cp | contests/all_submissions/2000D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);cerr.rdbuf(cout.rdbuf());
#define f(i,a,b) for (ll (i)=(a); (i)<(b); (i)++)
#define rf(i,a,b) for (ll (i)=(a); (i)>=(b); (i)--)
#define vll vector<ll>
#define vvll vector<vll>
#define in(n... | ALGO | 0.999872 | 3.618525 |
9db867e2-b125-40f6-af2a-c60ced9237a6 | raifernando/competitive-programming | gema/exercicios/busca-binaria/division.cpp | // Array Division
// https://cses.fi/problemset/task/1085/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool checar(int n, int k, ll mid, vector<int> v) {
int total = 0;
ll soma = 0;
for (int i = 0; i < n; i++) {
int num = v[i];
if (soma + num < mid) {
... | ALGO | 0.999991 | 4.791352 |
b243a30c-dde2-4fd6-a7e6-e2f3e7ee15c2 | NguyenMinhThuan24112001/CPP_PTIT | test/modo/fibo3.cpp | #include<bits/stdc++.h>
using namespace std;
bool check[1000];
bool so(int n){
if(n<2){
return 1;
}
int a=0,b=1,c=0;
while(c<n){
c=a+b;
a=b;
b=c;
if(c==n)
return 1;
}
return 0;
}
int main(){
int t;
int n,a[100],i;
cin>>t;
for(i=0;i<1001;i++){
check[i]=so(i);
}
while(t--){
cin>>n;
for(i=0;... | ALGO | 0.999574 | 3.608218 |
04a784b1-432a-48b1-8a64-f6a13455f86b | Sookmyung-Algos/2021algos | algos_assignment/3rd_grade/윤이빈_yibin99/week1/11724.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> graph[1001];
bool vis[1001] = {false, };
void dfs(int n){
vis[n] = true;
for(int next:graph[n]){
if(!vis[next])
dfs(next);
}
}
int main(){
int n, m, u, v;
int cnt = 0;
cin >> n >> m;
for(int i=0;i<... | ALGO | 0.999817 | 4.869863 |
8f3cc881-30d7-4136-adb1-5da8480ba497 | ishandutta2007/codeforces | hogloid/normal/155/E.cpp | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<vector>
#define REP(i,m) for(int i=0;i<(int)m;++i)
#define REPN(i,m,in) for(int i=in;i<(int)m;++i)
#define pb push_back
#define mp make_pair
#define fr first
#define ALL(t) (t).begin(),(t).end()
#define sc second
#define INF ((int)5e8)
#... | ALGO | 0.99994 | 3.590196 |
1ce9f7ce-4cb6-481f-b0b8-f2b0acc6bb51 | carloscl2001/POO | EXAMENES RESUELTOS/Febrero/febrero2021.cpp | #include <set>
#include <map>
#include <string.h>
#include <cstring>
#include <iostream>
using namespace std;
class Llamada{
public:
Llamada(string s1, string s2, string s3 ):codigo_(s1), hIncio_(s2), hFin_(s3){}
void asignar(Operador&);
Operador* asistente(){return operador_;};
private... | ALGO | 0.972285 | 3.951148 |
a55807d7-4dab-43be-a813-733601e1c713 | 27-aditya/LeetSols | 0207-course-schedule/0207-course-schedule.cpp | class Solution {
public:
bool canFinish(int numCourses, vector<vector<int>>& prerequisites) {
vector<int> indegree(numCourses, 0);
vector<vector<int>> adjlist(numCourses);
for(const auto& pair : prerequisites){
int u = pair[0];
int v = pair[1];
indegree[u]... | ALGO | 0.999643 | 6.358288 |
3afd3d9b-a2e1-4d30-ba49-a1350bdd3b40 | bhupalisarma/Problems | 0287-find-the-duplicate-number/0287-find-the-duplicate-number.cpp | // class Solution {
// public:
// int findDuplicate(vector<int>& nums) {
// int slow=nums[0];
// int fast=nums[0];
// do{
// slow=nums[slow];
// fast=nums[nums[fast]];
// } while(slow!=fast);
// fast=nums[0];
// while(slow!=fa... | ALGO | 0.999985 | 5.91847 |
722aace0-7788-4f08-832c-cb1ae330e3fa | nimxor/competitive_progeamming | codeforces/653-B/653-B-16835583.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mset(m,v) memset(m,v,sizeof(m))
#define iter(a,it) for(auto it: a)
#define f(it,o) f(aut(it, (o).begin()); it != (o).end(); ++ it)
#define tr(cont, it) for(typeof(cont.begin()) it = cont.begin(); it != cont.end(); it++)
#define dbg(x) ... | ALGO | 0.999829 | 4.153148 |
9b62f805-f977-41e1-8b54-236bb9cfa869 | raincross7/code-similarity | codes/train_code/problem342/problem342_213.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
string s;
cin>>s;
int ansa = -1;
int ansb = -1;
if(s.length() == 2){
if(s[0] == s[1])
ansa = 1 , ansb = 2;
}else if(s.length() > 2){
for(int i=0;i<s.length()-2;i++){
if(s[i] == s[i+1] || s[i] == s[i+2] || s[i+1] == ... | ALGO | 0.999736 | 3.326756 |
a76ac3cd-3171-4d0a-8c79-e8e6953418d6 | Wu0409/NOIP_solution | 方块分割(蓝桥杯 2017-B)/main.cpp | //蓝桥杯 2017 - B 方块分割
#include <iostream>
using namespace std;
int dr[] = {-1, 0, 1, 0};
int dc[] = {0, 1, 0, -1};
int vis[7][7];
int ans = 0;
bool is_ok(int r, int c) {
return (r >= 0 && r <= 6 && c >= 0 && c <= 6);
}
void dfs(int r, int c) {
if (r == 0 || r == 6 || c == 0 || c == 6) {
ans++;
... | ALGO | 0.999782 | 4.300873 |
70d45988-1958-4f0c-a753-ee24c1815443 | stulsani/Additional-WorkSpace | Data Structure/a3b3.cpp | //Answer is wrong********************************************************
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <unordered_map>
using namespace std;
void a3b3element(int n1,int n2)
{
vector<int> ans;
priority_queue< int,vector<int>... | ALGO | 0.999079 | 3.388384 |
1f3899b0-d473-4beb-b8d7-43e4335c5ae4 | viftode4/PBINFOOOO | Info/digital root/main.cpp | #include <bits/stdc++.h>
using namespace std;
long long n, a, b, c = 1;
int main()
{
cin >> n;
for( int i = 1; i <= n; i++ )
{
cin >> a >> b;
cout << ( long long )( ( a - 1 ) * 9 + b )*c << '\n';
}
return 0;
}
| ALGO | 0.998658 | 3.260296 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.