Submission #1642506


Source Code Expand

#include "bits/stdc++.h"
#include <unordered_set>
using namespace std;

#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
const int inf = 1000000001;
const ll INF = 1e16;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<<fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };

/*
cin.tie(0);
ios::sync_with_stdio(false);
*/
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int t;
	cin >> t;
	int i;
	for (i = 0; i < t; i++) {
		int n, d, j;
		cin >> n >> d;
		ll sum = d;
		for (j = 1; j < n; j++) {
			ll y = d ^ 127;
			sum -= d;
			sum += 127;
			sum += y;
			d = y;
		}
		cout << sum << endl;
	}
}

Submission Info

Submission Time
Task C - Cookie Breeding Machine
User fuppy0716
Language C++14 (GCC 5.4.1)
Score 100
Code Size 1132 Byte
Status AC
Exec Time 4 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 4 ms 256 KB
random_01.txt AC 4 ms 256 KB
random_02.txt AC 4 ms 256 KB
random_03.txt AC 4 ms 256 KB
random_04.txt AC 4 ms 256 KB