Skip to content

Commit

Permalink
feat: working on problem
Browse files Browse the repository at this point in the history
  • Loading branch information
RanolP committed Mar 3, 2024
1 parent 91d0aa8 commit e2a7483
Show file tree
Hide file tree
Showing 17 changed files with 609 additions and 332 deletions.
76 changes: 44 additions & 32 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
}
/* directly taken from solved.ac */
:root {
--solve-tier-zero: #2d2d2d;
--solve-tier-bronze5: #9d4900;
--solve-tier-bronze4: #a54f00;
--solve-tier-bronze3: #ad5600;
Expand Down Expand Up @@ -97,97 +98,107 @@
--solve-tier-ruby1: #ff3071;
--solve-tier-master: #c67739;
}
.solve-tier-bronze5 {
.solve-tier.zero {
color: var(--solve-tier-zero);
}
[data-theme='dark'] .solve-tier.zero {
text-shadow:
1px 1px 0 #7a7a7a,
-0.5px 0.5px 0 #5a5a5a,
0.5px -0.5px 0 #5a5a5a,
-0.5px -0.5px 0 #5a5a5a;
}
.solve-tier.bronze5 {
color: var(--solve-tier-bronze5);
}
.solve-tier-bronze4 {
.solve-tier.bronze4 {
color: var(--solve-tier-bronze4);
}
.solve-tier-bronze3 {
.solve-tier.bronze3 {
color: var(--solve-tier-bronze3);
}
.solve-tier-bronze2 {
.solve-tier.bronze2 {
color: var(--solve-tier-bronze2);
}
.solve-tier-bronze1 {
.solve-tier.bronze1 {
color: var(--solve-tier-bronze1);
}
.solve-tier-silver5 {
.solve-tier.silver5 {
color: var(--solve-tier-silver5);
}
.solve-tier-silver4 {
.solve-tier.silver4 {
color: var(--solve-tier-silver4);
}
.solve-tier-silver3 {
.solve-tier.silver3 {
color: var(--solve-tier-silver3);
}
.solve-tier-silver2 {
.solve-tier.silver2 {
color: var(--solve-tier-silver2);
}
.solve-tier-silver1 {
.solve-tier.silver1 {
color: var(--solve-tier-silver1);
}
.solve-tier-gold5 {
.solve-tier.gold5 {
color: var(--solve-tier-gold5);
}
.solve-tier-gold4 {
.solve-tier.gold4 {
color: var(--solve-tier-gold4);
}
.solve-tier-gold3 {
.solve-tier.gold3 {
color: var(--solve-tier-gold3);
}
.solve-tier-gold2 {
.solve-tier.gold2 {
color: var(--solve-tier-gold2);
}
.solve-tier-gold1 {
.solve-tier.gold1 {
color: var(--solve-tier-gold1);
}
.solve-tier-platinum5 {
.solve-tier.platinum5 {
color: var(--solve-tier-platinum5);
}
.solve-tier-platinum4 {
.solve-tier.platinum4 {
color: var(--solve-tier-platinum4);
}
.solve-tier-platinum3 {
.solve-tier.platinum3 {
color: var(--solve-tier-platinum3);
}
.solve-tier-platinum2 {
.solve-tier.platinum2 {
color: var(--solve-tier-platinum2);
}
.solve-tier-platinum1 {
.solve-tier.platinum1 {
color: var(--solve-tier-platinum1);
}
.solve-tier-diamond5 {
.solve-tier.diamond5 {
color: var(--solve-tier-diamond5);
}
.solve-tier-diamond4 {
.solve-tier.diamond4 {
color: var(--solve-tier-diamond4);
}
.solve-tier-diamond3 {
.solve-tier.diamond3 {
color: var(--solve-tier-diamond3);
}
.solve-tier-diamond2 {
.solve-tier.diamond2 {
color: var(--solve-tier-diamond2);
}
.solve-tier-diamond1 {
.solve-tier.diamond1 {
color: var(--solve-tier-diamond1);
}
.solve-tier-ruby5 {
.solve-tier.ruby5 {
color: var(--solve-tier-ruby5);
}
.solve-tier-ruby4 {
.solve-tier.ruby4 {
color: var(--solve-tier-ruby4);
}
.solve-tier-ruby3 {
.solve-tier.ruby3 {
color: var(--solve-tier-ruby3);
}
.solve-tier-ruby2 {
.solve-tier.ruby2 {
color: var(--solve-tier-ruby2);
}
.solve-tier-ruby1 {
.solve-tier.ruby1 {
color: var(--solve-tier-ruby1);
}
.solve-tier-master {
.solve-tier.master {
background-color: #b491ff;
background-image: linear-gradient(0deg, #ff7ca8, #b491ff, #7cf9ff);
background-size: 80%;
Expand Down Expand Up @@ -220,6 +231,7 @@
hideInternal="true"
/>
<script>
// https://github.com/stoplightio/elements/issues/1439#issuecomment-1922387443
// adapted from https://github.com/FormidableLabs/prism-react-renderer/blob/master/src/themes/nightOwl.js
const darkTheme = {
mode: 'dark',
Expand Down Expand Up @@ -408,7 +420,7 @@
content: ({ type }) => {
const iconMap = {
'solve-tier': () => {
const match = /solve-tier:(\d+)/.exec(type);
const match = /solve-tier:(\d+|nr)/.exec(type);
return match
? `https://static.solved.ac/tier_small/${match[1]}.svg`
: null;
Expand Down
217 changes: 217 additions & 0 deletions src/models/Problem.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
namespace SolvedAC;

/**
* 문제 정보입니다.
*/
model Problem {
/**
* 문제 고유 ID입니다.
*
* @example 13705
*/
problemId: uint64;

/**
* 한국어 문제 제목입니다.
* HTML 엔티티나 LaTeX 수식을 포함할 수 있습니다.
*
* @example "Ax+Bsin(x)=C"
*/
titleKo: string;

/**
* 언어별 문제 제목 목록입니다.
*
* @example
* [{
* "language": "ko",
* "languageDisplayName": "ko",
* "title": "Ax+Bsin(x)=C",
* "isOriginal": true
* }]
*/
titles: ProblemTitleTranslated[];

/**
* 채점 가능 여부입니다.
*
* @example true
*/
isSolvable: boolean;

/**
* 부분 점수/서브태스크 문제 여부입니다.
*
* @example false
*/
isPartial: boolean;

/**
* 맞은 사람 수입니다.
*
* @example 560
*/
acceptedUserCount: uint64;

level: ProblemLevel;

/**
* 난이도 기여자 수입니다.
*
* @example 163
*/
votedUserCount: uint64;

/**
* 새싹 문제 여부입니다.
*
* @example false
*/
sprout: boolean;

/**
* 레이팅을 주지 않는지 여부입니다.
*
* @example false
*/
givesNoRating: boolean;

/**
* 난이도 기여 제한 여부입니다.
*
* @example false
*/
isLevelLocked: boolean;

/**
* 평균 시도 횟수입니다.
*
* @example 24.5393
*/
averageTries: float64;

/**
* 공식 문제 여부입니다.
* 번외 문제 등은 비공식 문제로 분류됩니다.
*
* @example true
*/
official: boolean;

/**
* 태그 목록입니다.
*
* @example
* [
* {
* "key": "arbitrary_precision",
* "isMeta": false,
* "bojTagId": 117,
* "problemCount": 241,
* "displayNames": [
* {
* "language": "ko",
* "name": "임의 정밀도 / 큰 수 연산",
* "short": "임의 정밀도 / 큰 수 연산"
* },
* {
* "language": "en",
* "name": "arbitrary precision / big integers",
* "short": "arbitrary precision / big integers"
* },
* {
* "language": "ja",
* "name": "高精度または大きな数の演算",
* "short": "高精度または大きな数の演算"
* }
* ],
* "aliases": [
* { "alias": "빅인티저" },
* { "alias": "빅데시멀" },
* { "alias": "biginteger" },
* { "alias": "bigdecimal" }
* ]
* },
* {
* "key": "binary_search",
* "isMeta": false,
* "bojTagId": 12,
* "problemCount": 1137,
* "displayNames": [
* {
* "language": "ko",
* "name": "이분 탐색",
* "short": "이분 탐색"
* },
* {
* "language": "en",
* "name": "binary search",
* "short": "binary search"
* },
* {
* "language": "ja",
* "name": "二分探索",
* "short": "二分探索"
* }
* ],
* "aliases": [
* { "alias": "이분탐색" },
* { "alias": "이진탐색" }
* ]
* },
* {
* "key": "math",
* "isMeta": false,
* "bojTagId": 124,
* "problemCount": 6007,
* "displayNames": [
* {
* "language": "ko",
* "name": "수학",
* "short": "수학"
* },
* {
* "language": "en",
* "name": "mathematics",
* "short": "math"
* },
* {
* "language": "ja",
* "name": "数学",
* "short": "数学"
* }
* ],
* "aliases": []
* },
* {
* "key": "numerical_analysis",
* "isMeta": false,
* "bojTagId": 122,
* "problemCount": 17,
* "displayNames": [
* {
* "language": "ko",
* "name": "수치해석",
* "short": "수치해석"
* },
* {
* "language": "en",
* "name": "numerical analysis",
* "short": "numerical analysis"
* },
* {
* "language": "ja",
* "name": "数値解析",
* "short": "数値解析"
* }
* ],
* "aliases": [
* { "alias": "수학" }
* ]
* }
* ]
*/
tags: ProblemTag[];

metadata: unknown;
}
Loading

0 comments on commit e2a7483

Please sign in to comment.