@cyrilverloop/codingame-configuration 1.1.2 → 1.1.3
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 +4 -0
- package/CONTRIBUTING.md +6 -2
- package/README.md +1 -1
- package/config/easy/ABunnyAndCarrots/code/CGCode.js +15 -0
- package/config/easy/ABunnyAndCarrots/code/CGCode.php +16 -0
- package/config/easy/ABunnyAndCarrots/config.json +28 -0
- package/config/easy/ABunnyAndCarrots/input/01 - small garden.txt +3 -0
- package/config/easy/ABunnyAndCarrots/input/02 - a bigger garden.txt +3 -0
- package/config/easy/ABunnyAndCarrots/input/03 - wide garden.txt +3 -0
- package/config/easy/ABunnyAndCarrots/input/04 - so many carrots!!.txt +3 -0
- package/config/easy/ABunnyAndCarrots/output/01 - small garden.txt +4 -0
- package/config/easy/ABunnyAndCarrots/output/02 - a bigger garden.txt +6 -0
- package/config/easy/ABunnyAndCarrots/output/03 - wide garden.txt +6 -0
- package/config/easy/ABunnyAndCarrots/output/04 - so many carrots!!.txt +80 -0
- package/config/easy/AChildsPlay/code/CGCode.js +12 -0
- package/config/easy/AChildsPlay/code/CGCode.php +12 -0
- package/config/easy/AChildsPlay/config.json +63 -0
- package/config/easy/AChildsPlay/input/01 - test example.txt +8 -0
- package/config/easy/AChildsPlay/input/02 - test real case.txt +10 -0
- package/config/easy/AChildsPlay/input/03 - test 3.txt +12 -0
- package/config/easy/AChildsPlay/input/04 - test 4.txt +12 -0
- package/config/easy/AChildsPlay/input/05 - test 5.txt +12 -0
- package/config/easy/AChildsPlay/input/06 - test 6.txt +7 -0
- package/config/easy/AChildsPlay/input/07 - test 7.txt +6 -0
- package/config/easy/AChildsPlay/input/08 - test 8.txt +7 -0
- package/config/easy/AChildsPlay/input/09 - test 9.txt +7 -0
- package/config/easy/AChildsPlay/input/10 - loop detection 1.txt +8 -0
- package/config/easy/AChildsPlay/input/11 - loop detection 2.txt +8 -0
- package/config/easy/AChildsPlay/output/01 - test example.txt +1 -0
- package/config/easy/AChildsPlay/output/02 - test real case.txt +1 -0
- package/config/easy/AChildsPlay/output/03 - test 3.txt +1 -0
- package/config/easy/AChildsPlay/output/04 - test 4.txt +1 -0
- package/config/easy/AChildsPlay/output/05 - test 5.txt +1 -0
- package/config/easy/AChildsPlay/output/06 - test 6.txt +1 -0
- package/config/easy/AChildsPlay/output/07 - test 7.txt +1 -0
- package/config/easy/AChildsPlay/output/08 - test 8.txt +1 -0
- package/config/easy/AChildsPlay/output/09 - test 9.txt +1 -0
- package/config/easy/AChildsPlay/output/10 - loop detection 1.txt +1 -0
- package/config/easy/AChildsPlay/output/11 - loop detection 2.txt +1 -0
- package/config/easy/Defibrillators/code/CGCode.php +4 -4
- package/config/easy/HorseRacingDuals/code/CGCode.php +2 -2
- package/config/easy/MIMEType/code/CGCode.php +4 -4
- package/config/easy/Temperatures/code/CGCode.php +2 -2
- package/config/easy/Unary/code/CGCode.php +1 -1
- package/config/expert/MusicScores/code/CGCode.php +2 -2
- package/config/expert/TheResistance/code/CGCode.php +3 -3
- package/config/hard/BlunderEpisode2/code/CGCode.php +2 -2
- package/config/hard/BlunderEpisode3/code/CGCode.php +2 -2
- package/config/hard/CGXFormatter/code/CGCode.php +2 -2
- package/config/hard/GenomeSequencing/code/CGCode.php +2 -2
- package/config/hard/RollerCoaster/code/CGCode.php +2 -2
- package/config/hard/SuperComputer/code/CGCode.php +2 -2
- package/config/hard/TANNetwork/code/CGCode.php +6 -6
- package/config/hard/Winamax/code/CGCode.php +2 -2
- package/config/medium/BlunderEpisode1/code/CGCode.php +2 -2
- package/config/medium/ConwaySequence/code/CGCode.php +2 -2
- package/config/medium/DwarfsStandingOnTheShouldersOfGiants/code/CGCode.php +2 -2
- package/config/medium/MayanCalculation/code/CGCode.php +7 -7
- package/config/medium/NetworkCabling/code/CGCode.php +2 -2
- package/config/medium/Scrabble/code/CGCode.php +3 -3
- package/config/medium/StockExchangeLosses/code/CGCode.php +2 -2
- package/config/medium/TelephoneNumbers/code/CGCode.php +2 -2
- package/config/medium/TheGift/code/CGCode.php +3 -3
- package/config/medium/War/code/CGCode.php +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ 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.1.3] - 2024-05-29
|
|
8
|
+
### Fixed
|
|
9
|
+
- `STDIN` variables in default PHP codes.
|
|
10
|
+
|
|
7
11
|
## [1.1.2] - 2024-05-24
|
|
8
12
|
### Fixed
|
|
9
13
|
- Package version for NPM.
|
package/CONTRIBUTING.md
CHANGED
|
@@ -44,7 +44,9 @@ The `config.json` file MUST use the following architecture :
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
* `path` : MUST be the path to the configuration;
|
|
47
|
-
* `name` : MUST be the name of the puzzle from CodinGame
|
|
47
|
+
* `name` : MUST be the name of the puzzle from CodinGame.
|
|
48
|
+
Single quote `'` MUST be replaced by `‘` for opening and by `’` for closing and apostrophe.
|
|
49
|
+
Double quote `"` MUST be replaced by `«` for opening and by `»` for closing;
|
|
48
50
|
* `alphanumName` : MUST be the name of the puzzle with only alpha-numeric characters (no space or special character).
|
|
49
51
|
It MUST be case insensitive and unique amongst all configurations.
|
|
50
52
|
It MUST start with a letter. The corresponding regex is : `[a-zA-Z]{1}[a-zA-Z0-9]{0,}`;
|
|
@@ -52,7 +54,9 @@ It MUST start with a letter. The corresponding regex is : `[a-zA-Z]{1}[a-zA-Z0-9
|
|
|
52
54
|
* `tests` : MUST list every tests from CodinGame in the same order.
|
|
53
55
|
|
|
54
56
|
Each test MUST contain :
|
|
55
|
-
* `name` : MUST be the name of the test from CodinGame
|
|
57
|
+
* `name` : MUST be the name of the test from CodinGame.
|
|
58
|
+
Single quote `'` MUST be replaced by `‘` for opening and by `’` for closing and apostrophe.
|
|
59
|
+
Double quote `"` MUST be replaced by `«` for opening and by `»` for closing;
|
|
56
60
|
* `alphanumName` : MUST be the name of the test with only alpha-numeric characters (no space or special character).
|
|
57
61
|
It MUST be case insensitive and unique amongst all tests of the current configuration.
|
|
58
62
|
It MUST start with a letter. The corresponding regex is : `[a-zA-Z]{1}[a-zA-Z0-9]{0,}`;
|
package/README.md
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var inputs = readline().split(' ');
|
|
2
|
+
const M = parseInt(inputs[0]);
|
|
3
|
+
const N = parseInt(inputs[1]);
|
|
4
|
+
const t = parseInt(readline());
|
|
5
|
+
var inputs = readline().split(' ');
|
|
6
|
+
for (let i = 0; i < t; i++) {
|
|
7
|
+
const choices = parseInt(inputs[i]);
|
|
8
|
+
}
|
|
9
|
+
for (let i = 0; i < t; i++) {
|
|
10
|
+
|
|
11
|
+
// Write an answer using console.log()
|
|
12
|
+
// To debug: console.error('Debug messages...');
|
|
13
|
+
|
|
14
|
+
console.log('perimeter');
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
fscanf(STDIN, "%d %d", $M, $N);
|
|
3
|
+
fscanf(STDIN, "%d", $t);
|
|
4
|
+
$inputs = explode(" ", fgets(STDIN));
|
|
5
|
+
for ($i = 0; $i < $t; $i++)
|
|
6
|
+
{
|
|
7
|
+
$choices = intval($inputs[$i]);
|
|
8
|
+
}
|
|
9
|
+
for ($i = 0; $i < $t; $i++)
|
|
10
|
+
{
|
|
11
|
+
|
|
12
|
+
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
13
|
+
// To debug: error_log(var_export($var, true)); (equivalent to var_dump)
|
|
14
|
+
|
|
15
|
+
echo("perimeter\n");
|
|
16
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"path": "easy/ABunnyAndCarrots",
|
|
3
|
+
"name": "A Bunny and Carrots",
|
|
4
|
+
"alphanumName": "aBunnyAndCarrots",
|
|
5
|
+
"link": "https://www.codingame.com/ide/puzzle/a-bunny-and-carrots",
|
|
6
|
+
"tests": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Small Garden",
|
|
9
|
+
"alphanumName": "smallGarden",
|
|
10
|
+
"file": "01 - small garden.txt"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "A Bigger Garden",
|
|
14
|
+
"alphanumName": "aBiggerGarden",
|
|
15
|
+
"file": "02 - a bigger garden.txt"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "Wide Garden",
|
|
19
|
+
"alphanumName": "wideGarden",
|
|
20
|
+
"file": "03 - wide garden.txt"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "So Many Carrots!!",
|
|
24
|
+
"alphanumName": "soManyCarrots",
|
|
25
|
+
"file": "04 - so many carrots!!.txt"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
82
|
|
2
|
+
84
|
|
3
|
+
84
|
|
4
|
+
86
|
|
5
|
+
88
|
|
6
|
+
88
|
|
7
|
+
88
|
|
8
|
+
88
|
|
9
|
+
90
|
|
10
|
+
92
|
|
11
|
+
94
|
|
12
|
+
96
|
|
13
|
+
98
|
|
14
|
+
98
|
|
15
|
+
96
|
|
16
|
+
98
|
|
17
|
+
98
|
|
18
|
+
96
|
|
19
|
+
96
|
|
20
|
+
98
|
|
21
|
+
100
|
|
22
|
+
100
|
|
23
|
+
100
|
|
24
|
+
100
|
|
25
|
+
98
|
|
26
|
+
100
|
|
27
|
+
102
|
|
28
|
+
104
|
|
29
|
+
106
|
|
30
|
+
108
|
|
31
|
+
106
|
|
32
|
+
108
|
|
33
|
+
108
|
|
34
|
+
110
|
|
35
|
+
112
|
|
36
|
+
110
|
|
37
|
+
112
|
|
38
|
+
114
|
|
39
|
+
116
|
|
40
|
+
118
|
|
41
|
+
120
|
|
42
|
+
120
|
|
43
|
+
120
|
|
44
|
+
118
|
|
45
|
+
120
|
|
46
|
+
122
|
|
47
|
+
122
|
|
48
|
+
124
|
|
49
|
+
124
|
|
50
|
+
122
|
|
51
|
+
120
|
|
52
|
+
122
|
|
53
|
+
120
|
|
54
|
+
120
|
|
55
|
+
118
|
|
56
|
+
116
|
|
57
|
+
114
|
|
58
|
+
116
|
|
59
|
+
114
|
|
60
|
+
112
|
|
61
|
+
114
|
|
62
|
+
112
|
|
63
|
+
110
|
|
64
|
+
110
|
|
65
|
+
112
|
|
66
|
+
110
|
|
67
|
+
110
|
|
68
|
+
112
|
|
69
|
+
114
|
|
70
|
+
114
|
|
71
|
+
116
|
|
72
|
+
114
|
|
73
|
+
112
|
|
74
|
+
112
|
|
75
|
+
112
|
|
76
|
+
114
|
|
77
|
+
114
|
|
78
|
+
112
|
|
79
|
+
114
|
|
80
|
+
112
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var inputs = readline().split(' ');
|
|
2
|
+
const w = parseInt(inputs[0]);
|
|
3
|
+
const h = parseInt(inputs[1]);
|
|
4
|
+
const n = parseInt(readline());
|
|
5
|
+
for (let i = 0; i < h; i++) {
|
|
6
|
+
const line = readline();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Write an answer using console.log()
|
|
10
|
+
// To debug: console.error('Debug messages...');
|
|
11
|
+
|
|
12
|
+
console.log('answer');
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
fscanf(STDIN, "%d %d", $w, $h);
|
|
3
|
+
fscanf(STDIN, "%d", $n);
|
|
4
|
+
for ($i = 0; $i < $h; $i++)
|
|
5
|
+
{
|
|
6
|
+
$line = stream_get_line(STDIN, 500 + 1, "\n");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
10
|
+
// To debug: error_log(var_export($var, true)); (equivalent to var_dump)
|
|
11
|
+
|
|
12
|
+
echo("answer\n");
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"path": "easy/AChildsPlay",
|
|
3
|
+
"name": "A child’s play",
|
|
4
|
+
"alphanumName": "aChildsPlay",
|
|
5
|
+
"link": "https://www.codingame.com/ide/puzzle/a-childs-play",
|
|
6
|
+
"tests": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Test example",
|
|
9
|
+
"alphanumName": "testExample",
|
|
10
|
+
"file": "01 - test example.txt"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "Test real case",
|
|
14
|
+
"alphanumName": "testRealCase",
|
|
15
|
+
"file": "02 - test real case.txt"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "Test 3",
|
|
19
|
+
"alphanumName": "test3",
|
|
20
|
+
"file": "03 - test 3.txt"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "Test 4",
|
|
24
|
+
"alphanumName": "test4",
|
|
25
|
+
"file": "04 - test 4.txt"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "Test 5",
|
|
29
|
+
"alphanumName": "test5",
|
|
30
|
+
"file": "05 - test 5.txt"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "Test 6",
|
|
34
|
+
"alphanumName": "test6",
|
|
35
|
+
"file": "06 - test 6.txt"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "Test 7",
|
|
39
|
+
"alphanumName": "test7",
|
|
40
|
+
"file": "07 - test 7.txt"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "Test 8",
|
|
44
|
+
"alphanumName": "test8",
|
|
45
|
+
"file": "08 - test 8.txt"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "Test 9",
|
|
49
|
+
"alphanumName": "test9",
|
|
50
|
+
"file": "09 - test 9.txt"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "Loop detection 1",
|
|
54
|
+
"alphanumName": "loopDetection1",
|
|
55
|
+
"file": "10 - loop detection 1.txt"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "Loop detection 2",
|
|
59
|
+
"alphanumName": "loopDetection2",
|
|
60
|
+
"file": "11 - loop detection 2.txt"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
20 10
|
|
2
|
+
1234567898765434
|
|
3
|
+
...#.......#........
|
|
4
|
+
.......#..........#.
|
|
5
|
+
..#O........#.......
|
|
6
|
+
......#.............
|
|
7
|
+
....................
|
|
8
|
+
........#......#....
|
|
9
|
+
....................
|
|
10
|
+
..#......#..........
|
|
11
|
+
..............#.....
|
|
12
|
+
..................#.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4 2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6 6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2 3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1 3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5 4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2 2
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
fscanf(
|
|
3
|
-
fscanf(
|
|
4
|
-
fscanf(
|
|
2
|
+
fscanf(STDIN, "%s", $LON);
|
|
3
|
+
fscanf(STDIN, "%s", $LAT);
|
|
4
|
+
fscanf(STDIN, "%d", $N);
|
|
5
5
|
for ($i = 0; $i < $N; $i++) {
|
|
6
|
-
$DEFIB = stream_get_line(
|
|
6
|
+
$DEFIB = stream_get_line(STDIN, 256 + 1, "\n");
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
// $N: Number of elements which make up the association table.
|
|
3
|
-
fscanf(
|
|
3
|
+
fscanf(STDIN, "%d", $N);
|
|
4
4
|
// $Q: Number Q of file names to be analyzed.
|
|
5
|
-
fscanf(
|
|
5
|
+
fscanf(STDIN, "%d", $Q);
|
|
6
6
|
for ($i = 0; $i < $N; $i++) {
|
|
7
7
|
// $EXT: file extension
|
|
8
8
|
// $MT: MIME type.
|
|
9
|
-
fscanf(
|
|
9
|
+
fscanf(STDIN, "%s %s", $EXT, $MT);
|
|
10
10
|
}
|
|
11
11
|
for ($i = 0; $i < $Q; $i++) {
|
|
12
|
-
$FNAME = stream_get_line(
|
|
12
|
+
$FNAME = stream_get_line(STDIN, 256 + 1, "\n");// One file name per line.
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
// $n: the number of temperatures to analyse
|
|
3
|
-
fscanf(
|
|
4
|
-
$inputs = explode(" ", fgets(
|
|
3
|
+
fscanf(STDIN, "%d", $n);
|
|
4
|
+
$inputs = explode(" ", fgets(STDIN));
|
|
5
5
|
for ($i = 0; $i < $n; $i++) {
|
|
6
6
|
$t = intval($inputs[$i]); // a temperature expressed as an integer ranging from -273 to 5526
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
fscanf(
|
|
3
|
-
$IMAGE = stream_get_line(
|
|
2
|
+
fscanf(STDIN, "%d %d", $W, $H);
|
|
3
|
+
$IMAGE = stream_get_line(STDIN, 256 + 1, "\n");
|
|
4
4
|
|
|
5
5
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
6
6
|
// To debug: error_log(var_export($var, true)); (equivalent to var_dump)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
fscanf(
|
|
3
|
-
fscanf(
|
|
2
|
+
fscanf(STDIN, "%s", $L);
|
|
3
|
+
fscanf(STDIN, "%d", $N);
|
|
4
4
|
for ($i = 0; $i < $N; $i++)
|
|
5
5
|
{
|
|
6
|
-
fscanf(
|
|
6
|
+
fscanf(STDIN, "%s", $W);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
fscanf(
|
|
2
|
+
fscanf(STDIN, "%d", $N);
|
|
3
3
|
for ($i = 0; $i < $N; $i++)
|
|
4
4
|
{
|
|
5
|
-
$room = stream_get_line(
|
|
5
|
+
$room = stream_get_line(STDIN, 256 + 1, "\n");
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
fscanf(
|
|
2
|
+
fscanf(STDIN, "%d", $N);
|
|
3
3
|
for ($i = 0; $i < $N; $i++)
|
|
4
4
|
{
|
|
5
|
-
$cgxLine = stream_get_line(
|
|
5
|
+
$cgxLine = stream_get_line(STDIN, 1000 + 1, "\n");
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
fscanf(
|
|
3
|
-
fscanf(
|
|
4
|
-
fscanf(
|
|
2
|
+
fscanf(STDIN, "%s", $startPoint);
|
|
3
|
+
fscanf(STDIN, "%s", $endPoint);
|
|
4
|
+
fscanf(STDIN, "%d", $N);
|
|
5
5
|
for ($i = 0; $i < $N; $i++)
|
|
6
6
|
{
|
|
7
|
-
$stopName = stream_get_line(
|
|
7
|
+
$stopName = stream_get_line(STDIN, 256 + 1, "\n");
|
|
8
8
|
}
|
|
9
|
-
fscanf(
|
|
9
|
+
fscanf(STDIN, "%d", $M);
|
|
10
10
|
for ($i = 0; $i < $M; $i++)
|
|
11
11
|
{
|
|
12
|
-
$route = stream_get_line(
|
|
12
|
+
$route = stream_get_line(STDIN, 256 + 1, "\n");
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
fscanf(
|
|
2
|
+
fscanf(STDIN, "%d %d", $L, $C);
|
|
3
3
|
for ($i = 0; $i < $L; $i++)
|
|
4
4
|
{
|
|
5
|
-
$row = stream_get_line(
|
|
5
|
+
$row = stream_get_line(STDIN, 101 + 1, "\n");
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
// $n: the number of relationships of influence
|
|
3
|
-
fscanf(
|
|
3
|
+
fscanf(STDIN, "%d", $n);
|
|
4
4
|
for ($i = 0; $i < $n; $i++)
|
|
5
5
|
{
|
|
6
6
|
// $x: a relationship of influence between two people (x influences y)
|
|
7
|
-
fscanf(
|
|
7
|
+
fscanf(STDIN, "%d %d", $x, $y);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
fscanf(
|
|
2
|
+
fscanf(STDIN, "%d %d", $L, $H);
|
|
3
3
|
for ($i = 0; $i < $H; $i++) {
|
|
4
|
-
fscanf(
|
|
4
|
+
fscanf(STDIN, "%s", $numeral);
|
|
5
5
|
}
|
|
6
|
-
fscanf(
|
|
6
|
+
fscanf(STDIN, "%d", $S1);
|
|
7
7
|
for ($i = 0; $i < $S1; $i++) {
|
|
8
|
-
fscanf(
|
|
8
|
+
fscanf(STDIN, "%s", $num1Line);
|
|
9
9
|
}
|
|
10
|
-
fscanf(
|
|
10
|
+
fscanf(STDIN, "%d", $S2);
|
|
11
11
|
for ($i = 0; $i < $S2; $i++) {
|
|
12
|
-
fscanf(
|
|
12
|
+
fscanf(STDIN, "%s", $num2Line);
|
|
13
13
|
}
|
|
14
|
-
fscanf(
|
|
14
|
+
fscanf(STDIN, "%s", $operation);
|
|
15
15
|
|
|
16
16
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
17
17
|
// To debug: error_log(var_export($var, true)); (equivalent to var_dump)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
fscanf(
|
|
2
|
+
fscanf(STDIN, "%d", $N);
|
|
3
3
|
for ($i = 0; $i < $N; $i++)
|
|
4
4
|
{
|
|
5
|
-
$W = stream_get_line(
|
|
5
|
+
$W = stream_get_line(STDIN, 30 + 1, "\n");
|
|
6
6
|
}
|
|
7
|
-
$LETTERS = stream_get_line(
|
|
7
|
+
$LETTERS = stream_get_line(STDIN, 7 + 1, "\n");
|
|
8
8
|
|
|
9
9
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
10
10
|
// To debug: error_log(var_export($var, true)); (equivalent to var_dump)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<?php
|
|
2
|
-
fscanf(
|
|
3
|
-
fscanf(
|
|
2
|
+
fscanf(STDIN, "%d", $N);
|
|
3
|
+
fscanf(STDIN, "%d", $C);
|
|
4
4
|
for ($i = 0; $i < $N; $i++)
|
|
5
5
|
{
|
|
6
|
-
fscanf(
|
|
6
|
+
fscanf(STDIN, "%d", $B);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
// $n: the number of cards for player 1
|
|
3
|
-
fscanf(
|
|
3
|
+
fscanf(STDIN, "%d", $n);
|
|
4
4
|
for ($i = 0; $i < $n; $i++)
|
|
5
5
|
{
|
|
6
6
|
// $cardp1: the n cards of player 1
|
|
7
|
-
fscanf(
|
|
7
|
+
fscanf(STDIN, "%s", $cardp1);
|
|
8
8
|
}
|
|
9
9
|
// $m: the number of cards for player 2
|
|
10
|
-
fscanf(
|
|
10
|
+
fscanf(STDIN, "%d", $m);
|
|
11
11
|
for ($i = 0; $i < $m; $i++)
|
|
12
12
|
{
|
|
13
13
|
// $cardp2: the m cards of player 2
|
|
14
|
-
fscanf(
|
|
14
|
+
fscanf(STDIN, "%s", $cardp2);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
|