QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#175448#7176. I Flipped The Calendar...jsannemo#AC ✓183ms64976kbJava11577b2023-09-10 18:13:372023-09-10 18:13:38

Judging History

你现在查看的是最新测评结果

  • [2023-09-10 18:13:38]
  • 评测
  • 测评结果:AC
  • 用时:183ms
  • 内存:64976kb
  • [2023-09-10 18:13:37]
  • 提交

answer

import java.util.Calendar;
import java.util.Scanner;
import java.util.HashSet;

public class B {
	public static void main(String... args) {
		Scanner sc = new Scanner(System.in);
		int Y = sc.nextInt();
		int res = 0;
		for (int m = 0; m < 12; ++m) {
			HashSet<Integer> w = new HashSet<>();
			for (int j = 1; j <= 31; ++j) {
				Calendar c = Calendar.getInstance();
				c.setFirstDayOfWeek(Calendar.MONDAY);
				c.set(Y, m, j);
				if (c.get(Calendar.MONTH) == m) {
					w.add(c.get(Calendar.WEEK_OF_YEAR));
				}
			}
			res += w.size();
		}
		System.out.println(res);
	}
}

详细

Test #1:

score: 100
Accepted
time: 154ms
memory: 61144kb

input:

2023

output:

63

result:

ok 1 number(s): "63"

Test #2:

score: 0
Accepted
time: 168ms
memory: 63940kb

input:

1970

output:

63

result:

ok 1 number(s): "63"

Test #3:

score: 0
Accepted
time: 122ms
memory: 63652kb

input:

1971

output:

61

result:

ok 1 number(s): "61"

Test #4:

score: 0
Accepted
time: 100ms
memory: 63500kb

input:

1972

output:

63

result:

ok 1 number(s): "63"

Test #5:

score: 0
Accepted
time: 161ms
memory: 61676kb

input:

1973

output:

63

result:

ok 1 number(s): "63"

Test #6:

score: 0
Accepted
time: 131ms
memory: 61920kb

input:

1974

output:

62

result:

ok 1 number(s): "62"

Test #7:

score: 0
Accepted
time: 158ms
memory: 61924kb

input:

1975

output:

62

result:

ok 1 number(s): "62"

Test #8:

score: 0
Accepted
time: 183ms
memory: 62428kb

input:

1976

output:

62

result:

ok 1 number(s): "62"

Test #9:

score: 0
Accepted
time: 102ms
memory: 61296kb

input:

1977

output:

63

result:

ok 1 number(s): "63"

Test #10:

score: 0
Accepted
time: 170ms
memory: 60184kb

input:

1978

output:

63

result:

ok 1 number(s): "63"

Test #11:

score: 0
Accepted
time: 128ms
memory: 60912kb

input:

1979

output:

63

result:

ok 1 number(s): "63"

Test #12:

score: 0
Accepted
time: 142ms
memory: 62956kb

input:

1980

output:

62

result:

ok 1 number(s): "62"

Test #13:

score: 0
Accepted
time: 125ms
memory: 64292kb

input:

1981

output:

63

result:

ok 1 number(s): "63"

Test #14:

score: 0
Accepted
time: 109ms
memory: 61192kb

input:

1982

output:

61

result:

ok 1 number(s): "61"

Test #15:

score: 0
Accepted
time: 116ms
memory: 59604kb

input:

1983

output:

63

result:

ok 1 number(s): "63"

Test #16:

score: 0
Accepted
time: 142ms
memory: 61028kb

input:

1984

output:

64

result:

ok 1 number(s): "64"

Test #17:

score: 0
Accepted
time: 112ms
memory: 61616kb

input:

1985

output:

62

result:

ok 1 number(s): "62"

Test #18:

score: 0
Accepted
time: 138ms
memory: 62352kb

input:

1986

output:

62

result:

ok 1 number(s): "62"

Test #19:

score: 0
Accepted
time: 148ms
memory: 62396kb

input:

1987

output:

63

result:

ok 1 number(s): "63"

Test #20:

score: 0
Accepted
time: 144ms
memory: 62452kb

input:

1988

output:

62

result:

ok 1 number(s): "62"

Test #21:

score: 0
Accepted
time: 146ms
memory: 61024kb

input:

1989

output:

63

result:

ok 1 number(s): "63"

Test #22:

score: 0
Accepted
time: 145ms
memory: 61148kb

input:

1990

output:

63

result:

ok 1 number(s): "63"

Test #23:

score: 0
Accepted
time: 125ms
memory: 61192kb

input:

1991

output:

62

result:

ok 1 number(s): "62"

Test #24:

score: 0
Accepted
time: 139ms
memory: 64088kb

input:

1992

output:

63

result:

ok 1 number(s): "63"

Test #25:

score: 0
Accepted
time: 141ms
memory: 61928kb

input:

1993

output:

61

result:

ok 1 number(s): "61"

Test #26:

score: 0
Accepted
time: 120ms
memory: 61924kb

input:

1994

output:

63

result:

ok 1 number(s): "63"

Test #27:

score: 0
Accepted
time: 132ms
memory: 58728kb

input:

1995

output:

63

result:

ok 1 number(s): "63"

Test #28:

score: 0
Accepted
time: 124ms
memory: 61036kb

input:

1996

output:

62

result:

ok 1 number(s): "62"

Test #29:

score: 0
Accepted
time: 120ms
memory: 61080kb

input:

1997

output:

62

result:

ok 1 number(s): "62"

Test #30:

score: 0
Accepted
time: 128ms
memory: 60888kb

input:

1998

output:

63

result:

ok 1 number(s): "63"

Test #31:

score: 0
Accepted
time: 136ms
memory: 60884kb

input:

1999

output:

61

result:

ok 1 number(s): "61"

Test #32:

score: 0
Accepted
time: 116ms
memory: 61180kb

input:

2000

output:

63

result:

ok 1 number(s): "63"

Test #33:

score: 0
Accepted
time: 134ms
memory: 60572kb

input:

2001

output:

63

result:

ok 1 number(s): "63"

Test #34:

score: 0
Accepted
time: 143ms
memory: 61936kb

input:

2002

output:

62

result:

ok 1 number(s): "62"

Test #35:

score: 0
Accepted
time: 122ms
memory: 59216kb

input:

2003

output:

62

result:

ok 1 number(s): "62"

Test #36:

score: 0
Accepted
time: 162ms
memory: 60168kb

input:

2004

output:

62

result:

ok 1 number(s): "62"

Test #37:

score: 0
Accepted
time: 110ms
memory: 60156kb

input:

2005

output:

63

result:

ok 1 number(s): "63"

Test #38:

score: 0
Accepted
time: 159ms
memory: 60940kb

input:

2006

output:

63

result:

ok 1 number(s): "63"

Test #39:

score: 0
Accepted
time: 171ms
memory: 61660kb

input:

2007

output:

63

result:

ok 1 number(s): "63"

Test #40:

score: 0
Accepted
time: 156ms
memory: 62440kb

input:

2008

output:

62

result:

ok 1 number(s): "62"

Test #41:

score: 0
Accepted
time: 152ms
memory: 61140kb

input:

2009

output:

63

result:

ok 1 number(s): "63"

Test #42:

score: 0
Accepted
time: 164ms
memory: 64976kb

input:

2010

output:

61

result:

ok 1 number(s): "61"

Test #43:

score: 0
Accepted
time: 115ms
memory: 61452kb

input:

2011

output:

63

result:

ok 1 number(s): "63"

Test #44:

score: 0
Accepted
time: 121ms
memory: 61928kb

input:

2012

output:

64

result:

ok 1 number(s): "64"

Test #45:

score: 0
Accepted
time: 134ms
memory: 62896kb

input:

2013

output:

62

result:

ok 1 number(s): "62"

Test #46:

score: 0
Accepted
time: 138ms
memory: 59364kb

input:

2014

output:

62

result:

ok 1 number(s): "62"

Test #47:

score: 0
Accepted
time: 160ms
memory: 64180kb

input:

2015

output:

63

result:

ok 1 number(s): "63"

Test #48:

score: 0
Accepted
time: 177ms
memory: 60660kb

input:

2016

output:

62

result:

ok 1 number(s): "62"

Test #49:

score: 0
Accepted
time: 151ms
memory: 61524kb

input:

2017

output:

63

result:

ok 1 number(s): "63"

Test #50:

score: 0
Accepted
time: 119ms
memory: 62460kb

input:

2018

output:

63

result:

ok 1 number(s): "63"

Test #51:

score: 0
Accepted
time: 150ms
memory: 62552kb

input:

2019

output:

62

result:

ok 1 number(s): "62"

Test #52:

score: 0
Accepted
time: 117ms
memory: 57240kb

input:

2020

output:

63

result:

ok 1 number(s): "63"

Test #53:

score: 0
Accepted
time: 165ms
memory: 61692kb

input:

2021

output:

61

result:

ok 1 number(s): "61"

Test #54:

score: 0
Accepted
time: 118ms
memory: 60768kb

input:

2022

output:

63

result:

ok 1 number(s): "63"

Test #55:

score: 0
Accepted
time: 124ms
memory: 63244kb

input:

2024

output:

62

result:

ok 1 number(s): "62"

Test #56:

score: 0
Accepted
time: 138ms
memory: 64688kb

input:

2025

output:

62

result:

ok 1 number(s): "62"

Test #57:

score: 0
Accepted
time: 134ms
memory: 59316kb

input:

2026

output:

63

result:

ok 1 number(s): "63"

Test #58:

score: 0
Accepted
time: 104ms
memory: 59652kb

input:

2027

output:

61

result:

ok 1 number(s): "61"

Test #59:

score: 0
Accepted
time: 118ms
memory: 63948kb

input:

2028

output:

63

result:

ok 1 number(s): "63"

Test #60:

score: 0
Accepted
time: 129ms
memory: 62192kb

input:

2029

output:

63

result:

ok 1 number(s): "63"

Test #61:

score: 0
Accepted
time: 142ms
memory: 61820kb

input:

2030

output:

62

result:

ok 1 number(s): "62"

Test #62:

score: 0
Accepted
time: 112ms
memory: 62296kb

input:

2031

output:

62

result:

ok 1 number(s): "62"

Test #63:

score: 0
Accepted
time: 128ms
memory: 59480kb

input:

2032

output:

62

result:

ok 1 number(s): "62"

Test #64:

score: 0
Accepted
time: 130ms
memory: 59548kb

input:

2033

output:

63

result:

ok 1 number(s): "63"

Test #65:

score: 0
Accepted
time: 142ms
memory: 60484kb

input:

2034

output:

63

result:

ok 1 number(s): "63"

Test #66:

score: 0
Accepted
time: 119ms
memory: 61028kb

input:

2035

output:

63

result:

ok 1 number(s): "63"

Test #67:

score: 0
Accepted
time: 128ms
memory: 58324kb

input:

2036

output:

62

result:

ok 1 number(s): "62"

Test #68:

score: 0
Accepted
time: 131ms
memory: 61644kb

input:

2037

output:

63

result:

ok 1 number(s): "63"

Extra Test:

score: 0
Extra Test Passed