qsc oj 22 哗啦啦村的刁难(3)(随机数,神题)

时间:2023-03-09 07:17:13
qsc oj 22 哗啦啦村的刁难(3)(随机数,神题)

哗啦啦村的刁难(3)

发布时间: 2017年2月28日 20:00   最后更新: 2017年2月28日 20:01   时间限制: 1000ms   内存限制: 128M

描述

哗啦啦村作为喵哈哈村的对头,于是他们准备给喵哈哈村一个好看。

哗啦啦村的三号长老——大先生,就提出了以下问题:

现在这道题有两组数据,每组输入数据都是1,。

但是,第一组测试数据你需要输出1,第二组你需要输出2。

你怎么输出呢?

输入

1

输出

这道题只包含两组测试数据,第一组测试数据应该输出1,第二组你应该输出2.

样例输入1
1
样例输出1
1
样例输入2
1
样例输出2
2
题目链接:http://qscoj.cn/problem/22/
分析:

解法:卿学姐说OJ是并行哒,所以时间随机是不可行的,我们这里new一个东西,取地址是随机的

下面给出AC代码:

 #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <iostream> // C++头文件,C++完全兼容C
#include <algorithm> // C++头文件,C++完全兼容C
#include <time.h>
#define fre freopen("in.txt","r",stdin) //以文件代替控制台输入,比赛时很常用,能缩短输入测试样例的时间
#define INF 0x3f3f3f3f
#define inf 1e60
using namespace std; // C++头文件,C++完全兼容C
const int maxn = ;
int a[maxn];
int b[];
int ans,n,k; int main()
{ cin>>n;
char* x=new char;
int ans=(long)x;
printf("%d\n",ans/%+); return ;
}