This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
/* | |
http://uva.onlinejudge.org/index.php?option=onlinejudge&Itemid=99999999&page=show_problem&category=&problem=1350&mosmsg=Submission+received+with+ID+14394659 | |
*/ | |
/* | |
Debugging experience... | |
If the answer appears to be right all the time, check the ENTIRE algorithm again. Two hours were spent on debugging a trivial typo bug in the code... | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() | |
{ | |
int n,north,west,east,south,top,bottom,tempbottom,temptop; | |
char side[10]; | |
while(scanf("%d",&n)==1 && n!=0) | |
{ | |
top=1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
READ THE QUESTIONS CAREFULLY! | |
EVERY WORD REGARDING ALGORITHM, INPUT, OUTPUT, ETC. MUST BE CAREFULLY READ AND FOLLOWED. | |
eg. Think of swapping the input; be cautious on the output format!!! | |
What the statements said in the questions count, not my personal judgement! | |
The f****** "output order must be the same as input" statement caught me off guard TWICE! Learn the lesson. | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
READ THE QUESTIONS CAREFULLY! | |
EVERY WORD REGARDING ALGORITHM, INPUT, OUTPUT, ETC. MUST BE CAREFULLY READ AND FOLLOWED. | |
eg. Think of swapping the input; be cautious on the output format!!! | |
What the statements said in the questions count, not my personal judgement! | |
The f****** "output order must be the same as input" statement caught me off guard TWICE! Learn the lesson. | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<string.h> | |
struct Die | |
{ | |
int top, bottom, north, east, south, west; | |
}; | |
struct Die d; | |
int main() | |
{ | |
int n; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define north 2 | |
#define south 3 | |
#define east 0 | |
#define west 1 | |
#define top 4 | |
#define bottom 5 | |
/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int n,i,a,up,down,north,south,east,west,fnorth,fsouth,feast,fwest,fup,fdown; | |
char k[10]; | |
char j[10]="north"; | |
char j1[10]="east"; | |
char j2[10]="south"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int max(const int a, const int b) { | |
return ((a > b) ? a : b); | |
} | |
int min(const int a, const int b) { | |
return ((a < b) ? a : b); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
/* | |
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=&problem=979&mosmsg=Submission+received+with+ID+14429995 | |
*/ | |
int main() | |
{ | |
int total_cases; | |
while(scanf("%d", &total_cases)!= EOF) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
/* | |
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=&problem=979&mosmsg=Submission+received+with+ID+14429995 | |
*/ | |
/* | |
check corner case, such as 2 1 1... | |
*/ | |
int main() |