Using Swift for AtCoder Reasons:
- It’s difficult to relearn C++, and it doesn’t seem very meaningful.
- It seems interesting to try something new.
- C++ is only necessary for the main competition in JOI, and I don’t think I’ll reach the level where the main competition becomes important.
- It’s more about whether I can participate in the main competition…?
- Unless I have a sudden growth in skills in the future, it’s a different story.
- I prefer Swift.
Things to do:
-
Set up input and output.
-
Implement missing features similar to those in the STL.
-
Implement template-based algorithms.
-
Understand the computational complexity of array operations in Swift.
-
https://qiita.com/taka1068/items/e487e7becd4b1644ec86
-
Let’s pursue performance using Swift’s LazySequence/LazyCollection.
-
-
https://qiita.com/yum_fishing/items/7592a56f7e9dbeef8e75
-
Master the use of map, compactMap, and flatMap in Swift.
-
-
https://rizumita.medium.com/swiftのfor-inとmapやreduceの速度を比べてみる-21d059c02a85
-
Comparing the speed of for-in, map, and reduce in Swift.
-
-
Performance testing
0.00007.998943328857422 // Immediately after starting 0.00024902820587158203 // Reading the first line of input 0.0002950429916381836 // Reading the second line 0.0003980398178100586 //… 0.0004029273986816406 // Reading the last line 0.00040793418884277344 // Starting the data processing loop 0.00040900707244873047 0.0004099607467651367 0.00041103363037109375 0.0004119873046875 // Ending the processing loop 0.00041294097900390625 // Output finished
- It takes time to read the first line…
- So, I guess it’s not a big problem if I just loop through it?