QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#143226 | #7025. How Much Memory Your Code Is Using? | Sorting# | WA | 2ms | 3544kb | C++20 | 1.5kb | 2023-08-20 22:24:57 | 2023-08-20 22:25:00 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
typedef unsigned long long ull ;
typedef pair < int , int > pii ;
#define fi first
#define se second
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int id ;
void solve ( ) {
int q ; cin >> q ;
string a ;
ll ans = 0 ;
++ q ;
++ id ;
while ( q -- ) {
getline ( cin , a ) ;
int sz = a.size ( ) ;
ll coef = 0 ;
if ( a[ 0 ] == 'b' ) { coef = 1 ; } // bool
if ( a[ 0 ] == 'c' ) { coef = 1 ; } // char
if ( a[ 0 ] == 'i' ) { coef = 4 ; } // int
if ( a[ 0 ] == 'l' && a[ 5 ] == 'l' ) { coef = 8 ; } // long long
if ( a[ 0 ] == '_' ) { coef = 16 ; } // __int128
if ( a[ 0 ] == 'f' ) { coef = 4 ; }
if ( a[ 0 ] == 'd' ) { coef = 8 ; }
if ( a[ 0 ] == 'l' && a[ 5 ] == 'd' ) { coef = 16 ; }
ll hh = 1 ;
ll nw = 0 ;
bool fl = false ;
for ( int i = 0 ; i < sz ; ++ i ) {
if ( a[ i ] == '[' ) { fl = true ; }
if ( a[ i ] == ']' ) { break ; }
if ( fl == true && a[ i ] != '[' ) {
nw = ( nw * 10 + ( a[ i ] - '0' ) ) ;
}
}
if ( fl == true ) { hh = nw ; }
ans += coef * hh ;
}
cout << "Case #" << id << ": " << ( ans + 999 ) / 1000 << "\n" ;
}
int main ( ) {
ios_base :: sync_with_stdio ( false ) ;
cin.tie ( NULL ) ;
int t = 1 ; cin >> t ;
while ( t -- ) { solve ( ) ; }
return 0 ;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3524kb
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: 2ms
memory: 3544kb
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'