CODE FESTIVAL 2016 Final

Submission #991927

Source codeソースコード

#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

Task問題 A - Where's Snuke?
User nameユーザ名 FF256grhy
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 AC
Score得点 100
Source lengthソースコード長 2488 Byte
File nameファイル名
Exec time実行時間 1 ms
Memory usageメモリ使用量 128 KB

Compiler messageコンパイルメッセージ

./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...

Test case

Set

Set name Score得点 / Max score Cases
sample - sample-01.txt,sample-02.txt
all 100 / 100 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
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