├── .github └── workflows │ └── c.yml ├── .gitignore ├── Makefile ├── PATAdvanced ├── 1001.c ├── 1002.c ├── 1003.c ├── 1004.c ├── 1005.c ├── 1006.c ├── 1007.c ├── 1008.c ├── 1009.c ├── 1010.c ├── 1011.c ├── 1012.c ├── 1013.c ├── 1014.c ├── 1015.c ├── 1016.c ├── 1017.c ├── 1019.c ├── 1020.c ├── 1021.c ├── 1022.c ├── 1023.c ├── 1024.c ├── 1025.c ├── 1027.c ├── 1028.c ├── 1029.c ├── 1031.c ├── 1032.c ├── 1035.c ├── 1036.c ├── 1037.c ├── 1038.c ├── 1040.c ├── 1041.c ├── 1042.c ├── 1044.c ├── 1045.c ├── 1046.c ├── 1048.c ├── 1049.c ├── 1050.c └── 1051.c ├── PATBasic ├── 1001.c ├── 1002.c ├── 1003.c ├── 1004.c ├── 1005.c ├── 1006.c ├── 1007.c ├── 1008.c ├── 1009.c ├── 1010.c ├── 1011.c ├── 1012.c ├── 1013.c ├── 1014.c ├── 1015.c ├── 1016.c ├── 1017.c ├── 1018.c ├── 1019.c ├── 1020.c ├── 1021.c ├── 1022.c ├── 1023.c ├── 1024.c ├── 1025.c ├── 1026.c ├── 1027.c ├── 1028.c ├── 1029.c ├── 1030.c ├── 1031.c ├── 1032.c ├── 1033.c ├── 1034.c ├── 1035.c ├── 1036.c ├── 1037.c ├── 1038.c ├── 1039.c ├── 1040.c ├── 1041.c ├── 1042.c ├── 1043.c ├── 1044.c ├── 1045.c ├── 1046.c ├── 1047.c ├── 1048.c ├── 1049.c ├── 1050.c ├── 1051.c ├── 1052.c ├── 1053.c ├── 1054.c ├── 1055.c ├── 1056.c ├── 1057.c ├── 1058.c ├── 1059.c ├── 1060.c ├── 1061.c ├── 1062.c ├── 1063.c ├── 1064.c ├── 1065.c ├── 1066.c ├── 1067.c ├── 1068.c ├── 1069.c ├── 1070.c ├── 1071.c ├── 1072.c ├── 1073.c ├── 1074.c ├── 1075.c ├── 1076.c ├── 1077.c ├── 1078.c ├── 1079.c ├── 1080.c ├── 1081.c ├── 1082.c ├── 1083.c ├── 1084.c ├── 1085.c ├── 1086.c ├── 1087.c ├── 1088.c ├── 1089.c ├── 1090.c ├── 1091.c ├── 1092.c ├── 1093.c ├── 1094.c └── 1095.c ├── README.md └── samples ├── a1001-1.in ├── a1001-1.out ├── a1002-1.in ├── a1002-1.out ├── a1003-1.in ├── a1003-1.out ├── a1004-1.in ├── a1004-1.out ├── a1005-1.in ├── a1005-1.out ├── a1006-1.in ├── a1006-1.out ├── a1007-1.in ├── a1007-1.out ├── a1008-1.in ├── a1008-1.out ├── a1009-1.in ├── a1009-1.out ├── a1010-1.in ├── a1010-1.out ├── a1010-2.in ├── a1010-2.out ├── a1011-1.in ├── a1011-1.out ├── a1012-1.in ├── a1012-1.out ├── a1013-1.in ├── a1013-1.out ├── a1014-1.in ├── a1014-1.out ├── a1015-1.in ├── a1015-1.out ├── a1016-1.in ├── a1016-1.out ├── a1017-1.in ├── a1017-1.out ├── a1018-1.in ├── a1018-1.out ├── a1019-1.in ├── a1019-1.out ├── a1019-2.in ├── a1019-2.out ├── a1020-1.in ├── a1020-1.out ├── a1021-1.in ├── a1021-1.out ├── a1021-2.in ├── a1021-2.out ├── a1022-1.in ├── a1022-1.out ├── a1023-1.in ├── a1023-1.out ├── a1024-1.in ├── a1024-1.out ├── a1024-2.in ├── a1024-2.out ├── a1025-1.in ├── a1025-1.out ├── a1026-1.in ├── a1026-1.out ├── a1027-1.in ├── a1027-1.out ├── a1028-1.in ├── a1028-1.out ├── a1028-2.in ├── a1028-2.out ├── a1028-3.in ├── a1028-3.out ├── a1029-1.in ├── a1029-1.out ├── a1030-1.in ├── a1030-1.out ├── a1031-1.in ├── a1031-1.out ├── a1032-1.in ├── a1032-1.out ├── a1032-2.in ├── a1032-2.out ├── a1033-1.in ├── a1033-1.out ├── a1034-1.in ├── a1034-1.out ├── a1034-2.in ├── a1034-2.out ├── a1035-1.in ├── a1035-1.out ├── a1035-2.in ├── a1035-2.out ├── a1035-3.in ├── a1035-3.out ├── a1036-1.in ├── a1036-1.out ├── a1036-2.in ├── a1036-2.out ├── a1037-1.in ├── a1037-1.out ├── a1038-1.in ├── a1038-1.out ├── a1039-1.in ├── a1039-1.out ├── a1040-1.in ├── a1040-1.out ├── a1041-1.in ├── a1041-1.out ├── a1041-2.in ├── a1041-2.out ├── a1042-1.in ├── a1042-1.out ├── a1043-1.in ├── a1043-1.out ├── a1043-2.in ├── a1043-2.out ├── a1043-3.in ├── a1043-3.out ├── a1044-1.in ├── a1044-1.out ├── a1044-2.in ├── a1044-2.out ├── a1045-1.in ├── a1045-1.out ├── a1046-1.in ├── a1046-1.out ├── a1047-1.in ├── a1047-1.out ├── a1048-1.in ├── a1048-1.out ├── a1048-2.in ├── a1048-2.out ├── a1049-1.in ├── a1049-1.out ├── a1050-1.in ├── a1050-1.out ├── a1051-1.in ├── a1051-1.out ├── a1052-1.in ├── a1052-1.out ├── a1053-1.in ├── a1053-1.out ├── a1054-1.in ├── a1054-1.out ├── a1055-1.in ├── a1055-1.out ├── a1056-1.in ├── a1056-1.out ├── a1057-1.in ├── a1057-1.out ├── a1058-1.in ├── a1058-1.out ├── a1059-1.in ├── a1059-1.out ├── a1060-1.in ├── a1060-1.out ├── a1060-2.in ├── a1060-2.out ├── a1061-1.in ├── a1061-1.out ├── a1062-1.in ├── a1062-1.out ├── a1063-1.in ├── a1063-1.out ├── a1064-1.in ├── a1064-1.out ├── a1065-1.in ├── a1065-1.out ├── a1066-1.in ├── a1066-1.out ├── a1067-1.in ├── a1067-1.out ├── a1068-1.in ├── a1068-1.out ├── a1069-1.in ├── a1069-1.out ├── a1069-2.in ├── a1069-2.out ├── a1070-1.in ├── a1070-1.out ├── a1071-1.in ├── a1071-1.out ├── a1072-1.in ├── a1072-1.out ├── a1072-2.in ├── a1072-2.out ├── a1073-1.in ├── a1073-1.out ├── a1073-2.in ├── a1073-2.out ├── a1074-1.in ├── a1074-1.out ├── a1075-1.in ├── a1075-1.out ├── a1076-1.in ├── a1076-1.out ├── a1077-1.in ├── a1077-1.out ├── a1077-2.in ├── a1077-2.out ├── a1078-1.in ├── a1078-1.out ├── a1079-1.in ├── a1079-1.out ├── a1080-1.in ├── a1080-1.out ├── a1081-1.in ├── a1081-1.out ├── a1081-2.in ├── a1081-2.out ├── a1081-3.in ├── a1081-3.out ├── a1082-1.in ├── a1082-1.out ├── a1082-2.in ├── a1082-2.out ├── a1083-1.in ├── a1083-1.out ├── a1083-2.in ├── a1083-2.out ├── a1084-1.in ├── a1084-1.out ├── a1085-1.in ├── a1085-1.out ├── a1086-1.in ├── a1086-1.out ├── a1087-1.in ├── a1087-1.out ├── a1088-1.in ├── a1088-1.out ├── a1088-2.in ├── a1088-2.out ├── a1089-1.in ├── a1089-1.out ├── a1089-2.in ├── a1089-2.out ├── a1090-1.in ├── a1090-1.out ├── a1091-1.in ├── a1091-1.out ├── a1092-1.in ├── a1092-1.out ├── a1092-2.in ├── a1092-2.out ├── a1093-1.in ├── a1093-1.out ├── a1094-1.in ├── a1094-1.out ├── a1095-1.in ├── a1095-1.out ├── a1096-1.in ├── a1096-1.out ├── a1097-1.in ├── a1097-1.out ├── a1098-1.in ├── a1098-1.out ├── a1099-1.in ├── a1099-1.out ├── a1100-1.in ├── a1100-1.out ├── a1101-1.in ├── a1101-1.out ├── a1102-1.in ├── a1102-1.out ├── a1103-1.in ├── a1103-1.out ├── a1103-2.in ├── a1103-2.out ├── a1104-1.in ├── a1104-1.out ├── a1105-1.in ├── a1105-1.out ├── a1106-1.in ├── a1106-1.out ├── a1107-1.in ├── a1107-1.out ├── a1108-1.in ├── a1108-1.out ├── a1108-2.in ├── a1108-2.out ├── a1109-1.in ├── a1109-1.out ├── a1110-1.in ├── a1110-1.out ├── a1110-2.in ├── a1110-2.out ├── a1111-1.in ├── a1111-1.out ├── a1111-2.in ├── a1111-2.out ├── a1112-1.in ├── a1112-1.out ├── a1113-1.in ├── a1113-1.out ├── a1113-2.in ├── a1113-2.out ├── a1114-1.in ├── a1114-1.out ├── a1115-1.in ├── a1115-1.out ├── a1116-1.in ├── a1116-1.out ├── a1117-1.in ├── a1117-1.out ├── a1118-1.in ├── a1118-1.out ├── a1119-1.in ├── a1119-1.out ├── a1119-2.in ├── a1119-2.out ├── a1120-1.in ├── a1120-1.out ├── a1121-1.in ├── a1121-1.out ├── a1122-1.in ├── a1122-1.out ├── a1123-1.in ├── a1123-1.out ├── a1123-2.in ├── a1123-2.out ├── a1124-1.in ├── a1124-1.out ├── a1124-2.in ├── a1124-2.out ├── a1125-1.in ├── a1125-1.out ├── a1126-1.in ├── a1126-1.out ├── a1126-2.in ├── a1126-2.out ├── a1126-3.in ├── a1126-3.out ├── a1127-1.in ├── a1127-1.out ├── a1128-1.in ├── a1128-1.out ├── a1129-1.in ├── a1129-1.out ├── a1130-1.in ├── a1130-1.out ├── a1130-2.in ├── a1130-2.out ├── a1131-1.in ├── a1131-1.out ├── a1132-1.in ├── a1132-1.out ├── a1133-1.in ├── a1133-1.out ├── a1134-1.in ├── a1134-1.out ├── a1135-1.in ├── a1135-1.out ├── a1136-1.in ├── a1136-1.out ├── a1136-2.in ├── a1136-2.out ├── a1137-1.in ├── a1137-1.out ├── a1138-1.in ├── a1138-1.out ├── a1139-1.in ├── a1139-1.out ├── a1140-1.in ├── a1140-1.out ├── a1141-1.in ├── a1141-1.out ├── a1142-1.in ├── a1142-1.out ├── a1143-1.in ├── a1143-1.out ├── a1144-1.in ├── a1144-1.out ├── a1145-1.in ├── a1145-1.out ├── a1146-1.in ├── a1146-1.out ├── a1147-1.in ├── a1147-1.out ├── a1148-1.in ├── a1148-1.out ├── a1148-2.in ├── a1148-2.out ├── a1148-3.in ├── a1148-3.out ├── a1149-1.in ├── a1149-1.out ├── a1150-1.in ├── a1150-1.out ├── a1151-1.in ├── a1151-1.out ├── a1152-1.in ├── a1152-1.out ├── a1152-2.in ├── a1152-2.out ├── a1153-1.in ├── a1153-1.out ├── a1154-1.in ├── a1154-1.out ├── a1155-1.in ├── a1155-1.out ├── a1155-2.in ├── a1155-2.out ├── a1155-3.in ├── a1155-3.out ├── b1001-1.in ├── b1001-1.out ├── b1002-1.in ├── b1002-1.out ├── b1003-1.in ├── b1003-1.out ├── b1004-1.in ├── b1004-1.out ├── b1005-1.in ├── b1005-1.out ├── b1006-1.in ├── b1006-1.out ├── b1006-2.in ├── b1006-2.out ├── b1007-1.in ├── b1007-1.out ├── b1008-1.in ├── b1008-1.out ├── b1009-1.in ├── b1009-1.out ├── b1010-1.in ├── b1010-1.out ├── b1011-1.in ├── b1011-1.out ├── b1012-1.in ├── b1012-1.out ├── b1012-2.in ├── b1012-2.out ├── b1013-1.in ├── b1013-1.out ├── b1014-1.in ├── b1014-1.out ├── b1015-1.in ├── b1015-1.out ├── b1016-1.in ├── b1016-1.out ├── b1016-2.in ├── b1016-2.out ├── b1017-1.in ├── b1017-1.out ├── b1018-1.in ├── b1018-1.out ├── b1019-1.in ├── b1019-1.out ├── b1019-2.in ├── b1019-2.out ├── b1020-1.in ├── b1020-1.out ├── b1021-1.in ├── b1021-1.out ├── b1022-1.in ├── b1022-1.out ├── b1023-1.in ├── b1023-1.out ├── b1024-1.in ├── b1024-1.out ├── b1024-2.in ├── b1024-2.out ├── b1025-1.in ├── b1025-1.out ├── b1026-1.in ├── b1026-1.out ├── b1027-1.in ├── b1027-1.out ├── b1028-1.in ├── b1028-1.out ├── b1029-1.in ├── b1029-1.out ├── b1030-1.in ├── b1030-1.out ├── b1031-1.in ├── b1031-1.out ├── b1031-2.in ├── b1031-2.out ├── b1032-1.in ├── b1032-1.out ├── b1033-1.in ├── b1033-1.out ├── b1034-1.in ├── b1034-1.out ├── b1034-2.in ├── b1034-2.out ├── b1035-1.in ├── b1035-1.out ├── b1035-2.in ├── b1035-2.out ├── b1036-1.in ├── b1036-1.out ├── b1037-1.in ├── b1037-1.out ├── b1037-2.in ├── b1037-2.out ├── b1038-1.in ├── b1038-1.out ├── b1039-1.in ├── b1039-1.out ├── b1039-2.in ├── b1039-2.out ├── b1040-1.in ├── b1040-1.out ├── b1041-1.in ├── b1041-1.out ├── b1042-1.in ├── b1042-1.out ├── b1043-1.in ├── b1043-1.out ├── b1044-1.in ├── b1044-1.out ├── b1045-1.in ├── b1045-1.out ├── b1046-1.in ├── b1046-1.out ├── b1047-1.in ├── b1047-1.out ├── b1048-1.in ├── b1048-1.out ├── b1049-1.in ├── b1049-1.out ├── b1050-1.in ├── b1050-1.out ├── b1051-1.in ├── b1051-1.out ├── b1052-1.in ├── b1052-1.out ├── b1053-1.in ├── b1053-1.out ├── b1054-1.in ├── b1054-1.out ├── b1054-2.in ├── b1054-2.out ├── b1055-1.in ├── b1055-1.out ├── b1056-1.in ├── b1056-1.out ├── b1057-1.in ├── b1057-1.out ├── b1058-1.in ├── b1058-1.out ├── b1059-1.in ├── b1059-1.out ├── b1060-1.in ├── b1060-1.out ├── b1061-1.in ├── b1061-1.out ├── b1062-1.in ├── b1062-1.out ├── b1063-1.in ├── b1063-1.out ├── b1064-1.in ├── b1064-1.out ├── b1065-1.in ├── b1065-1.out ├── b1066-1.in ├── b1066-1.out ├── b1067-1.in ├── b1067-1.out ├── b1067-2.in ├── b1067-2.out ├── b1068-1.in ├── b1068-1.out ├── b1068-2.in ├── b1068-2.out ├── b1068-3.in ├── b1068-3.out ├── b1069-1.in ├── b1069-1.out ├── b1069-2.in ├── b1069-2.out ├── b1070-1.in ├── b1070-1.out ├── b1071-1.in ├── b1071-1.out ├── b1071-2.in ├── b1071-2.out ├── b1072-1.in ├── b1072-1.out ├── b1073-1.in ├── b1073-1.out ├── b1073-2.in ├── b1073-2.out ├── b1074-1.in ├── b1074-1.out ├── b1075-1.in ├── b1075-1.out ├── b1076-1.in ├── b1076-1.out ├── b1077-1.in ├── b1077-1.out ├── b1078-1.in ├── b1078-1.out ├── b1078-2.in ├── b1078-2.out ├── b1079-1.in ├── b1079-1.out ├── b1079-2.in ├── b1079-2.out ├── b1080-1.in ├── b1080-1.out ├── b1081-1.in ├── b1081-1.out ├── b1082-1.in ├── b1082-1.out ├── b1083-1.in ├── b1083-1.out ├── b1084-1.in ├── b1084-1.out ├── b1085-1.in ├── b1085-1.out ├── b1086-1.in ├── b1086-1.out ├── b1087-1.in ├── b1087-1.out ├── b1088-1.in ├── b1088-1.out ├── b1088-2.in ├── b1088-2.out ├── b1089-1.in ├── b1089-1.out ├── b1089-2.in ├── b1089-2.out ├── b1089-3.in ├── b1089-3.out ├── b1090-1.in ├── b1090-1.out ├── b1091-1.in ├── b1091-1.out ├── b1092-1.in ├── b1092-1.out ├── b1093-1.in ├── b1093-1.out ├── b1094-1.in ├── b1094-1.out ├── b1094-2.in ├── b1094-2.out ├── b1095-1.in ├── b1095-1.out ├── t1001-1.in ├── t1001-1.out ├── t1001-2.in ├── t1001-2.out ├── t1002-1.in ├── t1002-1.out ├── t1003-1.in ├── t1003-1.out ├── t1004-1.in ├── t1004-1.out ├── t1004-2.in ├── t1004-2.out ├── t1005-1.in ├── t1005-1.out ├── t1005-2.in ├── t1005-2.out ├── t1006-1.in ├── t1006-1.out ├── t1006-2.in ├── t1006-2.out ├── t1007-1.in ├── t1007-1.out ├── t1008-1.in ├── t1008-1.out ├── t1009-1.in ├── t1009-1.out ├── t1010-1.in ├── t1010-1.out ├── t1011-1.in ├── t1011-1.out ├── t1012-1.in ├── t1012-1.out ├── t1012-2.in ├── t1012-2.out ├── t1013-1.in ├── t1013-1.out ├── t1013-2.in ├── t1013-2.out ├── t1014-1.in ├── t1014-1.out ├── t1015-1.in ├── t1015-1.out ├── t1016-1.in ├── t1016-1.out ├── t1016-2.in ├── t1016-2.out ├── t1016-3.in ├── t1016-3.out ├── t1017-1.in ├── t1017-1.out ├── t1018-1.in ├── t1018-1.out ├── t1019-1.in ├── t1019-1.out ├── t1020-1.in ├── t1020-1.out ├── t1021-1.in ├── t1021-1.out ├── t1022-1.in ├── t1022-1.out ├── t1022-2.in ├── t1022-2.out ├── t1022-3.in ├── t1022-3.out ├── t1023-1.in ├── t1023-1.out ├── t1024-1.in ├── t1024-1.out ├── t1025-1.in ├── t1025-1.out ├── t1026-1.in ├── t1026-1.out ├── t1027-1.in └── t1027-1.out /.github/workflows/c.yml: -------------------------------------------------------------------------------- 1 | name: Sample Test 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Build 16 | run: make 17 | - name: Test 18 | run: make test 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle/ 2 | _site/ 3 | _articles/ 4 | PAT*/* 5 | !PAT*/*.c 6 | -------------------------------------------------------------------------------- /PATAdvanced/1001.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int a, b, pos; 7 | char num[11]; 8 | 9 | scanf("%d%d", &a, &b); 10 | sprintf(num, "%d", a + b); 11 | 12 | for (pos = strlen(num) - 3; pos > 0 && num[pos - 1] != '-'; pos -= 3) { 13 | memmove(num + pos + 1, num + pos, strlen(num) - pos + 1); 14 | num[pos] = ','; 15 | } 16 | 17 | puts(num); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /PATAdvanced/1005.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int sum = 0; 6 | char c, *digits[] = { 7 | "zero", "one", "two", "three", "four", "five", 8 | "six", "seven", "eight", "nine" 9 | }; 10 | 11 | while ((c = getchar()) != EOF && c != '\n') 12 | sum += c - '0'; 13 | 14 | if (sum >= 100) 15 | printf("%s ", digits[sum / 100]); 16 | if (sum >= 10) 17 | printf("%s ", digits[sum % 100 / 10]); 18 | printf("%s", digits[sum % 10]); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /PATAdvanced/1006.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int N, HH, MM, SS; 7 | int firsttime = 86400, lasttime = -1, time; 8 | char firstname[16], lastname[16], name[16]; 9 | 10 | scanf("%d", &N); 11 | for (int i = 0; i < N; i++) { 12 | scanf("%s %d:%d:%d", name, &HH, &MM, &SS); 13 | time = (HH * 60 + MM) * 60 + SS; 14 | if (time < firsttime) { 15 | firsttime = time; 16 | strcpy(firstname, name); 17 | } 18 | 19 | scanf("%d:%d:%d", &HH, &MM, &SS); 20 | time = (HH * 60 + MM) * 60 + SS; 21 | if (time > lasttime) { 22 | lasttime = time; 23 | strcpy(lastname, name); 24 | } 25 | } 26 | 27 | printf("%s %s", firstname, lastname); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /PATAdvanced/1008.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int N, time, cur, pre; 5 | 6 | scanf("%d", &N); 7 | for (pre = 0, time = 0; N--; pre = cur) { 8 | scanf("%d", &cur); 9 | if (cur > pre) 10 | time += (cur - pre) * 6 + 5; 11 | else 12 | time += (pre - cur) * 4 + 5; 13 | } 14 | 15 | printf("%d", time); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /PATAdvanced/1009.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int N, exp, count = 0; 5 | float coef, A[1001] = {0}, B[1001] = {0}, MUL[2001] = {0}; 6 | 7 | scanf("%d", &N); 8 | while (N--) { 9 | scanf("%d %f", &exp, &coef); 10 | A[exp] = coef; 11 | } 12 | scanf("%d", &N); 13 | while (N--) { 14 | scanf("%d %f", &exp, &coef); 15 | B[exp] = coef; 16 | } 17 | 18 | for (int i = 0; i < 1001; i++) 19 | for (int j = 0; j < 1001; j++) 20 | MUL[i + j] += A[i] * B[j]; 21 | 22 | for (int i = 0; i < 2001; i++) 23 | if (MUL[i]) count++; 24 | 25 | printf("%d", count); 26 | for (int i = 2000; i >= 0; i--) 27 | if (MUL[i]) 28 | printf(" %d %.1f", i, MUL[i]); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /PATAdvanced/1011.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char c = '\0'; 6 | float odd, maxodd, maxprofit = 1; 7 | 8 | for (int i = 0; i < 3; i++) { 9 | maxodd = 0; 10 | for (int j = 0; j < 3; j++) { 11 | scanf("%f", &odd); 12 | if (maxodd < odd) { 13 | maxodd = odd; 14 | c = "WTL"[j]; 15 | } 16 | } 17 | printf("%c ", c); 18 | maxprofit *= maxodd; 19 | } 20 | printf("%.2f", (maxprofit * 0.65 - 1) * 2); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /PATAdvanced/1013.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define MAX 1000 4 | 5 | void DFS(int v, int known[], int G[][MAX]) 6 | { 7 | known[v] = 1; 8 | for (int i = 0; i < MAX; i++) 9 | if ((G[v][i] || G[i][v]) && !known[i]) 10 | DFS(i, known, G); 11 | } 12 | 13 | int main() 14 | { 15 | int N, M, K; 16 | scanf("%d %d %d", &N, &M, &K); 17 | 18 | int Graph[MAX][MAX] = {{0}}; 19 | 20 | int city1, city2; 21 | for (int i = 0; i < M; i++) { 22 | scanf("%d %d", &city1, &city2); 23 | Graph[city1][city2] = 1; 24 | } 25 | 26 | for (int i = 0; i < K; i++) { 27 | int known[MAX] = {0}, lostcity, count = 0; 28 | scanf("%d", &lostcity); 29 | 30 | known[lostcity] = 1; 31 | for (int i = 1; i <= N; i++) 32 | if (!known[i]) { 33 | DFS(i, known, Graph); 34 | count++; 35 | } 36 | printf("%d\n", count - 1); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /PATAdvanced/1015.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int iPrime(int N) 4 | { 5 | if (N == 0 || N == 1) 6 | return 0; 7 | for (int i = 2; i * i <= N; i++) 8 | if (N % i == 0) 9 | return 0; 10 | return 1; 11 | } 12 | 13 | int Rev(int N, int D) 14 | { 15 | int Nrev; 16 | for (Nrev = 0; N; N /= D) { 17 | Nrev *= D; 18 | Nrev += N % D; 19 | } 20 | return Nrev; 21 | } 22 | 23 | int main() 24 | { 25 | int N, D; 26 | 27 | while (scanf("%d %d", &N, &D) == 2) 28 | puts(iPrime(N) && iPrime(Rev(N, D)) ? "Yes" : "No"); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /PATAdvanced/1019.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, b, c, isPalindromicNumber = 1, b_base[30] = {0}; 6 | 7 | scanf("%d %d", &N, &b); 8 | 9 | /* Calculate N in b-base */ 10 | for (c = 0; N; N /= b, c++) 11 | b_base[c] = N % b; 12 | 13 | /* Check if it is palindromic number */ 14 | for (int i = 0; i < c / 2; i++) 15 | if (b_base[i] != b_base[c - i - 1]) 16 | isPalindromicNumber = 0; 17 | puts(isPalindromicNumber ? "Yes" : "No"); 18 | 19 | if (c == 0) 20 | printf("0"); 21 | /* Reversely printing is the correct order */ 22 | while (c--) 23 | printf("%d%c", b_base[c], c ? ' ' : '\0'); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /PATAdvanced/1027.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n, DIGITS = 3; 6 | char convert[] = "0123456789ABC"; 7 | printf("#"); 8 | 9 | for (int i = 0; i < DIGITS; i++) { 10 | scanf("%d", &n); 11 | printf("%c%c", convert[n / 13], convert[n % 13]); 12 | } 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /PATAdvanced/1031.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int N, n1, n2, e; 7 | char string[81]; 8 | 9 | scanf("%s", string); 10 | N = strlen(string); 11 | 12 | /* the math is: n1 = n3; n2 >= n1; n2 + 2n1 = N + 2 */ 13 | e = ((N % 3) + 2) % 3; 14 | n1 = (N + 2 - e) / 3; 15 | n2 = n1 + e; 16 | 17 | for (int i = 0; i < n1; i++) { 18 | putchar(string[i]); 19 | for (int j = 0; j < n2 - 2; j++) 20 | if (i < n1 - 1) 21 | putchar(' '); 22 | else 23 | putchar(string[n1 + j]); 24 | putchar(string[N - 1 - i]); 25 | putchar('\n'); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /PATAdvanced/1032.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef struct Node Node; 4 | struct Node { 5 | int checked; 6 | struct Node *next; 7 | }; 8 | 9 | int main() 10 | { 11 | char data; 12 | int start1, start2, address, next, N; 13 | Node list[100000] = {0}, *p; 14 | 15 | scanf("%d %d %d", &start1, &start2, &N); 16 | /* record a linked list */ 17 | for (int i = 0; i < N; i++) { 18 | scanf("%d %c %d", &address, &data, &next); 19 | list[address].next = next == -1 ? NULL : &list[next]; 20 | } 21 | 22 | if (start1 == -1 || start2 == -1) { 23 | printf("-1"); 24 | return 0; 25 | } 26 | /* First traverse the first string */ 27 | for (p = list + start1; p; p = p->next) 28 | p->checked = 1; 29 | /* Then traverse the second looking for checked node */ 30 | for (p = list + start2; p && !p->checked; p = p->next) 31 | ; 32 | 33 | if (p) 34 | printf("%05ld", p - list); 35 | else 36 | printf("-1"); 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /PATAdvanced/1036.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef struct student { 4 | char name[11]; 5 | char gender; 6 | char ID[11]; 7 | } Student; 8 | 9 | int main() 10 | { 11 | int N, grade, gradeF = -1, gradeM = 101; 12 | Student students[101] = {0}, s; 13 | 14 | scanf("%d", &N); 15 | for (int i = 0; i < N; i++) { 16 | scanf("%s %c %s %d", s.name, &s.gender, s.ID, &grade); 17 | students[grade] = s; 18 | if (s.gender == 'F') 19 | gradeF = grade > gradeF ? grade : gradeF; 20 | else 21 | gradeM = grade < gradeM ? grade : gradeM; 22 | } 23 | 24 | if (gradeF != -1) 25 | printf("%s %s\n", students[gradeF].name, students[gradeF].ID); 26 | else 27 | printf("Absent\n"); 28 | 29 | if (gradeM != 101) 30 | printf("%s %s\n", students[gradeM].name, students[gradeM].ID); 31 | else 32 | printf("Absent\n"); 33 | 34 | if (gradeM == 101 || gradeF == -1) 35 | printf("NA"); 36 | else 37 | printf("%d", gradeF - gradeM); 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /PATAdvanced/1037.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int cmp(const void *a, const void *b) { return *(int*)b - *(int*)a; } 5 | 6 | int main() 7 | { 8 | int NC, NP; 9 | long sum = 0, coupon[100000] = {0}, product[100000] = {0}; 10 | 11 | /* read and sort */ 12 | scanf("%d", &NC); 13 | for (int i = 0; i < NC; i++) 14 | scanf("%ld", coupon + i); 15 | qsort(coupon, NC, sizeof(long), cmp); 16 | scanf("%d", &NP); 17 | for (int i = 0; i < NP; i++) 18 | scanf("%ld", product + i); 19 | qsort(product, NP, sizeof(long), cmp); 20 | 21 | for (int i = 0; coupon[i] > 0 && product[i] > 0; i++) 22 | sum += coupon[i] * product[i]; 23 | for (int i = 0; coupon[NC - i - 1] < 0 && product[NP - i - 1] < 0; i++) 24 | sum += coupon[NC - i - 1] * product[NP - i - 1]; 25 | 26 | printf("%ld\n", sum); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /PATAdvanced/1040.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int maxlen = 0, l, L; 7 | char string[1002]; 8 | 9 | fgets(string, 1001, stdin); 10 | 11 | L = strlen(string); 12 | for (int i = 0; i < L; i++) { 13 | /* odd symmetric */ 14 | l = 0; 15 | while (i - l >= 0 && i + l < L && string[i - l] == string[i + l]) 16 | l++; 17 | maxlen = (l * 2 - 1) > maxlen ? (l * 2 - 1) : maxlen; 18 | /* even symmetric */ 19 | l = 0; 20 | while (i - l >= 0 && i + l + 1 < L && string[i - l] == string[i + l + 1]) 21 | l++; 22 | maxlen = (l * 2) > maxlen ? (l * 2) : maxlen; 23 | } 24 | 25 | printf("%d", maxlen); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /PATAdvanced/1041.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, counts[10001] = {0}, bets[100000] = {0}; 6 | 7 | scanf("%d", &N); 8 | for (int i = 0; i < N; i++) { 9 | scanf("%d", bets + i); 10 | counts[bets[i]]++; 11 | } 12 | 13 | for (int i = 0; i < N; i++) 14 | if (counts[bets[i]] == 1) { 15 | printf("%d", bets[i]); 16 | return 0; 17 | } 18 | 19 | printf("None"); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /PATAdvanced/1042.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int count, order[54], deck[54], pos; 6 | char types[] = "SHCDJ"; 7 | 8 | scanf("%d", &count); 9 | for (int i = 0; i < 54; i++) 10 | scanf("%d", order + i); 11 | 12 | for (int i = 0; i < 54; i++) { 13 | pos = i; 14 | for (int j = 0; j < count; j++) 15 | pos = order[pos] - 1; /* the input order[] was 1 based */ 16 | deck[pos] = i; 17 | } 18 | 19 | for (int i = 0; i < 54; i++) { 20 | printf("%c", types[deck[i] / 13]); 21 | printf("%d", deck[i] % 13 + 1); 22 | printf("%c", i == 53 ? '\0' : ' '); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /PATAdvanced/1044.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, M, D[100000] = {0}, pair[100000][2] = {{0}}; 6 | 7 | scanf("%d %d", &N, &M); 8 | for (int n = 0; n < N; n++) 9 | scanf("%d", D + n); 10 | 11 | int i = 0, j = 0, sum = D[0], min = 100000000, count = 0; 12 | while (1) { 13 | if (sum <= min && sum >= M) { 14 | /* reset if found lower solution */ 15 | if (sum < min) { 16 | min = sum; 17 | count = 0; 18 | } 19 | /* record */ 20 | pair[count][0] = i; 21 | pair[count][1] = j; 22 | count ++; 23 | } 24 | /* Find closest solution */ 25 | if (sum <= M && j < N - 1) 26 | sum += D[++j]; 27 | else if (i < N - 1) 28 | sum -= D[i++]; 29 | else 30 | break; 31 | } 32 | 33 | for (int n = 0; n < count; n++) 34 | printf("%d-%d\n", pair[n][0] + 1, pair[n][1] + 1); 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /PATAdvanced/1046.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, M, start, end, d, D[100001] = {0}; 6 | 7 | scanf("%d", &N); 8 | for (int i = 0; i < N; i++) { 9 | scanf("%d", D + i + 1); 10 | /* record the distance between the current and the first exits */ 11 | D[i + 1] += D[i]; 12 | } 13 | 14 | scanf("%d", &M); 15 | for (int i = 0; i < M; i++) { 16 | scanf("%d %d", &start, &end); 17 | d = --start > --end ? D[start] - D[end] : D[end] - D[start]; 18 | /* if the distance is more than half total length, the other direction will be shorter */ 19 | printf("%d\n", d * 2 > D[N] ? D[N] - d : d); 20 | } 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /PATAdvanced/1048.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, M, counts[501] = {0}, coin; 6 | 7 | scanf("%d %d", &N, &M); 8 | for (int i = 0; i < N; i++) { 9 | scanf("%d", &coin); 10 | counts[coin]++; 11 | } 12 | 13 | for (int i = 1; 2 * i - 1 < M; i++) { 14 | if ((i * 2 == M && counts[i] > 1) 15 | || (i * 2 != M && M - i < 501 && counts[i] && counts[M - i])) { 16 | printf("%d %d", i, M - i); 17 | return 0; 18 | } 19 | } 20 | 21 | printf("No Solution"); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /PATAdvanced/1049.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, base10, lo, curr, hi, count = 0; 6 | 7 | scanf("%d", &N); 8 | 9 | /* for every digits, from lower to higher */ 10 | for (base10 = 1; base10 <= N; base10 *= 10) { 11 | lo = N % base10; /* part of the number after current digit */ 12 | hi = N / base10 / 10; /* part of the number before current digit */ 13 | curr = N / base10 - hi * 10; /* current digit */ 14 | /* count numbers that is smaller than N and has '1' in the current digit */ 15 | if (curr == 0) /* count: [0~(hi-1)]1[0~9...9] */ 16 | count += hi * base10; 17 | else if (curr == 1) /* count: [0~(hi-1)]1[0~9...9] or [hi]1[0~lo] */ 18 | count += lo + 1 + hi * base10; 19 | else /* count: [0~hi]1[0~9...9] */ 20 | count += (hi + 1) * base10; 21 | } 22 | 23 | printf("%d\n", count); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /PATAdvanced/1050.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char c, s1[10001]; 6 | int s2[128] = {0}; 7 | 8 | scanf("%[^\n]%c", s1, &c); 9 | while ((c = getchar()) != EOF && c != '\n') 10 | s2[(int)c] = 1; 11 | 12 | for (char *p = s1; *p; p++) 13 | if (!s2[(int)(*p)]) 14 | putchar(*p); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /PATAdvanced/1051.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char c; 6 | int M, N, K, stack[7] = {0}, top, pushed, popped, wanted; 7 | 8 | scanf("%d %d %d", &M, &N, &K); 9 | for (int i = 0; i < K; i++) { 10 | top = -1; 11 | pushed = 0; 12 | popped = 0; 13 | /* push */ 14 | stack[++top] = ++pushed; 15 | scanf("%d", &wanted); 16 | for ( ; ; ) { 17 | if (top != -1 && stack[top] == wanted) { 18 | /* pop */ 19 | stack[top--] = 0; 20 | popped++; 21 | /* read */ 22 | if (popped < N) { 23 | scanf("%d", &wanted); 24 | continue; 25 | } 26 | else 27 | break; 28 | } 29 | /* push */ 30 | if (pushed < N && top < M - 1) 31 | stack[++top] = ++pushed; 32 | else 33 | break; 34 | } 35 | printf("%s\n", popped < N ? "NO" : "YES"); 36 | while ((c = getchar()) != EOF && c != '\n'); 37 | } 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /PATBasic/1001.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int number, steps; 6 | scanf("%d", &number); 7 | 8 | for (steps = 0; number != 1; steps++) 9 | if (number % 2 == 0) 10 | number /= 2; 11 | else 12 | number = (3 * number + 1) / 2; 13 | 14 | printf("%d", steps); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /PATBasic/1002.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int sum = 0; 6 | char c, *pinyins[] = {"ling", "yi", "er", "san", "si", 7 | "wu", "liu", "qi", "ba", "jiu"}; 8 | 9 | while ((c = getchar()) != EOF && c != '\n') 10 | sum += c - '0'; 11 | 12 | if (sum / 100) /* hundreds */ 13 | printf("%s ", pinyins[sum / 100]); 14 | if (sum / 10) /* tens */ 15 | printf("%s ", pinyins[sum / 10 % 10]); 16 | printf("%s", pinyins[sum % 10]); /* units */ 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /PATBasic/1004.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int N; 7 | scanf("%d", &N); 8 | 9 | char maxname[11], minname[11], curname[11], 10 | maxid[11], minid[11], curid[11]; 11 | int maxgrade = -1, mingrade = 101, curgrade; 12 | 13 | for (int i = 0; i < N; i++) { 14 | scanf("%s %s %d", curname, curid, &curgrade); 15 | 16 | if (curgrade > maxgrade) { 17 | strcpy(maxname, curname); 18 | strcpy(maxid, curid); 19 | maxgrade = curgrade; 20 | } 21 | if (curgrade < mingrade) { 22 | strcpy(minname, curname); 23 | strcpy(minid, curid); 24 | mingrade = curgrade; 25 | } 26 | } 27 | 28 | printf("%s %s\n%s %s", maxname, maxid, minname, minid); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /PATBasic/1005.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int K, n, table[101] = {0}; 6 | 7 | scanf("%d", &K); 8 | for (int i = 0; i < K; i++) { 9 | scanf("%d", &n); 10 | table[n] = 1; 11 | } 12 | 13 | /* find numbers needed to test */ 14 | for (int i = 1; i <= 100; i++) 15 | if (table[i]) 16 | for (int j = i; j > 1; ) { 17 | /* calculate for one step */ 18 | if (j % 2) j = (3 * j + 1) / 2; 19 | else j /= 2; 20 | 21 | /* see if the new number is in given numbers */ 22 | if (j <= 100 && table[j]) { 23 | table[j] = 0; /* 'covered' this number */ 24 | K--; /* one less number not 'covered' */ 25 | if (j < i) break; /* did this before, no need going on */ 26 | } 27 | } 28 | 29 | for (int i = 100; i >= 1; i--) 30 | if (table[i] == 1) 31 | printf("%d%c", i, --K ? ' ' : '\0'); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /PATBasic/1006.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int n; 6 | scanf("%d", &n); 7 | 8 | for (int i = 0; i < n / 100; i++) 9 | putchar('B'); 10 | for (int i = 0; i < n / 10 % 10; i++) 11 | putchar('S'); 12 | for (int i = 0; i < n % 10; i++) 13 | putchar('1' + i); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /PATBasic/1008.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, M, numbers[100]; 6 | 7 | scanf("%d %d", &N, &M); 8 | M %= N; /* M could be larger than N */ 9 | 10 | /* Read */ 11 | for (int i = 0; i < N; i++) 12 | scanf("%d", &numbers[i]); 13 | 14 | /* Print */ 15 | for (int i = N - M; i < N; i++) /* Print N - M to N - 1 */ 16 | printf("%d ", numbers[i]); 17 | for (int i = 0; i < N - M - 1; i++) /* Print 0 to N - M - 2 */ 18 | printf("%d ", numbers[i]); 19 | printf("%d", numbers[N - M - 1]); /* Print N - M - 1, no blankspace */ 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /PATBasic/1009.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char s[82], *p; 7 | 8 | scanf("%[^\n]", s); 9 | 10 | for (p = s + strlen(s) - 1; p >= s; p--) { 11 | if (*(p - 1) == ' ') 12 | printf("%s ", p); 13 | if (p == s) 14 | printf("%s", p); 15 | if (*p == ' ') 16 | *p = '\0'; 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /PATBasic/1010.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int coef, index, count = 0; 6 | 7 | while (scanf("%d %d", &coef, &index) != EOF) { 8 | if (index) { /* Constant terms result in zero */ 9 | if (count++) putchar(' '); 10 | printf("%d %d", coef * index, index - 1); 11 | } 12 | } 13 | 14 | /* Zero polynomial or constant */ 15 | if (count == 0) 16 | puts("0 0"); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /PATBasic/1011.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int T; 6 | long int A, B, C; 7 | scanf("%d", &T); 8 | 9 | for (int i = 0; i < T; i++) { 10 | scanf("%ld %ld %ld", &A, &B, &C); 11 | printf("Case #%d: %s\n", i + 1, A + B > C ? "true" : "false"); 12 | } 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /PATBasic/1013.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | 6 | int M, N; 7 | int primes[10000]; 8 | 9 | scanf("%d %d", &M, &N); 10 | for (int n = 2, count = 0; count < N; n++) { 11 | /* Check if n is prime number */ 12 | int iprime = 1; 13 | for (int j = 0; count > 0 && primes[j] * primes[j] <= n; j++) 14 | if (n % primes[j] == 0) 15 | iprime = 0; 16 | 17 | /* Record */ 18 | if (iprime) 19 | primes[count++] = n; 20 | } 21 | 22 | /* Print */ 23 | for (int i = M; i < N; i++) { 24 | printf("%d", primes[i - 1]); 25 | printf((i - M + 1) % 10 ? " " : "\n"); 26 | } 27 | printf("%d", primes[N - 1]); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /PATBasic/1016.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long Dpart(long A, int D_A) 4 | { 5 | long P_A; 6 | for (P_A = 0; A; A /= 10) 7 | if (A % 10 == D_A) 8 | P_A = P_A * 10 + D_A; 9 | return P_A; 10 | } 11 | 12 | int main() 13 | { 14 | long A, B; 15 | int D_A, D_B; 16 | scanf("%ld %d %ld %d", &A, &D_A, &B, &D_B); 17 | printf("%ld", Dpart(A, D_A) + Dpart(B, D_B)); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /PATBasic/1017.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* read 2 digits from highest digit of A, do manual division, get the quotient 4 | and remainder. Read one more digit, combine this with the last remainder to 5 | get a new 2-digits number. Do this until read to the end of A */ 6 | 7 | int main() 8 | { 9 | int B; 10 | char A[1001], *p = A; 11 | scanf("%s %d", A, &B); 12 | 13 | /* the results are stored in A and B instead of printed out on-the-fly */ 14 | int twodigit, remainder = 0; 15 | for (int i = 0; A[i]; i ++) { 16 | twodigit = remainder * 10 + (A[i] - '0'); 17 | A[i] = twodigit / B + '0'; 18 | remainder = twodigit % B; 19 | } 20 | B = remainder; 21 | 22 | /* print */ 23 | if (A[0] == '0' && A[1] != '\0') p++; 24 | printf("%s %d", p, B); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /PATBasic/1019.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int cmp(const void *a, const void *b) 5 | { 6 | return *(int*)b - *(int*)a; 7 | } 8 | 9 | int sort(int n) 10 | { 11 | int digits[4] = {n/1000, n%1000/100, n%100/10, n%10}; 12 | qsort(digits, 4, sizeof(int), cmp); 13 | return digits[0] * 1000 + digits[1] * 100 + digits[2] * 10 + digits[3]; 14 | } 15 | 16 | int reverse(int n) 17 | { 18 | return n/1000 + n%1000/100 * 10 + n%100/10 * 100 + n%10 * 1000; 19 | } 20 | 21 | int main() 22 | { 23 | int N; 24 | 25 | scanf("%d", &N); 26 | do { 27 | N = sort(N); 28 | printf("%04d - %04d = %04d\n", N, reverse(N), N - reverse(N)); 29 | N = N - reverse(N); 30 | } while (N != 0 && N != 6174); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /PATBasic/1020.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, max; 6 | float D, Storage[1000], Total = 0, Price[1000]; 7 | 8 | scanf("%d %f", &N, &D); 9 | for (int i = 0; i < N; i++) scanf("%f", Storage + i); 10 | for (int i = 0; i < N; i++) scanf("%f", Price + i); 11 | 12 | while (D > 0) { 13 | max = 0; 14 | for (int i = 0; i < N; i++) 15 | if (Price[i] / Storage[i] > Price[max] / Storage[max]) 16 | max = i; 17 | 18 | if (Storage[max] < D) { 19 | Total += Price[max]; 20 | D -= Storage[max]; 21 | Price[max] = 0; 22 | } else { 23 | Total += Price[max] * D / Storage[max]; 24 | D = 0; 25 | } 26 | } 27 | printf("%.2f", Total); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /PATBasic/1021.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char c; 6 | int count[10] = {0}; 7 | while ((c = getchar()) != '\n' && c != EOF) 8 | count[c - '0']++; 9 | 10 | for (int i = 0; i < 10; i++) if (count[i]) 11 | printf("%d:%d\n", i, count[i]); 12 | 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /PATBasic/1022.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int A, B, D, Sum; 6 | scanf("%d %d %d", &A, &B, &D); 7 | Sum = A + B; 8 | 9 | /* calculate the bits of Sum */ 10 | int power = 1; 11 | /* use Sum / D >= power to avoid using long int */ 12 | while (Sum / D >= power) 13 | power *= D; 14 | 15 | /* calculate D-base number. print them on-the-fly */ 16 | for (; power > 0; Sum %= power, power /= D) 17 | printf("%d", Sum / power); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /PATBasic/1023.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int zero, nonzero; 6 | 7 | scanf("%d", &zero); 8 | for (int i = 1; i < 10; i++) { 9 | scanf("%d", &nonzero); 10 | while (nonzero--) { 11 | putchar('0' + i); 12 | /* after the first non-zero, print all the zeros */ 13 | for (; zero; zero--) 14 | putchar('0'); 15 | } 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /PATBasic/1024.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int exponent; /* the exponent part */ 6 | char line[10000], *p = line; 7 | scanf("%[^E]E%d", line, &exponent); 8 | 9 | if (*p++ == '-') putchar('-'); /* no print if it's '+' */ 10 | if (exponent >= 0) { /* print '.' later or add zeros in the end */ 11 | putchar(*p); 12 | for (p += 2; exponent; exponent--) /* print the integer part */ 13 | putchar(*p ? *p++ : '0'); 14 | if (*p) { /* there is still fraction part */ 15 | putchar('.'); 16 | while (*p) putchar(*p++); 17 | } 18 | } 19 | if (exponent < 0) { /* add exponent zeros in the beginning */ 20 | printf("0."); 21 | for (exponent++; exponent; exponent++) /* add zeros */ 22 | putchar('0'); 23 | for (; *p; p++) if (*p != '.') putchar(*p); /* the rest */ 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /PATBasic/1026.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int C1, C2, T; 6 | 7 | scanf("%d %d", &C1, &C2); 8 | T = (C2 - C1 + 50) / 100; /* rounding */ 9 | printf("%02d:%02d:%02d", T/3600, T%3600/60, T%60); 10 | 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /PATBasic/1027.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define ABS(X) ((X) >= 0 ? (X) : -(X)) 4 | 5 | int main() 6 | { 7 | char c; 8 | int N, M; 9 | scanf("%d %c", &N, &c); 10 | 11 | for (M = 1; 2 * M * M - 1 <= N; M++) ; 12 | M--; /* determine the size */ 13 | 14 | /* draw the sandglass */ 15 | for (int i = 0; i < 2 * M - 1; i ++) { 16 | for (int j = 0; j < M - 1 - ABS(M - 1 - i); j++) 17 | putchar(' '); 18 | for (int j = 0; j < 2 * ABS(M - 1 - i) + 1; j++) 19 | putchar(c); 20 | putchar('\n'); 21 | } 22 | printf("%d", N - 2 * M * M + 1); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /PATBasic/1028.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int N, count = 0; 7 | /* store name and birthday in one string: "YYYY/MM/DD\0NAMES\0" */ 8 | char cur[17], eldest[17] = {'9'}, youngest[17] = {'0'}; 9 | 10 | scanf("%d", &N); 11 | for (int i = 0; i < N; i++) { 12 | scanf("%s %s", cur + 11, cur); 13 | if (strcmp(cur, "1814/09/06") >= 0 && strcmp(cur, "2014/09/06") <= 0) { 14 | if (strcmp(cur, eldest) <= 0) 15 | memcpy(eldest, cur, 17); 16 | if (strcmp(cur, youngest) >= 0) 17 | memcpy(youngest, cur, 17); 18 | count++; 19 | } 20 | } 21 | 22 | if (count) 23 | printf("%d %s %s", count, eldest + 11, youngest + 11); 24 | else 25 | printf("0"); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /PATBasic/1029.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int printed[128] = {0}; 7 | char c, line[82]; 8 | 9 | fgets(line, 82, stdin); 10 | while ((c = getchar()) != EOF && c != '\n') 11 | printed[toupper(c)]++; 12 | 13 | for (char *p = line; *p; p++) { 14 | c = toupper(*p); 15 | if (printed[(int)c] == 0) { 16 | putchar(c); 17 | printed[(int)c] = -1; 18 | } 19 | } 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /PATBasic/1030.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int comp(const void *a, const void *b) 5 | { 6 | return *(int*)a - *(int*)b; 7 | } 8 | 9 | int main() 10 | { 11 | int N, p, data[100000]; 12 | int max = 0, first = 0, last = 0; 13 | 14 | scanf("%d %d", &N, &p); /* read */ 15 | for (int i = 0; i < N; i++) 16 | scanf("%d", data + i); 17 | 18 | qsort(data, N, sizeof(int), comp); /* sort */ 19 | 20 | for (; last < N && max < N - first; first++) { /* find */ 21 | while (last < N && data[last] <= 1L * data[first] * p) 22 | last++; 23 | if (max < last - first) 24 | max = last - first; 25 | } 26 | printf("%d", max); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /PATBasic/1031.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N; 6 | int weight[] = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; 7 | char ZtoM[] = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'}; 8 | char ID[19]; 9 | 10 | scanf("%d", &N); 11 | int d, sum, count = 0; /* index, weighted sum and count for legal IDs */ 12 | for (int i = 0; i < N; i++) { 13 | scanf("%s", ID); 14 | 15 | for (d = 0, sum = 0; d < 17 && ID[d] >= '0' && ID[d] <= '9'; d++) 16 | sum += (ID[d] - '0') * weight[d]; 17 | 18 | if (d == 17 && ID[17] == ZtoM[sum % 11]) /* legal ID */ 19 | count++; 20 | else /* illegal ID */ 21 | puts(ID); 22 | } 23 | if (count == N) 24 | puts("All passed"); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /PATBasic/1032.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, iSchool, score, imax = 0; 6 | scanf("%d", &N); 7 | 8 | int schools[100000] = {0}; 9 | for (int i = 0; i < N; i++) { 10 | scanf("%d %d", &iSchool, &score); 11 | schools[iSchool - 1] += score; 12 | } 13 | 14 | for (int i = 0; i < N; i++) 15 | if (schools[i] > schools[imax]) 16 | imax = i; 17 | 18 | printf("%d %d", imax + 1, schools[imax]); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /PATBasic/1033.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char c; 7 | int bad[128] = {0}; /* record keys are broken or not */ 8 | 9 | while ((c = getchar()) != '\n') /* read broken keys */ 10 | bad[toupper(c)] = 1; 11 | 12 | while ((c = getchar()) != EOF && c != '\n') /* read string and print */ 13 | if (!bad[toupper(c)] && !(isupper(c) && bad['+'])) 14 | putchar(c); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /PATBasic/1036.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N; 6 | char c; 7 | scanf("%d %c", &N, &c); 8 | 9 | for (int i = 0; i < (N + 1) / 2; i++) { 10 | for (int j = 0; j < N; j++) { 11 | if (i == 0 || i == (N - 1) / 2 || j == 0 || j == N - 1) 12 | putchar(c); 13 | else 14 | putchar(' '); 15 | } 16 | putchar('\n'); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /PATBasic/1037.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int Galleon, Sickle, Knut, P, A, change; 6 | 7 | scanf("%d.%d.%d", &Galleon, &Sickle, &Knut); 8 | P = (Galleon * 17 + Sickle) * 29 + Knut; 9 | scanf("%d.%d.%d", &Galleon, &Sickle, &Knut); 10 | A = (Galleon * 17 + Sickle) * 29 + Knut; 11 | 12 | change = A - P; 13 | if (change < 0) { 14 | change = -change; 15 | putchar('-'); 16 | } 17 | printf("%d.%d.%d", change / (17 * 29), change / 29 % 17, change % 29); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /PATBasic/1038.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, M, score, count[101] = {0}; 6 | 7 | scanf("%d", &N); 8 | for (int i = 0; i < N; i++) { 9 | scanf("%d", &score); 10 | count[score]++; 11 | } 12 | 13 | scanf("%d", &M); 14 | for (int i = 0; i < M; i++) { 15 | scanf("%d", &score); 16 | printf("%d%c", count[score], i == M - 1 ? '\n' : ' '); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /PATBasic/1039.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char c; 6 | int record[128] = {0}; /* all ASCII characters */ 7 | while ((c = getchar()) != '\n') 8 | record[(int)c]++; 9 | while ((c = getchar()) != EOF && c != '\n') 10 | record[(int)c]--; 11 | 12 | int more = 0, less = 0; 13 | for (int i = 0; i < 128; i++) { 14 | if (record[i] > 0) 15 | more += record[i]; 16 | if (record[i] < 0) 17 | less -= record[i]; 18 | } 19 | 20 | if (less) 21 | printf("No %d", less); 22 | else 23 | printf("Yes %d", more); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /PATBasic/1040.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define LIM 1000000007 4 | 5 | int main() 6 | { 7 | int P = 0, PA = 0, PAT = 0; 8 | char c; 9 | 10 | while ((c = getchar()) != EOF && c != '\n') { 11 | if (c == 'P') 12 | P++; 13 | if (c == 'A') 14 | PA = (PA + P) % LIM; 15 | if (c == 'T') 16 | PAT = (PAT + PA) % LIM; 17 | } 18 | printf("%d", PAT); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /PATBasic/1041.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | typedef struct student{ 5 | char ID[17]; 6 | int test_seat; 7 | int exam_seat; 8 | }Student, *pStudent; 9 | 10 | int main() 11 | { 12 | int N, M, test; 13 | Student students[1001] = {0}; /* N >= 1000 */ 14 | pStudent sp[1001] = {0}; 15 | 16 | scanf("%d", &N); 17 | for (int i = 0; i < N; i++) { 18 | pStudent s = students + i; /* fill in the ith in the array */ 19 | scanf("%s %d %d", s->ID, &s->test_seat, &s->exam_seat); 20 | sp[s->test_seat] = s; /* set index same as test number */ 21 | } 22 | 23 | scanf("%d", &M); 24 | for (int i = 0; i < M; i ++) { 25 | scanf("%d", &test); 26 | printf("%s %d\n", sp[test]->ID, sp[test]->exam_seat); 27 | } 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /PATBasic/1042.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char c; 7 | int count[26] = {0}, max = 25; 8 | 9 | while ((c = getchar()) != EOF && c != '\n') 10 | if (isalpha(c)) 11 | count[tolower(c) - 'a']++; 12 | 13 | /* find forward from end in case there are multiple maximums */ 14 | for (int i = 25; i >= 0; i--) 15 | if (count[i] >= count[max]) 16 | max = i; 17 | 18 | printf("%c %d", max + 'a', count[max]); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /PATBasic/1043.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char c, *str = "PATest"; /* use as index for count[] */ 6 | int i, flag = 1, count[128] = {0}; /* for each ASCII char */ 7 | 8 | /* Read and count numbers for every character */ 9 | while ((c = getchar()) != EOF && c != '\n') 10 | count[(int)c]++; 11 | 12 | /* Print any character in "PATest" if it is still left */ 13 | while (flag) 14 | for (i = 0, flag = 0; i < 6; i++) 15 | if (count[(int)str[i]]-- > 0) /* Check the number left */ 16 | putchar(str[i]), flag = 1; 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /PATBasic/1045.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, count = 0; 6 | int array[100000], lmax[100000], rmin[100000]; 7 | 8 | scanf("%d", &N); 9 | for (int i = 0; i < N; i++) scanf("%d", array + i); 10 | 11 | /* Find the largest on one's left and the smallest on the right */ 12 | for (int i = 0, max = i; i < N; i++) 13 | lmax[i] = array[i] >= array[max] ? array[max = i] : array[max]; 14 | for (int i = N - 1, min = i; i >= 0; i--) 15 | rmin[i] = array[i] <= array[min] ? array[min = i] : array[min]; 16 | 17 | /* A element is the largest on its left and the smallest on its right, 18 | * it is probably a pivot */ 19 | for (int i = 0; i < N; i++) { 20 | if (array[i] == lmax[i] && array[i] == rmin[i]) 21 | count++; 22 | else 23 | array[i] = 0; 24 | } 25 | 26 | printf("%d\n", count); 27 | for (int i = 0; i < N && count; i++) if (array[i]) 28 | printf("%d%c", array[i], --count ? ' ' : '\0'); 29 | printf("\n"); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /PATBasic/1046.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, A1, A2, B1, B2; 6 | int A = 0, B = 0; 7 | 8 | scanf("%d", &N); 9 | for (int i = 0; i < N; i++) { 10 | scanf("%d %d %d %d", &A1, &A2, &B1, &B2); 11 | if (A2 == A1 + B1 && B2 != A1 + B1) B++; 12 | if (A2 != A1 + B1 && B2 == A1 + B1) A++; 13 | } 14 | printf("%d %d", A, B); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /PATBasic/1047.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, team, member, score, highest = 0, teams[1000] = {0}; 6 | 7 | scanf("%d", &N); 8 | for (int i = 0; i < N; i++) { 9 | scanf("%d-%d %d", &team, &member, &score); 10 | teams[team - 1] += score; 11 | } 12 | for (int i = 0; i < 1000; i++) 13 | if (teams[i] > teams[highest]) 14 | highest = i; 15 | printf("%d %d", highest + 1, teams[highest]); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /PATBasic/1048.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char A[101], B[101]; 7 | char encrypt[] = "0123456789JQK"; 8 | 9 | scanf("%s %s", A, B); 10 | int lenA = strlen(A); 11 | int lenB = strlen(B); 12 | int maxlen = lenA > lenB ? lenA : lenB; 13 | int a, b; 14 | 15 | for (int i = 0; i < maxlen; i++) { 16 | a = lenA + i - maxlen < 0 ? 0 : A[lenA + i - maxlen] - '0'; 17 | b = lenB + i - maxlen < 0 ? 0 : B[lenB + i - maxlen] - '0'; 18 | 19 | if ((maxlen - i) % 2) 20 | putchar(encrypt[(a + b) % 13]); 21 | else 22 | putchar('0' + (b - a < 0 ? b - a + 10 : b - a)); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /PATBasic/1049.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N; 6 | double ai, sum = 0; 7 | 8 | scanf("%d", &N); 9 | for (int i = 0; i < N; i++) { 10 | scanf("%lf", &ai); 11 | /* ai is put at the beginning to avoid overflow */ 12 | sum += ai * (i + 1) * (N - i); 13 | } 14 | printf("%.2lf", sum); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /PATBasic/1051.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | double R1, P1, R2, P2; /* float type won't pass, not sure why */ 7 | double A, B; 8 | 9 | scanf("%lf %lf %lf %lf", &R1, &P1, &R2, &P2); 10 | A = R1 * R2 * cos(P1 + P2); /* doesn't matter how you calculate */ 11 | B = R1 * R2 * sin(P1 + P2); 12 | 13 | if (A < 0 && A > -0.005) 14 | A = 0; /* Rounding */ 15 | if (B < 0 && B > -0.005) 16 | B = 0; 17 | 18 | printf("%.2lf%+.2lfi", A, B); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /PATBasic/1053.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, D, K; 6 | int empty = 0, pempty = 0, lower; 7 | float e, E; 8 | 9 | scanf("%d %f %d", &N, &e, &D); 10 | for (int i = 0; i < N; i++) { 11 | lower = 0; 12 | scanf("%d", &K); 13 | for (int j = 0; j < K; j++) { 14 | scanf("%f", &E); 15 | if (E < e) 16 | lower++; 17 | } 18 | if (lower > K / 2 && K > D) 19 | empty++; 20 | else if (lower > K / 2) 21 | pempty++; 22 | } 23 | printf("%.1f%% %.1f%%", 100.0 * pempty / N, 100.0 * empty / N); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /PATBasic/1056.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, a, sum = 0; 6 | 7 | scanf("%d", &N); 8 | for (int i = 0; i < N; i++) { 9 | scanf("%d", &a); 10 | sum += a; 11 | } 12 | printf("%d", sum * (N - 1) * 11); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /PATBasic/1057.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char c; 7 | int sum = 0, count[2] = {0}; 8 | 9 | while ((c = getchar()) != EOF && c != '\n') 10 | if (isalpha(c)) 11 | sum += tolower(c) - 'a' + 1; 12 | 13 | for (; sum; sum >>= 1) 14 | count[sum & 1]++; 15 | 16 | printf("%d %d", count[0], count[1]); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /PATBasic/1060.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int cmp(const void *a, const void *b) 5 | { 6 | return *(int*)b - *(int*)a; 7 | } 8 | 9 | int main() 10 | { 11 | int N, E, miles[100000]; 12 | 13 | scanf("%d", &N); 14 | for (int i = 0; i < N; i++) 15 | scanf("%d", miles + i); 16 | 17 | qsort(miles, N, sizeof(int), cmp); 18 | 19 | for (E = 0; E < N && miles[E] > E + 1; E++) ; 20 | printf("%d", E); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /PATBasic/1061.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, M; 6 | int fullmark[100], answer[100]; 7 | int score, choice; 8 | 9 | scanf("%d %d", &N, &M); 10 | for (int i = 0; i < M; i++) 11 | scanf("%d", fullmark + i); 12 | for (int i = 0; i < M; i++) 13 | scanf("%d", answer + i); 14 | 15 | for (int i = 0; i < N; i++) { 16 | score = 0; 17 | for (int j = 0; j < M; j++) { 18 | scanf("%d", &choice); 19 | if (choice == answer[j]) 20 | score += fullmark[j]; 21 | } 22 | printf("%d\n", score); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /PATBasic/1062.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int gcd(int a, int b) 4 | { 5 | for (int r; (r = a % b); a = b, b = r) ; 6 | return b; 7 | } 8 | 9 | int main() 10 | { 11 | int N1, N2, M1, M2, K, L, count = 0; 12 | scanf("%d/%d %d/%d %d", &N1, &M1, &N2, &M2, &K); 13 | 14 | if (N1 * M2 > N2 * M1) { 15 | L = N1, N1 = N2, N2 = L; 16 | L = M1, M1 = M2, M2 = L; 17 | } 18 | 19 | for (L = N1 * K / M1 + 1; N2 * K > M2 * L; L++) 20 | if (gcd(L, K) == 1) 21 | printf("%s%d/%d", count++ ? " " : "", L, K); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /PATBasic/1063.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | int N, R, I, norm = 0; 7 | 8 | scanf("%d", &N); 9 | for (int i = 0; i < N; i++) { 10 | scanf("%d %d", &R, &I); 11 | if (R * R + I * I > norm) 12 | norm = R * R + I * I; 13 | } 14 | printf("%.2lf", sqrt(norm)); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /PATBasic/1064.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, m, sum, friendID[37] = {0}, count = 0; 6 | 7 | scanf("%d", &N); 8 | for (int i = 0; i < N; i++) { 9 | scanf("%d", &m); 10 | for (sum = 0; m; m /= 10) 11 | sum += m % 10; 12 | if (!friendID[sum]) 13 | friendID[sum] = 1, count++; 14 | } 15 | 16 | printf("%d\n", count); 17 | for (int i = 1; i < 37; i++) 18 | if (friendID[i]) 19 | printf("%d%c", i, --count ? ' ' : '\0'); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /PATBasic/1066.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, M, A, B, C, D; 6 | 7 | scanf("%d %d %d %d %d", &M, &N, &A, &B, &C); 8 | 9 | for (int i = 0; i < M; i++) 10 | for (int j = 0; j < N; j++) { 11 | scanf("%d", &D); 12 | if (A <= D && D <= B) D = C; 13 | printf("%03d%c", D, j == N - 1 ? '\n' : ' '); 14 | } 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /PATBasic/1067.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | int N; 8 | char c, correct[21], user[21]; 9 | 10 | scanf("%s %d", correct, &N); 11 | while (getchar() != '\n'); 12 | while (N--) { 13 | scanf("%20[^\n]", user); /* avoid overflow */ 14 | c = ungetc(getchar(), stdin); 15 | if (!strcmp(user, "#") && c == '\n') { 16 | break; 17 | } else if (!strcmp(correct, user) && c == '\n') { 18 | puts("Welcome in"); 19 | break; 20 | } else { 21 | printf("Wrong password: %s", user); 22 | while (putchar(getchar()) != '\n') ; 23 | if (!N) puts("Account locked"); 24 | } 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /PATBasic/1069.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char s[1000][21] = {{0}}, line[21]; 7 | int M, N, S, m, count = 0, r = 0; 8 | 9 | scanf("%d %d %d", &M, &N, &S); 10 | 11 | for (m = 0, S--; m < M; m++) { 12 | scanf("%s", line); 13 | if (m == S + count * N + r) { 14 | int flag = 1; 15 | for (int i = 0; i < count && flag; i++) 16 | if (!strcmp(s[i], line)) { 17 | flag = 0; 18 | r++; 19 | break; 20 | } 21 | if (flag) 22 | strcpy(s[count++], line); 23 | } 24 | } 25 | 26 | for (int i = 0; i < count; i++) 27 | printf("%s\n", s[i]); 28 | if (!count) 29 | printf("Keep going..."); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /PATBasic/1070.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int l[10001] = {0}, N, i; 6 | double length = 0; 7 | 8 | scanf("%d", &N); 9 | for (int j = 0; j < N; j++) { 10 | scanf("%d", &i); 11 | l[i]++; /* record counts */ 12 | } 13 | 14 | for (i = 0; i < 10001; i++) /* find the shortest, special case */ 15 | if (l[i]) { 16 | length = i; 17 | break; 18 | } 19 | 20 | for (; i < 10001; i++) /* make new ropes */ 21 | while (l[i]--) 22 | length = (length + i) / 2; 23 | 24 | printf("%d", (int)length); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /PATBasic/1071.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int T, K, n1, n2, b, t; 6 | scanf("%d %d", &T, &K); 7 | for (int i = 0; i < K; i ++) { 8 | scanf("%d %d %d %d", &n1, &b, &t, &n2); 9 | if (t <= T) { 10 | if ((b == 0 && n2 < n1) || (b == 1 && n2 > n1)) { 11 | T += t; 12 | printf("Win %d! Total = %d.\n", t, T); 13 | } else { 14 | T -= t; 15 | printf("Lose %d. Total = %d.\n", t, T); 16 | if (T <= 0) { 17 | printf("Game Over.\n"); 18 | break; 19 | } 20 | } 21 | } else { 22 | printf("Not enough tokens. Total = %d.\n", T); 23 | } 24 | } 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /PATBasic/1072.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, M, K, SNlist[10], SNtarget; 6 | char name[5]; 7 | 8 | scanf("%d %d", &N, &M); 9 | for (int i = 0; i < M; i ++) 10 | scanf("%d", SNlist + i); 11 | 12 | int flag, student_total = 0, item_total = 0; 13 | for (int i = 0; i < N; i ++) { 14 | flag = 0; 15 | scanf("%s %d", name, &K); 16 | for (int i = 0; i < K; i++) { 17 | scanf("%d", &SNtarget); 18 | for (int i = 0 ; i < M; i ++) { 19 | if (SNtarget == SNlist[i]) { 20 | if (flag == 0) { 21 | flag = 1; 22 | student_total++; 23 | printf("%s:", name); 24 | } 25 | item_total++; 26 | printf(" %04d", SNtarget); 27 | } 28 | } 29 | } 30 | if (flag) 31 | printf("\n"); 32 | } 33 | printf("%d %d", student_total, item_total); 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /PATBasic/1075.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int data[100000] = {0}, next[100000] = {0}, 6 | firstaddr, addr, lastaddr = -1, N, K; 7 | 8 | /* Read */ 9 | scanf("%d %d %d", &firstaddr, &N, &K); 10 | for (int i = 0; i < N; i++) { 11 | scanf("%d", &addr); 12 | scanf("%d %d", data + addr, next + addr); 13 | } 14 | 15 | /* Scan three times */ 16 | for (int i = 0; i < 3; i++) { 17 | /* Scan along the linked list */ 18 | for (addr = firstaddr; addr != -1; addr = next[addr]) { 19 | /* If the number fits the condition */ 20 | if ((i == 0 && data[addr] < 0) 21 | || (i == 1 && 0 <= data[addr] && data[addr] <= K) 22 | || (i == 2 && data[addr] > K)) 23 | { 24 | /* Print */ 25 | if (lastaddr != -1) printf(" %05d\n", addr); 26 | printf("%05d %d", addr, data[addr]); 27 | lastaddr = addr; 28 | } 29 | } 30 | } 31 | printf(" -1"); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /PATBasic/1076.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char string[4]; 6 | 7 | while (scanf("%s", string) != EOF) 8 | if (string[2] == 'T') 9 | putchar("1234"[string[0] - 'A']); 10 | 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /PATBasic/1077.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, M, count; 6 | double G1, G2, Gsum, Gmax, Gmin, G; 7 | scanf("%d %d", &N, &M); 8 | 9 | for (int i = 0; i < N; i++) { 10 | scanf("%lf", &G2); 11 | 12 | /* Calculate G1 */ 13 | Gsum = 0; 14 | count = 0; 15 | Gmin = M; 16 | Gmax = 0; 17 | for (int j = 0; j < N - 1; j++) { 18 | scanf("%lf", &G); 19 | if (G >= 0 && G <= M) { 20 | count++; 21 | Gsum += G; 22 | if (G > Gmax) /* Record highest score */ 23 | Gmax = G; 24 | if (G < Gmin) /* Record lowest score */ 25 | Gmin = G; 26 | } 27 | } 28 | G1 = (Gsum - Gmax - Gmin) / (count - 2); /* Average */ 29 | 30 | printf("%d\n", (int)((G1 + G2 + 1) / 2)); 31 | } 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /PATBasic/1081.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | char c; 7 | int N, count, num_digit, num_alpha, num_else; 8 | 9 | scanf("%d", &N); 10 | while (getchar() == '\n'); 11 | for (int i = 0; i < N; i++) { 12 | num_digit = num_alpha = num_else = 0; 13 | for (count = 0; (c = getchar()) != '\n'; count++) { 14 | if (isdigit(c)) 15 | num_digit++; 16 | else if (isalpha(c)) 17 | num_alpha++; 18 | else if (c != '.') 19 | num_else++; 20 | } 21 | if (count < 6) 22 | puts("Your password is tai duan le."); 23 | else if (num_else) 24 | puts("Your password is tai luan le."); 25 | else if (num_alpha && !num_digit) 26 | puts("Your password needs shu zi."); 27 | else if (num_digit && !num_alpha) 28 | puts("Your password needs zi mu."); 29 | else 30 | puts("Your password is wan mei."); 31 | } 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /PATBasic/1082.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int best_id = 0, worst_id = 0, cur_id; 6 | int x, y, N; 7 | int min_dist_sq = 99999, max_dist_sq = -1, cur_dist_sq; 8 | 9 | scanf("%d", &N); 10 | for (int i = 0; i < N; i++) { 11 | scanf("%d %d %d", &cur_id, &x, &y); 12 | cur_dist_sq = x * x + y * y; 13 | if (min_dist_sq > cur_dist_sq) { 14 | min_dist_sq = cur_dist_sq; 15 | best_id = cur_id; 16 | } 17 | if (max_dist_sq < cur_dist_sq) { 18 | max_dist_sq = cur_dist_sq; 19 | worst_id = cur_id; 20 | } 21 | } 22 | 23 | printf("%04d %04d", best_id, worst_id); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /PATBasic/1083.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, num, diff[10000] = {0}; 6 | 7 | scanf("%d", &N); 8 | for (int i = 0; i < N; i++) { 9 | /* The front is i + 1, the back is num */ 10 | scanf("%d", &num); 11 | diff[(num > i + 1) ? (num - i - 1) : (i + 1 - num)]++; 12 | } 13 | 14 | for (int i = N - 1; i >= 0; i--) 15 | if (diff[i] >= 2) 16 | printf("%d %d\n", i, diff[i]); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /PATBasic/1084.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, count; 6 | char string1[100000] = {0}, string2[100000] = {0}; 7 | char *s1 = string1, *s2 = string2, *temp; 8 | char *p1, *p2; 9 | 10 | scanf("%s %d", s1, &N); 11 | 12 | for (int i = 1; i < N; i++) { /* Loop through nth string */ 13 | for (p1 = s1, p2 = s2, count = 0; *p1; p1++) { 14 | count++; /* Magic, don't touch! */ 15 | if (*p1 != *(p1 + 1)) { /* New char or end */ 16 | *p2++ = *p1; /* Record character */ 17 | *p2++ = count + '0'; /* Record count */ 18 | count = 0; /* Reset count */ 19 | } 20 | } 21 | /* Swap */ 22 | temp = s1, s1 = s2, s2 = temp; 23 | } 24 | 25 | puts(s1); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /PATBasic/1086.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int A, B, C; 6 | scanf("%d %d", &A, &B); 7 | C = A * B; 8 | 9 | while (!(C % 10)) 10 | C /= 10; 11 | 12 | while (C) { 13 | putchar('0' + C % 10); 14 | C /= 10; 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /PATBasic/1087.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, n, m, m0 = -1, count = 0; 6 | 7 | scanf("%d", &N); 8 | 9 | for (n = 1; n <= N; n++) { 10 | m = n / 2 + n / 3 + n / 5; 11 | if (m > m0) 12 | count++; 13 | m0 = m; 14 | } 15 | 16 | printf("%d", count); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /PATBasic/1088.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int m, n, a, b, X, Y, M, diffab; 6 | double c; 7 | scanf("%d %d %d", &M, &X, &Y); 8 | 9 | for (m = 9; m > 0; m--) { 10 | for (n = 9; n >= 0; n--) { 11 | a = 10 * m + n; 12 | b = 10 * n + m; 13 | diffab = 9 * (m > n ? m - n : n - m); 14 | if (diffab * Y == b * X) { 15 | c = b * 1.0 / Y; 16 | printf("%d", a); 17 | printf(a > M ? " Cong" : (a == M ? " Ping" : " Gai")); 18 | printf(b > M ? " Cong" : (b == M ? " Ping" : " Gai")); 19 | printf(c > M ? " Cong" : (c == M ? " Ping" : " Gai")); 20 | return 0; 21 | } 22 | } 23 | } 24 | 25 | printf("No Solution"); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /PATBasic/1090.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int cmp(const void *a, const void *b) 5 | { 6 | return *(int*)a - *(int*)b; 7 | } 8 | 9 | int main() 10 | { 11 | int N, M, K, status; 12 | int itemlist[1000], pairlist[10000][2] = {{0}}; 13 | 14 | /* Record incompatible list */ 15 | scanf("%d %d", &N, &M); 16 | for (int i = 0; i < N; i ++) 17 | scanf("%d %d", &pairlist[i][0], &pairlist[i][1]); 18 | 19 | for (int i = 0; i < M; i++) { 20 | status = 1; 21 | scanf("%d", &K); 22 | for (int j = 0; j < K && status; j++) 23 | scanf("%d", itemlist + j); 24 | 25 | qsort(itemlist, K, sizeof(int), cmp); 26 | 27 | for (int j = 0; j < N; j++) { 28 | if (bsearch(&pairlist[j][0], itemlist, K, sizeof(int), cmp) 29 | && bsearch(&pairlist[j][1], itemlist, K, sizeof(int), cmp)) { 30 | puts("No"); 31 | status = 0; 32 | break; 33 | } 34 | } 35 | 36 | if (status) 37 | puts("Yes"); 38 | } 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /PATBasic/1091.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int M, N, K, L, mask; 6 | 7 | scanf("%d", &M); 8 | for (int i = 0; i < M; i++) { 9 | scanf("%d", &K); 10 | for (N = 1; N < 10; N++) { 11 | L = N * K * K; 12 | 13 | /* compare the lowest digits one by one */ 14 | for (mask = 1; mask <= K; mask *= 10) 15 | if (L / mask % 10 != K / mask % 10) 16 | break; 17 | 18 | if (mask > K) { /* all passed! */ 19 | printf("%d %d\n", N, L); 20 | break; 21 | } 22 | } 23 | if (N == 10) /* No results */ 24 | printf("No\n"); 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /PATBasic/1092.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int N, M, cur, max = 0, sales[1000] = {0}; 6 | 7 | scanf("%d %d", &N, &M); 8 | for (int i = 0; i < M; i++) { 9 | for (int j = 0; j < N; j++) { 10 | scanf("%d", &cur); 11 | sales[j] += cur; 12 | } 13 | } 14 | 15 | /* find the max */ 16 | for (int i = 0; i < N; i++) 17 | if (max < sales[i]) 18 | max = sales[i]; 19 | 20 | /* print all the indexes of max sales */ 21 | printf("%d", max); 22 | for (int i = 0, count = 0; i < N; i++) 23 | if (sales[i] == max) 24 | printf("%c%d", count++ ? ' ' : '\n', i + 1); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /PATBasic/1093.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | char c; 6 | int lines = 0, ascii[128] = {0}; 7 | 8 | while (lines < 2) { 9 | c = getchar(); 10 | if (c == '\n' || c == EOF) { 11 | lines++; 12 | } else if (!ascii[(int)c]) { 13 | putchar(c); 14 | ascii[(int)c]++; 15 | } 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /PATBasic/1094.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int iPrime(int n) 6 | { 7 | if (n < 2) 8 | return 0; 9 | for (int i = 2; i * i <= n; i++) 10 | if (n % i == 0) 11 | return 0; 12 | return 1; 13 | } 14 | 15 | int main() 16 | { 17 | char N[1000], n[10] = {0}; 18 | int L, K; 19 | 20 | scanf("%d %d %s", &L, &K, N); /* L == strlen(N) */ 21 | for (int i = 0; i <= L - K; i++) { 22 | strncpy(n, N + i, K); 23 | if (iPrime(atoi(n))) { 24 | printf("%s", n); 25 | return 0; 26 | } 27 | } 28 | 29 | printf("404"); 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PAT习题C语言题解 2 | 3 | ![](https://github.com/xlucn/pat/workflows/Sample%20Test/badge.svg) 4 | 5 | ## 代码 6 | 7 | 代码位于git仓库的`master`分支。 8 | 9 | [PAT习题][pintia]C语言题解。仅用C语言编写,尽量追求代码高效简洁。 10 | 11 | * PAT Basic (1001-1095) 12 | * PAT Advanced (未完成) 13 | * PAT Top (暂无) 14 | 15 | ## 解题说明 16 | 17 | https://xlucn.github.io/PAT/ 18 | 19 | 博客代码在仓库的`gh-pages`分支。 20 | 21 | [pintia]: https://pintia.cn/problem-sets 22 | [issues]: https://github.com/xlucn/PAT/issues 23 | [pr]: https://github.com/xlucn/PAT/pulls 24 | [mail]: mailto:oliver_lew@outlook.com 25 | -------------------------------------------------------------------------------- /samples/a1001-1.in: -------------------------------------------------------------------------------- 1 | -1000000 9 -------------------------------------------------------------------------------- /samples/a1001-1.out: -------------------------------------------------------------------------------- 1 | -999,991 -------------------------------------------------------------------------------- /samples/a1002-1.in: -------------------------------------------------------------------------------- 1 | 2 1 2.4 0 3.2 2 | 2 2 1.5 1 0.5 -------------------------------------------------------------------------------- /samples/a1002-1.out: -------------------------------------------------------------------------------- 1 | 3 2 1.5 1 2.9 0 3.2 -------------------------------------------------------------------------------- /samples/a1003-1.in: -------------------------------------------------------------------------------- 1 | 5 6 0 2 2 | 1 2 1 5 3 3 | 0 1 1 4 | 0 2 2 5 | 0 3 1 6 | 1 2 1 7 | 2 4 1 8 | 3 4 1 -------------------------------------------------------------------------------- /samples/a1003-1.out: -------------------------------------------------------------------------------- 1 | 2 4 -------------------------------------------------------------------------------- /samples/a1004-1.in: -------------------------------------------------------------------------------- 1 | 2 1 2 | 01 1 02 -------------------------------------------------------------------------------- /samples/a1004-1.out: -------------------------------------------------------------------------------- 1 | 0 1 -------------------------------------------------------------------------------- /samples/a1005-1.in: -------------------------------------------------------------------------------- 1 | 12345 -------------------------------------------------------------------------------- /samples/a1005-1.out: -------------------------------------------------------------------------------- 1 | one five -------------------------------------------------------------------------------- /samples/a1006-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | CS301111 15:30:28 17:00:10 3 | SC3021234 08:00:00 11:25:25 4 | CS301133 21:45:00 21:58:40 -------------------------------------------------------------------------------- /samples/a1006-1.out: -------------------------------------------------------------------------------- 1 | SC3021234 CS301133 -------------------------------------------------------------------------------- /samples/a1007-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | -10 1 2 3 4 -5 -23 3 7 -21 -------------------------------------------------------------------------------- /samples/a1007-1.out: -------------------------------------------------------------------------------- 1 | 10 1 4 -------------------------------------------------------------------------------- /samples/a1008-1.in: -------------------------------------------------------------------------------- 1 | 3 2 3 1 -------------------------------------------------------------------------------- /samples/a1008-1.out: -------------------------------------------------------------------------------- 1 | 41 -------------------------------------------------------------------------------- /samples/a1009-1.in: -------------------------------------------------------------------------------- 1 | 2 1 2.4 0 3.2 2 | 2 2 1.5 1 0.5 -------------------------------------------------------------------------------- /samples/a1009-1.out: -------------------------------------------------------------------------------- 1 | 3 3 3.6 2 6.0 1 1.6 -------------------------------------------------------------------------------- /samples/a1010-1.in: -------------------------------------------------------------------------------- 1 | 6 110 1 10 -------------------------------------------------------------------------------- /samples/a1010-1.out: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /samples/a1010-2.in: -------------------------------------------------------------------------------- 1 | 1 ab 1 2 -------------------------------------------------------------------------------- /samples/a1010-2.out: -------------------------------------------------------------------------------- 1 | Impossible -------------------------------------------------------------------------------- /samples/a1011-1.in: -------------------------------------------------------------------------------- 1 | 1.1 2.5 1.7 2 | 1.2 3.1 1.6 3 | 4.1 1.2 1.1 -------------------------------------------------------------------------------- /samples/a1011-1.out: -------------------------------------------------------------------------------- 1 | T T W 39.31 -------------------------------------------------------------------------------- /samples/a1012-1.in: -------------------------------------------------------------------------------- 1 | 5 6 2 | 310101 98 85 88 3 | 310102 70 95 88 4 | 310103 82 87 94 5 | 310104 91 91 91 6 | 310105 85 90 90 7 | 310101 8 | 310102 9 | 310103 10 | 310104 11 | 310105 12 | 999999 -------------------------------------------------------------------------------- /samples/a1012-1.out: -------------------------------------------------------------------------------- 1 | 1 C 2 | 1 M 3 | 1 E 4 | 1 A 5 | 3 A 6 | N/A -------------------------------------------------------------------------------- /samples/a1013-1.in: -------------------------------------------------------------------------------- 1 | 3 2 3 2 | 1 2 3 | 1 3 4 | 1 2 3 -------------------------------------------------------------------------------- /samples/a1013-1.out: -------------------------------------------------------------------------------- 1 | 1 2 | 0 3 | 0 -------------------------------------------------------------------------------- /samples/a1014-1.in: -------------------------------------------------------------------------------- 1 | 2 2 7 5 2 | 1 2 6 4 3 534 2 3 | 3 4 5 6 7 4 | -------------------------------------------------------------------------------- /samples/a1014-1.out: -------------------------------------------------------------------------------- 1 | 08:07 2 | 08:06 3 | 08:10 4 | 17:00 5 | Sorry 6 | -------------------------------------------------------------------------------- /samples/a1015-1.in: -------------------------------------------------------------------------------- 1 | 73 10 2 | 23 2 3 | 23 10 4 | -2 -------------------------------------------------------------------------------- /samples/a1015-1.out: -------------------------------------------------------------------------------- 1 | Yes 2 | Yes 3 | No -------------------------------------------------------------------------------- /samples/a1016-1.in: -------------------------------------------------------------------------------- 1 | 10 10 10 10 10 10 20 20 20 15 15 15 15 15 15 15 20 30 20 15 15 10 10 10 2 | 10 3 | CYLL 01:01:06:01 on-line 4 | CYLL 01:28:16:05 off-line 5 | CYJJ 01:01:07:00 off-line 6 | CYLL 01:01:08:03 off-line 7 | CYJJ 01:01:05:59 on-line 8 | aaa 01:01:01:03 on-line 9 | aaa 01:02:00:01 on-line 10 | CYLL 01:28:15:41 on-line 11 | aaa 01:05:02:24 on-line 12 | aaa 01:04:23:59 off-line -------------------------------------------------------------------------------- /samples/a1016-1.out: -------------------------------------------------------------------------------- 1 | CYJJ 01 2 | 01:05:59 01:07:00 61 $12.10 3 | Total amount: $12.10 4 | CYLL 01 5 | 01:06:01 01:08:03 122 $24.40 6 | 28:15:41 28:16:05 24 $3.85 7 | Total amount: $28.25 8 | aaa 01 9 | 02:00:01 04:23:59 4318 $638.80 10 | Total amount: $638.80 -------------------------------------------------------------------------------- /samples/a1017-1.in: -------------------------------------------------------------------------------- 1 | 7 3 2 | 07:55:00 16 3 | 17:00:01 2 4 | 07:59:59 15 5 | 08:01:00 60 6 | 08:00:00 30 7 | 08:00:02 2 8 | 08:03:00 10 -------------------------------------------------------------------------------- /samples/a1017-1.out: -------------------------------------------------------------------------------- 1 | 8.2 -------------------------------------------------------------------------------- /samples/a1018-1.in: -------------------------------------------------------------------------------- 1 | 10 3 3 5 2 | 6 7 0 3 | 0 1 1 4 | 0 2 1 5 | 0 3 3 6 | 1 3 1 7 | 2 3 1 -------------------------------------------------------------------------------- /samples/a1018-1.out: -------------------------------------------------------------------------------- 1 | 3 0->2->3 0 -------------------------------------------------------------------------------- /samples/a1019-1.in: -------------------------------------------------------------------------------- 1 | 27 2 -------------------------------------------------------------------------------- /samples/a1019-1.out: -------------------------------------------------------------------------------- 1 | Yes 2 | 1 1 0 1 1 -------------------------------------------------------------------------------- /samples/a1019-2.in: -------------------------------------------------------------------------------- 1 | 121 5 -------------------------------------------------------------------------------- /samples/a1019-2.out: -------------------------------------------------------------------------------- 1 | No 2 | 4 4 1 -------------------------------------------------------------------------------- /samples/a1020-1.in: -------------------------------------------------------------------------------- 1 | 7 2 | 2 3 1 5 7 6 4 3 | 1 2 3 4 5 6 7 -------------------------------------------------------------------------------- /samples/a1020-1.out: -------------------------------------------------------------------------------- 1 | 4 1 6 3 5 7 2 -------------------------------------------------------------------------------- /samples/a1021-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | 1 2 3 | 1 3 4 | 1 4 5 | 2 5 -------------------------------------------------------------------------------- /samples/a1021-1.out: -------------------------------------------------------------------------------- 1 | 3 2 | 4 3 | 5 -------------------------------------------------------------------------------- /samples/a1021-2.in: -------------------------------------------------------------------------------- 1 | 5 2 | 1 3 3 | 1 4 4 | 2 5 5 | 3 4 -------------------------------------------------------------------------------- /samples/a1021-2.out: -------------------------------------------------------------------------------- 1 | Error: 2 components -------------------------------------------------------------------------------- /samples/a1022-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | 1111111 3 | The Testing Book 4 | Yue Chen 5 | test code debug sort keywords 6 | ZUCS Print 7 | 2011 8 | 3333333 9 | Another Testing Book 10 | Yue Chen 11 | test code sort keywords 12 | ZUCS Print2 13 | 2012 14 | 2222222 15 | The Testing Book 16 | CYLL 17 | keywords debug book 18 | ZUCS Print2 19 | 2011 20 | 6 21 | 1: The Testing Book 22 | 2: Yue Chen 23 | 3: keywords 24 | 4: ZUCS Print 25 | 5: 2011 26 | 3: blablabla -------------------------------------------------------------------------------- /samples/a1022-1.out: -------------------------------------------------------------------------------- 1 | 1: The Testing Book 2 | 1111111 3 | 2222222 4 | 2: Yue Chen 5 | 1111111 6 | 3333333 7 | 3: keywords 8 | 1111111 9 | 2222222 10 | 3333333 11 | 4: ZUCS Print 12 | 1111111 13 | 5: 2011 14 | 1111111 15 | 2222222 16 | 3: blablabla 17 | Not Found -------------------------------------------------------------------------------- /samples/a1023-1.in: -------------------------------------------------------------------------------- 1 | 1234567899 -------------------------------------------------------------------------------- /samples/a1023-1.out: -------------------------------------------------------------------------------- 1 | Yes 2 | 2469135798 -------------------------------------------------------------------------------- /samples/a1024-1.in: -------------------------------------------------------------------------------- 1 | 67 3 -------------------------------------------------------------------------------- /samples/a1024-1.out: -------------------------------------------------------------------------------- 1 | 484 2 | 2 -------------------------------------------------------------------------------- /samples/a1024-2.in: -------------------------------------------------------------------------------- 1 | 69 3 -------------------------------------------------------------------------------- /samples/a1024-2.out: -------------------------------------------------------------------------------- 1 | 1353 2 | 3 -------------------------------------------------------------------------------- /samples/a1025-1.in: -------------------------------------------------------------------------------- 1 | 2 2 | 5 3 | 1234567890001 95 4 | 1234567890005 100 5 | 1234567890003 95 6 | 1234567890002 77 7 | 1234567890004 85 8 | 4 9 | 1234567890013 65 10 | 1234567890011 25 11 | 1234567890014 100 12 | 1234567890012 85 -------------------------------------------------------------------------------- /samples/a1025-1.out: -------------------------------------------------------------------------------- 1 | 9 2 | 1234567890005 1 1 1 3 | 1234567890014 1 2 1 4 | 1234567890001 3 1 2 5 | 1234567890003 3 1 2 6 | 1234567890004 5 1 4 7 | 1234567890012 5 2 2 8 | 1234567890002 7 1 5 9 | 1234567890013 8 2 3 10 | 1234567890011 9 2 4 -------------------------------------------------------------------------------- /samples/a1026-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 20:52:00 10 0 3 | 08:00:00 20 0 4 | 08:02:00 30 0 5 | 20:51:00 10 0 6 | 08:10:00 30 0 7 | 08:12:00 10 1 8 | 20:40:00 13 0 9 | 08:01:30 15 1 10 | 20:53:00 10 1 11 | 20:54:00 10 0 12 | 3 1 13 | 2 14 | -------------------------------------------------------------------------------- /samples/a1026-1.out: -------------------------------------------------------------------------------- 1 | 08:00:00 08:00:00 0 2 | 08:01:30 08:01:30 0 3 | 08:02:00 08:02:00 0 4 | 08:12:00 08:16:30 5 5 | 08:10:00 08:20:00 10 6 | 20:40:00 20:40:00 0 7 | 20:51:00 20:51:00 0 8 | 20:52:00 20:52:00 0 9 | 20:53:00 20:53:00 0 10 | 4 3 2 11 | -------------------------------------------------------------------------------- /samples/a1027-1.in: -------------------------------------------------------------------------------- 1 | 15 43 71 -------------------------------------------------------------------------------- /samples/a1027-1.out: -------------------------------------------------------------------------------- 1 | #123456 -------------------------------------------------------------------------------- /samples/a1028-1.in: -------------------------------------------------------------------------------- 1 | 3 1 2 | 000007 James 85 3 | 000010 Amy 90 4 | 000001 Zoe 60 5 | -------------------------------------------------------------------------------- /samples/a1028-1.out: -------------------------------------------------------------------------------- 1 | 000001 Zoe 60 2 | 000007 James 85 3 | 000010 Amy 90 4 | -------------------------------------------------------------------------------- /samples/a1028-2.in: -------------------------------------------------------------------------------- 1 | 4 2 2 | 000007 James 85 3 | 000010 Amy 90 4 | 000001 Zoe 60 5 | 000002 James 98 6 | -------------------------------------------------------------------------------- /samples/a1028-2.out: -------------------------------------------------------------------------------- 1 | 000010 Amy 90 2 | 000002 James 98 3 | 000007 James 85 4 | 000001 Zoe 60 5 | -------------------------------------------------------------------------------- /samples/a1028-3.in: -------------------------------------------------------------------------------- 1 | 4 3 2 | 000007 James 85 3 | 000010 Amy 90 4 | 000001 Zoe 60 5 | 000002 James 9 6 | -------------------------------------------------------------------------------- /samples/a1028-3.out: -------------------------------------------------------------------------------- 1 | 000002 James 9 2 | 000001 Zoe 60 3 | 000007 James 85 4 | 000010 Amy 90 5 | -------------------------------------------------------------------------------- /samples/a1029-1.in: -------------------------------------------------------------------------------- 1 | 4 11 12 13 14 2 | 5 9 10 15 16 17 -------------------------------------------------------------------------------- /samples/a1029-1.out: -------------------------------------------------------------------------------- 1 | 13 -------------------------------------------------------------------------------- /samples/a1030-1.in: -------------------------------------------------------------------------------- 1 | 4 5 0 3 2 | 0 1 1 20 3 | 1 3 2 30 4 | 0 3 4 10 5 | 0 2 2 20 6 | 2 3 1 20 -------------------------------------------------------------------------------- /samples/a1030-1.out: -------------------------------------------------------------------------------- 1 | 0 2 3 3 40 -------------------------------------------------------------------------------- /samples/a1031-1.in: -------------------------------------------------------------------------------- 1 | helloworld! -------------------------------------------------------------------------------- /samples/a1031-1.out: -------------------------------------------------------------------------------- 1 | h ! 2 | e d 3 | l l 4 | lowor -------------------------------------------------------------------------------- /samples/a1032-1.in: -------------------------------------------------------------------------------- 1 | 11111 22222 9 2 | 67890 i 00002 3 | 00010 a 12345 4 | 00003 g -1 5 | 12345 D 67890 6 | 00002 n 00003 7 | 22222 B 23456 8 | 11111 L 00001 9 | 23456 e 67890 10 | 00001 o 00010 -------------------------------------------------------------------------------- /samples/a1032-1.out: -------------------------------------------------------------------------------- 1 | 67890 -------------------------------------------------------------------------------- /samples/a1032-2.in: -------------------------------------------------------------------------------- 1 | 00001 00002 4 2 | 00001 a 10001 3 | 10001 s -1 4 | 00002 a 10002 5 | 10002 t -1 -------------------------------------------------------------------------------- /samples/a1032-2.out: -------------------------------------------------------------------------------- 1 | -1 -------------------------------------------------------------------------------- /samples/a1033-1.in: -------------------------------------------------------------------------------- 1 | 50 1300 12 8 2 | 6.00 1250 3 | 7.00 600 4 | 7.00 150 5 | 7.10 0 6 | 7.20 200 7 | 7.50 400 8 | 7.30 1000 9 | 6.85 300 -------------------------------------------------------------------------------- /samples/a1033-1.out: -------------------------------------------------------------------------------- 1 | 749.17 -------------------------------------------------------------------------------- /samples/a1034-1.in: -------------------------------------------------------------------------------- 1 | 8 59 2 | AAA BBB 10 3 | BBB AAA 20 4 | AAA CCC 40 5 | DDD EEE 5 6 | EEE DDD 70 7 | FFF GGG 30 8 | GGG HHH 20 9 | HHH FFF 10 -------------------------------------------------------------------------------- /samples/a1034-1.out: -------------------------------------------------------------------------------- 1 | 2 2 | AAA 3 3 | GGG 3 -------------------------------------------------------------------------------- /samples/a1034-2.in: -------------------------------------------------------------------------------- 1 | 8 70 2 | AAA BBB 10 3 | BBB AAA 20 4 | AAA CCC 40 5 | DDD EEE 5 6 | EEE DDD 70 7 | FFF GGG 30 8 | GGG HHH 20 9 | HHH FFF 10 -------------------------------------------------------------------------------- /samples/a1034-2.out: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /samples/a1035-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | Team000002 Rlsp0dfa 3 | Team000003 perfectpwd 4 | Team000001 R1spOdfa -------------------------------------------------------------------------------- /samples/a1035-1.out: -------------------------------------------------------------------------------- 1 | 2 2 | Team000002 RLsp%dfa 3 | Team000001 R@spodfa -------------------------------------------------------------------------------- /samples/a1035-2.in: -------------------------------------------------------------------------------- 1 | 1 2 | team110 abcdefg332 -------------------------------------------------------------------------------- /samples/a1035-2.out: -------------------------------------------------------------------------------- 1 | There is 1 account and no account is modified -------------------------------------------------------------------------------- /samples/a1035-3.in: -------------------------------------------------------------------------------- 1 | 2 2 | team110 abcdefg222 3 | team220 abcdefg333 -------------------------------------------------------------------------------- /samples/a1035-3.out: -------------------------------------------------------------------------------- 1 | There are 2 accounts and no account is modified -------------------------------------------------------------------------------- /samples/a1036-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | Joe M Math990112 89 3 | Mike M CS991301 100 4 | Mary F EE990830 95 -------------------------------------------------------------------------------- /samples/a1036-1.out: -------------------------------------------------------------------------------- 1 | Mary EE990830 2 | Joe Math990112 3 | 6 -------------------------------------------------------------------------------- /samples/a1036-2.in: -------------------------------------------------------------------------------- 1 | 1 2 | Jean M AA980920 60 -------------------------------------------------------------------------------- /samples/a1036-2.out: -------------------------------------------------------------------------------- 1 | Absent 2 | Jean AA980920 3 | NA -------------------------------------------------------------------------------- /samples/a1037-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 1 2 4 -1 3 | 4 4 | 7 6 -2 -3 -------------------------------------------------------------------------------- /samples/a1037-1.out: -------------------------------------------------------------------------------- 1 | 43 -------------------------------------------------------------------------------- /samples/a1038-1.in: -------------------------------------------------------------------------------- 1 | 5 32 321 3214 0229 87 -------------------------------------------------------------------------------- /samples/a1038-1.out: -------------------------------------------------------------------------------- 1 | 22932132143287 -------------------------------------------------------------------------------- /samples/a1039-1.in: -------------------------------------------------------------------------------- 1 | 11 5 2 | 4 7 3 | BOB5 DON2 FRA8 JAY9 KAT3 LOR6 ZOE1 4 | 1 4 5 | ANN0 BOB5 JAY9 LOR6 6 | 2 7 7 | ANN0 BOB5 FRA8 JAY9 JOE4 KAT3 LOR6 8 | 3 1 9 | BOB5 10 | 5 9 11 | AMY7 ANN0 BOB5 DON2 FRA8 JAY9 KAT3 LOR6 ZOE1 12 | ZOE1 ANN0 BOB5 JOE4 JAY9 FRA8 DON2 AMY7 KAT3 LOR6 NON9 -------------------------------------------------------------------------------- /samples/a1039-1.out: -------------------------------------------------------------------------------- 1 | ZOE1 2 4 5 2 | ANN0 3 1 2 5 3 | BOB5 5 1 2 3 4 5 4 | JOE4 1 2 5 | JAY9 4 1 2 4 5 6 | FRA8 3 2 4 5 7 | DON2 2 4 5 8 | AMY7 1 5 9 | KAT3 3 2 4 5 10 | LOR6 4 1 2 4 5 11 | NON9 0 -------------------------------------------------------------------------------- /samples/a1040-1.in: -------------------------------------------------------------------------------- 1 | Is PAT&TAP symmetric? -------------------------------------------------------------------------------- /samples/a1040-1.out: -------------------------------------------------------------------------------- 1 | 11 -------------------------------------------------------------------------------- /samples/a1041-1.in: -------------------------------------------------------------------------------- 1 | 7 5 31 5 88 67 88 17 -------------------------------------------------------------------------------- /samples/a1041-1.out: -------------------------------------------------------------------------------- 1 | 31 -------------------------------------------------------------------------------- /samples/a1041-2.in: -------------------------------------------------------------------------------- 1 | 5 888 666 666 888 888 -------------------------------------------------------------------------------- /samples/a1041-2.out: -------------------------------------------------------------------------------- 1 | None -------------------------------------------------------------------------------- /samples/a1042-1.in: -------------------------------------------------------------------------------- 1 | 2 2 | 36 52 37 38 3 39 40 53 54 41 11 12 13 42 43 44 2 4 23 24 25 26 27 6 7 8 48 49 50 51 9 10 14 15 16 5 17 18 19 1 20 21 22 28 29 30 31 32 33 34 35 45 46 47 -------------------------------------------------------------------------------- /samples/a1042-1.out: -------------------------------------------------------------------------------- 1 | S7 C11 C10 C12 S1 H7 H8 H9 D8 D9 S11 S12 S13 D10 D11 D12 S3 S4 S6 S10 H1 H2 C13 D2 D3 D4 H6 H3 D13 J1 J2 C1 C2 C3 C4 D1 S5 H5 H11 H12 C6 C7 C8 C9 S2 S8 S9 H10 D5 D6 D7 H4 H13 C5 -------------------------------------------------------------------------------- /samples/a1043-1.in: -------------------------------------------------------------------------------- 1 | 7 2 | 8 6 5 7 10 8 11 -------------------------------------------------------------------------------- /samples/a1043-1.out: -------------------------------------------------------------------------------- 1 | YES 2 | 5 7 6 8 11 10 8 -------------------------------------------------------------------------------- /samples/a1043-2.in: -------------------------------------------------------------------------------- 1 | 7 2 | 8 10 11 8 6 7 5 -------------------------------------------------------------------------------- /samples/a1043-2.out: -------------------------------------------------------------------------------- 1 | YES 2 | 11 8 10 7 5 6 8 -------------------------------------------------------------------------------- /samples/a1043-3.in: -------------------------------------------------------------------------------- 1 | 7 2 | 8 6 8 5 10 9 11 -------------------------------------------------------------------------------- /samples/a1043-3.out: -------------------------------------------------------------------------------- 1 | NO -------------------------------------------------------------------------------- /samples/a1044-1.in: -------------------------------------------------------------------------------- 1 | 16 15 2 | 3 2 1 5 4 6 8 7 16 10 15 11 9 12 14 13 -------------------------------------------------------------------------------- /samples/a1044-1.out: -------------------------------------------------------------------------------- 1 | 1-5 2 | 4-6 3 | 7-8 4 | 11-11 -------------------------------------------------------------------------------- /samples/a1044-2.in: -------------------------------------------------------------------------------- 1 | 5 13 2 | 2 4 5 7 9 -------------------------------------------------------------------------------- /samples/a1044-2.out: -------------------------------------------------------------------------------- 1 | 2-4 2 | 4-5 -------------------------------------------------------------------------------- /samples/a1045-1.in: -------------------------------------------------------------------------------- 1 | 6 2 | 5 2 3 1 5 6 3 | 12 2 2 4 1 5 5 6 3 1 1 5 6 -------------------------------------------------------------------------------- /samples/a1045-1.out: -------------------------------------------------------------------------------- 1 | 7 -------------------------------------------------------------------------------- /samples/a1046-1.in: -------------------------------------------------------------------------------- 1 | 5 1 2 4 14 9 2 | 3 3 | 1 3 4 | 2 5 5 | 4 1 -------------------------------------------------------------------------------- /samples/a1046-1.out: -------------------------------------------------------------------------------- 1 | 3 2 | 10 3 | 7 -------------------------------------------------------------------------------- /samples/a1047-1.in: -------------------------------------------------------------------------------- 1 | 10 5 2 | ZOE1 2 4 5 3 | ANN0 3 5 2 1 4 | BOB5 5 3 4 2 1 5 5 | JOE4 1 2 6 | JAY9 4 1 2 5 4 7 | FRA8 3 4 2 5 8 | DON2 2 4 5 9 | AMY7 1 5 10 | KAT3 3 5 4 2 11 | LOR6 4 2 4 1 5 -------------------------------------------------------------------------------- /samples/a1047-1.out: -------------------------------------------------------------------------------- 1 | 1 4 2 | ANN0 3 | BOB5 4 | JAY9 5 | LOR6 6 | 2 7 7 | ANN0 8 | BOB5 9 | FRA8 10 | JAY9 11 | JOE4 12 | KAT3 13 | LOR6 14 | 3 1 15 | BOB5 16 | 4 7 17 | BOB5 18 | DON2 19 | FRA8 20 | JAY9 21 | KAT3 22 | LOR6 23 | ZOE1 24 | 5 9 25 | AMY7 26 | ANN0 27 | BOB5 28 | DON2 29 | FRA8 30 | JAY9 31 | KAT3 32 | LOR6 33 | ZOE1 -------------------------------------------------------------------------------- /samples/a1048-1.in: -------------------------------------------------------------------------------- 1 | 8 15 2 | 1 2 8 7 2 4 11 15 -------------------------------------------------------------------------------- /samples/a1048-1.out: -------------------------------------------------------------------------------- 1 | 4 11 -------------------------------------------------------------------------------- /samples/a1048-2.in: -------------------------------------------------------------------------------- 1 | 7 14 2 | 1 8 7 2 4 11 15 -------------------------------------------------------------------------------- /samples/a1048-2.out: -------------------------------------------------------------------------------- 1 | No Solution -------------------------------------------------------------------------------- /samples/a1049-1.in: -------------------------------------------------------------------------------- 1 | 12 -------------------------------------------------------------------------------- /samples/a1049-1.out: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /samples/a1050-1.in: -------------------------------------------------------------------------------- 1 | They are students. 2 | aeiou -------------------------------------------------------------------------------- /samples/a1050-1.out: -------------------------------------------------------------------------------- 1 | Thy r stdnts. -------------------------------------------------------------------------------- /samples/a1051-1.in: -------------------------------------------------------------------------------- 1 | 5 7 5 2 | 1 2 3 4 5 6 7 3 | 3 2 1 7 5 6 4 4 | 7 6 5 4 3 2 1 5 | 5 6 4 3 7 2 1 6 | 1 7 6 5 4 3 2 -------------------------------------------------------------------------------- /samples/a1051-1.out: -------------------------------------------------------------------------------- 1 | YES 2 | NO 3 | NO 4 | YES 5 | NO -------------------------------------------------------------------------------- /samples/a1052-1.in: -------------------------------------------------------------------------------- 1 | 5 00001 2 | 11111 100 -1 3 | 00001 0 22222 4 | 33333 100000 11111 5 | 12345 -1 33333 6 | 22222 1000 12345 -------------------------------------------------------------------------------- /samples/a1052-1.out: -------------------------------------------------------------------------------- 1 | 5 12345 2 | 12345 -1 00001 3 | 00001 0 11111 4 | 11111 100 22222 5 | 22222 1000 33333 6 | 33333 100000 -1 -------------------------------------------------------------------------------- /samples/a1053-1.in: -------------------------------------------------------------------------------- 1 | 20 9 24 2 | 10 2 4 3 5 10 2 18 9 7 2 2 1 3 12 1 8 6 2 2 3 | 00 4 01 02 03 04 4 | 02 1 05 5 | 04 2 06 07 6 | 03 3 11 12 13 7 | 06 1 09 8 | 07 2 08 10 9 | 16 1 15 10 | 13 3 14 16 17 11 | 17 2 18 19 -------------------------------------------------------------------------------- /samples/a1053-1.out: -------------------------------------------------------------------------------- 1 | 10 5 2 7 2 | 10 4 10 3 | 10 3 3 6 2 4 | 10 3 3 6 2 -------------------------------------------------------------------------------- /samples/a1054-1.in: -------------------------------------------------------------------------------- 1 | 5 3 2 | 0 0 255 16777215 24 3 | 24 24 0 0 24 4 | 24 0 24 24 24 -------------------------------------------------------------------------------- /samples/a1054-1.out: -------------------------------------------------------------------------------- 1 | 24 -------------------------------------------------------------------------------- /samples/a1055-1.in: -------------------------------------------------------------------------------- 1 | 12 4 2 | Zoe_Bill 35 2333 3 | Bob_Volk 24 5888 4 | Anny_Cin 95 999999 5 | Williams 30 -22 6 | Cindy 76 76000 7 | Alice 18 88888 8 | Joe_Mike 32 3222 9 | Michael 5 300000 10 | Rosemary 40 5888 11 | Dobby 24 5888 12 | Billy 24 5888 13 | Nobody 5 0 14 | 4 15 45 15 | 4 30 35 16 | 4 5 95 17 | 1 45 50 -------------------------------------------------------------------------------- /samples/a1055-1.out: -------------------------------------------------------------------------------- 1 | Case #1: 2 | Alice 18 88888 3 | Billy 24 5888 4 | Bob_Volk 24 5888 5 | Dobby 24 5888 6 | Case #2: 7 | Joe_Mike 32 3222 8 | Zoe_Bill 35 2333 9 | Williams 30 -22 10 | Case #3: 11 | Anny_Cin 95 999999 12 | Michael 5 300000 13 | Alice 18 88888 14 | Cindy 76 76000 15 | Case #4: 16 | None -------------------------------------------------------------------------------- /samples/a1056-1.in: -------------------------------------------------------------------------------- 1 | 11 3 2 | 25 18 0 46 37 3 19 22 57 56 10 3 | 6 0 8 7 10 5 9 1 4 2 3 -------------------------------------------------------------------------------- /samples/a1056-1.out: -------------------------------------------------------------------------------- 1 | 5 5 5 2 5 5 5 3 1 3 5 -------------------------------------------------------------------------------- /samples/a1057-1.in: -------------------------------------------------------------------------------- 1 | 17 2 | Pop 3 | PeekMedian 4 | Push 3 5 | PeekMedian 6 | Push 2 7 | PeekMedian 8 | Push 1 9 | PeekMedian 10 | Pop 11 | Pop 12 | Push 5 13 | Push 4 14 | PeekMedian 15 | Pop 16 | Pop 17 | Pop 18 | Pop -------------------------------------------------------------------------------- /samples/a1057-1.out: -------------------------------------------------------------------------------- 1 | Invalid 2 | Invalid 3 | 3 4 | 2 5 | 2 6 | 1 7 | 2 8 | 4 9 | 4 10 | 5 11 | 3 12 | Invalid -------------------------------------------------------------------------------- /samples/a1058-1.in: -------------------------------------------------------------------------------- 1 | 3.2.1 10.16.27 -------------------------------------------------------------------------------- /samples/a1058-1.out: -------------------------------------------------------------------------------- 1 | 14.1.28 -------------------------------------------------------------------------------- /samples/a1059-1.in: -------------------------------------------------------------------------------- 1 | 97532468 -------------------------------------------------------------------------------- /samples/a1059-1.out: -------------------------------------------------------------------------------- 1 | 97532468=2^2*11*17*101*1291 -------------------------------------------------------------------------------- /samples/a1060-1.in: -------------------------------------------------------------------------------- 1 | 3 12300 12358.9 -------------------------------------------------------------------------------- /samples/a1060-1.out: -------------------------------------------------------------------------------- 1 | YES 0.123*10^5 -------------------------------------------------------------------------------- /samples/a1060-2.in: -------------------------------------------------------------------------------- 1 | 3 120 128 -------------------------------------------------------------------------------- /samples/a1060-2.out: -------------------------------------------------------------------------------- 1 | NO 0.120*10^3 0.128*10^3 -------------------------------------------------------------------------------- /samples/a1061-1.in: -------------------------------------------------------------------------------- 1 | 3485djDkxh4hhGE 2 | 2984akDfkkkkggEdsb 3 | s&hgsfdk 4 | d&Hyscvnm -------------------------------------------------------------------------------- /samples/a1061-1.out: -------------------------------------------------------------------------------- 1 | THU 14:04 -------------------------------------------------------------------------------- /samples/a1062-1.in: -------------------------------------------------------------------------------- 1 | 14 60 80 2 | 10000001 64 90 3 | 10000002 90 60 4 | 10000011 85 80 5 | 10000003 85 80 6 | 10000004 80 85 7 | 10000005 82 77 8 | 10000006 83 76 9 | 10000007 90 78 10 | 10000008 75 79 11 | 10000009 59 90 12 | 10000010 88 45 13 | 10000012 80 100 14 | 10000013 90 99 15 | 10000014 66 60 -------------------------------------------------------------------------------- /samples/a1062-1.out: -------------------------------------------------------------------------------- 1 | 12 2 | 10000013 90 99 3 | 10000012 80 100 4 | 10000003 85 80 5 | 10000011 85 80 6 | 10000004 80 85 7 | 10000007 90 78 8 | 10000006 83 76 9 | 10000005 82 77 10 | 10000002 90 60 11 | 10000014 66 60 12 | 10000008 75 79 13 | 10000001 64 90 -------------------------------------------------------------------------------- /samples/a1063-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | 3 99 87 101 3 | 4 87 101 5 87 4 | 7 99 101 18 5 135 18 99 5 | 2 6 | 1 2 7 | 1 3 -------------------------------------------------------------------------------- /samples/a1063-1.out: -------------------------------------------------------------------------------- 1 | 50.0% 2 | 33.3% -------------------------------------------------------------------------------- /samples/a1064-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 1 2 3 4 5 6 7 8 9 0 -------------------------------------------------------------------------------- /samples/a1064-1.out: -------------------------------------------------------------------------------- 1 | 6 3 8 1 5 7 9 0 2 4 -------------------------------------------------------------------------------- /samples/a1065-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | 1 2 3 3 | 2 3 4 4 | 9223372036854775807 -9223372036854775808 0 -------------------------------------------------------------------------------- /samples/a1065-1.out: -------------------------------------------------------------------------------- 1 | Case #1: false 2 | Case #2: true 3 | Case #3: false -------------------------------------------------------------------------------- /samples/a1066-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | 88 70 61 96 120 -------------------------------------------------------------------------------- /samples/a1066-1.out: -------------------------------------------------------------------------------- 1 | 70 -------------------------------------------------------------------------------- /samples/a1067-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 3 5 7 2 6 4 9 0 8 1 -------------------------------------------------------------------------------- /samples/a1067-1.out: -------------------------------------------------------------------------------- 1 | 9 -------------------------------------------------------------------------------- /samples/a1068-1.in: -------------------------------------------------------------------------------- 1 | 8 9 2 | 5 9 8 7 2 3 4 1 -------------------------------------------------------------------------------- /samples/a1068-1.out: -------------------------------------------------------------------------------- 1 | 1 3 5 -------------------------------------------------------------------------------- /samples/a1069-1.in: -------------------------------------------------------------------------------- 1 | 6767 -------------------------------------------------------------------------------- /samples/a1069-1.out: -------------------------------------------------------------------------------- 1 | 7766 - 6677 = 1089 2 | 9810 - 0189 = 9621 3 | 9621 - 1269 = 8352 4 | 8532 - 2358 = 6174 -------------------------------------------------------------------------------- /samples/a1069-2.in: -------------------------------------------------------------------------------- 1 | 2222 -------------------------------------------------------------------------------- /samples/a1069-2.out: -------------------------------------------------------------------------------- 1 | 2222 - 2222 = 0000 -------------------------------------------------------------------------------- /samples/a1070-1.in: -------------------------------------------------------------------------------- 1 | 3 200 2 | 180 150 100 3 | 7.5 7.2 4.5 -------------------------------------------------------------------------------- /samples/a1070-1.out: -------------------------------------------------------------------------------- 1 | 9.45 -------------------------------------------------------------------------------- /samples/a1071-1.in: -------------------------------------------------------------------------------- 1 | Can1: "Can a can can a can? It can!" -------------------------------------------------------------------------------- /samples/a1071-1.out: -------------------------------------------------------------------------------- 1 | can 5 -------------------------------------------------------------------------------- /samples/a1072-1.in: -------------------------------------------------------------------------------- 1 | 4 3 11 5 2 | 1 2 2 3 | 1 4 2 4 | 1 G1 4 5 | 1 G2 3 6 | 2 3 2 7 | 2 G2 1 8 | 3 4 2 9 | 3 G3 2 10 | 4 G1 3 11 | G2 G1 1 12 | G3 G2 2 -------------------------------------------------------------------------------- /samples/a1072-1.out: -------------------------------------------------------------------------------- 1 | G1 2 | 2.0 3.3 -------------------------------------------------------------------------------- /samples/a1072-2.in: -------------------------------------------------------------------------------- 1 | 2 1 2 10 2 | 1 G1 9 3 | 2 G1 20 -------------------------------------------------------------------------------- /samples/a1072-2.out: -------------------------------------------------------------------------------- 1 | No Solution -------------------------------------------------------------------------------- /samples/a1073-1.in: -------------------------------------------------------------------------------- 1 | +1.23400E-03 -------------------------------------------------------------------------------- /samples/a1073-1.out: -------------------------------------------------------------------------------- 1 | 0.00123400 -------------------------------------------------------------------------------- /samples/a1073-2.in: -------------------------------------------------------------------------------- 1 | -1.2E+10 -------------------------------------------------------------------------------- /samples/a1073-2.out: -------------------------------------------------------------------------------- 1 | -12000000000 -------------------------------------------------------------------------------- /samples/a1074-1.in: -------------------------------------------------------------------------------- 1 | 00100 6 4 2 | 00000 4 99999 3 | 00100 1 12309 4 | 68237 6 -1 5 | 33218 3 00000 6 | 99999 5 68237 7 | 12309 2 33218 -------------------------------------------------------------------------------- /samples/a1074-1.out: -------------------------------------------------------------------------------- 1 | 00000 4 33218 2 | 33218 3 12309 3 | 12309 2 00100 4 | 00100 1 99999 5 | 99999 5 68237 6 | 68237 6 -1 -------------------------------------------------------------------------------- /samples/a1075-1.in: -------------------------------------------------------------------------------- 1 | 7 4 20 2 | 20 25 25 30 3 | 00002 2 12 4 | 00007 4 17 5 | 00005 1 19 6 | 00007 2 25 7 | 00005 1 20 8 | 00002 2 2 9 | 00005 1 15 10 | 00001 1 18 11 | 00004 3 25 12 | 00002 2 25 13 | 00005 3 22 14 | 00006 4 -1 15 | 00001 2 18 16 | 00002 1 20 17 | 00004 1 15 18 | 00002 4 18 19 | 00001 3 4 20 | 00001 4 2 21 | 00005 2 -1 22 | 00004 2 0 -------------------------------------------------------------------------------- /samples/a1075-1.out: -------------------------------------------------------------------------------- 1 | 1 00002 63 20 25 - 18 2 | 2 00005 42 20 0 22 - 3 | 2 00007 42 - 25 - 17 4 | 2 00001 42 18 18 4 2 5 | 5 00004 40 15 0 25 - -------------------------------------------------------------------------------- /samples/a1076-1.in: -------------------------------------------------------------------------------- 1 | 7 3 2 | 3 2 3 4 3 | 0 4 | 2 5 6 5 | 2 3 1 6 | 2 3 4 7 | 1 4 8 | 1 5 9 | 2 2 6 -------------------------------------------------------------------------------- /samples/a1076-1.out: -------------------------------------------------------------------------------- 1 | 4 2 | 5 -------------------------------------------------------------------------------- /samples/a1077-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | Itai nyan~ 3 | Ninjin wa iyadanyan~ 4 | uhhh nyan~ -------------------------------------------------------------------------------- /samples/a1077-1.out: -------------------------------------------------------------------------------- 1 | nyan~ -------------------------------------------------------------------------------- /samples/a1077-2.in: -------------------------------------------------------------------------------- 1 | 3 2 | Itai! 3 | Ninjinnwaiyada T_T 4 | T_T -------------------------------------------------------------------------------- /samples/a1077-2.out: -------------------------------------------------------------------------------- 1 | nai -------------------------------------------------------------------------------- /samples/a1078-1.in: -------------------------------------------------------------------------------- 1 | 4 4 2 | 10 6 4 15 -------------------------------------------------------------------------------- /samples/a1078-1.out: -------------------------------------------------------------------------------- 1 | 0 1 4 - -------------------------------------------------------------------------------- /samples/a1079-1.in: -------------------------------------------------------------------------------- 1 | 10 1.80 1.00 2 | 3 2 3 5 3 | 1 9 4 | 1 4 5 | 1 7 6 | 0 7 7 | 2 6 1 8 | 1 8 9 | 0 9 10 | 0 4 11 | 0 3 -------------------------------------------------------------------------------- /samples/a1079-1.out: -------------------------------------------------------------------------------- 1 | 42.4 -------------------------------------------------------------------------------- /samples/a1080-1.in: -------------------------------------------------------------------------------- 1 | 11 6 3 2 | 2 1 2 2 2 3 3 | 100 100 0 1 2 4 | 60 60 2 3 5 5 | 100 90 0 3 4 6 | 90 100 1 2 0 7 | 90 90 5 1 3 8 | 80 90 1 0 2 9 | 80 80 0 1 2 10 | 80 80 0 1 2 11 | 80 70 1 3 2 12 | 70 80 1 2 3 13 | 100 100 0 2 4 -------------------------------------------------------------------------------- /samples/a1080-1.out: -------------------------------------------------------------------------------- 1 | 0 10 2 | 3 3 | 5 6 7 4 | 2 8 5 | 6 | 1 4 -------------------------------------------------------------------------------- /samples/a1081-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | 2/5 4/15 1/30 -2/60 8/3 -------------------------------------------------------------------------------- /samples/a1081-1.out: -------------------------------------------------------------------------------- 1 | 3 1/3 -------------------------------------------------------------------------------- /samples/a1081-2.in: -------------------------------------------------------------------------------- 1 | 2 2 | 4/3 2/3 -------------------------------------------------------------------------------- /samples/a1081-2.out: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /samples/a1081-3.in: -------------------------------------------------------------------------------- 1 | 3 2 | 1/3 -1/6 1/8 -------------------------------------------------------------------------------- /samples/a1081-3.out: -------------------------------------------------------------------------------- 1 | 7/24 -------------------------------------------------------------------------------- /samples/a1082-1.in: -------------------------------------------------------------------------------- 1 | -123456789 -------------------------------------------------------------------------------- /samples/a1082-1.out: -------------------------------------------------------------------------------- 1 | Fu yi Yi er Qian san Bai si Shi wu Wan liu Qian qi Bai ba Shi jiu -------------------------------------------------------------------------------- /samples/a1082-2.in: -------------------------------------------------------------------------------- 1 | 100800 -------------------------------------------------------------------------------- /samples/a1082-2.out: -------------------------------------------------------------------------------- 1 | yi Shi Wan ling ba Bai -------------------------------------------------------------------------------- /samples/a1083-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | Tom CS000001 59 3 | Joe Math990112 89 4 | Mike CS991301 100 5 | Mary EE990830 95 6 | 60 100 -------------------------------------------------------------------------------- /samples/a1083-1.out: -------------------------------------------------------------------------------- 1 | Mike CS991301 2 | Mary EE990830 3 | Joe Math990112 -------------------------------------------------------------------------------- /samples/a1083-2.in: -------------------------------------------------------------------------------- 1 | 2 2 | Jean AA980920 60 3 | Ann CS01 80 4 | 90 95 -------------------------------------------------------------------------------- /samples/a1083-2.out: -------------------------------------------------------------------------------- 1 | NONE -------------------------------------------------------------------------------- /samples/a1084-1.in: -------------------------------------------------------------------------------- 1 | 7_This_is_a_test 2 | _hs_s_a_es -------------------------------------------------------------------------------- /samples/a1084-1.out: -------------------------------------------------------------------------------- 1 | 7TI -------------------------------------------------------------------------------- /samples/a1085-1.in: -------------------------------------------------------------------------------- 1 | 10 8 2 | 2 3 20 4 5 1 6 7 8 9 -------------------------------------------------------------------------------- /samples/a1085-1.out: -------------------------------------------------------------------------------- 1 | 8 -------------------------------------------------------------------------------- /samples/a1086-1.in: -------------------------------------------------------------------------------- 1 | 6 2 | Push 1 3 | Push 2 4 | Push 3 5 | Pop 6 | Pop 7 | Push 4 8 | Pop 9 | Pop 10 | Push 5 11 | Push 6 12 | Pop 13 | Pop -------------------------------------------------------------------------------- /samples/a1086-1.out: -------------------------------------------------------------------------------- 1 | 3 4 2 6 5 1 -------------------------------------------------------------------------------- /samples/a1087-1.in: -------------------------------------------------------------------------------- 1 | 6 7 HZH 2 | ROM 100 3 | PKN 40 4 | GDN 55 5 | PRS 95 6 | BLN 80 7 | ROM GDN 1 8 | BLN ROM 1 9 | HZH PKN 1 10 | PRS ROM 2 11 | BLN HZH 2 12 | PKN GDN 1 13 | HZH PRS 1 -------------------------------------------------------------------------------- /samples/a1087-1.out: -------------------------------------------------------------------------------- 1 | 3 3 195 97 2 | HZH->PRS->ROM -------------------------------------------------------------------------------- /samples/a1088-1.in: -------------------------------------------------------------------------------- 1 | 2/3 -4/2 -------------------------------------------------------------------------------- /samples/a1088-1.out: -------------------------------------------------------------------------------- 1 | 2/3 + (-2) = (-1 1/3) 2 | 2/3 - (-2) = 2 2/3 3 | 2/3 * (-2) = (-1 1/3) 4 | 2/3 / (-2) = (-1/3) -------------------------------------------------------------------------------- /samples/a1088-2.in: -------------------------------------------------------------------------------- 1 | 5/3 0/6 -------------------------------------------------------------------------------- /samples/a1088-2.out: -------------------------------------------------------------------------------- 1 | 1 2/3 + 0 = 1 2/3 2 | 1 2/3 - 0 = 1 2/3 3 | 1 2/3 * 0 = 0 4 | 1 2/3 / 0 = Inf -------------------------------------------------------------------------------- /samples/a1089-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 3 1 2 8 7 5 9 4 6 0 3 | 1 2 3 7 8 5 9 4 6 0 -------------------------------------------------------------------------------- /samples/a1089-1.out: -------------------------------------------------------------------------------- 1 | Insertion Sort 2 | 1 2 3 5 7 8 9 4 6 0 -------------------------------------------------------------------------------- /samples/a1089-2.in: -------------------------------------------------------------------------------- 1 | 10 2 | 3 1 2 8 7 5 9 4 0 6 3 | 1 3 2 8 5 7 4 9 0 6 -------------------------------------------------------------------------------- /samples/a1089-2.out: -------------------------------------------------------------------------------- 1 | Merge Sort 2 | 1 2 3 8 4 5 7 9 0 6 -------------------------------------------------------------------------------- /samples/a1090-1.in: -------------------------------------------------------------------------------- 1 | 9 1.80 1.00 2 | 1 5 4 4 -1 4 5 3 6 -------------------------------------------------------------------------------- /samples/a1090-1.out: -------------------------------------------------------------------------------- 1 | 1.85 2 -------------------------------------------------------------------------------- /samples/a1091-1.in: -------------------------------------------------------------------------------- 1 | 3 4 5 2 2 | 1 1 1 1 3 | 1 1 1 1 4 | 1 1 1 1 5 | 0 0 1 1 6 | 0 0 1 1 7 | 0 0 1 1 8 | 1 0 1 1 9 | 0 1 0 0 10 | 0 0 0 0 11 | 1 0 1 1 12 | 0 0 0 0 13 | 0 0 0 0 14 | 0 0 0 1 15 | 0 0 0 1 16 | 1 0 0 0 -------------------------------------------------------------------------------- /samples/a1091-1.out: -------------------------------------------------------------------------------- 1 | 26 -------------------------------------------------------------------------------- /samples/a1092-1.in: -------------------------------------------------------------------------------- 1 | ppRYYGrrYBR2258 2 | YrR8RrY -------------------------------------------------------------------------------- /samples/a1092-1.out: -------------------------------------------------------------------------------- 1 | Yes 8 -------------------------------------------------------------------------------- /samples/a1092-2.in: -------------------------------------------------------------------------------- 1 | ppRYYGrrYB225 2 | YrR8RrY -------------------------------------------------------------------------------- /samples/a1092-2.out: -------------------------------------------------------------------------------- 1 | No 2 -------------------------------------------------------------------------------- /samples/a1093-1.in: -------------------------------------------------------------------------------- 1 | APPAPT -------------------------------------------------------------------------------- /samples/a1093-1.out: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /samples/a1094-1.in: -------------------------------------------------------------------------------- 1 | 23 13 2 | 21 1 23 3 | 01 4 03 02 04 05 4 | 03 3 06 07 08 5 | 06 2 12 13 6 | 13 1 21 7 | 08 2 15 16 8 | 02 2 09 10 9 | 11 2 19 20 10 | 17 1 22 11 | 05 1 11 12 | 07 1 14 13 | 09 1 17 14 | 10 1 18 -------------------------------------------------------------------------------- /samples/a1094-1.out: -------------------------------------------------------------------------------- 1 | 9 4 -------------------------------------------------------------------------------- /samples/a1095-1.in: -------------------------------------------------------------------------------- 1 | 16 7 2 | JH007BD 18:00:01 in 3 | ZD00001 11:30:08 out 4 | DB8888A 13:00:00 out 5 | ZA3Q625 23:59:50 out 6 | ZA133CH 10:23:00 in 7 | ZD00001 04:09:59 in 8 | JH007BD 05:09:59 in 9 | ZA3Q625 11:42:01 out 10 | JH007BD 05:10:33 in 11 | ZA3Q625 06:30:50 in 12 | JH007BD 12:23:42 out 13 | ZA3Q625 23:55:00 in 14 | JH007BD 12:24:23 out 15 | ZA133CH 17:11:22 out 16 | JH007BD 18:07:01 out 17 | DB8888A 06:30:50 in 18 | 05:10:00 19 | 06:30:50 20 | 11:00:00 21 | 12:23:42 22 | 14:00:00 23 | 18:00:00 24 | 23:59:00 -------------------------------------------------------------------------------- /samples/a1095-1.out: -------------------------------------------------------------------------------- 1 | 1 2 | 4 3 | 5 4 | 2 5 | 1 6 | 0 7 | 1 8 | JH007BD ZD00001 07:20:09 -------------------------------------------------------------------------------- /samples/a1096-1.in: -------------------------------------------------------------------------------- 1 | 630 -------------------------------------------------------------------------------- /samples/a1096-1.out: -------------------------------------------------------------------------------- 1 | 3 2 | 5*6*7 -------------------------------------------------------------------------------- /samples/a1097-1.in: -------------------------------------------------------------------------------- 1 | 00100 5 2 | 99999 -7 87654 3 | 23854 -15 00000 4 | 87654 15 -1 5 | 00000 -15 99999 6 | 00100 21 23854 -------------------------------------------------------------------------------- /samples/a1097-1.out: -------------------------------------------------------------------------------- 1 | 00100 21 23854 2 | 23854 -15 99999 3 | 99999 -7 -1 4 | 00000 -15 87654 5 | 87654 15 -1 -------------------------------------------------------------------------------- /samples/a1098-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 3 1 2 8 7 5 9 4 6 0 3 | 1 2 3 7 8 5 9 4 6 0 -------------------------------------------------------------------------------- /samples/a1098-1.out: -------------------------------------------------------------------------------- 1 | Insertion Sort 2 | 1 2 3 5 7 8 9 4 6 0 -------------------------------------------------------------------------------- /samples/a1099-1.in: -------------------------------------------------------------------------------- 1 | 9 2 | 1 6 3 | 2 3 4 | -1 -1 5 | -1 4 6 | 5 -1 7 | -1 -1 8 | 7 -1 9 | -1 8 10 | -1 -1 11 | 73 45 11 58 82 25 67 38 42 -------------------------------------------------------------------------------- /samples/a1099-1.out: -------------------------------------------------------------------------------- 1 | 58 25 82 11 38 67 45 73 42 -------------------------------------------------------------------------------- /samples/a1100-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 29 3 | 5 4 | elo nov 5 | tam -------------------------------------------------------------------------------- /samples/a1100-1.out: -------------------------------------------------------------------------------- 1 | hel mar 2 | may 3 | 115 4 | 13 -------------------------------------------------------------------------------- /samples/a1101-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | 1 3 2 4 5 3 | -------------------------------------------------------------------------------- /samples/a1101-1.out: -------------------------------------------------------------------------------- 1 | 3 2 | 1 4 5 3 | -------------------------------------------------------------------------------- /samples/a1102-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | 1 - 3 | - - 4 | 0 - 5 | 2 7 6 | - - 7 | - - 8 | 5 - 9 | 4 6 -------------------------------------------------------------------------------- /samples/a1102-1.out: -------------------------------------------------------------------------------- 1 | 3 7 2 6 4 0 5 1 2 | 6 5 7 4 3 2 0 1 -------------------------------------------------------------------------------- /samples/a1103-1.in: -------------------------------------------------------------------------------- 1 | 169 5 2 -------------------------------------------------------------------------------- /samples/a1103-1.out: -------------------------------------------------------------------------------- 1 | 169 = 6^2 + 6^2 + 6^2 + 6^2 + 5^2 -------------------------------------------------------------------------------- /samples/a1103-2.in: -------------------------------------------------------------------------------- 1 | 169 167 3 -------------------------------------------------------------------------------- /samples/a1103-2.out: -------------------------------------------------------------------------------- 1 | Impossible -------------------------------------------------------------------------------- /samples/a1104-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 0.1 0.2 0.3 0.4 -------------------------------------------------------------------------------- /samples/a1104-1.out: -------------------------------------------------------------------------------- 1 | 5.00 -------------------------------------------------------------------------------- /samples/a1105-1.in: -------------------------------------------------------------------------------- 1 | 12 2 | 37 76 20 98 76 42 53 95 60 81 58 93 -------------------------------------------------------------------------------- /samples/a1105-1.out: -------------------------------------------------------------------------------- 1 | 98 95 93 2 | 42 37 81 3 | 53 20 76 4 | 58 60 76 -------------------------------------------------------------------------------- /samples/a1106-1.in: -------------------------------------------------------------------------------- 1 | 10 1.80 1.00 2 | 3 2 3 5 3 | 1 9 4 | 1 4 5 | 1 7 6 | 0 7 | 2 6 1 8 | 1 8 9 | 0 10 | 0 11 | 0 -------------------------------------------------------------------------------- /samples/a1106-1.out: -------------------------------------------------------------------------------- 1 | 1.8362 2 -------------------------------------------------------------------------------- /samples/a1107-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | 3: 2 7 10 3 | 1: 4 4 | 2: 5 3 5 | 1: 4 6 | 1: 3 7 | 1: 4 8 | 4: 6 8 1 5 9 | 1: 4 -------------------------------------------------------------------------------- /samples/a1107-1.out: -------------------------------------------------------------------------------- 1 | 3 2 | 4 3 1 -------------------------------------------------------------------------------- /samples/a1108-1.in: -------------------------------------------------------------------------------- 1 | 7 2 | 5 -3.2 aaa 9999 2.3.4 7.123 2.35 -------------------------------------------------------------------------------- /samples/a1108-1.out: -------------------------------------------------------------------------------- 1 | ERROR: aaa is not a legal number 2 | ERROR: 9999 is not a legal number 3 | ERROR: 2.3.4 is not a legal number 4 | ERROR: 7.123 is not a legal number 5 | The average of 3 numbers is 1.38 -------------------------------------------------------------------------------- /samples/a1108-2.in: -------------------------------------------------------------------------------- 1 | 2 2 | aaa -9999 -------------------------------------------------------------------------------- /samples/a1108-2.out: -------------------------------------------------------------------------------- 1 | ERROR: aaa is not a legal number 2 | ERROR: -9999 is not a legal number 3 | The average of 0 numbers is Undefined -------------------------------------------------------------------------------- /samples/a1109-1.in: -------------------------------------------------------------------------------- 1 | 10 3 2 | Tom 188 3 | Mike 170 4 | Eva 168 5 | Tim 160 6 | Joe 190 7 | Ann 168 8 | Bob 175 9 | Nick 186 10 | Amy 160 11 | John 159 -------------------------------------------------------------------------------- /samples/a1109-1.out: -------------------------------------------------------------------------------- 1 | Bob Tom Joe Nick 2 | Ann Mike Eva 3 | Tim Amy John -------------------------------------------------------------------------------- /samples/a1110-1.in: -------------------------------------------------------------------------------- 1 | 9 2 | 7 8 3 | - - 4 | - - 5 | - - 6 | 0 1 7 | 2 3 8 | 4 5 9 | - - 10 | - - -------------------------------------------------------------------------------- /samples/a1110-1.out: -------------------------------------------------------------------------------- 1 | YES 8 -------------------------------------------------------------------------------- /samples/a1110-2.in: -------------------------------------------------------------------------------- 1 | 8 2 | - - 3 | 4 5 4 | 0 6 5 | - - 6 | 2 3 7 | - 7 8 | - - 9 | - - -------------------------------------------------------------------------------- /samples/a1110-2.out: -------------------------------------------------------------------------------- 1 | NO 1 -------------------------------------------------------------------------------- /samples/a1111-1.in: -------------------------------------------------------------------------------- 1 | 10 15 2 | 0 1 0 1 1 3 | 8 0 0 1 1 4 | 4 8 1 1 1 5 | 3 4 0 3 2 6 | 3 9 1 4 1 7 | 0 6 0 1 1 8 | 7 5 1 2 1 9 | 8 5 1 2 1 10 | 2 3 0 2 2 11 | 2 1 1 1 1 12 | 1 3 0 3 1 13 | 1 4 0 1 1 14 | 9 7 1 3 1 15 | 5 1 0 5 2 16 | 6 5 1 1 2 17 | 3 5 -------------------------------------------------------------------------------- /samples/a1111-1.out: -------------------------------------------------------------------------------- 1 | Distance = 6: 3 -> 4 -> 8 -> 5 2 | Time = 3: 3 -> 1 -> 5 -------------------------------------------------------------------------------- /samples/a1111-2.in: -------------------------------------------------------------------------------- 1 | 7 9 2 | 0 4 1 1 1 3 | 1 6 1 1 3 4 | 2 6 1 1 1 5 | 2 5 1 2 2 6 | 3 0 0 1 1 7 | 3 1 1 1 3 8 | 3 2 1 1 2 9 | 4 5 0 2 2 10 | 6 5 1 1 2 11 | 3 5 -------------------------------------------------------------------------------- /samples/a1111-2.out: -------------------------------------------------------------------------------- 1 | Distance = 3; Time = 4: 3 -> 2 -> 5 -------------------------------------------------------------------------------- /samples/a1112-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | caseee1__thiiis_iiisss_a_teeeeeest -------------------------------------------------------------------------------- /samples/a1112-1.out: -------------------------------------------------------------------------------- 1 | ei 2 | case1__this_isss_a_teest -------------------------------------------------------------------------------- /samples/a1113-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 23 8 10 99 46 2333 46 1 666 555 -------------------------------------------------------------------------------- /samples/a1113-1.out: -------------------------------------------------------------------------------- 1 | 0 3611 -------------------------------------------------------------------------------- /samples/a1113-2.in: -------------------------------------------------------------------------------- 1 | 13 2 | 110 79 218 69 3721 100 29 135 2 6 13 5188 85 -------------------------------------------------------------------------------- /samples/a1113-2.out: -------------------------------------------------------------------------------- 1 | 1 9359 -------------------------------------------------------------------------------- /samples/a1114-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 6666 5551 5552 1 7777 1 100 3 | 1234 5678 9012 1 0002 2 300 4 | 8888 -1 -1 0 1 1000 5 | 2468 0001 0004 1 2222 1 500 6 | 7777 6666 -1 0 2 300 7 | 3721 -1 -1 1 2333 2 150 8 | 9012 -1 -1 3 1236 1235 1234 1 100 9 | 1235 5678 9012 0 1 50 10 | 2222 1236 2468 2 6661 6662 1 300 11 | 2333 -1 3721 3 6661 6662 6663 1 100 -------------------------------------------------------------------------------- /samples/a1114-1.out: -------------------------------------------------------------------------------- 1 | 3 2 | 8888 1 1.000 1000.000 3 | 0001 15 0.600 100.000 4 | 5551 4 0.750 100.000 -------------------------------------------------------------------------------- /samples/a1115-1.in: -------------------------------------------------------------------------------- 1 | 9 2 | 25 30 42 16 20 20 35 -5 28 -------------------------------------------------------------------------------- /samples/a1115-1.out: -------------------------------------------------------------------------------- 1 | 2 + 4 = 6 -------------------------------------------------------------------------------- /samples/a1116-1.in: -------------------------------------------------------------------------------- 1 | 6 2 | 1111 3 | 6666 4 | 8888 5 | 1234 6 | 5555 7 | 0001 8 | 6 9 | 8888 10 | 0001 11 | 1111 12 | 2222 13 | 8888 14 | 2222 -------------------------------------------------------------------------------- /samples/a1116-1.out: -------------------------------------------------------------------------------- 1 | 8888: Minion 2 | 0001: Chocolate 3 | 1111: Mystery Award 4 | 2222: Are you kidding? 5 | 8888: Checked 6 | 2222: Are you kidding? -------------------------------------------------------------------------------- /samples/a1117-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 6 7 6 9 3 10 8 2 7 8 -------------------------------------------------------------------------------- /samples/a1117-1.out: -------------------------------------------------------------------------------- 1 | 6 -------------------------------------------------------------------------------- /samples/a1118-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 3 10 1 2 3 | 2 3 4 4 | 4 1 5 7 8 5 | 3 9 6 4 6 | 2 7 | 10 5 8 | 3 7 -------------------------------------------------------------------------------- /samples/a1118-1.out: -------------------------------------------------------------------------------- 1 | 2 10 2 | Yes 3 | No -------------------------------------------------------------------------------- /samples/a1119-1.in: -------------------------------------------------------------------------------- 1 | 7 2 | 1 2 3 4 6 7 5 3 | 2 6 7 4 5 3 1 -------------------------------------------------------------------------------- /samples/a1119-1.out: -------------------------------------------------------------------------------- 1 | Yes 2 | 2 1 6 4 7 3 5 -------------------------------------------------------------------------------- /samples/a1119-2.in: -------------------------------------------------------------------------------- 1 | 4 2 | 1 2 3 4 3 | 2 4 3 1 -------------------------------------------------------------------------------- /samples/a1119-2.out: -------------------------------------------------------------------------------- 1 | No 2 | 2 1 3 4 -------------------------------------------------------------------------------- /samples/a1120-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | 123 899 51 998 27 33 36 12 -------------------------------------------------------------------------------- /samples/a1120-1.out: -------------------------------------------------------------------------------- 1 | 4 2 | 3 6 9 26 -------------------------------------------------------------------------------- /samples/a1121-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | 11111 22222 3 | 33333 44444 4 | 55555 66666 5 | 7 6 | 55555 44444 10000 88888 22222 11111 23333 -------------------------------------------------------------------------------- /samples/a1121-1.out: -------------------------------------------------------------------------------- 1 | 5 2 | 10000 23333 44444 55555 88888 -------------------------------------------------------------------------------- /samples/a1122-1.in: -------------------------------------------------------------------------------- 1 | 6 10 2 | 6 2 3 | 3 4 4 | 1 5 5 | 2 5 6 | 3 1 7 | 4 1 8 | 1 6 9 | 6 3 10 | 1 2 11 | 4 5 12 | 6 13 | 7 5 1 4 3 6 2 5 14 | 6 5 1 4 3 6 2 15 | 9 6 2 1 6 3 4 5 2 6 16 | 4 1 2 5 1 17 | 7 6 1 3 4 5 2 6 18 | 7 6 1 2 5 4 3 1 -------------------------------------------------------------------------------- /samples/a1122-1.out: -------------------------------------------------------------------------------- 1 | YES 2 | NO 3 | NO 4 | NO 5 | YES 6 | NO -------------------------------------------------------------------------------- /samples/a1123-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | 88 70 61 63 65 -------------------------------------------------------------------------------- /samples/a1123-1.out: -------------------------------------------------------------------------------- 1 | 70 63 88 61 65 2 | YES -------------------------------------------------------------------------------- /samples/a1123-2.in: -------------------------------------------------------------------------------- 1 | 8 2 | 88 70 61 96 120 90 65 68 -------------------------------------------------------------------------------- /samples/a1123-2.out: -------------------------------------------------------------------------------- 1 | 88 65 96 61 70 90 120 68 2 | NO -------------------------------------------------------------------------------- /samples/a1124-1.in: -------------------------------------------------------------------------------- 1 | 9 3 2 2 | Imgonnawin! 3 | PickMe 4 | PickMeMeMeee 5 | LookHere 6 | Imgonnawin! 7 | TryAgainAgain 8 | TryAgainAgain 9 | Imgonnawin! 10 | TryAgainAgain -------------------------------------------------------------------------------- /samples/a1124-1.out: -------------------------------------------------------------------------------- 1 | PickMe 2 | Imgonnawin! 3 | TryAgainAgain -------------------------------------------------------------------------------- /samples/a1124-2.in: -------------------------------------------------------------------------------- 1 | 2 3 5 2 | Imgonnawin! 3 | PickMe -------------------------------------------------------------------------------- /samples/a1124-2.out: -------------------------------------------------------------------------------- 1 | Keep going... -------------------------------------------------------------------------------- /samples/a1125-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | 10 15 12 3 4 13 1 15 -------------------------------------------------------------------------------- /samples/a1125-1.out: -------------------------------------------------------------------------------- 1 | 14 -------------------------------------------------------------------------------- /samples/a1126-1.in: -------------------------------------------------------------------------------- 1 | 7 12 2 | 5 7 3 | 1 2 4 | 1 3 5 | 2 3 6 | 2 4 7 | 3 4 8 | 5 2 9 | 7 6 10 | 6 3 11 | 4 5 12 | 6 4 13 | 5 6 -------------------------------------------------------------------------------- /samples/a1126-1.out: -------------------------------------------------------------------------------- 1 | 2 4 4 4 4 4 2 2 | Eulerian -------------------------------------------------------------------------------- /samples/a1126-2.in: -------------------------------------------------------------------------------- 1 | 6 10 2 | 1 2 3 | 1 3 4 | 2 3 5 | 2 4 6 | 3 4 7 | 5 2 8 | 6 3 9 | 4 5 10 | 6 4 11 | 5 6 -------------------------------------------------------------------------------- /samples/a1126-2.out: -------------------------------------------------------------------------------- 1 | 2 4 4 4 3 3 2 | Semi-Eulerian -------------------------------------------------------------------------------- /samples/a1126-3.in: -------------------------------------------------------------------------------- 1 | 5 8 2 | 1 2 3 | 2 5 4 | 5 4 5 | 4 1 6 | 1 3 7 | 3 2 8 | 3 4 9 | 5 3 -------------------------------------------------------------------------------- /samples/a1126-3.out: -------------------------------------------------------------------------------- 1 | 3 3 4 3 3 2 | Non-Eulerian -------------------------------------------------------------------------------- /samples/a1127-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | 12 11 20 17 1 15 8 5 3 | 12 20 17 11 15 8 5 1 -------------------------------------------------------------------------------- /samples/a1127-1.out: -------------------------------------------------------------------------------- 1 | 1 11 5 8 17 12 20 15 -------------------------------------------------------------------------------- /samples/a1128-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 8 4 6 8 2 7 1 3 5 3 | 9 4 6 7 2 8 1 9 5 3 4 | 6 1 5 2 6 4 3 5 | 5 1 3 5 2 4 -------------------------------------------------------------------------------- /samples/a1128-1.out: -------------------------------------------------------------------------------- 1 | YES 2 | NO 3 | NO 4 | YES -------------------------------------------------------------------------------- /samples/a1129-1.in: -------------------------------------------------------------------------------- 1 | 12 3 2 | 3 5 7 5 5 3 2 1 8 3 8 12 -------------------------------------------------------------------------------- /samples/a1129-1.out: -------------------------------------------------------------------------------- 1 | 5: 3 2 | 7: 3 5 3 | 5: 3 5 7 4 | 5: 5 3 7 5 | 3: 5 3 7 6 | 2: 5 3 7 7 | 1: 5 3 2 8 | 8: 5 3 1 9 | 3: 5 3 1 10 | 8: 3 5 1 11 | 12: 3 5 8 -------------------------------------------------------------------------------- /samples/a1130-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | * 8 7 3 | a -1 -1 4 | * 4 1 5 | + 2 5 6 | b -1 -1 7 | d -1 -1 8 | - -1 6 9 | c -1 -1 -------------------------------------------------------------------------------- /samples/a1130-1.out: -------------------------------------------------------------------------------- 1 | (a+b)*(c*(-d)) -------------------------------------------------------------------------------- /samples/a1130-2.in: -------------------------------------------------------------------------------- 1 | 8 2 | 2.35 -1 -1 3 | * 6 1 4 | - -1 4 5 | % 7 8 6 | + 2 3 7 | a -1 -1 8 | str -1 -1 9 | 871 -1 -1 -------------------------------------------------------------------------------- /samples/a1130-2.out: -------------------------------------------------------------------------------- 1 | (a*2.35)+(-(str%871)) -------------------------------------------------------------------------------- /samples/a1131-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 7 1001 3212 1003 1204 1005 1306 7797 3 | 9 9988 2333 1204 2006 2005 2004 2003 2302 2001 4 | 13 3011 3812 3013 3001 1306 3003 2333 3066 3212 3008 2302 3010 3011 5 | 4 6666 8432 4011 1306 6 | 3 7 | 3011 3013 8 | 6666 2001 9 | 2004 3001 -------------------------------------------------------------------------------- /samples/a1131-1.out: -------------------------------------------------------------------------------- 1 | 2 2 | Take Line#3 from 3011 to 3013. 3 | 10 4 | Take Line#4 from 6666 to 1306. 5 | Take Line#3 from 1306 to 2302. 6 | Take Line#2 from 2302 to 2001. 7 | 6 8 | Take Line#2 from 2004 to 1204. 9 | Take Line#1 from 1204 to 1306. 10 | Take Line#3 from 1306 to 3001. -------------------------------------------------------------------------------- /samples/a1132-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | 167334 3 | 2333 4 | 12345678 -------------------------------------------------------------------------------- /samples/a1132-1.out: -------------------------------------------------------------------------------- 1 | Yes 2 | No 3 | No -------------------------------------------------------------------------------- /samples/a1133-1.in: -------------------------------------------------------------------------------- 1 | 00100 9 10 2 | 23333 10 27777 3 | 00000 0 99999 4 | 00100 18 12309 5 | 68237 -6 23333 6 | 33218 -4 00000 7 | 48652 -2 -1 8 | 99999 5 68237 9 | 27777 11 48652 10 | 12309 7 33218 -------------------------------------------------------------------------------- /samples/a1133-1.out: -------------------------------------------------------------------------------- 1 | 33218 -4 68237 2 | 68237 -6 48652 3 | 48652 -2 12309 4 | 12309 7 00000 5 | 00000 0 99999 6 | 99999 5 23333 7 | 23333 10 00100 8 | 00100 18 27777 9 | 27777 11 -1 -------------------------------------------------------------------------------- /samples/a1134-1.in: -------------------------------------------------------------------------------- 1 | 10 11 2 | 8 7 3 | 6 8 4 | 4 5 5 | 8 4 6 | 8 1 7 | 1 2 8 | 1 4 9 | 9 8 10 | 9 1 11 | 1 0 12 | 2 4 13 | 5 14 | 4 0 3 8 4 15 | 6 6 1 7 5 4 9 16 | 3 1 8 4 17 | 2 2 8 18 | 7 9 8 7 6 5 4 2 -------------------------------------------------------------------------------- /samples/a1134-1.out: -------------------------------------------------------------------------------- 1 | No 2 | Yes 3 | Yes 4 | No 5 | No -------------------------------------------------------------------------------- /samples/a1135-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | 9 3 | 7 -2 1 5 -4 -11 8 14 -15 4 | 9 5 | 11 -2 1 -7 5 -4 8 14 -15 6 | 8 7 | 10 -7 5 -6 8 15 -11 17 -------------------------------------------------------------------------------- /samples/a1135-1.out: -------------------------------------------------------------------------------- 1 | Yes 2 | No 3 | No -------------------------------------------------------------------------------- /samples/a1136-1.in: -------------------------------------------------------------------------------- 1 | 97152 -------------------------------------------------------------------------------- /samples/a1136-1.out: -------------------------------------------------------------------------------- 1 | 97152 + 25179 = 122331 2 | 122331 + 133221 = 255552 3 | 255552 is a palindromic number. -------------------------------------------------------------------------------- /samples/a1136-2.in: -------------------------------------------------------------------------------- 1 | 196 -------------------------------------------------------------------------------- /samples/a1136-2.out: -------------------------------------------------------------------------------- 1 | 196 + 691 = 887 2 | 887 + 788 = 1675 3 | 1675 + 5761 = 7436 4 | 7436 + 6347 = 13783 5 | 13783 + 38731 = 52514 6 | 52514 + 41525 = 94039 7 | 94039 + 93049 = 187088 8 | 187088 + 880781 = 1067869 9 | 1067869 + 9687601 = 10755470 10 | 10755470 + 07455701 = 18211171 11 | Not found in 10 iterations. -------------------------------------------------------------------------------- /samples/a1137-1.in: -------------------------------------------------------------------------------- 1 | 6 6 7 2 | 01234 880 3 | a1903 199 4 | ydjh2 200 5 | wehu8 300 6 | dx86w 220 7 | missing 400 8 | ydhfu77 99 9 | wehu8 55 10 | ydjh2 98 11 | dx86w 88 12 | a1903 86 13 | 01234 39 14 | ydhfu77 88 15 | a1903 66 16 | 01234 58 17 | wehu8 84 18 | ydjh2 82 19 | missing 99 20 | dx86w 81 -------------------------------------------------------------------------------- /samples/a1137-1.out: -------------------------------------------------------------------------------- 1 | missing 400 -1 99 99 2 | ydjh2 200 98 82 88 3 | dx86w 220 88 81 84 4 | wehu8 300 55 84 84 -------------------------------------------------------------------------------- /samples/a1138-1.in: -------------------------------------------------------------------------------- 1 | 7 2 | 1 2 3 4 5 6 7 3 | 2 3 1 5 4 7 6 -------------------------------------------------------------------------------- /samples/a1138-1.out: -------------------------------------------------------------------------------- 1 | 3 -------------------------------------------------------------------------------- /samples/a1139-1.in: -------------------------------------------------------------------------------- 1 | 10 18 2 | -2001 1001 3 | -2002 -2001 4 | 1004 1001 5 | -2004 -2001 6 | -2003 1005 7 | 1005 -2001 8 | 1001 -2003 9 | 1002 1001 10 | 1002 -2004 11 | -2004 1001 12 | 1003 -2002 13 | -2003 1003 14 | 1004 -2002 15 | -2001 -2003 16 | 1001 1003 17 | 1003 -2001 18 | 1002 -2001 19 | -2002 -2003 20 | 5 21 | 1001 -2001 22 | -2003 1001 23 | 1005 -2001 24 | -2002 -2004 25 | 1111 -2003 -------------------------------------------------------------------------------- /samples/a1139-1.out: -------------------------------------------------------------------------------- 1 | 4 2 | 1002 2004 3 | 1003 2002 4 | 1003 2003 5 | 1004 2002 6 | 4 7 | 2001 1002 8 | 2001 1003 9 | 2002 1003 10 | 2002 1004 11 | 0 12 | 1 13 | 2003 2001 14 | 0 -------------------------------------------------------------------------------- /samples/a1140-1.in: -------------------------------------------------------------------------------- 1 | 1 8 -------------------------------------------------------------------------------- /samples/a1140-1.out: -------------------------------------------------------------------------------- 1 | 1123123111 -------------------------------------------------------------------------------- /samples/a1141-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | A57908 85 Au 3 | B57908 54 LanX 4 | A37487 60 au 5 | T28374 67 CMU 6 | T32486 24 hypu 7 | A66734 92 cmu 8 | B76378 71 AU 9 | A47780 45 lanx 10 | A72809 100 pku 11 | A03274 45 hypu -------------------------------------------------------------------------------- /samples/a1141-1.out: -------------------------------------------------------------------------------- 1 | 5 2 | 1 cmu 192 2 3 | 1 au 192 3 4 | 3 pku 100 1 5 | 4 hypu 81 2 6 | 4 lanx 81 2 -------------------------------------------------------------------------------- /samples/a1142-1.in: -------------------------------------------------------------------------------- 1 | 8 10 2 | 5 6 3 | 7 8 4 | 6 4 5 | 3 6 6 | 4 5 7 | 2 3 8 | 8 2 9 | 2 7 10 | 5 3 11 | 3 4 12 | 6 13 | 4 5 4 3 6 14 | 3 2 8 7 15 | 2 2 3 16 | 1 1 17 | 3 4 3 6 18 | 3 3 2 1 -------------------------------------------------------------------------------- /samples/a1142-1.out: -------------------------------------------------------------------------------- 1 | Yes 2 | Yes 3 | Yes 4 | Yes 5 | Not Maximal 6 | Not a Clique -------------------------------------------------------------------------------- /samples/a1143-1.in: -------------------------------------------------------------------------------- 1 | 6 8 2 | 6 3 1 2 5 4 8 7 3 | 2 5 4 | 8 7 5 | 1 9 6 | 12 -3 7 | 0 8 8 | 99 99 -------------------------------------------------------------------------------- /samples/a1143-1.out: -------------------------------------------------------------------------------- 1 | LCA of 2 and 5 is 3. 2 | 8 is an ancestor of 7. 3 | ERROR: 9 is not found. 4 | ERROR: 12 and -3 are not found. 5 | ERROR: 0 is not found. 6 | ERROR: 99 and 99 are not found. -------------------------------------------------------------------------------- /samples/a1144-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 5 -25 9 6 1 3 4 2 5 17 -------------------------------------------------------------------------------- /samples/a1144-1.out: -------------------------------------------------------------------------------- 1 | 7 -------------------------------------------------------------------------------- /samples/a1145-1.in: -------------------------------------------------------------------------------- 1 | 4 5 4 2 | 10 6 4 15 11 3 | 11 4 15 2 -------------------------------------------------------------------------------- /samples/a1145-1.out: -------------------------------------------------------------------------------- 1 | 15 cannot be inserted. 2 | 2.8 -------------------------------------------------------------------------------- /samples/a1146-1.in: -------------------------------------------------------------------------------- 1 | 6 8 2 | 1 2 3 | 1 3 4 | 5 2 5 | 5 4 6 | 2 3 7 | 2 6 8 | 3 4 9 | 6 4 10 | 6 11 | 5 2 3 6 4 1 12 | 1 5 2 3 6 4 13 | 5 1 2 6 3 4 14 | 5 1 2 3 6 4 15 | 5 2 1 6 3 4 16 | 1 2 3 4 5 6 17 | -------------------------------------------------------------------------------- /samples/a1146-1.out: -------------------------------------------------------------------------------- 1 | 0 4 5 2 | -------------------------------------------------------------------------------- /samples/a1147-1.in: -------------------------------------------------------------------------------- 1 | 3 8 2 | 98 72 86 60 65 12 23 50 3 | 8 38 25 58 52 82 70 60 4 | 10 28 15 12 34 9 8 56 -------------------------------------------------------------------------------- /samples/a1147-1.out: -------------------------------------------------------------------------------- 1 | Max Heap 2 | 50 60 65 72 12 23 86 98 3 | Min Heap 4 | 60 58 52 38 82 70 25 8 5 | Not Heap 6 | 56 12 34 28 9 8 15 10 -------------------------------------------------------------------------------- /samples/a1148-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | -2 3 | +3 4 | -4 5 | +5 6 | +4 -------------------------------------------------------------------------------- /samples/a1148-1.out: -------------------------------------------------------------------------------- 1 | 1 4 -------------------------------------------------------------------------------- /samples/a1148-2.in: -------------------------------------------------------------------------------- 1 | 6 2 | +6 3 | +3 4 | +1 5 | -5 6 | -2 7 | +4 -------------------------------------------------------------------------------- /samples/a1148-2.out: -------------------------------------------------------------------------------- 1 | 1 5 -------------------------------------------------------------------------------- /samples/a1148-3.in: -------------------------------------------------------------------------------- 1 | 5 2 | -2 3 | -3 4 | -4 5 | -5 6 | -1 -------------------------------------------------------------------------------- /samples/a1148-3.out: -------------------------------------------------------------------------------- 1 | No Solution -------------------------------------------------------------------------------- /samples/a1149-1.in: -------------------------------------------------------------------------------- 1 | 6 3 2 | 20001 20002 3 | 20003 20004 4 | 20005 20006 5 | 20003 20001 6 | 20005 20004 7 | 20004 20006 8 | 4 00001 20004 00002 20003 9 | 5 98823 20002 20003 20006 10010 10 | 3 12345 67890 23333 -------------------------------------------------------------------------------- /samples/a1149-1.out: -------------------------------------------------------------------------------- 1 | No 2 | Yes 3 | Yes -------------------------------------------------------------------------------- /samples/a1150-1.in: -------------------------------------------------------------------------------- 1 | 6 10 2 | 6 2 1 3 | 3 4 1 4 | 1 5 1 5 | 2 5 1 6 | 3 1 8 7 | 4 1 6 8 | 1 6 1 9 | 6 3 1 10 | 1 2 1 11 | 4 5 1 12 | 7 13 | 7 5 1 4 3 6 2 5 14 | 7 6 1 3 4 5 2 6 15 | 6 5 1 4 3 6 2 16 | 9 6 2 1 6 3 4 5 2 6 17 | 4 1 2 5 1 18 | 7 6 1 2 5 4 3 1 19 | 7 6 3 2 5 4 1 6 -------------------------------------------------------------------------------- /samples/a1150-1.out: -------------------------------------------------------------------------------- 1 | Path 1: 11 (TS simple cycle) 2 | Path 2: 13 (TS simple cycle) 3 | Path 3: 10 (Not a TS cycle) 4 | Path 4: 8 (TS cycle) 5 | Path 5: 3 (Not a TS cycle) 6 | Path 6: 13 (Not a TS cycle) 7 | Path 7: NA (Not a TS cycle) 8 | Shortest Dist(4) = 8 -------------------------------------------------------------------------------- /samples/a1151-1.in: -------------------------------------------------------------------------------- 1 | 6 8 2 | 7 2 3 4 6 5 1 8 3 | 5 3 7 2 6 4 8 1 4 | 2 6 5 | 8 1 6 | 7 9 7 | 12 -3 8 | 0 8 9 | 99 99 -------------------------------------------------------------------------------- /samples/a1151-1.out: -------------------------------------------------------------------------------- 1 | LCA of 2 and 6 is 3. 2 | 8 is an ancestor of 1. 3 | ERROR: 9 is not found. 4 | ERROR: 12 and -3 are not found. 5 | ERROR: 0 is not found. 6 | ERROR: 99 and 99 are not found. -------------------------------------------------------------------------------- /samples/a1152-1.in: -------------------------------------------------------------------------------- 1 | 20 5 2 | 23654987725541023819 -------------------------------------------------------------------------------- /samples/a1152-1.out: -------------------------------------------------------------------------------- 1 | 49877 -------------------------------------------------------------------------------- /samples/a1152-2.in: -------------------------------------------------------------------------------- 1 | 10 3 2 | 2468024680 -------------------------------------------------------------------------------- /samples/a1152-2.out: -------------------------------------------------------------------------------- 1 | 404 -------------------------------------------------------------------------------- /samples/a1153-1.in: -------------------------------------------------------------------------------- 1 | 8 4 2 | B123180908127 99 3 | B102180908003 86 4 | A112180318002 98 5 | T107150310127 62 6 | A107180908108 100 7 | T123180908010 78 8 | B112160918035 88 9 | A107180908021 98 10 | 1 A 11 | 2 107 12 | 3 180908 13 | 2 999 -------------------------------------------------------------------------------- /samples/a1153-1.out: -------------------------------------------------------------------------------- 1 | Case 1: 1 A 2 | A107180908108 100 3 | A107180908021 98 4 | A112180318002 98 5 | Case 2: 2 107 6 | 3 260 7 | Case 3: 3 180908 8 | 107 2 9 | 123 2 10 | 102 1 11 | Case 4: 2 999 12 | NA -------------------------------------------------------------------------------- /samples/a1154-1.in: -------------------------------------------------------------------------------- 1 | 10 11 2 | 8 7 3 | 6 8 4 | 4 5 5 | 8 4 6 | 8 1 7 | 1 2 8 | 1 4 9 | 9 8 10 | 9 1 11 | 1 0 12 | 2 4 13 | 4 14 | 0 1 0 1 4 1 0 1 3 0 15 | 0 1 0 1 4 1 0 1 0 0 16 | 8 1 0 1 4 1 0 5 3 0 17 | 1 2 3 4 5 6 7 8 8 9 -------------------------------------------------------------------------------- /samples/a1154-1.out: -------------------------------------------------------------------------------- 1 | 4-coloring 2 | No 3 | 6-coloring 4 | No -------------------------------------------------------------------------------- /samples/a1155-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | 98 72 86 60 65 12 23 50 -------------------------------------------------------------------------------- /samples/a1155-1.out: -------------------------------------------------------------------------------- 1 | 98 86 23 2 | 98 86 12 3 | 98 72 65 4 | 98 72 60 50 5 | Max Heap -------------------------------------------------------------------------------- /samples/a1155-2.in: -------------------------------------------------------------------------------- 1 | 8 2 | 8 38 25 58 52 82 70 60 -------------------------------------------------------------------------------- /samples/a1155-2.out: -------------------------------------------------------------------------------- 1 | 8 25 70 2 | 8 25 82 3 | 8 38 52 4 | 8 38 58 60 5 | Min Heap -------------------------------------------------------------------------------- /samples/a1155-3.in: -------------------------------------------------------------------------------- 1 | 8 2 | 10 28 15 12 34 9 8 56 -------------------------------------------------------------------------------- /samples/a1155-3.out: -------------------------------------------------------------------------------- 1 | 10 15 8 2 | 10 15 9 3 | 10 28 34 4 | 10 28 12 56 5 | Not Heap -------------------------------------------------------------------------------- /samples/b1001-1.in: -------------------------------------------------------------------------------- 1 | 3 -------------------------------------------------------------------------------- /samples/b1001-1.out: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /samples/b1002-1.in: -------------------------------------------------------------------------------- 1 | 1234567890987654321123456789 -------------------------------------------------------------------------------- /samples/b1002-1.out: -------------------------------------------------------------------------------- 1 | yi san wu -------------------------------------------------------------------------------- /samples/b1003-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | PAT 3 | PAAT 4 | AAPATAA 5 | AAPAATAAAA 6 | xPATx 7 | PT 8 | Whatever 9 | APAAATAA 10 | APT 11 | APATTAA -------------------------------------------------------------------------------- /samples/b1003-1.out: -------------------------------------------------------------------------------- 1 | YES 2 | YES 3 | YES 4 | YES 5 | NO 6 | NO 7 | NO 8 | NO 9 | NO 10 | NO -------------------------------------------------------------------------------- /samples/b1004-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | Joe Math990112 89 3 | Mike CS991301 100 4 | Mary EE990830 95 -------------------------------------------------------------------------------- /samples/b1004-1.out: -------------------------------------------------------------------------------- 1 | Mike CS991301 2 | Joe Math990112 -------------------------------------------------------------------------------- /samples/b1005-1.in: -------------------------------------------------------------------------------- 1 | 6 2 | 3 5 6 7 8 11 -------------------------------------------------------------------------------- /samples/b1005-1.out: -------------------------------------------------------------------------------- 1 | 7 6 -------------------------------------------------------------------------------- /samples/b1006-1.in: -------------------------------------------------------------------------------- 1 | 234 -------------------------------------------------------------------------------- /samples/b1006-1.out: -------------------------------------------------------------------------------- 1 | BBSSS1234 -------------------------------------------------------------------------------- /samples/b1006-2.in: -------------------------------------------------------------------------------- 1 | 23 -------------------------------------------------------------------------------- /samples/b1006-2.out: -------------------------------------------------------------------------------- 1 | SS123 -------------------------------------------------------------------------------- /samples/b1007-1.in: -------------------------------------------------------------------------------- 1 | 20 -------------------------------------------------------------------------------- /samples/b1007-1.out: -------------------------------------------------------------------------------- 1 | 4 -------------------------------------------------------------------------------- /samples/b1008-1.in: -------------------------------------------------------------------------------- 1 | 6 2 2 | 1 2 3 4 5 6 -------------------------------------------------------------------------------- /samples/b1008-1.out: -------------------------------------------------------------------------------- 1 | 5 6 1 2 3 4 -------------------------------------------------------------------------------- /samples/b1009-1.in: -------------------------------------------------------------------------------- 1 | Hello World Here I Come 2 | -------------------------------------------------------------------------------- /samples/b1009-1.out: -------------------------------------------------------------------------------- 1 | Come I Here World Hello 2 | -------------------------------------------------------------------------------- /samples/b1010-1.in: -------------------------------------------------------------------------------- 1 | 3 4 -5 2 6 1 -2 0 -------------------------------------------------------------------------------- /samples/b1010-1.out: -------------------------------------------------------------------------------- 1 | 12 3 -10 1 6 0 -------------------------------------------------------------------------------- /samples/b1011-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 1 2 3 3 | 2 3 4 4 | 2147483647 0 2147483646 5 | 0 -2147483648 -2147483647 -------------------------------------------------------------------------------- /samples/b1011-1.out: -------------------------------------------------------------------------------- 1 | Case #1: false 2 | Case #2: true 3 | Case #3: true 4 | Case #4: false -------------------------------------------------------------------------------- /samples/b1012-1.in: -------------------------------------------------------------------------------- 1 | 13 1 2 3 4 5 6 7 8 9 10 20 16 18 -------------------------------------------------------------------------------- /samples/b1012-1.out: -------------------------------------------------------------------------------- 1 | 30 11 2 9.7 9 -------------------------------------------------------------------------------- /samples/b1012-2.in: -------------------------------------------------------------------------------- 1 | 8 1 2 4 5 6 7 9 16 -------------------------------------------------------------------------------- /samples/b1012-2.out: -------------------------------------------------------------------------------- 1 | N 11 2 N 9 -------------------------------------------------------------------------------- /samples/b1013-1.in: -------------------------------------------------------------------------------- 1 | 5 27 -------------------------------------------------------------------------------- /samples/b1013-1.out: -------------------------------------------------------------------------------- 1 | 11 13 17 19 23 29 31 37 41 43 2 | 47 53 59 61 67 71 73 79 83 89 3 | 97 101 103 -------------------------------------------------------------------------------- /samples/b1014-1.in: -------------------------------------------------------------------------------- 1 | 3485djDkxh4hhGE 2 | 2984akDfkkkkggEdsb 3 | s&hgsfdk 4 | d&Hyscvnm -------------------------------------------------------------------------------- /samples/b1014-1.out: -------------------------------------------------------------------------------- 1 | THU 14:04 -------------------------------------------------------------------------------- /samples/b1015-1.in: -------------------------------------------------------------------------------- 1 | 14 60 80 2 | 10000001 64 90 3 | 10000002 90 60 4 | 10000011 85 80 5 | 10000003 85 80 6 | 10000004 80 85 7 | 10000005 82 77 8 | 10000006 83 76 9 | 10000007 90 78 10 | 10000008 75 79 11 | 10000009 59 90 12 | 10000010 88 45 13 | 10000012 80 100 14 | 10000013 90 99 15 | 10000014 66 60 -------------------------------------------------------------------------------- /samples/b1015-1.out: -------------------------------------------------------------------------------- 1 | 12 2 | 10000013 90 99 3 | 10000012 80 100 4 | 10000003 85 80 5 | 10000011 85 80 6 | 10000004 80 85 7 | 10000007 90 78 8 | 10000006 83 76 9 | 10000005 82 77 10 | 10000002 90 60 11 | 10000014 66 60 12 | 10000008 75 79 13 | 10000001 64 90 -------------------------------------------------------------------------------- /samples/b1016-1.in: -------------------------------------------------------------------------------- 1 | 3862767 6 13530293 3 2 | -------------------------------------------------------------------------------- /samples/b1016-1.out: -------------------------------------------------------------------------------- 1 | 399 2 | -------------------------------------------------------------------------------- /samples/b1016-2.in: -------------------------------------------------------------------------------- 1 | 3862767 1 13530293 8 2 | -------------------------------------------------------------------------------- /samples/b1016-2.out: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /samples/b1017-1.in: -------------------------------------------------------------------------------- 1 | 123456789050987654321 7 -------------------------------------------------------------------------------- /samples/b1017-1.out: -------------------------------------------------------------------------------- 1 | 17636684150141093474 3 -------------------------------------------------------------------------------- /samples/b1018-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | C J 3 | J B 4 | C B 5 | B B 6 | B C 7 | C C 8 | C B 9 | J B 10 | B C 11 | J J -------------------------------------------------------------------------------- /samples/b1018-1.out: -------------------------------------------------------------------------------- 1 | 5 3 2 2 | 2 3 5 3 | B B -------------------------------------------------------------------------------- /samples/b1019-1.in: -------------------------------------------------------------------------------- 1 | 6767 -------------------------------------------------------------------------------- /samples/b1019-1.out: -------------------------------------------------------------------------------- 1 | 7766 - 6677 = 1089 2 | 9810 - 0189 = 9621 3 | 9621 - 1269 = 8352 4 | 8532 - 2358 = 6174 -------------------------------------------------------------------------------- /samples/b1019-2.in: -------------------------------------------------------------------------------- 1 | 2222 -------------------------------------------------------------------------------- /samples/b1019-2.out: -------------------------------------------------------------------------------- 1 | 2222 - 2222 = 0000 -------------------------------------------------------------------------------- /samples/b1020-1.in: -------------------------------------------------------------------------------- 1 | 3 20 2 | 18 15 10 3 | 75 72 45 -------------------------------------------------------------------------------- /samples/b1020-1.out: -------------------------------------------------------------------------------- 1 | 94.50 -------------------------------------------------------------------------------- /samples/b1021-1.in: -------------------------------------------------------------------------------- 1 | 100311 -------------------------------------------------------------------------------- /samples/b1021-1.out: -------------------------------------------------------------------------------- 1 | 0:2 2 | 1:3 3 | 3:1 -------------------------------------------------------------------------------- /samples/b1022-1.in: -------------------------------------------------------------------------------- 1 | 123 456 8 2 | -------------------------------------------------------------------------------- /samples/b1022-1.out: -------------------------------------------------------------------------------- 1 | 1103 2 | -------------------------------------------------------------------------------- /samples/b1023-1.in: -------------------------------------------------------------------------------- 1 | 2 2 0 0 0 3 0 0 1 0 -------------------------------------------------------------------------------- /samples/b1023-1.out: -------------------------------------------------------------------------------- 1 | 10015558 -------------------------------------------------------------------------------- /samples/b1024-1.in: -------------------------------------------------------------------------------- 1 | +1.23400E-03 -------------------------------------------------------------------------------- /samples/b1024-1.out: -------------------------------------------------------------------------------- 1 | 0.00123400 -------------------------------------------------------------------------------- /samples/b1024-2.in: -------------------------------------------------------------------------------- 1 | -1.2E+10 -------------------------------------------------------------------------------- /samples/b1024-2.out: -------------------------------------------------------------------------------- 1 | -12000000000 -------------------------------------------------------------------------------- /samples/b1025-1.in: -------------------------------------------------------------------------------- 1 | 00100 6 4 2 | 00000 4 99999 3 | 00100 1 12309 4 | 68237 6 -1 5 | 33218 3 00000 6 | 99999 5 68237 7 | 12309 2 33218 -------------------------------------------------------------------------------- /samples/b1025-1.out: -------------------------------------------------------------------------------- 1 | 00000 4 33218 2 | 33218 3 12309 3 | 12309 2 00100 4 | 00100 1 99999 5 | 99999 5 68237 6 | 68237 6 -1 -------------------------------------------------------------------------------- /samples/b1026-1.in: -------------------------------------------------------------------------------- 1 | 123 4577973 -------------------------------------------------------------------------------- /samples/b1026-1.out: -------------------------------------------------------------------------------- 1 | 12:42:59 -------------------------------------------------------------------------------- /samples/b1027-1.in: -------------------------------------------------------------------------------- 1 | 19 * -------------------------------------------------------------------------------- /samples/b1027-1.out: -------------------------------------------------------------------------------- 1 | ***** 2 | *** 3 | * 4 | *** 5 | ***** 6 | 2 -------------------------------------------------------------------------------- /samples/b1028-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | John 2001/05/12 3 | Tom 1814/09/06 4 | Ann 2121/01/30 5 | James 1814/09/05 6 | Steve 1967/11/20 -------------------------------------------------------------------------------- /samples/b1028-1.out: -------------------------------------------------------------------------------- 1 | 3 Tom John -------------------------------------------------------------------------------- /samples/b1029-1.in: -------------------------------------------------------------------------------- 1 | 7_This_is_a_test 2 | _hs_s_a_es -------------------------------------------------------------------------------- /samples/b1029-1.out: -------------------------------------------------------------------------------- 1 | 7TI -------------------------------------------------------------------------------- /samples/b1030-1.in: -------------------------------------------------------------------------------- 1 | 10 8 2 | 2 3 20 4 5 1 6 7 8 9 -------------------------------------------------------------------------------- /samples/b1030-1.out: -------------------------------------------------------------------------------- 1 | 8 -------------------------------------------------------------------------------- /samples/b1031-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 320124198808240056 3 | 12010X198901011234 4 | 110108196711301866 5 | 37070419881216001X -------------------------------------------------------------------------------- /samples/b1031-1.out: -------------------------------------------------------------------------------- 1 | 12010X198901011234 2 | 110108196711301866 3 | 37070419881216001X -------------------------------------------------------------------------------- /samples/b1031-2.in: -------------------------------------------------------------------------------- 1 | 2 2 | 320124198808240056 3 | 110108196711301862 -------------------------------------------------------------------------------- /samples/b1031-2.out: -------------------------------------------------------------------------------- 1 | All passed -------------------------------------------------------------------------------- /samples/b1032-1.in: -------------------------------------------------------------------------------- 1 | 6 2 | 3 65 3 | 2 80 4 | 1 100 5 | 2 70 6 | 3 40 7 | 3 0 8 | -------------------------------------------------------------------------------- /samples/b1032-1.out: -------------------------------------------------------------------------------- 1 | 2 150 2 | -------------------------------------------------------------------------------- /samples/b1033-1.in: -------------------------------------------------------------------------------- 1 | 7+IE. 2 | 7_This_is_a_test. -------------------------------------------------------------------------------- /samples/b1033-1.out: -------------------------------------------------------------------------------- 1 | _hs_s_a_tst -------------------------------------------------------------------------------- /samples/b1034-1.in: -------------------------------------------------------------------------------- 1 | 2/3 -4/2 -------------------------------------------------------------------------------- /samples/b1034-1.out: -------------------------------------------------------------------------------- 1 | 2/3 + (-2) = (-1 1/3) 2 | 2/3 - (-2) = 2 2/3 3 | 2/3 * (-2) = (-1 1/3) 4 | 2/3 / (-2) = (-1/3) -------------------------------------------------------------------------------- /samples/b1034-2.in: -------------------------------------------------------------------------------- 1 | 5/3 0/6 -------------------------------------------------------------------------------- /samples/b1034-2.out: -------------------------------------------------------------------------------- 1 | 1 2/3 + 0 = 1 2/3 2 | 1 2/3 - 0 = 1 2/3 3 | 1 2/3 * 0 = 0 4 | 1 2/3 / 0 = Inf -------------------------------------------------------------------------------- /samples/b1035-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 3 1 2 8 7 5 9 4 6 0 3 | 1 2 3 7 8 5 9 4 6 0 -------------------------------------------------------------------------------- /samples/b1035-1.out: -------------------------------------------------------------------------------- 1 | Insertion Sort 2 | 1 2 3 5 7 8 9 4 6 0 -------------------------------------------------------------------------------- /samples/b1035-2.in: -------------------------------------------------------------------------------- 1 | 10 2 | 3 1 2 8 7 5 9 4 0 6 3 | 1 3 2 8 5 7 4 9 0 6 -------------------------------------------------------------------------------- /samples/b1035-2.out: -------------------------------------------------------------------------------- 1 | Merge Sort 2 | 1 2 3 8 4 5 7 9 0 6 -------------------------------------------------------------------------------- /samples/b1036-1.in: -------------------------------------------------------------------------------- 1 | 10 a -------------------------------------------------------------------------------- /samples/b1036-1.out: -------------------------------------------------------------------------------- 1 | aaaaaaaaaa 2 | a a 3 | a a 4 | a a 5 | aaaaaaaaaa -------------------------------------------------------------------------------- /samples/b1037-1.in: -------------------------------------------------------------------------------- 1 | 10.16.27 14.1.28 -------------------------------------------------------------------------------- /samples/b1037-1.out: -------------------------------------------------------------------------------- 1 | 3.2.1 -------------------------------------------------------------------------------- /samples/b1037-2.in: -------------------------------------------------------------------------------- 1 | 14.1.28 10.16.27 -------------------------------------------------------------------------------- /samples/b1037-2.out: -------------------------------------------------------------------------------- 1 | -3.2.1 -------------------------------------------------------------------------------- /samples/b1038-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 60 75 90 55 75 99 82 90 75 50 3 | 3 75 90 88 -------------------------------------------------------------------------------- /samples/b1038-1.out: -------------------------------------------------------------------------------- 1 | 3 2 0 -------------------------------------------------------------------------------- /samples/b1039-1.in: -------------------------------------------------------------------------------- 1 | ppRYYGrrYBR2258 2 | YrR8RrY -------------------------------------------------------------------------------- /samples/b1039-1.out: -------------------------------------------------------------------------------- 1 | Yes 8 -------------------------------------------------------------------------------- /samples/b1039-2.in: -------------------------------------------------------------------------------- 1 | ppRYYGrrYB225 2 | YrR8RrY -------------------------------------------------------------------------------- /samples/b1039-2.out: -------------------------------------------------------------------------------- 1 | No 2 -------------------------------------------------------------------------------- /samples/b1040-1.in: -------------------------------------------------------------------------------- 1 | APPAPT -------------------------------------------------------------------------------- /samples/b1040-1.out: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /samples/b1041-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 3310120150912233 2 4 3 | 3310120150912119 4 1 4 | 3310120150912126 1 3 5 | 3310120150912002 3 2 6 | 2 7 | 3 4 -------------------------------------------------------------------------------- /samples/b1041-1.out: -------------------------------------------------------------------------------- 1 | 3310120150912002 2 2 | 3310120150912119 1 -------------------------------------------------------------------------------- /samples/b1042-1.in: -------------------------------------------------------------------------------- 1 | This is a simple TEST. There ARE numbers and other symbols 1&2&3........... -------------------------------------------------------------------------------- /samples/b1042-1.out: -------------------------------------------------------------------------------- 1 | e 7 -------------------------------------------------------------------------------- /samples/b1043-1.in: -------------------------------------------------------------------------------- 1 | redlesPayBestPATTopTeePHPereatitAPPT -------------------------------------------------------------------------------- /samples/b1043-1.out: -------------------------------------------------------------------------------- 1 | PATestPATestPTetPTePePee -------------------------------------------------------------------------------- /samples/b1044-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 29 3 | 5 4 | elo nov 5 | tam -------------------------------------------------------------------------------- /samples/b1044-1.out: -------------------------------------------------------------------------------- 1 | hel mar 2 | may 3 | 115 4 | 13 -------------------------------------------------------------------------------- /samples/b1045-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | 1 3 2 4 5 -------------------------------------------------------------------------------- /samples/b1045-1.out: -------------------------------------------------------------------------------- 1 | 3 2 | 1 4 5 -------------------------------------------------------------------------------- /samples/b1046-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | 8 10 9 12 3 | 5 10 5 10 4 | 3 8 5 12 5 | 12 18 1 13 6 | 4 16 12 15 -------------------------------------------------------------------------------- /samples/b1046-1.out: -------------------------------------------------------------------------------- 1 | 1 2 -------------------------------------------------------------------------------- /samples/b1047-1.in: -------------------------------------------------------------------------------- 1 | 6 2 | 3-10 99 3 | 11-5 87 4 | 102-1 0 5 | 102-3 100 6 | 11-9 89 7 | 3-2 61 -------------------------------------------------------------------------------- /samples/b1047-1.out: -------------------------------------------------------------------------------- 1 | 11 176 -------------------------------------------------------------------------------- /samples/b1048-1.in: -------------------------------------------------------------------------------- 1 | 1234567 368782971 -------------------------------------------------------------------------------- /samples/b1048-1.out: -------------------------------------------------------------------------------- 1 | 3695Q8118 -------------------------------------------------------------------------------- /samples/b1049-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 0.1 0.2 0.3 0.4 -------------------------------------------------------------------------------- /samples/b1049-1.out: -------------------------------------------------------------------------------- 1 | 5.00 -------------------------------------------------------------------------------- /samples/b1050-1.in: -------------------------------------------------------------------------------- 1 | 12 2 | 37 76 20 98 76 42 53 95 60 81 58 93 -------------------------------------------------------------------------------- /samples/b1050-1.out: -------------------------------------------------------------------------------- 1 | 98 95 93 2 | 42 37 81 3 | 53 20 76 4 | 58 60 76 -------------------------------------------------------------------------------- /samples/b1051-1.in: -------------------------------------------------------------------------------- 1 | 2.3 3.5 5.2 0.4 -------------------------------------------------------------------------------- /samples/b1051-1.out: -------------------------------------------------------------------------------- 1 | -8.68-8.23i -------------------------------------------------------------------------------- /samples/b1052-1.in: -------------------------------------------------------------------------------- 1 | [╮][╭][o][~\][/~] [<][>] 2 | [╯][╰][^][-][=][>][<][@][⊙] 3 | [Д][▽][_][ε][^] ... 4 | 4 5 | 1 1 2 2 2 6 | 6 8 1 5 5 7 | 3 3 4 3 3 8 | 2 10 3 9 3 -------------------------------------------------------------------------------- /samples/b1052-1.out: -------------------------------------------------------------------------------- 1 | ╮(╯▽╰)╭ 2 | <(@Д=)/~ 3 | o(^ε^)o 4 | Are you kidding me? @\/@ -------------------------------------------------------------------------------- /samples/b1053-1.in: -------------------------------------------------------------------------------- 1 | 5 0.5 10 2 | 6 0.3 0.4 0.5 0.2 0.8 0.6 3 | 10 0.0 0.1 0.2 0.3 0.0 0.8 0.6 0.7 0.0 0.5 4 | 5 0.4 0.3 0.5 0.1 0.7 5 | 11 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 6 | 11 2 2 2 1 1 0.1 1 0.1 0.1 0.1 0.1 -------------------------------------------------------------------------------- /samples/b1053-1.out: -------------------------------------------------------------------------------- 1 | 40.0% 20.0% -------------------------------------------------------------------------------- /samples/b1054-1.in: -------------------------------------------------------------------------------- 1 | 7 2 | 5 -3.2 aaa 9999 2.3.4 7.123 2.35 -------------------------------------------------------------------------------- /samples/b1054-1.out: -------------------------------------------------------------------------------- 1 | ERROR: aaa is not a legal number 2 | ERROR: 9999 is not a legal number 3 | ERROR: 2.3.4 is not a legal number 4 | ERROR: 7.123 is not a legal number 5 | The average of 3 numbers is 1.38 -------------------------------------------------------------------------------- /samples/b1054-2.in: -------------------------------------------------------------------------------- 1 | 2 2 | aaa -9999 -------------------------------------------------------------------------------- /samples/b1054-2.out: -------------------------------------------------------------------------------- 1 | ERROR: aaa is not a legal number 2 | ERROR: -9999 is not a legal number 3 | The average of 0 numbers is Undefined -------------------------------------------------------------------------------- /samples/b1055-1.in: -------------------------------------------------------------------------------- 1 | 10 3 2 | Tom 188 3 | Mike 170 4 | Eva 168 5 | Tim 160 6 | Joe 190 7 | Ann 168 8 | Bob 175 9 | Nick 186 10 | Amy 160 11 | John 159 -------------------------------------------------------------------------------- /samples/b1055-1.out: -------------------------------------------------------------------------------- 1 | Bob Tom Joe Nick 2 | Ann Mike Eva 3 | Tim Amy John -------------------------------------------------------------------------------- /samples/b1056-1.in: -------------------------------------------------------------------------------- 1 | 3 2 8 5 -------------------------------------------------------------------------------- /samples/b1056-1.out: -------------------------------------------------------------------------------- 1 | 330 -------------------------------------------------------------------------------- /samples/b1057-1.in: -------------------------------------------------------------------------------- 1 | PAT (Basic) -------------------------------------------------------------------------------- /samples/b1057-1.out: -------------------------------------------------------------------------------- 1 | 3 4 -------------------------------------------------------------------------------- /samples/b1058-1.in: -------------------------------------------------------------------------------- 1 | 3 4 2 | 3 4 2 a c 3 | 2 5 1 b 4 | 5 3 2 b c 5 | 1 5 4 a b d e 6 | (2 a c) (2 b d) (2 a c) (3 a b e) 7 | (2 a c) (1 b) (2 a b) (4 a b d e) 8 | (2 b d) (1 e) (2 b c) (4 a b c d) -------------------------------------------------------------------------------- /samples/b1058-1.out: -------------------------------------------------------------------------------- 1 | 3 2 | 6 3 | 5 4 | 2 2 3 4 -------------------------------------------------------------------------------- /samples/b1059-1.in: -------------------------------------------------------------------------------- 1 | 6 2 | 1111 3 | 6666 4 | 8888 5 | 1234 6 | 5555 7 | 0001 8 | 6 9 | 8888 10 | 0001 11 | 1111 12 | 2222 13 | 8888 14 | 2222 -------------------------------------------------------------------------------- /samples/b1059-1.out: -------------------------------------------------------------------------------- 1 | 8888: Minion 2 | 0001: Chocolate 3 | 1111: Mystery Award 4 | 2222: Are you kidding? 5 | 8888: Checked 6 | 2222: Are you kidding? -------------------------------------------------------------------------------- /samples/b1060-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | 6 7 6 9 3 10 8 2 7 8 -------------------------------------------------------------------------------- /samples/b1060-1.out: -------------------------------------------------------------------------------- 1 | 6 -------------------------------------------------------------------------------- /samples/b1061-1.in: -------------------------------------------------------------------------------- 1 | 3 6 2 | 2 1 3 3 4 5 3 | 0 0 1 0 1 1 4 | 0 1 1 0 0 1 5 | 1 0 1 0 1 0 6 | 1 1 0 0 1 1 -------------------------------------------------------------------------------- /samples/b1061-1.out: -------------------------------------------------------------------------------- 1 | 13 2 | 11 3 | 12 -------------------------------------------------------------------------------- /samples/b1062-1.in: -------------------------------------------------------------------------------- 1 | 7/18 13/20 12 -------------------------------------------------------------------------------- /samples/b1062-1.out: -------------------------------------------------------------------------------- 1 | 5/12 7/12 -------------------------------------------------------------------------------- /samples/b1063-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | 0 1 3 | 2 0 4 | -1 0 5 | 3 3 6 | 0 -3 -------------------------------------------------------------------------------- /samples/b1063-1.out: -------------------------------------------------------------------------------- 1 | 4.24 -------------------------------------------------------------------------------- /samples/b1064-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | 123 899 51 998 27 33 36 12 -------------------------------------------------------------------------------- /samples/b1064-1.out: -------------------------------------------------------------------------------- 1 | 4 2 | 3 6 9 26 -------------------------------------------------------------------------------- /samples/b1065-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | 11111 22222 3 | 33333 44444 4 | 55555 66666 5 | 7 6 | 55555 44444 10000 88888 22222 11111 23333 -------------------------------------------------------------------------------- /samples/b1065-1.out: -------------------------------------------------------------------------------- 1 | 5 2 | 10000 23333 44444 55555 88888 -------------------------------------------------------------------------------- /samples/b1066-1.in: -------------------------------------------------------------------------------- 1 | 3 5 100 150 0 2 | 3 189 254 101 119 3 | 150 233 151 99 100 4 | 88 123 149 0 255 -------------------------------------------------------------------------------- /samples/b1066-1.out: -------------------------------------------------------------------------------- 1 | 003 189 254 000 000 2 | 000 233 151 099 000 3 | 088 000 000 000 255 -------------------------------------------------------------------------------- /samples/b1067-1.in: -------------------------------------------------------------------------------- 1 | Correct%pw 3 2 | correct%pw 3 | Correct@PW 4 | whatisthepassword! 5 | Correct%pw 6 | # -------------------------------------------------------------------------------- /samples/b1067-1.out: -------------------------------------------------------------------------------- 1 | Wrong password: correct%pw 2 | Wrong password: Correct@PW 3 | Wrong password: whatisthepassword! 4 | Account locked -------------------------------------------------------------------------------- /samples/b1067-2.in: -------------------------------------------------------------------------------- 1 | cool@gplt 3 2 | coolman@gplt 3 | coollady@gplt 4 | cool@gplt 5 | try again 6 | # -------------------------------------------------------------------------------- /samples/b1067-2.out: -------------------------------------------------------------------------------- 1 | Wrong password: coolman@gplt 2 | Wrong password: coollady@gplt 3 | Welcome in -------------------------------------------------------------------------------- /samples/b1068-1.in: -------------------------------------------------------------------------------- 1 | 8 6 200 2 | 0 0 0 0 0 0 0 0 3 | 65280 65280 65280 16711479 65280 65280 65280 65280 4 | 16711479 65280 65280 65280 16711680 65280 65280 65280 5 | 65280 65280 65280 65280 65280 65280 165280 165280 6 | 65280 65280 16777015 65280 65280 165280 65480 165280 7 | 16777215 16777215 16777215 16777215 16777215 16777215 16777215 16777215 -------------------------------------------------------------------------------- /samples/b1068-1.out: -------------------------------------------------------------------------------- 1 | (5, 3): 16711680 -------------------------------------------------------------------------------- /samples/b1068-2.in: -------------------------------------------------------------------------------- 1 | 4 5 2 2 | 0 0 0 0 3 | 0 0 3 0 4 | 0 0 0 0 5 | 0 5 0 0 6 | 0 0 0 0 -------------------------------------------------------------------------------- /samples/b1068-2.out: -------------------------------------------------------------------------------- 1 | Not Unique -------------------------------------------------------------------------------- /samples/b1068-3.in: -------------------------------------------------------------------------------- 1 | 3 3 5 2 | 1 2 3 3 | 3 4 5 4 | 5 6 7 -------------------------------------------------------------------------------- /samples/b1068-3.out: -------------------------------------------------------------------------------- 1 | Not Exist -------------------------------------------------------------------------------- /samples/b1069-1.in: -------------------------------------------------------------------------------- 1 | 9 3 2 2 | Imgonnawin! 3 | PickMe 4 | PickMe 5 | LookHere 6 | Imgonnawin! 7 | TryAgainAgain 8 | TryAgainAgain 9 | Imgonnawin! 10 | TryAgainAgain 11 | -------------------------------------------------------------------------------- /samples/b1069-1.out: -------------------------------------------------------------------------------- 1 | PickMe 2 | Imgonnawin! 3 | TryAgainAgain 4 | -------------------------------------------------------------------------------- /samples/b1069-2.in: -------------------------------------------------------------------------------- 1 | 2 3 5 2 | Imgonnawin! 3 | PickMe 4 | -------------------------------------------------------------------------------- /samples/b1069-2.out: -------------------------------------------------------------------------------- 1 | Keep going... 2 | -------------------------------------------------------------------------------- /samples/b1070-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | 10 15 12 3 4 13 1 15 -------------------------------------------------------------------------------- /samples/b1070-1.out: -------------------------------------------------------------------------------- 1 | 14 -------------------------------------------------------------------------------- /samples/b1071-1.in: -------------------------------------------------------------------------------- 1 | 100 4 2 | 8 0 100 2 3 | 3 1 50 1 4 | 5 1 200 6 5 | 7 0 200 8 -------------------------------------------------------------------------------- /samples/b1071-1.out: -------------------------------------------------------------------------------- 1 | Win 100! Total = 200. 2 | Lose 50. Total = 150. 3 | Not enough tokens. Total = 150. 4 | Not enough tokens. Total = 150. -------------------------------------------------------------------------------- /samples/b1071-2.in: -------------------------------------------------------------------------------- 1 | 100 4 2 | 8 0 100 2 3 | 3 1 200 1 4 | 5 1 200 6 5 | 7 0 200 8 -------------------------------------------------------------------------------- /samples/b1071-2.out: -------------------------------------------------------------------------------- 1 | Win 100! Total = 200. 2 | Lose 200. Total = 0. 3 | Game Over. -------------------------------------------------------------------------------- /samples/b1072-1.in: -------------------------------------------------------------------------------- 1 | 4 2 2 | 2333 6666 3 | CYLL 3 1234 2345 3456 4 | U 4 9966 6666 8888 6666 5 | GG 2 2333 7777 6 | JJ 3 0012 6666 2333 -------------------------------------------------------------------------------- /samples/b1072-1.out: -------------------------------------------------------------------------------- 1 | U: 6666 6666 2 | GG: 2333 3 | JJ: 6666 2333 4 | 3 5 -------------------------------------------------------------------------------- /samples/b1073-1.in: -------------------------------------------------------------------------------- 1 | 3 4 2 | 3 4 2 a c 3 | 2 5 1 b 4 | 5 3 2 b c 5 | 1 5 4 a b d e 6 | (2 a c) (3 b d e) (2 a c) (3 a b e) 7 | (2 a c) (1 b) (2 a b) (4 a b d e) 8 | (2 b d) (1 e) (1 c) (4 a b c d) -------------------------------------------------------------------------------- /samples/b1073-1.out: -------------------------------------------------------------------------------- 1 | 3.5 2 | 6.0 3 | 2.5 4 | 2 2-e 5 | 2 3-a 6 | 2 3-b -------------------------------------------------------------------------------- /samples/b1073-2.in: -------------------------------------------------------------------------------- 1 | 2 2 2 | 3 4 2 a c 3 | 2 5 1 b 4 | (2 a c) (1 b) 5 | (2 a c) (1 b) -------------------------------------------------------------------------------- /samples/b1073-2.out: -------------------------------------------------------------------------------- 1 | 5.0 2 | 5.0 3 | Too simple -------------------------------------------------------------------------------- /samples/b1074-1.in: -------------------------------------------------------------------------------- 1 | 30527 2 | 06203 3 | 415 -------------------------------------------------------------------------------- /samples/b1074-1.out: -------------------------------------------------------------------------------- 1 | 7201 -------------------------------------------------------------------------------- /samples/b1075-1.in: -------------------------------------------------------------------------------- 1 | 00100 9 10 2 | 23333 10 27777 3 | 00000 0 99999 4 | 00100 18 12309 5 | 68237 -6 23333 6 | 33218 -4 00000 7 | 48652 -2 -1 8 | 99999 5 68237 9 | 27777 11 48652 10 | 12309 7 33218 -------------------------------------------------------------------------------- /samples/b1075-1.out: -------------------------------------------------------------------------------- 1 | 33218 -4 68237 2 | 68237 -6 48652 3 | 48652 -2 12309 4 | 12309 7 00000 5 | 00000 0 99999 6 | 99999 5 23333 7 | 23333 10 00100 8 | 00100 18 27777 9 | 27777 11 -1 -------------------------------------------------------------------------------- /samples/b1076-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | A-T B-F C-F D-F 3 | C-T B-F A-F D-F 4 | A-F D-F C-F B-T 5 | B-T A-F C-F D-F 6 | B-F D-T A-F C-F 7 | A-T C-F B-F D-F 8 | D-T B-F C-F A-F 9 | C-T A-F B-F D-F -------------------------------------------------------------------------------- /samples/b1076-1.out: -------------------------------------------------------------------------------- 1 | 13224143 -------------------------------------------------------------------------------- /samples/b1077-1.in: -------------------------------------------------------------------------------- 1 | 6 50 2 | 42 49 49 35 38 41 3 | 36 51 50 28 -1 30 4 | 40 36 41 33 47 49 5 | 30 250 -25 27 45 31 6 | 48 0 0 50 50 1234 7 | 43 41 36 29 42 29 -------------------------------------------------------------------------------- /samples/b1077-1.out: -------------------------------------------------------------------------------- 1 | 42 2 | 33 3 | 41 4 | 31 5 | 37 6 | 39 -------------------------------------------------------------------------------- /samples/b1078-1.in: -------------------------------------------------------------------------------- 1 | C 2 | TTTTThhiiiis isssss a tesssst CAaaa as -------------------------------------------------------------------------------- /samples/b1078-1.out: -------------------------------------------------------------------------------- 1 | 5T2h4is i5s a3 te4st CA3a as -------------------------------------------------------------------------------- /samples/b1078-2.in: -------------------------------------------------------------------------------- 1 | D 2 | 5T2h4is i5s a3 te4st CA3a as10Z -------------------------------------------------------------------------------- /samples/b1078-2.out: -------------------------------------------------------------------------------- 1 | TTTTThhiiiis isssss a tesssst CAaaa asZZZZZZZZZZ -------------------------------------------------------------------------------- /samples/b1079-1.in: -------------------------------------------------------------------------------- 1 | 97152 -------------------------------------------------------------------------------- /samples/b1079-1.out: -------------------------------------------------------------------------------- 1 | 97152 + 25179 = 122331 2 | 122331 + 133221 = 255552 3 | 255552 is a palindromic number. -------------------------------------------------------------------------------- /samples/b1079-2.in: -------------------------------------------------------------------------------- 1 | 196 -------------------------------------------------------------------------------- /samples/b1079-2.out: -------------------------------------------------------------------------------- 1 | 196 + 691 = 887 2 | 887 + 788 = 1675 3 | 1675 + 5761 = 7436 4 | 7436 + 6347 = 13783 5 | 13783 + 38731 = 52514 6 | 52514 + 41525 = 94039 7 | 94039 + 93049 = 187088 8 | 187088 + 880781 = 1067869 9 | 1067869 + 9687601 = 10755470 10 | 10755470 + 07455701 = 18211171 11 | Not found in 10 iterations. -------------------------------------------------------------------------------- /samples/b1080-1.in: -------------------------------------------------------------------------------- 1 | 6 6 7 2 | 01234 880 3 | a1903 199 4 | ydjh2 200 5 | wehu8 300 6 | dx86w 220 7 | missing 400 8 | ydhfu77 99 9 | wehu8 55 10 | ydjh2 98 11 | dx86w 88 12 | a1903 86 13 | 01234 39 14 | ydhfu77 88 15 | a1903 66 16 | 01234 58 17 | wehu8 84 18 | ydjh2 82 19 | missing 99 20 | dx86w 81 -------------------------------------------------------------------------------- /samples/b1080-1.out: -------------------------------------------------------------------------------- 1 | missing 400 -1 99 99 2 | ydjh2 200 98 82 88 3 | dx86w 220 88 81 84 4 | wehu8 300 55 84 84 -------------------------------------------------------------------------------- /samples/b1081-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | 123s 3 | zheshi.wodepw 4 | 1234.5678 5 | WanMei23333 6 | pass*word.6 7 | -------------------------------------------------------------------------------- /samples/b1081-1.out: -------------------------------------------------------------------------------- 1 | Your password is tai duan le. 2 | Your password needs shu zi. 3 | Your password needs zi mu. 4 | Your password is wan mei. 5 | Your password is tai luan le. 6 | -------------------------------------------------------------------------------- /samples/b1082-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | 0001 5 7 3 | 1020 -1 3 4 | 0233 0 -1 -------------------------------------------------------------------------------- /samples/b1082-1.out: -------------------------------------------------------------------------------- 1 | 0233 0001 -------------------------------------------------------------------------------- /samples/b1083-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | 3 5 8 6 2 1 4 7 -------------------------------------------------------------------------------- /samples/b1083-1.out: -------------------------------------------------------------------------------- 1 | 5 2 2 | 3 3 3 | 2 2 -------------------------------------------------------------------------------- /samples/b1084-1.in: -------------------------------------------------------------------------------- 1 | 1 8 -------------------------------------------------------------------------------- /samples/b1084-1.out: -------------------------------------------------------------------------------- 1 | 1123123111 -------------------------------------------------------------------------------- /samples/b1085-1.in: -------------------------------------------------------------------------------- 1 | 10 2 | A57908 85 Au 3 | B57908 54 LanX 4 | A37487 60 au 5 | T28374 67 CMU 6 | T32486 24 hypu 7 | A66734 92 cmu 8 | B76378 71 AU 9 | A47780 45 lanx 10 | A72809 100 pku 11 | A03274 45 hypu -------------------------------------------------------------------------------- /samples/b1085-1.out: -------------------------------------------------------------------------------- 1 | 5 2 | 1 cmu 192 2 3 | 1 au 192 3 4 | 3 pku 100 1 5 | 4 hypu 81 2 6 | 4 lanx 81 2 -------------------------------------------------------------------------------- /samples/b1086-1.in: -------------------------------------------------------------------------------- 1 | 5 7 -------------------------------------------------------------------------------- /samples/b1086-1.out: -------------------------------------------------------------------------------- 1 | 53 -------------------------------------------------------------------------------- /samples/b1087-1.in: -------------------------------------------------------------------------------- 1 | 2017 -------------------------------------------------------------------------------- /samples/b1087-1.out: -------------------------------------------------------------------------------- 1 | 1480 -------------------------------------------------------------------------------- /samples/b1088-1.in: -------------------------------------------------------------------------------- 1 | 48 3 7 -------------------------------------------------------------------------------- /samples/b1088-1.out: -------------------------------------------------------------------------------- 1 | 48 Ping Cong Gai -------------------------------------------------------------------------------- /samples/b1088-2.in: -------------------------------------------------------------------------------- 1 | 48 11 6 -------------------------------------------------------------------------------- /samples/b1088-2.out: -------------------------------------------------------------------------------- 1 | No Solution -------------------------------------------------------------------------------- /samples/b1089-1.in: -------------------------------------------------------------------------------- 1 | 5 2 | -2 3 | +3 4 | -4 5 | +5 6 | +4 -------------------------------------------------------------------------------- /samples/b1089-1.out: -------------------------------------------------------------------------------- 1 | 1 4 -------------------------------------------------------------------------------- /samples/b1089-2.in: -------------------------------------------------------------------------------- 1 | 6 2 | +6 3 | +3 4 | +1 5 | -5 6 | -2 7 | +4 -------------------------------------------------------------------------------- /samples/b1089-2.out: -------------------------------------------------------------------------------- 1 | 1 5 -------------------------------------------------------------------------------- /samples/b1089-3.in: -------------------------------------------------------------------------------- 1 | 5 2 | -2 3 | -3 4 | -4 5 | -5 6 | -1 -------------------------------------------------------------------------------- /samples/b1089-3.out: -------------------------------------------------------------------------------- 1 | No Solution -------------------------------------------------------------------------------- /samples/b1090-1.in: -------------------------------------------------------------------------------- 1 | 6 3 2 | 20001 20002 3 | 20003 20004 4 | 20005 20006 5 | 20003 20001 6 | 20005 20004 7 | 20004 20006 8 | 4 00001 20004 00002 20003 9 | 5 98823 20002 20003 20006 10010 10 | 3 12345 67890 23333 -------------------------------------------------------------------------------- /samples/b1090-1.out: -------------------------------------------------------------------------------- 1 | No 2 | Yes 3 | Yes -------------------------------------------------------------------------------- /samples/b1091-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | 92 5 233 -------------------------------------------------------------------------------- /samples/b1091-1.out: -------------------------------------------------------------------------------- 1 | 3 25392 2 | 1 25 3 | No -------------------------------------------------------------------------------- /samples/b1092-1.in: -------------------------------------------------------------------------------- 1 | 5 3 2 | 1001 992 0 233 6 3 | 8 0 2018 0 2008 4 | 36 18 0 1024 4 -------------------------------------------------------------------------------- /samples/b1092-1.out: -------------------------------------------------------------------------------- 1 | 2018 2 | 3 5 -------------------------------------------------------------------------------- /samples/b1093-1.in: -------------------------------------------------------------------------------- 1 | This is a sample test 2 | to show you_How it works -------------------------------------------------------------------------------- /samples/b1093-1.out: -------------------------------------------------------------------------------- 1 | This ampletowyu_Hrk -------------------------------------------------------------------------------- /samples/b1094-1.in: -------------------------------------------------------------------------------- 1 | 20 5 2 | 23654987725541023819 -------------------------------------------------------------------------------- /samples/b1094-1.out: -------------------------------------------------------------------------------- 1 | 49877 -------------------------------------------------------------------------------- /samples/b1094-2.in: -------------------------------------------------------------------------------- 1 | 10 3 2 | 2468001680 -------------------------------------------------------------------------------- /samples/b1094-2.out: -------------------------------------------------------------------------------- 1 | 404 -------------------------------------------------------------------------------- /samples/b1095-1.in: -------------------------------------------------------------------------------- 1 | 8 4 2 | B123180908127 99 3 | B102180908003 86 4 | A112180318002 98 5 | T107150310127 62 6 | A107180908108 100 7 | T123180908010 78 8 | B112160918035 88 9 | A107180908021 98 10 | 1 A 11 | 2 107 12 | 3 180908 13 | 2 999 -------------------------------------------------------------------------------- /samples/b1095-1.out: -------------------------------------------------------------------------------- 1 | Case 1: 1 A 2 | A107180908108 100 3 | A107180908021 98 4 | A112180318002 98 5 | Case 2: 2 107 6 | 3 260 7 | Case 3: 3 180908 8 | 107 2 9 | 123 2 10 | 102 1 11 | Case 4: 2 999 12 | NA -------------------------------------------------------------------------------- /samples/t1001-1.in: -------------------------------------------------------------------------------- 1 | 4 5 2 | 1 2 1 1 3 | 1 3 1 1 4 | 2 3 1 0 5 | 2 4 1 1 6 | 3 4 1 0 -------------------------------------------------------------------------------- /samples/t1001-1.out: -------------------------------------------------------------------------------- 1 | 1 2 -------------------------------------------------------------------------------- /samples/t1001-2.in: -------------------------------------------------------------------------------- 1 | 4 5 2 | 1 2 1 1 3 | 1 3 1 1 4 | 2 3 1 0 5 | 2 4 1 1 6 | 3 4 2 1 -------------------------------------------------------------------------------- /samples/t1001-2.out: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /samples/t1002-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | 7 1 3 3 | 10 2 3 4 | 6 1 2 5 | 5 1 1 -------------------------------------------------------------------------------- /samples/t1002-1.out: -------------------------------------------------------------------------------- 1 | 18 -------------------------------------------------------------------------------- /samples/t1003-1.in: -------------------------------------------------------------------------------- 1 | EAR MAR 11 2 | EAR AAA 300 3 | EAR BBB 400 4 | AAA BBB 100 5 | AAA CCC 400 6 | AAA MAR 300 7 | BBB DDD 400 8 | AAA DDD 400 9 | DDD AAA 100 10 | CCC MAR 400 11 | DDD CCC 200 12 | DDD MAR 300 -------------------------------------------------------------------------------- /samples/t1003-1.out: -------------------------------------------------------------------------------- 1 | 700 -------------------------------------------------------------------------------- /samples/t1004-1.in: -------------------------------------------------------------------------------- 1 | RYg5 2 | 8 3 | gY5Ybf 4 | 8R5 5 | 12346789 6 | gRg8h 7 | 5Y37 8 | pRgYgbR52 9 | 8Y 10 | 8g -------------------------------------------------------------------------------- /samples/t1004-1.out: -------------------------------------------------------------------------------- 1 | Yes 3 -------------------------------------------------------------------------------- /samples/t1004-2.in: -------------------------------------------------------------------------------- 1 | YrRR8RRrY 2 | 3 3 | ppRGrrYB225 4 | 8ppGrrB25 5 | Zd6KrY -------------------------------------------------------------------------------- /samples/t1004-2.out: -------------------------------------------------------------------------------- 1 | No 3 -------------------------------------------------------------------------------- /samples/t1005-1.in: -------------------------------------------------------------------------------- 1 | 4 2 | //A can can can a can. -------------------------------------------------------------------------------- /samples/t1005-1.out: -------------------------------------------------------------------------------- 1 | can 4 -------------------------------------------------------------------------------- /samples/t1005-2.in: -------------------------------------------------------------------------------- 1 | 3 2 | int a=~~~~~~~~~~~~~~~~~~~~~0; -------------------------------------------------------------------------------- /samples/t1005-2.out: -------------------------------------------------------------------------------- 1 | ~~~ 19 -------------------------------------------------------------------------------- /samples/t1006-1.in: -------------------------------------------------------------------------------- 1 | 9 2 | 3 - 2 1 7 9 - 4 6 3 | 9 - 5 3 2 1 - 6 4 4 | 3 1 - - 7 - 6 8 - -------------------------------------------------------------------------------- /samples/t1006-1.out: -------------------------------------------------------------------------------- 1 | 3 5 2 1 7 9 8 4 6 2 | 9 7 5 3 2 1 8 6 4 3 | 3 1 2 5 7 4 6 8 9 4 | 9 7 8 5 6 3 2 4 1 -------------------------------------------------------------------------------- /samples/t1006-2.in: -------------------------------------------------------------------------------- 1 | 3 2 | - - - 3 | - 1 - 4 | 1 - - -------------------------------------------------------------------------------- /samples/t1006-2.out: -------------------------------------------------------------------------------- 1 | Impossible -------------------------------------------------------------------------------- /samples/t1007-1.in: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /samples/t1007-1.out: -------------------------------------------------------------------------------- 1 | 8 -------------------------------------------------------------------------------- /samples/t1008-1.in: -------------------------------------------------------------------------------- 1 | 12 19 2 | 3 4 3 | 1 3 4 | 12 11 5 | 5 9 6 | 6 2 7 | 3 2 8 | 10 7 9 | 9 1 10 | 7 12 11 | 2 4 12 | 9 5 13 | 2 6 14 | 12 4 15 | 11 10 16 | 4 8 17 | 8 12 18 | 11 8 19 | 12 7 20 | 1 5 21 | 20 22 | 11 4 23 | 12 7 24 | 3 6 25 | 2 3 26 | 5 3 27 | 3 9 28 | 4 3 29 | 8 3 30 | 8 10 31 | 10 11 32 | 7 8 33 | 7 1 34 | 9 5 35 | 1 9 36 | 2 6 37 | 3 1 38 | 3 12 39 | 7 3 40 | 6 9 41 | 6 8 -------------------------------------------------------------------------------- /samples/t1008-1.out: -------------------------------------------------------------------------------- 1 | Yes 2 | Yes 3 | No 4 | No 5 | No 6 | No 7 | No 8 | No 9 | Yes 10 | Yes 11 | Yes 12 | No 13 | Yes 14 | Yes 15 | Yes 16 | No 17 | No 18 | No 19 | No 20 | No -------------------------------------------------------------------------------- /samples/t1009-1.in: -------------------------------------------------------------------------------- 1 | 22 2 | 1 2 3 4 5 16 6 7 8 9 10 19 11 12 14 15 17 18 21 22 20 13 -------------------------------------------------------------------------------- /samples/t1009-1.out: -------------------------------------------------------------------------------- 1 | 8 -------------------------------------------------------------------------------- /samples/t1010-1.in: -------------------------------------------------------------------------------- 1 | 6 2 | 24 35 12 1 56 23 -------------------------------------------------------------------------------- /samples/t1010-1.out: -------------------------------------------------------------------------------- 1 | 3 3 1 0 1 0 -------------------------------------------------------------------------------- /samples/t1011-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | 3 0 0 1 0 1 1 3 | 3 0 0 1 1 0 1 4 | 3 0 0 1 0 1 1 5 | 3 0 0 1 1 0 2 6 | 4 0 4 1 4 1 0 0 0 7 | 4 4 0 4 1 0 1 0 0 8 | 3 0 0 1 1 0 1 9 | 4 2 3 1 4 1 7 2 7 10 | 5 10 10 10 12 12 12 14 11 14 10 11 | 3 28 35 29 35 29 37 12 | 3 7 9 8 11 8 9 13 | 5 87 26 92 26 92 23 90 22 87 22 14 | 5 0 0 2 0 1 1 1 2 0 2 15 | 4 0 0 1 1 2 1 2 0 16 | 4 0 0 0 1 1 1 2 0 17 | 4 0 0 0 1 1 1 2 0 -------------------------------------------------------------------------------- /samples/t1011-1.out: -------------------------------------------------------------------------------- 1 | YES 2 | NO 3 | YES 4 | YES 5 | YES 6 | YES 7 | NO 8 | YES -------------------------------------------------------------------------------- /samples/t1012-1.in: -------------------------------------------------------------------------------- 1 | 6 1 2 | 2 5 -------------------------------------------------------------------------------- /samples/t1012-1.out: -------------------------------------------------------------------------------- 1 | 0 4 2 | -1 -------------------------------------------------------------------------------- /samples/t1012-2.in: -------------------------------------------------------------------------------- 1 | 6 2 2 | 2 2 3 | 3 3 -------------------------------------------------------------------------------- /samples/t1012-2.out: -------------------------------------------------------------------------------- 1 | 2 1 2 | 0 2 -------------------------------------------------------------------------------- /samples/t1013-1.in: -------------------------------------------------------------------------------- 1 | 10 21 100 2 | 0 1 10 3 | 0 3 60 4 | 0 4 90 5 | 1 2 90 6 | 1 3 50 7 | 1 4 200 8 | 1 5 86 9 | 2 4 95 10 | 2 5 5 11 | 3 4 95 12 | 3 6 15 13 | 3 7 101 14 | 4 5 500 15 | 4 6 100 16 | 4 7 101 17 | 4 8 101 18 | 5 7 300 19 | 5 8 50 20 | 6 7 90 21 | 7 8 84 22 | 7 9 34 -------------------------------------------------------------------------------- /samples/t1013-1.out: -------------------------------------------------------------------------------- 1 | 0 1 3 6 2 | 2 5 8 3 | 4 4 | 7 9 -------------------------------------------------------------------------------- /samples/t1013-2.in: -------------------------------------------------------------------------------- 1 | 7 7 100 2 | 0 1 10 3 | 1 2 61 4 | 2 3 50 5 | 3 4 200 6 | 4 5 82 7 | 5 0 200 8 | 3 6 90 -------------------------------------------------------------------------------- /samples/t1013-2.out: -------------------------------------------------------------------------------- 1 | 0 1 2 | 2 3 6 3 | 4 5 -------------------------------------------------------------------------------- /samples/t1014-1.in: -------------------------------------------------------------------------------- 1 | 17 2 | 2 15 12 3 | 1 17 4 | 2 16 9 5 | 1 8 6 | 4 10 13 15 14 7 | 0 8 | 2 11 14 9 | 1 4 10 | 2 2 3 11 | 2 13 11 12 | 2 15 7 13 | 2 1 14 14 | 2 5 15 15 | 0 16 | 0 17 | 1 3 18 | 1 2 -------------------------------------------------------------------------------- /samples/t1014-1.out: -------------------------------------------------------------------------------- 1 | 4 3 -------------------------------------------------------------------------------- /samples/t1015-1.in: -------------------------------------------------------------------------------- 1 | iononmrogdg 2 | goodmorning -------------------------------------------------------------------------------- /samples/t1015-1.out: -------------------------------------------------------------------------------- 1 | 8 -------------------------------------------------------------------------------- /samples/t1016-1.in: -------------------------------------------------------------------------------- 1 | 5 7 2 | 1 2 6 3 | 5 1 1 4 | 2 3 4 5 | 3 4 3 6 | 4 1 7 7 | 2 4 2 8 | 4 5 5 -------------------------------------------------------------------------------- /samples/t1016-1.out: -------------------------------------------------------------------------------- 1 | 11 2 | Yes -------------------------------------------------------------------------------- /samples/t1016-2.in: -------------------------------------------------------------------------------- 1 | 4 5 2 | 1 2 1 3 | 2 3 1 4 | 3 4 2 5 | 4 1 2 6 | 3 1 3 -------------------------------------------------------------------------------- /samples/t1016-2.out: -------------------------------------------------------------------------------- 1 | 4 2 | No -------------------------------------------------------------------------------- /samples/t1016-3.in: -------------------------------------------------------------------------------- 1 | 5 5 2 | 1 2 1 3 | 2 3 1 4 | 3 4 2 5 | 4 1 2 6 | 3 1 3 -------------------------------------------------------------------------------- /samples/t1016-3.out: -------------------------------------------------------------------------------- 1 | No MST 2 | 2 -------------------------------------------------------------------------------- /samples/t1017-1.in: -------------------------------------------------------------------------------- 1 | 20 2 | 1 3 0 8 5 -2 29 20 20 4 10 4 7 25 18 6 17 16 2 -1 -------------------------------------------------------------------------------- /samples/t1017-1.out: -------------------------------------------------------------------------------- 1 | 10 14 25 -------------------------------------------------------------------------------- /samples/t1018-1.in: -------------------------------------------------------------------------------- 1 | 1234567890123456789 -------------------------------------------------------------------------------- /samples/t1018-1.out: -------------------------------------------------------------------------------- 1 | 332876913 -------------------------------------------------------------------------------- /samples/t1019-1.in: -------------------------------------------------------------------------------- 1 | 3 5 8 1 2 | ...O. 3 | .O... 4 | ..... -------------------------------------------------------------------------------- /samples/t1019-1.out: -------------------------------------------------------------------------------- 1 | 8 -------------------------------------------------------------------------------- /samples/t1020-1.in: -------------------------------------------------------------------------------- 1 | ababcc -------------------------------------------------------------------------------- /samples/t1020-1.out: -------------------------------------------------------------------------------- 1 | 15 -------------------------------------------------------------------------------- /samples/t1021-1.in: -------------------------------------------------------------------------------- 1 | 16 20 2 | 001 002 3 | 003 004 4 | 004 005 5 | 005 006 6 | 006 007 7 | 007 008 8 | 008 003 9 | 009 010 10 | 009 011 11 | 009 012 12 | 009 013 13 | 010 014 14 | 011 015 15 | 012 016 16 | 012 017 17 | 013 018 18 | 020 99 19 | 019 99 20 | 018 4 21 | 017 2 22 | 016 3 23 | 015 6 24 | 014 5 25 | 013 1 26 | 012 1 27 | 011 1 28 | 010 1 29 | 009 10 30 | 008 1 31 | 007 2 32 | 006 5 33 | 005 3 34 | 004 4 35 | 003 6 36 | 002 1 37 | 001 2 -------------------------------------------------------------------------------- /samples/t1021-1.out: -------------------------------------------------------------------------------- 1 | 12 2 | 002 004 006 008 009 014 015 016 017 018 019 020 3 | 239 -------------------------------------------------------------------------------- /samples/t1022-1.in: -------------------------------------------------------------------------------- 1 | 5 2 2 2 | -2 3 | +3 4 | -4 5 | +5 6 | +4 -------------------------------------------------------------------------------- /samples/t1022-1.out: -------------------------------------------------------------------------------- 1 | 4 1 -------------------------------------------------------------------------------- /samples/t1022-2.in: -------------------------------------------------------------------------------- 1 | 6 2 3 2 | -2 3 | +3 4 | -4 5 | +5 6 | +4 7 | -3 -------------------------------------------------------------------------------- /samples/t1022-2.out: -------------------------------------------------------------------------------- 1 | 6 4 -------------------------------------------------------------------------------- /samples/t1022-3.in: -------------------------------------------------------------------------------- 1 | 6 2 5 2 | -2 3 | +3 4 | -4 5 | +5 6 | +4 7 | +6 -------------------------------------------------------------------------------- /samples/t1022-3.out: -------------------------------------------------------------------------------- 1 | No Solution -------------------------------------------------------------------------------- /samples/t1023-1.in: -------------------------------------------------------------------------------- 1 | 10 6 2 | 133.0 1.0 3 | 544.0 71.0 4 | 558.0 206.0 5 | 536.0 338.0 6 | 463.0 436.0 7 | 330.0 503.0 8 | 188.0 499.0 9 | 305.0 2.0 10 | 55.0 410.0 11 | 2.0 140.0 -------------------------------------------------------------------------------- /samples/t1023-1.out: -------------------------------------------------------------------------------- 1 | 9 8 5 3 1 0 -------------------------------------------------------------------------------- /samples/t1024-1.in: -------------------------------------------------------------------------------- 1 | 6 9 2 | 4 3 CBC 32 3 | 1 5 HSB 43 4 | 1 0 HSB 32 5 | 0 2 CTB 28 6 | 4 2 CBC 19 7 | 2 3 CBC 28 8 | 0 4 ABC 28 9 | 1 2 ABC 32 10 | 3 1 CTB 19 -------------------------------------------------------------------------------- /samples/t1024-1.out: -------------------------------------------------------------------------------- 1 | 3 137 2 | 4 2 CBC 19 3 | 2 3 CBC 28 4 | 3 1 CTB 19 5 | 0 2 CTB 28 6 | 1 5 HSB 43 -------------------------------------------------------------------------------- /samples/t1025-1.in: -------------------------------------------------------------------------------- 1 | aabac -------------------------------------------------------------------------------- /samples/t1025-1.out: -------------------------------------------------------------------------------- 1 | 19 -------------------------------------------------------------------------------- /samples/t1026-1.in: -------------------------------------------------------------------------------- 1 | 8 2 | 18 20 2 97 23 12 8 5 3 | 3 3 5 8 1 5 2 1 -------------------------------------------------------------------------------- /samples/t1026-1.out: -------------------------------------------------------------------------------- 1 | 66 3 6 -------------------------------------------------------------------------------- /samples/t1027-1.in: -------------------------------------------------------------------------------- 1 | 3 2 | 2 1 3 -------------------------------------------------------------------------------- /samples/t1027-1.out: -------------------------------------------------------------------------------- 1 | 1 0 2 1 2 1 --------------------------------------------------------------------------------