@cyrilverloop/codingame-configuration 1.27.0 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/config/easy/HagridSpeaking/code/CGCode.cpp +21 -0
- package/config/easy/HagridSpeaking/code/CGCode.java +22 -0
- package/config/easy/HagridSpeaking/code/CGCode.js +9 -0
- package/config/easy/HagridSpeaking/code/CGCode.php +11 -0
- package/config/easy/HagridSpeaking/code/CGCode.ts +9 -0
- package/config/easy/HagridSpeaking/config.json +48 -0
- package/config/easy/HagridSpeaking/input/01 - Simple sentences.txt +3 -0
- package/config/easy/HagridSpeaking/input/02 - Does Hagrid speak.txt +6 -0
- package/config/easy/HagridSpeaking/input/03 - t,f, d and g replacement.txt +8 -0
- package/config/easy/HagridSpeaking/input/04 - Word replacement.txt +2 -0
- package/config/easy/HagridSpeaking/input/05 - Do yeh forge/342/200/231 the case.txt" +3 -0
- package/config/easy/HagridSpeaking/input/06 - Compound Words.txt +2 -0
- package/config/easy/HagridSpeaking/input/07 - Edge cases.txt +11 -0
- package/config/easy/HagridSpeaking/input/08 - Very long talk.txt +12 -0
- package/config/easy/HagridSpeaking/output/01 - Simple sentences.txt +2 -0
- package/config/easy/HagridSpeaking/output/02 - Does Hagrid speak.txt +5 -0
- package/config/easy/HagridSpeaking/output/03 - t,f, d and g replacement.txt +7 -0
- package/config/easy/HagridSpeaking/output/04 - Word replacement.txt +1 -0
- package/config/easy/HagridSpeaking/output/05 - Do yeh forge/342/200/231 the case.txt" +2 -0
- package/config/easy/HagridSpeaking/output/06 - Compound Words.txt +1 -0
- package/config/easy/HagridSpeaking/output/07 - Edge cases.txt +10 -0
- package/config/easy/HagridSpeaking/output/08 - Very long talk.txt +11 -0
- package/config/{easy → medium}/RemoveInsertStatements/config.json +1 -1
- package/config/medium/SimpleMakefiles/code/CGCode.cpp +34 -0
- package/config/medium/SimpleMakefiles/code/CGCode.java +31 -0
- package/config/medium/SimpleMakefiles/code/CGCode.js +20 -0
- package/config/medium/SimpleMakefiles/code/CGCode.php +22 -0
- package/config/medium/SimpleMakefiles/code/CGCode.ts +20 -0
- package/config/medium/SimpleMakefiles/config.json +83 -0
- package/config/medium/SimpleMakefiles/input/01 - Problem statement example.txt +12 -0
- package/config/medium/SimpleMakefiles/input/02 - Up-to-date check and partial rebuild.txt +13 -0
- package/config/medium/SimpleMakefiles/input/03 - Single rule with no actions.txt +6 -0
- package/config/medium/SimpleMakefiles/input/04 - Up-to-date ages.txt +14 -0
- package/config/medium/SimpleMakefiles/input/05 - Multiple goal targets.txt +16 -0
- package/config/medium/SimpleMakefiles/input/06 - No-action intermediates and unused rules.txt +19 -0
- package/config/medium/SimpleMakefiles/input/07 - Multiple targets with identical prerequisites.txt +18 -0
- package/config/medium/SimpleMakefiles/input/08 - Built-in macros and comments.txt +19 -0
- package/config/medium/SimpleMakefiles/input/09 - Same target in multiple rules.txt +23 -0
- package/config/medium/SimpleMakefiles/input/10 - Large partial rebuild.txt +25 -0
- package/config/medium/SimpleMakefiles/input/11 - Cycle detection.txt +22 -0
- package/config/medium/SimpleMakefiles/input/12 - Unreachable cycle detection.txt +22 -0
- package/config/medium/SimpleMakefiles/input/13 - All rebuild features combined.txt +40 -0
- package/config/medium/SimpleMakefiles/input/14 - Multiple action lines per rule.txt +25 -0
- package/config/medium/SimpleMakefiles/input/15 - Kitchen sink.txt +56 -0
- package/config/medium/SimpleMakefiles/output/01 - Problem statement example.txt +4 -0
- package/config/medium/SimpleMakefiles/output/02 - Up-to-date check and partial rebuild.txt +3 -0
- package/config/medium/SimpleMakefiles/output/03 - Single rule with no actions.txt +1 -0
- package/config/medium/SimpleMakefiles/output/04 - Up-to-date ages.txt +1 -0
- package/config/medium/SimpleMakefiles/output/05 - Multiple goal targets.txt +4 -0
- package/config/medium/SimpleMakefiles/output/06 - No-action intermediates and unused rules.txt +3 -0
- package/config/medium/SimpleMakefiles/output/07 - Multiple targets with identical prerequisites.txt +4 -0
- package/config/medium/SimpleMakefiles/output/08 - Built-in macros and comments.txt +6 -0
- package/config/medium/SimpleMakefiles/output/09 - Same target in multiple rules.txt +5 -0
- package/config/medium/SimpleMakefiles/output/10 - Large partial rebuild.txt +4 -0
- package/config/medium/SimpleMakefiles/output/11 - Cycle detection.txt +1 -0
- package/config/medium/SimpleMakefiles/output/12 - Unreachable cycle detection.txt +1 -0
- package/config/medium/SimpleMakefiles/output/13 - All rebuild features combined.txt +8 -0
- package/config/medium/SimpleMakefiles/output/14 - Multiple action lines per rule.txt +11 -0
- package/config/medium/SimpleMakefiles/output/15 - Kitchen sink.txt +14 -0
- package/config/medium/Squares/code/CGCode.cpp +30 -0
- package/config/medium/Squares/code/CGCode.java +27 -0
- package/config/medium/Squares/code/CGCode.js +20 -0
- package/config/medium/Squares/code/CGCode.php +15 -0
- package/config/medium/Squares/code/CGCode.ts +20 -0
- package/config/medium/Squares/config.json +38 -0
- package/config/medium/Squares/input/01 - Example.txt +10 -0
- package/config/medium/Squares/input/02 - Overlap.txt +17 -0
- package/config/medium/Squares/input/03 - Fat Squares.txt +15 -0
- package/config/medium/Squares/input/04 - Black Hole.txt +20 -0
- package/config/medium/Squares/input/05 - Venn.txt +28 -0
- package/config/medium/Squares/input/06 - Dartboard.txt +51 -0
- package/config/medium/Squares/output/01 - Example.txt +7 -0
- package/config/medium/Squares/output/02 - Overlap.txt +12 -0
- package/config/medium/Squares/output/03 - Fat Squares.txt +10 -0
- package/config/medium/Squares/output/04 - Black Hole.txt +15 -0
- package/config/medium/Squares/output/05 - Venn.txt +23 -0
- package/config/medium/Squares/output/06 - Dartboard.txt +46 -0
- package/package.json +1 -1
- /package/config/{easy → medium}/RemoveInsertStatements/code/CGCode.js +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/code/CGCode.php +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/input/01 - simple insert statement.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/input/02 - simple commented statement.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/input/03 - insert + comment.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/input/04 - with function.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/input/05 - many insert statements.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/input/06 - functions + inserts.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/input/07 - multi-line INSERT instructions.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/input/08 - many insert on same line.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/output/01 - simple insert statement.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/output/02 - simple commented statement.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/output/03 - insert + comment.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/output/04 - with function.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/output/05 - many insert statements.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/output/06 - functions + inserts.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/output/07 - multi-line INSERT instructions.txt +0 -0
- /package/config/{easy → medium}/RemoveInsertStatements/output/08 - many insert on same line.txt +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [1.29.0] - 2026-08-31
|
|
8
|
+
### Added
|
|
9
|
+
- configuration for "Hagrid speaking".
|
|
10
|
+
- configuration for "Squares".
|
|
11
|
+
- configuration for "Simple Makefiles".
|
|
12
|
+
|
|
13
|
+
## [1.28.0] - 2026-06-30
|
|
14
|
+
### Changed
|
|
15
|
+
- difficulty of "Remove insert statements" from easy to medium.
|
|
16
|
+
|
|
7
17
|
## [1.27.0] - 2026-05-31
|
|
8
18
|
### Added
|
|
9
19
|
- configuration for "Build-A-Die".
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#include <iostream>
|
|
2
|
+
#include <string>
|
|
3
|
+
#include <vector>
|
|
4
|
+
#include <algorithm>
|
|
5
|
+
|
|
6
|
+
using namespace std;
|
|
7
|
+
|
|
8
|
+
int main()
|
|
9
|
+
{
|
|
10
|
+
int n;
|
|
11
|
+
cin >> n; cin.ignore();
|
|
12
|
+
for (int i = 0; i < n; i++) {
|
|
13
|
+
string line;
|
|
14
|
+
getline(cin, line);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Write an answer using cout. DON'T FORGET THE "<< endl"
|
|
18
|
+
// To debug: cerr << "Debug messages..." << endl;
|
|
19
|
+
|
|
20
|
+
cout << "Yeh mus\' find a way ter transform these lines" << endl;
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import java.util.*;
|
|
2
|
+
import java.io.*;
|
|
3
|
+
import java.math.*;
|
|
4
|
+
|
|
5
|
+
class Solution {
|
|
6
|
+
|
|
7
|
+
public static void main(String args[]) {
|
|
8
|
+
Scanner in = new Scanner(System.in);
|
|
9
|
+
int N = in.nextInt();
|
|
10
|
+
if (in.hasNextLine()) {
|
|
11
|
+
in.nextLine();
|
|
12
|
+
}
|
|
13
|
+
for (int i = 0; i < N; i++) {
|
|
14
|
+
String line = in.nextLine();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Write an answer using System.out.println()
|
|
18
|
+
// To debug: System.err.println("Debug messages...");
|
|
19
|
+
|
|
20
|
+
System.out.println("Yeh mus\' find a way ter transform these lines");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
fscanf(STDIN, "%d", $N);
|
|
3
|
+
for ($i = 0; $i < $N; $i++)
|
|
4
|
+
{
|
|
5
|
+
$line = stream_get_line(STDIN, 150 + 1, "\n");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
9
|
+
// To debug: error_log(var_export($var, true)); (equivalent to var_dump)
|
|
10
|
+
|
|
11
|
+
echo("Yeh mus\' find a way ter transform these lines\n");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const N: number = parseInt(readline());
|
|
2
|
+
for (let i = 0; i < N; i++) {
|
|
3
|
+
const line: string = readline();
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// Write an answer using console.log()
|
|
7
|
+
// To debug: console.error('Debug messages...');
|
|
8
|
+
|
|
9
|
+
console.log('Yeh mus\' find a way ter transform these lines');
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"path": "easy/HagridSpeaking",
|
|
3
|
+
"name": "Hagrid speaking",
|
|
4
|
+
"alphanumName": "HagridSpeaking",
|
|
5
|
+
"link": "https://www.codingame.com/ide/puzzle/hagrid-speaking",
|
|
6
|
+
"tests": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Simple sentences",
|
|
9
|
+
"alphanumName": "SimpleSentences",
|
|
10
|
+
"file": "01 - Simple sentences.txt"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "Does Hagrid speak?",
|
|
14
|
+
"alphanumName": "DoesHagridSpeak",
|
|
15
|
+
"file": "02 - Does Hagrid speak.txt"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "t,f, d and g replacement",
|
|
19
|
+
"alphanumName": "TFDandGreplacement",
|
|
20
|
+
"file": "03 - t,f, d and g replacement.txt"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "Word replacement",
|
|
24
|
+
"alphanumName": "WordReplacement",
|
|
25
|
+
"file": "04 - Word replacement.txt"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "Do yeh forge’ the case?",
|
|
29
|
+
"alphanumName": "DoYehForgeTheCase",
|
|
30
|
+
"file": "05 - Do yeh forge’ the case.txt"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "Compound Words",
|
|
34
|
+
"alphanumName": "CompoundWords",
|
|
35
|
+
"file": "06 - Compound Words.txt"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "Edge cases",
|
|
39
|
+
"alphanumName": "EdgeCases",
|
|
40
|
+
"file": "07 - Edge cases.txt"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "Very long talk",
|
|
44
|
+
"alphanumName": "VeryLongTalk",
|
|
45
|
+
"file": "08 - Very long talk.txt"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
5
|
|
2
|
+
"This is mad!" Ron murmured, moving his free hand gingerly up and down his horse's neck.
|
|
3
|
+
"You'd better hope it stays invisible," said Harry darkly.
|
|
4
|
+
"We all ready, then?" added Harry.
|
|
5
|
+
They all nodded and he saw five pairs of knees tighten beneath their robes.
|
|
6
|
+
Hagrid went away from the Thestrals after their takeoff.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
7
|
|
2
|
+
"Tell us about your summer and I'll tell you about mine, Hagrid." Said Harry.
|
|
3
|
+
Hagrid glared at him through his one open eye.
|
|
4
|
+
"Oh, all right" Hagrid said in a resigned voice.
|
|
5
|
+
He took another fortifying gulp of tea, then said.
|
|
6
|
+
"Well, we set off right after term ended..." Hagrid began.
|
|
7
|
+
"Madame Maxime went with you, then?" Hermione interjected.
|
|
8
|
+
"Yes and she took her dog with her" replied Hagrid.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
10
|
|
2
|
+
Hagrid muttered, "..."
|
|
3
|
+
"Me? You! And, to." said Hagrid.
|
|
4
|
+
"He had to go out. Give me a hand!" said Hagrid.
|
|
5
|
+
"Wait - what about me?" asked Hagrid.
|
|
6
|
+
"Where's your android today?" said Hagrid.
|
|
7
|
+
"yOu AnD mE" shouted Hagrid.
|
|
8
|
+
"VICTORY! forget-me-not! I add it to my to-do list!" shouted Hagrid.
|
|
9
|
+
McHagrid said "back off!"
|
|
10
|
+
"GET OFF, I DON'T WANT AND DON'T GO WITH YOU TO THE CASTLE!" replied fearfully Hagrid.
|
|
11
|
+
"(you), (me), the potato, the tryout, the sandy desert... I should amend the list." said Hagrid.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
11
|
|
2
|
+
"You and me have to go to the dark forest to hunt the half hound and find the hot food!" Hagrid roared.
|
|
3
|
+
"I do not want to go to the forest with you and him!" Ron yelled.
|
|
4
|
+
"Wait! What? How are you doing today? It is hot, hard, and terrifying to find food in the forest..." said Hagrid.
|
|
5
|
+
"You, you, you, and me, me, me, to, to, to, the, the, the forest, forest, forest!" Hagrid mumbled.
|
|
6
|
+
"Harry, you have to find out what happened to the dog, the half hound that we saw in the forest!" Hermione whispered.
|
|
7
|
+
"You have to help me, Harry! The forest is dark and full of bad things, huge dogs and hot fire!" Hagrid panicked.
|
|
8
|
+
"And, if you want, we can go to the pub to get a hot tea." Hagrid proposed.
|
|
9
|
+
"But the huge half hound had a hard tooth that could cut a tough log." Hagrid explained.
|
|
10
|
+
"Me and you, Harry, we are a good team to find the bad dog." Hagrid smiled.
|
|
11
|
+
"Watch yourself!" shouted Hagrid.
|
|
12
|
+
"What you've done is meaningless?!" cried Hagrid.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"This is mad!" Ron murmured, moving his free hand gingerly up and down his horse's neck.
|
|
2
|
+
"You'd better hope it stays invisible," said Harry darkly.
|
|
3
|
+
"We all ready, then?" added Harry.
|
|
4
|
+
They all nodded and he saw five pairs of knees tighten beneath their robes.
|
|
5
|
+
Hagrid went away from the Thestrals after their takeoff.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"Tell us about your summer and I'll tell you about mine, Hagrid." Said Harry.
|
|
2
|
+
Hagrid glared at him through his one open eye.
|
|
3
|
+
"Oh, all righ'" Hagrid said in a resigned voice.
|
|
4
|
+
He took another fortifying gulp of tea, then said.
|
|
5
|
+
"Well, we se' of' righ' after term ende'..." Hagrid began.
|
|
6
|
+
"Madame Maxime went with you, then?" Hermione interjected.
|
|
7
|
+
"Yes an' she took 'er do' with 'er" replied Hagrid.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"Yeh nee' ter come down ter the 'u' with Ron an' meh!" said Hagrid.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"Yeh nee' ter listen ter meh! Tha' three-headed do' an' tha' blast-ended skrew' are dangerous!" warned Hagrid.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Hagrid muttered, "..."
|
|
2
|
+
"Meh? Yeh! An', ter." said Hagrid.
|
|
3
|
+
"He 'a' ter go ou'. Give meh a 'an'!" said Hagrid.
|
|
4
|
+
"Wai' - wha' abou' meh?" asked Hagrid.
|
|
5
|
+
"Where's your androi' today?" said Hagrid.
|
|
6
|
+
"yEh An' mEH" shouted Hagrid.
|
|
7
|
+
"VICTORY! forget-me-not! I ad' it ter my to-do lis'!" shouted Hagrid.
|
|
8
|
+
McHagrid said "back off!"
|
|
9
|
+
"GE' OF', I DON'T WAN' AN' DON'T GO WITH YEH TER THE CASTLE!" replied fearfully Hagrid.
|
|
10
|
+
"(yeh), (meh), the potato, the tryou', the sandy deser'... I shoul' amen' the lis'." said Hagrid.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"Yeh an' meh 'ave ter go ter the dark fores' ter 'un' the 'al' 'oun' an' fin' the 'o' foo'!" Hagrid roared.
|
|
2
|
+
"I do not want to go to the forest with you and him!" Ron yelled.
|
|
3
|
+
"Wai'! Wha'? 'ow are yeh doin' today? It is 'o', 'ar', an' terrifyin' ter fin' foo' in the fores'..." said Hagrid.
|
|
4
|
+
"Yeh, yeh, yeh, an' meh, meh, meh, ter, ter, ter, the, the, the fores', fores', fores'!" Hagrid mumbled.
|
|
5
|
+
"Harry, you have to find out what happened to the dog, the half hound that we saw in the forest!" Hermione whispered.
|
|
6
|
+
"Yeh 'ave ter 'elp meh, 'arry! The fores' is dark an' full of ba' things, 'uge dogs an' 'o' fire!" Hagrid panicked.
|
|
7
|
+
"An', if yeh wan', we can go ter the pub ter ge' a 'o' tea." Hagrid proposed.
|
|
8
|
+
"Bu' the 'uge 'al' 'oun' 'a' a 'ar' tooth tha' coul' cu' a tough lo'." Hagrid explained.
|
|
9
|
+
"Meh an' yeh, 'arry, we are a goo' team ter fin' the ba' do'." Hagrid smiled.
|
|
10
|
+
"Watch yoursel'!" shouted Hagrid.
|
|
11
|
+
"Wha' you've done is meaningless?!" cried Hagrid.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#include <iostream>
|
|
2
|
+
#include <string>
|
|
3
|
+
#include <vector>
|
|
4
|
+
#include <algorithm>
|
|
5
|
+
|
|
6
|
+
using namespace std;
|
|
7
|
+
|
|
8
|
+
int main()
|
|
9
|
+
{
|
|
10
|
+
int n_files;
|
|
11
|
+
cin >> n_files; cin.ignore();
|
|
12
|
+
for (int i = 0; i < n_files; i++) {
|
|
13
|
+
string preexisting_file;
|
|
14
|
+
int file_time;
|
|
15
|
+
cin >> preexisting_file >> file_time; cin.ignore();
|
|
16
|
+
}
|
|
17
|
+
int n_goal_targets;
|
|
18
|
+
cin >> n_goal_targets; cin.ignore();
|
|
19
|
+
for (int i = 0; i < n_goal_targets; i++) {
|
|
20
|
+
string goal_target;
|
|
21
|
+
cin >> goal_target; cin.ignore();
|
|
22
|
+
}
|
|
23
|
+
int n_lines;
|
|
24
|
+
cin >> n_lines; cin.ignore();
|
|
25
|
+
for (int i = 0; i < n_lines; i++) {
|
|
26
|
+
string makefile_line;
|
|
27
|
+
getline(cin, makefile_line);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Write an answer using cout. DON'T FORGET THE "<< endl"
|
|
31
|
+
// To debug: cerr << "Debug messages..." << endl;
|
|
32
|
+
|
|
33
|
+
cout << "[Build complete]" << endl;
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import java.util.*;
|
|
2
|
+
import java.io.*;
|
|
3
|
+
import java.math.*;
|
|
4
|
+
|
|
5
|
+
class Solution {
|
|
6
|
+
|
|
7
|
+
public static void main(String args[]) {
|
|
8
|
+
Scanner in = new Scanner(System.in);
|
|
9
|
+
int nFiles = in.nextInt();
|
|
10
|
+
for (int i = 0; i < nFiles; i++) {
|
|
11
|
+
String preexistingFile = in.next();
|
|
12
|
+
int fileTime = in.nextInt();
|
|
13
|
+
}
|
|
14
|
+
int nGoalTargets = in.nextInt();
|
|
15
|
+
for (int i = 0; i < nGoalTargets; i++) {
|
|
16
|
+
String goalTarget = in.next();
|
|
17
|
+
}
|
|
18
|
+
int nLines = in.nextInt();
|
|
19
|
+
if (in.hasNextLine()) {
|
|
20
|
+
in.nextLine();
|
|
21
|
+
}
|
|
22
|
+
for (int i = 0; i < nLines; i++) {
|
|
23
|
+
String makefileLine = in.nextLine();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Write an answer using System.out.println()
|
|
27
|
+
// To debug: System.err.println("Debug messages...");
|
|
28
|
+
|
|
29
|
+
System.out.println("[Build complete]");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const nFiles = parseInt(readline());
|
|
2
|
+
for (let i = 0; i < nFiles; i++) {
|
|
3
|
+
var inputs = readline().split(' ');
|
|
4
|
+
const preexistingFile = inputs[0];
|
|
5
|
+
const fileTime = parseInt(inputs[1]);
|
|
6
|
+
}
|
|
7
|
+
const nGoalTargets = parseInt(readline());
|
|
8
|
+
var inputs = readline().split(' ');
|
|
9
|
+
for (let i = 0; i < nGoalTargets; i++) {
|
|
10
|
+
const goalTarget = inputs[i];
|
|
11
|
+
}
|
|
12
|
+
const nLines = parseInt(readline());
|
|
13
|
+
for (let i = 0; i < nLines; i++) {
|
|
14
|
+
const makefileLine = readline();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Write an answer using console.log()
|
|
18
|
+
// To debug: console.error('Debug messages...');
|
|
19
|
+
|
|
20
|
+
console.log('[Build complete]');
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
fscanf(STDIN, "%d", $nFiles);
|
|
3
|
+
for ($i = 0; $i < $nFiles; $i++)
|
|
4
|
+
{
|
|
5
|
+
fscanf(STDIN, "%s %d", $preexistingFile, $fileTime);
|
|
6
|
+
}
|
|
7
|
+
fscanf(STDIN, "%d", $nGoalTargets);
|
|
8
|
+
$inputs = explode(" ", fgets(STDIN));
|
|
9
|
+
for ($i = 0; $i < $nGoalTargets; $i++)
|
|
10
|
+
{
|
|
11
|
+
$goalTarget = ($inputs[$i]);
|
|
12
|
+
}
|
|
13
|
+
fscanf(STDIN, "%d", $nLines);
|
|
14
|
+
for ($i = 0; $i < $nLines; $i++)
|
|
15
|
+
{
|
|
16
|
+
$makefileLine = stream_get_line(STDIN, 100 + 1, "\n");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
20
|
+
// To debug: error_log(var_export($var, true)); (equivalent to var_dump)
|
|
21
|
+
|
|
22
|
+
echo("[Build complete]\n");
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const nFiles: number = parseInt(readline());
|
|
2
|
+
for (let i = 0; i < nFiles; i++) {
|
|
3
|
+
var inputs: string[] = readline().split(' ');
|
|
4
|
+
const preexistingFile: string = inputs[0];
|
|
5
|
+
const fileTime: number = parseInt(inputs[1]);
|
|
6
|
+
}
|
|
7
|
+
const nGoalTargets: number = parseInt(readline());
|
|
8
|
+
var inputs: string[] = readline().split(' ');
|
|
9
|
+
for (let i = 0; i < nGoalTargets; i++) {
|
|
10
|
+
const goalTarget: string = inputs[i];
|
|
11
|
+
}
|
|
12
|
+
const nLines: number = parseInt(readline());
|
|
13
|
+
for (let i = 0; i < nLines; i++) {
|
|
14
|
+
const makefileLine: string = readline();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Write an answer using console.log()
|
|
18
|
+
// To debug: console.error('Debug messages...');
|
|
19
|
+
|
|
20
|
+
console.log('[Build complete]');
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"path": "medium/SimpleMakefiles",
|
|
3
|
+
"name": "Simple Makefiles",
|
|
4
|
+
"alphanumName": "SimpleMakefiles",
|
|
5
|
+
"link": "https://www.codingame.com/ide/puzzle/simple-makefiles",
|
|
6
|
+
"tests": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Problem statement example",
|
|
9
|
+
"alphanumName": "ProblemStatementExample",
|
|
10
|
+
"file": "01 - Problem statement example.txt"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "Up-to-date check and partial rebuild",
|
|
14
|
+
"alphanumName": "UptodateCheckAndPartialRebuild",
|
|
15
|
+
"file": "02 - Up-to-date check and partial rebuild.txt"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "Single rule with no actions",
|
|
19
|
+
"alphanumName": "SingleRuleWithNoActions",
|
|
20
|
+
"file": "03 - Single rule with no actions.txt"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "Up-to-date ages",
|
|
24
|
+
"alphanumName": "UptodateAges",
|
|
25
|
+
"file": "04 - Up-to-date ages.txt"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "Multiple goal targets",
|
|
29
|
+
"alphanumName": "MultipleGoalTargets",
|
|
30
|
+
"file": "05 - Multiple goal targets.txt"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "No-action intermediates and unused rules",
|
|
34
|
+
"alphanumName": "NoactionIntermediatesAndUnusedRules",
|
|
35
|
+
"file": "06 - No-action intermediates and unused rules.txt"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "Multiple targets with identical prerequisites",
|
|
39
|
+
"alphanumName": "MultipleTargetsWithIdenticalPrerequisites",
|
|
40
|
+
"file": "07 - Multiple targets with identical prerequisites.txt"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "Built-in macros and comments",
|
|
44
|
+
"alphanumName": "BuiltinMacrosAndComments",
|
|
45
|
+
"file": "08 - Built-in macros and comments.txt"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "Same target in multiple rules",
|
|
49
|
+
"alphanumName": "SameTargetInMultipleRules",
|
|
50
|
+
"file": "09 - Same target in multiple rules.txt"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "Large partial rebuild",
|
|
54
|
+
"alphanumName": "LargePartialRebuild",
|
|
55
|
+
"file": "10 - Large partial rebuild.txt"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "Cycle detection",
|
|
59
|
+
"alphanumName": "CycleDetection",
|
|
60
|
+
"file": "11 - Cycle detection.txt"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "Unreachable cycle detection",
|
|
64
|
+
"alphanumName": "UnreachableCycleDetection",
|
|
65
|
+
"file": "12 - Unreachable cycle detection.txt"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "All rebuild features combined",
|
|
69
|
+
"alphanumName": "AllRebuildFeaturesCombined",
|
|
70
|
+
"file": "13 - All rebuild features combined.txt"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "Multiple action lines per rule",
|
|
74
|
+
"alphanumName": "MultipleActionLinesPerRule",
|
|
75
|
+
"file": "14 - Multiple action lines per rule.txt"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "Kitchen sink",
|
|
79
|
+
"alphanumName": "KitchenSink",
|
|
80
|
+
"file": "15 - Kitchen sink.txt"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
4
|
|
2
|
+
data.raw 100
|
|
3
|
+
result-a 90
|
|
4
|
+
result-b 100
|
|
5
|
+
result-c 200
|
|
6
|
+
4
|
|
7
|
+
result-d result-a result-b result-c
|
|
8
|
+
8
|
|
9
|
+
result-a: data.raw
|
|
10
|
+
process $< -o $@
|
|
11
|
+
result-b: data.raw
|
|
12
|
+
process $< -o $@
|
|
13
|
+
result-c: data.raw
|
|
14
|
+
process $< -o $@
|
|
15
|
+
result-d:
|
|
16
|
+
generate result-d
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
4
|
|
2
|
+
seed.dat 100
|
|
3
|
+
output 50
|
|
4
|
+
config 999
|
|
5
|
+
cooked.dat 80
|
|
6
|
+
1
|
|
7
|
+
final
|
|
8
|
+
11
|
|
9
|
+
final: cooked.dat config output stage
|
|
10
|
+
publish $^
|
|
11
|
+
cooked.dat: seed.dat
|
|
12
|
+
cook $< -o $@
|
|
13
|
+
stage: cooked.dat
|
|
14
|
+
output:
|
|
15
|
+
create output
|
|
16
|
+
data:
|
|
17
|
+
fetch data
|
|
18
|
+
unused: config
|
|
19
|
+
skip
|
package/config/medium/SimpleMakefiles/input/07 - Multiple targets with identical prerequisites.txt
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
4
|
|
2
|
+
base.c 50
|
|
3
|
+
extra.c 50
|
|
4
|
+
base.o 100
|
|
5
|
+
extra.o 100
|
|
6
|
+
1
|
|
7
|
+
top
|
|
8
|
+
10
|
|
9
|
+
top:left right
|
|
10
|
+
merge $^
|
|
11
|
+
left: base.o extra.o
|
|
12
|
+
link-left $^
|
|
13
|
+
right: base.o extra.o
|
|
14
|
+
link-right $^
|
|
15
|
+
base.o: base.c
|
|
16
|
+
cc -c $< -o $@
|
|
17
|
+
extra.o: extra.c
|
|
18
|
+
cc -c $< -o $@
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
3
|
|
2
|
+
raw-b 100
|
|
3
|
+
part-a 80
|
|
4
|
+
raw-a 100
|
|
5
|
+
1
|
|
6
|
+
result
|
|
7
|
+
12
|
|
8
|
+
# Build the final product
|
|
9
|
+
result: part-a part-b raw-c
|
|
10
|
+
join $^ > $@
|
|
11
|
+
part-a: raw-a
|
|
12
|
+
echo building part-a
|
|
13
|
+
convert $< $@
|
|
14
|
+
part-b: raw-b
|
|
15
|
+
convert $< $@
|
|
16
|
+
raw-a:
|
|
17
|
+
fetch raw-a # get data
|
|
18
|
+
raw-c:
|
|
19
|
+
fetch raw-c
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
5
|
|
2
|
+
part1.c 100
|
|
3
|
+
part2.c 100
|
|
4
|
+
header.h 100
|
|
5
|
+
part1.o 50
|
|
6
|
+
part2.o 200
|
|
7
|
+
1
|
|
8
|
+
app
|
|
9
|
+
14
|
|
10
|
+
app: lib
|
|
11
|
+
link $^
|
|
12
|
+
lib: part1.o header.h
|
|
13
|
+
stage1 $<
|
|
14
|
+
other: part1.o header.h
|
|
15
|
+
stage1 $<
|
|
16
|
+
lib: part2.o header.h
|
|
17
|
+
stage2 $^
|
|
18
|
+
part1.o: part1.c
|
|
19
|
+
cc -c $< -o $@
|
|
20
|
+
part2.o: part2.c
|
|
21
|
+
cc -c $< -o $@
|
|
22
|
+
other:
|
|
23
|
+
echo "extra target built"
|