[Tutorial] CoLoR format the Code!

Really quick tutorial for all forum members who dont know how to color format code like this which i learned from another site.

just use 3 backticks ``` before and after the code and your code looks like this :point_down::point_down::point_down:

CPP :

    #include <iostream>
    using namespace std;

    int main() {
    	for(int i=0 ; i < 10 ;++i) {
    		cout << i <<" - hello world\n";
    	}
    	return 0;
    }

Python :

# Python 3 program to find 
# factorial of given number 
def factorial(n): 
	return 1 if (n==1 or n==0) else n * factorial(n - 1); 

num = 5; 
print("Factorial of",num,"is", 
factorial(num)) 
30 Likes
PIZZA DELIVERY DP PROBLEM
Merge Two Sorted Linked List
FIBEASY Matrix Exponentiation Solution? O(lgn) (edit: this solution failed for subcase 3 Yet I am producing right answers?)
FIBEASY - Editorial
TAX SLABS LOGIC
How to add a code in a comment on codechef discuss?
August LunchTime 2019 Eidi gift
SIGTSTP ERROR in "Moving Rectangles" (RECTARAN)
Wa error in my programme
WHY DO I GET WRONG ANSWER FOR COMPRESS THE LIST
Problem Code HIT
Equals() method is not working / always giving FALSE
Binary search- Euron Problem. i am tle for this code.can anyone suggest any optimisation?
Why does it give Exceptions (MSV)
WA in MINEAT
Multiple of 3
I am getting WA in factorial question but my sample TCs are running fine
I am getting WA in factorial question but my sample TCs are running fine
I always get a wrong answer in a correct program. Can anybody please tell why this is wrong
Compare The Strings -CODEY504 Why Wrong?
LOSTWKND - Editorial
https://www.codechef.com/problems/NOTALLFL
LEBOMBS Please verify
Lucky Four, C++
RAINBOWA Getting WA
LOSTWEKD CODECHEF IDE
Whats wrong with this? (1st question 2nd division isnt working(MAY LUNCHTIME 2020))
LOSTWKND - Editorial
CHEFSHIP - Editorial
Why i am getting SIGSEGV in my program
Need help (CHEFRECP)
I'm getting nzec run time error can someone tell me what i did wrong
Help in Rolling Hashing for Strings
CHEFINSQ - Editorial
Why is TLE in this codeforces problem? https://codeforces.com/contest/1352/problem/E
Memory limit in maps
Max power in beginner
Runtime Error in RECNDNOS
Can we use iterator more than one times in c++?
LEBOMBS - Editorial
Runtime Error in Rupsa and the Game | CodeChef
Doubt in CHANDF Problem
Runtime Error in ZUBSPOIL
Sigsegv error__clean up problem
Pintu and fruits code(CHPINTU)
Help with QHOUSE
Paying up Problem Code: A1
Getting WA Codeforces 642(Div. 3) Question C
Runtime error in OJUMPS - please help
How is this solution even failing :o
Racing horses--sigsegv error
Why am I getting SIGABRT error? (PSHOT)
Xor sequence from hackerrank
Life, Universe and everything
Racing Horses | CodeChef
Why my answer is partiality correct (TLG)
Binary search- Euron Problem. i am tle for this code.can anyone suggest any optimisation?
CNOTE - Editorial
Candies | hackerrank greedy alogrithms
I am getting error of inaccessibility even though ive declared them as friends please give a soln to this
RAINBOWA Problem
The code below executes perfectly while compiling but fails when submitted. Can anyone tell me why?https://www.codechef.com/APRIL20B/problems/COVIDLQ
Doubt in modular exponentation
Chef and walk
WA In Chef and Walk
Chef and walk
What is wrong in this solution of FCTRL question of DSA learning series
FFL - Editorial
Runtime Error in "Chef in Fantasy League" (FFL) - please help
FFL - Editorial
Problem Code:FFL April Lunchtime
Why is this solution not accepted for BFRIEND? link:https://www.codechef.com/problems/BFRIEND
FEB LONG THEATRE
Operator overloading
Expression cannot be used a function
Getting started
MATBREAK ;WA is coming
WA In CSUB
Ciel and Receipt Problem Code: CIELRCPT
PIPSQUIK-CAN ANYBODY HELP ME OUT
COVIDTEST GETING ( WA) EVEN AFTER RIGHT ANSWER HELP ME I AM NEW HERE
Help required in chef and proxy
Only 30 Marks for "Smart Phone" (ZCO14003)
WALKFAST problem
STUPID MACHINE
COMPILERS DSA
Query on declaration of variable array
Https://www.codechef.com/viewsolution/27971127 (TRAINSET)
Editorial for Problems of Codechef-DSA-Learning-Series: 1-Complexity Analysis + Basics Warm Up
Lapindromes
WA in CLEANUP
KS1 (AUG 19 Division B)
Brackets Balance
Run time error please help! perfectly works on gdb compiler
Delete Last node at linked list (Copied from a site still not working)
LAPIN - Editorial
WA in "Total Expenses" (FLOW009)
What is wrong with my code for CHPINTU in C
ENGXOR Logic
XOREngine problem in March long challenge (2020)
Vector and for loop
Chef & stones greedy algorithms
Help needed in dijkstra's algo implementation
Why do I get Wrong Answer?
Why it is giving compile time error
Why do I get Wrong Answer?
Vector Range
Vector Range
JOHNY: Getting WA when using std::find
Ans is coming wrong
Why this constraint error?
February Lunchtime Error in SWAPPALI
Stone | CodeChef
Total Number of Graphs Possible (HELP!)
Vector in c++ (auto it)
Sort vector pair of <int,char>
Partially correct answer (ZCO15002)
The Lead Game | CodeChef
January long challenge 1st problem have solved it in own my ide need AC from codechef
Help me to fix SIGSEGV error in TRAINSET problem
Help me to fix the run time error (SIGSEGV) in my code
PLAYSTR - Editorial
CHEFINSQ - Editorial
BFRIEND - Editorial
BFRIEND - Editorial
What's wrong with my code
RAINBOWA - Editorial
WA in Polynomial multiplication (POLMUL)
WA in Polynomial multiplication (POLMUL)
WA - Problem Code: COMPILER
RE (SIGSEV) in SMPAIR
Wrong Answer despite correct output I tried every possible test case Problem :https://www.codechef.com/problems/CHEALG
Showing wrong answer (CLEANUP)
Problem Code: COPS
Can anyone tell why am i getting run time error in this code? (CDUTSV01)
ATM-NZEC Error
Practice Beginner Level - ATM challenge
Unexpected output of a very simple program
TLE in "Mod in an Array" (MOD)
WA in USANBOLT
WA in "To and Fro" (PD33)
WA in FLOW005
WHY I AM GETTING WRONG ANS FOR CHEALG
Safe Robots wrong answer (SAFEROBO)
LEBOMBS - Editorial
CHNGIT - Editorial
Please help me in finding nzec error in java code(Problem Crash It(CRSHIT) )
I m new to coding , i got this error java.util.NoSuchElementException while i m executing help me why this error shows
CHNGIT - Editorial
Good practice for asking help
PLEASE HELP!
Showing wrong answer (CLEANUP)
CSUB - Editorial
Can anyone please help me with this problem: MAY19F1 of contest FLPAST01
http://codeforces.com/contest/1278/problem/B for this my solution in giving TLE . can you help me out?
Problem with BINXOR? December long challenge
COPS - Editorial
NZEC error PLMU
Whats wrong with this code? (BINADD)
Help for bst operation (BSTOPS)
Problem in program
CSUB - Editorial
NOT ABLE TO SUBMIT A SUCCESSFULLY RUNNING CODE IN BASH (UNIX)
Am i missing any test case?
CHAR FUNCTION WITH RETURN
Strstr() in with 2d and 1d array in c++
I am getting TLE and SIGSTP I dont know why
Help in modulo operator
Count Substrings | CodeChef
Please Help Me!
Help in Codeforces problem a
What is wrong with my code -- Little Elephant and Candies
NZEC error in the code
I am getting NEZEC error
ZCO15004 solution not accepted
Segmentation error
Unable to solve TRAINSET problem in codechef
Signature (HELP)
Casey And Gifts
Practice Beginner PROXYC problem with code
WA on 3 out of 6 cases in Chef and maximum Coloring CAMC
FAILURE - Editorial
How to reduce time complexity!
Second Largest | CodeChef
Any please tell me whats wrong in this code for lead game please
Getting tle (EN123)
LAPIN - Editorial
CKWLK - Editorial
I am getting compilation error in this code
Why am I getting WA? (DOR)
Whats wrong with my code--NOKIA(https://www.codechef.com/problems/NOKIA)
Spam classification using neural net (SPAMCLAS)
MARM - Editorial
MARM - Editorial
Even edges (getting tle in one case of 2nd subtask)
Why giving nrez error BACREP
Please explain why am i getting a SIGSEGV error. I am getting the correct output though
FIBEASY : can someone help me about my code , however it"s working but On submission it shows WA
Getting sigcont error can any one explain why
Java Runtime error for using Integer.parseInt() , though proper updation of integer in loop
FIBEASY answer keeps showing TLE
What is the fault in this code?
Getting NZEC
Can someone find error in this code
CANDY123 - Editorial
Help with vectors
Not Able to understand why still the submission is failing? (LECANDY)
CHEFINSQ - Editorial
I am getting wrong answer (CLEANUP)
CHEFINSQ - Editorial
FIBEASY - Editorial
Getting wrong output in palindrome program
Problem In "REVERSE THE NUMBER" at beginner level
The output of the program matches the gives test case and i have increased the test cases too yet my program is giving error in submission plz help
Why is my code giving runtime error
What is the mistake in this factorial program .codechef is not accepting this code.helpmeout
Adjacency matrix representation in cpp
Help! LONGSEQ
EID2 - Editorial
Time Complexity
TRIP2 - Editorial
EID2 - Editorial
EID2 - Editorial
TRIP2 - Editorial
Problem -->> EIDI GIFT
Why this code is executing 'cin' statement infinite times
DSA problem on Lapindrome getting wrong answer
LECANDY - Editorial
SIGABRT in BINFUN - please help
WA in "Pick from both sides!" (Interviewbit)
"Segmentation fault" in doubly-linked list implementation
PROXYC - EDITORIAL
Code is not working for a specific test case
Help with a code. Two similar codes but different outputs
Getting TLE in OR-THODOX COOKOFF
Time complexity
DRGNDEN - Editorial
Problem code:EOEO ,problem name: The Tom and Jerry Game!
Help with Runtime Error
CHARCOUN problem
Help me in a question of codeforces
Someone please help me in MAXMEX
June Challenge-- Chef and Icecream Problem

Can this post please be pinned, or included in the information people get when they create a blog (currently it’s just something about cheating, but that’s not going to affect anything anyway, and could be filled with much more useful stuff)? Look at how many times this post has been linked now.

3 Likes
cout<<"Got it "<<endl;

+1

1 Like