結果
| 問題 |
No.750 Frac #1
|
| コンテスト | |
| ユーザー |
funakoshi
|
| 提出日時 | 2019-07-02 13:06:59 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 1,000 ms |
| コード長 | 1,243 bytes |
| コンパイル時間 | 3,749 ms |
| コンパイル使用メモリ | 103,424 KB |
| 実行使用メモリ | 17,920 KB |
| 最終ジャッジ日時 | 2024-07-21 06:08:45 |
| 合計ジャッジ時間 | 4,177 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
コンパイルメッセージ
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;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace yukicoderTest
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
string[] bunsu = new string[n];
double[] ans = new double[n];
for(int i=0;i<n;i++)
{
bunsu[i] = Console.ReadLine();
string[] temp = bunsu[i].Split(' ');
double a = int.Parse(temp[0]);
double b = int.Parse(temp[1]);
ans[i] = a / b;
}
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
if(ans[i]<ans[j])
{
double temp = ans[i];
ans[i] = ans[j];
ans[j] = temp;
string tmp = bunsu[i];
bunsu[i] = bunsu[j];
bunsu[j] = tmp;
}
}
}
for(int i=0;i<n;i++)
{
Console.WriteLine(bunsu[i]);
}
}
}
}
funakoshi