Submission #991927


Source Code Expand

#include <cstdio>
#include <cmath>

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define inc( i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec( i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

template<typename T> void swap(T & x, T & y) { T t = x; x = y; y = t; return; }
template<typename T> T abs(T x) { return (0 <= x ? x : -x); }
template<typename T> T max(T a, T b) { return (b <= a ? a : b); }
template<typename T> T min(T a, T b) { return (a <= b ? a : b); }
template<typename T> bool setmin(T & a, T b) { if(a <= b) { return false; } else { a = b; return true; } }
template<typename T> bool setmax(T & a, T b) { if(b <= a) { return false; } else { a = b; return true; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int len(char s[]) {
	int l = 0;
	while(s[l] != '\0') { l++; }
	return l;
}
int bitlen(int x) {
	int c = 0;
	while(x != 0) { c++; x /= 2; }
	return c;
}
int bc(int x) {
	int c = 0;
	while(x != 0) {	c += x % 2; x /= 2; }
	return c;
}
LL fact(LL x) {
	if(x == 0) { return 1; }
	return x * fact(x - 1);
}
LL _fibo[50];
bool fibo_flag;
LL fibo(int x) {
	if(fibo_flag) { return _fibo[x]; }
	_fibo[0] = 0;
	_fibo[1] = 1;
	incII(i, 2, x) { _fibo[i] = _fibo[i - 1] + _fibo[i - 2]; }
	fibo_flag = true;
	return _fibo[x];
}


int n, a[100], ans;
int h, w, b[100][100];
char s[101];
const int MOD = 1000000007;


int mainN() {
	scanf("%d", &n);
	inc(i, n) { scanf("%d", &a[i]); }
	
	printf("%d\n", n);
	
	return 0;
}

int mainS() {
	scanf("%s", s);
	inc(i, len(s)) {
		if(s[i] == '#') {
			ans++;
		}
	}
	
	printf("%d", ans);
	
	return 0;
}


char snu[6] = "snuke";
char t[26][26][6];

int main() {
	scanf("%d%d", &h, &w);
	inc(i, h) {
	inc(j, w) {
		scanf("%s", t[i][j]);
	}
	}
	
	inc(i, h) {
	inc(j, w) {
		bool flag = true;
		inc(k, 5) { if(snu[k] != t[i][j][k]) { flag = false; break; } }
		if(flag) { printf("%c%d\n", 'A' + j, i + 1); }
	}
	}
	
	return 0;
}

Submission Info

Submission Time
Task A - Where's Snuke?
User FF256grhy
Language C++14 (GCC 5.4.1)
Score 100
Code Size 2488 Byte
Status AC
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.cpp: In function ‘int mainN()’:
./Main.cpp:68:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
                 ^
./Main.cpp:69:32: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  inc(i, n) { scanf("%d", &a[i]); }
                                ^
./Main.cpp: In function ‘int mainS()’:
./Main.cpp:77:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s", s);
                ^
./Main.cpp: In function ‘int main()’:
./Main.cpp:94:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &h, &w);
                       ^
./Main.cpp:97:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunuse...

Judge Result

Set Name sample all
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 9
Set Name Test Cases
sample sample-01.txt, sample-02.txt
all sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt
Case Name Status Exec Time Memory
01-01.txt AC 1 ms 128 KB
01-02.txt AC 1 ms 128 KB
01-03.txt AC 1 ms 128 KB
01-04.txt AC 1 ms 128 KB
01-05.txt AC 1 ms 128 KB
01-06.txt AC 1 ms 128 KB
01-07.txt AC 1 ms 128 KB
sample-01.txt AC 1 ms 128 KB
sample-02.txt AC 1 ms 128 KB