結果
| 問題 |
No.342 一番ワロタww
|
| コンテスト | |
| ユーザー |
bal4u
|
| 提出日時 | 2019-05-05 21:39:43 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 935 bytes |
| コンパイル時間 | 407 ms |
| コンパイル使用メモリ | 29,568 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 02:58:22 |
| 合計ジャッジ時間 | 857 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
// yukicoder: No.342 一番ワロタww
// 2019.5.5 bal4u
#include <stdio.h>
#define gc() getchar()
#define pc(c) putchar(c)
void ins(unsigned char *s) // 文字列の入力 スペース以下の文字で入力終了
{
do *s = gc();
while (*s++ > ' ');
*(s-1) = 0;
}
void outs(unsigned char *s) { while (*s) pc(*s++); }
// w = 0xef 0xbd 0x97
unsigned char S[1000], *s = S;
int isJW(unsigned char *s) {
return *s == 0xef && *(s+1) == 0xbd && *(s+2) == 0x97;
}
int main()
{
int w, max;
unsigned char *S0, *p, *q;
ins(S);
while (isJW(s)) s += 3;
S0 = s;
max = 0;
while (1) {
w = 0; while (isJW(s)) s += 3, w++;
if (w > max) max = w;
if (*s++ == 0) break;
}
if (max == 0) { pc('\n'); return 0; }
s = S0, p = s; while (1) {
if (isJW(s)) {
q = s;
w = 0; while (isJW(s)) s += 3, w++;
if (w == max) {
*q = 0, outs(p), pc('\n');
}
p = s;
}
if (*s++ == 0) break;
}
return 0;
}
bal4u