結果
問題 |
No.3260 岩井スターグラフ
|
ユーザー |
![]() |
提出日時 | 2025-09-06 15:28:10 |
言語 | C# (.NET 8.0.404) |
結果 |
AC
|
実行時間 | 1,122 ms / 2,000 ms |
コード長 | 2,960 bytes |
コンパイル時間 | 11,094 ms |
コンパイル使用メモリ | 170,932 KB |
実行使用メモリ | 212,556 KB |
最終ジャッジ日時 | 2025-09-06 15:28:52 |
合計ジャッジ時間 | 38,031 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 36 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (117 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System.Diagnostics; class Program { static string ReadLine() => Console.ReadLine().Trim(); static int ReadInt() => int.Parse(ReadLine()); static long ReadLong() => long.Parse(ReadLine()); static int[] ReadIntArray() { string str = ReadLine(); return str != "" ? str.Split().Select(_ => int.Parse(_)).ToArray() : new int[0]; } static long[] ReadLongArray() { string str = ReadLine(); return str != "" ? str.Split().Select(_ => long.Parse(_)).ToArray() : new long[0]; } static (int a, int b) ReadInt2() { int[] vs = ReadIntArray(); return (a: vs[0], b: vs[1]); } static (int a, int b, int c) ReadInt3() { int[] vs = ReadIntArray(); return (a: vs[0], b: vs[1], c: vs[2]); } static (int a, int b, int c, int d) ReadInt4() { int[] vs = ReadIntArray(); return (a: vs[0], b: vs[1], c: vs[2], d: vs[3]); } static (long a, long b) ReadLong2() { long[] vs = ReadLongArray(); return (a: vs[0], b: vs[1]); } static (long a, long b, long c) ReadLong3() { long[] vs = ReadLongArray(); return (a: vs[0], b: vs[1], c: vs[2]); } static (long a, long b, long c, long d) ReadLong4() { long[] vs = ReadLongArray(); return (a: vs[0], b: vs[1], c: vs[2], d: vs[3]); } static void Main() { SourceExpander.Expander.Expand(); (long C, long L, long N) = ReadLong3(); for (int i = 0; i < N; i++) { (long a0, long b0) = ReadLong2(); long a = Math.Min(a0, b0); long b = Math.Max(a0, b0); if (a == 0) { long ans = 0; if (b % L > 0) ans = b % L; else ans = L; Console.WriteLine(ans); } else if ((a - 1) / L == (b - 1) / L) { long ans1 = 0; if (a % L > 0) ans1 = a % L; else ans1 = L; long ans2 = 0; if (b % L > 0) ans2 = b % L; else ans2 = L; Console.WriteLine(Math.Abs(ans1 - ans2)); } else { long ans1 = 0; if (a % L > 0) ans1 = a % L; else ans1 = L; long ans2 = 0; if (b % L > 0) ans2 = b % L; else ans2 = L; Console.WriteLine(ans1 + ans2); } } } } #region Expanded by https://github.com/kzrnm/SourceExpander namespace SourceExpander{public class Expander{[Conditional("EXP")]public static void Expand(string inputFilePath=null,string outputFilePath=null,bool ignoreAnyError=true){}public static string ExpandString(string inputFilePath=null,bool ignoreAnyError=true){return "";}}} #endregion Expanded by https://github.com/kzrnm/SourceExpander