0% found this document useful (0 votes)
67 views

Competitive Programming in Python: 128 Algorithms to Develop your Coding Skills 1st Edition Christoph Dürr all chapter instant download

Algorithms

Uploaded by

tirhipikon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

Competitive Programming in Python: 128 Algorithms to Develop your Coding Skills 1st Edition Christoph Dürr all chapter instant download

Algorithms

Uploaded by

tirhipikon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Experience Seamless Full Ebook Downloads for Every Genre at textbookfull.

com

Competitive Programming in Python: 128 Algorithms


to Develop your Coding Skills 1st Edition
Christoph Dürr

https://textbookfull.com/product/competitive-programming-in-
python-128-algorithms-to-develop-your-coding-skills-1st-
edition-christoph-durr/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Algorithmic Thinking. Learn Algorithms...Your Coding


Skills 2ed 2024 Zingaro D.

https://textbookfull.com/product/algorithmic-thinking-learn-
algorithms-your-coding-skills-2ed-2024-zingaro-d/

textboxfull.com

Good Habits for Great Coding: Improving Programming Skills


with Examples in Python Michael Stueben

https://textbookfull.com/product/good-habits-for-great-coding-
improving-programming-skills-with-examples-in-python-michael-stueben/

textboxfull.com

Good Habits for Great Coding: Improving Programming Skills


with Examples in Python 1st Edition Michael Stueben

https://textbookfull.com/product/good-habits-for-great-coding-
improving-programming-skills-with-examples-in-python-1st-edition-
michael-stueben/
textboxfull.com

Algorithms For Competitive Programming 1st Edition David


Esparza Alba

https://textbookfull.com/product/algorithms-for-competitive-
programming-1st-edition-david-esparza-alba/

textboxfull.com
Basic Exercises for Competitive Programming Python 1st
Edition Jan Pol

https://textbookfull.com/product/basic-exercises-for-competitive-
programming-python-1st-edition-jan-pol/

textboxfull.com

Python Programming For Beginners: Python Mastery in 7


Days: Top-Secret Coding Tips with Hands-On Exercises for
Your Dream Job 1st Edition Oswald Thornton
https://textbookfull.com/product/python-programming-for-beginners-
python-mastery-in-7-days-top-secret-coding-tips-with-hands-on-
exercises-for-your-dream-job-1st-edition-oswald-thornton/
textboxfull.com

Guide to Competitive Programming: Learning and Improving


Algorithms Through Contests (Undergraduate Topics in
Computer Science) Antti Laaksonen
https://textbookfull.com/product/guide-to-competitive-programming-
learning-and-improving-algorithms-through-contests-undergraduate-
topics-in-computer-science-antti-laaksonen/
textboxfull.com

Python: 3 books in 1: Beginner’s guide, Data science and


Machine learning. The easiest guide to start Python
programming. Unlock your programmer potential and develop
your project in just 30 days First Edition William Dimick
https://textbookfull.com/product/python-3-books-in-1-beginners-guide-
data-science-and-machine-learning-the-easiest-guide-to-start-python-
programming-unlock-your-programmer-potential-and-develop-your-project-
in-just-30-d/
textboxfull.com

Coding Games in Python 1st Edition Carol Vorderman

https://textbookfull.com/product/coding-games-in-python-1st-edition-
carol-vorderman/

textboxfull.com
Competitive Programming in Python

Want to kill it at your job interview in the tech industry? Want to win that coding
competition? Learn all the algorithmic techniques and programming skills you need
from two experienced coaches, problem-setters, and judges for coding competitions.
The authors highlight the versatility of each algorithm by considering a variety of
problems and show how to implement algorithms in simple and efficient code. What
to expect:
* Master 128 algorithms in Python.
* Discover the right way to tackle a problem and quickly implement a solution of low
complexity.
* Understand classic problems like Dijkstra’s shortest path algorithm and
Knuth–Morris–Pratt’s string matching algorithm, plus lesser-known data structures
like Fenwick trees and Knuth’s dancing links.
* Develop a framework to tackle algorithmic problem solving, including: Definition,
Complexity, Applications, Algorithm, Key Information, Implementation, Variants,
In Practice, and Problems.
* Python code included in the book and on the companion website.

Christoph Dürr is a senior researcher at the French National Center for Scientific
Research (CNRS), affiliated with the Sorbonne University in Paris. After a PhD in
1996 at Paris-Sud University, he worked for one year as a postdoctoral researcher at
the International Computer Science Institute in Berkeley and one year in the School
of Computer Science and Engineering in the Hebrew University of Jerusalem in
Israel. He has worked in the fields of quantum computation, discrete tomography and
algorithmic game theory, and his current research activity focuses on algorithms and
optimisation. From 2007 to 2014, he taught a preparation course for programming
contests at the engineering school École Polytechnique, and acts regularly as a
problem setter, trainer, or competitor for various coding competitions. In addition, he
loves carrot cake.

Jill-Jênn Vie is a research scientist at Inria in machine learning. He is an alumnus


from École normale supérieure Paris-Saclay, where he founded the algorithmic club
of Paris-Saclay (CAPS) and coached several teams for the International Collegiate
Programming Contest (ICPC). He published a book in theoretical computer science
to help students prepare for prestigious French competitive exams such as Grandes
Écoles or agrégation, and directed a television show “Blame the Algorithm” about
the algorithms that govern our lives. He is part of the advisory board of the French
Computer Science Society (SIF), itself a member of the International Federation for
Information Processing (IFIP).
Competitive Programming
in Python
128 Algorithms to Develop Your Coding Skills

CHRISTOPH DÜRR
CNRS, Sorbonne University

JILL-JÊNN VIE
Inria

Translated by Greg Gibbons and Danièle Gibbons


University Printing House, Cambridge CB2 8BS, United Kingdom
One Liberty Plaza, 20th Floor, New York, NY 10006, USA
477 Williamstown Road, Port Melbourne, VIC 3207, Australia
314–321, 3rd Floor, Plot 3, Splendor Forum, Jasola District Centre, New Delhi – 110025, India
79 Anson Road, #06–04/06, Singapore 079906

Cambridge University Press is part of the University of Cambridge.


It furthers the University’s mission by disseminating knowledge in the pursuit of
education, learning, and research at the highest international levels of excellence.

www.cambridge.org
Information on this title: www.cambridge.org/9781108716826
DOI: 10.1017/9781108591928
© Cambridge University Press 2021
Translation from the French language edition:
Programmation efficace - 128 algorithmes qu’il faut avoir compris et codés en Python au cour de sa vie
By Christoph Dürr & Jill-Jênn Vie
Copyright © 2016 Edition Marketing S.A.
www.editions-ellipses.fr
All Rights Reserved
This publication is in copyright. Subject to statutory exception
and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without the written
permission of Cambridge University Press.
First published 2021
Printed in the United Kingdom by TJ Books Limited, Padstow Cornwall
A catalogue record for this publication is available from the British Library.
Library of Congress Cataloging-in-Publication Data
Names: Dürr, Christoph, 1969– author. | Vie, Jill-Jênn, 1990– author. |
Gibbons, Greg, translator. | Gibbons, Danièle, translator.
Title: Competitive programming in Python : 128 algorithms to develop your
coding skills / Christoph Dürr, Jill-Jênn Vie ; translated by Greg
Gibbons, Danièle Gibbons.
Other titles: Programmation efficace. English
Description: First edition. | New York : Cambridge University Press, 2020.
| Includes bibliographical references and index.
Identifiers: LCCN 2020022774 (print) | LCCN 2020022775 (ebook) |
ISBN 9781108716826 (paperback) | ISBN 9781108591928 (epub)
Subjects: LCSH: Python (Computer program language) | Algorithms.
Classification: LCC QA76.73.P98 D8713 2020 (print) | LCC QA76.73.P98
(ebook) | DDC 005.13/3–dc23
LC record available at https://lccn.loc.gov/2020022774
LC ebook record available at https://lccn.loc.gov/2020022775
ISBN 978-1-108-71682-6 Paperback
Cambridge University Press has no responsibility for the persistence or accuracy of
URLs for external or third-party internet websites referred to in this publication
and does not guarantee that any content on such websites is, or will remain,
accurate or appropriate.
Contents

Preface page ix

1 Introduction 1
1.1 Programming Competitions 1
1.2 Python in a Few Words 5
1.3 Input-Output 13
1.4 Complexity 17
1.5 Abstract Types and Essential Data Structures 20
1.6 Techniques 28
1.7 Advice 37
1.8 A Problem: ‘Frosting on the Cake’ 39

2 Character Strings 42
2.1 Anagrams 42
2.2 T9—Text on 9 Keys 43
2.3 Spell Checking with a Lexicographic Tree 46
2.4 Searching for Patterns 48
2.5 Maximal Boundaries—Knuth–Morris–Pratt 49
2.6 Pattern Matching—Rabin–Karp 56
2.7 Longest Palindrome of a String—Manacher 59

3 Sequences 62
3.1 Shortest Path in a Grid 62
3.2 The Levenshtein Edit Distance 63
3.3 Longest Common Subsequence 65
3.4 Longest Increasing Subsequence 68
3.5 Winning Strategy in a Two-Player Game 70

4 Arrays 72
4.1 Merge of Sorted Lists 73
4.2 Sum Over a Range 74
4.3 Duplicates in a Range 74
4.4 Maximum Subarray Sum 75
vi Contents

4.5 Query for the Minimum of a Range—Segment Tree 75


4.6 Query the Sum over a Range—Fenwick Tree 77
4.7 Windows with k Distinct Elements 80

5 Intervals 82
5.1 Interval Trees 82
5.2 Union of Intervals 85
5.3 The Interval Point Cover Problem 85

6 Graphs 88
6.1 Encoding in Python 88
6.2 Implicit Graphs 90
6.3 Depth-First Search—DFS 91
6.4 Breadth-First Search—BFS 93
6.5 Connected Components 94
6.6 Biconnected Components 97
6.7 Topological Sort 102
6.8 Strongly Connected Components 105
6.9 2-Satisfiability 110

7 Cycles in Graphs 113


7.1 Eulerian Tour 113
7.2 The Chinese Postman Problem 116
7.3 Cycles with Minimal Ratio of Weight to Length—Karp 117
7.4 Cycles with Minimal Cost-to-Time Ratio 120
7.5 Travelling Salesman 120
7.6 Full Example: Menu Tour 121

8 Shortest Paths 124


8.1 Composition Property 124
8.2 Graphs with Weights 0 or 1 126
8.3 Graphs with Non-negative Weights—Dijkstra 127
8.4 Graphs with Arbitrary Weights—Bellman–Ford 130
8.5 All Source–Destination paths—Floyd–Warshall 132
8.6 Grid 133
8.7 Variants 135

9 Matchings and Flows 138


9.1 Maximum Bipartite Matching 139
9.2 Maximal-Weight Perfect Matching—Kuhn–Munkres 145
9.3 Planar Matching without Crossings 151
9.4 Stable Marriages—Gale–Shapley 153
Contents vii

9.5 Maximum Flow by Ford–Fulkerson 155


9.6 Maximum Flow by Edmonds–Karp 158
9.7 Maximum Flow by Dinic 159
9.8 Minimum s − t Cut 162
9.9 s − t Minimum Cut for Planar Graphs 163
9.10 A Transport Problem 165
9.11 Reductions between Matchings and Flows 165
9.12 Width of a Partial Order—Dilworth 167

10 Trees 171
10.1 Huffman Coding 172
10.2 Lowest Common Ancestor 174
10.3 Longest Path in a Tree 178
10.4 Minimum Weight Spanning Tree—Kruskal 179

11 Sets 182
11.1 The Knapsack Problem 182
11.2 Making Change 184
11.3 Subset Sum 185
11.4 The k-sum Problem 187

12 Points and Polygons 189


12.1 Convex Hull 190
12.2 Measures of a Polygon 193
12.3 Closest Pair of Points 195
12.4 Simple Rectilinear Polygon 198

13 Rectangles 200
13.1 Forming Rectangles 200
13.2 Largest Square in a Grid 201
13.3 Largest Rectangle in a Histogram 202
13.4 Largest Rectangle in a Grid 204
13.5 Union of Rectangles 205
13.6 Union of Disjoint Rectangles 212

14 Numbers and Matrices 214


14.1 GCD 214
14.2 Bézout Coefficients 214
14.3 Binomial Coefficients 215
14.4 Fast Exponentiation 216
14.5 Prime Numbers 217
14.6 Evaluate an Arithmetical Expression 218
viii Contents

14.7 System of Linear Equations 221


14.8 Multiplication of a Matrix Sequence 225

15 Exhaustive Search 227


15.1 All Paths for a Laser 227
15.2 The Exact Cover Problem 231
15.3 Problems 237
15.4 Sudoku 238
15.5 Enumeration of Permutations 240
15.6 Le Compte est Bon 243

16 Conclusion 245
16.1 Combine Algorithms to Solve a Problem 245
16.2 For Further Reading 245
16.3 Rendez-vous on tryalgo.org 246

Debugging tool 247


References 248
Index 251
Preface

Algorithms play an important role in our society, solving numerous mathematical


problems which appear in a broad spectrum of situations. To give a few examples,
think of planning taxi routes given a set of reservations (see Section 9.12); assigning
students to schools in a large urban school district, such as New York (see Section
9.4); or identifying a bottleneck in a transportation network (see Section 9.8). This
is why job interviews in the IT (Information Technology) industry test candidates for
their problem-solving skills. Many programming contests are organised by companies
such as Google, Facebook and Microsoft to spot gifted candidates and then send
them job offers. This book will help students to develop a culture of algorithms and
data structures, so that they know how to apply them properly when faced with new
mathematical problems.
Designing the right algorithm to solve a given problem is only half of the work;
to complete the job, the algorithm needs to be implemented efficiently. This is why
this book also emphasises implementation issues, and provides full source code for
most of the algorithms presented. We have chosen Python for these implementations.
What makes this language so enticing is that it allows a particularly clear and refined
expression, illustrating the essential steps of the algorithm, without obscuring things
behind burdensome notations describing data structures. Surprisingly, it is actually
possible to re-read code written several months ago and even understand it!
We have collected here 128 algorithmic problems, indexed by theme rather than
by technique. Many are classic, whereas certain are atypical. This work should
prove itself useful when preparing to solve the wide variety of problems posed in
programming contests such as ICPC, Google Code Jam, Facebook Hacker Cup,
Prologin, France-ioi, etc. We hope that it could serve as a basis for an advanced
course in programming and algorithms, where even certain candidates for the
‘agrégation de mathématiques option informatique’ (French competitive exam for
the highest teacher’s certification) will find a few original developments. The website
tryalgo.org, maintained by the authors, contains links to the code of this book, as
well as to selected problems at various online contests. This allows readers to verify
their freshly acquired skills.
This book would never have seen the light of day without the support of the
authors’ life partners. Danke, Hương. Merci, 智子. The authors would also like to
thank the students of the École polytechnique and the École normale supérieure
of Paris-Saclay, whose practice, often nocturnal, generated a major portion of the
x Preface

material of this text. Thanks to all those who proofread the manuscript, especially
René Adad, Evripidis Bampis, Binh-Minh Bui-Xuan, Stéphane Henriot, Lê Thành
Dũng Nguyễn, Alexandre Nolin and Antoine Pietri. Thanks to all those who improved
the programs on GitHub: Louis Abraham, Lilian Besson, Ryan Lahfa, Olivier Marty,
Samuel Tardieu and Xavier Carcelle. One of the authors would especially like to thank
his past teacher at the Lycée Thiers, Monsieur Yves Lemaire, for having introduced
him to the admirable gem of Section 2.5 on page 52.
We hope that the reader will pass many long hours tackling algorithmic problems
that at first glance appear insurmountable, and in the end feel the profound joy when
a solution, especially an elegant solution, suddenly becomes apparent.
Finally, we would like to thank Danièle and Greg Gibbons for their translation of
this work, even of this very phrase.
Attention, it’s all systems go!
1 Introduction

You, my young friend, are going to learn to program the algorithms of this book,
and then go on to win programming contests, sparkle during your job interviews,
and finally roll up your sleeves, get to work, and greatly improve the gross national
product!

Mistakenly, computer scientists are still often considered the magicians of modern
times. Computers have slowly crept into our businesses, our homes and our machines,
and have become important enablers in the functioning of our world. However, there
are many that use these devices without really mastering them, and hence, they do not
fully enjoy their benefits. Knowing how to program provides the ability to fully exploit
their potential to solve problems in an efficient manner. Algorithms and programming
techniques have become a necessary background for many professions. Their mastery
allows the development of creative and efficient computer-based solutions to problems
encountered every day.
This text presents a variety of algorithmic techniques to solve a number of classic
problems. It describes practical situations where these problems arise, and presents
simple implementations written in the programming language Python. Correctly
implementing an algorithm is not always easy: there are numerous traps to avoid and
techniques to apply to guarantee the announced running times. The examples in the
text are embellished with explanations of important implementation details which
must be respected.
For the last several decades, programming competitions have sprung up at every
level all over the world, in order to promote a broad culture of algorithms. The prob-
lems proposed in these contests are often variants of classic algorithmic problems,
presented as frustrating enigmas that will never let you give up until you solve them!

1.1 Programming Competitions

In a programming competition, the candidates must solve several problems in a


fixed time. The problems are often variants of classic problems, such as those
addressed in this book, dressed up with a short story. The inputs to the problems
are called instances. An instance can be, for example, the adjacency matrix of a graph
for a shortest path problem. In general, a small example of an instance is provided,
along with its solution. The source code of a solution can be uploaded to a server via
2 Introduction

a web interface, where it is compiled and tested against instances hidden from the
public. For some problems the code is called for each instance, whereas for others the
input begins with an integer indicating the number of instances occurring in the input.
In the latter case, the program must then loop over each instance, solve it and display
the results. A submission is accepted if it gives correct results in a limited time, on the
order of a few seconds.

Figure 1.1 The logo of the ICPC nicely shows the steps in the resolution of a problem.
A helium balloon is presented to the team for each problem solved.

To give here a list of all the programming competitions and training sites is quite
impossible, and such a list would quickly become obsolete. Nevertheless, we will
review some of the most important ones.

ICPC The oldest of these competitions was founded by the Association for
Computing Machinery in 1977 and supported by them up until 2017. This
contest, known as the ICPC, for International Collegiate Programming Contest,
is organised in the form of a tournament. The starting point is one of the regional
competitions, such as the South-West European Regional Contest (SWERC),
where the two best teams qualify for the worldwide final. The particularity of
this contest is that each three-person team has only a single computer at their
disposal. They have only 5 hours to solve a maximum number of problems
among the 10 proposed. The first ranking criterion is the number of submitted
solutions accepted (i.e. tested successfully against a set of unknown instances).
The next criterion is the sum over the submitted problems of the time between
the start of the contest and the moment of the accepted submission. For each
erroneous submission, a penalty of 20 minutes is added.
There are several competing theories on what the ideal composition of a
team is. In general, a good programmer and someone familiar with algorithms
is required, along with a specialist in different domains such as graph theory,
dynamic programming, etc. And, of course, the team members need to get along
together, even in stressful situations!
For the contest, each team can bring 25 pages of reference code printed in an
8-point font. They can also access the online documentation of the Java API and
the C++ standard library.
Google Code Jam In contrast with the ICPC contest, which is limited to students
up to a Master’s level, the Google Code Jam is open to everyone. This more
recent annual competition is for individual contestants. Each problem comes in
1.1 Programming Competitions 3

general with a deck of small instances whose resolution wins a few points, and
a set of enormous instances for which it is truly important to find a solution
with the appropriate algorithmic complexity. The contestants are informed of
the acceptance of their solution for the large instances only at the end of the
contest. However, its true strong point is the possibility to access the solutions
submitted by all of the participants, which is extremely instructive.
The competition Facebook Hacker Cup is of a similar nature.
Prologin The French association Prologin organises each year a competition
targeted at students up to twenty years old. Their capability to solve algorithmic
problems is put to test in three stages: an online selection, then regional
competitions and concluding with a national final. The final is atypically an
endurance test of 36 hours, during which the participants are confronted with a
problem in Artificial Intelligence. Each candidate must program a “champion”
to play a game whose rules are defined by the organisers. At the end of the
day, the champions are thrown in the ring against each other in a tournament to
determine the final winner.
The website https://prologin.org includes complete archives of past
problems, with the ability to submit algorithms online to test the solutions.
France-IOI Each year, the organisation France-IOI prepares junior and senior
high school students for the International Olympiad in Informatics. Since
2011, they have organised the ‘Castor Informatique’ competition, addressed at
students from Grade 4 to Grade 12 (675,000 participants in 2018). Their website
http://france-ioi.org hosts a large number of algorithmic problems (more
than 1,000).

Numerous programming contests organised with the goal of selecting candidates


for job offers also exist. The web site www.topcoder.com, for example, also includes
tutorials on algorithms, often very well written.
For training, we particularly recommend https://codeforces.com, a well-
respected web site in the community of programming competitions, as it proposes
clear and well-prepared problems.

1.1.1 Training Sites


A number of websites propose problems taken from the annals of competitions, with
the possibility to test solutions as a training exercise. This is notably the case for
Google Code Jam and Prologin (in French). The collections of the annals of the ICPC
contests can be found in various locations.
Traditional online judges The following sites contain, among others, many
problems derived from the ICPC contests.
uva http://uva.onlinejudge.org
icpcarchive http://icpcarchive.ecs.baylor.edu, http://livearchive
.onlinejudge.org
4 Introduction

Chinese online judges Several training sites now exist in China. They tend to
have a purer and more refined interface than the traditional judges. Nevertheless,
sporadic failures have been observed.
poj http://poj.org
tju http://acm.tju.edu.cn (Shut down since 2017)
zju http://acm.zju.edu.cn
Modern online judges Sphere Online Judge http://spoj.com and Kattis
http://open.kattis.com have the advantage of accepting the submission
of solutions in a variety of languages, including Python.
spoj http://spoj.com
kattis http://open.kattis.com
zju http://acm.zju.edu.cn
Other sites
codechef http://codechef.com
codility http://codility.com
gcj http://code.google.com/codejam
prologin http://prologin.org
slpc http://cs.stanford.edu/group/acm
Throughout this text, problems are proposed at the end of each section in rela-
tion to the topic presented. They are accompanied with their identifiers to a judge
site; for example [spoj:CMPLS] refers to the problem ‘Complete the Sequence!’ at
the URL www.spoj.com/problems/CMPLS/. The site http://tryalgo.org contains
links to all of these problems. The reader thus has the possibility to put into practice
the algorithms described in this book, testing an implementation against an online
judge.
The languages used for programming competitions are principally C++ and Java.
The SPOJ judge also accepts Python, while the Google Code Jam contest accepts
many of the most common languages. To compensate for the differences in execution
speed due to the choice of language, the online judges generally adapt the time limit
to the language used. However, this adaptation is not always done carefully, and it is
sometimes difficult to have a solution in Python accepted, even if it is correctly written.
We hope that this situation will be improved in the years to come. Also, certain judges
work with an ancient version of Java, in which such useful classes as Scanner are
not available.

1.1.2 Responses of the Judges


When some code for a problem is submitted to an online judge, it is evaluated via a set
of private tests and a particularly succinct response is returned. The principal response
codes are the following:
1.2 Python in a Few Words 5

Accepted Your program provides the correct output in the allotted time. Congrat-
ulations!
Presentation Error Your program is almost accepted, but the output contains
extraneous or missing blanks or end-of-lines. This message occurs rarely.
Compilation Error The compilation of your program generates errors. Often,
clicking on this message will provide the nature of the error. Be sure to compare
the version of the compiler used by the judge with your own.
Wrong Answer Re-read the problem statement, a detail must have been over-
looked. Are you sure to have tested all the limit cases? Might you have left
debugging statements in your code?
Time Limit Exceeded You have probably not implemented the most efficient
algorithm for this problem, or perhaps have an infinite loop somewhere. Test
your loop invariants to ensure loop termination. Generate a large input instance
and test locally the performance of your code.
Runtime Error In general, this could be a division by zero, an access beyond the
limits of an array, or a pop() on an empty stack. However, other situations can
also generate this message, such as the use of assert in Java, which is often not
accepted.
The taciturn behaviour of the judges nevertheless allows certain information to be
gleaned from the instances. Here is a trick that was used during an ICPC / SWERC
contest. In a problem concerning graphs, the statement indicated that the input con-
sisted of connected graphs. One of the teams doubted this, and wrote a connectivity
test. In the positive case, the program entered into an infinite loop, while in the negative
case, it caused a division by zero. The error code generated by the judge (Time Limit
Exceeded ou Runtime Error) allowed the team to detect that certain graphs in the input
were not connected.

1.2 Python in a Few Words

The programming language Python was chosen for this book, for its readability and
ease of use. In September 2017, Python was identified by the website https://
stackoverflow.com as the programming language with the greatest growth in high-
income countries, in terms of the number of questions seen on the website, notably
thanks to the popularity of machine learning.1 Python is also the language retained
for such important projects as the formal calculation system SageMath, whose critical
portions are nonetheless implemented in more efficient languages such as C++ or C.
Here are a few details on this language. This chapter is a short introduction to
Python and does not claim to be exhaustive or very formal. For the neophyte reader
we recommend the site python.org, which contains a high-quality introduction as
well as exceptional documentation. A reader already familiar with Python can profit

1 https://stackoverflow.blog/2017/09/06/incredible-growth-python/
6 Introduction

enormously by studying the programs of David Eppstein, which are very elegant and
highly readable. Search for the keywords Eppstein PADS.
Python is an interpreted language. Variable types do not have to be declared, they
are simply inferred at the time of assignment. There are neither keywords begin/end
nor brackets to group instructions, for example in the blocks of a function or a loop.
The organisation in blocks is simply based on indentation! A typical error, difficult
to identify, is an erroneous indentation due to spaces used in some lines and tabs
in others.

Basic Data Types


In Python, essentially four basic data types exist: Booleans, integers, floating-point
numbers and character strings. In contrast with most other programming languages,
the integers are not limited to a fixed number of bits (typically 64), but use an arbi-
trary precision representation. The functions—more precisely the constructors: bool,
int, float, str—allow the conversion of an object to one of these basic types. For
example, to access the digits of a specific integer given its decimal representation,
it can be first transformed into a string, and then the characters of the string can be
accessed. However, in contrast with languages such as C, it is not possible to directly
modify a character of a string: strings are immutable. It is first necessary to convert to
a list representation of the characters; see below.

Data Structures
The principal complex data structures are dictionaries, sets, lists and n-tuples. These
structures are called containers, as they contain several objects in a structured manner.
Once again, there are functions dict, set, list and tuple that allow the conversion of
an object into one of these structures. For example, for a string s, the function list(s)
returns a list L composed of the characters of the string. We could then, for example,
replace certain elements of the list L and then recreate a string by concatenating the ele-
ments of L with the expression ‘’.join(L). Here, the empty string could be replaced
by a separator: for example, ‘-’.join([’A’,’B’,’C’]) returns the string “A-B-C”.

1.2.1 Manipulation of Lists, n-tuples, Dictionaries


Note that lists in Python are not linked lists of cells, each with a pointer to its successor
in the list, as is the case in many other languages. Instead, lists are arrays of elements
that can be accessed and modified using their index into the array. A list is written by
enumerating its elements between square brackets [ and ], with the elements separated
by commas.

Lists The indices of a list start with 0. The last element can also be accessed with
the index −1, the second last with −2 and so on. Here are some examples of
operations to extract elements or sublists of a list. This mechanism is known as
slicing, and is also available for strings.
1.2 Python in a Few Words 7

The following expressions have a complexity linear in the length of L, with


the exception of the first, which is in constant time.
L[i] the ith element of L
L[i:j] the list of elements with indices starting at i and up to
(but not including) j
L[:j] the first j elements
L[i:] all the elements from the ith onwards
L[-3:] the last three elements of L
L[i:j:k] elements from the ith up to (but not including) the jth,
taking only every kth element
L[::2] the elements of L with even indices
L[::-1] a reverse copy of L
The most important methods of a list for our usage are listed below. Their
complexity is expressed in terms of n, the length of the list L. A function has
constant amortised complexity if, for several successive calls to it, the average
complexity is constant, even if some of these calls take a time linear in n.
len(L) returns the number of elements of the list L O(1)
sorted(L) returns a sorted copy of the list L O(n log n)
L.sort() sorts L in place O(n log n)
L.count(c) the number of occurrences of c in L O(n)
c in L is the element c found in L? O(n)
L.append(c) append c to the end of L amortised O(1)
L.pop() extracts and returns the last element of L amortised O(1)
Thus a list has all the functionality of a stack, defined in Section 1.5.1 on
page 20.
n-tuple An n-tuple behaves much like a list, with a difference in the usage
of parentheses to describe it, as in (1, 2) or (left, ’X’, right). A 1-tuple,
composed of only one element, requires the usage of a comma, as in (2,).
A 0-tuple, empty, can be written as (), or as tuple(), no doubt more readable.
The main difference with lists is that n-tuples are immutable, just like strings.
This is why an n-tuple can serve as a key in a dictionary.
Dictionaries Dictionaries are used to associate objects with values, for example
the words of a text with their frequency. A dictionary is constructed as
comma-separated key:value pairs between curly brackets, such as {’the’: 4,
’bread’: 1, ’is’: 6}, where the keys and values are separated by a colon.
An empty dictionary is obtained with {}. A membership test of a key x in a
dictionary dic is written x in dic. Behind a dictionary there is a hash table,
hence the complexity of the expressions x in dic, dic[x], dic[x] = 42
is in practice constant time, even if the worst-case complexity is linear,
a case obtained in the improbable event of all keys having the same hash
value.
If the keys of a dictionary are all the integers between 0 and n − 1, the use of
a list is much more efficient.
8 Introduction

A loop in Python is written either with the keyword for or with while. The nota-
tion for the loop for is for x in S:, where the variable x successively takes on the
values of the container S, or of the keys of S in the case of a dictionary. In contrast,
while L: will loop as long as the list L is non-empty. Here, an implicit conversion of
a list to a Boolean is made, with the convention that only the empty list converts to
False.
At times, it is necessary to handle at the same time the values of a list along with
their positions (indices) within the list. This can be implemented as follows:

for index in range(len(L)):


value = L[index]
# ... handling of index and value

The function enumerate allows a more compact expression of this loop:

for index, value in enumerate(L):


# ... handling of index and value

For a dictionary, the following loop iterates simultaneously over the keys and
values:

for key, value in dic.items():


# ... handling of key and value

1.2.2 Specificities: List and Dictionary Comprehension, Iterators


List and Dictionary Comprehension
The language Python provides a syntax close to the notation used in mathematics for
certain objects. To describe the list of squares from 0 to n2 , it is possible to use a list
comprehension:

>>> n = 5
>>> squared_numbers = [x ** 2 for x in range(n + 1)]
>>> squared_numbers
[0, 1, 4, 9, 16, 25]

which corresponds to the set {x 2 |x = 0, . . . ,n} in mathematics.


This is particularly useful to initialise a list of length n:

>>> t = [0 for _ in range(n)]


>>> t
[0, 0, 0, 0, 0]
1.2 Python in a Few Words 9

or to initialise counters for the letters in a string:

>>> my_string = "cowboy bebop"


>>> nb_occurrences = {letter: 0 for letter in my_string}
>>> nb_occurrences
{’c’: 0, ’o’: 0, ’w’: 0, ’b’: 0, ’y’: 0, ’ ’: 0, ’e’: 0, ’p’: 0}

The second line, a dictionary comprehension, is equivalent to the following:

nb_occurrences = {}
for letter in my_string:
nb_occurrences[letter] = 0

Ranges and Other Iterators


To loop over ranges of integers, the code for i in range(n): can be used to run over
the integers from 0 to n − 1. Several variants exist:

range(k, n) from k to n − 1
range(k, n, 2) from k to n − 1 two by two
range(n - 1, -1, -1) from n − 1 to 0 (−1 excluded) in decreasing order.

In early versions of Python, range returned a list. Nowadays, for efficiency, it


returns an object known as an iterator, which produces integers one by one, if and
when the for loop claims a value. Any function can serve as an iterator, as long
as it can produce elements at different moments of its execution using the keyword
yield. For example, the following function iterates over all pairs of elements of a
given list:.

def all_pairs(L):
n = len(L)
for i in range(n):
for j in range(i + 1, n):
yield (L[i], L[j])

1.2.3 Useful Modules and Packages


Modules
Certain Python objects must be imported from a module or a package with the
command import. A package is a collection of modules. Two methods can be used;
the second avoids potential naming collisions between the methods in different
modules:
10 Introduction

>>> from math import sqrt


>>> sqrt(4)
2
>>> import math
>>> math.sqrt(4)
2

math This module contains mathematical functions and constants such as log,
sqrt, pi, etc. Python operates on integers with arbitrary precision, thus there
is no limit on their size. As a consequence, there is no integer equivalent to
represent −∞ or +∞. For floating point numbers on the other hand, float(’-
inf’) and float(’inf’) can be used. Beginning with Python 3.5, math.inf (or
from math import inf) is equivalent to float(’inf’).
fractions This module exports the class Fraction, which allows computations
with fractions without the loss of precision of floating point calculations. For
example, if f is an instance of the class Fraction, then str(f) returns a string
similar to the form “3/2”, expressing f as an irreducible fraction.
bisect Provides binary (dichotomous) search functions on a sorted list.
heapq Provides functions to manipulate a list as a heap, thus allowing an element
to be added or the smallest element removed in time logarithmic in the size of
the heap; see Section 1.5.4 on page 22.
string This module provides, for example, the function ascii_lowercase, which
returns its argument converted to lowercase characters. Note that the strings
themselves already provide numerous useful methods, such as strip, which
removes whitespace from the beginning and end of a string and returns the
result, lower, which converts all the characters to lowercase, and especially
split, which detects the substrings separated by spaces (or by another separa-
tor passed as an argument). For example, “12/OCT/2018”.split(“/”) returns
[“12”, “OCT”, “2018”].

Packages
One of the strengths of Python is the existence of a large variety of code packages.
Some are part of the standard installation of the language, while others must be
imported with the shell command pip. They are indexed and documented at the web
site pypi.org. Here is a non-exhaustive list of very useful packages.

tryalgo All the code of the present book is available in a package called tryalgo
and can be imported in the following manner: pip install tryalgo.

>>> import tryalgo


>>> help(tryalgo) # for the list of modules
>>> help(tryalgo.arithm) # for a particular module

collections To simplify life, the class from collections import Counter can
be used. For an object c of this class, the expression c[x] will return 0 if x is not
1.2 Python in a Few Words 11

a key in c. Only modification of the value associated with x will create an entry
in c, such as, for example, when executing the instruction c[x] += 1. This is
thus slightly more practical than a dictionary, as is illustrated below.

>>> c = {} # dictionary
>>> c[’a’] += 1 # the key does not exist
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: ’a’
>>> c[’a’] = 1
>>> c[’a’] += 1 # now it does
>>> c
{’a’: 2}
>>> from collections import Counter
>>> c = Counter()
>>> c[’a’] += 1 # the key does not exist, so it is created
Counter({’a’: 1})
>>> c = Counter(’cowboy bebop’)
Counter({’o’: 3, ’b’: 3, ’c’: 1, ’w’: 1, ’y’: 1, ’ ’: 1, ’e’: 1, ’p’: 1})

The collections package also provides the class deque, for double-ended
queue, see Section 1.5.3 on page 21. With this structure, elements can be added
or removed either from the left (head) or from the right (tail) of the queue. This
helps implement Dijkstra’s algorithm in the case where the edges have only
weights 0 or 1, see Section 8.2 on page 126.
This package also provides the class defaultdict, which is a dictionary that
assigns default values to keys that are yet in the dictionary, hence a generalisa-
tion of the class Counter.

>>> from collections import defaultdict


>>> g = defaultdict(list)
>>> g[’paris’].append(’marseille’) # ’paris’ key is created on the fly
>>> g[’paris’].append(’lyon’)
>>> g
defaultdict(<class ’list’>, {’paris’: [’marseille’, ’lyon’]})
>>> g[’paris’] # behaves like a dict
[’marseille’, ’lyon’]

See also Section 1.3 on page 13 for an example of reading a graph given as
input.
numpy This package provides general tools for numerical calculations involving
manipulations of large matrices. For example, numpy.linalg.solve solves
a linear system, while numpy.fft.fft calculates a (fast) discrete Fourier
transform.

While writing the code of this book, we have followed the norm PEP8, which
provides precise recommendations on the usage of blanks, the choice of names for
variables, etc. We advise the readers to also follow these indications, using, for exam-
ple, the tool pycodestyle to validate the structure of their code.
12 Introduction

1.2.4 Interpreters Python, PyPy, and PyPy3


We have chosen to implement our algorithms in Python 3, which is already over
12 years old,2 while ensuring backwards compatibility with Python 2. The principal
changes affecting the code appearing in this text concern print and division between
integers. In Python 3, 5 / 2 is equal to 2.5, whereas it gives 2 in Python 2. The integer
division operator // gives the same result for both versions. As for print, in Python 2
it is a keyword, whereas in Python 3 it is a function, and hence requires the parameters
to be enclosed by parentheses.
The interpreter of reference is CPython, and its executable is just called python.
According to your installation, the interpreter of Python 3 could be called python or
python3. Another much more efficient interpreter is PyPy, whose executable is called
pypy in version 2 and pypy3 in version 3. It implements a subset of the Python
language, called RPython, with quite minimal restrictions, which essentially allow the
inference of the type of a variable by an analysis of the source code. The inconvenience
is that pypy is still under development and certain modules are not yet available. But
it can save your life during a contest with time limits!

1.2.5 Frequent Errors


Copy
An error often made by beginners in Python concerns the copying of lists. In the
following example, the list B is in fact just a reference to A. Thus a modification of
B[0] results also in a modification of A[0].

A = [1, 2, 3]
B = A # Beware! Both variables refer to the same object

For B to be a distinct copy of A, the following syntax should be used:

A = [1, 2, 3]
B = A[:] # B becomes a distinct copy of A

The notation [:] can be used to make a copy of a list. It is also possible to make a
copy of all but the first element, A[1 :], or all but the last element, A[: −1], or even
in reverse order A[:: −1]. For example, the following code creates a matrix M, all of
whose rows are the same, and the modification of M[0][0] modifies the whole of the
first column of M.

M = [[0] * 10] * 10 # Do not write this!

2 Python 3.0 final was released on 3 December, 2008.


1.3 Input-Output 13

A square matrix can be correctly initialised using one of the following expressions:

M1 = [[0] * 10 for _ in range(10)]


M2 = [[0 for j in range(10)] for i in range(10)]

The module numpy permits easy manipulations of matrices; however, we have cho-
sen not to profit from it in this text, in order to have generic code that is easy to translate
to Java or C++.

Ranges
Another typical error concerns the use of the function range. For example, the follow-
ing code processes the elements of a list A between the indices 0 and 9 inclusive, in
order.

for i in range(0, 10): # 0 included, 10 excluded


process(A[i])

To process the elements in descending order, it is not sufficient to just swap the
arguments. In fact, range(10, 0, -1)—the third argument indicates the step—is the
list of elements with indices 10 (included) to 0 (excluded). Thus the loop must be
written as:

for i in range(9, -1, -1): # 9 included, -1 excluded


process(A[i])

1.3 Input-Output

1.3.1 Read the Standard Input


For most problems posed by programming contests, the input data are read from
standard input, and the responses displayed on standard output. For example, if the
input file is called test.in, and your program is prog.py, the contents of the input
file can be directed to your program with the following command, launched from a
command window:

python prog.py < test.in

In general, under Mac OS X, a command window can be obtained


by typing Command-Space Terminal, and under Windows, via
>_
Start → Run → cmd.
If you are running Linux, the keyboard shortcut is generally Alt-
F2, but that you probably already knew. . .
14 Introduction

If you wish to save the output of your program to a file called test.out, type:

python prog.py < test.in > test.out

A little hint: if you want to display the output at the same time as it is being written
to a file test.out, use the following (the command tee is not present by default in
Windows):

python prog.py < test.in | tee test.out

The inputs can be read line by line via the command input(), which returns the
next input line in the form of a string, excluding the end-of-line characters.3 The
module sys contains a similar function stdin.readline(), which does not suppress
the end-of-line characters, but according to our experience has the advantage of being
four times as fast!
If the input line is meant to contain an integer, we can convert the string with the
function int (if it is a floating point number, then we must use float instead). In
the case of a line containing several integers separated by spaces, the string can first be
cut into different substrings using split(); these can then be converted into integers
with the method map. For example, in the case of two integers height and width to be
read on the same line, separated by a space, the following command suffices:

import sys

height, width = map(int, sys.stdin.readline().split())

If your program exhibits performance problems while reading the inputs, our expe-
rience shows that a factor of two can be gained by reading the whole of the inputs with
a single system call. The following code fragment assumes that the inputs are made
up of only integers, eventually on multiple lines. The parameter 0 in the function
os.read means that the read is from standard input, and the constant M must be an
upper bound on the size of the file. For example, if the file contains 107 integers,
each between 0 and 109 , then as each integer is written with at most 10 characters
and there are at most 2 characters separating the integers (\n and \r), we can choose
M = 12 · 107 .

3 According to the operating system, the end-of-line is indicated by the characters \r, \n, or both, but this
is not important when reading with input(). Note that in Python 2 the behaviour of input() is
different, so it is necessary to use the equivalent function raw_input().
1.3 Input-Output 15

import os

instance = list(map(int, os.read(0, M).split()))

Example – Read a Graph on Input


If the inputs are given in the form:

3
paris tokyo 9471
paris new-york 5545
new-york singapore 15344

where 3 is the number of edges of a graph and each edge is represented by


<departure> <arrival> <distance>, then the following code, using defaultdict
to initialise the new keys in an empty dictionary, allows the construction of
the graph:

from collections import defaultdict

nb_edges = int(input())

g = defaultdict(dict)
for _ in range(nb_edges):
u, v, weight = input().split()
g[u][v] = int(weight)
# g[v][u] = int(weight) # For an undirected graph

Example—read three matrices A,B,C and test if AB = C


In this example, the inputs are in the following form: the first line contains a single
integer n. It is followed by 3n lines each containing n integers separated by spaces,
coding the values contained in three n × n matrices A,B,C, given row by row. The
goal is to test if the product A times B is equal to the matrix C. A direct approach
by matrix multiplication would have a complexity O(n3 ). However, a probabilistic
solution exists in O(n2 ), which consists in randomly choosing a vector x and testing
whether A(Bx) = Cx. This is the Freivalds test (1979). What is the probability that
the algorithm outputs equality even if AB = C? Whenever the computations are
made modulo d, the probability of error is at most 1/d. This error probability can
be made arbitrarily small by repeating the test several times. The following code has
an error probability bounded above by 10−6 .
16 Introduction

from random import randint


from sys import stdin

def readint():
return int(stdin.readline())

def readarray(typ):
return list(map(typ, stdin.readline().split()))
def readmatrix(n):
M = []
for _ in range(n):
row = readarray(int)
assert len(row) == n
M.append(row)
return M

def mult(M, v):


n = len(M)
return [sum(M[i][j] * v[j] for j in range(n)) for i in range(n)]

def freivalds(A, B, C):


n = len(A)
x = [randint(0, 1000000) for j in range(n)]
return mult(A, mult(B, x)) == mult(C, x)

if __name__ == "__main__":
n = readint()
A = readmatrix(n)
B = readmatrix(n)
C = readmatrix(n)
print(freivalds(A, B, C))

Note the test on the variable __name__. This test is evaluated as True if the file
containing this code is called directly, and as False if the file is included with the
import keyword.

Problem
Enormous Input Test [spoj:INTEST]

1.3.2 Output Format


The outputs of your program are displayed with the command print, which produces
a new line with the values of its arguments. The generation of end-of-line characters
can be suppressed by passing end=‘’ as an argument.
1.4 Complexity 17

To display numbers with fixed precision and length, there are at least two pos-
sibilities in Python. First of all, there is the operator % that works like the func-
tion printf in the language C. The syntax is s % a, where s is a format string, a
character string including typed display indicators beginning with %, and where a
consists of one or more arguments that will replace the display indicators in the format
string.

>>> i_test = 1
>>> answer = 1.2142
>>> print("Case #%d: %.2f gigawatts!!!" % (i_test, answer))
Case #1: 1.21 gigawatts!!!

The letter d after the % indicates that the first argument should be interpreted as an
integer and inserted in place of the %d in the format string. Similarly, the letter f is
used for floats and s for strings. A percentage can be displayed by indicating %% in
the format string. Between the character % and the letter indicating the type, further
numerical indications can be given. For example, %.2f indicates that up to two digits
should be displayed after the decimal point.
Another possibility is to use the method format of a string, which follows the
syntax of the language C#. This method provides more formatting possibilities and
is in general easier to manipulate.

>>> print("Case #{}: {:.2f} gigawatts!!!".format(i_test, answer))


Case #1: 1.21 gigawatts!!!

Finally, beginning with Python 3.6, f-strings, or formatted string literals, exist.

>>> print(f"Case #{testCase}: {answer:.2f} gigawatts!!!")


Case #1: 1.21 gigawatts!!!

In this case, the floating point precision itself can be a variable, and the formatting
is embedded with each argument.

>>> precision = 2
>>> print(f"Case #{testCase}: {answer:.{precision}f} gigawatts!!!")
Case #1: 1.21 gigawatts!!!

1.4 Complexity

To write an efficient program, it is first necessary to find an algorithm of appropriate


complexity. This complexity is expressed as a function of the size of the inputs. In
order to easily compare complexities, the notation of Landau symbols is used.
18 Introduction

Landau Symbols
The complexity of an algorithm is, for example, said to be O(n2 ) if the execution time
can be bounded above by a quadratic function in n, where n represents the size or some
parameter of the input. More precisely, for two functions f ,g we denote f ∈ O(g)
if positive constants n0,c exist, such that for every n ≥ n0 , f (n) ≤ c · g(n). By an
abuse of notation, we also write f = O(g). This notation allows us to ignore the
multiplicative and additive constants in a function f and brings out the magnitude and
form of the dependence on a parameter.
Similarly, if for constants n0,c > 0 we have f (n) ≥ c · g(n) for every n ≥ n0 , then
we write f ∈ (g). If f ∈ O(g) and f ∈ (g), then we write f ∈ (g), indicating
that f and g have the same order of magnitude of complexity. Finally, if f ∈ O(g)
but not g ∈ O(f ), then we write f ∈ o(g)

Complexity Classes
If the complexity of an algorithm is O(nc ) for some constant c, it is said to be polyno-
mial in n. A problem for which a polynomial algorithm exists is said to be polynomial,
and the class of such problems bears the name P. Unhappily, not all problems are
polynomial, and numerous problems exist for which no polynomial algorithm has
been found to this day.
One such problem is k-SAT: Given n Boolean variables and m clauses each
containing k literals (a variable or its negation), is it possible to assign to each variable
a Boolean value in such a manner that each clause contains at least one literal with the
value True (SAT is the version of this problem without a restriction on the number of
variables in a clause)? The particularity of each of these problems is that a potential
solution (assignment to each of the variables) satisfying all the constraints can be
verified in polynomial time by evaluating all the clauses: they are in the class NP
(for Non-deterministic Polynomial). We can easily solve 1-SAT in polynomial time,
hence 1-SAT is in P. 2-SAT is also in P; this is the subject of Section 6.9 on page 110.
However, from 3-SAT onwards, the answer is not known. We only know that solving
3-SAT is at least as difficult as solving SAT.
It turns out that P ⊆ NP—intuitively, if we can construct a solution in polynomial
time, then we can also verify a solution in polynomial time. It is believed that
P = NP, but this conjecture remains unproven to this day. In the meantime,
researchers have linked NP problems among themselves using reductions, which
transform in polynomial time an algorithm for a problem A into an algorithm for a
problem B. Hence, if A is in P, then B is also in P: A is ‘at least as difficult’ as B.
The problems that are at least as difficult as SAT constitute the class of problems
NP-hard, and among these we distinguish the NP-complete problems, which are
defined as those being at the same time NP-hard and in NP. Solve any one of these
in polynomial time and you will have solved them all, and will be gratified by eternal
recognition, accompanied by a million dollars.4 At present, to solve these problems
in an acceptable time, it is necessary to restrict them to instances with properties

4 www.claymath.org/millennium-problems/p-vs-np-problem
Another Random Scribd Document
with Unrelated Content
France, under the leadership of Poincaré, scoffed from the
beginning at the League of Nations, although supporting it over the
Corfu incident, and although one representative, M. Léon Bourgeois,
was a loyal friend of the League idea. After the refusal of the United
States to ratify the pact of security for France against another war of
German aggression, followed by the withdrawal of Great Britain, the
France of Poincaré saw no safety except in the power of her Army in
alliance with other forces which she could link in a military chain
around her defeated enemies. No one ought to blame France for
that philosophy, in view of her agony and her future peril. But it
resulted inevitably in actions which checked the recovery of Europe,
aroused all the old hatreds, filled the defeated peoples with a sense
of profound injustice, and raised the old devils of national pride,
vengeance, and belief in force which for a time had been banished
to the houses of the German Junkers and had lain low in German
hearts. It was the cause of increasing friction, spasms of passionate
ill-will, between France and England, and a long campaign of
scurrilous abuse in the French Press which poisoned the old Entente
Cordiale, wiped out the memories of war comradeship, and was a
tragic and painful chapter in recent history.
France under Poincaré demanded her pound of flesh from
Germany, including the lifeblood of the German people in the
arteries of its economic health. Germany could not recover nor,
before recovering, pay. Afterwards, when the Ruhr was invaded,
their chief source of wealth and of payment was strangled. The
French objects of “security” and “reparations” were in hopeless
antagonism, and defeated each other. There could be no
reparations, on a large scale, if French security demanded the
expulsion of those who directed and worked the Ruhr and its
railways. There could be no “security” for France in the long run if,
instead of German reparations, she goaded the German people into
nationalism and a war of vengeance by every means, fair or foul.
While the policy of Poincaré was dominant, Europe sank deep into
despair, and the nations most stricken by war saw no hope of
revival.
The first three years after the world war provided terrible proofs of
the disaster which had happened to humanity in that deadly
struggle. Those who wish to convince the future generations of the
devastating effect of modern warfare upon highly organised nations,
as a frightful warning, must summon up the picture of Europe in
1919, 1920 and 1921. I saw it from end to end, and it haunted me.

The Russian Revolution

On the Eastern side of Europe Russia was cut off from the family
of nations and lay prostrate. Civilisation itself had gone down there
in anarchy and misery, and its new government of Bolsheviks were
ruling over a hundred million people, hungry, diseased, stricken,
crushed in spirit, weak in body, overcome by melancholy and inertia.
They had broken first under the strain of war. Four million of their
men had died in the fields of slaughter and their labour had been
taken from the fields. Corruption beyond words, treachery in high
places, inefficiency amounting to murder, had aroused a spirit of
revolt amongst soldiers sent forward without arms to fight against
men with whom, individually, they had no lasting cause of quarrel;
peasants like themselves, gun-fodder like themselves, for ambitions
and hatreds which they did not share. They turned to rend their own
leaders and made a pact at any price with the enemy outside. All the
explosive forces of passion which had been stored up in centuries of
tyranny by a brutal Tsardom and its Governors burst out against its
present representatives, although the last Tsar was a gentle man
who loved his people. Old dreams of liberty, new philosophies of
democracy, united for a time to overthrow the Government and all
its powers. Revolution, bloody and cruel, raged in Russia, and the
beast leapt up in peasant minds. Kerensky tried to control this
anarchy but was swept on one side like a straw by stronger forces.
Lenin and his crowd took command, and their new philosophy of
Communism, fair-sounding, theoretically righteous, based upon the
principles of equality and brotherhood and peace, put a spell upon
the simple minds of the Russian folk. All opponents, critics, doubters,
were destroyed relentlessly. Lenin and his friends, having taken
command of the new machinery of Government by Soviet
committees, were in supreme power over a people unarmed, half-
starving, and submissive to those who had broken their old chains.
It was some time before the Russian folk were aware of the fetters
which enslaved them, and of a tyranny over their minds and bodies
more ruthless than that of Tsardom. They were denied freedom of
speech, freedom of knowledge, freedom of movement. The
newspapers published the news of the world according to Lenin. The
schools taught economic history according to Karl Marx and world
history according to Soviet philosophy. Trotsky fashioned a Red Army
in which discipline was more severe than under the Grand Duke
Nicholas. The prisons were filled with people of all classes who came
under the notice of the secret police. Execution became a habit.
There was a Reign of Terror undoubtedly as bad as that of the
French Revolution of 1793.
For a time the people as a whole were keyed up to a new
enthusiasm for what they believed to be a democratic system of
Government by attacks from the “White Armies” of the old Royalists,
financed, armed and organised by foreign powers, and especially by
France and Great Britain. As Republican France had risen against the
armies of the emigrés, so Soviet Russia rallied against the armies of
Koltchak, Denikin, Wrangel and others, and defeated them
overwhelmingly. After that the Reign of Terror abated somewhat,
internal revolt died down, and the gospel of Communism was seen
at work in conditions of peace.
It failed to work. It was all very well for the Communists to hand
out tickets for bread, clothes, boots, education and operas to all
those who were registered for service to the State, but those who
presented the tickets found that there was not enough bread to go
round, that no clothes or boots were forthcoming, that education is
a poor thing on empty stomachs in schools where the teachers died
of starvation, and that the opera, beautiful as it continued to be, was
not nourishing after a day of hunger. The workers fled from the
factories because they could get no food. In the fields the peasants
resisted the soldiers who tried to requisition their grain for the cities.
Transport broke down. Grass grew on the railways. Horses and cattle
died for lack of fodder. Typhus was rampant for lack of soap,
medicines, decent conditions of life. Then famine struck the Volga
region after two summers of drought. Twenty-five million people
were threatened with death by actual starvation, and all over Russia
there was hunger, fear, and despair.
From the famine districts the roads were black with fugitives
moving to districts where they hoped to find food, while, from those
very districts, people were trekking away from barren fields. Parents
abandoned their children. When I went down the Volga the people
were eating dried leaves, chopped straw and clay. The children were
dying. The old people awaited death. And far away in Petrograd and
in Moscow the factories were deserted, the hospitals were stone cold
for lack of fuel, and there was not a single man or woman who had
any comfort of body or soul.
Communism had failed. Its failure was proclaimed by Lenin
himself. Russia was in extremis after a war which had broken the
machinery of its life and a revolution which had failed to fulfil any of
its promises, except equality—in misery.
That downfall of Russia was the worst thing in Europe, and was
the cause of some of its general poverty. Trade was cut off from a
hundred million people. Their purchasing power had been
extinguished, so that neighbouring countries could not sell to them.
Their own sources of wealth had perished, so that neither wheat nor
oil nor flax could be exchanged for manufactured goods. The wealth
of the world was so much less.
At that time the new Baltic States were unable to support
themselves on any decent standard of life. Their children also were
underfed. No trade came into the port of Riga, which once had been
busy with the world’s merchandise.
In Poland there was the spiritual warmth of national
independence, but not much else. Misery was widespread. Food for
the army was taken from the people. Commerce was stagnant,
industry at a standstill. Germany was not buying from Poland. Poland
could not buy from Germany or Russia. Underneath its new military
ardour there was desperate need in the homes of the workers.

The Agony of Austria

In Austria there was utter hopelessness, and the health of the


people was breaking down. The Reparations Commission, under Sir
William Goode, established to exact indemnities, saw the folly of
such action and became a Relief Mission to save the life of those
people, the most charming and brilliant and civilised in Central
Europe, before they sank under the doom pronounced upon them by
a Treaty of Peace which had left them with the capital city of a great
Empire from which the Empire had been lopped. I went into the
Austrian hospitals, homes, babies’ crèches, and children’s clinics, and
saw little Austrian children so weak from under-nourishment that
they could not sit up in bed and crippled with rickets. Children of
three and four had no solid bone in their bodies, but only gristle.
Where their arms were crossed at night there were deep sunken
hollows. Sixty-eight per cent. of the Austrian children were in a state
of semi-starvation in the year that followed war.

The German People

In Germany it was not so bad—but bad. For the last year of the
war the people had been reduced to the bare limits of food supply.
After the war, when the blockade was maintained until the signature
of peace, the children went without milk and fats and there was
general shortness of provisions, not amounting to actual starvation,
but weakening the working men and women. Factory workmen told
me that they never ate meat, and existed on bread and potatoes. It
was enough for life, they said, but not enough for physical strength.
They felt tired. Women fainted in the tramcars. There was stinting
and scraping in every home, except those of the “profiteers,” who by
some genius of finance were making a good thing out of the fall of
the mark.
Coming across Europe like that, and seeing the spreading track of
financial and commercial ruin, the lowering of the standard of life in
many countries where it had been high and splendid, the loss of
purchasing power for anything but the barest necessities, and all the
new frontiers and customs lines between new States and old States,
checking the free interchange of goods, slowing down world trade,
an observer like myself was staggered by the gravity of this state of
things. It seemed to me that we were all heading for disaster. I was
convinced that all those fair promises of quick prosperity, German
reparations, revival of British trade, stabilising of international
exchanges, would be utterly falsified unless there was a new co-
operation among the countries of Europe on lines of economic
commonsense, and a truce to the policy of demanding from the
defeated countries immense sums of money beyond their ability to
pay. It seemed to me very clear that if Germany went down into real
economic disaster the whole of Europe would go down too, and that
what was wanted most was not payment of fantastic reparations but
a return to the normal exchange of goods and energy. I was afraid
for England.

The British Illusion

The British Government, after the Armistice and the uncertain


Peace, had behaved for a while as though victory had re-established
her old strength. Superficially, indeed, and in moral prestige, among
the nations of the world, the British Empire had emerged stronger
than before the war. The menace of the German fleet was at the
bottom of the sea. New territories in Africa had come under British
dominion. British spheres of influence had been extended through
Palestine, Mesopotamia and Persia. But those new “mandates” were
a source of weakness and not of power. They were very costly at a
time when there was no money to spend on new adventures in
Imperialism. At least the vast sums of money poured into
Mesopotamia and other Eastern territories on extravagant
administration and development could not be justified to British
taxpayers confronted by a staggering bill of costs for war purposes
which drained the old reserves of wealth. British statesmen, not yet
taught the elementary lessons of economic law, behaved with a kind
of splendid madness, as though a new Golden Age had arrived in
which their people would possess an Oriental Empire such as
Alexander had carved out of the old world. They forgot, or did not
know, that poverty and something like industrial ruin was creeping
over English life. They did not realise that after a devastating war
they could not call upon the last reserves of manhood to support
military adventures in far lands. They did not understand that the
effects of war in Europe from the Rhine to the Volga, and beyond,
had so lowered the purchasing power of the defeated peoples, the
neutral countries and the new States, that Great Britain, for a long
time to come, would lose many of her old markets for the export
trade upon which her life depended, as well as the shipping of the
world’s merchandise from port to port which had been so great a
source of her old wealth. Winston Churchill, with his restless
imagination and wide-reaching Imperialism dreamed dreams of
British rule extending from the Cape to Cairo and from Tooting to
Tibet. Even Lloyd George, for a little while, was intoxicated with the
magnificence of the victory in which he claimed a chief share, not to
be denied in history in spite of some blunders and a feud with the
Army Chiefs.

The Lesson of Reality

Then, quicker than in France, all this illusion was smashed in the
face by reality. The British nation became aware of its dwindling
trade, the stagnation of its industry. Unemployment began to creep
up in a steady tide, until two million men were out of work and
existing only on Government “doles.” Factories were closing down or
working half time. The Mersey, the Clyde and the Thames were
crowded with ships without cargoes, and all the ports were filled
with seamen without berths. After demobilisation ex-officers as well
as men could not find jobs to do. They tramped the streets in search
of work, wearing out their boots and their hearts. They played
piano-organs, moved in dismal processions with banners flying the
words “We want work,” shook street collecting boxes in the faces of
the passers-by. The Trade Unions were hard and selfish. They
refused to admit untrained labour to their ranks. Without Trade
Union tickets men who had saved the country were turned away at
the factory gates. Labour put up a fierce fight to maintain the
standard of wages and of life which had been established in time of
war—no longer possible in time of peace with failing markets and a
world in ruin. One cannot blame them. None of us likes to reduce his
standard of life and go back to miserable conditions of stint and
scrape. Strikes and lockouts beat them down, but did not relieve the
strain or increase the nation’s wealth. Things looked very serious
below the surface of English life. There was a bitterness in the minds
of men who had been promised great rewards for heroic service,
and now found themselves destitute, in overcrowded slums—where
were the “homes for heroes”?—maintained on a miserable “dole”
that just saved them from starvation but was not enough for decent
life. There was for a year or so a danger of revolt, a spreading of
revolutionary ideas, among men like that. Russian Communism put a
spell upon many minds who knew nothing of the agony in Russia but
were stirred by the Bolshevik doctrine of equality and the
“dictatorship of the proletariat.”
When Germany failed to pay the immense reparations which had
been demanded from her the British Government was faced with the
necessity of balancing its yearly Budget without those payments,
and, unlike France, which still banked upon them, or like Germany,
which created false money by inflation, determined to sustain the
national credit by taxation and sound finance. It put the most
tremendous burden upon the nation that has ever been sustained by
any people in modern history. It was accepted with a resignation and
courage which will stand for ever to the credit of the British folk, and
especially to the credit of those who paid at the cost of all that was
dearest to them in life apart from national honour and family blood.
Income Tax, Super Tax, and Death Duties fell upon the people who
lived on inherited wealth with a terrifying ferocity. There are only
two and a half million people in Great Britain who pay any Income
Tax at all, and only eighty-five thousand who are subject to Super
Tax, but it was from that small minority that the Government
demanded the revenue necessary for the upkeep of its services. It
caused, and is causing, a social revolution which is changing the
whole aspect of English life. The old aristocracy are abandoning their
houses, selling their estates, becoming shabby genteel, losing their
old splendour, prerogatives and power. To pay their Income Tax and
Death Duties they are eating into their old capital, selling the old
pictures on their walls, abandoning old mansions haunted by the
ghosts of history in which their pride and spirit dwelt. They have
done this not without anguish, not without a sense of tragedy, not
without bitterness, but with an acknowledgment of inevitable
necessity. Bloodlessly the revolution in England is being
accomplished, though the hard road has not yet been travelled to
the end.

The Price of War

More crippling in its effects upon the nation as a whole was the
taxation of capital in trade and industry. At a time when it was most
necessary to limit the costs of production and to stimulate the
adventure of trade, the business world was crushed under a burden
of taxation which limited its reserves, put heavy charges upon the
cost of manufacture, and reduced the capital available for new
enterprise. The price of war, and of victory, lay with an almost
intolerable weight upon the spirit of the British people, even before
they had to shoulder the burden—rejected by every other nation—
the payment of War Debt to the United States of America,
amounting to £35,000,000 sterling every year. With an export trade
less than 75 per cent. of what it reached before the War, with a
population which had increased by nearly two millions in spite of all
the slaughter, with new and ruinous expenses, and with a higher
standard of life demanded by the labouring class, the people of
Great Britain breathed hard, became very anxious, faced up to
realities, and saw, with almost blinding clarity of vision, that their
own national life depended upon the peace and recovery of Europe,
including that of Germany and the defeated peoples. This realisation
changed their whole attitude of mind towards the problem of peace.
It made them draw farther and farther away from the French policy
of Poincaré, which was based upon the prevention of German
recovery and “security” by military force. But above all these
financial considerations England believed in fair play even to a
defeated foe, in generosity rather than vengeance, and in future
peace by conciliation rather than by a military combination which
one day would be challenged in another “inevitable” war, more
ghastly than the last. All that sounded like weakness and treachery
to the mind of France. The Entente Cordiale was strained and
broken....

Physical Recovery in Europe

In many ways the recovery of Europe was more rapid in its


fundamental needs of life than seemed possible after the
devastation of war. Human energy, faith and hope repaired the
material damage of war in an almost miraculous degree. Walking
day by day across the battlefields of France and Flanders it seemed
impossible to me and to all others that the ground upheaved by high
explosives, criss-crossed with deep trenches, and sown with
unexploded shells would return within the lifetime of the present
generation to harvest fields and pleasant pasture. It was incredible
that all those villages blown off the map, so that there were only
rubbish heaps to mark their site, should be rebuilt within half a
century with new walls and sheltering roofs for the people who had
fled from them.
I never expected to see a new city of Ypres, or to walk past shop
windows in Arras, or to see a harvest gathered on the outskirts of a
new Peronne. The infernal track of war from Belgium to Switzerland,
littered with dead bodies and the wreckage of battle, could not be
wiped out, I thought, from the eyes of living men. But that has
happened at least along some parts of the line ten years after. There
are red roofs and busy streets in Ypres and Arras. The fields are
smooth and green around Peronne. There are houses at
Passchendaele. It is difficult to see the scars of war in Amiens. It is
hard to find trenches and dug-outs or places where monstrous
battles happened beyond the Menin Gate of Ypres or down by Lens,
beyond the Vimy Ridge. Peasants dug out the unexploded shells.
The trenches silted in or were ploughed in. The Belgians were as
busy as bees when they returned to the hive. French contractors
hired Poles and Czechs to supplement their French labour and made
enormous fortunes in the reconstruction of destroyed towns at the
cost of the French Government, which accepted all their claims until
an orgy of corruption broke all bounds. In East Prussia, destroyed by
Russian cavalry, little red houses were put up even more quickly
because of German industry. In Italy many wounds were hidden and
healed. There is still much work to be done, especially in France,
most terribly mutilated; but, ten years after, the work of
reconstruction by the energy of men and women, desperate in their
desire to blot out the years of agony and get back to peaceful
labours and their old home life, is a splendid victory over the forces
of destruction. Life triumphs over death, as always in history.
So also the stricken peoples staggered up from the bog of misery
into which they were deep sunk after war. The land saved the cities,
and the peasants found the source of life in the kind earth again.
One nation above all helped them to tide over the lean years and
live until they could reap new harvests. Without that rescue, millions
more would have died and Europe would have been swept by
pestilence and famine. The people of the United States did a work of
charity on behalf of the starving folk of Europe, more especially in
the rescue of the starving children, which absolves them, if they
need absolution, from the charge of utter selfishness and
indifference to the sufferings of that Europe from which they drew
back in a policy of isolation.
It is one of the paradoxes of recent history that while the
American people, hardened against the Wilson ideal of co-operation
with Europe, drew away from the League of Nations as an accursed
thing with which they would have no part or lot, and reasserted the
Monroe Doctrine with a new interpretation of narrow exclusiveness,
they gave with their left hand, nearest to the heart, what their right
hand refused. Publicly they said, “Let Europe stew in its own broth.”
Privately they poured out their dollars in charity for European relief.

The “A.R.A.”

Early in the War the American Relief Administration, organised by


Herbert Hoover, fed day by day many millions of people in the areas
of enemy occupation. A great deal of these food supplies were
contributed by Great Britain, Canada, Australia, and other countries,
as it is only fair to say, but the American contributions were
enormous, and the organisation by American officials was a model of
efficiency and zeal. As soon as the War ended, the A.R.A., as
Hoover’s administration was universally known, extended its
operations and intensified its appeals to the charity of the American
people on behalf of the stricken populations on both sides of the war
zone. The American Government supported this work by immense
subsidies of surplus stocks, which perhaps was good business as
well as good will. But the good will was there, and it was reinforced
by a volume of generosity which welled up from an almost
inexhaustible source of private charity. The A.R.A. sent its officers
and its food trains into Austria, Germany, Poland, Czecho-Slovakia,
Serbia, Hungary, Armenia, Esthonia, Latvia, Lithuania, and many
other countries. It established feeding centres and kitchens in the
most necessitous cities and areas. It measured millions of children
by a rough-and-ready system which showed the standard of under-
nourishment and vital debility. It rushed food out to the innocent
victims of war’s cruelty, and helped, prodigiously, to save the world’s
childhood, without distinction of race, religion or politics. It was a
divine work, inspired by God’s love, after four years of hate and
horror. In Europe other societies, like the Save the Children Fund,
the Society of Friends, the Imperial Relief Committee, and the
International Red Cross, did splendid work too, with less means and
out of increasing poverty, on behalf of all this mass of human
suffering left as the heritage of war, but the A.R.A. was the most
powerful crusade of rescue, and by its far-reaching aid did
undoubtedly give the stricken peoples time and chance to recover
their power of self-subsistence after a period when physical
weakness, moral despair, and the ravages of war had deprived them
of the means of life above the hunger line.
It was when famine took possession of the most fertile territories
of Russia that the A.R.A. did its greatest work. In the United States
of America, as in England and France, the cry for help that came out
of Russia, so long cut off from human intercourse, so long hidden by
closed doors behind which lay the tragedy of a great people, many
men and women, shocked to their inmost soul by stories of
Bolshevik atrocities, refused to listen to the voice of charity. Many
were certain that any food or help sent to Russia would be used by
the Communist leaders to save themselves from destruction or to
support the Red Army and the Reign of Terror. In any case, as some
of them said, why feed Russian peasants who have adopted the
pernicious philosophy of Bolshevism, or submitted to it; and why
feed Bolshevik babies who will grow up to threaten the civilised code
of decent peoples? Let Russia pay the penalty of its atrocious crimes.
There was no country in the world where there was a greater
loathing of Bolshevism than in the United States. It was to the
majority of American citizens, as it is still, the Unspeakable Thing,
because it denied the rights of private property, declared war upon
Capital, and conspired for the overthrow of all Governments based
upon the Capitalist system. So much the more wonderful then is the
charity of those people who, with that enormous prejudice in their
minds, heard the voice of charity.

The Russian Famine

I went into Russia with some of the first officials of the A.R.A. and
travelled with them to the Volga region, where twenty-five million
people were threatened with starvation and starving. It was
Governor “Jim” of Indiana—Governor Goodrich—whose wise,
temperate and humane report was a document which helped to save
those millions. I read it as he had written it in a slow-going train
from Kazan to Moscow on the way back from dreadful scenes, and I
gave the homage of my heart to that serene-eyed man who, with
one lame leg, travelled through Russia on a diet of apples, went
fearlessly into typhus-stricken places, and saw all things with a great
pity, sound commonsense, practical judgment, large humanity.
He was only an observer. Colonel Haskell and his little band of
officers were the organisation and the administration in the field of
action, of a great campaign of rescue which flowed out from
America. They had to contend with the inertia of Russian character,
with the suspicion of Soviet officials who feared a political purpose
behind the work of charity, with a broken-down railway system, with
no material for printing or packing, with immense distances and lack
of transport, with the Russian language and bad interpreters, with
Russian labour weakened by being under-nourished, and with
millions of starving and disease-stricken people who had hardly the
strength or will to help themselves or co-operate with others for
their own rescue. It was a formidable adventure in which the young
officers of the A.R.A.—like those of our British relief societies—risked
their lives by disease and were strained to the utmost of nervous
energy. And they brought the food to Russia and distributed it to the
starving folk. Millions died—Dr. Nansen reckons four millions—but
eleven million people were fed every day by the A.R.A. for nearly a
year. In addition to that mass relief, millions of food packages
addressed to individuals in Russia by relations and friends in the
United States reached the starving and distressed people outside the
area of actual famine, and gave new hope of life to those who had
been reduced to misery and despair in Petrograd, Moscow, and other
cities. When we think of the organisation and labour required in time
of war to feed our armies in the field, it is almost miraculous that
eleven million Russian peasants could be supplied at a distance of
6,000 miles, after the breakdown of the very machinery of their life.
History will record it as the greatest campaign of relief and
international charity ever attempted or achieved.
It is only right to say that, after the first suspicions had been
overcome, the Soviet Government and its officials played fair and did
all they could to facilitate this work. The food did reach the starving
children and their parents. The railways and engines were repaired.
Trucks were built. A new hope dawned in Russia, which learnt
something from American methods of efficiency. The Reign of Terror
had worn itself out, the actual practice of Communism was
abandoned, the rights of private property and private trading were,
to some extent, restored, a great shadow passed from the spirit of
the people, and in many ways life became endurable after the years
of agony. The utter failure of the Communist experiment was
acknowledged by Lenin within Russia itself, though its propaganda
and revolutionary doctrines were still used to stir up trouble in the
outside world. Slowly the life of the Russian people staggered up
from misery, and although there is still great distress in many
districts and a new threat of famine, the ninety million peasants,
controlled by a small body of Communists whose economic
philosophy has no appeal for them, are getting a bare life out of the
soil, with now and then a surplus of grain for export in return for
manufactured goods. Even Russia is on the road to recovery.
Other countries revived, at least to the extent of providing their
own means of subsistence, in peasant states like those of the new
Baltic nations. Even international trade recovered some of its old
activity in countries, like Czecho-Slovakia, newly carved out of the
old Austrian Empire and successors to its sources of industrial
energy. But it was impossible to hope for any general and complete
recovery of trade conditions in Europe so long as there was no
stability in the value of monetary exchange and no political peace.
The printing presses in many countries were issuing paper money
which had no reality behind it, and the time came when it proved
worthless either for internal commerce or for foreign business.
Russian roubles had long ceased to have any purchasing power. A
million roubles brought from Moscow would not buy a glass of
schnapps in Riga.
The Relief of Austria

In Austria money went the same way. The Austrian kronen,


unsupported by gold or goods, became a mockery in the markets of
the world and in Vienna itself. The professional classes were dying of
starvation, the middle classes were reduced to an extreme
destitution; labour, paid false wages, had no heart to work. Several
loans granted by the British Government and others, after
abandoning all immediate claims to “reparations,” withered away in
supporting crowds of needy officials and struggling with financial
chaos. Austria declared itself a bankrupt State, appealing to the
world for help, and at last her immense distress was recognised by
all other States, and the League of Nations was entrusted with the
task of administering a new loan of something like fifteen millions
sterling, with a strict control of Austrian revenue, expenditure,
taxation, and financial measures.
It was a lesson to the world of what may be done by good will
and commonsense rather than by political hatred and international
hostility. As a foster child of the League of Nations, Austria recovered
in a way which seemed beyond hope. As soon as her money was
stabilised to a fixed value, because of its gold backing, trade began
to flow back a little, capital came to the rescue, with a sense of
security. The Austrian people were able to buy food in return for
their merchandise at prices which no longer fluctuated wildly
according to the downfall of paper money. They were able to accept
contracts for future work and to fulfil them with a certainty that the
money they received would not melt in their hands like summer
snow. They recovered hope, worth more than gold, and physical
strength restored their mental and moral health. The nightmare
lifted. The city of Vienna to-day, in spite of much poverty and a
disappearance of its former luxury among the old classes who dwelt
in the splendour of Imperial Courts, is as different from Vienna in
1920 as the day from the night. The Viennese, once the gayest
people in Europe, have learnt to laugh again. There is music in the
cafés once more. The streets are lighted again. The children are no
longer weak with rickets. The bitter cup has passed from them,
except for those who remember their former state and the old world
of the Austrian Empire that has gone down with all its pride.

The Problem of Germany

Germany remained the great problem of Europe and the great


peril.
After the war, when “something seemed to break in them,” as a
German wrote to me, they were for a time stunned and dazed by
defeat. To German pride of race it seemed incredible, even in the
face of dreadful facts, that they had lost everything for which they
had fought and struggled with such desperate and stubborn will-
power. After all their victories! After all that slaughter! “Deutschland
über Alles!” Now they were in chains, hopeless and helpless,
disarmed, under the heel of France, Britain, Belgium—done and
down!
The military chiefs hid themselves in their castles—sullen, broken.
They put all the blame on the German people. It was they who had
blundered and had been defeated. The invincible German armies
had never been defeated. Never! Only Ludendorff in an incautious
book confessed the truth that he had not been able to hold the line
against the overwhelming assault of the Allies. But his argument was
the same. It was German will-power that had broken behind the
lines. It was Bolshevism and Pacifism that had let down the fighting
men. When the Peace Treaties were published the German people
gasped and, for a time, despaired. They were confronted with
conditions which would crush them for all time. However hard they
worked, all the profits of their labour would be seized by their
enemies. However much they pinched, more would be demanded.
There was no fixed sum which they could wipe out by stupendous
effort, but only sums rising higher in fantastic figures for ever and
ever. They were the bondslaves of the world.
That mood did not last, though it came back again. A new mood
followed and buoyed them up for a year or two. They had lost the
War, but they would show the world that they could win the peace.
German genius, organisation, and industry would rise above even
the monstrous penalties exacted by their enemies. They would
capture the markets of the world, smash all competitors by an
industrial war, regain their liberty and commercial power. The Krupp
works which had made great guns and all the monstrous machinery
of war converted their plant to the instruments of peace, produced
ploughs, steam-engines, safety razors, cash registers, everything
that is made of metal for the use of life. Every factory in Germany
got to work again. There were no unemployed as in England,
because the workers accepted low wages, and desired work almost
as much as bread in a fever of industrial energy, to wipe out the War
and build up the prosperity of a peace. Defeat was better than
victory in its moral effect upon the German people. At least they did
not fall into that idleness, that craving for gaiety, that moral lassitude
and indiscipline of spirit which overcame the victorious peoples.
When I went to Germany, several times after the War, I was amazed
at its energy and industry. There were no scenes in Berlin like those
in London, with processions of unemployed and innumerable
beggars and crowds of loungers round the Labour Exchanges. There
was an air of activity in Germany, startling and rather splendid. The
whole nation was working full steam ahead, and the products of its
industry were being offered in the markets of the world at less than
the cost price of similar goods in England. It steadied them and gave
them a purpose in life.
And yet beneath this superficial appearance of renewed prosperity
and industrial power there was, as I could see, something rotten.
Misery was not to be seen in the open, as in London, but it was
there, in middle-class homes and mean streets. The whole of this
new industrial adventure in Germany was based upon underpaid and
under-nourished labour, upon cut-throat prices, and upon the
temporary advantage of a falling exchange.
The German Government was tinkering with its money, speeding
up the printing presses, issuing notes beyond the backing of real
securities. The illusion of a Germany capturing the world’s markets
had no great basis of truth. The world markets had lost their
purchasing power, however cheap were German goods. Russia was
not buying much from Germany, nor Austria, nor Poland, nor
Hungary, nor Turkey. Looking into the figures given me by experts—
English as well as German—it seemed certain that there was an
adverse trade balance against Germany when her national
expenditure was reckoned with her revenue. The reparations she
was beginning to pay, the deliveries in kind she was making to
France, Belgium, and Italy, the costs of the Armies of Occupation on
the Rhine, were eating into her capital wealth and swallowing up her
last gold reserves. She had to pay her indemnities by buying foreign
money—dollars, sterling, francs—and after each payment her own
money depreciated by irresistible economic laws.

The Adventure of Inflation

The financial advisers of the German Government used the


method of inflation to keep the German people working on cheap
money to avoid a revolution which they feared would happen if
unemployment prevailed, to wipe out their internal debt, and to
dupe the world. At first, no doubt, they believed that they could
control this system of postponing the evil day of reckoning, but,
once having started the ball rolling, it increased with frightful velocity
down hill. Every time the mark fell in value more marks had to be
printed. When its purchasing power fell so far below the real value
of wages that the workers clamoured for increased pay, the printing
presses had to be turned again to provide the additional money
which again fell in the foreign exchange while more slowly prices
rose in Germany. The German financiers never checked this wheel in
its mad revolutions. They protested that they were unable to check
it. To some extent it was a gamble with loaded dice. They were
bound to win—up to a point. As long as foreign money was paid for
worthless paper—whatever the figure of exchange—they would be
taking good money for bad, which is excellent business. As long as
by increasing the quantities of paper they could enable their
industrialists to employ cheap labour, it was good business. As long
as the paper itself and the labour of printing were not more costly
than the purchase value represented by fantastic numbers on the
note, they could carry on the economic life of the country and at the
same time abolish all their internal debts. People who had invested
all their savings in war loans found that their income had withered
away. Industrial companies who had borrowed real capital could pay
it back in false notes. And private individuals who were ruined by
this means could at least recoup themselves a little at the expense
of the foreigner by selling German paper for pounds, dollars, or
francs, and gambling on the exchange. It was a great game, which
absorbed the interest of large numbers of the German people.
Waiters in hotels, clerks in offices, vendors of newspapers, middle-
class housewives, did their little bit of daily speculation, and secreted
foreign money for rainy days. The great industrialists and
professional financiers speculated on a large scale and made
enormous profits, while the game lasted. But it was a game bound
to fail in the long run. It was bound to fail when no other country
would buy German marks at any rate of exchange, and when those
who possessed real things, such as potatoes, meat, milk, or
manufactured articles, refused to part with them for any number of
German notes. That time came during the occupation of the Ruhr,
when, to subsidise the passive resistance of the workers, the
German Government poured out a vast tide of paper money, and
when the German nation was cut off from its chief source of real
wealth in that great industrial region.
I saw from time to time the progress along the road to ruin.
Although it enabled a minority to get rich quick, it caused intense
suffering among the mass of the German people. The wages of the
workers never kept pace with the fall in the purchasing power of
their wages, although they were raised week by week on an
ascending scale. What five marks would buy in 1913 a million marks
would not buy in 1923. It made trade impossible, because no sooner
were prices adjusted to the new note issues than a fresh burst of
inflation made them less than the cost price of the goods a week
before. It was futile to save when thrift was mocked by this
depreciation and disappearance of money values. German people
had to spend quickly in food or drink or foolish things, because what
they had to-day would be worthless to-morrow. The German
housewife despaired. She could not keep pace with these rising
prices. Some of them went crazy over millions of marks that had no
meaning. Germany, apart from its profiteers, stinted, scraped, and
toiled, without decent reward for its labour, and with certain ruin
ahead.
Looking back on that amazing adventure of inflation, one must ask
oneself the question what would have happened in Germany if its
Government had endeavoured to stabilise its finances by not issuing
money beyond its real backing, and trying to balance its Budget
according to sound methods. It is my opinion that the illusion of
German prosperity would have been more rapidly dispelled and that
their default in the payment of reparations would have happened
earlier. Foreign speculators would not have been “bitten in the ear,”
German speculators would not have made profits over exchange
gambles; but the Allies would not have received more payments,
and there would have been widespread unemployment and revolt
among the German people. They were between the devil and the
deep sea, and though they chose the devil of inflation, it postponed
the plunge into the deep sea for a year or two more.
In fairness to Germany, it must be remembered that she did make
very heavy payments in money and kind, amounting all told to more
than £400,000,000 sterling—that is to say, nearly half the amount of
the British debt to the United States of America, which the British
people, richer than Germany at the present time, find an almost
intolerable burden, although they are paying only £30,000,000 a
year to reduce it. In Germany’s post-War state it was a drain upon
her dwindling capital which she could not sustain at anything like
that rate, and with or without inflation it crippled her. The Dawes
Report was an acknowledgment of that fact, although it took into
account the immense sums of money secreted abroad. Previous
default had caused the French occupation of Düsseldorf, Duisburg,
and Frankfurt, arousing a flame of hostility in German minds. But
when France marched into the Ruhr against the will of the British,
and without their co-operation, the whole of the German people,
without difference of class or political opinion, denounced it as a
violation of the Peace Treaty, and as a sentence of ruin, not only to
Germany herself, but to the whole of Europe.

The Occupation of the Ruhr

It was this occupation of the Ruhr—the threat of its happening,


the entry of the French troops, and the results of it—which poisoned
the relations between England and France, flung Germany back into
the arms of her Nationalists, and thwarted all efforts of international
good will in the spirit of the League of Nations. It kept the wounds
of war open and salted in Central Europe. It checked the economic
recovery of all nations dependent upon Germany as buyers and
sellers. France failed to get her reparations, and instead of building
up security the policy of Poincaré made a future war between the
two nations almost inevitable by stirring a cauldron of boiling pitch.
It turned the justice of the War into an injustice of peace, with the
Germans as the victims of injustice. For how could they pay
reparations if their industrial heart was strangled? And how could
they submit to a military tyranny over their great working population
from an enemy which had professed to fight the war for liberty and
democracy? How could any peace be justified which enabled a
foreign army, after war, to hold up the chief industries of a great
country, to destroy the machinery of its life, to coerce its workers at
the point of the bayonet, to expel them when they refused to work
under their military command, to take their money, to fling out their
furniture, to imprison their working chiefs, to cut off their food
supplies, to prevent their intercourse with their own folk, to deal
with the passive resistance of proud and hungry men as though it
were a crime against France, to use their whips in German theatres,
to terrorise the inhabitants of a great district, to break their spirit by
a thousand tyrannies, insults, humiliations and brutalities? That was
how the Germans argued, and the argument stands in the soul of
Germany as a memory that must one day be wiped out in blood. I
think France under Poincaré was unwise in giving to Germany that
sense of injustice and that cause of vengeance. I think France under
Herriot thinks so too, although it cannot forget, as none of us can
forget, the abominable acts of German officers and men during time
of war in France and Belgium.
The argument on the French side was logical enough, to a certain
point, where its logic broke abruptly. France, as its mind was
expressed by Poincaré, said: “These people have not paid us. They
are not trying to pay us. They are in wilful and flagrant default.”
They paid no attention to the German reply that they had paid all
they could—enormous sums—and could pay no more without utter
ruin. In any case, they did not yet know the fixed sum of their debt,
and the figures France demanded were beyond the capacity of any
nation on earth.
“Very well,” said the French, “we will take pledges for future
payment. We will send the bailiff into the house; we will hold the
Ruhr until Germany realises the inevitable and makes better
arrangements to pay. Meanwhile, whether she pays or not, we shall
weaken her power of recovery, postpone the time when she is able
to challenge us again, and hold her by the throat for the security of
France. Excellent plan, both ways! Perfectly justified in law and
equity.”
Where France failed in logic was in the combination of two ideas
which were mutually destructive. She might gain military security
(for a time) by weakening Germany and keeping a grip on her
jugular vein, but she could not gain reparations at the same time
and by the same method. Above all, her logic on the point of
security would fail at some future date—twenty years, forty years,
sixty years, when the German people would be strong enough to
fight for the liberty of their life, by the mere weight of increasing
population inspired by passion and armed with new weapons. France
would have done better to seek the security of world opinion in
support of her just claims instead of risking this lonely adventure
against the judgment of her friends. That, I think, was the verdict of
the Dawes Report. It was certainly the verdict of British opinion
among moderate-minded folk, long before the Ruhr episode had
ended in the financial downfall of Germany and explosive passion.

The German Separatists

What further excited the bitter hatred of the Germans was the
effort of French generals and political agents to detach the loyalty of
the Rhineland from the German Empire by encouraging bodies of
“Separatists,” who proclaimed a Rhineland Republic. Led by a very
doubtful but plausible gentleman named Dr. Dorten, whom I met in
the early days of the British occupation, these “Separatists” were
mostly youths of the disorderly class and men of criminal type
supported by a few sincere fanatics. Many of them were in the pay
of the French. Their movement was regarded as black treachery by
patriotic Germans, and when the French troops stood by the
Separatists while they seized public buildings and murdered German
police, previously disarmed by French orders, fury was unrestrained
among the German people. French policy, in this matter at least, was
a blunder, because from the first the Separatist movement had no
basis of reality nor any chance of success. It was an illusion of
French politicians who let their wish be father to their thoughts.

“The Black Horror”

Another cause of hatred in Germany, amounting to a mad rage


which made them see red, was the use of coloured troops in the
French zone of occupation. Under the name of “The Black Horror,”
German propaganda exaggerated and falsified the hideous aspects
of this last humiliation to their pride. It was asserted that masses of
African negroes had been let loose in the Rhineland to assault white
women and brutalise white men. The French denied that they were
using any black troops, and this was perhaps technically true,
although I saw with my own eyes Seneghalese negroes on the
banks of the Rhine. But they were not fighting troops. They were
transport men, lorry drivers, and ambulance drivers, in the blue
uniform and steel hat of the French poilu. I saw the inhabitants of
Bonn shudder and sicken at the sight of them. But it was true that
the French did employ large numbers of Moroccan soldiers in
German towns. They were not black, they were not even “nearly
black,” and in race they belonged to the same Mediterranean
peoples from which the French themselves have sprung. But that
made no difference in German psychology, and I sympathise with
their detestation of being controlled and put under the menace of
Moroccan troops who, whatever shade their colour and historical
ancestry, do not belong to our European type of civilisation, such as
it is, and should not be put in military power over European
populations. The British use of Indian troops in the white man’s war,
and the American use of black battalions, were, in my judgment,
similar errors which may cost us dear. But it was more than an error
to use Moroccans in time of peace among German citizens who
resented their presence as a shameful insult. These things are
beyond argument. They belong to the realm of instinct. It was
handing the Germans another cause of hatred.

British Policy and French Suspicion

Most people in England watched all these things with disapproval


and dismay. Gradually, as time went on, they drew further away
from the French policy in Europe. It seemed to them bad business
and bad morality. From a business point of view a great number of
hard-headed people in Great Britain could see no sense in
demanding payments from Germany beyond her power to pay, and
in holding her by the throat so tightly that in any case she could not
pay. Unemployment and bad trade in Great Britain were seen to be
directly caused by this situation in Germany, which at one time had
been England’s second best customer. It was not only the direct
trade between Germany and England that had declined, but it was
the indirect effect of Germany’s economic downfall all round the
world. If Germany bought less wool from Australia and less grain
from Canada, then Australia and Canada bought less manufactured
goods from Great Britain. If Germany were not trading profitably
with Holland, Denmark, and Sweden, then those countries could not
buy the same quantity of British goods. Germany was the axle-tree
of the great wheel of European trade which had broken its spokes
and lay in the ditch. Until the old waggon was on the road again
England would not recover her commerce. The French cried: “What
about our devastated regions? Who will pay for reconstruction if the
Germans are not forced to do so?” The English shrugged their
shoulders and said: “What about our devastated trade in Liverpool,
Manchester, Glasgow, London, and a hundred other cities where
men are out of work?”
Less than ten years after the beginning of that struggle in which
the youth of these two countries had fought side by side for the
same purpose, and with the same ideals, there was a friction
between England and France which obliterated the memory of that
common sacrifice in many minds and created suspicion, dislike and
political hostility.
The French Press and people abused the British for their
materialism. “That nation of shopkeepers!” they cried. “They can
think of nothing but their trade interests. They would sell their soul
or their best comrade for a mess of pottage!” They forgot that they
also were out for financial interests, that their policy was dictated by
the desire to get reparations out of Germany. And although England
advanced commercial reasons for relieving the pressure on Germany,
she had other reasons which to the French seemed sheer hypocrisy,
the most sickening cant. The English people and their sister nations
do not like kicking an enemy when he is down, nor treading on his
face when he lies prostrate. The old traditions of sport, strong even
in the Cockney mind, bid them shake hands with the other fellow
when he has been counted out after a knock-out blow. They do not
believe in “hugging hate.” They have an instinctive sense of fair play.
It is not too much to say that these were the overwhelming reasons
in the minds of the average Englishman which made him dislike the
entry into the Ruhr and the Poincaré policy of “keeping the Germans
down.”

Lloyd George and Poincaré

There was another reason, deep in many minds of humble folk


and great statesmen. They looked back to the War with loathing and
horror. They desired to support some better way of argument in
international disputes, so that there need be no “next war,” worse
than the last, between the same combination of Powers. They
believed in the spirit of the League of Nations as the only way by
which that next war might be avoided. They were hostile to any
Power which seemed to thwart the progress of that spirit. They
believed that the policy of Poincaré was contrary to the
establishment of good will among nations. They believed that it was
hurtful to future peace and leading inevitably to a war of revenge.
For that reason millions of people in Great Britain looked upon
Poincaré and for all he stood as the greatest menace in the world.
Lloyd George was one of them. After the signing of the Peace
Treaty and a jingo election in which his followers appealed to the
lowest passions of the people, that extraordinary man, with his
nimble mind, his rapid vision, his instinctive Liberalism, his sincere
belief in righteousness (overlaid by the cunning and craft of political
necessities), led him into a crusade on behalf of a world settlement
by conciliation and compromise.
In conference after conference, with splendid courage, with
untiring zeal, with broad and liberal views, with an honest desire to
bring Europe back to health by fair play all round and business
methods, he endeavoured to settle the differences between France
and England over this question of Germany, to scale down the
German payments so that they were possible and not impossible, to
give France security, to bring Russia back into the family of nations,
to make some reasonable arrangement for inter-allied debts, and to
adopt a scheme of general demobilisation in Europe which would
relieve its peoples from crushing burdens and prepare the way of
peace. However one may criticise the character and quality of Lloyd
George, history will, I think, give him enormous credit for that great
endeavour to secure the peace of the world. At every conference he
was thwarted by France, whose difficulties and dangers could not be
reconciled by any of these plans, who regarded them all as treachery
to her people.
Briand concluded an agreement by which he released Germany of
certain obligations in return for a limited guarantee of French
security by British alliance in the case of a new aggressive war from
Germany. And with that document in his pocket Briand lost his job in
France. Poincaré succeeded him as the representative of French
nationalism, the military point of view, the unrelenting will of the
majority of French people to exact their full pound of flesh from
Germany at all costs. From that time onwards until the downfall of
Lloyd George himself the situation between France and England was
controlled by the diplomatic intercourse between Lloyd George and
Poincaré which developed into a personal duel of hostile views. In
every case Poincaré had the best of the argument on lines of pure
logic and abstract justice. It was right that Germany should pay for
all the damage she had done. Was France to pay?... In every
conference Poincaré stone-walled Lloyd George’s attempt at
compromise, by which logic should give way a little to general
interest and the military safety of France to a world pact of peace.
Then Lloyd George fell. By a frightful paradox his fall was partly
due to a call for war. The man who was passionate for the peace of
the world, who had given his health and risked his political career in
the cause of the pacification of Europe, raised a fiery torch to the
people—which fell like a damp squib in a cold sea. It was after the
tragedy of Greece.
For some reasons not yet fully known to history, Lloyd George had
fallen under the spell of Venizelos and his friends. Greece had been
given a new Empire in Asia Minor and Thrace at the expense of the
Turk, who had been utterly crushed by British armies. He turned a
deaf ear to all critics who prophesied that the character of the
Greeks would not be equal to these new responsibilities.

The Downfall of Greece

Meanwhile in Constantinople, where I happened to be, our Military


Mission was getting anxious. A new leader had arisen among the
Turks named Mustapha Kemal Pasha. Established at Angora, with a
Committee of Turkish Nationalists, he defied the terms of peace
imposed upon his people, refused to acknowledge the decree of a
Sultan in the hands of the inter-allied force, rallied to his standard
every Turkish patriot, raised a new army, filled Constantinople with
his spies and agents, and proclaimed a “Holy War” of Islam. He
vowed to recapture Smyrna, to liberate Constantinople, and to take
possession of Thrace.
The Greek troops before Smyrna were confident, as I saw them,
of holding their lines against the Turk. The Greek Commander-in-
Chief, whom I interviewed, was ready to break the Turkish lines “as
though on parade.” Lloyd George gave them the moral support of
emotional words, and they were very grateful to him, and believed
that England was behind him. The world knows what happened. Its
conscience must still burn at times as it hears the cries of terror and
anguish on that quayside at Smyrna when the Turkish irregulars set
fire to the Christian quarters and massacred men, women and
children, while British and American warships stood by, with their
officers and men staring through that pall of smoke and its rending
fire, listening to the shrieks beyond.
The Turks advanced to the Ismid Peninsula overlooking the
Dardanelles. They advanced to the very lines which the British
troops—young boys mostly—held at Chanak. Beyond that they could
not go without a war with Great Britain, which hung by a thread day
after day and week after week. The French, whose politicians and
public opinion were sympathetic to the Turks, and who were
incredibly jealous of British influence in Egypt, Palestine and
Mesopotamia—an old source of enmity stirred up again in military
minds—withdrew their own troops from Chanak, and left the British
troops isolated. They made it perfectly clear, very courteously, but
very firmly, that they would not engage in war against Turkey. It is
certain that the French people after all their loss of blood and years
of strife would have refused to support such a war. In any case, they
preferred the Turks to the Greeks, and were glad of the Greek
defeat.
To Lloyd George, in England, these Turkish victories were heavy
blows. His honour was engaged to Greece. He believed that British
honour was engaged, though certainly his pro-Greek policy had
never gained the support and enthusiasm of public opinion. He
hated the thought of seeing the Turk in power again at
Constantinople. He had incited the Greek Army to attack. The horror
at Smyrna made his blood run cold. It was Winston Churchill,
without waiting for Parliamentary sanction, who raised the fiery
cross and sent an emotional appeal for help to all the Dominions. It
was received at first in stony silence, and then with deadly hostility.
Neither Canada nor Australia would send a man to fight in a new
war. They had done enough; they were not interested. At home in
England and Scotland there was no support for a new war. There
was a fierce outcry in the Press. The nation refused to envisage war,
for any reason. They were sick of war. They could not afford it in
men or money after years of colossal sacrifice.
The war did not happen, thanks a good deal to General Sir Charles
Harington, commanding in Constantinople. Cool as ice in the face of
extreme provocation, determined to keep the peace by every
method of statesmanship, unless his men were actually attacked, it
was his fine chivalry, his diplomatic wisdom with the Turkish
Generals and statesmen, which resulted in an Armistice hanging on
a hair-trigger. Lord Curzon patched up a peace which gave to the
Turks most of what they claimed and more than they ought to have
had in humanity and justice. The expulsion of the Christian
communities from Asia Minor was one of the most infernal tragedies
of history, hushed up in the British and European Press because it
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like