mirror of
https://github.com/Xevion/contest.git
synced 2025-12-11 12:06:55 -06:00
rename folders
This commit is contained in:
6
uil/october-2013/1/java/.idea/misc.xml
generated
Normal file
6
uil/october-2013/1/java/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
uil/october-2013/1/java/.idea/modules.xml
generated
Normal file
8
uil/october-2013/1/java/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/1.iml" filepath="$PROJECT_DIR$/1.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
311
uil/october-2013/1/java/.idea/workspace.xml
generated
Normal file
311
uil/october-2013/1/java/.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,311 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="23ea4cb8-4435-47e1-9ce5-e2565ff7e5f3" name="Default Changelist" comment="" />
|
||||
<ignored path="$PROJECT_DIR$/out/" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="FUSProjectUsageTrigger">
|
||||
<session id="132001983">
|
||||
<usages-collector id="statistics.lifecycle.project">
|
||||
<counts>
|
||||
<entry key="project.closed" value="3" />
|
||||
<entry key="project.open.time.0" value="2" />
|
||||
<entry key="project.open.time.2" value="1" />
|
||||
<entry key="project.opened" value="3" />
|
||||
</counts>
|
||||
</usages-collector>
|
||||
<usages-collector id="statistics.file.extensions.open">
|
||||
<counts>
|
||||
<entry key="class" value="1" />
|
||||
<entry key="java" value="2" />
|
||||
</counts>
|
||||
</usages-collector>
|
||||
<usages-collector id="statistics.file.types.open">
|
||||
<counts>
|
||||
<entry key="CLASS" value="1" />
|
||||
<entry key="JAVA" value="2" />
|
||||
</counts>
|
||||
</usages-collector>
|
||||
<usages-collector id="statistics.file.extensions.edit">
|
||||
<counts>
|
||||
<entry key="java" value="571" />
|
||||
</counts>
|
||||
</usages-collector>
|
||||
<usages-collector id="statistics.file.types.edit">
|
||||
<counts>
|
||||
<entry key="JAVA" value="571" />
|
||||
</counts>
|
||||
</usages-collector>
|
||||
</session>
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/src/problem1.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="329">
|
||||
<caret line="54" column="26" selection-start-line="54" selection-start-column="26" selection-end-line="54" selection-end-column="26" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="GradleLocalSettings">
|
||||
<option name="projectSyncType">
|
||||
<map>
|
||||
<entry key="A:/Programming/Modding/Minecraft/EnderStorage" value="PREVIEW" />
|
||||
<entry key="A:/Programming/Modding/Minecraft/Fabric/fabric-example-mod" value="PREVIEW" />
|
||||
<entry key="A:/Programming/Modding/Minecraft/HelloWorldMod" value="PREVIEW" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/src/problem1.java" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds" extendedState="6">
|
||||
<option name="x" value="351" />
|
||||
<option name="y" value="-16" />
|
||||
<option name="width" value="974" />
|
||||
<option name="height" value="1057" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator proportions="" version="1">
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="PackagesPane" />
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="1" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="1" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="1" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="1" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="out" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="1" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="1" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="out" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="production" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="1" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="1" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="out" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="production" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="1" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="1" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="1" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1568523089262" />
|
||||
<property name="project.structure.last.edited" value="Modules" />
|
||||
<property name="project.structure.proportion" value="0.0" />
|
||||
<property name="project.structure.side.proportion" value="0.0" />
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="F:\Programming\Java\UIL\October 2013 Set\1\src" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunDashboard">
|
||||
<option name="ruleStates">
|
||||
<list>
|
||||
<RuleState>
|
||||
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
<RuleState>
|
||||
<option name="name" value="StatusDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration name="problem1" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="problem1" />
|
||||
<module name="1" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Application.problem1" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="23ea4cb8-4435-47e1-9ce5-e2565ff7e5f3" name="Default Changelist" comment="" />
|
||||
<created>1568522090590</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1568522090590</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-8" y="-8" width="1936" height="1066" extended-state="6" />
|
||||
<layout>
|
||||
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2553305" />
|
||||
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
||||
<window_info id="Image Layers" order="2" />
|
||||
<window_info id="Designer" order="3" />
|
||||
<window_info id="UI Designer" order="4" />
|
||||
<window_info id="Capture Tool" order="5" />
|
||||
<window_info id="Favorites" order="6" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
<window_info anchor="bottom" id="Find" order="1" />
|
||||
<window_info anchor="bottom" id="Run" order="2" weight="0.32939914" />
|
||||
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
|
||||
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
||||
<window_info anchor="bottom" id="TODO" order="6" />
|
||||
<window_info anchor="bottom" id="Terminal" order="7" />
|
||||
<window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Version Control" order="9" show_stripe_button="false" />
|
||||
<window_info anchor="bottom" id="Messages" order="10" />
|
||||
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
|
||||
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
|
||||
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
||||
<window_info anchor="right" id="Palette" order="3" />
|
||||
<window_info anchor="right" id="Capture Analysis" order="4" />
|
||||
<window_info anchor="right" id="Theme Preview" order="5" />
|
||||
<window_info anchor="right" id="Palette	" order="6" />
|
||||
<window_info anchor="right" id="Maven Projects" order="7" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/problem1.class" />
|
||||
<entry file="file://$PROJECT_DIR$/src/problem1.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="329">
|
||||
<caret line="54" column="26" selection-start-line="54" selection-start-column="26" selection-end-line="54" selection-end-column="26" />
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="masterDetails">
|
||||
<states>
|
||||
<state key="ArtifactsStructureConfigurable.UI">
|
||||
<settings>
|
||||
<artifact-editor />
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="FacetStructureConfigurable.UI">
|
||||
<settings>
|
||||
<last-edited>No facets are configured</last-edited>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="GlobalLibrariesConfigurable.UI">
|
||||
<settings>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="JdkListConfigurable.UI">
|
||||
<settings>
|
||||
<last-edited>1.8</last-edited>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="ModuleStructureConfigurable.UI">
|
||||
<settings>
|
||||
<last-edited>1</last-edited>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
<option value="0.6" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="ProjectJDKs.UI">
|
||||
<settings>
|
||||
<last-edited>11</last-edited>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="ProjectLibrariesConfigurable.UI">
|
||||
<settings>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
</states>
|
||||
</component>
|
||||
</project>
|
||||
11
uil/october-2013/1/java/1.iml
Normal file
11
uil/october-2013/1/java/1.iml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
4
uil/october-2013/1/java/input1.dat
Normal file
4
uil/october-2013/1/java/input1.dat
Normal file
@@ -0,0 +1,4 @@
|
||||
3
|
||||
1 2 3 3
|
||||
10 10 10 10 10 10 10 10 10 10
|
||||
2 3 4 5 5 9 8 7 5 5 3 2 1
|
||||
BIN
uil/october-2013/1/java/out/production/1/problem1.class
Normal file
BIN
uil/october-2013/1/java/out/production/1/problem1.class
Normal file
Binary file not shown.
85
uil/october-2013/1/java/src/problem1.java
Normal file
85
uil/october-2013/1/java/src/problem1.java
Normal file
@@ -0,0 +1,85 @@
|
||||
import static java.lang.System.*;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Collections;
|
||||
import java.util.Scanner;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
public class problem1 {
|
||||
public static void main(String[] args) throws FileNotFoundException {
|
||||
// Main Constants
|
||||
File input = new File("input1.dat");
|
||||
Scanner scan = new Scanner(input);
|
||||
List<String> output = new ArrayList<String>();
|
||||
|
||||
// Process the input data
|
||||
int lineCount = scan.nextInt();
|
||||
scan.nextLine();
|
||||
for(int i = 0; i < lineCount; i++) {
|
||||
output.add(process(scan.nextLine()));
|
||||
}
|
||||
|
||||
// Print out the array of processed inputs
|
||||
output.add(0, "mean median mode");
|
||||
for(String line : output) {
|
||||
out.println(line);
|
||||
}
|
||||
}
|
||||
|
||||
static String process(String input) {
|
||||
// Sub-constants
|
||||
Scanner read = new Scanner(input);
|
||||
int sum = 0;
|
||||
Map<Integer, Integer> mode = new HashMap<Integer, Integer>();
|
||||
List<Integer> median = new ArrayList<Integer>();
|
||||
|
||||
// Read each number in the file in sequence
|
||||
while(read.hasNextInt()) {
|
||||
int newread = read.nextInt();
|
||||
sum += newread;
|
||||
// Add key to dictionary and list
|
||||
median.add(newread);
|
||||
if(mode.containsKey(newread))
|
||||
mode.put(newread, mode.get(newread) + 1);
|
||||
else
|
||||
mode.put(newread, 1);
|
||||
}
|
||||
|
||||
// Find the mean and mode
|
||||
double mean = sum / (double) median.size();
|
||||
double finalMode = getBestKey(mode, median);
|
||||
|
||||
// Find the median
|
||||
Collections.sort(median);
|
||||
double finalMedian;
|
||||
if(median.size() % 2 == 0 && median.size() > 2) {
|
||||
int center = (median.size() / 2) - 1;
|
||||
finalMedian = (median.get(center) + median.get(center + 1)) / 2.0;
|
||||
} else
|
||||
finalMedian = median.get(median.size() / 2);
|
||||
|
||||
return "" + properRound(mean) + " " + properRound(finalMedian) + " " + properRound(finalMode);
|
||||
}
|
||||
|
||||
// Formats the string properly, rounds down to 1 decimal always
|
||||
static String properRound(double input) {
|
||||
return "" + (Math.round(input * 10) / 10.0);
|
||||
}
|
||||
|
||||
// In a dictionary, finds the key with the highest value, for mode
|
||||
// Keys are provided from the list aggregated for the median
|
||||
static int getBestKey(Map<Integer, Integer> map, List<Integer> keys) {
|
||||
int curcount = (Integer) 0;
|
||||
int curkey = (Integer) 0;
|
||||
for(Integer key : keys) {
|
||||
if(map.get(key) > curcount) {
|
||||
curcount = map.get(key);
|
||||
curkey = key;
|
||||
}
|
||||
}
|
||||
return curkey;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user