The first lecture of the ACM Aleppo CPC training. The local contest of ICPC. This lecture will help you get started in programming contests word with the lower bound techniques. The lectures focus on the C++ programming language and the STL library to solve programming problems.
The second lecture of the ACM Aleppo CPC training. The local contest of ICPC. This lecture will help you get started in programming contests word with the lower bound techniques. The lectures focus on the C++ programming language and the STL library to solve programming problems.
The first lecture of the ACM Aleppo CPC training. The local contest of ICPC. This lecture will help you get started in programming contests word with the lower bound techniques. The lectures focus on the C++ programming language and the STL library to solve programming problems.
The first lecture of the ACM Aleppo CPC training. The local contest of ICPC. This lecture will help you get started in programming contests word with the lower bound techniques. The lectures focus on the C++ programming language and the STL library to solve programming problems.
The first lecture of the ACM Aleppo CPC training. The local contest of ICPC. This lecture will help you get started in programming contests word with the lower bound techniques. The lectures focus on the C++ programming language and the STL library to solve programming problems.
This document provides information on Python code structures, including if/else statements, loops (while and for), functions, and arguments. It explains the basic syntax and usage of these structures. Key points covered include:
- How to write if/else statements and the use of conditions like ==, !=, <, >, etc.
- The syntax of while and for loops, and how to use break, continue, else blocks
- What functions are in Python and how to define them with def, pass arguments, and return values
- The basics of calling functions, optional arguments, and nested structures like if/else in loops
This document provides an introduction to the Python programming language. It describes Python as a multi-purpose, object-oriented language that is interpreted, dynamically typed and focuses on readability. It lists several major organizations that use Python. It then provides examples of basic Python programs and covers key Python concepts like variables, data types, strings, comments, functions and more in under 3 sentences each.
The document discusses strings and string manipulation in Java. It covers creating and initializing strings, comparing strings, concatenating strings, searching strings for substrings, extracting substrings, splitting strings, replacing substrings, changing character casing, and using StringBuilder for efficient string modification.
This document provides an overview of string handling in C programming. It discusses how strings are represented as character arrays and terminated with a null character. It describes declaring, initializing, and manipulating strings through built-in string functions like strlen(), strcpy(), strcmp(), strcat(), strlwr(), and strrev(). Examples are given to illustrate how each string function works and how to use them to process strings as complete entities.
C Programming/Strings. A string in C is merely an array of characters. The length of a string is determined by a terminating null character: '-' . So, a string with the contents, say, "abc" has four characters: 'a' , 'b' , 'c' , and the terminating null character.
The document discusses strings in C and common string functions. It defines a string as an array of characters terminated by a null character. It describes two ways to use strings - with a character array or string pointer. It then explains functions such as strcpy(), strcat(), strcmp() that copy, append, or compare strings. Other functions like memcpy(), memcmp() operate on a specified number of characters rather than null-terminated strings.
Python is an interpreted, general-purpose, high-level programming language. It allows programmers to define functions for reusing code and scoping variables within functions. Key concepts covered include objects, expressions, conditionals, loops, modules, files, and recursion. Functions can call other functions, allowing for modular and reusable code.
This document discusses strings in C++. It begins by explaining that strings are stored as character arrays terminated by a null character. It then covers declaring and initializing strings, accessing characters within strings, inputting and outputting strings using cin, gets(), and getline(), and comparing and copying strings. The document also discusses two-dimensional character arrays for storing arrays of strings. It provides examples of initializing, inputting, and displaying 2D string arrays.
This document provides information about strings in C++. It defines a string as a collection of characters within double quotes. Strings are stored as character arrays terminated by a null character. The document discusses declaring and initializing strings, inputting strings from the user, and functions for manipulating strings like strcat(), strcmp(), and memcpy(). It also covers arrays of strings and comparing, concatenating, copying and other operations on strings.
This document discusses C-strings in C++. It begins by outlining topics like C-string functions and input/output. It then defines C-strings as null-terminated arrays of characters that can be used to represent strings. It covers declaring, initializing, assigning, comparing and manipulating C-strings using standard string functions from the cstring library like strcpy(), strcmp(), strcat(), and strlen(). It also discusses C-string input/output using stream operators and safer alternatives like strncpy() and strncat().
What is Data Type?
Primitive Types in C#: Integer Types, Floating-Point Types, Decimal Type, Boolean Type, Character Types, Strings, Objects
Value Types and Reference Types
Variables. Using Variables: Declaring, Initializing, Assigning Value, Accessing Value
Literals: The Values of the Variables in the Source Code. Boolean Literals. Integer Literals. Floating-Point Literals, Decimal Literals, String Literals and Escaping Sequences
Exercises: Working with Primitive Types and Variables
The document discusses strings in C programming language. It provides details about:
- Strings are arrays of characters terminated by a null character '\0'.
- Common functions to declare, initialize, print and manipulate strings like strlen(), strcpy(), strcat(), strcmp() etc.
- Important points about receiving and processing multi-word strings using scanf(), gets() and puts().
- Implementation of some string handling functions like xstrlen(), xstrcpy() to demonstrate their working.
The document discusses strings in C and C++. It explains that strings are not a built-in data type in C/C++ and describes C-style strings as character arrays terminated by a null character. It also discusses C++ string classes like std::string. The document provides examples of using C-style strings and C++ strings. It describes common string functions in C++ for manipulating and comparing strings.
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVSGautham Rajesh
This document provides an overview of key concepts in C++ programming. It discusses the basic building blocks of a C++ program like data types, variables, constants, operators, control structures, functions and arrays. It explains fundamental concepts like tokens, literals, data type conversion and standard libraries. It also introduces object oriented programming concepts like classes and objects. The document is intended as a study material for class 12 students to help understand C++ programming.
String in programming language in c or c++ Samsil Arefin
This document discusses strings in C programming. It defines strings as arrays of characters terminated by a null character. Strings can be declared as character arrays or using string pointers. Functions like strlen(), strcpy(), strcat() are described which operate on strings. Examples are given to find the frequency of characters, number of vowels/consonants, reversing a string, sorting strings, and concatenating strings. The strcat() function is explained in detail, with an example program demonstrating how it concatenates two strings.
This document provides an overview of string manipulation in C++. It discusses C-style strings and introduces C++ strings as objects of the string class. It describes various string constructors, functions for comparison, concatenation, insertion, extraction and other operations. Examples are given to demonstrate the use of functions like length(), capacity(), empty(), at(), find(), assign(), begin() and end(). The document is intended as a lecture on object-oriented string handling in C++.
Python was created in the late 1980s by Guido van Rossum and first released in 1991. It gained popularity and saw new releases in 2000 and 2008. Python is an open source, general purpose, interpreted, object-oriented programming language used widely for web development, science, and more due to its large community and support. Performance depends more on frameworks and architecture than language alone.
Python supports four main numerical types - integers, long integers, floating point numbers, and complex numbers. It provides various functions for mathematical, random number, trigonometric operations and constants like pi and e. Numbers are immutable and created using literals or by assigning values. The del statement can delete single or multiple number references.
This document discusses C# .NET strings and various methods that can be used on string variables including trim, contains, replace, and substring. Trim removes unwanted characters from the start and end of a string. Contains checks if a substring is within a string. Replace replaces occurrences of one substring with another. Substring extracts a portion of a string starting from a specified index for a given length.
This document discusses the StringBuffer and StringBuilder classes in Java. It explains that StringBuffer can be used to create mutable strings, while StringBuilder is similar but non-synchronized. It outlines several key methods for each class, such as append(), insert(), reverse(), substring(), and describes how to construct and manipulate string objects in Java.
This document provides an overview of common string operations in C++, including how to declare and initialize strings, access individual characters, compare strings, append to strings, search within strings, and convert between C++ strings and C-style character arrays. It also describes some additional string utility functions provided in the CS106 library like converting case and converting between strings and numbers.
Type header file in c++ and its functionFrankie Jones
This document lists common C++ header files and standard functions. It provides a brief description of functions in headers like cassert, cctype, cmath, cstdlib, cstring, and others. Functions like assert, isalnum, ceil, atoi, strcat, and cout are described. The document serves as a reference for commonly used C++ functions organized by header file.
This document provides an overview of string handling in C programming. It discusses how strings are represented as character arrays and terminated with a null character. It describes declaring, initializing, and manipulating strings through built-in string functions like strlen(), strcpy(), strcmp(), strcat(), strlwr(), and strrev(). Examples are given to illustrate how each string function works and how to use them to process strings as complete entities.
C Programming/Strings. A string in C is merely an array of characters. The length of a string is determined by a terminating null character: '-' . So, a string with the contents, say, "abc" has four characters: 'a' , 'b' , 'c' , and the terminating null character.
The document discusses strings in C and common string functions. It defines a string as an array of characters terminated by a null character. It describes two ways to use strings - with a character array or string pointer. It then explains functions such as strcpy(), strcat(), strcmp() that copy, append, or compare strings. Other functions like memcpy(), memcmp() operate on a specified number of characters rather than null-terminated strings.
Python is an interpreted, general-purpose, high-level programming language. It allows programmers to define functions for reusing code and scoping variables within functions. Key concepts covered include objects, expressions, conditionals, loops, modules, files, and recursion. Functions can call other functions, allowing for modular and reusable code.
This document discusses strings in C++. It begins by explaining that strings are stored as character arrays terminated by a null character. It then covers declaring and initializing strings, accessing characters within strings, inputting and outputting strings using cin, gets(), and getline(), and comparing and copying strings. The document also discusses two-dimensional character arrays for storing arrays of strings. It provides examples of initializing, inputting, and displaying 2D string arrays.
This document provides information about strings in C++. It defines a string as a collection of characters within double quotes. Strings are stored as character arrays terminated by a null character. The document discusses declaring and initializing strings, inputting strings from the user, and functions for manipulating strings like strcat(), strcmp(), and memcpy(). It also covers arrays of strings and comparing, concatenating, copying and other operations on strings.
This document discusses C-strings in C++. It begins by outlining topics like C-string functions and input/output. It then defines C-strings as null-terminated arrays of characters that can be used to represent strings. It covers declaring, initializing, assigning, comparing and manipulating C-strings using standard string functions from the cstring library like strcpy(), strcmp(), strcat(), and strlen(). It also discusses C-string input/output using stream operators and safer alternatives like strncpy() and strncat().
What is Data Type?
Primitive Types in C#: Integer Types, Floating-Point Types, Decimal Type, Boolean Type, Character Types, Strings, Objects
Value Types and Reference Types
Variables. Using Variables: Declaring, Initializing, Assigning Value, Accessing Value
Literals: The Values of the Variables in the Source Code. Boolean Literals. Integer Literals. Floating-Point Literals, Decimal Literals, String Literals and Escaping Sequences
Exercises: Working with Primitive Types and Variables
The document discusses strings in C programming language. It provides details about:
- Strings are arrays of characters terminated by a null character '\0'.
- Common functions to declare, initialize, print and manipulate strings like strlen(), strcpy(), strcat(), strcmp() etc.
- Important points about receiving and processing multi-word strings using scanf(), gets() and puts().
- Implementation of some string handling functions like xstrlen(), xstrcpy() to demonstrate their working.
The document discusses strings in C and C++. It explains that strings are not a built-in data type in C/C++ and describes C-style strings as character arrays terminated by a null character. It also discusses C++ string classes like std::string. The document provides examples of using C-style strings and C++ strings. It describes common string functions in C++ for manipulating and comparing strings.
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVSGautham Rajesh
This document provides an overview of key concepts in C++ programming. It discusses the basic building blocks of a C++ program like data types, variables, constants, operators, control structures, functions and arrays. It explains fundamental concepts like tokens, literals, data type conversion and standard libraries. It also introduces object oriented programming concepts like classes and objects. The document is intended as a study material for class 12 students to help understand C++ programming.
String in programming language in c or c++ Samsil Arefin
This document discusses strings in C programming. It defines strings as arrays of characters terminated by a null character. Strings can be declared as character arrays or using string pointers. Functions like strlen(), strcpy(), strcat() are described which operate on strings. Examples are given to find the frequency of characters, number of vowels/consonants, reversing a string, sorting strings, and concatenating strings. The strcat() function is explained in detail, with an example program demonstrating how it concatenates two strings.
This document provides an overview of string manipulation in C++. It discusses C-style strings and introduces C++ strings as objects of the string class. It describes various string constructors, functions for comparison, concatenation, insertion, extraction and other operations. Examples are given to demonstrate the use of functions like length(), capacity(), empty(), at(), find(), assign(), begin() and end(). The document is intended as a lecture on object-oriented string handling in C++.
Python was created in the late 1980s by Guido van Rossum and first released in 1991. It gained popularity and saw new releases in 2000 and 2008. Python is an open source, general purpose, interpreted, object-oriented programming language used widely for web development, science, and more due to its large community and support. Performance depends more on frameworks and architecture than language alone.
Python supports four main numerical types - integers, long integers, floating point numbers, and complex numbers. It provides various functions for mathematical, random number, trigonometric operations and constants like pi and e. Numbers are immutable and created using literals or by assigning values. The del statement can delete single or multiple number references.
This document discusses C# .NET strings and various methods that can be used on string variables including trim, contains, replace, and substring. Trim removes unwanted characters from the start and end of a string. Contains checks if a substring is within a string. Replace replaces occurrences of one substring with another. Substring extracts a portion of a string starting from a specified index for a given length.
This document discusses the StringBuffer and StringBuilder classes in Java. It explains that StringBuffer can be used to create mutable strings, while StringBuilder is similar but non-synchronized. It outlines several key methods for each class, such as append(), insert(), reverse(), substring(), and describes how to construct and manipulate string objects in Java.
This document provides an overview of common string operations in C++, including how to declare and initialize strings, access individual characters, compare strings, append to strings, search within strings, and convert between C++ strings and C-style character arrays. It also describes some additional string utility functions provided in the CS106 library like converting case and converting between strings and numbers.
Type header file in c++ and its functionFrankie Jones
This document lists common C++ header files and standard functions. It provides a brief description of functions in headers like cassert, cctype, cmath, cstdlib, cstring, and others. Functions like assert, isalnum, ceil, atoi, strcat, and cout are described. The document serves as a reference for commonly used C++ functions organized by header file.
Lab Assignment #6, part 3 Time ConversionProgram Name lab.docxsmile790243
This document contains code for multiple C++ programs that demonstrate various concepts. The first section shows code for a time conversion program that converts between military and standard time formats. The second section shows code for a cookie sales tracking program that uses vectors to store cookie names and sales amounts, and includes functions to calculate totals, percentages, and find best/worst sellers. The third section covers various aspects of the C++ string data type, including initialization, input/output, concatenation, comparison operators, and common string methods.
Classes allow programmers to create new types that model real-world objects. A class defines both data attributes and built-in operations that can operate on that data. C++ provides built-in classes like string and iostream that add powerful functionality to the language. The string class allows easy storage and manipulation of strings, while the iostream classes (istream and ostream) define objects like cin and cout for input/output. These classes provide many useful built-in operations that make input/output powerful yet easy to use.
CBSE Question Paper Computer Science with C++ 2011Deepak Singh
This document provides instructions for a 3-hour computer science exam with 70 maximum marks. It includes 6 questions with subparts testing various C++ programming concepts. Question 1 covers local vs global variables, header files, error correction, and finding output. Question 2 differentiates class members, illustrates function overloading, and defines a class. Question 3 includes array functions for transferring content between arrays, finding an array element location, and queue operations. Question 4 involves file input/output functions for modifying a data file.
The document provides an overview of key C++ concepts including:
- C++ is an extension of C that adds object-oriented features like inheritance, polymorphism, encapsulation and abstraction.
- It discusses the differences between C and C++, data types, variables, arrays, strings, functions, and conditionals.
- The document concludes with examples of C++ programs and practice questions.
1) The document provides an introduction to programming concepts like flow charts, libraries, variables, data types, inputs/outputs, and operators.
2) Control structures like if/else, switch, and different types of loops (for, while, do-while) are explained with examples.
3) An assignment is given to write a calculator program that takes two numbers from the user, an operation to perform, performs the calculation, and allows the user to choose another operation or exit.
This document provides information about C++ programming language tokens and input/output operations. It defines various tokens like keywords, identifiers, literals, punctuators, and operators. It explains the basic structure of a C++ program and defines important headers like iostream. It also describes input/output streams like cout and cin, and input/output operators like << and >>.
This document summarizes key aspects of a C++ program discussed in Chapter 2 of the textbook. It explains the parts of a basic C++ program including comments, preprocessor directives, namespaces, functions and blocks. It also describes important C++ concepts such as data types, variables, constants, operators, and input/output using cout. Special characters, escape sequences and standard libraries are defined. Best practices for writing readable and maintainable C++ code are also covered.
The document compares computers to dumbo, explaining that both require input from a user to perform tasks. It then provides details about C++ programs, data types used in C++ like int, float, double, char, and string to store different types of data. It explains concepts like binary representation of numbers, operators and precedence, loops, structures, and pointers. Overall, the document covers fundamental concepts about how computers work and common data types and programming elements used in C++.
The document provides information about Bjarne Stroustrup, the creator of C++ programming language, and introduces some basic concepts of C++ like tokens, keywords, identifiers, literals, character set, and a simple "Hello World" program. It mentions that Stroustrup added object-oriented programming features to the C language and named it C++. The document also lists different types of tokens, literals, and operators used in C++.
This document discusses file input and output (I/O) in C++. It explains that a file contains a collection of related data stored on disk and is accessed using input and output pointers. It describes functions for manipulating these pointers like seekg(), seekp(), tellg(), and tellp(). It also covers reading and writing single characters and blocks of data using functions like put(), get(), write(), and read(). Finally, it discusses using command line arguments to specify file names and handling errors in file I/O.
This document provides an overview of C++ basics including:
- C++ is an object-oriented superset of C that allows for high-level programming.
- The #include preprocessor directive is used to include header files containing commonly used code.
- The main() function marks the starting point of a C++ program and must return an int.
- Variables, data types, operators, and flow control structures like if/else statements are explained.
This document provides an overview of the C++ Data Structures lab manual. It covers topics like C++ review, implementation of various data structures like stack, queue, linked list, binary tree, graph. It also discusses sorting and searching techniques, file input/output, functions, classes, templates and exercises for students to practice implementing different data structures and algorithms. The instructor's contact details are provided at the beginning.
The document provides information about file pointers in C++. It states that a file pointer indicates the position in a file being accessed by a program. File pointers allow programs to move around within a file to read or write data at different locations. Some key functions that manipulate file pointers are seekg(), tellg(), seekp(), and tellp(). These functions respectively allow seeking to a particular location in a file for reading or writing, and returning the current file position. Precise control over file pointers is important when working with random access file I/O in C++.
This document discusses file handling in C++. It begins by explaining that files allow data to be stored permanently on secondary storage devices like hard disks, unlike variables in memory. It then covers key topics like:
- The different types of files, such as text files containing readable characters and binary files containing raw data.
- Classes used for file input/output like ifstream, ofstream, and fstream.
- Opening, closing, reading from, and writing to files using functions like open(), close(), get(), put(), seekg(), tellg(), seekp(), and tellp().
- File pointers that track read/write positions and functions to manipulate them.
- Examples of creating
The document provides an introduction to the C++ programming language, including its history, characteristics, and components. It notes that C++ was created in the 1980s by Bjarne Stroustrup at Bell Labs as an enhancement to the C language that added object-oriented programming capabilities while still maintaining efficiency. Some key characteristics of C++ include object-oriented programming, portability, modular programming, C compatibility, and a wide range of library functions. The document discusses the basic building blocks of C++, including tokens like identifiers, keywords, constants, punctuators, and operators.
This study describe how to write the Research Paper and its related issues. It also presents the major sections of Research Paper and various tools & techniques used for Polishing Research Paper
before final submission.
Finding a Right Journal and Publication Ethics are explain in brief.
New syllabus entomology (Lession plan 121).pdfArshad Shaikh
*Fundamentals of Entomology*
Entomology is the scientific study of insects, including their behavior, ecology, evolution, classification, and management. Insects are the most diverse group of organisms on Earth, with over a million described species. Understanding entomology is crucial for managing insect pests, conserving beneficial insects, and appreciating their role in ecosystems.
*Key Concepts:*
- Insect morphology and anatomy
- Insect physiology and behavior
- Insect ecology and evolution
- Insect classification and identification
- Insect management and conservation
Entomology has numerous applications in agriculture, conservation, public health, and environmental science, making it a vital field of study.
Drug Metabolism advanced medicinal chemistry.pptxpharmaworld
This document describes about structural metabolism relationship and drug designing and toxicity of drugs in " DRUG METABOLISM"
In Drug Metabolism is the process of converting a drug into product or inert substances after or before reaching at the site of action.
Metabolism plays an important role in elimination of drugs and foreign substance from the body.
The metabolism of any drug is generally characterised by two phases of reaction
1.Metabolic transformation ( biotransformation ) and
2.Conjugation
The Principal site of drug metabolism is the liver, but the kidney, lungs, and GIT also are important metabolic sites.
The enzymatic bio transformations of drugs is known as Drug Metabolism. Because many drugs have structures similar to those of endogenous compounds , drugs may get metabolised by specific enzymes for the related natural substrates as well as by non-specific enzymes.
Reaction type of Phase-I:
1.Oxidation
2.Reduction
3.Hydrolysis
Most drugs are metabolised ,atleast to some extent , by both phases of metabolism.
Example: Metabolism of Aspirin
Acetyl Salicylic acid undergoes hydrolysis to salicylic acid ( metabolic transformation ), which is then conjugated with glycine to form Salicyluric acid ( Conjugation ).
In Phase-II the metabolites formed in Phase-II are converted to more polar and water soluble product by attaching polar and ionisable moiety such as
1.Glucuronic acid
2.Glycine
3.Glutamine
4.Glutathione conjugation
5.Acetylation
6.Methylation
7.Sulfate conjugation
8.Nucleoside and Nucleotide formation
9.Amino Acid Conjugation
10.Fatty Acid and Cholesterol Conjugation
Drug design is the process of creating new drugs by using knowledge of a biological target.
Drug design considers metabolism to optimize pharmaco kinects ( ADME: Absorption , Distribution , Metabolism , Excretion )
Cytochrome CYP450 enzyme in Drug Metabolism is vital in drug design to enhance efficacy , reduce toxicity and improve bioavailability.
Cytochrome P450 enzymes (CYPs) are a superfamily of heme -containing proteins found from bacteria to human.
Cytochrome P-450 activity in various organs like Liver,Lung ,Kidney , Intestine,Placenta
Adrenal and Skin and they shows the relative activity with repect to their organs in the process of drug metabolism.
Most important CYP450 enzymes are CYP1A2 , CYP2C9 , CYP2E1
,etc...
Toxic Effects of Drug Metabolism
Toxicity: Accumulation of Excess of medications in the Blood Stream.
Ariens (1948) and Mitchell and Horning (1984) deal with this topic.
Some examples of Metabolism-Linked Toxicity are
1.Acetaminophen (paracetmol)
2.Isoniazid ( TB drug)
3.Chloroform
4.Dapsone
5.Diazepam
6.Salicylate
7.Halothane (Anesthetic)
8.Tamoxifen (Breast Cancer drug )
9.Clozapine(Antipsychotic)
These drugs are differentiates with the TOXIC METABOLITE , TOXICITY OF METABOLITE.
References for this topic also mentioned at the end.
"Dictyoptera: The Order of Cockroaches and Mantises" Or, more specifically: ...Arshad Shaikh
Dictyoptera is an order of insects that includes cockroaches and praying mantises. These insects are characterized by their flat, oval-shaped bodies and unique features such as modified forelegs in mantises for predation. They inhabit diverse environments worldwide.
How to Configure Subcontracting in Odoo 18 ManufacturingCeline George
Subcontracting in manufacturing involves outsourcing specific production tasks to external vendors or subcontractors. These tasks may include manufacturing certain components, handling assembly processes, or even producing entire product lines.
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...Sandeep Swamy
Weather shapes our world and daily lives. This presentation explores how we measure weather conditions and use predictions to prepare for various weather events. "A change in the weather is sufficient to create the world and oneself anew." - Marcel Proust, French novelist by sandeep swamy
This article explores the miraculous event of the Splitting of the Moon (Shaqq al-Qamar) as recorded in Islamic scripture and tradition. Drawing from the Qur'an, authentic hadith collections, and classical tafsir, the article affirms the event as a literal miracle performed by Prophet Muhammad ﷺ in response to the Quraysh’s demand for a sign. It also investigates external historical accounts, particularly the legend of Cheraman Perumal, a South Indian king who allegedly witnessed the miracle and embraced Islam. The article critically examines the authenticity and impact of such regional traditions, while also discussing the lack of parallel astronomical records and how scholars have interpreted this event across centuries. Concluding with the theological significance of the miracle, the article offers a well-rounded view of one of Islam’s most discussed supernatural events.
"Orthoptera: Grasshoppers, Crickets, and Katydids pptxArshad Shaikh
Orthoptera is an order of insects that includes grasshoppers, crickets, and katydids. Characterized by their powerful hind legs, Orthoptera are known for their impressive jumping ability. With diverse species, they inhabit various environments, playing important roles in ecosystems as herbivores and prey. Their sounds, often produced through stridulation, are distinctive features of many species.
What are the Features & Functions of Odoo 18 SMS MarketingCeline George
A key approach to promoting a business's events, products, services, and special offers is through SMS marketing. With Odoo 18's SMS Marketing module, users can notify customers about flash sales, discounts, and limited-time offers.
In this presentation we will show irrefutable evidence that proves the existence of Pope Joan, who became pontiff in 856 BC and died giving birth in the middle of a procession in 858 BC.
Research Handbook On Environment And Investment Law Kate Milesmucomousamir
Research Handbook On Environment And Investment Law Kate Miles
Research Handbook On Environment And Investment Law Kate Miles
Research Handbook On Environment And Investment Law Kate Miles
Protest - Student Revision Booklet For VCE Englishjpinnuck
The 'Protest Student Revision Booklet' is a comprehensive resource to scaffold students to prepare for writing about this idea framework on a SAC or for the exam. This resource helps students breakdown the big idea of protest, practise writing in different styles, brainstorm ideas in response to different stimuli and develop a bank of creative ideas.
Protest - Student Revision Booklet For VCE Englishjpinnuck
Acm aleppo cpc training ninth session
1. ACM Aleppo CPC Training
Part 1 C++ Programming Concepts
By Ahmad Bashar Eter
2. The Priority Queue Container
• Priority Queue is similar to queue, but with a one difference the
element with highest priority will be moved to the front of the queue.
Thus it is possible that when you enqueue an element at the back in the
queue, it can move to front because of its highest priority.
• In another words Priority queues are a type of container adaptors,
specifically designed such that its first element is always the greatest of
the elements it contains.
• This context is similar to a heap, where elements can be inserted at any
moment, and only the max heap element can be retrieved.
Reference:
3. The Priority Queue Container
• The Priority Queue are implemented as containers adaptors, which are
classes that use an encapsulated object of a specific container like
deque and vector.
• Priority Queue uses algorithm functions make_heap, push_heap and
pop_heap when needed to preserve the heap context to effectively
have the maximum element at the top of the heap orat the front of the
container.
Reference:
4. The Priority Queue Container
• Some member function of Queues are:
empty(): Returns true if the priority queue is empty and false if the
priority queue has at least one element. Its time complexity is
O(1).
pop(): Removes the largest element from the priority queue. Its time
complexity is O(logN) where N is the size of the priority queue.
push(): Inserts a new element in the priority queue. Its time complexity
is O(logN) where N is the size of the priority queue.
size(): Returns the number of element in the priority queue. Its time
complexity is O(1).
top(): Returns a reference to the largest element in the priority queue.
Its time complexity is O(1).
Reference:
5. Example 1: Monk And Champions League
Monk's favourite game is Football and his favourite club is "Manchester United".
Manchester United has qualified for the Champions League Final which is to be
held at the Wembley Stadium in London. So, he decided to go there and watch
his favourite team play. After reaching the stadium, he saw that many people
have lined up for the match tickets. He knows that there are M rows in the
stadium with different seating capacities. They may or may not be equal. The
price of the ticket depends on the row. If the row has K(always greater than 0)
vacant seats, then the price of the ticket will be K pounds(units of British
Currency). Now, every football fan standing in the line will get a ticket one by
one.
Given the seating capacities of different rows, find the maximum possible
pounds that the club will gain with the help of the ticket sales.
Solve At:
6. Example 1: Little Monk and Goblet of Fire
Input: The first line consists of M and N. M denotes the number of seating rows
in the stadium and N denotes the number of football fans waiting in the line to
get a ticket for the match.
Next line consists of M space separated integers X[1],X[2],X[3]....
X[M] where X[i] denotes the number of empty seats initially in the ith row.
Output:
Print in a single line the maximum pounds the club will gain.
Constraints:
1 <= M <= 1000000
1 <= N <= 1000000
1 <= X[i] <= 1000000
Sum of X[i] for all 1 <= i <= M will always be greater than N.
Solve At:
7. Example 1: Little Monk and Goblet of Fire
Sample Input
3 4
1 2 4
Solve At:
Sample Output
11
8. Bitset Container
• A bitset stores bits (elements with only two possible values).
• The class emulates an array of bool elements, but optimized for space
allocation: generally, each element occupies only one bit (which, on
most systems, is eight times less than the smallest elemental type:
char).
• Each bit position can be accessed individually: for example, for a given
bitset named foo, the expression foo[3] accesses its fourth bit, just like a
regular array accesses its elements.
• Bitsets have the feature of being able to be constructed from and
converted to both integer values and binary strings. They can also be
directly inserted and extracted from streams in binary format.
Reference:
9. Bitset Container
• The size of a bitset is fixed at compile-time (determined by its template
parameter).
• To define a bitset:
bitset<100> x = 9;
string s = “1010011100”
bitset<100> y = s;
• With bitset you can use any bitwise operators(like <<,>>,&,^,|,~).
Reference:
10. Bitset Container
• Some bitset functions:
Reference:
Descriptionfunction
Access a bitoperator[]
Count bits in the bitsetcount
Return the size of bitsetsize
Return a bit value in the bitsettest
Test if any bit is setany
Test if no bit is setnone
Test if all bits are setall
11. Bitset Container
• Some bitset functions:
Reference:
Descriptionfunction
Set bits (make it 1)set
Reset bits(make it 0)reset
Flip bitsflip
Convert to stringto_string
Convert to unsigned long integerto_ulong
Convert to unsigned long longto_ullong
12. Bitset Container
• Some bitset functions:
Reference:
Descriptionfunction
Set bits (make it 1)set
Reset bits(make it 0)reset
Flip bitsflip
Convert to stringto_string
Convert to unsigned long integerto_ulong
Convert to unsigned long longto_ullong
13. Handling files
• To make the cin, cout streams read and write to a file you can use the
function freopen witch reopen a stream of data which allow you to
open a file to read from when using cin and open a file to write to when
using cout.
• This function take 3 parameters the first one is the file name to open,
the second one is “r” string or “w” string which specify how you will use
the file to read or write the last one is stdin or stdout which tell the
function to assign the file to the input stream(cin) or the output
stream(cout) .
• Eg: freopen(“input.txt”,”r”,stdin);
freopen(“output.txt”,”w”,stdout);
Reference:
14. C style IO
• In addition to c++ style IO we have the C style IO which consist of sacnf
and printf, these two functions IO in the C style. C style IO is much faster
than the C++ style this what made us interested in it.
• This two functions take 2 or more parameters the first parameter is a
string which contain the format or the description of the input or the
output, then the other parameters are the variables that we want to
print or scan.
• The formatting string may have a regular string and may have
commands started with % symbol which descript the variables type and
there display options.
Reference:
15. C style IO
• A format specifier follows this prototype:
%[flags][width][.precision][length]specifier
The specifiers may be any one of this specifiers.
• %d mean decimal integer value.
• %ld mean decimal long integer value.
• %lld or %i64d mean decimal long long integer value.
• %f mean flotation point value.
• %s mean char array for C style strings value.
• %c mean one characher value.
Reference:
16. String Conversion
• Some problems give you the input as string and you need to extract the
values from it and some problems need you to combine two values next
to each other in some way.
• In this case you can solve the problem quickly if you can convert the
values to string and string to value.
• If you want to do this conversion you may use string stream.
• String stream behave like IO streams (cin, cout) but it reads and writes
to a string in the memory.
• To create string stream first you need to include <sstream> then create
stringstream object.
Reference:
17. String Conversion
• You can use the stringstream object to input using >> operator or to output
using << operator data from and to a string.
• The str method inside the stringstream give you the string which the stream is
writing to, also allow you to set a new string to read from.
• See this code snippet:
string s; int a; float b;
stringstream i("99.55"),o;
i >> b;
cout << b << endl;
o << 5 <<" "<< 9.5 << " abcdefg ";
cout << o.str()<<endl;
o >> a >> b >> s;
cout << a << endl << b << endl << s << endl;
Reference:
18. Preprocessor directives
• Preprocessor directives are lines included in the code of programs
preceded by a hash sign (#). These lines are not program statements but
directives for the preprocessor. The preprocessor examines the code
before actual compilation of code begins and resolves all these
directives before any code is actually generated by regular statements.
• These preprocessor directives extend only across a single line of code.
As soon as a newline character is found, the preprocessor directive is
ends. No semicolon (;) is expected at the end of a preprocessor
directive. The only way a preprocessor directive can extend through
more than one line is by preceding the newline character at the end of
the line by a backslash ().
Reference:
19. Macro definitions (#define)
• To define preprocessor macros we can use #define.
• Its syntax is: #define identifier replacement
• When the preprocessor encounters this directive, it replaces any
occurrence of identifier in the rest of the code by replacement. This
replacement can be an expression, a statement, a block or simply
anything. The preprocessor does not understand C++ proper, it simply
replaces any occurrence of identifier by replacement.
Reference:
20. Macro definitions (#define)
• When practicing in home online we may create our macros to help us
get our code ready fast.
• We may define a macro to represent a for loop like this:
#define rep(I,n) for(int i=0;i<n;i++)
• And we can use it like that:
rep(i,5){ cout<<i<<endl; }
• Before compiling the compiler will replace the rep(i,5) expression by the
for(int i=0;i<5;i++) so that we will end up having a for loop.
Reference:
21. Inline
• Sometimes we need to define a small function which it will be called so
many times.
• In this situation the calling overhead will be too much. To reduce this
overhead we can make this function inline.
• Inline functions are optimized so that the compiler can replace there
code by its calling operation.
• This will make the code much bigger but if the functions are small this
will make them run faster (no calling overhead).
22. Code Optimization
• Sometime we face a problem and we solve it with low order algorithm
but we still get TLE. In this case we need to optimize our code.
• This is some of the tips we need to have a good code:
1. Don’t use long long if you can.
2. Avoid using floating point numbers if you can, and if you must use
them consider the precision and use double instead of float.
3. If you have multi-dimensions array try make the last dimensions the
one to be accessed more frequently.
4. Try to stop your algorithm as soon as you find the solution or
eliminate parts of search space that you will not need them.
5. Use C style string and IO it may help.
23. Example 2: UVA 11553 Grid Game
Alice and Bob both have lots of candies but want more. They decide to play the
following turn-based game. They fill an nxn grid M with random integers. Alice
begins the game by crossing off an uncrossed row i of the grid. Now it’s Bob turn
and he crosses off an uncrossed column j of the grid.
At the end of Bob’s turn, Alice takes the number candies in the i-th row and j-th
column of M, call this value M(i; j), from Bob. (If M(i, j) is negative, then Alice
gives |M(i, j)| candies to Bob.) The game continues alternating turns from Alice
to Bob until the entire board is crossed off.
What is the largest amount of candies that Alice can win from Bob (or least
amount to lose if she cannot win) if both Alice and Bob play optimally?
24. Example 2: UVA 11553 Grid Game
Input
The first line of the input contains an integer t (1 t 20), the number of test cases.
Each test case starts with n (1 n 8), the size of the grid. Then follow n lines
containing n numbers separated by spaces describing M. We call the j-th number
on i-th line M(i; j) ( 1000 M(i; j) 1000).
Output
For each test case, print the largest amount of candies that Alice can win from
Bob. If she cannot win,
print the negative number indicating the minimum number of candies she loses.
26. Example 3: The path in the colored field
The square field consists of M M cells. Each cell is colored in one of three colors
(1,2,3). The initial state is chosen in one of the cells of color 1. In each step one
allowed to move one cell up, down, left or right remaining inside the field.
You are to define the minimal amount of steps one should make to get a cell of
color 3 independent on the initial state.
Note that the field contains at least one cell of color 1 and at least one cell of
color 3.
27. Example 3: The path in the colored field
Input
The input consists of several input blocks. The first line of each block contains
integer M, the size of
the field. Then there are M lines with colors of the cells.
Output
For each input block the output should consist of one line with the integer, the
minimal amount of
steps one should make to get a cell of color 3 independent on the initial state.
28. Example 3: The path in the colored field
Sample Input
4
1223
2123
2213
3212
2
12
33
Sample Output
3
1