Submission #33081607


Source Code Expand

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;

namespace Tasks
{
    public class B
    {
        public static void Main()
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var (A, B, D) = Scanner.Scan<double, double, double>();
            var rad = D * Math.PI / 180.0;
            var sin = Math.Sin(rad);
            var cos = Math.Cos(rad);
            var x = A * cos - B * sin;
            var y = A * sin + B * cos;
            Console.WriteLine($"{x} {y}");
        }

        public static class Scanner
        {
            public static string ScanLine() => Console.ReadLine()?.Trim() ?? string.Empty;
            public static string[] Scan() => ScanLine().Split(' ');
            public static T Scan<T>() where T : IConvertible => Convert<T>(Scan()[0]);
            public static (T1, T2) Scan<T1, T2>() where T1 : IConvertible where T2 : IConvertible
            {
                var line = Scan();
                return (Convert<T1>(line[0]), Convert<T2>(line[1]));
            }
            public static (T1, T2, T3) Scan<T1, T2, T3>() where T1 : IConvertible where T2 : IConvertible where T3 : IConvertible
            {
                var line = Scan();
                return (Convert<T1>(line[0]), Convert<T2>(line[1]), Convert<T3>(line[2]));
            }
            public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() where T1 : IConvertible where T2 : IConvertible where T3 : IConvertible where T4 : IConvertible
            {
                var line = Scan();
                return (Convert<T1>(line[0]), Convert<T2>(line[1]), Convert<T3>(line[2]), Convert<T4>(line[3]));
            }
            public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() where T1 : IConvertible where T2 : IConvertible where T3 : IConvertible where T4 : IConvertible where T5 : IConvertible
            {
                var line = Scan();
                return (Convert<T1>(line[0]), Convert<T2>(line[1]), Convert<T3>(line[2]), Convert<T4>(line[3]), Convert<T5>(line[4]));
            }
            public static (T1, T2, T3, T4, T5, T6) Scan<T1, T2, T3, T4, T5, T6>() where T1 : IConvertible where T2 : IConvertible where T3 : IConvertible where T4 : IConvertible where T5 : IConvertible where T6 : IConvertible
            {
                var line = Scan();
                return (Convert<T1>(line[0]), Convert<T2>(line[1]), Convert<T3>(line[2]), Convert<T4>(line[3]), Convert<T5>(line[4]), Convert<T6>(line[5]));
            }
            public static IEnumerable<T> ScanEnumerable<T>() where T : IConvertible => Scan().Select(Convert<T>);
            private static T Convert<T>(string value) where T : IConvertible => (T)System.Convert.ChangeType(value, typeof(T));
        }
    }
}

Submission Info

Submission Time
Task B - Counterclockwise Rotation
User AconCavy
Language C# (.NET Core 3.1.201)
Score 200
Code Size 3078 Byte
Status AC
Exec Time 88 ms
Memory 27984 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 5
AC × 16
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_case_00.txt, 01_case_01.txt, 01_case_02.txt, 01_case_03.txt, 01_case_04.txt, 01_case_05.txt, 01_case_06.txt, 01_case_07.txt, 01_case_08.txt, 01_case_09.txt, 01_case_10.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 87 ms 27732 KiB
00_sample_01.txt AC 88 ms 27476 KiB
00_sample_02.txt AC 84 ms 27668 KiB
00_sample_03.txt AC 84 ms 27496 KiB
00_sample_04.txt AC 83 ms 27756 KiB
01_case_00.txt AC 84 ms 27508 KiB
01_case_01.txt AC 80 ms 27984 KiB
01_case_02.txt AC 83 ms 27932 KiB
01_case_03.txt AC 88 ms 27568 KiB
01_case_04.txt AC 83 ms 27720 KiB
01_case_05.txt AC 84 ms 27428 KiB
01_case_06.txt AC 84 ms 27832 KiB
01_case_07.txt AC 81 ms 27636 KiB
01_case_08.txt AC 84 ms 27832 KiB
01_case_09.txt AC 80 ms 27600 KiB
01_case_10.txt AC 83 ms 27924 KiB