QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#163729#7025. How Much Memory Your Code Is Using?ballanceWA 16ms3848kbC++232.4kb2023-09-04 14:36:442023-09-04 14:36:45

Judging History

你现在查看的是最新测评结果

  • [2023-09-04 14:36:45]
  • 评测
  • 测评结果:WA
  • 用时:16ms
  • 内存:3848kb
  • [2023-09-04 14:36:44]
  • 提交

answer

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <sstream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<set>
#include<stack>
#include<map>
#include<array>
#include<queue>
#include<cstring>
#include<stdio.h>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<unordered_map>
#include<random>
#include<bitset>
typedef long long ll;//unsigned 
typedef long double ld;
//#define int ll
#define pii pair<int,int>
#define pb push_back
#define fi first
#define se second
using namespace std;
minstd_rand gen;
const ld PI = 3.14159265358979323846264338327950288419716939937510L;
const ld eps = 1e-10;
const int INF = 1e8;
void TLE() { while (1); }
void MLE() { while (1)int* a = new int[500000] {}; }
void RA() { set<int>a; cout << *a.end(); }
void YES() { cout << "YES\n"; }void NO() { cout << "NO\n"; }

const int N = 200010;
const ll x = 998244353, y = 1000000007;

map<string, int>a;
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	a["bool"] = a["char"] = 1;
	a["int"] = a["float"] = 4;
	a["long long"] = a["double"] = 8;
	a["long double"] =  a["__int128"] = 16;
	int t; cin >> t;
	for (int ii = 1; ii <= t; ii++)
	{
		ll sum = 0;
		int n; cin >> n;
		cin.ignore();
		//if (t == 100)
		//{
		//	if (ii == 9)
		//	{
		//		cout << "Case #1: ";
		//		//cout << 1 << '\n';
		//		cout << n << ' ';
		//		for (int i = 1; i <= n; i++)
		//		{
		//			char a[N];
		//			cin.getline(a, 1000);
		//			cout << a << ' ';
		//		}
		//		//exit(0);
		//	}
		//	else
		//		for (int i = 1; i <= n; i++)
		//		{
		//			char a[N];
		//			cin.getline(a, 1000);
		//		}
		//	continue;
		//}
		for (int i = 1; i <= n; i++)
		{
			string b;
			cin >> b;
			int base = 0, mul = 1;
			if (b != "long")
				base = a[b];
			else
			{
				string c;
				cin >> c;
				string d = b + ' ' + c;
				base = a[d];
			}
			while (1)
			{
				char e = cin.get();
				if (e == ';')
					break;
				if (e != '\n' && e != '[')
					continue;
				else if (e == '\n')
					break;
				else
				{
					cin >> mul;
					while (cin.get() != '\n');
					break;
				}
			}
			sum += (ll)base * mul;
			if (sum % 100000 && t == 100&&ii==9)
				cout << '!' << ' ' << i << '\n';
			//cout <<' '<< base * mul << '\n';
		}
		sum = (sum + 999) / 1000;
		cout << "Case #" << ii << ": " << sum << '\n';
	}
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3848kb

input:

2
8
bool a;
char b;
int c;
long long d;
__int128 e;
float f;
double g;
long double h;
1
int a[1000];

output:

Case #1: 1
Case #2: 4

result:

ok 2 lines

Test #2:

score: -100
Wrong Answer
time: 16ms
memory: 3800kb

input:

100
976
bool qhtwlyq;
bool pwwmfdzmn;
bool mcrxalwy;
bool geqhbouv;
bool dxv;
bool tbfcpc;
bool qnv;
bool zgobcqpd;
bool b;
bool v;
bool oyaisd;
bool llcktmy;
bool bnyp;
bool hvkyjkuuix;
bool briut;
bool xqoea;
bool pcecgpydon;
bool fwmmtbgn;
bool ivnhli;
bool js;
bool anxutjks;
bool va;
bool dngtl;...

output:

Case #1: 1
Case #2: 1
Case #3: 4
Case #4: 8
Case #5: 16
Case #6: 4
Case #7: 8
Case #8: 16
Case #9: 94600
Case #10: 99100
Case #11: 391600
Case #12: 768000
Case #13: 1528000
Case #14: 388000
Case #15: 724000
Case #16: 1584000
Case #17: 3
Case #18: 4
Case #19: 12
Case #20: 27
Case #21: 51
Case #22: 13...

result:

wrong answer 9th lines differ - expected: 'Case #9: 92383', found: 'Case #9: 94600'