Skip to content

Instantly share code, notes, and snippets.

@oyakodon
Created January 9, 2016 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oyakodon/19e975d8a13327fbbd91 to your computer and use it in GitHub Desktop.
Save oyakodon/19e975d8a13327fbbd91 to your computer and use it in GitHub Desktop.
ABC032で実際に打ったプログラム / C#
using System;
class Program
{
static void Main(string[] args)
{
var a = int.Parse(Console.ReadLine());
var b = int.Parse(Console.ReadLine());
var n = int.Parse(Console.ReadLine());
var i = n;
while (true)
{
if (i % a == 0 && i % b == 0)
break;
++i;
}
Console.WriteLine(i);
}
}
using System;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
var s = Console.ReadLine();
var k = int.Parse(Console.ReadLine());
var l = new List<string>();
for (var i = 0; i < s.Length - k + 1; ++i)
{
var sk = s.Substring(i, k);
if (!l.Contains(sk)){
l.Add(sk);
}
}
Console.WriteLine(l.Count);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment