結果
| 問題 |
No.805 UMG
|
| コンテスト | |
| ユーザー |
to_to_0121
|
| 提出日時 | 2019-03-22 21:32:59 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 2,000 ms |
| コード長 | 630 bytes |
| コンパイル時間 | 943 ms |
| コンパイル使用メモリ | 112,092 KB |
| 実行使用メモリ | 26,048 KB |
| 最終ジャッジ日時 | 2024-11-18 13:14:59 |
| 合計ジャッジ時間 | 2,515 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
string s = Console.ReadLine();
int ans = 0;
for (int i=0; i<n-2; i++){
if(s[i] != 'U') continue;
for (int j = 1; i + 2 * j < n; j++)
{
if (s[i + j] != 'M') continue;
if (s[i + 2 * j] != 'G') continue;
ans++;
}
}
Console.WriteLine(ans);
}
}
//mcs Main.cs
//mono Main.exe
to_to_0121