結果

問題 No.87 Advent Calendar Problem
コンテスト
ユーザー kuuso1
提出日時 2014-12-07 00:32:29
言語 C#(csc)
(csc 3.9.0)
コンパイル:
csc -langversion:latest -unsafe -warn:0 -o+ /r:System.Numerics.dll _filename_ -out:a.exe
実行:
/usr/bin/mono a.exe
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,312 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 39 ms
最終ジャッジ日時 2026-03-04 21:46:25
合計ジャッジ時間 315 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
0f0bda2d2e09
[/j_bin/judge_tool judge 40000 ../CompileMemory.txt /dev/null sud /dev/null _ csc -langversion:latest -unsafe -warn:0 -o+ /r:System.Numerics.dll Main.cs -out:a.exe]
strconv.Atoi: parsing "../CompileMemory.txt": invalid syntax
goroutine 1 [running]:
runtime/debug.Stack()
	/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/debug/stack.go:26 +0x5e
main.main.func1()
	/home/yuki2006/gopath/src/yukicoder/judge/main.go:22 +0x57
panic({0x7d6880?, 0xc0000f6240?})
	/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/panic.go:783 +0x132
main.judgeMain({0xc000012130, 0x5?, 0x0?})
	/home/yuki2006/gopath/src/yukicoder/judge/judge_linux.go:121 +0x4b1
main.main()
	/home/yuki2006/gopath/src/yukicoder/judge/main.go:97 +0x277

ソースコード

diff #
raw source code

using System;
using System.Collections;
using System.Collections.Generic;
 
class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int[] A=new int[400*7];
		//日月火水木金土
		//0 1 2 3 4 5 6 
		int y=2014;
		A[0]=3;
		int peri=1;
		for(int i=1;i<2800;i++){
			y=2014+i;
			int d=365;
			if(y%4==0)d++;
			if(y%100==0)d--;
			if(y%400==0)d++;
			A[i]=(A[i-1]+d)%7;
			if(A[i]==A[0])peri++;
		}
		long rest=N-2014;
		long ans=(rest/2800)*peri;
		rest-=(rest/2800)*2800;
		for(int i=0;i<=rest;i++){
			if(A[i]==A[0])ans++;
		}
		Console.WriteLine(ans-1);
		
		
		
		
	}
	long N;
	public Sol(){
		N=rl();
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
0