Submission #138119


Source Code Expand

#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<string>
#include<string.h>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<complex>
#include<map>
#include<set>
#include<bitset>
#include<iostream>
#include<sstream>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < n; i++)
#define rrep(i,n) for(int i = 1; i <= n; i++)
#define drep(i,n) for(int i = n-1; i >= 0; i--)
#define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y);
#define mins(x,y) x = min(x,y);
#define pb push_back
#define sz(x) (int)(x).size()
#define popcount __builtin_popcount
#define snuke srand((unsigned)clock()+(unsigned)time(NULL))
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;

const int MX = 100005, INF = 2000000000;
const ll LINF = 1000000000000000000ll;
const double eps = 1e-10;
const int dx[] = {-1,0,1,0}, dy[] = {0,-1,0,1}; //<^>v

ll f(ll c){
	return c*(c-1)/2;
}

int main(){
	ll a, b;
	cin >> a >> b;
	a -= 2000; b--;
	b += (a-13)*12+(13*12/2);
	
	ll l = 0, r = (ll)INF, c;
	while(l+1<r){
		c = l+r>>1;
		if(f(c) <= b) l = c; else r = c;
	}
	
	printf("%lld %lld\n",2000+l,b-f(l)+1);
	
	return 0;
}




Submission Info

Submission Time
Task B - 13月
User snuke
Language C++ (G++ 4.6.4)
Score 100
Code Size 1433 Byte
Status AC
Exec Time 23 ms
Memory 916 KB

Judge Result

Set Name Small Large
Score / Max Score 50 / 50 50 / 50
Status
AC × 19
AC × 35
Set Name Test Cases
Small 01-max-small, 01-random-small01, 01-random-small02, 01-random-small03, 01-random-small04, 01-random-small05, 01-random-small06, 01-random-small07, 01-random-small08, 01-random-small09, 01-random-small10, 01-random-small11, 01-random-small12, 01-random-small13, 01-random-small14, 01-random-small15, 00-sample1, 00-sample2, 00-sample3
Large 00-sample1, 00-sample2, 00-sample3, 01-max-small, 01-random-small01, 01-random-small02, 01-random-small03, 01-random-small04, 01-random-small05, 01-random-small06, 01-random-small07, 01-random-small08, 01-random-small09, 01-random-small10, 01-random-small11, 01-random-small12, 01-random-small13, 01-random-small14, 01-random-small15, 10-max-large, 11-random-large01, 11-random-large02, 11-random-large03, 11-random-large04, 11-random-large05, 11-random-large06, 11-random-large07, 11-random-large08, 11-random-large09, 11-random-large10, 11-random-large11, 11-random-large12, 11-random-large13, 11-random-large14, 11-random-large15
Case Name Status Exec Time Memory
00-sample1 AC 22 ms 788 KB
00-sample2 AC 22 ms 792 KB
00-sample3 AC 23 ms 792 KB
01-max-small AC 20 ms 916 KB
01-random-small01 AC 22 ms 792 KB
01-random-small02 AC 22 ms 784 KB
01-random-small03 AC 19 ms 788 KB
01-random-small04 AC 23 ms 796 KB
01-random-small05 AC 21 ms 792 KB
01-random-small06 AC 21 ms 788 KB
01-random-small07 AC 22 ms 792 KB
01-random-small08 AC 20 ms 796 KB
01-random-small09 AC 23 ms 812 KB
01-random-small10 AC 20 ms 788 KB
01-random-small11 AC 23 ms 788 KB
01-random-small12 AC 21 ms 792 KB
01-random-small13 AC 22 ms 916 KB
01-random-small14 AC 21 ms 796 KB
01-random-small15 AC 21 ms 792 KB
10-max-large AC 21 ms 796 KB
11-random-large01 AC 21 ms 796 KB
11-random-large02 AC 22 ms 796 KB
11-random-large03 AC 21 ms 792 KB
11-random-large04 AC 22 ms 716 KB
11-random-large05 AC 21 ms 796 KB
11-random-large06 AC 22 ms 796 KB
11-random-large07 AC 21 ms 796 KB
11-random-large08 AC 23 ms 792 KB
11-random-large09 AC 21 ms 796 KB
11-random-large10 AC 20 ms 788 KB
11-random-large11 AC 21 ms 916 KB
11-random-large12 AC 23 ms 788 KB
11-random-large13 AC 21 ms 916 KB
11-random-large14 AC 22 ms 792 KB
11-random-large15 AC 21 ms 788 KB