fork download
  1. import std.conv;
  2. import std.stdio;
  3. import std.string;
  4.  
  5. void main() {
  6.  
  7. int n = readln.strip.to!int;
  8. string s = readln.strip;
  9.  
  10. foreach (from; 0 .. n)
  11. foreach (jump; 1 .. n) {
  12. bool ok;
  13. foreach (i; 0 .. 5) {
  14. int pos = from + i * jump;
  15. if (pos >= n || s[pos] != '*') {
  16. ok = true;
  17. break;
  18. }
  19. }
  20. if (!ok)
  21. return writeln("yes");
  22. }
  23.  
  24. writeln("no");
  25. }
Runtime error #stdin #stdout 0s 3756KB
stdin
16
.**.*..*.***.**.
stdout
yes