This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'dart:math'; | |
/** | |
* Auto-generated code below aims at helping you parse | |
* the standard input according to the problem statement. | |
**/ | |
Point lightOfPowerPoint; | |
Point thorPoint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../../salesforce/s1-elements/scaffold/s1AppScaffold.html"> | |
<link rel="import" href="../../salesforce/s1-elements/scaffold/s1PageContainer.html"> | |
<link rel="import" href="../../salesforce/s1-elements/s1StagedNavigationStageLeft.html"> | |
<link rel="import" href="../../salesforce/s1-elements/s1StagedNavigationNotifications.html"> | |
<link rel="import" href="../../salesforce/s1-elements/s1AnchorLightDefault.html"> | |
<link rel="import" href="../../salesforce/s1-elements/s1ListWithLabels.html"> | |
<link rel="import" href="../../salesforce/s1-elements/s1AnchorDark.html"> | |
<link rel="import" href="../../salesforce/s1-elements/s1IndicatorDotsLightBackground.html"> | |
<link rel="import" href="../../salesforce/s1-elements/s1ButtonGroups.html"> | |
<link rel="import" href="../../salesforce/s1-elements/scaffold/s1DetailView.html"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-field/core-field.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Codingame Stock Exchange challenge solution in Dart | |
// Eric Taix | |
import 'dart:io'; | |
void main() { | |
stdin.readLineSync(); | |
int min = 0; | |
stdin.readLineSync().split(' ').map((s) => int.parse(s)).fold(null, (r, v) { | |
if (r == null) return v; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'dart:math'; | |
double toRadian(degree) => PI * degree / 180; | |
double parseDouble(string) => double.parse(string.replaceAll(',','.')); | |
void main() { | |
List<double> userLocation = new List<double>.generate(2, (index) => PI * double.parse(stdin.readLineSync().replaceAll(',','.')) / 180); | |
List defibrillators = new List | |
.generate(int.parse(stdin.readLineSync()), (index) => stdin.readLineSync().split(';')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Codingame Racing Horses challenge solution in Dart | |
// Eric Taix | |
import 'dart:io'; | |
void main() { | |
int min = 20000000; | |
List values = new List.generate(int.parse(stdin.readLineSync()), (_) => int.parse(stdin.readLineSync()))..insert(0, min)..sort((i,j) => i.compareTo(j)); | |
values.reduce((p,n) { | |
min = (p - n).abs() < min ? (p - n).abs() : min; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Codingame MIME types challenge solution in Dart | |
// Eric Taix | |
import 'dart:io'; | |
void main() { | |
int nbAsso = int.parse(stdin.readLineSync()); | |
int nbFile = int.parse(stdin.readLineSync()); | |
Map mimes = new List.generate(nbAsso, (_) => stdin.readLineSync()).map((s) => s.split(' ')).fold({}, (r, s) => r ..[s[0].toLowerCase()] = s[1]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
void main() { | |
int width = int.parse(stdin.readLineSync()); | |
int height = int.parse(stdin.readLineSync()); | |
List chars = stdin.readLineSync().split('').map((c) => c.toUpperCase()).map((c) => c.codeUnits[0]).toList(); | |
List dots = new List.generate(height, (_) => stdin.readLineSync().codeUnits.fold([], (d,i) => d..add(i))).fold([], (r,l) => r..addAll(l)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Codingame temperature challenge solution in Dart | |
// Eric Taix | |
import 'dart:io'; | |
void main() { | |
print(int.parse(stdin.readLineSync()) == 0 ? 0 : stdin.readLineSync().split(' ').map((s) => int.parse(s)) | |
.fold(10000,(r,i) => i.abs() == r.abs() ? (i > r ? i : r) : i.abs().compareTo(r.abs()) == -1 ? i : r)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// More concise solution and without multiple split/join which are not useful | |
import 'dart:io'; | |
void main() { | |
String result = ''; | |
stdin.readLineSync().codeUnits.fold([], (r,i) { | |
List str = i.toRadixString(2).split(''); | |
return r ..addAll(new List.generate(7-str.length, (_) => '0')) ..addAll(str); | |
}) |