結果

問題 No.607 開通777年記念
ユーザー tailstails
提出日時 2021-02-22 21:57:38
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 570 bytes
コンパイル時間 1,532 ms
コンパイル使用メモリ 30,276 KB
実行使用メモリ 5,528 KB
最終ジャッジ日時 2023-10-21 16:14:18
合計ジャッジ時間 1,497 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 0 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 7 ms
5,528 KB
testcase_12 AC 7 ms
5,472 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:8:1: warning: data definition has no type or storage class
    8 | d[1001];
      | ^
main.c:8:1: warning: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
main.c:10:1: warning: return type defaults to 'int' [-Wimplicit-int]
   10 | main(){
      | ^~~~
main.c: In function 'main':
main.c:26:33: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
   26 |                                 write(1,"YES",3);
      |                                 ^~~~~
main.c:27:33: warning: implicit declaration of function '_exit'; did you mean '_Exit'? [-Wimplicit-function-declaration]
   27 |                                 _exit(0);
      |                                 ^~~~~
      |                                 _Exit

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")

char*mmap();
#define RD(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;}
#define RD_SIGNED(v) int v=0;{int _c,_s;_s=*rp=='-'&&++rp;while(_c=*rp++-48,_c>=0)v=v*10+_c;v=_s?-v:v;}

d[1001];

main(){
	char*rp=mmap(0l,1l<<28,1,2,0,0ll);
	RD(n);
	RD(m);
	for(int i=0;i<m;++i){
		for(int j=0;j<n;++j){
			RD_SIGNED(a);
			d[j]+=a;
		}
		int b=0,e=0,s=0;
		while(e<n){
			s+=d[e++];
			while(s>777){
				s-=d[b++];
			}
			if(s==777){
				write(1,"YES",3);
				_exit(0);
			}
		}
	}
	write(1,"NO",2);
	_exit(0);
}
0