Submission #3585602
Source Code Expand
#if 0
cat <<EOF >mistaken-paste
#endif
// thanks for @rsk0315_h4x
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define BIG 2000000007
#define VERYBIG 2000000000000007LL
#define MOD 1000000007
#define FOD 998244353
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 1000000
#ifdef __cplusplus
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <functional>
#include <array>
using std::queue;
using std::priority_queue;
using std::stack;
using std::tuple;
using std::set;
using std::map;
using std::vector;
using std::greater;
using std::pair;
using std::string;
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> l, pair<T, U> r) {
return pair<T, U>(l.first + r.first, l.second + r.second);
}
#endif
typedef struct {
int32_t a;
int32_t b;
} hw;
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
sll a;
sll b;
sll c;
} hwllc;
typedef struct {
hwll a;
hwll b;
} linell;
ull n, m;
ull h, w;
ull k;
ull q;
sll va, vb, vc, vd, ve, vf;
ull ua, ub, uc, ud, ue, uf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
char ch, dh;
ull umin (ull x, ull y) {
return (x < y) ? x : y;
}
ull umax (ull x, ull y) {
return (x > y) ? x : y;
}
sll smin (sll x, sll y) {
return (x < y) ? x : y;
}
sll smax (sll x, sll 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 modulo) {
ull result = 1;
while (x) {
if (x & 1) {
result *= a;
result %= modulo;
}
x /= 2;
a = (a * a) % modulo;
}
return result;
}
ull divide (ull a, ull b, ull modulo) {
return (a * bitpow(b, modulo - 2, modulo)) % modulo;
}
ull udiff (ull a, ull b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
sll sdiff (sll a, sll b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
int bitcount (ull n) {
int result = 0;
while (n) {
if (n & 1) result++;
n /= 2;
}
return result;
}
#define BEGCMP(NAME) int32_t NAME (const void *left, const void *right)
#define DEFLR(TYPE) TYPE l=*(TYPE*)left,r=*(TYPE*)right
#define CMPRET(L, R) if((L)<(R))return-1;if((L)>(R))return+1
// int32_t pullcomp (const void *left, const void *right) {
// ull l = *(ull*)left;
// ull r = *(ull*)right;
// if (l < r) {
// return -1;
// }
// if (l > r) {
// return +1;
// }
// return 0;
// }
BEGCMP(pullcomp){
DEFLR(ull);
CMPRET(l, r);
return 0;
}
BEGCMP(prevcomp){
DEFLR(ull);
CMPRET(r, l);
return 0;
}
BEGCMP(psllcomp){
DEFLR(sll);
CMPRET(l, r);
return 0;
}
BEGCMP(pcharcomp){
DEFLR(char);
CMPRET(l, r);
return 0;
}
BEGCMP(pdoublecomp){
DEFLR(double);
CMPRET(l, r);
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
BEGCMP(phwllABcomp){
DEFLR(hwll);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
BEGCMP(phwllREVcomp){
DEFLR(hwll);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
return 0;
}
BEGCMP(ptriplecomp){
DEFLR(hwllc);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
CMPRET(l.c, r.c);
return 0;
}
BEGCMP(ptripleREVcomp){
DEFLR(hwllc);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
CMPRET(l.c, r.c);
return 0;
}
int32_t pquadcomp (const void *left, const void *right) {
linell l = *(linell*)left;
linell r = *(linell*)right;
sll ac = phwllABcomp(&(l.a), &(r.a));
if (ac) return ac;
sll bc = phwllABcomp(&(l.b), &(r.b));
if (bc) return bc;
return 0;
}
bool isinrange (sll left, sll x, sll right) {
return (left <= x && x <= right);
}
bool isinrange_soft (sll left, sll x, sll right) {
return (left <= x && x <= right) || (left >= x && x >= right);
}
sll a[N_MAX + 5];
// ull a[N_MAX];
// sll a[3001][3001];
sll b[N_MAX + 5];
// sll b[3001][3001];
sll c[N_MAX + 5];
sll d[N_MAX + 5];
// sll e[N_MAX];
char s[N_MAX + 1];
// char s[3010][3010];
char t[N_MAX + 1];
// char t[3010][3010];
char u[N_MAX + 1];
hwll xy[N_MAX];
hwllc tup[N_MAX];
sll table[3000][3000];
// here we go
ull solve () {
sll i, j, ki, li;
// ull result = 0;
sll result = 0;
double dresult = 0;
// ull maybe = 0;
sll maybe = 0;
// ull sum = 0;
sll sum = 0;
sll item;
ull *dpcell;
if (n <= m) goto fail;
i = 0;
j = 0;
ull del = 0;
while (j <= m) {
if (i == n + m) break;
if (!j) {
a[j++] = i;
} else {
printf("? %llu %llu\n", a[j - 1], i);
fflush(stdout);
scanf(" %c", &ch);
if (ch == 'Y') {
a[j++] = i;
} else {
j--;
}
}
i++;
}
ull y = a[j - 1];
for (i = 0; i < n + m; i++) {
printf("? %llu %llu\n", y, i);
fflush(stdout);
scanf(" %c", &ch);
s[i] = (ch == 'Y' ? '1' : '0');
}
putchar('!');
putchar(' ');
// printf("%lld\n", result);
// printf("%.15lf\n", dresult);
puts(s);
return 0;
success:
// puts("YES");
// puts("Yes");
printf("%llu\n", result);
// puts("0");
// puts("Yay!");
return 0;
fail:
// puts("NO");
// puts("No");
// puts("0");
// puts("-1");
// puts("-1 -1 -1");
puts("Impossible");
return 1;
}
int32_t main (void) {
int32_t i, j;
int32_t x, y;
// scanf("%llu%llu", &h, &w);
scanf("%llu%llu", &n, &m);
// scanf("%llu", &k, &n, &m);
// scanf("%llu%llu", &h, &w);
// scanf("%llu", &q);
// scanf("%s", s);
// scanf("%lld%lld%lld%lld", &va, &vb, &vc, &vd);
// scanf("%llu%llu%llu", &ua, &ub, &uc, &ud);
// scanf("%s", t);
// scanf("%d", &n);
// for (i = 0; i < n; i++) {
// // scanf("%lld%lld", &xy[i].a, &xy[i].b);
// // scanf("%lld%lld%lld", &tup[i].a, &tup[i].b, &tup[i].c);
// scanf("%lld", &a[i]);
// scanf("%lld", &b[i]);
// // scanf("%lld", &c[i]);
// // scanf("%lld", &d[i]);
// // a[i]--;
// // b[i]--;
// // c[i]--;
// // d[i]--;
// // tup[i].a--;
// // tup[i].b--;
// }
// scanf("%llu", &m, &k);
// scanf("%llu", &q);
// scanf("%s", s);
// for (i = 0; i < n; i++) {
// scanf("%lld", &b[i]);
// // b[i]--;
// }
// scanf("%llu", &q);
// for (i = 0; i < h; i++) {
// for (j = 0; j < w; j++) {
// scanf("%llu", &table[i][j]);
// }
// }
// for (i = 0; i < h; i++) {
// scanf("%s", &s[i]);
// }
solve();
return 0;
}
Submission Info
Submission Time
2018-11-11 20:33:47+0900
Task
F - HonestOrUnkind
User
sheyasutaka
Language
C (GCC 5.4.1)
Score
1300
Code Size
6733 Byte
Status
AC
Exec Time
361 ms
Memory
8788 KB
Compile Error
./Main.c: In function ‘solve’:
./Main.c:293:11: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘sll {aka long int}’ [-Wformat=]
printf("? %llu %llu\n", a[j - 1], i);
^
./Main.c:293:11: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘sll {aka long int}’ [-Wformat=]
./Main.c:308:10: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘ull {aka long unsigned int}’ [-Wformat=]
printf("? %llu %llu\n", y, i);
^
./Main.c:308:10: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘sll {aka long int}’ [-Wformat=]
./Main.c:325:9: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘sll {aka long int}’ [-Wformat=]
printf("%llu\n", result);
^
./Main.c: In function ‘main’:
./Main.c:347:8: warning: format ‘%llu’ expects argument of type ‘long lo...
Judge Result
Set Name
All
Score / Max Score
1300 / 1300
Status
Set Name
Test Cases
All
000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 029.txt, 030.txt, 031.txt, 032.txt, 033.txt, 034.txt, 035.txt, 036.txt, 037.txt, 038.txt, 039.txt, 040.txt, 041.txt, 042.txt, 043.txt, 044.txt, 045.txt, 046.txt, 047.txt, 048.txt, 049.txt, 050.txt, 051.txt, 052.txt, 053.txt, 054.txt, 055.txt, 056.txt, 057.txt, 058.txt, 059.txt, 060.txt, 061.txt, 062.txt, 063.txt, 064.txt, 065.txt, 066.txt, 067.txt, 068.txt, 069.txt, 070.txt, 071.txt, 072.txt, 073.txt, 074.txt, 075.txt, 076.txt, 077.txt, 078.txt, 079.txt, 080.txt, 081.txt, 082.txt, 083.txt, 084.txt, 085.txt, 086.txt, 087.txt, 088.txt, 089.txt, 090.txt, 091.txt, 092.txt, 093.txt, 094.txt, 095.txt, 096.txt, 097.txt, 098.txt, 099.txt, 100.txt, 101.txt, 102.txt, 103.txt, 104.txt, 105.txt, 106.txt, 107.txt, 108.txt, 109.txt, 110.txt, 111.txt, 112.txt, 113.txt, 114.txt, 115.txt, 116.txt, 117.txt, 118.txt, 119.txt, 120.txt, 121.txt, 122.txt, 123.txt, 124.txt, 125.txt
Case Name
Status
Exec Time
Memory
000.txt
AC
5 ms
8784 KB
001.txt
AC
4 ms
8660 KB
002.txt
AC
4 ms
8788 KB
003.txt
AC
4 ms
8784 KB
004.txt
AC
4 ms
8784 KB
005.txt
AC
4 ms
8656 KB
006.txt
AC
4 ms
8788 KB
007.txt
AC
4 ms
8784 KB
008.txt
AC
4 ms
8784 KB
009.txt
AC
5 ms
8788 KB
010.txt
AC
19 ms
8660 KB
011.txt
AC
353 ms
8780 KB
012.txt
AC
92 ms
8656 KB
013.txt
AC
4 ms
8784 KB
014.txt
AC
4 ms
8788 KB
015.txt
AC
4 ms
8784 KB
016.txt
AC
4 ms
8788 KB
017.txt
AC
4 ms
8784 KB
018.txt
AC
4 ms
8656 KB
019.txt
AC
4 ms
8788 KB
020.txt
AC
4 ms
8788 KB
021.txt
AC
5 ms
8784 KB
022.txt
AC
5 ms
8784 KB
023.txt
AC
17 ms
8788 KB
024.txt
AC
357 ms
8788 KB
025.txt
AC
92 ms
8784 KB
026.txt
AC
4 ms
8784 KB
027.txt
AC
4 ms
8788 KB
028.txt
AC
4 ms
8788 KB
029.txt
AC
4 ms
8784 KB
030.txt
AC
4 ms
8784 KB
031.txt
AC
4 ms
8788 KB
032.txt
AC
4 ms
8784 KB
033.txt
AC
5 ms
8788 KB
034.txt
AC
5 ms
8660 KB
035.txt
AC
5 ms
8660 KB
036.txt
AC
18 ms
8784 KB
037.txt
AC
355 ms
8788 KB
038.txt
AC
86 ms
8784 KB
039.txt
AC
4 ms
8788 KB
040.txt
AC
4 ms
8784 KB
041.txt
AC
4 ms
8784 KB
042.txt
AC
4 ms
8780 KB
043.txt
AC
4 ms
8784 KB
044.txt
AC
4 ms
8784 KB
045.txt
AC
4 ms
8784 KB
046.txt
AC
4 ms
8784 KB
047.txt
AC
5 ms
8788 KB
048.txt
AC
5 ms
8780 KB
049.txt
AC
18 ms
8788 KB
050.txt
AC
361 ms
8784 KB
051.txt
AC
88 ms
8788 KB
052.txt
AC
4 ms
8784 KB
053.txt
AC
4 ms
8784 KB
054.txt
AC
4 ms
8784 KB
055.txt
AC
4 ms
8784 KB
056.txt
AC
4 ms
8660 KB
057.txt
AC
4 ms
8788 KB
058.txt
AC
4 ms
8784 KB
059.txt
AC
4 ms
8784 KB
060.txt
AC
5 ms
8788 KB
061.txt
AC
5 ms
8784 KB
062.txt
AC
18 ms
8788 KB
063.txt
AC
342 ms
8788 KB
064.txt
AC
92 ms
8784 KB
065.txt
AC
4 ms
8784 KB
066.txt
AC
4 ms
8788 KB
067.txt
AC
4 ms
8780 KB
068.txt
AC
4 ms
8784 KB
069.txt
AC
4 ms
8780 KB
070.txt
AC
4 ms
8784 KB
071.txt
AC
4 ms
8788 KB
072.txt
AC
4 ms
8784 KB
073.txt
AC
5 ms
8788 KB
074.txt
AC
5 ms
8788 KB
075.txt
AC
19 ms
8788 KB
076.txt
AC
357 ms
8788 KB
077.txt
AC
90 ms
8784 KB
078.txt
AC
4 ms
8784 KB
079.txt
AC
4 ms
8788 KB
080.txt
AC
4 ms
8784 KB
081.txt
AC
4 ms
8788 KB
082.txt
AC
4 ms
8788 KB
083.txt
AC
5 ms
8784 KB
084.txt
AC
4 ms
8780 KB
085.txt
AC
4 ms
8788 KB
086.txt
AC
5 ms
8788 KB
087.txt
AC
5 ms
8780 KB
088.txt
AC
18 ms
8784 KB
089.txt
AC
355 ms
8784 KB
090.txt
AC
91 ms
8784 KB
091.txt
AC
4 ms
8788 KB
092.txt
AC
4 ms
8784 KB
093.txt
AC
4 ms
8788 KB
094.txt
AC
4 ms
8788 KB
095.txt
AC
4 ms
8788 KB
096.txt
AC
4 ms
8788 KB
097.txt
AC
4 ms
8788 KB
098.txt
AC
4 ms
8788 KB
099.txt
AC
4 ms
8788 KB
100.txt
AC
5 ms
8788 KB
101.txt
AC
19 ms
8788 KB
102.txt
AC
350 ms
8788 KB
103.txt
AC
84 ms
8784 KB
104.txt
AC
4 ms
8788 KB
105.txt
AC
4 ms
8788 KB
106.txt
AC
4 ms
8788 KB
107.txt
AC
4 ms
8784 KB
108.txt
AC
4 ms
8784 KB
109.txt
AC
4 ms
8784 KB
110.txt
AC
4 ms
8788 KB
111.txt
AC
4 ms
8788 KB
112.txt
AC
5 ms
8788 KB
113.txt
AC
5 ms
8788 KB
114.txt
AC
19 ms
8788 KB
115.txt
AC
355 ms
8788 KB
116.txt
AC
90 ms
8660 KB
117.txt
AC
3 ms
4692 KB
118.txt
AC
3 ms
4692 KB
119.txt
AC
3 ms
4688 KB
120.txt
AC
3 ms
4688 KB
121.txt
AC
3 ms
4688 KB
122.txt
AC
3 ms
4692 KB
123.txt
AC
3 ms
4684 KB
124.txt
AC
3 ms
4688 KB
125.txt
AC
3 ms
4688 KB