Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarceloRosendo/4b3d2bda069d313e8f934dd6a9559fca to your computer and use it in GitHub Desktop.
Save MarceloRosendo/4b3d2bda069d313e8f934dd6a9559fca to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/awesomeProject.iml" filepath="$PROJECT_DIR$/.idea/awesomeProject.iml" />
</modules>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/grafos-tp2" vcs="Git" />
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="00032597-7a21-43ed-867c-07410141fd42" name="Default Changelist" comment="" />
<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="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Go Application" />
</list>
</option>
</component>
<component name="GOROOT" path="C:\Users\marce\sdk\go1.13.4" />
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/grafos-tp2" />
</component>
<component name="ProjectId" id="1Tf4EFL1jvDkyA59jDTUyMU2vSx" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="PropertiesComponent">
<property name="DefaultGoTemplateProperty" value="Go Application" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="go.import.settings.migrated" value="true" />
<property name="last_opened_file_path" value="$USER_HOME$" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
<property name="node.js.path.for.package.tslint" value="project" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
</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="go build awesomeProject" type="GoApplicationRunConfiguration" factoryName="Go Application" temporary="true" nameIsGenerated="true">
<module name="awesomeProject" />
<working_directory value="$PROJECT_DIR$/" />
<kind value="PACKAGE" />
<filePath value="$PROJECT_DIR$/main.go" />
<package value="awesomeProject" />
<directory value="$PROJECT_DIR$/" />
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Go Build.go build awesomeProject" />
</list>
</recent_temporary>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State>
<option name="COLUMN_ORDER" />
</State>
</value>
</entry>
</map>
</option>
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/main.go</url>
<line>55</line>
<option name="timeStamp" value="2" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>
package main
import (
"fmt"
)
func readEntry() (int, int, int) {
var N, M , A int
fmt.Scanf("%d %d %d", &N, &M, &A)
if N == M && M == A && A == 0 {
// end of test cases
return 0, 0, 0
}
if N < 2 || N > 50 {
return 0, 0, 0
}
if M < 1 || M > 2450 {
return 0, 0, 0
}
if A < 1 || A > 50 {
return 0, 0, 0
}
return N, M, A
}
func readEntryLine(N int) (int, int, int) {
var O, D, S int
fmt.Scanf("%d %d %d", &O, &D, &S)
if O < 1 || O > N {
return 0, 0, 0
}
if (D < 1 || D > N) && O == D {
return 0, 0, 0
}
if S < 1 || S > 50 {
return 0, 0, 0
}
return O, D, S
}
func max_flow(){
}
func main(){
for{
fmt.Println("enter with 3 numbers N M A")
N, M, A := readEntry()
if N == M && M == A && A == 0{
return
}
if N == M && M == A && A == 0 {
return
}
var O = make([]int, 1)
var D = make([]int, 1)
var S = make([]int, 1)
var i int
for i = 0; i < M; i++ {
A, B, C := readEntryLine(N)
O[i] = append(O, A)
D[i] = append(B)
S[i] = append(C)
}
// max flow
fmt.Println("bfs, mey return a list with path that ")
// here we calculate Ford Fulkerson
fmt.Println("O", O)
fmt.Println("D", D)
fmt.Println("S", S)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment