├── EasyFPSViewer
├── .gitignore
├── EasyFPSViewer v1.1.exe
├── LICENSE
├── README.md
└── src
│ ├── EasyFPSViewer.sln
│ └── EasyFPSViewer
│ ├── AboutForm.Designer.cs
│ ├── AboutForm.cs
│ ├── AboutForm.resx
│ ├── Core
│ ├── FPSParser.cs
│ ├── FPSViewMaker.cs
│ └── I18N.cs
│ ├── EasyFPSViewer.csproj
│ ├── EditForm.Designer.cs
│ ├── EditForm.cs
│ ├── EditForm.resx
│ ├── FPSListBinder.cs
│ ├── MainForm.Designer.cs
│ ├── MainForm.cs
│ ├── MainForm.resx
│ ├── Models
│ ├── FPSItem.cs
│ ├── FPSItemImage.cs
│ ├── FPSItemSolution.cs
│ ├── FPSItemSpecialJudge.cs
│ └── NotFPSFileException.cs
│ ├── ProblemForm.Designer.cs
│ ├── ProblemForm.cs
│ ├── ProblemForm.resx
│ ├── Program.cs
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
│ ├── Resources
│ ├── Azure99.jpg
│ ├── FPSWebView.txt
│ └── Zh_Cn.txt
│ ├── SearchForm.Designer.cs
│ ├── SearchForm.cs
│ ├── SearchForm.resx
│ ├── SplitForm.Designer.cs
│ ├── SplitForm.cs
│ └── SplitForm.resx
├── FAQ.md
├── FPSParser
├── FPSParser.sln
├── FPSParser.suo
└── FPSParser
│ ├── 20120605025014400_easyicon_cn_32.ico
│ ├── FPSParser.Designer.cs
│ ├── FPSParser.cs
│ ├── FPSParser.csproj
│ ├── FPSParser.resx
│ ├── Program.cs
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
│ └── bin
│ ├── Debug
│ ├── FPSParser.exe
│ └── template.tpl
│ └── Release
│ ├── FPSParser.exe
│ └── template.tpl
├── FPSPythonParser
├── __init__.py
├── fps.xml
├── multi.xml
└── parser.py
├── FPSSpliter
├── COMDLG32.OCX
├── FPSSpliter-GUI.exe
├── FPSSpliter.c
├── Makefile
├── README.md
└── fpsspliter.exe
├── FPSViewer
├── .classpath
├── .project
├── FPSViewer.jar
└── src
│ ├── demo.xml
│ ├── freeproblemset
│ └── FPSViewer.java
│ └── template.html
├── LICENSE
├── PyFPS
├── FpsGenTool.py
├── LuoguListSpider.py
├── LuoguProblemFetcher.py
├── README.md
└── luogu.xml
├── README.md
├── Vijos2FPS
├── .classpath
├── .project
└── src
│ └── freeproblemset
│ ├── loj
│ └── LOJ2FPS.java
│ └── vijos
│ └── Vijos2FPS.java
├── fps-examples
├── PerformanceTest.xml
├── README.md
├── fps-bas-3001-3482.xml
├── fps-loj-small-pics.zip
├── fps-my-1000-1128.xml
├── fps-www.educg.net-codeforce-1-2833.xml.zip
├── fps-zhblue-CSP-J_S 2024 第二轮认证 入门级(仅含样例数据).zip
├── fps-zhblue-CSP-J_S 2024 第二轮认证 提高级.zip
├── fps-zhblue-SQL.xml
├── fps-zhblue-一本通 1.1 例题.xml
└── fps-刘谦2025.xml
├── fps-zhblue-A+B.xml
└── fps.current.dtd
/EasyFPSViewer/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015/2017 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # Visual Studio 2017 auto generated files
33 | Generated\ Files/
34 |
35 | # MSTest test Results
36 | [Tt]est[Rr]esult*/
37 | [Bb]uild[Ll]og.*
38 |
39 | # NUNIT
40 | *.VisualState.xml
41 | TestResult.xml
42 |
43 | # Build Results of an ATL Project
44 | [Dd]ebugPS/
45 | [Rr]eleasePS/
46 | dlldata.c
47 |
48 | # Benchmark Results
49 | BenchmarkDotNet.Artifacts/
50 |
51 | # .NET Core
52 | project.lock.json
53 | project.fragment.lock.json
54 | artifacts/
55 | **/Properties/launchSettings.json
56 |
57 | # StyleCop
58 | StyleCopReport.xml
59 |
60 | # Files built by Visual Studio
61 | *_i.c
62 | *_p.c
63 | *_i.h
64 | *.ilk
65 | *.meta
66 | *.obj
67 | *.iobj
68 | *.pch
69 | *.pdb
70 | *.ipdb
71 | *.pgc
72 | *.pgd
73 | *.rsp
74 | *.sbr
75 | *.tlb
76 | *.tli
77 | *.tlh
78 | *.tmp
79 | *.tmp_proj
80 | *.log
81 | *.vspscc
82 | *.vssscc
83 | .builds
84 | *.pidb
85 | *.svclog
86 | *.scc
87 |
88 | # Chutzpah Test files
89 | _Chutzpah*
90 |
91 | # Visual C++ cache files
92 | ipch/
93 | *.aps
94 | *.ncb
95 | *.opendb
96 | *.opensdf
97 | *.sdf
98 | *.cachefile
99 | *.VC.db
100 | *.VC.VC.opendb
101 |
102 | # Visual Studio profiler
103 | *.psess
104 | *.vsp
105 | *.vspx
106 | *.sap
107 |
108 | # Visual Studio Trace Files
109 | *.e2e
110 |
111 | # TFS 2012 Local Workspace
112 | $tf/
113 |
114 | # Guidance Automation Toolkit
115 | *.gpState
116 |
117 | # ReSharper is a .NET coding add-in
118 | _ReSharper*/
119 | *.[Rr]e[Ss]harper
120 | *.DotSettings.user
121 |
122 | # JustCode is a .NET coding add-in
123 | .JustCode
124 |
125 | # TeamCity is a build add-in
126 | _TeamCity*
127 |
128 | # DotCover is a Code Coverage Tool
129 | *.dotCover
130 |
131 | # AxoCover is a Code Coverage Tool
132 | .axoCover/*
133 | !.axoCover/settings.json
134 |
135 | # Visual Studio code coverage results
136 | *.coverage
137 | *.coveragexml
138 |
139 | # NCrunch
140 | _NCrunch_*
141 | .*crunch*.local.xml
142 | nCrunchTemp_*
143 |
144 | # MightyMoose
145 | *.mm.*
146 | AutoTest.Net/
147 |
148 | # Web workbench (sass)
149 | .sass-cache/
150 |
151 | # Installshield output folder
152 | [Ee]xpress/
153 |
154 | # DocProject is a documentation generator add-in
155 | DocProject/buildhelp/
156 | DocProject/Help/*.HxT
157 | DocProject/Help/*.HxC
158 | DocProject/Help/*.hhc
159 | DocProject/Help/*.hhk
160 | DocProject/Help/*.hhp
161 | DocProject/Help/Html2
162 | DocProject/Help/html
163 |
164 | # Click-Once directory
165 | publish/
166 |
167 | # Publish Web Output
168 | *.[Pp]ublish.xml
169 | *.azurePubxml
170 | # Note: Comment the next line if you want to checkin your web deploy settings,
171 | # but database connection strings (with potential passwords) will be unencrypted
172 | *.pubxml
173 | *.publishproj
174 |
175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
176 | # checkin your Azure Web App publish settings, but sensitive information contained
177 | # in these scripts will be unencrypted
178 | PublishScripts/
179 |
180 | # NuGet Packages
181 | *.nupkg
182 | # The packages folder can be ignored because of Package Restore
183 | **/[Pp]ackages/*
184 | # except build/, which is used as an MSBuild target.
185 | !**/[Pp]ackages/build/
186 | # Uncomment if necessary however generally it will be regenerated when needed
187 | #!**/[Pp]ackages/repositories.config
188 | # NuGet v3's project.json files produces more ignorable files
189 | *.nuget.props
190 | *.nuget.targets
191 |
192 | # Microsoft Azure Build Output
193 | csx/
194 | *.build.csdef
195 |
196 | # Microsoft Azure Emulator
197 | ecf/
198 | rcf/
199 |
200 | # Windows Store app package directories and files
201 | AppPackages/
202 | BundleArtifacts/
203 | Package.StoreAssociation.xml
204 | _pkginfo.txt
205 | *.appx
206 |
207 | # Visual Studio cache files
208 | # files ending in .cache can be ignored
209 | *.[Cc]ache
210 | # but keep track of directories ending in .cache
211 | !*.[Cc]ache/
212 |
213 | # Others
214 | ClientBin/
215 | ~$*
216 | *~
217 | *.dbmdl
218 | *.dbproj.schemaview
219 | *.jfm
220 | *.pfx
221 | *.publishsettings
222 | orleans.codegen.cs
223 |
224 | # Including strong name files can present a security risk
225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
226 | #*.snk
227 |
228 | # Since there are multiple workflows, uncomment next line to ignore bower_components
229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
230 | #bower_components/
231 |
232 | # RIA/Silverlight projects
233 | Generated_Code/
234 |
235 | # Backup & report files from converting an old project file
236 | # to a newer Visual Studio version. Backup files are not needed,
237 | # because we have git ;-)
238 | _UpgradeReport_Files/
239 | Backup*/
240 | UpgradeLog*.XML
241 | UpgradeLog*.htm
242 | ServiceFabricBackup/
243 | *.rptproj.bak
244 |
245 | # SQL Server files
246 | *.mdf
247 | *.ldf
248 | *.ndf
249 |
250 | # Business Intelligence projects
251 | *.rdl.data
252 | *.bim.layout
253 | *.bim_*.settings
254 | *.rptproj.rsuser
255 |
256 | # Microsoft Fakes
257 | FakesAssemblies/
258 |
259 | # GhostDoc plugin setting file
260 | *.GhostDoc.xml
261 |
262 | # Node.js Tools for Visual Studio
263 | .ntvs_analysis.dat
264 | node_modules/
265 |
266 | # Visual Studio 6 build log
267 | *.plg
268 |
269 | # Visual Studio 6 workspace options file
270 | *.opt
271 |
272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
273 | *.vbw
274 |
275 | # Visual Studio LightSwitch build output
276 | **/*.HTMLClient/GeneratedArtifacts
277 | **/*.DesktopClient/GeneratedArtifacts
278 | **/*.DesktopClient/ModelManifest.xml
279 | **/*.Server/GeneratedArtifacts
280 | **/*.Server/ModelManifest.xml
281 | _Pvt_Extensions
282 |
283 | # Paket dependency manager
284 | .paket/paket.exe
285 | paket-files/
286 |
287 | # FAKE - F# Make
288 | .fake/
289 |
290 | # JetBrains Rider
291 | .idea/
292 | *.sln.iml
293 |
294 | # CodeRush
295 | .cr/
296 |
297 | # Python Tools for Visual Studio (PTVS)
298 | __pycache__/
299 | *.pyc
300 |
301 | # Cake - Uncomment if you are using it
302 | # tools/**
303 | # !tools/packages.config
304 |
305 | # Tabs Studio
306 | *.tss
307 |
308 | # Telerik's JustMock configuration file
309 | *.jmconfig
310 |
311 | # BizTalk build output
312 | *.btp.cs
313 | *.btm.cs
314 | *.odx.cs
315 | *.xsd.cs
316 |
317 | # OpenCover UI analysis results
318 | OpenCover/
319 |
320 | # Azure Stream Analytics local run output
321 | ASALocalRun/
322 |
323 | # MSBuild Binary and Structured Log
324 | *.binlog
325 |
326 | # NVidia Nsight GPU debugger configuration file
327 | *.nvuser
328 |
329 | # MFractors (Xamarin productivity tool) working folder
330 | .mfractor/
331 |
--------------------------------------------------------------------------------
/EasyFPSViewer/EasyFPSViewer v1.1.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/EasyFPSViewer/EasyFPSViewer v1.1.exe
--------------------------------------------------------------------------------
/EasyFPSViewer/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Azure
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/EasyFPSViewer/README.md:
--------------------------------------------------------------------------------
1 | # EasyFPSViewer
2 | An easy Freeproblemset File view and edit tool.
3 |
4 | 一个用于快速查看与编辑Freeproblemset文件的工具。
5 |
6 | 长期更新地址:[https://github.com/Azure99/EasyFPSViewer](https://github.com/Azure99/EasyFPSViewer)
7 |
8 | 支持如下功能
9 | 1. 查看FPS文件中的题目
10 | 2. 删除、添加题目
11 | 3. 统计题目测试数据大小
12 | 4. 分割大FPS为多个小文件
13 | 5. 批量替换测试数据换行符为\n
14 | 6. 排序题目
15 | 7. 简单编辑题目
16 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28010.2019
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyFPSViewer", "EasyFPSViewer\EasyFPSViewer.csproj", "{737DB055-73B3-4A84-B741-944D60B00962}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {737DB055-73B3-4A84-B741-944D60B00962}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {737DB055-73B3-4A84-B741-944D60B00962}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {737DB055-73B3-4A84-B741-944D60B00962}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {737DB055-73B3-4A84-B741-944D60B00962}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {80E83B7C-AB53-4B4F-AC92-0D564F763828}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/AboutForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace EasyFPSViewer
2 | {
3 | partial class AboutForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label_EasyFPSViewer = new System.Windows.Forms.Label();
32 | this.label_Hint = new System.Windows.Forms.Label();
33 | this.pictureBox_Azure99 = new System.Windows.Forms.PictureBox();
34 | this.label1 = new System.Windows.Forms.Label();
35 | this.linkLabel1 = new System.Windows.Forms.LinkLabel();
36 | this.linkLabel2 = new System.Windows.Forms.LinkLabel();
37 | this.linkLabel3 = new System.Windows.Forms.LinkLabel();
38 | this.label_Github = new System.Windows.Forms.Label();
39 | this.label_Website = new System.Windows.Forms.Label();
40 | this.linkLabel4 = new System.Windows.Forms.LinkLabel();
41 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox_Azure99)).BeginInit();
42 | this.SuspendLayout();
43 | //
44 | // label_EasyFPSViewer
45 | //
46 | this.label_EasyFPSViewer.AutoSize = true;
47 | this.label_EasyFPSViewer.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
48 | this.label_EasyFPSViewer.ForeColor = System.Drawing.Color.Purple;
49 | this.label_EasyFPSViewer.Location = new System.Drawing.Point(12, 12);
50 | this.label_EasyFPSViewer.Name = "label_EasyFPSViewer";
51 | this.label_EasyFPSViewer.Size = new System.Drawing.Size(290, 40);
52 | this.label_EasyFPSViewer.TabIndex = 0;
53 | this.label_EasyFPSViewer.Text = "EasyFPSViewer";
54 | //
55 | // label_Hint
56 | //
57 | this.label_Hint.AutoSize = true;
58 | this.label_Hint.Location = new System.Drawing.Point(16, 63);
59 | this.label_Hint.Name = "label_Hint";
60 | this.label_Hint.Size = new System.Drawing.Size(383, 15);
61 | this.label_Hint.TabIndex = 1;
62 | this.label_Hint.Text = "An easy Freeproblemset File view and edit tool.";
63 | //
64 | // pictureBox_Azure99
65 | //
66 | this.pictureBox_Azure99.Image = global::EasyFPSViewer.Properties.Resources.Azure99;
67 | this.pictureBox_Azure99.Location = new System.Drawing.Point(450, 28);
68 | this.pictureBox_Azure99.Name = "pictureBox_Azure99";
69 | this.pictureBox_Azure99.Size = new System.Drawing.Size(200, 200);
70 | this.pictureBox_Azure99.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
71 | this.pictureBox_Azure99.TabIndex = 2;
72 | this.pictureBox_Azure99.TabStop = false;
73 | //
74 | // label1
75 | //
76 | this.label1.AutoSize = true;
77 | this.label1.Location = new System.Drawing.Point(16, 106);
78 | this.label1.Name = "label1";
79 | this.label1.Size = new System.Drawing.Size(87, 15);
80 | this.label1.TabIndex = 3;
81 | this.label1.Text = "By Azure99";
82 | //
83 | // linkLabel1
84 | //
85 | this.linkLabel1.AutoSize = true;
86 | this.linkLabel1.Location = new System.Drawing.Point(16, 131);
87 | this.linkLabel1.Name = "linkLabel1";
88 | this.linkLabel1.Size = new System.Drawing.Size(327, 15);
89 | this.linkLabel1.TabIndex = 4;
90 | this.linkLabel1.TabStop = true;
91 | this.linkLabel1.Text = "https://github.com/Azure99/EasyFPSViewer";
92 | this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
93 | //
94 | // linkLabel2
95 | //
96 | this.linkLabel2.AutoSize = true;
97 | this.linkLabel2.Location = new System.Drawing.Point(85, 189);
98 | this.linkLabel2.Name = "linkLabel2";
99 | this.linkLabel2.Size = new System.Drawing.Size(215, 15);
100 | this.linkLabel2.TabIndex = 5;
101 | this.linkLabel2.TabStop = true;
102 | this.linkLabel2.Text = "https://github.com/Azure99";
103 | this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
104 | //
105 | // linkLabel3
106 | //
107 | this.linkLabel3.AutoSize = true;
108 | this.linkLabel3.Location = new System.Drawing.Point(89, 217);
109 | this.linkLabel3.Name = "linkLabel3";
110 | this.linkLabel3.Size = new System.Drawing.Size(191, 15);
111 | this.linkLabel3.TabIndex = 6;
112 | this.linkLabel3.TabStop = true;
113 | this.linkLabel3.Text = "https://www.rainng.com/";
114 | this.linkLabel3.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked);
115 | //
116 | // label_Github
117 | //
118 | this.label_Github.AutoSize = true;
119 | this.label_Github.Location = new System.Drawing.Point(15, 190);
120 | this.label_Github.Name = "label_Github";
121 | this.label_Github.Size = new System.Drawing.Size(63, 15);
122 | this.label_Github.TabIndex = 7;
123 | this.label_Github.Text = "Github:";
124 | //
125 | // label_Website
126 | //
127 | this.label_Website.AutoSize = true;
128 | this.label_Website.Location = new System.Drawing.Point(16, 217);
129 | this.label_Website.Name = "label_Website";
130 | this.label_Website.Size = new System.Drawing.Size(71, 15);
131 | this.label_Website.TabIndex = 8;
132 | this.label_Website.Text = "Website:";
133 | //
134 | // linkLabel4
135 | //
136 | this.linkLabel4.AutoSize = true;
137 | this.linkLabel4.Location = new System.Drawing.Point(16, 160);
138 | this.linkLabel4.Name = "linkLabel4";
139 | this.linkLabel4.Size = new System.Drawing.Size(327, 15);
140 | this.linkLabel4.TabIndex = 9;
141 | this.linkLabel4.TabStop = true;
142 | this.linkLabel4.Text = "https://github.com/zhblue/freeproblemset";
143 | this.linkLabel4.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel4_LinkClicked);
144 | //
145 | // AboutForm
146 | //
147 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
148 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
149 | this.ClientSize = new System.Drawing.Size(682, 253);
150 | this.Controls.Add(this.linkLabel4);
151 | this.Controls.Add(this.label_Website);
152 | this.Controls.Add(this.label_Github);
153 | this.Controls.Add(this.linkLabel3);
154 | this.Controls.Add(this.linkLabel2);
155 | this.Controls.Add(this.linkLabel1);
156 | this.Controls.Add(this.label1);
157 | this.Controls.Add(this.pictureBox_Azure99);
158 | this.Controls.Add(this.label_Hint);
159 | this.Controls.Add(this.label_EasyFPSViewer);
160 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
161 | this.MaximizeBox = false;
162 | this.MinimizeBox = false;
163 | this.Name = "AboutForm";
164 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
165 | this.Text = "About";
166 | this.Load += new System.EventHandler(this.AboutForm_Load);
167 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox_Azure99)).EndInit();
168 | this.ResumeLayout(false);
169 | this.PerformLayout();
170 |
171 | }
172 |
173 | #endregion
174 |
175 | private System.Windows.Forms.Label label_EasyFPSViewer;
176 | private System.Windows.Forms.Label label_Hint;
177 | private System.Windows.Forms.PictureBox pictureBox_Azure99;
178 | private System.Windows.Forms.Label label1;
179 | private System.Windows.Forms.LinkLabel linkLabel1;
180 | private System.Windows.Forms.LinkLabel linkLabel2;
181 | private System.Windows.Forms.LinkLabel linkLabel3;
182 | private System.Windows.Forms.Label label_Github;
183 | private System.Windows.Forms.Label label_Website;
184 | private System.Windows.Forms.LinkLabel linkLabel4;
185 | }
186 | }
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/AboutForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using EasyFPSViewer.Core;
10 |
11 | namespace EasyFPSViewer
12 | {
13 | public partial class AboutForm : Form
14 | {
15 | public AboutForm()
16 | {
17 | InitializeComponent();
18 | I18N.InitControl(this);
19 | }
20 |
21 | private void AboutForm_Load(object sender, EventArgs e)
22 | {
23 |
24 | }
25 |
26 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
27 | {
28 | System.Diagnostics.Process.Start("https://github.com/Azure99/EasyFPSViewer");
29 | }
30 |
31 | private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
32 | {
33 | System.Diagnostics.Process.Start("https://github.com/Azure99");
34 | }
35 |
36 | private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
37 | {
38 | System.Diagnostics.Process.Start("http://www.rainng.com/");
39 | }
40 |
41 | private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
42 | {
43 | System.Diagnostics.Process.Start("https://github.com/zhblue/freeproblemset");
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/AboutForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Core/FPSViewMaker.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using EasyFPSViewer.Models;
3 |
4 | namespace EasyFPSViewer.Core
5 | {
6 | public static class FPSViewBuilder
7 | {
8 | public static string Build(FPSItem item)
9 | {
10 | StringBuilder sb = new StringBuilder(Properties.Resources.FPSWebView);
11 | sb.Replace("[[[Title]]]", item.Title);
12 | sb.Replace("[[[Description]]]", item.Description);
13 | sb.Replace("[[[TimeLimit]]]", item.TimeLimit + item.TimeLimitUnit);
14 | sb.Replace("[[[MemoryLimit]]]", item.MemoryLimit + item.MemoryLimitUnit);
15 | sb.Replace("[[[Input]]]", item.Input);
16 | sb.Replace("[[[Output]]]", item.Output);
17 | sb.Replace("[[[Sample Input]]]", item.SampleInput);
18 | sb.Replace("[[[Sample Output]]]", item.SampleOutput);
19 | sb.Replace("[[[Hint]]]", item.Hint);
20 | sb.Replace("[[[Source]]]", item.Source);
21 | return sb.ToString();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Core/I18N.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows.Forms;
6 |
7 | namespace EasyFPSViewer.Core
8 | {
9 | public static class I18N
10 | {
11 | private static readonly string LanguageString = System.Globalization.CultureInfo.CurrentCulture.EnglishName.ToLower();
12 | private static Dictionary _languageDic = new Dictionary();
13 | static I18N()
14 | {
15 | string languageData;
16 | if(LanguageString.Contains("chinese"))
17 | {
18 | languageData = Properties.Resources.Zh_Cn;
19 | }
20 | else
21 | {
22 | languageData = "";
23 | }
24 |
25 | InitLanguageDic(languageData);
26 | }
27 |
28 | private static void InitLanguageDic(string langData)
29 | {
30 | string[] rules = langData.Replace("\r\n", "\n").Replace("\r", "\n").Split('\n');
31 | foreach(string rule in rules)
32 | {
33 | if(rule.StartsWith("##"))
34 | {
35 | continue;
36 | }
37 |
38 | string[] split = rule.Split('=');
39 | if(split.Length == 2)
40 | {
41 | _languageDic[split[0]] = split[1];
42 | }
43 | }
44 | }
45 |
46 | public static string GetStr(string str)
47 | {
48 | if (_languageDic.ContainsKey(str))
49 | {
50 | return _languageDic[str];
51 | }
52 |
53 | return str;
54 | }
55 |
56 | public static void InitControl(Control control)
57 | {
58 | control.Text = GetStr(control.Text);
59 | foreach (Control child in control.Controls)
60 | {
61 | if(child is ListView)
62 | {
63 | InitListView(child as ListView);
64 | }
65 | else if(child is MenuStrip)
66 | {
67 | InitMenuStrip(child as MenuStrip);
68 | }
69 |
70 | InitControl(child);
71 | }
72 | }
73 |
74 | public static void InitMenuStrip(MenuStrip menuStrip)
75 | {
76 | menuStrip.Text = GetStr(menuStrip.Text);
77 | foreach(ToolStripMenuItem child in menuStrip.Items)
78 | {
79 | if(child is ToolStripMenuItem)
80 | {
81 | InitToolStripMenuItem(child);
82 | }
83 | }
84 | }
85 |
86 | public static void InitToolStripMenuItem(ToolStripMenuItem stripMenuItem)
87 | {
88 | stripMenuItem.Text = GetStr(stripMenuItem.Text);
89 | foreach(ToolStripItem child in stripMenuItem.DropDownItems)
90 | {
91 | if(child is ToolStripMenuItem)
92 | {
93 | child.Text = GetStr(child.Text);
94 | InitToolStripMenuItem(child as ToolStripMenuItem);
95 | }
96 | }
97 | }
98 |
99 | public static void InitContextMenuStrip(ContextMenuStrip contextMenuStrip)
100 | {
101 | contextMenuStrip.Text = GetStr(contextMenuStrip.Text);
102 | foreach(ToolStripItem child in contextMenuStrip.Items)
103 | {
104 | if(child is ToolStripMenuItem)
105 | {
106 | child.Text = GetStr(child.Text);
107 | InitToolStripMenuItem(child as ToolStripMenuItem);
108 | }
109 | }
110 | }
111 |
112 |
113 | public static void InitListView(ListView listView)
114 | {
115 | foreach(ColumnHeader col in listView.Columns)
116 | {
117 | col.Text = GetStr(col.Text);
118 | }
119 | }
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/EasyFPSViewer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {737DB055-73B3-4A84-B741-944D60B00962}
8 | WinExe
9 | EasyFPSViewer
10 | EasyFPSViewer
11 | v4.0
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Form
49 |
50 |
51 | AboutForm.cs
52 |
53 |
54 |
55 | Form
56 |
57 |
58 | EditForm.cs
59 |
60 |
61 |
62 |
63 |
64 | Form
65 |
66 |
67 | MainForm.cs
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | Form
76 |
77 |
78 | ProblemForm.cs
79 |
80 |
81 |
82 |
83 | Form
84 |
85 |
86 | SearchForm.cs
87 |
88 |
89 | Form
90 |
91 |
92 | SplitForm.cs
93 |
94 |
95 | AboutForm.cs
96 |
97 |
98 | EditForm.cs
99 |
100 |
101 | MainForm.cs
102 |
103 |
104 | ProblemForm.cs
105 |
106 |
107 | ResXFileCodeGenerator
108 | Resources.Designer.cs
109 | Designer
110 |
111 |
112 | True
113 | Resources.resx
114 | True
115 |
116 |
117 | SearchForm.cs
118 |
119 |
120 | SplitForm.cs
121 |
122 |
123 | SettingsSingleFileGenerator
124 | Settings.Designer.cs
125 |
126 |
127 | True
128 | Settings.settings
129 | True
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/EditForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using EasyFPSViewer.Core;
10 | using EasyFPSViewer.Models;
11 |
12 | namespace EasyFPSViewer
13 | {
14 | public partial class EditForm : Form
15 | {
16 | private FPSItem _fpsItem;
17 | private EditForm()
18 | {
19 | InitializeComponent();
20 | I18N.InitControl(this);
21 | }
22 |
23 | public EditForm(FPSItem fpsItem) : this()
24 | {
25 | this.Text = this.Text + " - " + fpsItem.Title;
26 | _fpsItem = fpsItem;
27 | }
28 |
29 | private void EditForm_Load(object sender, EventArgs e)
30 | {
31 | textBox_Title.Text = _fpsItem.Title;
32 | textBox_Description.Text = _fpsItem.Description;
33 | textBox_Input.Text = _fpsItem.Input;
34 | textBox_Output.Text = _fpsItem.Output;
35 | textBox_SampleInput.Text = _fpsItem.SampleInput.Replace("\r\n", "\r").Replace("\n", "\r").Replace("\r", "\r\n");
36 | textBox_SampleOutput.Text = _fpsItem.SampleOutput.Replace("\r\n", "\r").Replace("\n", "\r").Replace("\r", "\r\n");
37 | textBox_Hint.Text = _fpsItem.Hint;
38 | textBox_Source.Text = _fpsItem.Source;
39 | }
40 |
41 | private void button_Save_Click(object sender, EventArgs e)
42 | {
43 | _fpsItem.Title = textBox_Title.Text;
44 | _fpsItem.Description = textBox_Description.Text;
45 | _fpsItem.Input = textBox_Input.Text;
46 | _fpsItem.Output = textBox_Output.Text;
47 | _fpsItem.SampleInput = textBox_SampleInput.Text.Replace("\r\n", "\n").Replace("\r", "\n");
48 | _fpsItem.SampleOutput = textBox_SampleOutput.Text.Replace("\r\n", "\n").Replace("\r", "\n");
49 | _fpsItem.Hint = textBox_Hint.Text;
50 | _fpsItem.Source = textBox_Source.Text;
51 |
52 | if (!_fpsItem.SampleInput.EndsWith("\n"))
53 | {
54 | _fpsItem.SampleInput += "\n";
55 | }
56 |
57 | if (!_fpsItem.SampleOutput.EndsWith("\n"))
58 | {
59 | _fpsItem.SampleOutput += "\n";
60 | }
61 |
62 | MessageBox.Show(I18N.GetStr("Save successful!"));
63 | this.Close();
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/EditForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/FPSListBinder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows.Forms;
6 | using EasyFPSViewer.Core;
7 | using EasyFPSViewer.Models;
8 |
9 | namespace EasyFPSViewer
10 | {
11 | public class FPSListBinder
12 | {
13 | public ListView ListView { get; private set; }
14 | public List FPSItemList { get; private set; }
15 | public Dictionary ViewItemDic { get; private set; }
16 | public Dictionary ProblemFormDic { get; private set; }
17 | public Dictionary EditFormDic { get; private set; }
18 |
19 | public FPSListBinder(ListView listView)
20 | {
21 | ListView = listView;
22 | FPSItemList = new List();
23 | ViewItemDic = new Dictionary();
24 | ProblemFormDic = new Dictionary();
25 | EditFormDic = new Dictionary();
26 | }
27 |
28 | public void Add(FPSItem fpsItem)
29 | {
30 | ListViewItem viewItem = ListView.Items.Add(fpsItem.Title);
31 | viewItem.SubItems.Add(fpsItem.TimeLimit + fpsItem.TimeLimitUnit);
32 | viewItem.SubItems.Add(fpsItem.MemoryLimit + fpsItem.MemoryLimitUnit);
33 |
34 | int casesCount = fpsItem.TestOutput.Length;
35 | if (!string.IsNullOrEmpty(fpsItem.SampleOutput))
36 | {
37 | casesCount++;
38 | }
39 | viewItem.SubItems.Add(casesCount.ToString());
40 | viewItem.SubItems.Add((Math.Max(fpsItem.TestDataSize / 1024, 1)).ToString() + "KB");
41 |
42 | FPSItemList.Add(fpsItem);
43 | ViewItemDic[fpsItem] = viewItem;
44 | }
45 |
46 | public int Search(string title, string description)
47 | {
48 | ClearSelectStatus();
49 | var quary = from n in FPSItemList
50 | where n.Title.ToLower().Contains(title.ToLower())
51 | where n.Description.ToLower().Contains(description.ToLower())
52 | select n;
53 |
54 | FPSItem firstItem = null;
55 | foreach(var fpsItem in quary)
56 | {
57 | if (firstItem == null)
58 | {
59 | firstItem = fpsItem;
60 | }
61 | ViewItemDic[fpsItem].Selected = true;
62 | }
63 |
64 | if (firstItem != null)
65 | {
66 | ViewItemDic[firstItem].EnsureVisible();
67 | ViewItemDic[firstItem].Focused = true;
68 | }
69 |
70 | return quary.Count();
71 | }
72 |
73 | public void ClearSelectStatus()
74 | {
75 | foreach(ListViewItem item in ListView.Items)
76 | {
77 | if(item.Selected)
78 | {
79 | item.Selected = false;
80 | }
81 | }
82 | }
83 | public void Flush()
84 | {
85 | ListView.Items.Clear();
86 | ViewItemDic.Clear();
87 |
88 | foreach(FPSItem fpsItem in FPSItemList)
89 | {
90 | ListViewItem viewItem = ListView.Items.Add(fpsItem.Title);
91 | viewItem.SubItems.Add(fpsItem.TimeLimit + fpsItem.TimeLimitUnit);
92 | viewItem.SubItems.Add(fpsItem.MemoryLimit + fpsItem.MemoryLimitUnit);
93 |
94 | int casesCount = fpsItem.TestOutput.Length;
95 | if (!string.IsNullOrEmpty(fpsItem.SampleOutput))
96 | {
97 | casesCount++;
98 | }
99 | viewItem.SubItems.Add(casesCount.ToString());
100 | viewItem.SubItems.Add((Math.Max(fpsItem.TestDataSize / 1024, 1)).ToString() + "KB");
101 |
102 | ViewItemDic[fpsItem] = viewItem;
103 | }
104 | }
105 |
106 | public void Remove(FPSItem fpsItem)
107 | {
108 | CloseProblemForm(fpsItem);
109 | CloseEditForm(fpsItem);
110 |
111 | ListView.Items.Remove(ViewItemDic[fpsItem]);
112 | ViewItemDic.Remove(fpsItem);
113 | ProblemFormDic.Remove(fpsItem);
114 | EditFormDic.Remove(fpsItem);
115 |
116 | FPSItemList.Remove(fpsItem);
117 |
118 | GC.Collect();
119 | }
120 |
121 | public void Sort(Func selector)
122 | {
123 | FPSItemList = FPSItemList.OrderBy(selector).ToList();
124 | Flush();
125 | }
126 |
127 | public void Clear()
128 | {
129 | foreach(FPSItem key in ProblemFormDic.Keys)
130 | {
131 | CloseProblemForm(key);
132 | }
133 |
134 | foreach (FPSItem key in EditFormDic.Keys)
135 | {
136 | CloseEditForm(key);
137 | }
138 |
139 | ListView.Items.Clear();
140 | ProblemFormDic.Clear();
141 | ViewItemDic.Clear();
142 | FPSItemList.Clear();
143 | EditFormDic.Clear();
144 |
145 | GC.Collect();
146 | }
147 |
148 | public FPSItem[] GetSelectedItems()
149 | {
150 | List selectedList = new List();
151 | foreach(ListViewItem viewItem in ListView.SelectedItems)
152 | {
153 | selectedList.Add(FPSItemList[viewItem.Index]);
154 | }
155 |
156 | return selectedList.ToArray();
157 | }
158 |
159 | public void CreatePorblemForm(FPSItem fpsItem)
160 | {
161 | if (!ProblemFormDic.ContainsKey(fpsItem) || ProblemFormDic[fpsItem].IsDisposed)
162 | {
163 | ProblemFormDic[fpsItem] = new ProblemForm(fpsItem);
164 | ProblemFormDic[fpsItem].Show();
165 | }
166 | else
167 | {
168 | ProblemFormDic[fpsItem].Focus();
169 | }
170 | }
171 |
172 | public void CloseProblemForm(FPSItem fpsItem)
173 | {
174 | if (ProblemFormDic.ContainsKey(fpsItem) && !ProblemFormDic[fpsItem].IsDisposed)
175 | {
176 | ProblemFormDic[fpsItem].Close();
177 | }
178 | }
179 |
180 | public void CreateEditForm(FPSItem fpsItem)
181 | {
182 | if (!EditFormDic.ContainsKey(fpsItem) || EditFormDic[fpsItem].IsDisposed)
183 | {
184 | EditFormDic[fpsItem] = new EditForm(fpsItem);
185 | EditFormDic[fpsItem].Show();
186 | }
187 | else
188 | {
189 | EditFormDic[fpsItem].Focus();
190 | }
191 | }
192 |
193 | public void CloseEditForm(FPSItem fpsItem)
194 | {
195 | if (EditFormDic.ContainsKey(fpsItem) && !EditFormDic[fpsItem].IsDisposed)
196 | {
197 | EditFormDic[fpsItem].Close();
198 | }
199 | }
200 | }
201 | }
202 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/MainForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 195, 17
122 |
123 |
124 | 17, 17
125 |
126 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Models/FPSItem.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace EasyFPSViewer.Models
3 | {
4 | public class FPSItem
5 | {
6 | public string Title { get; set; } = "No Title";
7 | public int TimeLimit { get; set; } = 1;
8 | public string TimeLimitUnit { get; set; } = "s";
9 | public int MemoryLimit { get; set; } = 256;
10 | public string MemoryLimitUnit { get; set; } = "mb";
11 | public string Description { get; set; } = "No Description";
12 | public string Input { get; set; } = "";
13 | public string Output { get; set; } = "";
14 | public string SampleInput { get; set; } = "";
15 | public string SampleOutput { get; set; } = "";
16 | public string Hint { get; set; } = "";
17 | public string Source { get; set; } = "";
18 | public FPSItemSolution[] Solutions { get; set; }
19 | public string[] TestInput { get; set; }
20 | public string[] TestOutput { get; set; }
21 | public FPSItemImage[] Images { get; set; }
22 | public FPSItemSpecialJudge[] SpecialJudge { get; set; }
23 |
24 | public int TestDataSize { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Models/FPSItemImage.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | namespace EasyFPSViewer.Models
4 | {
5 | public class FPSItemImage
6 | {
7 | public string Path { get; set; }
8 | public byte[] Image { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Models/FPSItemSolution.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | namespace EasyFPSViewer.Models
4 | {
5 | public class FPSItemSolution
6 | {
7 | public string Language { get; set; }
8 | public string SourceCode { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Models/FPSItemSpecialJudge.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | namespace EasyFPSViewer.Models
4 | {
5 | public class FPSItemSpecialJudge
6 | {
7 | public string Language { get; set; }
8 | public string SourceCode { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Models/NotFPSFileException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace EasyFPSViewer.Models
4 | {
5 | public class NotFPSFileException : ApplicationException
6 | {
7 | public NotFPSFileException(string message) : base(message)
8 | { }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/ProblemForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace EasyFPSViewer
2 | {
3 | partial class ProblemForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.webBrowser_Main = new System.Windows.Forms.WebBrowser();
32 | this.SuspendLayout();
33 | //
34 | // webBrowser_Main
35 | //
36 | this.webBrowser_Main.Dock = System.Windows.Forms.DockStyle.Fill;
37 | this.webBrowser_Main.Location = new System.Drawing.Point(0, 0);
38 | this.webBrowser_Main.MinimumSize = new System.Drawing.Size(20, 20);
39 | this.webBrowser_Main.Name = "webBrowser_Main";
40 | this.webBrowser_Main.Size = new System.Drawing.Size(800, 450);
41 | this.webBrowser_Main.TabIndex = 0;
42 | this.webBrowser_Main.Url = new System.Uri("", System.UriKind.Relative);
43 | //
44 | // ProblemForm
45 | //
46 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
47 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
48 | this.ClientSize = new System.Drawing.Size(800, 450);
49 | this.Controls.Add(this.webBrowser_Main);
50 | this.Name = "ProblemForm";
51 | this.Text = "Problem";
52 | this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ProblemForm_FormClosed);
53 | this.Load += new System.EventHandler(this.ProblemForm_Load);
54 | this.ResumeLayout(false);
55 |
56 | }
57 |
58 | #endregion
59 |
60 | private System.Windows.Forms.WebBrowser webBrowser_Main;
61 | }
62 | }
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/ProblemForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.IO;
4 | using System.Windows.Forms;
5 | using EasyFPSViewer.Core;
6 | using EasyFPSViewer.Models;
7 |
8 | namespace EasyFPSViewer
9 | {
10 | public partial class ProblemForm : Form
11 | {
12 | private FPSItem fpsItem;
13 | private string tempDir;
14 | private ProblemForm()
15 | {
16 | InitializeComponent();
17 | }
18 |
19 | public ProblemForm(FPSItem item) : this()
20 | {
21 | this.Text = item.Title;
22 |
23 | fpsItem = item;
24 | tempDir = GetTempDirectory();
25 |
26 | ReleaseFPSResources();
27 | webBrowser_Main.Url = new Uri(@"file:\\" + Path.Combine(tempDir, "index.html"));
28 | }
29 |
30 | private void ProblemForm_Load(object sender, EventArgs e)
31 | {
32 |
33 | }
34 |
35 |
36 | private void ReleaseFPSResources()
37 | {
38 | foreach(FPSItemImage img in fpsItem.Images)
39 | {
40 |
41 | string imagePath = new Uri(img.Path).PathAndQuery;
42 | imagePath = Path.Combine(tempDir, imagePath);
43 | Directory.CreateDirectory(Path.GetDirectoryName(imagePath));
44 |
45 | File.WriteAllBytes(imagePath, img.Image);
46 | }
47 |
48 | File.WriteAllText(Path.Combine(tempDir, "index.html"), FPSViewBuilder.Build(fpsItem));
49 | }
50 |
51 | private string GetTempDirectory()
52 | {
53 | Random random = new Random();
54 | StringBuilder sb = new StringBuilder();
55 | for (int i = 0; i < 10; i++)
56 | {
57 | sb.Append(random.Next(0, 10));
58 | }
59 |
60 | string path = Path.GetFullPath(Path.Combine("Pages", sb.ToString()));
61 | Directory.CreateDirectory(path);
62 |
63 | return path;
64 | }
65 |
66 | private void ProblemForm_FormClosed(object sender, FormClosedEventArgs e)
67 | {
68 | Directory.Delete(tempDir, true);
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/ProblemForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace EasyFPSViewer
5 | {
6 | static class Program
7 | {
8 | ///
9 | /// 应用程序的主入口点。
10 | ///
11 | [STAThread]
12 | static void Main()
13 | {
14 | Application.EnableVisualStyles();
15 | Application.SetCompatibleTextRenderingDefault(false);
16 | Application.Run(new MainForm());
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("EasyFPSViewer")]
9 | [assembly: AssemblyDescription("An easy Freeproblemset File view and edit tool")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Rainng")]
12 | [assembly: AssemblyProduct("EasyFPSViewer")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("737db055-73b3-4a84-b741-944d60b00962")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
33 | // 方法是按如下所示使用“*”: :
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.1.0.0")]
36 | [assembly: AssemblyFileVersion("1.1.0.0")]
37 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EasyFPSViewer.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EasyFPSViewer.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 重写当前线程的 CurrentUICulture 属性
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
65 | ///
66 | internal static System.Drawing.Bitmap Azure99 {
67 | get {
68 | object obj = ResourceManager.GetObject("Azure99", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// 查找类似 <!DOCTYPE html>
75 | ///<html>
76 | ///<head>
77 | ///<meta charset="utf-8">
78 | ///<title>Problem</title>
79 | ///</head>
80 | ///
81 | ///<body>
82 | ///<div>
83 | /// <h2 style="text-align: center;">[[[Title]]]</h2>
84 | /// <hr />
85 | /// <div style="text-align: center;">
86 | /// <p>TimeLimit:[[[TimeLimit]]] | MemoryLimit:[[[MemoryLimit]]]</p>
87 | /// </div>
88 | /// <div>
89 | /// <h3>Description</h3>
90 | /// <div style="background-color: #f0f0f5;">[[[Description]]]</div>
91 | /// <h3>Input</h3>
92 | /// <div style="background-color: #f0f0f5;">[[[Input]]]</div>
93 | /// < [字符串的其余部分被截断]"; 的本地化字符串。
94 | ///
95 | internal static string FPSWebView {
96 | get {
97 | return ResourceManager.GetString("FPSWebView", resourceCulture);
98 | }
99 | }
100 |
101 | ///
102 | /// 查找类似 ##简体中文
103 | ///File=文件
104 | ///Load=加载
105 | ///Save=保存
106 | ///About=关于
107 | ///Exit=退出
108 | ///
109 | ///Edit=编辑
110 | ///Clear=清空
111 | ///Tools=工具
112 | ///Replace NewLine To \n=替换换行符为\n
113 | ///Split FPS=切割FPS 的本地化字符串。
114 | ///
115 | internal static string Zh_Cn {
116 | get {
117 | return ResourceManager.GetString("Zh_Cn", resourceCulture);
118 | }
119 | }
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\FPSWebView.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312
123 |
124 |
125 | ..\Resources\Azure99.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\Resources\Zh_Cn.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
129 |
130 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EasyFPSViewer.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Resources/Azure99.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/EasyFPSViewer/src/EasyFPSViewer/Resources/Azure99.jpg
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Resources/FPSWebView.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Problem
6 |
7 |
8 |
9 |
10 |
[[[Title]]]
11 |
12 |
13 |
TimeLimit:[[[TimeLimit]]] | MemoryLimit:[[[MemoryLimit]]]
14 |
15 |
16 |
Description
17 |
[[[Description]]]
18 |
Input
19 |
[[[Input]]]
20 |
Output
21 |
[[[Output]]]
22 |
Sample Input
23 |
[[[Sample Input]]]
24 |
Sample Output
25 |
[[[Sample Output]]]
26 |
Hint
27 |
[[[Hint]]]
28 |
Source
29 | [[[Source]]]
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/Resources/Zh_Cn.txt:
--------------------------------------------------------------------------------
1 | ##简体中文
2 | File=文件
3 | Load=加载
4 | Save=保存
5 | Bug Report=错误反馈
6 | About=关于
7 | Exit=退出
8 |
9 | Add Problem=添加问题
10 | Edit=编辑
11 | Search=搜索
12 | Clear=清空
13 | Tools=工具
14 | Replace NewLine To \n=替换换行符为\n
15 | Split FPS=切割FPS
16 |
17 | Title=标题
18 | TimeLimit=时间限制
19 | MemoryLimit=内存限制
20 | TestCases=测试点数
21 | DataSize=数据大小
22 |
23 | Show Details=查看详情
24 | Delete=删除
25 |
26 | Title:=标题:
27 | Description:=题目描述:
28 |
29 | Browse=搜索
30 | Split=分割
31 | Help?=帮助?
32 |
33 | Output Directory:=输出目录:
34 | File Prefix:=文件名前缀:
35 | Szie:=大小
36 |
37 | Save successful!=保存成功!
38 | Save failed!=保存失败!
39 | This operation will replace all NewLine Chars of TestData to \n(Linux). Are you sure ? =此操作将替换测试数据中所有的换行符为\n(Linux). 您确定吗?
40 | Replace successful!=替换成功!
41 | Result Count=结果数
42 |
43 | Keywords can not be empty.=关键词不能同时为空.
44 |
45 | Split successful!=分割成功!
46 | Split failed!=分割失败!
47 | Size must be a number.=大小 必须为整数
48 | Split tool can split a big FPS file to some little files.=分割工具可以将一个较大的FPS文件切割为多个小文件.
49 | description:= 描述:
50 | Input:=输入:
51 | Output:=输出:
52 | SampleInput=样例输入
53 | SampleOutput=样例输出
54 | Hint:=提示:
55 | Source:=来源:
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/SearchForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace EasyFPSViewer
2 | {
3 | partial class SearchForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.textBox_Title = new System.Windows.Forms.TextBox();
32 | this.label_Title = new System.Windows.Forms.Label();
33 | this.label_Description = new System.Windows.Forms.Label();
34 | this.textBox_Description = new System.Windows.Forms.TextBox();
35 | this.button_Search = new System.Windows.Forms.Button();
36 | this.SuspendLayout();
37 | //
38 | // textBox_Title
39 | //
40 | this.textBox_Title.Location = new System.Drawing.Point(113, 14);
41 | this.textBox_Title.Name = "textBox_Title";
42 | this.textBox_Title.Size = new System.Drawing.Size(174, 25);
43 | this.textBox_Title.TabIndex = 0;
44 | //
45 | // label_Title
46 | //
47 | this.label_Title.AutoSize = true;
48 | this.label_Title.Location = new System.Drawing.Point(13, 17);
49 | this.label_Title.Name = "label_Title";
50 | this.label_Title.Size = new System.Drawing.Size(55, 15);
51 | this.label_Title.TabIndex = 1;
52 | this.label_Title.Text = "Title:";
53 | //
54 | // label_Description
55 | //
56 | this.label_Description.AutoSize = true;
57 | this.label_Description.Location = new System.Drawing.Point(12, 56);
58 | this.label_Description.Name = "label_Description";
59 | this.label_Description.Size = new System.Drawing.Size(103, 15);
60 | this.label_Description.TabIndex = 2;
61 | this.label_Description.Text = "Description:";
62 | //
63 | // textBox_Description
64 | //
65 | this.textBox_Description.Location = new System.Drawing.Point(113, 53);
66 | this.textBox_Description.Name = "textBox_Description";
67 | this.textBox_Description.Size = new System.Drawing.Size(174, 25);
68 | this.textBox_Description.TabIndex = 3;
69 | //
70 | // button_Search
71 | //
72 | this.button_Search.Location = new System.Drawing.Point(307, 14);
73 | this.button_Search.Name = "button_Search";
74 | this.button_Search.Size = new System.Drawing.Size(140, 65);
75 | this.button_Search.TabIndex = 4;
76 | this.button_Search.Text = "Search";
77 | this.button_Search.UseVisualStyleBackColor = true;
78 | this.button_Search.Click += new System.EventHandler(this.button_Search_Click);
79 | //
80 | // SearchForm
81 | //
82 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
83 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
84 | this.ClientSize = new System.Drawing.Size(462, 93);
85 | this.Controls.Add(this.button_Search);
86 | this.Controls.Add(this.textBox_Description);
87 | this.Controls.Add(this.label_Description);
88 | this.Controls.Add(this.label_Title);
89 | this.Controls.Add(this.textBox_Title);
90 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
91 | this.MaximizeBox = false;
92 | this.MinimizeBox = false;
93 | this.Name = "SearchForm";
94 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
95 | this.Text = "Search";
96 | this.Load += new System.EventHandler(this.SearchForm_Load);
97 | this.ResumeLayout(false);
98 | this.PerformLayout();
99 |
100 | }
101 |
102 | #endregion
103 |
104 | private System.Windows.Forms.TextBox textBox_Title;
105 | private System.Windows.Forms.Label label_Title;
106 | private System.Windows.Forms.Label label_Description;
107 | private System.Windows.Forms.TextBox textBox_Description;
108 | private System.Windows.Forms.Button button_Search;
109 | }
110 | }
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/SearchForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using EasyFPSViewer.Core;
10 |
11 | namespace EasyFPSViewer
12 | {
13 | public partial class SearchForm : Form
14 | {
15 | public Tuple Result { get; private set; }
16 | public SearchForm()
17 | {
18 | InitializeComponent();
19 | I18N.InitControl(this);
20 | Result = new Tuple(false, "", "");
21 | }
22 |
23 | private void SearchForm_Load(object sender, EventArgs e)
24 | {
25 |
26 | }
27 |
28 | private void button_Search_Click(object sender, EventArgs e)
29 | {
30 | if (string.IsNullOrEmpty(textBox_Description.Text) &&
31 | string.IsNullOrEmpty(textBox_Title.Text))
32 | {
33 | MessageBox.Show(I18N.GetStr("Keywords can not be empty."));
34 | return;
35 | }
36 | Result = new Tuple(true, textBox_Title.Text, textBox_Description.Text);
37 | this.Hide();
38 | this.Close();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/SearchForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/SplitForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace EasyFPSViewer
2 | {
3 | partial class SplitForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label_OutputDirectory = new System.Windows.Forms.Label();
32 | this.textBox_OutputDir = new System.Windows.Forms.TextBox();
33 | this.label_Prefix = new System.Windows.Forms.Label();
34 | this.textBox_Prefix = new System.Windows.Forms.TextBox();
35 | this.button_Split = new System.Windows.Forms.Button();
36 | this.button_Browse = new System.Windows.Forms.Button();
37 | this.label_Size = new System.Windows.Forms.Label();
38 | this.textBox_Size = new System.Windows.Forms.TextBox();
39 | this.label_MB = new System.Windows.Forms.Label();
40 | this.button_Help = new System.Windows.Forms.Button();
41 | this.SuspendLayout();
42 | //
43 | // label_OutputDirectory
44 | //
45 | this.label_OutputDirectory.AutoSize = true;
46 | this.label_OutputDirectory.Location = new System.Drawing.Point(22, 37);
47 | this.label_OutputDirectory.Name = "label_OutputDirectory";
48 | this.label_OutputDirectory.Size = new System.Drawing.Size(143, 15);
49 | this.label_OutputDirectory.TabIndex = 0;
50 | this.label_OutputDirectory.Text = "Output Directory:";
51 | //
52 | // textBox_OutputDir
53 | //
54 | this.textBox_OutputDir.Location = new System.Drawing.Point(172, 34);
55 | this.textBox_OutputDir.Name = "textBox_OutputDir";
56 | this.textBox_OutputDir.Size = new System.Drawing.Size(291, 25);
57 | this.textBox_OutputDir.TabIndex = 1;
58 | //
59 | // label_Prefix
60 | //
61 | this.label_Prefix.AutoSize = true;
62 | this.label_Prefix.Location = new System.Drawing.Point(62, 85);
63 | this.label_Prefix.Name = "label_Prefix";
64 | this.label_Prefix.Size = new System.Drawing.Size(103, 15);
65 | this.label_Prefix.TabIndex = 2;
66 | this.label_Prefix.Text = "File Prefix:";
67 | //
68 | // textBox_Prefix
69 | //
70 | this.textBox_Prefix.Location = new System.Drawing.Point(172, 82);
71 | this.textBox_Prefix.Name = "textBox_Prefix";
72 | this.textBox_Prefix.Size = new System.Drawing.Size(100, 25);
73 | this.textBox_Prefix.TabIndex = 3;
74 | this.textBox_Prefix.Text = "FPS_";
75 | //
76 | // button_Split
77 | //
78 | this.button_Split.Location = new System.Drawing.Point(118, 137);
79 | this.button_Split.Name = "button_Split";
80 | this.button_Split.Size = new System.Drawing.Size(313, 62);
81 | this.button_Split.TabIndex = 4;
82 | this.button_Split.Text = "Split";
83 | this.button_Split.UseVisualStyleBackColor = true;
84 | this.button_Split.Click += new System.EventHandler(this.button_Split_Click);
85 | //
86 | // button_Browse
87 | //
88 | this.button_Browse.Location = new System.Drawing.Point(471, 34);
89 | this.button_Browse.Name = "button_Browse";
90 | this.button_Browse.Size = new System.Drawing.Size(75, 26);
91 | this.button_Browse.TabIndex = 5;
92 | this.button_Browse.Text = "Browse";
93 | this.button_Browse.UseVisualStyleBackColor = true;
94 | this.button_Browse.Click += new System.EventHandler(this.button_Browse_Click);
95 | //
96 | // label_Size
97 | //
98 | this.label_Size.AutoSize = true;
99 | this.label_Size.Location = new System.Drawing.Point(303, 85);
100 | this.label_Size.Name = "label_Size";
101 | this.label_Size.Size = new System.Drawing.Size(47, 15);
102 | this.label_Size.TabIndex = 6;
103 | this.label_Size.Text = "Size:";
104 | //
105 | // textBox_Size
106 | //
107 | this.textBox_Size.Location = new System.Drawing.Point(356, 82);
108 | this.textBox_Size.Name = "textBox_Size";
109 | this.textBox_Size.Size = new System.Drawing.Size(75, 25);
110 | this.textBox_Size.TabIndex = 7;
111 | this.textBox_Size.Text = "5";
112 | //
113 | // label_MB
114 | //
115 | this.label_MB.AutoSize = true;
116 | this.label_MB.Location = new System.Drawing.Point(440, 85);
117 | this.label_MB.Name = "label_MB";
118 | this.label_MB.Size = new System.Drawing.Size(23, 15);
119 | this.label_MB.TabIndex = 8;
120 | this.label_MB.Text = "mb";
121 | //
122 | // button_Help
123 | //
124 | this.button_Help.Location = new System.Drawing.Point(471, 151);
125 | this.button_Help.Name = "button_Help";
126 | this.button_Help.Size = new System.Drawing.Size(60, 35);
127 | this.button_Help.TabIndex = 9;
128 | this.button_Help.Text = "Help?";
129 | this.button_Help.UseVisualStyleBackColor = true;
130 | this.button_Help.Click += new System.EventHandler(this.button_Help_Click);
131 | //
132 | // SplitForm
133 | //
134 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
135 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
136 | this.ClientSize = new System.Drawing.Size(558, 222);
137 | this.Controls.Add(this.button_Help);
138 | this.Controls.Add(this.label_MB);
139 | this.Controls.Add(this.textBox_Size);
140 | this.Controls.Add(this.label_Size);
141 | this.Controls.Add(this.button_Browse);
142 | this.Controls.Add(this.button_Split);
143 | this.Controls.Add(this.textBox_Prefix);
144 | this.Controls.Add(this.label_Prefix);
145 | this.Controls.Add(this.textBox_OutputDir);
146 | this.Controls.Add(this.label_OutputDirectory);
147 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
148 | this.MaximizeBox = false;
149 | this.Name = "SplitForm";
150 | this.Text = "Split";
151 | this.Load += new System.EventHandler(this.SplitForm_Load);
152 | this.ResumeLayout(false);
153 | this.PerformLayout();
154 |
155 | }
156 |
157 | #endregion
158 |
159 | private System.Windows.Forms.Label label_OutputDirectory;
160 | private System.Windows.Forms.TextBox textBox_OutputDir;
161 | private System.Windows.Forms.Label label_Prefix;
162 | private System.Windows.Forms.TextBox textBox_Prefix;
163 | private System.Windows.Forms.Button button_Split;
164 | private System.Windows.Forms.Button button_Browse;
165 | private System.Windows.Forms.Label label_Size;
166 | private System.Windows.Forms.TextBox textBox_Size;
167 | private System.Windows.Forms.Label label_MB;
168 | private System.Windows.Forms.Button button_Help;
169 | }
170 | }
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/SplitForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.IO;
9 | using System.Windows.Forms;
10 | using EasyFPSViewer.Core;
11 | using EasyFPSViewer.Models;
12 |
13 | namespace EasyFPSViewer
14 | {
15 | public partial class SplitForm : Form
16 | {
17 | private List _fpsItemList;
18 | private SplitForm()
19 | {
20 | InitializeComponent();
21 | I18N.InitControl(this);
22 | }
23 |
24 | public SplitForm(List fpsItemList) : this()
25 | {
26 | _fpsItemList = fpsItemList;
27 | }
28 |
29 | private void SplitForm_Load(object sender, EventArgs e)
30 | {
31 | textBox_OutputDir.Text = Environment.CurrentDirectory;
32 | }
33 |
34 | private void button_Browse_Click(object sender, EventArgs e)
35 | {
36 | FolderBrowserDialog dialog = new FolderBrowserDialog();
37 | if(dialog.ShowDialog() == DialogResult.OK)
38 | {
39 | textBox_OutputDir.Text = dialog.SelectedPath;
40 | }
41 | }
42 |
43 | private void button_Split_Click(object sender, EventArgs e)
44 | {
45 | try
46 | {
47 | SplitFPSFile();
48 | MessageBox.Show(I18N.GetStr("Split successful!"));
49 | }
50 | catch
51 | {
52 | MessageBox.Show(I18N.GetStr("Split failed!"));
53 | }
54 | }
55 |
56 | private void SplitFPSFile()
57 | {
58 | int size;
59 | if (!Int32.TryParse(textBox_Size.Text, out size))
60 | {
61 | MessageBox.Show(I18N.GetStr("Size must be a number."));
62 | return;
63 | }
64 |
65 | int outputNum = 1;
66 | List itemBufferList = new List();
67 | int nowSize = 0;
68 | foreach (FPSItem item in _fpsItemList)
69 | {
70 | nowSize += item.TestDataSize / 1024 / 1024;
71 | itemBufferList.Add(item);
72 |
73 | if (nowSize >= size)
74 | {
75 | WriteFPSFile(itemBufferList, textBox_OutputDir.Text, textBox_Prefix.Text, outputNum++);
76 |
77 | itemBufferList.Clear();
78 | nowSize = 0;
79 | }
80 | }
81 |
82 | if(itemBufferList.Count > 0)
83 | {
84 | WriteFPSFile(itemBufferList, textBox_OutputDir.Text, textBox_Prefix.Text, outputNum++);
85 | }
86 | }
87 |
88 | private void WriteFPSFile(List itemList, string dir, string prefix, int num)
89 | {
90 | string path = Path.Combine(dir, prefix + num + ".xml");
91 | using (FileStream fs = new FileStream(path, FileMode.Create))
92 | {
93 | new FPSParser().ConvertToStream(itemList.ToArray(), fs);
94 | }
95 | }
96 |
97 | private void button_Help_Click(object sender, EventArgs e)
98 | {
99 | MessageBox.Show(I18N.GetStr("Split tool can split a big FPS file to some little files."));
100 | }
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/EasyFPSViewer/src/EasyFPSViewer/SplitForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/FAQ.md:
--------------------------------------------------------------------------------
1 | FAQ on fps
2 | ----
3 |
4 |
5 | 导入失败
6 | --
7 | 1、先用谷歌浏览器直接打开xml文件,看是否有语法错误,如果有,用文本编辑器修订提示的行号。
8 |
9 | 2、如果超过100M,可以先用EasyFPSViewer拆分成多个小文件,然后再导入。
10 |
11 | 3、对于HUSTOJ,可以先压缩为zip再上传导入
12 |
13 | 特殊元素说明
14 | --
15 | append是自动加在学生代码后面的代码,prepend是前面。
16 |
17 | solution是给管理员、老师用的参考程序。
18 |
19 | template是提交时直接给学生看的,用来做程序填空题的模板。
20 |
21 | spj是基于HUSTOJ规范的special judge程序
22 |
23 | tpj是基于testlib.h规范的special judge程序
24 |
25 | remote_oj 是用于远程判题的宿主机标识,hustoj中会调用include/remote_xxx.php来评测标识为xxx的远程题,通常由宿主服务器管理员导出题目时手工填写。
26 |
27 | remote_id 是用于远程判题的题目序号,这个序号是宿主机上同个题目的标识,一般不改动。
28 |
--------------------------------------------------------------------------------
/FPSParser/FPSParser.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 10.00
3 | # Visual Studio 2008
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FPSParser", "FPSParser\FPSParser.csproj", "{E8DEED09-E289-41DD-9E5B-6D6083F9E273}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {E8DEED09-E289-41DD-9E5B-6D6083F9E273}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {E8DEED09-E289-41DD-9E5B-6D6083F9E273}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {E8DEED09-E289-41DD-9E5B-6D6083F9E273}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {E8DEED09-E289-41DD-9E5B-6D6083F9E273}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/FPSParser/FPSParser.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/FPSParser/FPSParser.suo
--------------------------------------------------------------------------------
/FPSParser/FPSParser/20120605025014400_easyicon_cn_32.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/FPSParser/FPSParser/20120605025014400_easyicon_cn_32.ico
--------------------------------------------------------------------------------
/FPSParser/FPSParser/FPSParser.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FPSParser
2 | {
3 | partial class FPSParser
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows 窗体设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FPSParser));
32 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
33 | this.textBox1 = new System.Windows.Forms.TextBox();
34 | this.button1 = new System.Windows.Forms.Button();
35 | this.button2 = new System.Windows.Forms.Button();
36 | this.label1 = new System.Windows.Forms.Label();
37 | this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
38 | this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
39 | this.baseUrl = new System.Windows.Forms.TextBox();
40 | this.label2 = new System.Windows.Forms.Label();
41 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
42 | this.SuspendLayout();
43 | //
44 | // pictureBox1
45 | //
46 | this.pictureBox1.Image = global::FPSParser.Properties.Resources._20120605025014400_easyicon_cn_32;
47 | this.pictureBox1.Location = new System.Drawing.Point(12, 10);
48 | this.pictureBox1.Name = "pictureBox1";
49 | this.pictureBox1.Size = new System.Drawing.Size(32, 32);
50 | this.pictureBox1.TabIndex = 1;
51 | this.pictureBox1.TabStop = false;
52 | //
53 | // textBox1
54 | //
55 | this.textBox1.AllowDrop = true;
56 | this.textBox1.Location = new System.Drawing.Point(53, 35);
57 | this.textBox1.Name = "textBox1";
58 | this.textBox1.ReadOnly = true;
59 | this.textBox1.Size = new System.Drawing.Size(160, 21);
60 | this.textBox1.TabIndex = 3;
61 | //
62 | // button1
63 | //
64 | this.button1.Location = new System.Drawing.Point(53, 62);
65 | this.button1.Name = "button1";
66 | this.button1.Size = new System.Drawing.Size(67, 21);
67 | this.button1.TabIndex = 4;
68 | this.button1.Text = "Browse...";
69 | this.button1.UseVisualStyleBackColor = true;
70 | this.button1.Click += new System.EventHandler(this.button1_Click);
71 | //
72 | // button2
73 | //
74 | this.button2.Location = new System.Drawing.Point(146, 62);
75 | this.button2.Name = "button2";
76 | this.button2.Size = new System.Drawing.Size(67, 21);
77 | this.button2.TabIndex = 5;
78 | this.button2.Text = "Parse (&P)";
79 | this.button2.UseVisualStyleBackColor = true;
80 | this.button2.Click += new System.EventHandler(this.button2_Click);
81 | //
82 | // label1
83 | //
84 | this.label1.AutoSize = true;
85 | this.label1.Location = new System.Drawing.Point(142, 86);
86 | this.label1.Name = "label1";
87 | this.label1.Size = new System.Drawing.Size(71, 12);
88 | this.label1.TabIndex = 6;
89 | this.label1.Text = "By XadillaX";
90 | //
91 | // openFileDialog1
92 | //
93 | this.openFileDialog1.Filter = "FPS File (*.xml)|*.xml|All files (*.*)|*.*";
94 | this.openFileDialog1.Title = "Select a FPS file";
95 | //
96 | // folderBrowserDialog1
97 | //
98 | this.folderBrowserDialog1.Description = "Select a folder to save the result.";
99 | //
100 | // baseUrl
101 | //
102 | this.baseUrl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
103 | this.baseUrl.Location = new System.Drawing.Point(53, 10);
104 | this.baseUrl.Name = "baseUrl";
105 | this.baseUrl.Size = new System.Drawing.Size(160, 21);
106 | this.baseUrl.TabIndex = 7;
107 | this.baseUrl.Text = "Base Url";
108 | this.baseUrl.Leave += new System.EventHandler(this.baseUrl_Leave);
109 | this.baseUrl.Enter += new System.EventHandler(this.baseUrl_Enter);
110 | //
111 | // label2
112 | //
113 | this.label2.AutoSize = true;
114 | this.label2.ForeColor = System.Drawing.Color.Red;
115 | this.label2.Location = new System.Drawing.Point(52, 104);
116 | this.label2.Name = "label2";
117 | this.label2.Size = new System.Drawing.Size(161, 12);
118 | this.label2.TabIndex = 8;
119 | this.label2.Text = "Single test data file only";
120 | //
121 | // FPSParser
122 | //
123 | this.AllowDrop = true;
124 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
125 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
126 | this.ClientSize = new System.Drawing.Size(225, 125);
127 | this.Controls.Add(this.label2);
128 | this.Controls.Add(this.baseUrl);
129 | this.Controls.Add(this.label1);
130 | this.Controls.Add(this.button2);
131 | this.Controls.Add(this.button1);
132 | this.Controls.Add(this.textBox1);
133 | this.Controls.Add(this.pictureBox1);
134 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
135 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
136 | this.ImeMode = System.Windows.Forms.ImeMode.Disable;
137 | this.MaximizeBox = false;
138 | this.Name = "FPSParser";
139 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
140 | this.Text = "XaFPSParser";
141 | this.TopMost = true;
142 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
143 | this.ResumeLayout(false);
144 | this.PerformLayout();
145 |
146 | }
147 |
148 | #endregion
149 |
150 | private System.Windows.Forms.PictureBox pictureBox1;
151 | private System.Windows.Forms.TextBox textBox1;
152 | private System.Windows.Forms.Button button1;
153 | private System.Windows.Forms.Button button2;
154 | private System.Windows.Forms.Label label1;
155 | private System.Windows.Forms.OpenFileDialog openFileDialog1;
156 | private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
157 | private System.Windows.Forms.TextBox baseUrl;
158 | private System.Windows.Forms.Label label2;
159 | }
160 | }
161 |
162 |
--------------------------------------------------------------------------------
/FPSParser/FPSParser/FPSParser.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 9.0.21022
7 | 2.0
8 | {E8DEED09-E289-41DD-9E5B-6D6083F9E273}
9 | WinExe
10 | Properties
11 | FPSParser
12 | FPSParser
13 | v3.5
14 | 512
15 | 20120605025014400_easyicon_cn_32.ico
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 | 3.5
38 |
39 |
40 | 3.5
41 |
42 |
43 | 3.5
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | Form
54 |
55 |
56 | FPSParser.cs
57 |
58 |
59 |
60 |
61 | FPSParser.cs
62 | Designer
63 |
64 |
65 | ResXFileCodeGenerator
66 | Resources.Designer.cs
67 | Designer
68 |
69 |
70 | True
71 | Resources.resx
72 | True
73 |
74 |
75 | SettingsSingleFileGenerator
76 | Settings.Designer.cs
77 |
78 |
79 | True
80 | Settings.settings
81 | True
82 |
83 |
84 |
85 |
86 |
87 |
88 |
95 |
--------------------------------------------------------------------------------
/FPSParser/FPSParser/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Windows.Forms;
5 |
6 | namespace FPSParser
7 | {
8 | static class Program
9 | {
10 | ///
11 | /// 应用程序的主入口点。
12 | ///
13 | [STAThread]
14 | static void Main()
15 | {
16 | Application.EnableVisualStyles();
17 | Application.SetCompatibleTextRenderingDefault(false);
18 | Application.Run(new FPSParser());
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FPSParser/FPSParser/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列属性集
6 | // 控制。更改这些属性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("FPSParser")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("China")]
12 | [assembly: AssemblyProduct("FPSParser")]
13 | [assembly: AssemblyCopyright("Copyright © China 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 属性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("d18e35fa-a531-4d9a-9c5c-6f0faf5c934b")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/FPSParser/FPSParser/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行库版本:2.0.50727.1891
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FPSParser.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 强类型资源类,用于查找本地化字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FPSParser.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 为使用此强类型资源类的所有资源查找
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | internal static System.Drawing.Bitmap _20120605025014400_easyicon_cn_32 {
64 | get {
65 | object obj = ResourceManager.GetObject("20120605025014400_easyicon_cn_32", resourceCulture);
66 | return ((System.Drawing.Bitmap)(obj));
67 | }
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/FPSParser/FPSParser/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\20120605025014400_easyicon_cn_32.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
--------------------------------------------------------------------------------
/FPSParser/FPSParser/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.1891
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FPSParser.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/FPSParser/FPSParser/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/FPSParser/FPSParser/bin/Debug/FPSParser.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/FPSParser/FPSParser/bin/Debug/FPSParser.exe
--------------------------------------------------------------------------------
/FPSParser/FPSParser/bin/Debug/template.tpl:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 | [{$idx}] {$title}
6 |
7 |
8 | {$baseurl}
9 |
10 |
26 |
27 |
28 |
29 |
[{$idx}] {$title}
30 |
31 | Time Limit: {$time_limit} ms Memory Limit: {$memory_limit} KB
32 |
33 |
34 |
35 |
Description
36 | {$description}
37 |
38 |
39 |
40 |
Input
41 | {$input}
42 |
43 |
44 |
45 |
Output
46 | {$output}
47 |
48 |
49 |
50 |
Sample Input
51 |
{$sample_input}
52 |
53 |
54 |
55 |
Sample Output
56 |
{$sample_output}
57 |
58 |
59 |
60 |
Hint
61 | {$hint}
62 |
63 |
64 |
65 |
Source
66 | {$source}
67 |
68 |
69 |
70 |
Solution
71 | {$solution}
72 |
73 |
74 |
78 |
79 |
80 | Generated by XaFPSParser | admin@xcoder.in
81 |
82 |
83 |
--------------------------------------------------------------------------------
/FPSParser/FPSParser/bin/Release/FPSParser.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/FPSParser/FPSParser/bin/Release/FPSParser.exe
--------------------------------------------------------------------------------
/FPSParser/FPSParser/bin/Release/template.tpl:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 | [{$idx}] {$title}
6 |
7 |
8 | {$baseurl}
9 |
10 |
26 |
27 |
28 |
29 |
[{$idx}] {$title}
30 |
31 | Time Limit: {$time_limit} ms Memory Limit: {$memory_limit} KB
32 |
33 |
34 |
35 |
Description
36 | {$description}
37 |
38 |
39 |
40 |
Input
41 | {$input}
42 |
43 |
44 |
45 |
Output
46 | {$output}
47 |
48 |
49 |
50 |
Sample Input
51 |
{$sample_input}
52 |
53 |
54 |
55 |
Sample Output
56 |
{$sample_output}
57 |
58 |
59 |
60 |
Hint
61 | {$hint}
62 |
63 |
64 |
65 |
Source
66 | {$source}
67 |
68 |
69 |
70 |
Solution
71 | {$solution}
72 |
73 |
74 |
78 |
79 |
80 | Generated by XaFPSParser | admin@xcoder.in
81 |
82 |
83 |
--------------------------------------------------------------------------------
/FPSPythonParser/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/FPSPythonParser/__init__.py
--------------------------------------------------------------------------------
/FPSPythonParser/fps.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 | ]]>
10 |
11 | Two integer a,b (0<=a,b<=10)
12 |
]]>
13 |
14 | Output a+b
15 | ]]>
16 |
17 |
18 |
20 |
21 |
24 |
26 |
27 |
28 |
29 | int main()
30 | {
31 | int a,b;
32 | while(scanf("%d%d",&a,&b)!=EOF)
33 | {
34 | printf("%d\n",a+b);
35 | }
36 | return 0;
37 | }]]>
38 |
39 |
40 | int main()
41 | {
42 | int a,b;
43 | scanf("%d %d",&a,&b);
44 | printf("%d",a+b);
45 | return 0;
46 | }
47 | ]]>
48 |
49 | #include
50 | using namespace std;
51 | int main()
52 | {
53 | #ifndef ONLINE_JUDGE
54 | freopen("in.txt","r",stdin);
55 | #endif
56 | int a,b;
57 | while(cin >>a >>b)
58 | {
59 | cout <
63 |
64 | using namespace std;
65 | int main(){
66 | int a,b;
67 | while(cin >> a >> b)
68 | cout << a+b << endl;
69 | return 0;
70 | }
71 | ]]>
72 |
79 |
95 |
103 |
117 |
124 |
125 |
126 | int main()
127 | {
128 | int a,b;
129 | scanf("%d %d",&a,&b);
130 | printf("%d",a+b);
131 | return 0;
132 | }
133 | ]]>
134 |
135 | using namespace std;
136 | int main(){
137 | int a,b;
138 | while(cin >> a >> b)
139 | cout << a+b << endl;
140 | return 0;
141 | }
142 | ]]>
143 |
145 |
146 |
--------------------------------------------------------------------------------
/FPSPythonParser/parser.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import copy
3 | import base64
4 | import random
5 | import string
6 | import xml.etree.ElementTree as ET
7 |
8 |
9 | class FPSParser(object):
10 | def __init__(self, fps_path):
11 | self.fps_path = fps_path
12 | self.version = None
13 |
14 | @property
15 | def _root(self):
16 | root = ET.ElementTree(file=self.fps_path).getroot()
17 | self.version = root.attrib.get("version", "No Version")
18 | if self.version not in ["1.1", "1.2"]:
19 | raise ValueError("Unsupported version '" + self.version + "'")
20 | return root
21 |
22 | def parse(self):
23 | ret = []
24 | for node in self._root:
25 | if node.tag == "item":
26 | ret.append(self._parse_one_problem(node))
27 | return ret
28 |
29 | def _parse_one_problem(self, node):
30 | sample_start = True
31 | test_case_start = True
32 | problem = {"title": "No Title", "description": "No Description",
33 | "input": "No Input Description",
34 | "output": "No Output Description",
35 | "memory_limit": {"unit": None, "value": None},
36 | "time_limit": {"unit": None, "value": None},
37 | "samples": [], "images": [], "append": [],
38 | "template": [], "prepend": [], "test_cases": [],
39 | "hint": None, "source": None, "spj": None, "solution": []}
40 | for item in node:
41 | tag = item.tag
42 | if tag in ["title", "description", "input", "output", "hint", "source"]:
43 | problem[item.tag] = item.text
44 | elif tag == "time_limit":
45 | unit = item.attrib.get("unit", "s")
46 | if unit not in ["s", "ms"]:
47 | raise ValueError("Invalid time limit unit")
48 | problem["time_limit"]["unit"] = item.attrib.get("unit", "s")
49 | value = 0
50 | if self.version != "1.1":
51 | value = float(item.text)
52 | else:
53 | value = int(item.text)
54 | if value <= 0:
55 | raise ValueError("Invalid time limit value")
56 | problem["time_limit"]["value"] = value
57 | elif tag == "memory_limit":
58 | unit = item.attrib.get("unit", "MB")
59 | if unit not in ["MB", "KB", "mb", "kb"]:
60 | raise ValueError("Invalid memory limit unit")
61 | problem["memory_limit"]["unit"] = unit.upper()
62 | value = int(item.text)
63 | if value <= 0:
64 | raise ValueError("Invalid memory limit value")
65 | problem["memory_limit"]["value"] = value
66 | elif tag in ["template", "append", "prepend", "solution"]:
67 | lang = item.attrib.get("language")
68 | if not lang:
69 | raise ValueError("Invalid " + tag + ", language name is missed")
70 | problem[tag].append({"language": lang, "code": item.text})
71 | elif tag == 'spj':
72 | lang = item.attrib.get("language")
73 | if not lang:
74 | raise ValueError("Invalid spj, language name if missed")
75 | problem["spj"] = {"language": lang, "code": item.text}
76 | elif tag == "img":
77 | problem["images"].append({"src": None, "blob": None})
78 | for child in item:
79 | if child.tag == "src":
80 | problem["images"][-1]["src"] = child.text
81 | elif child.tag == "base64":
82 | problem["images"][-1]["blob"] = base64.b64decode(child.text)
83 | elif tag == "sample_input":
84 | if not sample_start:
85 | raise ValueError("Invalid xml, error 'sample_input' tag order")
86 | problem["samples"].append({"input": item.text, "output": None})
87 | sample_start = False
88 | elif tag == "sample_output":
89 | if sample_start:
90 | raise ValueError("Invalid xml, error 'sample_output' tag order")
91 | problem["samples"][-1]["output"] = item.text
92 | sample_start = True
93 | elif tag == "test_input":
94 | if not test_case_start:
95 | raise ValueError("Invalid xml, error 'test_input' tag order")
96 | problem["test_cases"].append({"input": item.text, "output": None})
97 | test_case_start = False
98 | elif tag == "test_output":
99 | if test_case_start:
100 | raise ValueError("Invalid xml, error 'test_output' tag order")
101 | problem["test_cases"][-1]["output"] = item.text
102 | test_case_start = True
103 |
104 | return problem
105 |
106 |
107 | class FPSHelper(object):
108 | def save_image(self, problem, base_dir, base_url):
109 | _problem = copy.deepcopy(problem)
110 | for img in _problem["images"]:
111 | name = "".join(random.choice(string.ascii_lowercase + string.digits) for _ in range(12))
112 | ext = os.path.splitext(img["src"])[1]
113 | file_name = name + ext
114 | with open(os.path.join(base_dir, file_name), "wb") as f:
115 | f.write(img["blob"])
116 | for item in ["description", "input", "output"]:
117 | _problem[item] = _problem[item].replace(img["src"], os.path.join(base_url, file_name))
118 | return _problem
119 |
120 | def save_test_case(self, problem, base_dir, input_preprocessor=None, output_preprocessor=None):
121 | for index, item in enumerate(problem["test_cases"]):
122 | with open(os.path.join(base_dir, str(index + 1) + ".in"), "w", encoding="utf-8") as f:
123 | if input_preprocessor:
124 | input_content = input_preprocessor(item["input"])
125 | else:
126 | input_content = item["input"]
127 | f.write(input_content)
128 | with open(os.path.join(base_dir, str(index + 1) + ".out"), "w", encoding="utf-8") as f:
129 | if output_preprocessor:
130 | output_content = output_preprocessor(item["output"])
131 | else:
132 | output_content = item["output"]
133 | f.write(output_content)
134 |
135 |
136 | if __name__ == "__main__":
137 | import pprint
138 | import os
139 |
140 | parser = FPSParser("fps.xml")
141 | helper = FPSHelper()
142 | problems = parser.parse()
143 | for index, problem in enumerate(problems):
144 | path = os.path.join("/tmp/", str(index + 1))
145 | os.makedirs(path)
146 | helper.save_test_case(problem, path)
147 |
148 | pprint.pprint(helper.save_image(problem, "/tmp", "/static/img"))
149 |
--------------------------------------------------------------------------------
/FPSSpliter/COMDLG32.OCX:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/FPSSpliter/COMDLG32.OCX
--------------------------------------------------------------------------------
/FPSSpliter/FPSSpliter-GUI.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/FPSSpliter/FPSSpliter-GUI.exe
--------------------------------------------------------------------------------
/FPSSpliter/FPSSpliter.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | int main(int argc,char * argv[]){
4 |
5 | const char * head1="\n";
6 | const char * head2="";
7 | const char * head3="";
8 | const char * tail="\n \n";
9 | if(argc<2){
10 | printf("Usage: fpssliter [size]\n \t http://github.com/zhblue/freeproblemset\n");
11 | return -1;
12 | }else{
13 | printf("Splitting freeproblemset file: %s\n",argv[1]);
14 | }
15 | FILE * infile=fopen(argv[1],"r");
16 | int num=1;
17 | const int bsize=64000;
18 | int trigger=10;
19 | if (argc==3){
20 | sscanf(argv[2],"%d",&trigger);
21 | }
22 |
23 | int location=0;
24 | char filename[255] ;
25 | char buf [bsize] ;
26 | char * endpoint;
27 | int cp=0;
28 | sprintf(filename,"fps_%d.xml",num);
29 | FILE * outfile=fopen(filename,"w");
30 | while(fgets(buf,bsize,infile)!=NULL){
31 | location+=strlen(buf);
32 | endpoint=strstr(buf,"");
33 | if(location>trigger*1024*1024&&endpoint!=NULL){
34 | printf("trigger %dM\n%s\n",trigger,buf);
35 | cp=0;
36 | while( strncmp("",&buf[cp],7)!=0){
37 | fprintf(outfile,"%c",buf[cp]);
38 | printf("%c",buf[cp]);
39 | cp++;
40 | }
41 | printf("cut at %s \n",&buf[cp]);
42 | location=0;
43 | fprintf(outfile,"%s",tail);
44 | fclose(outfile);
45 | num++;
46 | sprintf(filename,"fps_%d.xml",num);
47 | outfile=fopen(filename,"w");
48 | fprintf(outfile,"%s",head1);
49 | fprintf(outfile,"%s",head2);
50 | fprintf(outfile,"%s",head3);
51 | fprintf(outfile,"%s",&buf[cp+7]);
52 |
53 | }else{
54 | fprintf(outfile,"%s",buf);
55 | }
56 |
57 | }
58 | fclose(outfile);
59 | fclose(infile);
60 | return 0;
61 | }
62 |
--------------------------------------------------------------------------------
/FPSSpliter/Makefile:
--------------------------------------------------------------------------------
1 | target all:
2 | gcc -o fpsspliter FPSSpliter.c
3 |
--------------------------------------------------------------------------------
/FPSSpliter/README.md:
--------------------------------------------------------------------------------
1 | Usage: fpssliter [size]
2 |
3 | 使用方法,将fpsspliter.exe与要拆分的文件放在一起,执行
4 | ```
5 | fpssliter [size]
6 | ```
7 | 例如:
8 | ```
9 | fpssliter fps_sample.xml 10
10 | ```
11 | 将fps_sample.xml拆分为至少10m一个大小的文件。
12 |
--------------------------------------------------------------------------------
/FPSSpliter/fpsspliter.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/FPSSpliter/fpsspliter.exe
--------------------------------------------------------------------------------
/FPSViewer/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/FPSViewer/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | FPSViewer
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/FPSViewer/FPSViewer.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/FPSViewer/FPSViewer.jar
--------------------------------------------------------------------------------
/FPSViewer/src/demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 | Calculate a+b
10 |
]]>
11 | Two integer a,b (0<=a,b<=10)]]>
12 | Output a+b]]>
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | Q: Where are the input and the output? A: Your program shall always read input from stdin (Standard Input) and write output to stdout (Standard Output) . For example, you can use 'scanf' in C or 'cin' in C++ to read from stdin, and use 'printf' in C or 'cout' in C++ to write to stdout. You shall not output any extra data to standard output other than that required by the problem, otherwise you will get a "Wrong Answer". User programs are not allowed to open and read from/write to files. You will get a "Runtime Error" or a "Wrong Answer" if you try to do so. Here is a sample solution for problem 1000 using C++/G++:
22 |
23 | #include <iostream>
24 | using namespace std;
25 | int main()
26 | {
27 | int a,b;
28 | cin >> a >> b;
29 | cout << a+b << endl;
30 | return 0;
31 | }
32 | It's important that the return type of main() must be int when you use G++/GCC,or you may get compile error. Here is a sample solution for problem 1000 using C/GCC:
33 |
34 | #include <stdio.h>
35 |
36 | int main()
37 | {
38 | int a,b;
39 | scanf("%d %d",&a, &b);
40 | printf("%d\n",a+b);
41 | return 0;
42 | }
43 | Here is a sample solution for problem 1000 using PASCAL:
44 |
45 | program p1000(Input,Output);
46 | var
47 | a,b:Integer;
48 | begin
49 | Readln(a,b);
50 | Writeln(a+b);
51 | end.
52 | Here is a sample solution for problem 1000 using JAVA: Now java compiler is jdk 1.5, next is program for 1000
53 |
54 | import java.io.*;
55 | import java.util.*;
56 | public class Main
57 | {
58 | public static void main(String args[]) throws Exception
59 | {
60 | Scanner cin=new Scanner(System.in);
61 | int a=cin.nextInt();int b=cin.nextInt();
62 | System.out.println(a+b);
63 | }
64 | }
65 | Old program for jdk 1.4
66 |
67 | import java.io.*;
68 | import java.util.*;
69 |
70 | public class Main
71 | {
72 | public static void main (String args[]) throws Exception
73 | {
74 | BufferedReader stdin =
75 | new BufferedReader(
76 | new InputStreamReader(System.in));
77 |
78 | String line = stdin.readLine();
79 | StringTokenizer st = new StringTokenizer(line);
80 | int a = Integer.parseInt(st.nextToken());
81 | int b = Integer.parseInt(st.nextToken());
82 | System.out.println(a+b);
83 | }
84 | } ]]>
85 |
86 |
87 | void main()
88 | {
89 | int a,b,sum;
90 | scanf("%d%d",&a,&b);
91 | sum=a+b;
92 | printf("%d",sum);
93 | }
94 | ]]>
95 |
96 |
97 |
--------------------------------------------------------------------------------
/FPSViewer/src/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
75 |
76 | $FPS_TITLE
77 | Time Limit: $FPS_TIME Sec
78 | Memory Limit: $FPS_MEMORY MB
79 |
80 |
81 | Description
82 | $FPS_Description
83 |
84 | Input
85 | $FPS_INPUT
86 |
87 | Output
88 | $FPS_OUTPUT
89 |
90 |
Sample Input
91 |
92 | $FPS_Sample_Input
93 |
Sample Output
94 |
95 | $FPS_Sample_Output
96 |
HINT
97 | $FPS_HINT
98 | Source
99 |
100 | $FPS_Source
101 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 |
9 | This version of the GNU Lesser General Public License incorporates
10 | the terms and conditions of version 3 of the GNU General Public
11 | License, supplemented by the additional permissions listed below.
12 |
13 | 0. Additional Definitions.
14 |
15 | As used herein, "this License" refers to version 3 of the GNU Lesser
16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU
17 | General Public License.
18 |
19 | "The Library" refers to a covered work governed by this License,
20 | other than an Application or a Combined Work as defined below.
21 |
22 | An "Application" is any work that makes use of an interface provided
23 | by the Library, but which is not otherwise based on the Library.
24 | Defining a subclass of a class defined by the Library is deemed a mode
25 | of using an interface provided by the Library.
26 |
27 | A "Combined Work" is a work produced by combining or linking an
28 | Application with the Library. The particular version of the Library
29 | with which the Combined Work was made is also called the "Linked
30 | Version".
31 |
32 | The "Minimal Corresponding Source" for a Combined Work means the
33 | Corresponding Source for the Combined Work, excluding any source code
34 | for portions of the Combined Work that, considered in isolation, are
35 | based on the Application, and not on the Linked Version.
36 |
37 | The "Corresponding Application Code" for a Combined Work means the
38 | object code and/or source code for the Application, including any data
39 | and utility programs needed for reproducing the Combined Work from the
40 | Application, but excluding the System Libraries of the Combined Work.
41 |
42 | 1. Exception to Section 3 of the GNU GPL.
43 |
44 | You may convey a covered work under sections 3 and 4 of this License
45 | without being bound by section 3 of the GNU GPL.
46 |
47 | 2. Conveying Modified Versions.
48 |
49 | If you modify a copy of the Library, and, in your modifications, a
50 | facility refers to a function or data to be supplied by an Application
51 | that uses the facility (other than as an argument passed when the
52 | facility is invoked), then you may convey a copy of the modified
53 | version:
54 |
55 | a) under this License, provided that you make a good faith effort to
56 | ensure that, in the event an Application does not supply the
57 | function or data, the facility still operates, and performs
58 | whatever part of its purpose remains meaningful, or
59 |
60 | b) under the GNU GPL, with none of the additional permissions of
61 | this License applicable to that copy.
62 |
63 | 3. Object Code Incorporating Material from Library Header Files.
64 |
65 | The object code form of an Application may incorporate material from
66 | a header file that is part of the Library. You may convey such object
67 | code under terms of your choice, provided that, if the incorporated
68 | material is not limited to numerical parameters, data structure
69 | layouts and accessors, or small macros, inline functions and templates
70 | (ten or fewer lines in length), you do both of the following:
71 |
72 | a) Give prominent notice with each copy of the object code that the
73 | Library is used in it and that the Library and its use are
74 | covered by this License.
75 |
76 | b) Accompany the object code with a copy of the GNU GPL and this license
77 | document.
78 |
79 | 4. Combined Works.
80 |
81 | You may convey a Combined Work under terms of your choice that,
82 | taken together, effectively do not restrict modification of the
83 | portions of the Library contained in the Combined Work and reverse
84 | engineering for debugging such modifications, if you also do each of
85 | the following:
86 |
87 | a) Give prominent notice with each copy of the Combined Work that
88 | the Library is used in it and that the Library and its use are
89 | covered by this License.
90 |
91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 | document.
93 |
94 | c) For a Combined Work that displays copyright notices during
95 | execution, include the copyright notice for the Library among
96 | these notices, as well as a reference directing the user to the
97 | copies of the GNU GPL and this license document.
98 |
99 | d) Do one of the following:
100 |
101 | 0) Convey the Minimal Corresponding Source under the terms of this
102 | License, and the Corresponding Application Code in a form
103 | suitable for, and under terms that permit, the user to
104 | recombine or relink the Application with a modified version of
105 | the Linked Version to produce a modified Combined Work, in the
106 | manner specified by section 6 of the GNU GPL for conveying
107 | Corresponding Source.
108 |
109 | 1) Use a suitable shared library mechanism for linking with the
110 | Library. A suitable mechanism is one that (a) uses at run time
111 | a copy of the Library already present on the user's computer
112 | system, and (b) will operate properly with a modified version
113 | of the Library that is interface-compatible with the Linked
114 | Version.
115 |
116 | e) Provide Installation Information, but only if you would otherwise
117 | be required to provide such information under section 6 of the
118 | GNU GPL, and only to the extent that such information is
119 | necessary to install and execute a modified version of the
120 | Combined Work produced by recombining or relinking the
121 | Application with a modified version of the Linked Version. (If
122 | you use option 4d0, the Installation Information must accompany
123 | the Minimal Corresponding Source and Corresponding Application
124 | Code. If you use option 4d1, you must provide the Installation
125 | Information in the manner specified by section 6 of the GNU GPL
126 | for conveying Corresponding Source.)
127 |
128 | 5. Combined Libraries.
129 |
130 | You may place library facilities that are a work based on the
131 | Library side by side in a single library together with other library
132 | facilities that are not Applications and are not covered by this
133 | License, and convey such a combined library under terms of your
134 | choice, if you do both of the following:
135 |
136 | a) Accompany the combined library with a copy of the same work based
137 | on the Library, uncombined with any other library facilities,
138 | conveyed under the terms of this License.
139 |
140 | b) Give prominent notice with the combined library that part of it
141 | is a work based on the Library, and explaining where to find the
142 | accompanying uncombined form of the same work.
143 |
144 | 6. Revised Versions of the GNU Lesser General Public License.
145 |
146 | The Free Software Foundation may publish revised and/or new versions
147 | of the GNU Lesser General Public License from time to time. Such new
148 | versions will be similar in spirit to the present version, but may
149 | differ in detail to address new problems or concerns.
150 |
151 | Each version is given a distinguishing version number. If the
152 | Library as you received it specifies that a certain numbered version
153 | of the GNU Lesser General Public License "or any later version"
154 | applies to it, you have the option of following the terms and
155 | conditions either of that published version or of any later version
156 | published by the Free Software Foundation. If the Library as you
157 | received it does not specify a version number of the GNU Lesser
158 | General Public License, you may choose any version of the GNU Lesser
159 | General Public License ever published by the Free Software Foundation.
160 |
161 | If the Library as you received it specifies that a proxy can decide
162 | whether future versions of the GNU Lesser General Public License shall
163 | apply, that proxy's public statement of acceptance of any version is
164 | permanent authorization for you to choose that version for the
165 | Library.
166 |
--------------------------------------------------------------------------------
/PyFPS/FpsGenTool.py:
--------------------------------------------------------------------------------
1 | from lxml import etree
2 | import os
3 |
4 | class FpsGenTool:
5 | def __init__(self):
6 | #self.tree=etree.parse(os.path.dirname(__file__)+'fps-framework.xml')
7 | self.problem_cnt=0
8 | self.tree=etree.parse('fps-framework.xml')
9 | # item
10 | self.tpl_item=self.tree.getroot().find('item')
11 | self.tree.getroot().remove(self.tpl_item)
12 | # test_input
13 | self.tpl_test_input=self.tpl_item.find('test_input')
14 | self.tpl_item.remove(self.tpl_test_input)
15 | # test_output
16 | self.tpl_test_output=self.tpl_item.find('test_output')
17 | self.tpl_item.remove(self.tpl_test_output)
18 | # solution
19 | self.tpl_solution=self.tpl_item.find('solution')
20 | self.tpl_item.remove(self.tpl_solution)
21 |
22 | self.tpl_item_str=etree.tostring(self.tpl_item)
23 | self.tpl_test_input_str=etree.tostring(self.tpl_test_input)
24 | self.tpl_test_output_str=etree.tostring(self.tpl_test_output)
25 | self.tpl_solution_str=etree.tostring(self.tpl_solution)
26 | def add_problem(self,
27 | title,
28 | time_limit,
29 | memory_limit,
30 | description,
31 | input_=None,
32 | output=None,
33 | sample_input=None,
34 | sample_output=None,
35 | test_input=None,
36 | test_output=None,
37 | hint=None,
38 | source=None,
39 | solution=None,
40 | img=None):
41 | new_item=etree.fromstring(self.tpl_item_str)
42 | new_item.find('title').text=title
43 | new_item.find('time_limit').text=str(time_limit)
44 | new_item.find('memory_limit').text=str(memory_limit)
45 | new_item.find('description').text=description
46 | if input_:
47 | new_item.find('input').text=input_
48 | if output:
49 | new_item.find('output').text=output
50 | if sample_input: # HustOj只支持单sample
51 | new_item.find('sample_input').text=sample_input
52 | if sample_output:
53 | new_item.find('sample_output').text=sample_output
54 | if test_input:
55 | for i in range(len(test_input)):
56 | elem=etree.fromstring(self.tpl_test_input_str)
57 | elem.set('name','test%d'%i)
58 | elem.text=test_input[i]
59 | new_item.append(elem)
60 | if test_output:
61 | for i in range(len(test_output)):
62 | elem=etree.fromstring(self.tpl_test_output_str)
63 | elem.set('name','test%d'%i)
64 | elem.text=test_output[i]
65 | new_item.append(elem)
66 | if hint:
67 | new_item.find('hint').text=hint
68 | if source: # 题目来源
69 | new_item.find('source').text=source
70 | if solution: # 标准程序
71 | elem=etree.fromstring(self.tpl_solution_str)
72 | elem.text=solution
73 | new_item.append(elem)
74 | if img: # 图片内联替换
75 | for img_item in img:
76 | elem=etree.fromstring(''' ''')
77 | elem.find('src').text=img_item[0]
78 | elem.find('base64').text=img_item[1]
79 | new_item.append(elem)
80 | self.tree.getroot().append(new_item)
81 | self.problem_cnt+=1
82 | def count(self):
83 | return self.problem_cnt
84 | def dump(self,filename):
85 | self.tree.write(filename,pretty_print=True)
86 | def __str__(self):
87 | return etree.tostring(self.tree,pretty_print=True).decode('utf-8')
88 |
89 | if __name__ == '__main__':
90 | tool=FpsGenTool()
91 | tool.add_problem('FPS验证导入功能',
92 | '1',
93 | '32',
94 | '这是题目描述
',
95 | '输入2个整数a和b',
96 | '输出a和b的和',
97 | '1 2',
98 | '3',
99 | ['4 5'],
100 | ['9'],
101 | '注意整数是64位的',
102 | '采集自东方博宜',
103 | )
104 | tool.dump('result.xml')
105 | print(tool)
--------------------------------------------------------------------------------
/PyFPS/LuoguListSpider.py:
--------------------------------------------------------------------------------
1 | from FpsGenTool import FpsGenTool
2 | import requests
3 | from bs4 import BeautifulSoup
4 | from LuoguProblemFetcher import LuoguProblemFetcher
5 | import json
6 | import time
7 |
8 | # problem下载器
9 | fetcher=LuoguProblemFetcher()
10 | tool=FpsGenTool()
11 |
12 | # 生成题单JSON
13 | problemset=[]
14 |
15 | # index翻页
16 | for page in range(39,40): # 1,162
17 | url='https://www.luogu.com.cn/problem/list?page=%d'%page
18 | index_html=requests.get(url,headers={'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36'}).text
19 | soup=BeautifulSoup(index_html,features='lxml')
20 | problem_table=soup.find('div',id='app')
21 | for problem_li in problem_table.find('ul',recursive=True).find_all('li'):
22 | problem_id=problem_li.find('a').get('href')
23 | while True: # 洛谷有限速,失败了重试就好
24 | try:
25 | problem=fetcher.fetch(problem_id)
26 | print(page,problem_id)
27 | except:
28 | print('失败', problem_id)
29 | tool.dump('luogu.xml')
30 | time.sleep(15)
31 | else:
32 | break
33 | hint_href="原题链接 "%problem['url']
34 | tool.add_problem(problem['title'],
35 | problem['time_limit'],
36 | problem['memory_limit'],
37 | problem['description'],
38 | input_=problem['input_'],
39 | output=problem['output'],
40 | sample_input=problem['sample_input'],
41 | sample_output=problem['sample_output'],
42 | test_input=problem['test_input'],
43 | test_output=problem['test_output'],
44 | hint=problem['hint']+' '+hint_href if problem['hint'] else hint_href,
45 | source=problem['source'],
46 | img=problem['img'])
47 | problemset.append([problem_id,problem['title']])
48 | time.sleep(1)
49 | tool.dump('luogu.xml')
--------------------------------------------------------------------------------
/PyFPS/LuoguProblemFetcher.py:
--------------------------------------------------------------------------------
1 | from FpsGenTool import FpsGenTool
2 | import requests
3 | from bs4 import BeautifulSoup
4 | import base64
5 | from selenium import webdriver
6 | from selenium.webdriver.common.by import By
7 | import re
8 | import urllib.parse
9 | import json
10 |
11 | # https://www.luogu.com.cn/problem/P1043
12 |
13 | class LuoguProblemFetcher:
14 | def __init__(self):
15 | self.base_headers={'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36'}
16 |
17 | options = webdriver.ChromeOptions()
18 | options.add_argument('--headless')
19 | self.browser = webdriver.Chrome(options=options)
20 |
21 | def _gather_img(self, parent, img_list):
22 | for img in parent.find_all('img', recursive=True):
23 | img_list.append(img.get('src'))
24 |
25 | def fetch(self,id):
26 | problem_url='https://www.luogu.com.cn/problem/%s'%id
27 | self.browser.get(problem_url)
28 | #self.browser.implicitly_wait(3)
29 | # 展开标签
30 | tag_btn=self.browser.find_element(By.CSS_SELECTOR, '.expand-tip')
31 | tag_btn.click()
32 | html=self.browser.page_source
33 |
34 | html=html.replace('class="katex"','class="katex katex-no-js"')
35 |
36 | json_data=re.search('JSON.parse\\(decodeURIComponent\\("(.+)"',html).group(1)
37 | json_data=json.loads(urllib.parse.unquote(json_data))
38 | limits=json_data['currentData']['problem']['limits']
39 |
40 | soup=BeautifulSoup(html,features='lxml')
41 | # 标题
42 | title=soup.find('head').find('title').string[len(id):]
43 | title=title[:title.find('- 洛谷')].strip() + '(洛谷 - %s)' % id
44 |
45 | # 核心区域
46 | pdetail=soup.find(class_='problem-card')
47 |
48 | time_limit=max(limits['time'])//1000
49 | memory_limit=max(limits['memory'])//1024
50 | description=None
51 | input_=None
52 | output=None
53 | sample_input=None
54 | sample_output=None
55 | test_input=[]
56 | test_output=[]
57 | hint=None # 提示
58 | source=[] # 来源
59 | img_list=[]#涉及图片
60 |
61 | # 标签
62 | tags_wrap=soup.find('div',class_='tags-wrap',recursive=True)
63 | if tags_wrap:
64 | for tag_div in soup.find('div',class_='tags-wrap').find_all('a'):
65 | source.append(tag_div.find('span').string)
66 | source=' '.join(source)
67 |
68 | # 扫描problem-card第2个div
69 | key=''
70 | for item in pdetail.find_all('div')[1].contents:
71 | if item.name not in ['h2','div']:
72 | continue
73 | if item.name=='h2':
74 | key=item.string.strip()
75 | elif item.name=='div':
76 | if key=='题目描述':
77 | description=str(item)
78 | self._gather_img(item,img_list)
79 | #description='[md]'+json_data['currentData']['problem']['description']+'[/md]'
80 | elif key=='输入格式':
81 | input_=str(item)
82 | self._gather_img(item,img_list)
83 | #input_='[md]'+json_data['currentData']['problem']['inputFormat']+'[/md]'
84 | elif key=='输出格式':
85 | output=str(item)
86 | self._gather_img(item,img_list)
87 | #output='[md]'+json_data['currentData']['problem']['outputFormat']+'[/md]'
88 | elif key=='说明/提示':
89 | hint=str(item)
90 | self._gather_img(item,img_list)
91 | #hint='[md]'+json_data['currentData']['problem']['hint']+'[/md]'
92 | elif key=='输入输出样例':
93 | sample_input=item.find(class_='input').find('pre').string
94 | sample_output=item.find(class_='output').find('pre').string
95 | test_input.append(sample_input)
96 | test_output.append(sample_output)
97 | self._gather_img(item,img_list)
98 | key=''
99 |
100 | # 图片内联
101 | for i in range(len(img_list)):
102 | url=img_list[i]
103 | if not url.startswith('http'):
104 | url='https://cdn.luogu.com.cn/%s'%img_list[i]
105 | img_content=requests.get(url).content
106 | img_b64=base64.b64encode(img_content).decode('utf-8')
107 | img_list[i]=(img_list[i],img_b64)
108 |
109 | return {
110 | 'id': id,
111 | 'title': title,
112 | 'time_limit':time_limit,
113 | 'memory_limit':memory_limit,
114 | 'description': description,
115 | 'input_': input_,
116 | 'output': output,
117 | 'sample_input': sample_input,
118 | 'sample_output': sample_output,
119 | 'test_input': test_input,
120 | 'test_output': test_output,
121 | 'source': source,
122 | 'hint': hint,
123 | 'url': problem_url,
124 | 'img':img_list,
125 | }
126 | if __name__=='__main__':
127 | fetcher=LuoguProblemFetcher()
128 | problem=fetcher.fetch('P1371')
129 | #print(problem)
130 | hint_href="原题链接 "%problem['url']
131 |
132 | tool=FpsGenTool()
133 | tool.add_problem(problem['title'],
134 | problem['time_limit'],
135 | problem['memory_limit'],
136 | problem['description'],
137 | input_=problem['input_'],
138 | output=problem['output'],
139 | sample_input=problem['sample_input'],
140 | sample_output=problem['sample_output'],
141 | test_input=problem['test_input'],
142 | test_output=problem['test_output'],
143 | hint=problem['hint']+' '+hint_href if problem['hint'] else hint_href,
144 | source=problem['source'],
145 | img=problem['img'])
146 | tool.dump('luogu.xml')
147 | print(tool)
--------------------------------------------------------------------------------
/PyFPS/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # freeproblemset
2 |
3 | a.k.a fps 是一种开放式([LGPL](lgpl-3.0.txt))ACM/ICPC/NOIP题目存储、转换标准,目前有
4 |
5 | [HUSTOJ](https://github.com/zhblue/hustoj)
6 |
7 | [Hydro](https://hydro.js.org/)
8 |
9 | [OpenJudger](https://github.com/Azure99/OpenJudger)
10 |
11 | [QDUOJ](https://github.com/QingdaoU/OnlineJudge)
12 |
13 | 等系统兼容这种格式的导入导出。
14 |
15 | 快速理解:看这个[例子](https://github.com/zhblue/freeproblemset/blob/master/fps-zhblue-A%2BB.xml)
16 |
17 | 开源授权:
18 | 如果您的软件准确的兼容本格式的导入导出,不会对软件的开源与否、开源协议的选择构成任何要求。
19 | 如果您要在本格式的基础上进行修改、增减要求,衍生出新的格式,则要求新的格式必须采用与本格式相同的授权方式([LGPL](lgpl-3.0.txt)),并提供至少一种开源([LGPL](lgpl-3.0.txt)/GPL)实现。
20 |
21 | 如果您愿意分享原创题目,请联系我,或直接将导出为fps格式的题目发我,我将上传到fps-examples中供ACMer们下载使用。newsclan(a)gmail.com
22 |
23 | 上传题目前请做好测试,用[hustoj的liveCD](http://cdn.m.hustoj.com:8090/)导入,正常AC的再上传。
24 | fps-examples中已有2500+题,下载时请注意标签,避免重复导入。最好先在HUSTOJ-LiveCD做测试。
25 | 新增Java编写的FPS文件题目查看器,需要安装JRE,Windows中暂不支持中文路径。
26 |
27 | There is many free ACM/ICPC Online Judge System available. But not so much problemset available.
28 |
29 | This project is trying to provide free problemset for managers of ACM/ICPC Online Jugde.
30 |
31 | FPS is definied as:
32 | 1.problem
33 | 2.test data
34 | 3.special judger(optional)
35 | 4.standard AC answer(optional)
36 |
37 | the latest defination can be view and discussed on TransportFileDefinition
38 |
39 | For now it's designed for hustoj (on googlecode),but it should be usable for other OJs.
40 |
41 | 目前有许多开源的ACM/ICPC Online Judge 系统,都各有特色,他们都有自己独特的体系结构。
42 |
43 | 但似乎比较难找的是相应的练习题目,各大学校的OJ都对自己的题目数据严加保密,不轻易与人分享。
44 |
45 | 出题是很辛苦的事情,抄题也是如此,而且抄来的题目数据很难制作,标程就更难寻找,特别裁判更加难上加难。
46 |
47 | 这个项目希望建立一个交流平台,使得学校之间交流题目更加容易。
48 |
49 | 所以这个项目的目标是,建立一种通用题目交换格式,基于XML来实现。
50 |
51 | 其中包含了:
52 | 1、题目
53 | 2、图片(可选)
54 | =1.0 URL
55 | >=1.1 内置
56 | 3、测试数据
57 | 4、裁判(可选)
58 | 5、标程(可选)
59 |
60 | 最新格式可以在[DTD](fps.current.dtd)中看到,欢迎讨论和建议。
61 |
62 | 因为个人的原因,以 [HUSTOJ](https://github.com/zhblue/hustoj) 为原型系统,建立导入/导出功能,因此本项目的主要工作是制定数据格式,相应的代码工作在HUSTOJ中完成。
63 |
64 | 如果您的OJ系统不是HUSTOJ,也没关系,只要您有修改源码的权限,增加基于XML的导入导出功能是理论上一定可以实现的。
65 |
66 | 一旦您的系统有了导入功能,您就可以从本站下载题目数据;一旦您有导出功能,您就可以导出题目与兄弟院校进行交流,如果您愿意,当然更希望您能参与本项目,将导出的数据共享出来,这样我们就可以共同创建世界上第一个开源OJ数据中心。
67 |
68 | 推荐使用[EasyFPSViewer](https://github.com/zhblue/freeproblemset/tree/master/EasyFPSViewer)查看编辑fps/xml文件。
69 |
70 | 目前HUSTOJ已经可以进行题目和测试数据的导出。
71 |
72 | 需要题目资源,请访问[TK题库](http://tk.hustoj.com/) 有上千道免费题目可以下载。
73 |
74 | 之前在GoogleCode共享的题库可通过,[谷歌历史镜像](https://code.google.com/archive/p/freeproblemset/downloads)下载,自备网络通信工具。
75 |
76 | 本项目期待您的加入…… 联系我10982766@企鹅.com
77 |
--------------------------------------------------------------------------------
/Vijos2FPS/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Vijos2FPS/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | vijos2fps
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Vijos2FPS/src/freeproblemset/vijos/Vijos2FPS.java:
--------------------------------------------------------------------------------
1 | package freeproblemset.vijos;
2 |
3 | import java.awt.event.ActionEvent;
4 | import java.awt.event.ActionListener;
5 | import java.io.BufferedReader;
6 | import java.io.File;
7 | import java.io.FileInputStream;
8 | import java.io.FileNotFoundException;
9 | import java.io.FileWriter;
10 | import java.io.FilenameFilter;
11 | import java.io.IOException;
12 | import java.io.InputStreamReader;
13 | import java.io.PrintStream;
14 |
15 | import javax.swing.JFileChooser;
16 | import javax.swing.JFrame;
17 | import javax.swing.filechooser.FileFilter;
18 | import javax.swing.filechooser.FileNameExtensionFilter;
19 |
20 | public class Vijos2FPS extends JFrame implements ActionListener {
21 |
22 |
23 | private static final long SplitLimit = 8000000;
24 | private static String APPDIR = System.getProperty("user.dir").replaceAll(
25 | "\\\\", "/");
26 |
27 | public Vijos2FPS() {
28 | super("Vijos2FPS");
29 | String vijosDataPath = openVijosData();
30 | convert(vijosDataPath);
31 | System.exit(0);
32 | }
33 |
34 | private void convert(String vijosDataPath) {
35 | // TODO Auto-generated method stub
36 | File basedir = new File(vijosDataPath);
37 | try {
38 | String fname = vijosDataPath + "/fps.xml";
39 | PrintStream fps = new PrintStream(fname, "UTF-8");
40 | // fps=System.out;
41 | printHeader(fps);
42 | String[] items = basedir.list(new VijosFilenameFilter());
43 | for (int i = 0; i < items.length; i++) {
44 | printProblem(fps, basedir + "/" + items[i]);
45 | File file = new File(fname);
46 | if (file.length() > SplitLimit) {
47 | printTail(fps);
48 | fps.close();
49 | fname = vijosDataPath + "/fps-" + (i+1) + ".xml";
50 | fps = new PrintStream(fname, "UTF-8");
51 | printHeader(fps);
52 | }
53 | }
54 | printTail(fps);
55 | fps.close();
56 | } catch (IOException e) {
57 | // TODO Auto-generated catch block
58 | e.printStackTrace();
59 | }
60 |
61 | }
62 |
63 | private void printTail(PrintStream fps) {
64 | // TODO Auto-generated method stub
65 | fps.println("");
66 | }
67 |
68 | private void printProblem(PrintStream fps, String dir) {
69 | // TODO Auto-generated method stub
70 | fps.println("- ");
71 | printElement(fps, "title", new File(dir).getName(), "");
72 | printElement(fps, "description", dir + "/Description.txt", "", true);
73 | printElement(fps, "input", dir + "/InputFormat.txt", "", true);
74 | printElement(fps, "output", dir + "/OutputFormat.txt", "", true);
75 | printElement(fps, "sample_input", dir + "/SampleInput.txt", "", false);
76 | printElement(fps, "sample_output", dir + "/SampleOutput.txt", "", false);
77 | printElement(fps, "time_limit", dir + "/TimeLimitation.txt", "", true);
78 | printElement(fps, "time_limit", "1", "unit=\"s\"");
79 | printElement(fps, "memory_limit", "128", "unit=\"mb\"");
80 | printElement(fps, "hint", dir + "/Hint.txt", "", true);
81 | printElement(fps, "source", dir + "/Source.txt", "", true);
82 |
83 | printData(fps, dir, "Input");
84 | printData(fps, dir, "Output");
85 | fps.println("
");
86 |
87 | }
88 |
89 | private void printData(PrintStream fps, String dir, String type) {
90 | File basedir = new File(dir + "/" + type);
91 | String[] items = basedir.list(new ExtensionFilter("txt"));
92 | for (int i = 0; items!=null&&i < items.length; i++) {
93 | printElement(fps, "test_" + type.toLowerCase(), basedir + "/"
94 | + items[i], "", false);
95 | }
96 | }
97 |
98 | private void printElement(PrintStream fps, String tagName, String content,
99 | String props) {
100 | // TODO Auto-generated method stub
101 | fps.printf("<%s %s>%s>\n", content.replaceAll("]]>", "]]]>"), tagName);
103 | }
104 |
105 | private void printElement(PrintStream fps, String tagName, String file,
106 | String props, boolean pre) {
107 | printElement(fps, tagName, pre ? htmlEncode(readFile(file))
108 | : readFile(file), props);
109 |
110 | }
111 |
112 | public String htmlEncode(String s) {
113 | StringBuffer stringbuffer = new StringBuffer();
114 | int j = s.length();
115 | for (int i = 0; i < j; i++) {
116 | char c = s.charAt(i);
117 | switch (c) {
118 | case 60:
119 | stringbuffer.append("< ");
120 | break;
121 | case 62:
122 | stringbuffer.append("> ");
123 | break;
124 | case 38:
125 | stringbuffer.append("& ");
126 | break;
127 | case 34:
128 | stringbuffer.append("" ");
129 | break;
130 | case 169:
131 | stringbuffer.append("© ");
132 | break;
133 | case 174:
134 | stringbuffer.append("® ");
135 | break;
136 | case 165:
137 | stringbuffer.append("¥ ");
138 | break;
139 | case 8364:
140 | stringbuffer.append("€ ");
141 | break;
142 | case 8482:
143 | stringbuffer.append(" ");
144 | break;
145 | case 13:
146 | if (i < j - 1 && s.charAt(i + 1) == 10) {
147 | stringbuffer.append(" ");
148 | i++;
149 | }
150 | break;
151 | case 32:
152 | stringbuffer.append("  ");
153 | break;
154 |
155 | default:
156 | stringbuffer.append(c);
157 | break;
158 | }
159 | }
160 | return new String(stringbuffer.toString());
161 | }
162 |
163 | private String readFile(String file) {
164 | // TODO Auto-generated method stub
165 | StringBuffer sb = new StringBuffer();
166 | try {
167 | BufferedReader br = new BufferedReader(new InputStreamReader(
168 | new FileInputStream(file), "GBK"));
169 | while (br.ready())
170 | sb.append(br.readLine() + "\n");
171 | br.close();
172 |
173 | } catch (FileNotFoundException e) {
174 | // TODO Auto-generated catch block
175 | // e.printStackTrace();
176 | } catch (IOException e) {
177 | // TODO Auto-generated catch block
178 | // e.printStackTrace();
179 | }
180 |
181 | return sb.toString();
182 | }
183 |
184 | private void printHeader(PrintStream fps) {
185 | // TODO Auto-generated method stub
186 | fps.print("\n \n");
187 | }
188 |
189 | /**
190 | * @param args
191 | */
192 | public static void main(String[] args) {
193 | // TODO Auto-generated method stub
194 | new Vijos2FPS();
195 | }
196 |
197 | @Override
198 | public void actionPerformed(ActionEvent arg0) {
199 | // TODO Auto-generated method stub
200 |
201 | }
202 |
203 | public String openVijosData() {
204 | String filename = null;
205 | JFileChooser c = new JFileChooser(APPDIR);
206 | c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
207 | // Demonstrate "Open" dialog:
208 | int rVal = c.showOpenDialog(this);
209 | if (rVal == JFileChooser.APPROVE_OPTION) {
210 | try {
211 | filename = (c.getSelectedFile().getCanonicalPath());
212 | } catch (IOException e) {
213 | // TODO Auto-generated catch block
214 | System.exit(0);
215 | }
216 |
217 | }
218 | if (rVal == JFileChooser.CANCEL_OPTION) {
219 | System.exit(0);
220 | }
221 | return filename;
222 | }
223 | }
224 |
225 | class VijosFilenameFilter implements FilenameFilter {
226 |
227 | @Override
228 | public boolean accept(File arg0, String arg1) {
229 | // TODO Auto-generated method stub
230 | return (arg1.startsWith("P"));
231 |
232 | }
233 |
234 | }
235 | class ExtensionFilter implements FilenameFilter {
236 | private String ext;
237 | public ExtensionFilter(String ext){
238 | this.ext=ext;
239 |
240 | }
241 | @Override
242 | public boolean accept(File arg0, String arg1) {
243 | // TODO Auto-generated method stub
244 | return (arg1.toLowerCase().endsWith(ext));
245 | }
246 |
247 | }
248 |
--------------------------------------------------------------------------------
/fps-examples/README.md:
--------------------------------------------------------------------------------
1 | 部分题面导入后题面是markdown的,需要增加[md] [/md] 或者
2 | ```
3 |
4 | .....
5 |
6 | ```
7 |
8 | 如果有新搭建的OJ,想测试性能,可以导入这个文件:PerformanceTest.xml
9 |
10 | 最后全部判完,这个AWT越小,说明判题速度越快
11 |
12 | 
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | fps-my-1000-1128.xml 用于演示service.php的使用。
21 | 先复制include/remote_service.php 为 include/remote_my.php
22 | 修改其中末尾的
23 | ```
24 | $remote_oj="my"; // problem表的remote_oj字段设my,本文件复制一份改名成remote_my.php,并在../remote.php中增加扫描项。
25 | $remote_site="http://my.hustoj.com/service.php"; // 需要远程服务器运行开启service_port的最新版本HUSTOJ
26 | $remote_user='service'; // 远程系统具有 service_port 的可用状态(正常登录、未到期,有权限)账号
27 | $remote_pass='123456'; //账号、密码 注意保存,更新时可能覆盖此文件
28 | ```
29 | 修改remote.php
30 | 增加项
31 | ```
32 | $remote_ojs=array(
33 | "my" // "pku","hdu" //使用一本通启蒙设为:"bas"
34 | );
35 | ```
36 | 和
37 | ```
38 | "my" => "http://my.hustoj.com/",
39 | ```
40 | 最后启用db_info.inc.php中的
41 | `$OJ_REMOTE_JUDGE=true;`
42 |
43 | 并导入本文件。
44 |
--------------------------------------------------------------------------------
/fps-examples/fps-loj-small-pics.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/fps-examples/fps-loj-small-pics.zip
--------------------------------------------------------------------------------
/fps-examples/fps-www.educg.net-codeforce-1-2833.xml.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/fps-examples/fps-www.educg.net-codeforce-1-2833.xml.zip
--------------------------------------------------------------------------------
/fps-examples/fps-zhblue-CSP-J_S 2024 第二轮认证 入门级(仅含样例数据).zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/fps-examples/fps-zhblue-CSP-J_S 2024 第二轮认证 入门级(仅含样例数据).zip
--------------------------------------------------------------------------------
/fps-examples/fps-zhblue-CSP-J_S 2024 第二轮认证 提高级.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhblue/freeproblemset/963372738409da3e78644c1d23b3a077da89b62e/fps-examples/fps-zhblue-CSP-J_S 2024 第二轮认证 提高级.zip
--------------------------------------------------------------------------------
/fps-examples/fps-刘谦2025.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 | -
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | ### 题目名称:魔术师的交换谜题
19 |
20 | #### 题目背景
21 |
22 | 刘谦在2025年春晚表演的魔术《画蛇添福》通过一系列精心设计的交换步骤,使得杯子必然出现在最右侧。现在,你需要编写程序模拟这一过程,验证其数学规律。
23 |
24 | ------
25 |
26 | #### 问题描述
27 |
28 | 给定三个物品(`C`-杯子、`S`-勺子、`K`-筷子)的初始排列,按照以下步骤操作:
29 |
30 | - 1.将筷子和它左边相邻的东西互相交换位置,如果筷子已经在最左边,就不需要操作
31 |
32 | - 2.将杯子和它右边相邻的东西互相交换位置,如果杯子已经在最右边,就不需要操作
33 |
34 | - 3.将勺子和它左边相邻的东西互相交换位置,如果勺子已经在最左边,就不需要操作
35 |
36 | 最终输出操作后的排列
37 |
38 | **输入格式**
39 | 一个长度为 3 的字符串,包含且仅包含 'C'、'S'、'K'。
40 |
41 | **输出格式**
42 | 应用步骤后的最终排列字符串。
43 |
44 | **输入样例**
45 | CSK
46 |
47 | **输出样例**
48 | KSC
49 | ]]>
50 |
51 |
52 |
53 |
54 |
55 |
57 |
58 |
60 |
61 |
63 |
64 |
66 |
67 |
69 |
70 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | #include
79 | using namespace std;
80 |
81 | int main() {
82 | string s;
83 | cin >> s;
84 |
85 | // 步骤1:筷子(K)左移
86 | int kPos = s.find('K');
87 | if (kPos > 0) {
88 | // 交换 s[kPos] 和 s[kPos-1]
89 | char temp = s[kPos];
90 | s[kPos] = s[kPos - 1];
91 | s[kPos - 1] = temp;
92 | }
93 |
94 | // 步骤2:杯子(C)右移
95 | int cPos = s.find('C');
96 | if (cPos < 2) {
97 | // 交换 s[cPos] 和 s[cPos+1]
98 | char temp = s[cPos];
99 | s[cPos] = s[cPos + 1];
100 | s[cPos + 1] = temp;
101 | }
102 |
103 | // 步骤3:勺子(S)左移
104 | int sPos = s.find('S');
105 | if (sPos > 0) {
106 | // 交换 s[sPos] 和 s[sPos-1]
107 | char temp = s[sPos];
108 | s[sPos] = s[sPos - 1];
109 | s[sPos - 1] = temp;
110 | }
111 |
112 | cout << s << endl;
113 | return 0;
114 | }]]>
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/fps.current.dtd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------