日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

UVa 10188 - Automated Judge Script

發布時間:2024/4/17 编程问答 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 UVa 10188 - Automated Judge Script 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

題目:給你一些題目的輸出結果,推斷是AC,PE還是WA。

分析:模擬。

依照題意模擬就可以,注意PE條件為全部數字字符出現順序同樣就可以。

說明:想起非常多年前寫的OJ的后臺判題程序了╮(╯▽╰)╭。

#include <algorithm> #include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> #include <cmath>using namespace std;char list1[101][122]; char list2[101][122]; char numb1[12001]; char numb2[12001];int main() {int n,m,t = 1;while (~scanf("%d",&n) && n) {getchar();for (int i = 0; i < n; ++ i)gets(list1[i]);scanf("%d",&m);getchar();for (int i = 0; i < m; ++ i)gets(list2[i]);int AC = 1;if (m == n) {for (int i = 0; i < n; ++ i)if (strcmp(list1[i], list2[i])) {AC = 0;break;}}else AC = 0;int PE = 1,save1 = 0,save2 = 0;for (int i = 0; i < n; ++ i)for (int j = 0; list1[i][j]; ++ j)if (list1[i][j] >= '0' && list1[i][j] <= '9')numb1[save1 ++] = list1[i][j];for (int i = 0; i < m; ++ i) for (int j = 0; list2[i][j]; ++ j)if (list2[i][j] >= '0' && list2[i][j] <= '9')numb2[save2 ++] = list2[i][j]; if (save1 == save2) {for (int i = 0; i < save1; ++ i)if (numb1[i] != numb2[i]) {PE = 0;break;}}else PE = 0;printf("Run #%d: ",t ++);if (AC) printf("Accepted\n");else if (PE) printf("Presentation Error\n");else printf("Wrong Answer\n");}return 0; }

轉載于:https://www.cnblogs.com/bhlsheji/p/5152146.html

總結

以上是生活随笔為你收集整理的UVa 10188 - Automated Judge Script的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。