WA on #5 83pts 求条
查看原帖
WA on #5 83pts 求条
1058410
Gcc_Gdb_7_8_1楼主2025/1/31 20:46

这是蒟蒻第三次找人求条。(真不要脸

WA on #5

#include <bits/stdc++.h>
#ifndef __DEBUG_LIB
#define __DEBUG_LIB

bool isdebug = false;

#define change(x) isdebug = x
#define Debugc if(isdebug) cout
#define Debug if(isdebug)

#endif
using namespace std;

#define LL long long
#define Pii pair<int, int>
#define ULL unsigned long long

namespace gdb7
{
	string str[13];
	int hit[13], score[13];
	bool vis[13];
	signed main() {
		int tscore = 0, len = 0;
		for (len = 1; len <= 12 && cin >> str[len]; ++len) {
			if (str[len][0] == '/' || str[len][1] == '/') {
				hit[len] = 10;
			} else {
				hit[len] = str[len][0] - 48 + str[len][1] - 48;
			}
		}
		--len;
//		cout << len << endl; 
		for (int i = min(10, len); i >= 1; --i) {
			if (str[i][0] == '/') {
				if (i <= len - 1) {
					if (str[i + 1][0] == '/') {
						if (i <= len - 2) {
							vis[i] = true;
							score[i] = 10 + 10 + (str[i + 2][0] == '/' ? 10 : str[i + 2][0] - '0');
						} else {
							continue;
						}
					} else {
						vis[i] = true;
						score[i] = 10 + hit[i + 1];
					}
				} else {
					continue;
				}
			} else if (str[i][1] == '/') {
				if (i <= len - 1) {
					score[i] = 10 + (str[i + 1][0] == '/' ? 10 : str[i + 1][0] - 48);
					vis[i] = true;
				} else {
					continue;
				}
			} else {
				score[i] = hit[i];
				vis[i] = true;
			}
		}
		for (int i = 1; i <= 10; ++i) {
			if (vis[i]) {
				cout << score[i] << " ";
			}
		}
		cout << endl;
		for (int i = 1; i <= 10; ++i) {
			if (vis[i]) {
				tscore += score[i];
				cout << tscore << " ";
			}
		}
	    return 0;
	}
};

signed main()
{
	return gdb7::main();
}


2025/1/31 20:46
加载中...