結果

問題 No.1455 拡張ROTN
ユーザー tsuishitsuishi
提出日時 2021-04-01 14:55:39
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 4,106 bytes
コンパイル時間 572 ms
コンパイル使用メモリ 30,936 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-08-22 18:21:19
合計ジャッジ時間 4,135 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// for debug
#define DEBUG
// -----------

#define NOP do{}while(0)
#ifdef DEBUG
#include <time.h>
#define TRACE(...) do{printf(__VA_ARGS__);fflush(stdout);}while(0)
#define TRACECR do{putchar_unlocked('\n');fflush(stdout);}while(0)
static clock_t	startclock;
void DEBUGSTART(void){TRACE("--DEBUG MODE --\n");startclock=clock();}
void DEBUGEND(void){startclock=clock()-startclock;TRACE("--finish --\ntime is %.3fms\n",startclock/1000.);}
#else
#define TRACE(...) NOP
#define TRACECR NOP
void DEBUGSTART(void){return;}
void DEBUGEND(void){return;}
#endif


extern int getchar_unlocked(void);
extern int putchar_unlocked(int);
#define gc(d)	(d)=getchar_unlocked()
#define	pc(d) putchar_unlocked(d)
#define SWAP(type,a,b) do{type _c;_c=a;a=b;b=_c;}while(0)
#define MAX(a,b)	((a)>(b)?(a):(b))
#define MIN(a,b)	((a)<(b)?(a):(b))
#define REP(a,b) for(int a=0;a<(int)(b);++a)
#define REP1(a,b) for(int a=1;a<=(int)(b);++a)
static char *GETWORD(char* str) {char c;char *cp;cp=&str[0];gc(c);while(c!=EOF){if((c==' ')||(c=='\n'))break;*cp++=c;gc(c);}*cp='\0';return &str[0];}
#define GETLINE(str) do{char *p;fgets(str,sizeof(str),stdin);p=strchr(str,'\n');if(p)*p='\0';}while(0)
#define mygc(c) (c)=getchar()
static void read1(int *x){int k,m=0;*x=0;for(;;){mygc(k);if(k=='-'){m=1;break;}if('0'<=k&&k<='9'){*x=k-'0';break;}}for(;;){mygc(k);if(k<'0'||k>'9')break;*x=(*x)*10+k-'0';}if(m)(*x)=-(*x);}
static void read2(int *x, int *y){read1(x);read1(y);}
#define INPUT(str) do{char *p;fgets(str,sizeof(str),stdin);p=strchr(str,'\n');if(p)*p='\0';}while(0)
#define REP(a,b) for(int a=0;a<(int)(b);++a)
#define lolong long long
static int GETLINEINT(void) {char s[34];GETLINE(s);return atoi(s);}
static int GETLINELONG(void) {char s[34];GETLINE(s);return atol(s);}
static int GETWORDINT(void) {char s[34];GETWORD(s);return atoi(s);}
static int GETWORDLONG(void) {char s[34];GETWORD(s);return atol(s);}
static int cmpint_asc(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
static int cmpint_desc(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
#define	ull	unsigned long long
void out(int n) {
	int i;
	char b[70];
	if (!n) pc('0');
	else {
		if (n < 0) pc('-'), n = -n;
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}
void outl(ull n) {
	int i;
	char b[70];
	if (!n) pc('0');
	else {
		if (n < 0) pc('-'), n = -n;
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}
void outs(char *c) {
	while(*c > '\n') { pc(*c); c++; }
	pc('\n');
}
ull a2l(char *r) {
    ull res = 0;
    ull sign= 1;
    int i=0;

    while ((r[i]==' ')||(r[i]=='\t')||(r[i]=='\n')||(r[i]=='\v')||(r[i]=='\r')||(r[i]=='\f')) i++;
    if (r[i] == '-') sign = -1;
    if (r[i] == '+' || r[i] == '-') i++;
    while ((r[i]>='0')&&(r[i]<='9')){
		ull	dmy = res;
        res <<= 3;
        dmy <<= 1;
        res = res + dmy;
        res += (ull)(r[i] - '0');
        i++;
    }
    return res * sign;
}
long long  inl(void)   // 整数の入力(負数に対応)
{
	long long n = 0;
	int c;
	gc(c);
	do {
		n = 10 * n + (c & 0xf);
		gc(c);
	} while (c >= '0');
	return n;
}
// *********************
char	ss[140200];
char	wk[140200];
inline void change(char *bf, char *af) {
	char	c;
	char	*mt = bf;
	char	*kk = af;

	c = *mt;
	while( c >= '0' ){
		if( c == '9' ) {
			mt++;
			*kk++ = 'C';
			*kk++ = 'p';
			*kk++ = 'C';
			*kk++ = 'z';
			*kk++ = 'N';
			*kk++ = 'k';
			*kk++ = 'S';
			*kk++ = 'u';
			*kk++ = 'T';
			*kk++ = 'b';
			*kk++ = 'E';
			*kk++ = 'o';
			*kk++ = 'A';
		} else if( c == 'z' ) {
			*kk++ = 'a';	mt++;
		} else if( c == 'Z' ) {
			*kk++ = 'A';	mt++;
		} else {
			*kk++ = ++c;	mt++;
		}
		c = *mt;
	}
	*kk = '\0';
}
// *********************
int main( void ) {
	long long	i,e;
	int	thl =0;

	GETLINE(ss);
	e = inl();
	DEBUGSTART();
	for(i=0;i<e;i++) {
		if( i & 1 ) change(wk,ss);
		else change(ss,wk);
	}
	DEBUGEND();
	if( i& 1 ) outs(wk);
	else outs(ss);
}

0