Submission #1825735


Source Code Expand

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
#define INF 1e9

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef vector < pair<int, int> > vii;
typedef long double ld;
typedef tree<pair<int,int>, null_type, less<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;


ll t, n, d;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> t;
	while(t--){
		cin >> n >> d;
		if(n%2){
			cout<<(n-1)*127+d<<endl;
		}
		else{
			cout<<n*127-d<<endl;
		}
	}
	return 0;
}

Submission Info

Submission Time
Task C - Cookie Breeding Machine
User vjudge5
Language C++14 (GCC 5.4.1)
Score 100
Code Size 865 Byte
Status AC
Exec Time 3 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 6
Set Name Test Cases
All 00_sample.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt
Case Name Status Exec Time Memory
00_sample.txt AC 1 ms 256 KB
random_00.txt AC 3 ms 256 KB
random_01.txt AC 3 ms 256 KB
random_02.txt AC 3 ms 256 KB
random_03.txt AC 3 ms 256 KB
random_04.txt AC 3 ms 256 KB