Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- d88888b d8888b. .d8b. d8b db .o88b. d88888b d888888b .d88b. d888888b
- 88' 88 `8D d8' `8b 888o 88 d8P Y8 88' `88' .8P Y8. `88'
- 88ooo 88oobY' 88ooo88 88V8o 88 8P 88ooooo 88 88 88 88
- 88~~~ 88`8b 88~~~88 88 V8o88 8b 88~~~~~ C8888D 88 88 88 88
- 88 88 `88. 88 88 88 V888 Y8b d8 88. .88. `8b d8' .88.
- YP 88 YD YP YP VP V8P `Y88P' Y88888P Y888888P `Y88P' Y888888P
- """
- # Credit à @sahhquelplaisir sur France-IOI
- # Plus qu'à copier/coller, tout est déjà fait ! Solution de pratiquement tout le niveau 1 (55 challenges sur 70)
- # ----------------------------------------------------------------------------------------------------------------
- # Hello World
- print("Hello world!")
- # Présentation
- print("Coucou !")
- print("Je m'appelle Camthalion")
- print("Ma devise est 'Parler peu mais parler bien'.")
- # Plan de la montagne
- print("Tout droit tu grimperas,")
- print("La clé tu trouveras,")
- print("Habile tu seras,")
- print("Quand tu les porteras,")
- print("Et avec le chef tu reviendras !")
- # Dans le fourré
- from robot import *
- haut()
- haut()
- haut()
- droite()
- droite()
- bas()
- bas()
- droite()
- # Empilement de cylindres
- from robot import *
- deplacer(1, 2)
- deplacer(1, 3)
- deplacer(2, 3)
- deplacer(1, 2)
- deplacer(3, 1)
- deplacer(3, 2)
- deplacer(1, 2)
- deplacer(1, 3)
- deplacer(2, 3)
- deplacer(2, 1)
- deplacer(3, 1)
- deplacer(2, 3)
- deplacer(1, 2)
- deplacer(1, 3)
- deplacer(2, 3)
- # Recette secrète
- from robot import *
- remplir(3)
- transferer(3, 5)
- remplir(3)
- transferer(3, 5)
- vider(5)
- transferer(3, 5)
- remplir(3)
- transferer(3, 5)
- # Punition
- for loop in range(135):
- print("Je dois respecter le Grand Sorcier.")
- # Mathématiques de base
- for loop in range(13):
- print("9 * 8 = 72")
- # Transport d'eau
- from robot import *
- for loop in range(2):
- gauche()
- print("Bonjour, laissez-moi vous aider")
- ramasser()
- for loop in range(32):
- droite()
- deposer()
- # Le secret du Goma
- from robot import *
- for loop in range(15):
- droite()
- ramasser()
- droite()
- deposer()
- # Sisyphe
- from robot import *
- for loop in range(21):
- haut()
- droite()
- for loop in range(21):
- gauche()
- bas()
- # Page d'écriture
- for loop in range(30):
- print("a_", end = "")
- print("")
- for loop in range(30):
- print("b_", end = "")
- print("")
- for loop in range(30):
- print("c_", end = "")
- print("")
- # Jeu de dames
- for loop in range(20):
- for loop in range(20):
- print("OX", end = "")
- print("")
- for loop in range(20):
- print("XO", end = "")
- print("")
- # Mont Kailash
- from robot import *
- for loop in range(108):
- for loop in range(13):
- haut()
- for loop in range(13):
- droite()
- for loop in range(13):
- bas()
- for loop in range(13):
- gauche()
- # Vendanges
- from robot import *
- for loop in range(20):
- ramasser()
- for loop in range(15):
- droite()
- deposer()
- for loop in range(15):
- gauche()
- # Le Grand évènement
- from robot import *
- for loop in range(9):
- haut()
- for loop in range(9):
- droite()
- for loop in range(4):
- bas()
- for loop in range(8):
- gauche()
- bas()
- for loop in range(8):
- droite()
- bas()
- for loop in range(9):
- gauche()
- # Réponds !
- print(42)
- # L'éclipse
- print(12581 - 11937)
- # Bonbons pour tout le monde !
- eleves = 25 + 30 + 27 + 22
- total = eleves - 8
- print(total * 3)
- # L'algoréathlon
- distance = 2 + 34 + 6
- print(distance, end = " ")
- print(distance * 2, end = " ")
- print(distance * 3, end = " ")
- # Cour de récréation
- longueur = 5*17 + 2*7 + 5 + 2*2
- aire = longueur*longueur
- perimetre = 4*longueur
- print(aire)
- print(perimetre)
- # Une partie de cache-cache
- chiffre = 1
- while chiffre < 101:
- print(chiffre)
- chiffre = chiffre + 1
- print("J'arrive !")
- # Progresser par l'erreur
- print("V")
- print("V")
- print("I")
- print("I")
- print("V")
- print("I")
- print("I")
- # Décollage de fusée
- chiffre = 100
- while chiffre != 0:
- print(chiffre)
- chiffre = chiffre - 1
- print("0")
- print("Décollage !")
- # Invasion de batraciens
- crapauds = 1337
- for loop in range(12):
- crapauds = crapauds * 2
- print(crapauds)
- # Kermesse
- nombre = 1
- tour = 1
- print(nombre)
- while tour < 50:
- tour = tour + 1
- nombre = nombre + tour
- print(nombre)
- # Course avec les enfants
- from robot import *
- distance = 1
- for loop in range(10):
- for loop in range(distance):
- droite()
- ramasser()
- for loop in range(distance):
- gauche()
- deposer()
- distance = distance + 1
- # Construction d'une pyramide
- nombre = 17
- temp = 0
- total = 0
- for loop in range(9):
- temp = nombre * nombre * nombre
- total = total + temp
- nombre = nombre - 2
- print(total)
- # Table de multiplication
- nombre = 1
- const = 1
- const2 = 1
- mult = 1
- result = 1
- for loop in range(20):
- nombre = const
- mult = const2
- for loop in range(20):
- result = nombre * mult
- print(result, end = " ")
- mult = mult + 1
- print("")
- const = const + 1
- # Récoltes
- taille = int(input())
- taille = taille * taille
- total = taille * 23
- print(total)
- # Retraite spirituelle
- jours = int(input())
- temps = jours * 16 * 60 * 60
- print(temps)
- # Âge des petits-enfants
- âgeCadet = int(input())
- âgeAîné = int(input())
- différence = âgeAîné - âgeCadet
- print(différence)
- # Encore des punitions
- lignes = int(input())
- for loop in range(lignes):
- print("Je dois suivre en cours")
- # Graduation de thermomètres
- def print_between(start,stop):
- if start == stop:
- print(start)
- else:
- print(start)
- print_between(start + 1,stop)
- chiffre1 = int(input())
- chiffre2 = int(input())
- print_between(chiffre1,chiffre2)
- # Jeu de calcul mental
- num = int(input())
- nombre = 66
- choisi = 1
- for loop in range(num):
- nombre = nombre * choisi
- print(nombre)
- choisi = choisi + 1
- # La Grande Braderie
- depart = int(input())
- distance = int(input())
- recu = int(input())
- recu1 = recu
- depart1 = depart
- temp = 0
- print(depart)
- for loop in range(recu1):
- depart1 = depart1 + distance
- print(depart1)
- # Bétail
- temp1 = int(input())
- temp2 = int(input())
- temp3 = int(input())
- temp4 = int(input())
- temp5 = int(input())
- temp6 = int(input())
- temp7 = int(input())
- temp8 = int(input())
- temp9 = int(input())
- temp10 = int(input())
- temp11 = int(input())
- temp12 = int(input())
- temp13 = int(input())
- temp14 = int(input())
- temp15 = int(input())
- temp16 = int(input())
- temp17 = int(input())
- temp18 = int(input())
- temp19 = int(input())
- temp20 = int(input())
- total = temp1 + temp2 + temp3 + temp4 + temp5 + temp6 + temp7 + temp8 + temp9 + temp10 + temp11 + temp12 + temp13 + temp14 + temp15 + temp16 + temp17 + temp18 + temp19 + temp20
- print(total)
- # Socles pour statues
- ent1 = int(input())
- ent2 = int(input())
- ent1c = 0
- total = 0
- total1 = 0
- ent1c = ent1
- for loop in range(ent1 - ent2 + 1):
- total = ent1c * ent1c
- total1 = total1 + total
- ent1c = ent1c - 1
- print(total1)
- # Le plus beau Karva
- nombre = int(input())
- for loop in range(nombre):
- poids = int(input())
- age = int(input())
- longueur = int(input())
- hauteur = int(input())
- note = longueur * hauteur + poids
- print(note)
- # Transport des bagages
- int1 = int(input())
- int2 = int(input())
- total = int1 * int2
- if total > 105:
- print("Surcharge !")
- # Bornes kilométriques
- num1 = int(input())
- num2 = int(input())
- if num1 > num2:
- total = num1 - num2
- else:
- total = num2 - num1
- print(total)
- # Tarifs dégressifs
- heure = int(input())
- prix = 10
- heure = heure
- for loop in range(heure):
- prix = prix + 5
- if prix > 53:
- prix = 53
- print(prix)
- # Bagarre générale
- arignon = int(input())
- evaran = int(input())
- if arignon - evaran > 10:
- print("La famille Arignon a un champ trop grand")
- elif evaran - arignon > 10:
- print("La famille Evaran a un champ trop grand")
- # Tarif du bateau
- age = int(input())
- if age >= 21:
- print("Tarif plein")
- else:
- print("Tarif réduit")
- # Traversée du pont
- de1 = int(input())
- de2 = int(input())
- somme = de1 + de2
- if somme >= 10:
- print("Taxe spéciale !")
- print("36")
- else:
- somme = somme * 2
- print("Taxe régulière")
- print(somme)
- # Concours de tir à la corde
- nbMembres = int(input())
- poids1 = 0
- poids2 = 0
- temp = 0
- for loop in range(nbMembres):
- temp = int(input())
- poids1 = poids1 + temp
- temp = int(input())
- poids2 = poids2 + temp
- if poids1 > poids2:
- print("L'équipe 1 a un avantage")
- else:
- print("L'équipe 2 a un avantage")
- print("Poids total pour l'équipe 1 :", poids1)
- print("Poids total pour l'équipe 2 :", poids2)
- # Mot de passe du village
- motdepasse = int(input())
- if motdepasse == 64741:
- print("Bon festin !")
- else:
- print("Allez-vous en !")
- # Villes et villages
- nombre = int(input())
- total = 0
- for loop in range(nombre):
- temp = int(input())
- if temp > 10000:
- total = total + 1
- print(total)
- # Planning de la journée
- maintenant = int(input())
- nbrvillages = int(input())
- temp = 0
- total = 0
- for loop in range(nbrvillages):
- temp = int(input())
- if maintenant - temp <= 50 and maintenant - temp >= 0:
- total = total + 1
- elif maintenant - temp <= 0 and abs(maintenant - temp) <= 50:
- total = total + 1
- print(total)
- # Étape la plus longue
- ent = int(input())
- temp = 0
- total = 0
- for loop in range(ent):
- temp = int(input())
- if temp > total:
- total = temp
- print(total)
- # Calcul des dénivelées
- nombre = int(input())
- temp = 0
- totalpos = 0
- totalneg = 0
- for loop in range(nombre):
- temp = int(input())
- if temp > 0:
- totalpos = totalpos + temp
- else:
- totalneg = totalneg + temp
- print(totalpos)
- print(abs(totalneg))
- # Type d'arbres
- taille1 = int(input())
- taille2 = int(input())
- total = "Arbre"
- if taille1 <= 5 and taille2 >= 8:
- total = "Tinuviel"
- elif taille1 >= 10 and taille2 >= 10:
- total = "Calaelen"
- elif taille1 >= 12 and taille2 <= 7:
- total = "Dorthonion"
- elif taille1 <= 8 and taille2 <= 5:
- total = "Falarion"
- print(total)
- # Tarifs de l'auberge
- age = int(input())
- poids = int(input())
- prix = 0
- if age == 60:
- prix = 0
- elif age < 10:
- prix = 5
- else:
- prix = 30
- if poids >= 20:
- prix = 40
- print(prix)
- # Protection du village
- nombre = int(input())
- abscisse = 0
- ordonnee = 0
- taillex = 0
- tailley = 0
- temp1 = 0
- temp2 = 0
- abscisse = int(input())
- ordonnee = int(input())
- maxo = ordonnee
- mino = ordonnee
- maxa = abscisse
- mina = abscisse
- for loop in range(nombre - 1):
- abscisse = int(input())
- ordonnee = int(input())
- if abscisse > maxa:
- maxa = abscisse
- if abscisse < mina:
- mina = abscisse
- if ordonnee > maxo:
- maxo = ordonnee
- if ordonnee < mino:
- mino = ordonnee
- taillex = maxa - mina
- tailley = maxo - mino
- temp1 = taillex * 2
- temp2 = tailley * 2
- print(temp1 + temp2)
- # Le juste prix
- numero = int(input())
- etape = 1
- temp = 0
- total = 0
- temp = int(input())
- resultat = temp
- total = etape
- for loop in range(numero - 1):
- temp = int(input())
- etape = etape + 1
- if temp <= resultat:
- total = etape
- resultat = temp
- print(total)
- # Espion étranger
- debut = int(input())
- fin = int(input())
- entrees = int(input())
- total = 0
- for loop in range(entrees):
- temp = int(input())
- if (temp >= debut) and (temp <= fin):
- total = total + 1
- print(total)
- # Maison de l'espion
- amin = int(input())
- amax = int(input())
- omin = int(input())
- omax = int(input())
- maisons = int(input())
- tempa = 0
- tempo = 0
- total = 0
- for loop in range(maisons):
- tempa = int(input())
- tempo = int(input())
- if (tempa >= amin) and (tempa <= amax) and (tempo >= omin) and (tempo <= omax):
- total = total + 1
- print(total)
- # Nombre de jours dans le mois
- mois = int(input())
- if ( (mois >= 1) and (mois < 4) ) or ( (mois >= 7) and (mois < 10) ):
- print(30)
- elif ( (mois >= 4) and (mois < 7) ) or (mois == 10):
- print(31)
- else:
- print(29)
- # Amitié entre gardes
- arria = int(input())
- parta = int(input())
- arrib = int(input())
- partb = int(input())
- if ( ( (arria >= arrib) and (arria <= partb) ) or ( (parta >= arrib) and (parta <= partb) ) ) or ( ( (arrib >= arria) and (arrib <= parta) ) or ( (partb >= arria) and (partb <= arria) ) ):
- print("Amis")
- else:
- print("Pas amis")
- # Nombre de personnes à la fête
- personnes = int(input())
- temp = 0
- total1 = 0
- total = 0
- for loop in range(personnes * 2):
- temp = int(input())
- if temp >= 0:
- total1 = total1 + 1
- if total1 > total:
- total = total + 1
- else:
- total1 = total1 - 1
- if total1 > total:
- total = total + 1
- print(total)
Advertisement
Advertisement