自分が解いていて、相手が解いていない問題が分かるようなスクリプトをpythonで書いてみました。
導入方法が下のほうに書いてあります。
from aojtools import api
import sys
print 'Initializing please wait...'
allu=api.alluserlist()
yourID=raw_input('Please input your ID.\n')
competeID=raw_input('Please input rival ID.\n')
if len([x for x in allu.user if x.id==yourID])==0 :
print 'Does not exist your ID.'
sys.exit()
if len([x for x in allu.user if x.id==competeID])==0 :
print 'Does not exist rival ID.'
sys.exit()
your=api.user(id=yourID)
print 'Got your information\n'
compete=api.user(id=competeID)
print 'Got your rival information\n'
print 'Your rival solved',compete.status.solved,'problems.'
print 'You solved',your.status.solved,'problems.'
print ''
competesolved=[x.id for x in compete.solved_list.problem]
yoursolved=[x.id for x in your.solved_list.problem]
set_ru=set(competesolved)-set(yoursolved)
set_ur=set(yoursolved)-set(competesolved)
onlycompetesolved=list(set_ru)
onlyyoursolved=list(set_ur)
onlycompetesolved.sort()
onlyyoursolved.sort()
print 'Only your rival solved are list below'
pr=0
for x in onlycompetesolved:
if pr%15==0:
print ''
print "%4d"%(x),
pr+=1
print ''
print ''
print ''
print 'Only you solved are list below'
pr=0
for x in onlyyoursolved:
if pr%15==0:
print ''
print "%4d"%(x),
pr+=1
print ''
自分が取った方法はwindows限定ですが以下のようなものです。
①cygwinで全パッケージインストール(最低でもAll->Interpreters->pythonとAll->web->wgetの2つとそれに付随するパッケージはあったほうが良いと思われます。)
②ココで公開してもらっているpython用のAOJ向けラッパを使わせてもらっているので、そのパッケージをインストールします。以下のような手順になります。
③まずeasy_installというツールをインストールする以下のコマンドをシェル上で実行してください。 あとは上のサイトで書かれているように というコマンドを実行すれば、このスクリプトがまともに動くようになるはずです。
このスクリプトの使い方は次のようなものです。
①適当な名前で適当な場所にスクリプトを保存しましょう。
よく分からない方はホームディレクトリが手っ取り早いと思われます。
ここではaoj.pyとしてみます。
②python aoj.py
で実行します。
③Please input your ID.と表示されたらあなたのIDを入力してください。(名前ではなくIDであることに注意してください。)
④Please input rival ID.と表示されたら比較したい相手のIDを入力してください。(名前ではなく(ry
⑤二つのIDが両方共AOJ上に存在するIDであれば以下のような出力が得られるはずです。
ここでは自分と、AOJで一番解いている方とを比較してみました。
以下のような出力が得られましたorz
$ python aoj.py
Initializing please wait...
Please input your ID.
atetubou
Please input rival ID.
s1150092
Got your information
Got your rival information
Your rival solved 605 problems.
You solved 246 problems.
Only your rival solved are list below
41 43 68 69 70 87 88 90 110 111 113 114 116 118 120
121 122 126 129 130 131 135 139 143 144 145 146 147 151 152
153 154 155 156 157 160 162 163 164 165 166 169 170 171 172
175 176 177 178 180 181 182 183 186 187 189 190 192 193 194
199 202 204 207 211 212 213 214 215 224 225 229 234 235 236
237 503 508 517 518 525 527 529 530 531 535 537 539 546 547
1001 1002 1003 1006 1011 1012 1014 1017 1018 1020 1021 1022 1023 1026 1028
1031 1032 1034 1037 1038 1039 1044 1046 1047 1049 1050 1101 1102 1103 1106
1107 1108 1110 1111 1115 1116 1118 1121 1122 1125 1126 1127 1128 1131 1132
1133 1134 1138 1139 1140 1142 1143 1144 1145 1149 1150 1151 1155 1156 1157
1162 1163 1166 1168 1171 1201 1202 1203 1204 1206 1207 1208 1210 1211 1212
1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1225 1226 1227 1228 1229
1230 1231 1232 1233 1234 1235 1236 1237 1238 1240 1241 1242 1243 1244 1245
1246 1248 1249 1250 1251 1252 1253 1254 1255 1258 1259 1260 1261 1262 1263
1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1277 1278 1279 1280 1281
1282 1283 1285 1286 1287 1288 1289 1290 1291 1292 1294 1296 1297 1298 1299
1300 1301 1302 1303 1304 1306 1307 1309 2002 2003 2004 2008 2009 2010 2011
2013 2014 2017 2018 2019 2020 2021 2022 2023 2025 2026 2027 2028 2031 2032
2033 2034 2035 2036 2040 2041 2042 2045 2049 2050 2052 2055 2057 2058 2059
2061 2063 2064 2065 2069 2070 2071 2075 2076 2079 2080 2083 2085 2086 2087
2089 2090 2091 2093 2094 2095 2096 2097 2102 2103 2105 2106 2107 2108 2113
2115 2117 2119 2121 2123 2129 2130 2131 2134 2135 2137 2138 2139 2141 2142
2143 2146 2150 2151 2152 2153 2155 2156 2157 2160 2161 2163 2165 2166 2167
2168 2169 2171 2172 2175 2177 2179 2180 2182 2186 2187 2188 2189 2191 2193
2199 2200 2201 2207 2208 2218 2220 2221 2244 2250
Only you solved are list below
37 528 543 1051 1052 1053 1054 2024 2204 2205 2242
こうしたほうがいいんじゃない?というようなところを見つけましたら、コメントなど頂けるとうれしいです。