Submission #1753166


Source Code Expand

/*
exit
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
 
#define BIG 2000000007
 
#define MOD 1000000007
typedef unsigned long long ull;
typedef   signed long long sll;

#define N_MAX 100000
#define M_MAX 10000
 
typedef struct {
	int a;
	int b;
} hw;

typedef struct {
	sll a;
	sll b;
} hwll;
 
 
const hw vector8[8] = {
	{-1, -1},
	{-1,  0},
	{-1, +1},
	{ 0, -1},
	{ 0, +1},
	{+1, -1},
	{+1,  0},
	{+1, +1}
};
 
ull n, m;
ull h, w;
ull k;
sll va, vb, vc, vd, ve, vf;
ull a[N_MAX];
// sll a[N_MAX];
// ull b[N_MAX];
ull dp[N_MAX];
// ull dp[N_MAX][N_MAX];
// ull dp[N_MAX][M_MAX + 1];
// char s[N_MAX + 1];
// char t[N_MAX + 1];
// char s[N_MAX][M_MAX + 1];
// hw arr[N_MAX];
// hwll arr[N_MAX];
// hw brr[M_MAX];
// ull digitdp[102][   2][    2];
//          pos  less  carry
 
void swap_adj(ull *a, ull *b){
	ull tmp = *b;
	*b = *a;
	*a = tmp;
	return;
}
 
ull divide(ull a, ull b){
	ull x = MOD - 2;
	ull ans = 1;
	while (x) {
		if (x & 1) ans = (ans * b) % MOD;
		b = (b * b) % MOD;
		x /= 2;
	}
	return (a * ans) % MOD;
}
 
int digits(ull x){
	int i = 1;
	while (x >= 10) {
		x /= 10;
		i++;
	}
	return i;
}
 
ull min(ull x, ull y){
	return (x < y) ? x : y;
}
 
ull gcd(ull x, ull y){
	if (x < y) {
		return gcd(y, x);
	} else if (y == 0) {
		return x;
	} else {
		return gcd(y, x % y);
	}
}
 
ull bitpow(ull a, ull x){
	ull result = 1;
	while (x) {
		if (x & 1) {
			result *= a;
			result %= MOD;
		}
		x /= 2;
		a = (a * a) % MOD;
	}
	return result;
}
 
// int nextroute(int arr[]){
// 	int i = n - 1;
// 	int j, x;
// 	while (arr[i - 1] > arr[i]) i--;
 
// 	x = n;
// 	for (j = i; j < n; j++) {
// 		if (arr[j] < arr[i - 1]) continue;
// 		if (x == n || arr[x] > arr[j]) x = j;
// 	}
// 	arr[i - 1] ^= arr[x];
// 	arr[x] ^= arr[i - 1];
// 	arr[i - 1] ^= arr[x];
 
// 	qsort(&arr[i], n - i, sizeof(int), comp);
// 	return 0;
// }
 
int nibutan_target(ull target){
	ull maxdist = (target * (target + 1) / 2); // 時刻targetまでに到着できる距離は[-maxdist, maxdist]
	return (n <= maxdist);
}
 
int targetdig(ull x, int index /* 1-indexed */){
	// static...?
	int posmax = digits(x);
	if (posmax < index) return -1;
	while (posmax > index) {
		posmax--;
		x /= 10;
	}
	return x % 10;
}
 
int intcomp(const void *left, const void *right){
	if ((*(int*)left) < (*(int*)right)) {
		return -1;
	} else if ((*(int*)left) > (*(int*)right)) {
		return +1;
	} else {
		return 0;
	}
}

int ullcomp(const void *left, const void *right){
	if ((*(ull*)left) < (*(ull*)right)) {
		return -1;
	} else if ((*(ull*)left) > (*(ull*)right)) {
		return +1;
	} else {
		return 0;
	}
}

int sllcomp(const void *left, const void *right){
	if ((*(sll*)left) < (*(sll*)right)) {
		return -1;
	} else if ((*(sll*)left) > (*(sll*)right)) {
		return +1;
	} else {
		return 0;
	}
}

int hwAcomp(const void *left, const void *right){
	return intcomp(&(((hw*)left)->a), &(((hw*)right)->a));
}
 
int hwBcomp(const void *left, const void *right){
	return intcomp(&(((hw*)left)->b), &(((hw*)right)->b));
}
 
int hwABcomp(const void *left, const void *right){
	int x = hwAcomp(left, right);
	if (x) return x;
	return hwBcomp(left, right);
}

int hwllAcomp(const void *left, const void *right){
	return sllcomp(&(((hw*)left)->a), &(((hw*)right)->a));
}
 
int hwllBcomp(const void *left, const void *right){
	return sllcomp(&(((hw*)left)->b), &(((hw*)right)->b));
}
 
int hwllABcomp(const void *left, const void *right){
	int x = hwllAcomp(left, right);
	if (x) return x;
	return hwllBcomp(left, right);
}

int ispalin(int x){
	return (x == 0) || ((x & -x) == x);
}

int bitlet(char c){
	return (1 << (c - 'a'));
}

ull solve(){
	int i, j, ki;

	printf("%llu\n", n / (m + 1));

	return 1;
}
 
int main(void){
	int i, j;
	int x, y;
	int s[10] = {32, 1, 6, 0, 2, 4, 7, 13, 11, 5};

	scanf("%llu%llu", &n, &m, &va, &vb, &vc, &vd);

	solve();

	return 0;
}

Submission Info

Submission Time
Task C - amylasemania IIDX
User sheyasutaka
Language C (GCC 5.4.1)
Score 100
Code Size 4121 Byte
Status AC
Exec Time 2 ms
Memory 128 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:227:8: warning: too many arguments for format [-Wformat-extra-args]
  scanf("%llu%llu", &n, &m, &va, &vb, &vc, &vd);
        ^
./Main.c:227:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%llu%llu", &n, &m, &va, &vb, &vc, &vd);
  ^

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 37
Set Name Test Cases
All 00-sample-00, 00-sample-01, 10-small-00, 10-small-01, 10-small-02, 10-small-03, 10-small-04, 10-small-05, 10-small-06, 10-small-07, 10-small-08, 10-small-09, 10-small-10, 10-small-11, 10-small-12, 10-small-13, 10-small-14, 20-large-00, 20-large-01, 20-large-02, 20-large-03, 20-large-04, 30-random-00, 30-random-01, 30-random-02, 30-random-03, 30-random-04, 30-random-05, 30-random-06, 30-random-07, 30-random-08, 30-random-09, 30-random-10, 30-random-11, 30-random-12, 30-random-13, 30-random-14
Case Name Status Exec Time Memory
00-sample-00 AC 1 ms 128 KB
00-sample-01 AC 1 ms 128 KB
10-small-00 AC 1 ms 128 KB
10-small-01 AC 1 ms 128 KB
10-small-02 AC 1 ms 128 KB
10-small-03 AC 1 ms 128 KB
10-small-04 AC 1 ms 128 KB
10-small-05 AC 1 ms 128 KB
10-small-06 AC 1 ms 128 KB
10-small-07 AC 1 ms 128 KB
10-small-08 AC 1 ms 128 KB
10-small-09 AC 1 ms 128 KB
10-small-10 AC 1 ms 128 KB
10-small-11 AC 1 ms 128 KB
10-small-12 AC 1 ms 128 KB
10-small-13 AC 1 ms 128 KB
10-small-14 AC 1 ms 128 KB
20-large-00 AC 1 ms 128 KB
20-large-01 AC 1 ms 128 KB
20-large-02 AC 1 ms 128 KB
20-large-03 AC 2 ms 128 KB
20-large-04 AC 1 ms 128 KB
30-random-00 AC 1 ms 128 KB
30-random-01 AC 1 ms 128 KB
30-random-02 AC 1 ms 128 KB
30-random-03 AC 1 ms 128 KB
30-random-04 AC 1 ms 128 KB
30-random-05 AC 1 ms 128 KB
30-random-06 AC 1 ms 128 KB
30-random-07 AC 1 ms 128 KB
30-random-08 AC 1 ms 128 KB
30-random-09 AC 1 ms 128 KB
30-random-10 AC 1 ms 128 KB
30-random-11 AC 1 ms 128 KB
30-random-12 AC 1 ms 128 KB
30-random-13 AC 1 ms 128 KB
30-random-14 AC 1 ms 128 KB