跳到正文

剪贴板

剪贴板 yhxuiclu

原文
剪贴板信息

剪贴板信息

收录
更新
C++
/*
致正在收集迷惑代码的人
如果你看到了这份代码,那么请你再往下翻一点
你会看到好东西(笑
我很乐意你把我的代码收录进迷惑行为
我也很乐意你把我的代码公开(((
所有人AKCSP-J!!1
*/
/*
EEEEE V       V EEEEE RRRR  Y   Y  OOO  NN   N EEEEE     A     K  K   CCC  SSSS PPPP  ! !  1
E      V     V  E     R   R  Y Y  O   O N N  N E        AAA    K K   C    S     P   P ! ! 11
EEEEE   V   V   EEEEE RRRR    Y   O   O N  N N EEEEE   A   A   KK    C     SSS  PPPP  ! !  1
E        V V    E     R R     Y   O   O N   NN E      AAAAAAA  K K   C        S P          1
EEEEE     V     EEEEE R  RR   Y    OOO  N    N EEEEE A       A K  KK  CCC SSSS  P     ! ! 111
*/
/*
III     A     K  K   CCC  SSSS PPPP  ! !  1
 I     AAA    K K   C    S     P   P ! ! 11
 I    A   A   KK    C     SSS  PPPP  ! !  1
 I   AAAAAAA  K K   C        S P          1
III A       A K  KK  CCC SSSS  P     ! ! 111
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a, b, x = 1;
int main() {
	freopen("pow.in", "r", stdin);
	freopen("pow.out", "w", stdout);
	scanf("%lld%lld", &a, &b);
	if(a == 1) {
		puts("1");
		return 0;
	}
	for(int i = 1; i <= b; ++i) {
		x = x * a;
		if(x > 1000000000) {
			puts("-1");
			return 0;
		}
	}
	printf("%lld", x);
	return 0;
}
/*
考场10min码出来的贪吃蛇:
#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
using namespace std;
const int r = 25;
const int c = 50;
char ch, mp[r + 5][c + 5];
int x, y, t, nx, ny, cnt;
void print() {
	for(int i = 1; i <= r; ++i) puts(mp[i] + 1);
	cout << "score:" << cnt << endl;
}
void No() {
	system("cls");
	puts("GAME OVER!!!");
	exit(0);
}
vector< pair<int, int> > v;
int main() {
	srand(time(NULL));
	memset(mp, '.', sizeof(mp));
	for(int i = 1; i <= r; ++i) mp[i][c + 1] = 0;
	nx = 1, ny = 4;
	for(int i = 1; i <= 3; ++i) {
		v.push_back(make_pair(1, i));
		mp[1][i] = '#';
	}
	mp[nx][ny] = '@';
	v.push_back(make_pair(nx, ny));
	t = 10;
	while(t--) {
		do {
			x = rand() % r + 1, y = rand() % c + 1;
		} while(mp[x][y] != '.');
		mp[x][y] = '$';
	}
	t = 10;
	while(t--) {
		do {
			x = rand() % r + 1, y = rand() % c + 1;
		} while(mp[x][y] != '.');
		mp[x][y] = 'X';
	}
	t = 2;
	while(t--) {
		do {
			x = rand() % r + 1, y = rand() % c + 1;
		} while(mp[x][y] != '.');
		mp[x][y] = '*';
	}
	print();
	while(cnt < 100) {
		ch = getch();
		if(ch == 'w') {
			if(nx > 1) {
				mp[nx][ny] = '#';
				--nx;
			}
			else No();
		}
		if(ch == 's') {
			if(nx < r) {
				mp[nx][ny] = '#';
				++nx;
			}
			else No();
		}
		if(ch == 'a') {
			if(ny > 1) {
				mp[nx][ny] = '#';
				--ny;
			}
			else No();
		}
		if(ch == 'd') {
			if(ny < c) {
				mp[nx][ny] = '#';
				++ny;
			}
			else No();
		}
		if(mp[nx][ny] == '*') {
			mp[nx][ny] = '.';
			for(int i = 1; i <= r; ++i)
				for(int j = 1; j <= c; ++j)
					if(mp[i][j] == '*') {
						nx = i, ny = j;
						mp[i][j] = '.';
					}
			t = 2;
			while(t--) {
				do {
					x = rand() % r + 1, y = rand() % c + 1;
				} while(mp[x][y] != '.');
				mp[x][y] = '*';
			}
		}
		if(mp[nx][ny] == '$') {
			++cnt;
			mp[nx][ny] = '@';
			v.push_back(make_pair(nx, ny));
			do {
				x = rand() % r + 1, y = rand() % c + 1;
			} while(mp[x][y] != '.');
			mp[x][y] = '$';
		}
		else if(mp[nx][ny] == 'X') No();
		else {
			for(int i = 1; i < v.size(); ++i)
				if(v[i].first == nx && v[i].second == ny) {
					No();
				}
			v.push_back(make_pair(nx, ny));
			mp[v[0].first][v[0].second] = '.';
			v.erase(v.begin());
			mp[nx][ny] = '@';
		}
		system("cls");
		print();
	}
	system("cls");
	cout << "You win!!!" << endl;
	return 0;
}
*/

/*
锻炼反应力:

#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
using namespace std;
char ans, ch;
int main() {
	srand(time(NULL));
	while(true) {
		if(rand() & 1) {
			ans = rand() % 10 + '0';
		}
		else ans = rand() % 26 + 'a';
		cout << ans << endl;
		const int s = clock();
		ch = getch();
		system("cls");
		cout << "time:" << (clock() - s) / 1000.0 << endl;
		if(ch == ans) {
			puts("Good job!");
		}
		else {
			puts("qwq");
		}
		Sleep(100);
		system("cls");
	}
	return 0;
}
*/