submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s446377877 | p00147 | Java | import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
/**
* Fukushimaken
*/
public class Main{
/** 食べ終わるまでの時間 */
public static final int[] timeToEatList = {19, 39, 25, 36, 22, 42};
/** 座席数 */
public static final int SEAT_NUM = 17;
/** 来店するグループ数 */
public static final int GROUP_NUM = 100;
/** 客の到着する間隔 */
public static final int ARRIVE_INTERVAL = 5;
/** 座席 */
// -1 は空席、0以上はグループの番号
public static int[] seat = new int[SEAT_NUM];
/** 座席毎の食べ終わる時間 */
//誰もいない場合は-1。 */
public static int[] eatEndTime = new int[SEAT_NUM];
/** n番目の客の待ち時間 */
public static int[] waitingTime = new int[GROUP_NUM];
/** 先頭で待っているグループ番号 */
public static int headGroupNo = -1;
static {
Arrays.fill(waitingTime, -1);
}
/**
* エントリポイント
*/
public static void main(String args[]) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = "";
//入力値をまとめて読み込み
//(入力値中の、最大のグループ番号を求める)
List<Integer> inputList = new ArrayList<Integer>();
int maxGroupNum = 0;
while(true) {
input = br.readLine();
if(input == null) break;
int inputInt = Integer.parseInt(input);
if(maxGroupNum < inputInt) maxGroupNum = inputInt;
inputList.add(Integer.parseInt(input));
}
//入力値中の、最大のグループ番号までの待ち時間を計算
calcWaitTime(maxGroupNum);
//結果を表示
for (int i = 0; i < inputList.size(); i++) {
System.out.println(waitingTime[inputList.get(i)]);
}
}
/**
* 待ち時間を計算し、waitingTimeに記録する。
* ただし、入力値中の、最大のグループ番号まで、計算する。
*/
public static void calcWaitTime(int maxGroupNum) {
for (int min = 0; ; min++) {
//食べ終わりの判定
for (int s = 0; s < SEAT_NUM; s++) {
if(eatEndTime[s] == min) {
seat[s] = -1;
eatEndTime[s] = -1;
}
}
//客が到着し、誰も待っていなければ先頭のグループNoを更新
if (min % 5 == 0 && headGroupNo == -1) {
headGroupNo = min / ARRIVE_INTERVAL;
}
//席が空いていれば着席させる
while(headGroupNo != -1) {
//連続して空いている席を探索
int blankSeatNum = 0;
int numInGroup = headGroupNo % 5 == 1 ? 5 : 2;
int s;
for (s = 0; s < SEAT_NUM && blankSeatNum < numInGroup; s++) {
if (seat[s] == -1) {
blankSeatNum++;
} else {
blankSeatNum = 0;
}
}
//着席できた場合
if(blankSeatNum == numInGroup) {
for(int ts = s - 1; ts > s - 1 - numInGroup; ts--) {
seat[ts] = headGroupNo;
eatEndTime[ts] = min + timeToEatList[headGroupNo % timeToEatList.length];
}
//待った時間を記録
waitingTime[headGroupNo] = min - headGroupNo * ARRIVE_INTERVAL;
//求める最大のグループ番号が着席できた時点で、処理中断。
if (headGroupNo == maxGroupNum) return;
//次に先頭になるグループを算出
if(min >= (headGroupNo + 1) * ARRIVE_INTERVAL) {
//次のグループが既に到着していれば、次のグループが先頭
headGroupNo++;
} else {
//まだ到着していなければ、
headGroupNo = -1;
}
} else {
//着席できない場合、次の時刻に進む
break;
}
}
}
} | Main.java:129: error: reached end of file while parsing
}
^
1 error
|
s193935048 | p00147 | Java |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class NewFukushimaken {
/*** ??°??????????????° */
private static final int GROUP_NUM = 100;
private static BufferedReader br;
private static int placeNum;
private static int[] arriveTime, customerNum, mealTime, waitTime;
/*** ??? */
private static String[] places;
private static int finalPlace;
/*** ????????? */
static {
br = new BufferedReader(new InputStreamReader(System.in));
placeNum = 17;
arriveTime = new int[GROUP_NUM];
customerNum = new int[GROUP_NUM];
mealTime = new int[GROUP_NUM];
waitTime = new int[GROUP_NUM];
places = new String[placeNum];
}
/**
* ?????????????????????
*
* @param args
* ??????????????°
* @throws IOException
*/
public static void main(String[] args) throws IOException {
String line;
List<Integer> inputList = new ArrayList<Integer>();
// ??\???
while ((line = br.readLine()) != null && !line.isEmpty()) {
inputList.add(Integer.parseInt(line));
}
exe(inputList);
// ??????
for (int input : inputList) {
System.out.println(waitTime[input]);
}
}
private static void exe(List<Integer> inputList) {
// ?????????
for (int i = 0; i < GROUP_NUM; i++) {
arriveTime[i] = 5 * i;
customerNum[i] = i % 5 == 1 ? 5 : 2;
mealTime[i] = placeNum * (i % 2) + 3 * (i % 3) + 19;
}
int key;
// ????????¢?????????
List<Integer> waitList = new ArrayList<Integer>();
// ??\?????¢?????????
List<Integer> removeList = new ArrayList<Integer>();
// ??°??????????????¨?????????????????????????????????????????????
for (int currentTime = 0; currentTime <= 5 * 100; currentTime++) {
outStore(currentTime);
// ?????????????????°????????????
if ((key = search(arriveTime, currentTime)) != -1) {
if (waitList.isEmpty()) {
if (isEmpty(key)) {
set(Integer.toString(key));
} else {
waitList.add(key);
}
} else {
waitList.add(key);
}
}
if (!waitList.isEmpty()) {
// ???????????¢???????????´???
int i = 0;
boolean flg = true;
for (int wait : waitList) {
if (isEmpty(wait) && flg) {
set(Integer.toString(wait));
waitTime[wait] = currentTime - arriveTime[wait];
removeList.add(i);
flg = true;
} else {
flg = false;
}
i++;
}
}
if (!removeList.isEmpty()) {
Collections.reverse(removeList);
for (int remove : removeList) {
// ??\???????????¢???????????¢???????????????????????????
waitList.remove(remove);
}
removeList = new ArrayList<Integer>();
}
}
}
private static int search(int[] targets, int currentTime) {
int i = 0;
for (int target : targets) {
if (target == currentTime) {
return i;
}
i++;
}
return -1;
}
/**
* ??????????????£?????°?????????????????????????????????
*
*/
private static void outStore(int currentTime) {
int i = 0;
for (String place : places) {
if (place == null) {
i++;
continue;
}
if (mealTime[Integer.parseInt(place)] <= currentTime
- arriveTime[Integer.parseInt(place)]) {
places[i] = null;
}
i++;
}
}
/**
* ??°?????????????????§???????¨??????????
*
* @param groupNum
* ??°???????????????
*/
private static void set(String groupNum) {
for (int i = finalPlace - 1, count = 0; count < customerNum[Integer
.parseInt(groupNum)]; i--, count++) {
places[i] = groupNum;
}
}
/**
* ?????°?????°?????????????????°?????§?????????????????????????????????
*
* @param groupNum
* ??°?????????????????°
* @return true : ??§?????? false : ??§?????????
*/
private static boolean isEmpty(int groupNum) {
// ????????°
int emptyPlaceNum = 0;
for (int i = 0; i < placeNum; i++) {
if (emptyPlaceNum == customerNum[groupNum]) {
finalPlace = i;
return true;
}
if (places[i] == null) {
emptyPlaceNum++;
} else {
emptyPlaceNum = 0;
}
}
return false;
}
} | Main.java:9: error: class NewFukushimaken is public, should be declared in a file named NewFukushimaken.java
public class NewFukushimaken {
^
1 error
|
s245419317 | p00147 | Java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int[] seats = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0};
int[] groupMembers = new int[] {2, 5, 2, 2, 2};
int[] eatTimes = new int[] {19, 39, 25, 36, 22, 42};
int headGroup = -1;
int pastMinutes = 0;
Scanner sc = new Scanner(System.in);
List<Integer> inputted = new ArrayList<Integer>();
int maxInputted = -1;
while (sc.hasNext()) {
int ni = sc.nextInt();
maxInputted = maxInputted < ni ? ni : maxInputted;
inputted.put(ni);
}
List<Integer> waitTime = new ArrayList<Integer>();
while (waitTime.size() <= maxInputted) {
// たべおわる
for (int i = 0; i < seats.length; i++) {
seats[i] = seats[i] == 0 ? 0 : seats[i] - 1;
}
// 来店
if (headGroup == -1 && pastMinutes % 5 == 0) {
headGroup = pastMinutes / 5;
}
// ちゃくせき
while (headGroup != -1) {
int needsSequencialSeats = groupMembers[headGroup % 5];
int sequencialSeats = 0;
int startIndex = -1;
for (int i = 0; i < seats.length; i++) {
sequencialSeats = seats[i] == 0 ? sequencialSeats + 1 : 0;
if (sequencialSeats == needsSequencialSeats) {
startIndex = i - (needsSequencialSeats - 1);
break;
}
}
if (startIndex != -1) {
// すわれたみたい
waitTime.add(headGroup, pastMinutes - (headGroup * 5));
for (int i = startIndex; i < (startIndex + needsSequencialSeats); i++) {
seats[i] = eatTimes[headGroup % 6];
}
headGroup = (((headGroup + 1) * 5) <= pastMinutes) ? headGroup + 1
: -1;
} else {
// すわれなかったみたい
break;
}
}
pastMinutes++;
}
for(int input : inputted){
System.out.println(waitTime.get(input));
}
}
} | Main.java:24: error: cannot find symbol
inputted.put(ni);
^
symbol: method put(int)
location: variable inputted of type List<Integer>
1 error
|
s992782068 | p00147 | Java | public class Main03 {
public static void main(String[] args) {
}
/**
* index番目のグループの到着時刻を返却する(正午からの経過時間)
* 単位:分
* @param index
* @return 到着時刻
*/
private static int getArriveTime(int index) {
return index * 5;
}
/**
* index番目のグループの人数を返却する
* 単位:人
* @param index
* @return 人数
*/
private static int getNums(int index) {
return((index % 5 == 1) ? 5 : 2);
}
/**
* index番目のグループの所要時間を返却する
* 単位:分
* @param index
* @return 所要時間
*/
private static int getEatingTime(int index) {
return 17 * (index % 2) + 3 * (index % 3) + 19;
}
private static boolean checkSheet(int[] sheets, int index, int custmors) {
boolean canSit = true;
for (int i = 0; i < sheets.length; i++) {
for (int j = i; j < custmors; j++) {
if (j + custmors <= sheets.length) {
if (sheets[j] != 100) {
canSit = false;
}
}
}
if (canSit) {
for (int j = i; j < custmors; j++) {
sheets[j] = index;
}
}
}
}
} | Main.java:1: error: class Main03 is public, should be declared in a file named Main03.java
public class Main03 {
^
1 error
|
s490632823 | p00147 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class NewFukushimaken {
/** 対象外 */
private static final int EXEMPT = -1;
/** グループ数 */
private static final int GROUP_NUM = 100;
/** 標準入力 */
private static BufferedReader br;
/** 座席数 最後の座席番号 */
private static int seatsNum, firstSeatNum;
/** 到着時間 客数 食事時間 待ち時間 */
private static int[] arriveTime, customersNum, mealTimes, waitTimes;
/** 座席 */
private static String[] seats;
/** 初期化 */
static {
br = new BufferedReader(new InputStreamReader(System.in));
seatsNum = 17;
arriveTime = new int[GROUP_NUM];
customersNum = new int[GROUP_NUM];
mealTimes = new int[GROUP_NUM];
waitTimes = new int[GROUP_NUM];
seats = new String[seatsNum];
for (int i = 0; i < GROUP_NUM; i++) {
// グループ数分繰り返す
// 到着時間
arriveTime[i] = 5 * i;
// 人数
customersNum[i] = i % 5 == 1 ? 5 : 2;
// 食事時間
mealTimes[i] = seatsNum * (i % 2) + 3 * (i % 3) + 19;
}
// 待ち時間を作成
createWaitTimes();
}
/** 待ち時間を作成する */
private static void createWaitTimes() {
// 順番
int order;
// 行列リスト
List<Integer> waitList = new ArrayList<Integer>();
// 行列排除リスト
List<Integer> removeList = new ArrayList<Integer>();
for (int currentTime = 0, groupOrder = 0; groupOrder < GROUP_NUM; currentTime++) {
// 行列が終了するまで、一分毎に繰り返す
// 食事の時間が終了した客を離席させる
outCustomer(currentTime);
if ((order = arrivedCustomer(arriveTime, currentTime)) != EXEMPT) {
// 到着時間の場合
if (waitList.isEmpty()) {
// 行列がない場合
if (isEmpty(order)) {
// 着席可能の場合
// 座席に着席させる
setSeat(Integer.toString(order));
groupOrder++;
} else {
// 着席不可の場合
// 行列に並ばせる
waitList.add(order);
}
} else {
// 行列がある場合
// 行列に並ばせる
waitList.add(order);
}
}
if (!waitList.isEmpty()) {
// 行列がある場合
// 行列番号
int i = 0;
for (int wait : waitList) {
// 行列リスト分、繰り返す
if (isEmpty(wait)) {
// 着席可能の場合
// 座席に着席させる
setSeat(Integer.toString(wait));
groupOrder++;
// 待った時間を設定する
waitTimes[wait] = currentTime - arriveTime[wait];
// 着席したグループを行列排除リストに追加する
removeList.add(i);
} else {
// 着席不可の場合
// 行列の先頭が着席できないため、残りの行列も着席不可にする。
break;
}
i++;
}
}
if (!removeList.isEmpty()) {
// 行列排除リストに着席したグループが追加されていた場合
// リストの降順でソートする(リムーブするため)
Collections.reverse(removeList);
for (int remove : removeList) {
// 行列排除リスト分、繰り返す
// 行列リストから行列排除リストの番号を削除する
waitList.remove(remove);
}
// 初期化
removeList = new ArrayList<Integer>();
}
}
}
/** メイン */
public static void main(String[] args) throws IOException {
String line;
List<Integer> inputList = new ArrayList<Integer>();
while ((line = br.readLine()) != null && !line.isEmpty()) {
inputList.add(Integer.parseInt(line));
}
for (int input : inputList) {
System.out.println(waitTimes[input]);
}
}
/** 現在時間に到着するグループ番号を検索し返す */
private static int arrivedCustomer(int[] targets, int currentTime) {
int order = 0;
for (int target : targets) {
if (target == currentTime) {
return order;
}
order++;
}
return EXEMPT;
}
/** 離席させる */
private static void outCustomer(int currentTime) {
// 席番
int seatNum = 0;
for (String seat : seats) {
// 座席数分繰り返す
if (seat == null) {
// 空席の場合
seatNum++;
continue;
}
if (mealTimes[Integer.parseInt(seat)] <= currentTime
- arriveTime[Integer.parseInt(seat)]
+ waitTimes[Integer.parseInt(seat)]) {
// 食事の時間が終了した場合
// 空席にする
seats[seatNum] = null;
}
seatNum++;
}
}
/** 着席させる */
private static void setSeat(String groupsNum) {
for (int count = 0; count < customersNum[Integer.parseInt(groupsNum)]; count++) {
// 着席する人数分繰り返す
// 座席にグループ番号を設定する
seats[firstSeatNum++] = groupsNum;
}
}
/** 引数のグループ番号の客数分、空席かどうか確認する */
private static boolean isEmpty(int groupsNum) {
// 空席数
int emptyseatsNum = 0;
for (int i = 0; i < seatsNum || customersNum[groupsNum] <= seatsNum - i; i++) {
// 残座席数が客の数以下になるまで座席数分繰り返す
if (emptyseatsNum == customersNum[groupsNum]) {
// 連続した空席が客の数だけあった場合
// 空席の最初の座席番号を設定する
firstSeatNum = i - emptyseatsNum;
return true;
}
if (seats[i] == null) {
// 空席かつ繰り返す席が顧客数分以上存在する場合
emptyseatsNum++;
continue;
} else {
// 空席でない場合
// 空席数を初期化
emptyseatsNum = 0;
}
}
return false;
}
} | Main.java:8: error: class NewFukushimaken is public, should be declared in a file named NewFukushimaken.java
public class NewFukushimaken {
^
1 error
|
s967674219 | p00147 | Java |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Main2 {
public static void main(String[] args) throws IOException {
// ????????????????????°???????????????
// ???
int[] seat = new int[17];
// ????????????
List<Integer> waitGuest = new ArrayList<Integer>();
// ?¨??????\???
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = null;
// ??\???????????????????????????????????§????????????
while (true) {
input = br.readLine();
if (input == null || input.isEmpty()) {
break;
}
// int??????????????????
int inputNum = Integer.parseInt(input);
// ????????????????????°???????????????
// ??????
int time = 0;
// ?????????
while (true) {
// ?£????????????£?????¢????????????????????????
exitFukushimaken(seat, time);
// ??¢????????????????????????????????????????????????
if (time % 5 == 0) {
waitGuest.add(time / 5);
}
// ?????????????????¢?????????????????????
if (isWaitGuest(waitGuest)) {
// ??\?????¢????????°????????????
int guest = guestOfNumber(waitGuest.get(0));
// ?????????????????????????????????
int seatNum = confirmEmptySeat(seat, guest);
if (seatNum != 99) {
enterFukushimaken(waitGuest.get(0), guest, seatNum, seat, time);
// ??\??????????????°??????????????´?????????????????????????????????
if (inputNum == waitGuest.get(0)) {
System.out.println(time - waitGuest.get(0) * 5);
break;
}
waitGuest.remove(0);
}
}
++time;
}
}
}
// ????????????????????????????????????
//
private static boolean isWaitGuest(List<Integer> waitGuest){
if (waitGuest.size() != 0) {
return true;
}
return false;
}
// i???????????°?????????????????°?????????
private static int guestOfNumber(int number) {
if (number % 5 == 1) {
return 5;
} else {
return 2;
}
}
// ??§??????????????????????????????
// i = ??§????????´????????????????????????99?????§?????????
private static int confirmEmptySeat(int[] seat, int guest) {
int count = 0;
for (int i = 0; i < seat.length - guest; ++i) {
for (int j = 0; j < guest; ++j) {
if (seat[i + j] != 0) {
break;
} else {
++count;
if (guest == count) {
return i;
}
}
}
}
return 99;
}
// ????????????
private static void enterFukushimaken(int groupNum, int guest, int seatNum,
int[] seat, int time) {
int ateTime = time + ateFoodTime(groupNum);
for (int i = 0; i < guest; ++i) {
seat[seatNum + i] = ateTime;
}
}
// ?£????????????£?????¢?????????????¢??????????
private static void exitFukushimaken(int[] seat, int time) {
for (int i = 0; i < seat.length; ++i) {
if (time == seat[i]) {
seat[i] = 0;
}
}
}
// i???????????°?????????????£?????????????
private static int ateFoodTime(int number) {
int a = (number % 2) * 17;
int b = (number % 3) * 3;
return a + b + 19;
}
} | Main.java:8: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
1 error
|
s803841995 | p00147 | Java | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Fukushimaken {
// ??£?????????????????????????????????
private int time = 0;
// ?????????????????????????????§????????°???????????°
private int groupCount = 0;
public static void main(String[] args) throws Exception {
new Fukushimaken().execute();
}
private void execute() throws Exception {
// ?¨??????\????????????????????????
List<Integer> targetGroups = readInitialData();
// ?????°(17???)
EatingVisitor[] seats = new EatingVisitor[17];
// ?????£?????????????????????
List<WaitingVisitor> waitingGroups = new ArrayList<WaitingVisitor>();
// ?????°?????????????????????????¨??????????
List<Integer> waitTimes = new ArrayList<Integer>();
// ??????????????????????????????????????????????????°??????????????????
int maxGroupNum = searchMaxGroupNum(targetGroups);
// ?????????????????§??°??????????????????????????£????????????
while (groupCount <= maxGroupNum) {
// ???????????´??°
waitingGroups.addAll(updateWaitLine());
// ??¢?????????
leaveSeat(seats);
// ????????????
waitTimes.addAll(sitDown(seats, waitingGroups));
time++;
}
// ????????????
for (int targetGroup : targetGroups) {
System.out.println(waitTimes.get(targetGroup));
}
}
/**
* ??§??????????????????
*
* @param seats
* ??????????????§???(17???)
* @param waitingGroups
* ?????§?????£???????????°?????????
*/
private List<Integer> sitDown(EatingVisitor[] seats, List<WaitingVisitor> waitingGroups) {
List<Integer> waitTimes = new ArrayList<Integer>();
int removeCount = 0;
for (WaitingVisitor waitingPerson : waitingGroups) {
int emptySeatCount = 0;
boolean isEmpty = false;
for (int i = 0; i < seats.length; i++) {
// ????????°????????\
if (seats[i] == null) {
emptySeatCount++;
} else {
emptySeatCount = 0;
}
if (waitingPerson.getNumber() == emptySeatCount) {
// ????????§??£?????°???????????°?????´??°
groupCount++;
removeCount++;
isEmpty = true;
// ????±???°????????????????????????????¨????
waitTimes.add(time - waitingPerson.getStartTime());
// ?£???????????????????????¨????
int endTime = 17 * (waitingPerson.getGroup() % 2) + 3 * (waitingPerson.getGroup() % 3) + 19;
for (int j = 0; j < emptySeatCount; j++) {
seats[i - j] = new EatingVisitor(waitingPerson.getGroup(), endTime + time);
}
break;
}
}
if (!isEmpty) {
break;
}
}
// ?£????????§?????????????????????????
for (int i = 0; i < removeCount; i++) {
waitingGroups.remove(0);
}
return waitTimes;
}
/**
* ?£???????????????£???????????¢????????????
*
* @param seats
* ??§???
*/
private void leaveSeat(EatingVisitor[] seats) {
for (int i = 0; i < seats.length; i++) {
if (seats[i] != null && seats[i].getEndTime() == time) {
seats[i] = null;
}
}
}
/**
* ?????£????????????????????´??°
*
* @return ????????????
*/
private List<WaitingVisitor> updateWaitLine() {
List<WaitingVisitor> waitingGroups = new ArrayList<WaitingVisitor>();
int nowGroup = time / 5;
// ??°?????????????????£??????????????????
if (time % 5 == 0) {
// ??°?????????????????°?????????
int number = 2;
if (nowGroup % 5 == 1) {
number = 5;
}
// ??????????????????????????????????§?????????????????¨????
waitingGroups.add(new WaitingVisitor(nowGroup, number, time));
}
return waitingGroups;
}
/**
* ?¨??????\????????????????????????
*
* @return ??????????????°?????????
*/
private List<Integer> readInitialData() throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line = null;
List<Integer> groups = new ArrayList<Integer>();
while ((line = reader.readLine()) != null) {
groups.add(Integer.parseInt(line));
}
return groups;
}
/**
* ???????????????????????§??°??????????????????????´¢
*
* @param targetGroups
* ??????????±??????°?????????
* @return ??°???????????????
*/
private int searchMaxGroupNum(List<Integer> targetGroups) {
int maxGroupNum = 0;
for (int targetGroup : targetGroups) {
if (maxGroupNum < targetGroup) {
maxGroupNum = targetGroup;
}
}
return maxGroupNum;
}
}
/**
* ?????¢??????
*/
abstract class Visitor {
// ????±???°?????????
private int group;
public int getGroup() {
return group;
}
public void setGroup(int group) {
this.group = group;
}
}
/**
* ?????§?????£??????????????¢??????
*/
class WaitingVisitor extends Visitor {
public WaitingVisitor(int group, int number, int startTime) {
setGroup(group);
setNumber(number);
setStartTime(startTime);
}
// ???????§?????????????
private int startTime;
// ??°?????????????????°
private int number;
public int getStartTime() {
return startTime;
}
public void setStartTime(int startTime) {
this.startTime = startTime;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
}
/**
* ?£???????????????¢??????
*/
class EatingVisitor extends Visitor {
public EatingVisitor(int group, int endTime) {
setGroup(group);
setEndtTime(endTime);
}
// ?£???????????????????
private int endtTime;
public int getEndTime() {
return endtTime;
}
public void setEndtTime(int endtTime) {
this.endtTime = endtTime;
}
} | Main.java:6: error: class Fukushimaken is public, should be declared in a file named Fukushimaken.java
public class Fukushimaken {
^
1 error
|
s155678062 | p00147 | Java | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Main{
// ??£?????????????????????????????????
private int time = 0;
// ?????????????????????????????§????????°???????????°
private int groupCount = 0;
public static void main(String[] args) throws Exception {
new Fukushimaken().execute();
}
private void execute() throws Exception {
// ?¨??????\????????????????????????
List<Integer> targetGroups = readInitialData();
// ?????°(17???)
EatingVisitor[] seats = new EatingVisitor[17];
// ?????£?????????????????????
List<WaitingVisitor> waitingGroups = new ArrayList<WaitingVisitor>();
// ?????°?????????????????????????¨??????????
List<Integer> waitTimes = new ArrayList<Integer>();
// ??????????????????????????????????????????????????°??????????????????
int maxGroupNum = searchMaxGroupNum(targetGroups);
// ?????????????????§??°??????????????????????????£????????????
while (groupCount <= maxGroupNum) {
// ???????????´??°
waitingGroups.addAll(updateWaitLine());
// ??¢?????????
leaveSeat(seats);
// ????????????
waitTimes.addAll(sitDown(seats, waitingGroups));
time++;
}
// ????????????
for (int targetGroup : targetGroups) {
System.out.println(waitTimes.get(targetGroup));
}
}
/**
* ??§??????????????????
*
* @param seats
* ??????????????§???(17???)
* @param waitingGroups
* ?????§?????£???????????°?????????
*/
private List<Integer> sitDown(EatingVisitor[] seats, List<WaitingVisitor> waitingGroups) {
List<Integer> waitTimes = new ArrayList<Integer>();
int removeCount = 0;
for (WaitingVisitor waitingPerson : waitingGroups) {
int emptySeatCount = 0;
boolean isEmpty = false;
for (int i = 0; i < seats.length; i++) {
// ????????°????????\
if (seats[i] == null) {
emptySeatCount++;
} else {
emptySeatCount = 0;
}
if (waitingPerson.getNumber() == emptySeatCount) {
// ????????§??£?????°???????????°?????´??°
groupCount++;
removeCount++;
isEmpty = true;
// ????±???°????????????????????????????¨????
waitTimes.add(time - waitingPerson.getStartTime());
// ?£???????????????????????¨????
int endTime = 17 * (waitingPerson.getGroup() % 2) + 3 * (waitingPerson.getGroup() % 3) + 19;
for (int j = 0; j < emptySeatCount; j++) {
seats[i - j] = new EatingVisitor(waitingPerson.getGroup(), endTime + time);
}
break;
}
}
if (!isEmpty) {
break;
}
}
// ?£????????§?????????????????????????
for (int i = 0; i < removeCount; i++) {
waitingGroups.remove(0);
}
return waitTimes;
}
/**
* ?£???????????????£???????????¢????????????
*
* @param seats
* ??§???
*/
private void leaveSeat(EatingVisitor[] seats) {
for (int i = 0; i < seats.length; i++) {
if (seats[i] != null && seats[i].getEndTime() == time) {
seats[i] = null;
}
}
}
/**
* ?????£????????????????????´??°
*
* @return ????????????
*/
private List<WaitingVisitor> updateWaitLine() {
List<WaitingVisitor> waitingGroups = new ArrayList<WaitingVisitor>();
int nowGroup = time / 5;
// ??°?????????????????£??????????????????
if (time % 5 == 0) {
// ??°?????????????????°?????????
int number = 2;
if (nowGroup % 5 == 1) {
number = 5;
}
// ??????????????????????????????????§?????????????????¨????
waitingGroups.add(new WaitingVisitor(nowGroup, number, time));
}
return waitingGroups;
}
/**
* ?¨??????\????????????????????????
*
* @return ??????????????°?????????
*/
private List<Integer> readInitialData() throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line = null;
List<Integer> groups = new ArrayList<Integer>();
while ((line = reader.readLine()) != null) {
groups.add(Integer.parseInt(line));
}
return groups;
}
/**
* ???????????????????????§??°??????????????????????´¢
*
* @param targetGroups
* ??????????±??????°?????????
* @return ??°???????????????
*/
private int searchMaxGroupNum(List<Integer> targetGroups) {
int maxGroupNum = 0;
for (int targetGroup : targetGroups) {
if (maxGroupNum < targetGroup) {
maxGroupNum = targetGroup;
}
}
return maxGroupNum;
}
}
/**
* ?????¢??????
*/
abstract class Visitor {
// ????±???°?????????
private int group;
public int getGroup() {
return group;
}
public void setGroup(int group) {
this.group = group;
}
}
/**
* ?????§?????£??????????????¢??????
*/
class WaitingVisitor extends Visitor {
public WaitingVisitor(int group, int number, int startTime) {
setGroup(group);
setNumber(number);
setStartTime(startTime);
}
// ???????§?????????????
private int startTime;
// ??°?????????????????°
private int number;
public int getStartTime() {
return startTime;
}
public void setStartTime(int startTime) {
this.startTime = startTime;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
}
/**
* ?£???????????????¢??????
*/
class EatingVisitor extends Visitor {
public EatingVisitor(int group, int endTime) {
setGroup(group);
setEndtTime(endTime);
}
// ?£???????????????????
private int endtTime;
public int getEndTime() {
return endtTime;
}
public void setEndtTime(int endtTime) {
this.endtTime = endtTime;
}
} | Main.java:15: error: cannot find symbol
new Fukushimaken().execute();
^
symbol: class Fukushimaken
location: class Main
1 error
|
s579501978 | p00147 | C++ | #include <bits/stdc++.h>
using namespace std;
#define MAX 100
struct S{
int g, t;
S(int g, int t) : g(g), t(t) {}
};
int arr[MAX];
vector<S> seat;
int minute(int i){
return 17*(i%2) + 3*(i%3) + 19;
}
void make(){
int g = 0;
for(int i = 0 ; i < 17 ; i++){
seat.push_back(S(-1,-1));
}
vector<info> _wait;
for(int i = 0 ; i < 570 ; i++){
int size = _wait.size();
if(size){
for(int j = 0 ; j < size ; j++){
_wait[j].t++;
}
}
for(int j = 0 ; j < 17 ; j++){
if(seat[j].g != -1){
seat[j].t--;
if(seat[j].t == 0){
seat[j].g = seat[j].t = -1;
}
}
}
if(size){
for(int j = 0 ; j < size ; j++){
int n = _wait[j].g;
int cnt, c;
bool flg = false;
if(n % 5 == 1) cnt = c = 5;
else cnt = c = 2;
for(int k = 0 ; k < 17 ; k++){
if(seat[k].g == -1) cnt--;
else cnt = c;
if(cnt == 0){
for(int l = k-c+1 ; l <= k ; l++){
seat[l].g = n;
seat[l].t = minute(n);
}
arr[n] = _wait[j].t;
flg = true;
j--;
_wait.erase(_wait.begin());
break;
}
}
if(!flg || !_wait.size()) break;
}
size = _wait.size();
}
if(g == 100) continue;
if(i % 5 == 0){
int cnt, c;
bool flg = false;
if(size){
_wait.push_back(S(g,0));
g++;
continue;
}
if(g % 5 == 1) cnt = c = 5;
else cnt = c = 2;
for(int j = 0 ; j < 17 ; j++){
if(seat[j].g == -1) cnt--;
else cnt = c;
if(cnt == 0){
flg = true;
for(int k = j-c+1 ; k <= j ; k++){
seat[k].g = seat[k].g = g;
seat[k].t = seat[k].t = minute(g);
}
arr[g] = 0;
break;
}
}
if(!flg){
_wait.push_back(S(g,0));
}
g++;
}
}
}
int main(){
int N;
make();
while(cin >> N){
cout << arr[N] << endl;
}
return 0;
} | a.cc: In function 'void make()':
a.cc:24:10: error: 'info' was not declared in this scope
24 | vector<info> _wait;
| ^~~~
a.cc:24:14: error: template argument 1 is invalid
24 | vector<info> _wait;
| ^
a.cc:24:14: error: template argument 2 is invalid
a.cc:26:22: error: request for member 'size' in '_wait', which is of non-class type 'int'
26 | int size = _wait.size();
| ^~~~
a.cc:30:14: error: invalid types 'int[int]' for array subscript
30 | _wait[j].t++;
| ^
a.cc:45:22: error: invalid types 'int[int]' for array subscript
45 | int n = _wait[j].g;
| ^
a.cc:58:27: error: invalid types 'int[int]' for array subscript
58 | arr[n] = _wait[j].t;
| ^
a.cc:61:19: error: request for member 'erase' in '_wait', which is of non-class type 'int'
61 | _wait.erase(_wait.begin());
| ^~~~~
a.cc:61:31: error: request for member 'begin' in '_wait', which is of non-class type 'int'
61 | _wait.erase(_wait.begin());
| ^~~~~
a.cc:65:27: error: request for member 'size' in '_wait', which is of non-class type 'int'
65 | if(!flg || !_wait.size()) break;
| ^~~~
a.cc:67:20: error: request for member 'size' in '_wait', which is of non-class type 'int'
67 | size = _wait.size();
| ^~~~
a.cc:74:15: error: request for member 'push_back' in '_wait', which is of non-class type 'int'
74 | _wait.push_back(S(g,0));
| ^~~~~~~~~
a.cc:95:15: error: request for member 'push_back' in '_wait', which is of non-class type 'int'
95 | _wait.push_back(S(g,0));
| ^~~~~~~~~
|
s442962781 | p00147 | C++ | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Main {
/** 対象外 */
private static final int EXEMPT = -1;
/** グループ数 */
private static final int GROUP_NUM = 100;
/** 標準入力 */
private static BufferedReader br;
/** 座席数 最後の座席番号 */
private static int seatsNum, firstSeatNum;
/** 到着時間 客数 食事時間 待ち時間 */
private static int[] arriveMinutes, customersNum, mealMinutes, waitMinutes;
/** 座席 */
private static String[] seats;
/** 初期化 */
static {
br = new BufferedReader(new InputStreamReader(System.in));
seatsNum = 17;
arriveMinutes = new int[GROUP_NUM];
customersNum = new int[GROUP_NUM];
mealMinutes = new int[GROUP_NUM];
waitMinutes = new int[GROUP_NUM];
seats = new String[seatsNum];
for (int i = 0; i < GROUP_NUM; i++) {
// グループ数分繰り返す
// 到着時間
arriveMinutes[i] = 5 * i;
// 人数
customersNum[i] = i % 5 == 1 ? 5 : 2;
// 食事時間
mealMinutes[i] = seatsNum * (i % 2) + 3 * (i % 3) + 19;
}
// 待ち時間を作成
createWaitTimes();
}
/** 待ち時間を作成する */
private static void createWaitTimes() {
// 順番
int groupOrder;
// 行列リスト
List<Integer> waitList = new ArrayList<Integer>();
// 行列排除リスト
List<Integer> removeList = new ArrayList<Integer>();
for (int currentTime = 0, totalGroupNum = 0; totalGroupNum < GROUP_NUM; currentTime++) {
// 行列が終了するまで、一分毎に繰り返す
// 食事の時間が終了した客を離席させる
outCustomer(currentTime);
if ((groupOrder = arrivedCustomer(arriveMinutes, currentTime)) != EXEMPT) {
// 到着時間の場合
if (waitList.isEmpty()) {
// 行列がない場合
if (isEmpty(groupOrder)) {
// 着席可能の場合
// 座席に着席させる
setSeat(Integer.toString(groupOrder));
totalGroupNum++;
} else {
// 着席不可の場合
// 行列に並ばせる
waitList.add(groupOrder);
}
} else {
// 行列がある場合
// 行列に並ばせる
waitList.add(groupOrder);
}
}
if (!waitList.isEmpty()) {
// 行列がある場合
// 行列番号
int i = 0;
for (int wait : waitList) {
// 行列リスト分、繰り返す
if (isEmpty(wait)) {
// 着席可能の場合
// 座席に着席させる
setSeat(Integer.toString(wait));
totalGroupNum++;
// 待った時間を設定する
waitMinutes[wait] = currentTime - arriveMinutes[wait];
// 着席したグループを行列排除リストに追加する
removeList.add(i);
} else {
// 着席不可の場合
// 行列の先頭が着席できないため、残りの行列も着席不可にする。
break;
}
i++;
}
}
if (!removeList.isEmpty()) {
// 行列排除リストに着席したグループが追加されていた場合
// リストの降順でソートする(リムーブするため)
Collections.reverse(removeList);
for (int remove : removeList) {
// 行列排除リスト分、繰り返す
// 行列リストから行列排除リストの番号を削除する
waitList.remove(remove);
}
// 初期化
removeList = new ArrayList<Integer>();
}
}
}
/** メイン */
public static void main(String[] args) throws IOException {
String line;
List<Integer> inputList = new ArrayList<Integer>();
while ((line = br.readLine()) != null && !line.isEmpty()) {
inputList.add(Integer.parseInt(line));
}
for (int input : inputList) {
System.out.println(waitMinutes[input]);
}
}
/** 現在時間に到着するグループ番号を検索し返す */
private static int arrivedCustomer(int[] targets, int currentTime) {
int order = 0;
for (int target : targets) {
if (target == currentTime) {
return order;
}
order++;
}
return EXEMPT;
}
/** 離席させる */
private static void outCustomer(int currentTime) {
// 席番
int seatNum = 0;
for (String seat : seats) {
// 座席数分繰り返す
if (seat == null) {
// 空席の場合
seatNum++;
continue;
}
if (currentTime - (arriveMinutes[Integer.parseInt(seat)]
+ waitMinutes[Integer.parseInt(seat)]) >= mealMinutes[Integer
.parseInt(seat)]) {
// 食事の時間が終了した場合
// 空席にする
seats[seatNum] = null;
}
seatNum++;
}
}
/** 着席させる */
private static void setSeat(String groupsNum) {
for (int count = 0; count < customersNum[Integer.parseInt(groupsNum)]; count++) {
// 着席する人数分繰り返す
// 座席にグループ番号を設定する
seats[firstSeatNum++] = groupsNum;
}
}
/** 引数のグループ番号の客数分、空席かどうか確認する */
private static boolean isEmpty(int groupsNum) {
// 空席数
int emptyseatsNum = 0;
int i = 0;
for (; i < seatsNum || customersNum[groupsNum] <= seatsNum - i; i++) {
// 残座席数が客の数以下になるまで座席数分繰り返す
if (emptyseatsNum == customersNum[groupsNum]) {
// 連続した空席が客の数だけあった場合
break;
}
if (seats[i] == null) {
// 空席かつ繰り返す席が顧客数分以上存在する場合
emptyseatsNum++;
continue;
} else {
// 空席でない場合
// 空席数を初期化
emptyseatsNum = 0;
}
}
if (emptyseatsNum == customersNum[groupsNum]) {
// 空席の最初の座席番号を設定する
firstSeatNum = i - emptyseatsNum;
return true;
}
return false;
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.BufferedReader;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.io.InputStreamReader;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.util.ArrayList;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
5 | import java.util.Collections;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
6 | import java.util.List;
| ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: expected unqualified-id before 'public'
8 | public class Main {
| ^~~~~~
|
s976319685 | p00147 | C++ | #include<queue>
#include<cstdio>
#define mp make_pair
#define EMPTY -1
using namespace std;
typedef pair<int,int> pii;
int Numbers(int groupid){
return groupid%5==1?5:2;
}
int MealTime(int groupid){
return 17*(groupid%2)+3*(groupid%3)+19;
}
int main()
{
int counter[17],elapse[17],mealtime[17];
queue<pii> qu; // <numbers in a group, group id>
for(int i=0;i<17;i++) counter[i]=EMPTY;
int waittime[100];
for(int t=0;t<589;t++){
// enqueue
if(t%5==0&&t<500){
qu.push(mp(Numbers(t/5),t/5));
}
// going
for(int i=0;i<17;i++){
if(counter[i]!=EMPTY){
elapse[i]++;
if(elapse[i]==mealtime[i]) counter[i]=EMPTY;
}
}
// coming
if(!qu.empty()){
pii next=qu.front();
for(int i=0,cnt=0;i<17;i++){
if(counter[i]==EMPTY) cnt++;
else cnt=0;
if(cnt==next.first){
waittime[next.second]=t-5*next.second;
int mt=MealTime(next.second);
for(int j=i;j>i-next.first;j--){
counter[j]=next.second;
mealtime[j]=MealTime(next.second);
elapse[j]=0;
}
cnt=0;
qu.pop();
if(qu.empty()) break;
next=qu.front();
}
}
}
}
for(int n;~scanf("%d",&n)) printf("%d\n",waittime[n]);
return 0;
} | a.cc: In function 'int main()':
a.cc:64:34: error: expected ';' before ')' token
64 | for(int n;~scanf("%d",&n)) printf("%d\n",waittime[n]);
| ^
| ;
|
s211207455 | p00147 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
int seat[17] = {0};
int X = 0;
int stop[100] = {0};
int time = 0;
queue<int> Q;
while(X < 100){
int x;
if(time%5 == 0 && time < 500){
Q.push(time/5);
}
while(1){
if(Q.size())x = Q.front();
else x = -1;
bool f = false;
if(~x){
int people = (x%5==1?5:2);
int use = 19 + 3 * (x%3) + 17 * (x%2);
rep(i,17-people+1){
bool flag = true;
rep(j,people){
flag &= seat[i+j] == 0;
}
if(flag){
rep(j,people){
seat[i+j] = use;
}
f = true;
break;
}
}
}
if(f){
stop[x] = time - x * 5;
Q.pop();
X++;
}
if(!f)break;
}
rep(i,17){
seat[i] = max(0,seat[i]-1);
}
time++;
}
int n,c=0;
while(cin >> n){
if(n < 50)c++;
cout << stop[n] << endl;
}
while(c>=5){return 1};
} | a.cc: In function 'int main()':
a.cc:59:29: error: expected ';' before '}' token
59 | while(c>=5){return 1};
| ^
| ;
|
s576966472 | p00147 | C++ | main(){
int n,c=0;
while(~scanf("%d",&n)){
if(n==98)c++;
}
return (c?1:0);
} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:3:16: error: 'scanf' was not declared in this scope
3 | while(~scanf("%d",&n)){
| ^~~~~
|
s587217728 | p00148 | Java | #include <stdio.h>
int main(int argc,char* argv[]){
int num;
while(scanf("%d",&num) != EOF){
int d = num % 39;
if(d == 0){
d = 39;
}
printf("3C%02d\n",d);
}
return 0;
} | Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
^
Main.java:7: error: class, interface, enum, or record expected
while(scanf("%d",&num) != EOF){
^
Main.java:9: error: class, interface, enum, or record expected
if(d == 0){
^
Main.java:11: error: class, interface, enum, or record expected
}
^
Main.java:14: error: class, interface, enum, or record expected
}
^
Main.java:18: error: class, interface, enum, or record expected
}
^
7 errors
|
s688945619 | p00148 | C | main(c){for(;~scanf("%d",&c)*c;printf("3C%02d\n",c%39?c%39+1));} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(c){for(;~scanf("%d",&c)*c;printf("3C%02d\n",c%39?c%39+1));}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:1:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(c){for(;~scanf("%d",&c)*c;printf("3C%02d\n",c%39?c%39+1));}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(c){for(;~scanf("%d",&c)*c;printf("3C%02d\n",c%39?c%39+1));}
main.c:1:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(c){for(;~scanf("%d",&c)*c;printf("3C%02d\n",c%39?c%39+1));}
| ^~~~~
main.c:1:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:32: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | main(c){for(;~scanf("%d",&c)*c;printf("3C%02d\n",c%39?c%39+1));}
| ^~~~~~
main.c:1:32: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:32: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:32: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:61: error: expected ':' before ')' token
1 | main(c){for(;~scanf("%d",&c)*c;printf("3C%02d\n",c%39?c%39+1));}
| ^
| :
|
s078226850 | p00148 | C | main(c){for(;~scanf("%d",%c)*c;printf("3C%02d\n",c%39?:39));} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(c){for(;~scanf("%d",%c)*c;printf("3C%02d\n",c%39?:39));}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:1:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(c){for(;~scanf("%d",%c)*c;printf("3C%02d\n",c%39?:39));}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(c){for(;~scanf("%d",%c)*c;printf("3C%02d\n",c%39?:39));}
main.c:1:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(c){for(;~scanf("%d",%c)*c;printf("3C%02d\n",c%39?:39));}
| ^~~~~
main.c:1:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:26: error: expected expression before '%' token
1 | main(c){for(;~scanf("%d",%c)*c;printf("3C%02d\n",c%39?:39));}
| ^
main.c:1:32: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | main(c){for(;~scanf("%d",%c)*c;printf("3C%02d\n",c%39?:39));}
| ^~~~~~
main.c:1:32: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:32: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:32: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s292652939 | p00148 | C | #include<stdio.h>
int main(void)
{
int n;
while(scanf("%d",&n)!=EOF){
if((n-1)%38<10){
printf("3C0%d\n",(n-1)%38+1);
} else {
printf("3C%d\n",(n-1)%38+1);
}
return 0;
} | main.c: In function 'main':
main.c:14:1: error: expected declaration or statement at end of input
14 | }
| ^
|
s753763701 | p00148 | C | #include <stdio.h>
int main(void)
{
int n;
while (scanf("%d", &n) != EOF){
if (n > 39){
while (1){
n = n - 39;
if (n < 39){
if (n > 9){
if (n == 0){
n = 39;
printf("3C%d\n", n);
break;
}
else {
printf("3C%d\n", n);
}
else {
printf("3C0%d\n", n);
break;
}
}
}
}
else if (n < 9){
printf("3C0%d\n", n);
}
else {
printf("3C%d\n", n);
}
}
return (0);
} | main.c: In function 'main':
main.c:21:41: error: expected '}' before 'else'
21 | else {
| ^~~~
|
s425933546 | p00148 | C | #include <stdio.h>
int main(void)
{
int can;
while (scanf("%d", &can) != EOF){
if (can % 39 == 0){
printf(("3C39\n");
}
else if (can % 39 < 10){
printf("3C0%d\n", can % 39);
}
else {
printf("3C%d\n", can % 39);
}
}
return (0);
} | main.c: In function 'main':
main.c:9:42: error: expected ')' before ';' token
9 | printf(("3C39\n");
| ~ ^
| )
main.c:9:43: error: expected ';' before '}' token
9 | printf(("3C39\n");
| ^
| ;
10 | }
| ~
|
s377678543 | p00148 | C | main(n){for(;~scanf("%d",&n);)printf("3C%02d
",~-n%39+1);} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(n){for(;~scanf("%d",&n);)printf("3C%02d
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(n){for(;~scanf("%d",&n);)printf("3C%02d
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(n){for(;~scanf("%d",&n);)printf("3C%02d
main.c:1:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(n){for(;~scanf("%d",&n);)printf("3C%02d
| ^~~~~
main.c:1:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:31: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | main(n){for(;~scanf("%d",&n);)printf("3C%02d
| ^~~~~~
main.c:1:31: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:31: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:31: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:38: warning: missing terminating " character
1 | main(n){for(;~scanf("%d",&n);)printf("3C%02d
| ^
main.c:1:38: error: missing terminating " character
1 | main(n){for(;~scanf("%d",&n);)printf("3C%02d
| ^~~~~~~
main.c:2:1: warning: missing terminating " character
2 | ",~-n%39+1);}
| ^
main.c:2:1: error: missing terminating " character
2 | ",~-n%39+1);}
| ^~~~~~~~~~~~~
main.c:2:1: error: expected expression at end of input
main.c:2:1: error: expected declaration or statement at end of input
|
s298927327 | p00148 | C | z=main(a){for(;z=~scanf("%d",&a);printf("3C%02d\n",(a-1)%39+1));} | main.c:1:1: warning: data definition has no type or storage class
1 | z=main(a){for(;z=~scanf("%d",&a);printf("3C%02d\n",(a-1)%39+1));}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int]
main.c:1:3: error: implicit declaration of function 'main' [-Wimplicit-function-declaration]
1 | z=main(a){for(;z=~scanf("%d",&a);printf("3C%02d\n",(a-1)%39+1));}
| ^~~~
main.c:1:8: error: 'a' undeclared here (not in a function)
1 | z=main(a){for(;z=~scanf("%d",&a);printf("3C%02d\n",(a-1)%39+1));}
| ^
main.c:1:10: error: expected ',' or ';' before '{' token
1 | z=main(a){for(;z=~scanf("%d",&a);printf("3C%02d\n",(a-1)%39+1));}
| ^
|
s695475654 | p00148 | C++ | include <iostream>
using namespace std;
int main() {
int candy = 0;
while (true){
cin >> candy;
if (candy == EOF) {
break;
}
cout << candy % 39 << endl;
}
} | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
9 | cin >> candy;
| ^~~
a.cc:10:18: error: 'EOF' was not declared in this scope
10 | if (candy == EOF) {
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | include <iostream>
a.cc:14:5: error: 'cout' was not declared in this scope
14 | cout << candy % 39 << endl;
| ^~~~
a.cc:14:27: error: 'endl' was not declared in this scope
14 | cout << candy % 39 << endl;
| ^~~~
|
s014755601 | p00148 | C++ | #include<iostream>
using namespace std;
int main(){
int n,count;
while(1){
cin>>n;
if(n==char_traits<char>::eof)break;
count=n%39;
if(count==0)count=39;
cout<<"3C"<<count<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(n==char_traits<char>::eof)break;
| ~^~~~~~~~~~~~~~~~~~~~~~~~
|
s801877880 | p00148 | C++ | #include<iostream>
using namespace std;
int main(){
int n,count;
while(cin>>n){
count=n%39;
if(count==0)count=39;
cout<<"3C"<<(count/10==0)?"0"+count:count<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:58: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
9 | cout<<"3C"<<(count/10==0)?"0"+count:count<<endl;
| ~~~~~^~~~~~
|
s843705502 | p00148 | C++ | #include using namespace std;
int main() {
int n;
while (cin >> n) {
int s = n % 39;
if (s == 0) {
cout << "3C39" << endl;
} else if (s < 10) {
cout << "3C0" << s << endl;
} else {
cout << "3C" << s << endl;
}
}
return 0;
} | a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
1 | #include using namespace std;
| ^~~~~
a.cc: In function 'int main()':
a.cc:4:16: error: 'cin' was not declared in this scope
4 | while (cin >> n) {
| ^~~
a.cc:7:25: error: 'cout' was not declared in this scope
7 | cout << "3C39" << endl;
| ^~~~
a.cc:7:43: error: 'endl' was not declared in this scope
7 | cout << "3C39" << endl;
| ^~~~
a.cc:9:25: error: 'cout' was not declared in this scope
9 | cout << "3C0" << s << endl;
| ^~~~
a.cc:9:47: error: 'endl' was not declared in this scope
9 | cout << "3C0" << s << endl;
| ^~~~
a.cc:11:25: error: 'cout' was not declared in this scope
11 | cout << "3C" << s << endl;
| ^~~~
a.cc:11:46: error: 'endl' was not declared in this scope
11 | cout << "3C" << s << endl;
| ^~~~
|
s757050729 | p00148 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
???int n;
???cout.fill('0');
???while(cin>>n){
??????if(n%39==0)cout<<"3C39"<<endl;
??????else cout<<"3C"<<setw(2)<<n%39<<endl;
???}
} | a.cc: In function 'int main()':
a.cc:5:1: error: expected primary-expression before '?' token
5 | ???int n;
| ^
a.cc:5:2: error: expected primary-expression before '?' token
5 | ???int n;
| ^
a.cc:5:3: error: expected primary-expression before '?' token
5 | ???int n;
| ^
a.cc:5:4: error: expected primary-expression before 'int'
5 | ???int n;
| ^~~
a.cc:5:4: error: expected ':' before 'int'
5 | ???int n;
| ^~~
| :
a.cc:5:4: error: expected primary-expression before 'int'
5 | ???int n;
| ^~~
a.cc:5:4: error: expected ':' before 'int'
5 | ???int n;
| ^~~
| :
a.cc:5:4: error: expected primary-expression before 'int'
5 | ???int n;
| ^~~
a.cc:5:4: error: expected ':' before 'int'
5 | ???int n;
| ^~~
| :
a.cc:5:4: error: expected primary-expression before 'int'
5 | ???int n;
| ^~~
a.cc:6:1: error: expected primary-expression before '?' token
6 | ???cout.fill('0');
| ^
a.cc:6:2: error: expected primary-expression before '?' token
6 | ???cout.fill('0');
| ^
a.cc:6:3: error: expected primary-expression before '?' token
6 | ???cout.fill('0');
| ^
a.cc:6:18: error: expected ':' before ';' token
6 | ???cout.fill('0');
| ^
| :
a.cc:6:18: error: expected primary-expression before ';' token
a.cc:6:18: error: expected ':' before ';' token
6 | ???cout.fill('0');
| ^
| :
a.cc:6:18: error: expected primary-expression before ';' token
a.cc:6:18: error: expected ':' before ';' token
6 | ???cout.fill('0');
| ^
| :
a.cc:6:18: error: expected primary-expression before ';' token
a.cc:7:1: error: expected primary-expression before '?' token
7 | ???while(cin>>n){
| ^
a.cc:7:2: error: expected primary-expression before '?' token
7 | ???while(cin>>n){
| ^
a.cc:7:3: error: expected primary-expression before '?' token
7 | ???while(cin>>n){
| ^
a.cc:7:4: error: expected primary-expression before 'while'
7 | ???while(cin>>n){
| ^~~~~
a.cc:7:4: error: expected ':' before 'while'
7 | ???while(cin>>n){
| ^~~~~
| :
a.cc:7:4: error: expected primary-expression before 'while'
7 | ???while(cin>>n){
| ^~~~~
a.cc:7:4: error: expected ':' before 'while'
7 | ???while(cin>>n){
| ^~~~~
| :
a.cc:7:4: error: expected primary-expression before 'while'
7 | ???while(cin>>n){
| ^~~~~
a.cc:7:4: error: expected ':' before 'while'
7 | ???while(cin>>n){
| ^~~~~
| :
a.cc:7:4: error: expected primary-expression before 'while'
7 | ???while(cin>>n){
| ^~~~~
|
s977337367 | p00148 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
???int n;
???cout.fill('0');
???while(cin>>n){
??????if(n%39==0)cout<<"3C39"<<endl;
??????else cout<<"3C"<<setw(2)<<n%39<<endl;
???}
} | a.cc: In function 'int main()':
a.cc:5:1: error: expected primary-expression before '?' token
5 | ???int n;
| ^
a.cc:5:2: error: expected primary-expression before '?' token
5 | ???int n;
| ^
a.cc:5:3: error: expected primary-expression before '?' token
5 | ???int n;
| ^
a.cc:5:4: error: expected primary-expression before 'int'
5 | ???int n;
| ^~~
a.cc:5:4: error: expected ':' before 'int'
5 | ???int n;
| ^~~
| :
a.cc:5:4: error: expected primary-expression before 'int'
5 | ???int n;
| ^~~
a.cc:5:4: error: expected ':' before 'int'
5 | ???int n;
| ^~~
| :
a.cc:5:4: error: expected primary-expression before 'int'
5 | ???int n;
| ^~~
a.cc:5:4: error: expected ':' before 'int'
5 | ???int n;
| ^~~
| :
a.cc:5:4: error: expected primary-expression before 'int'
5 | ???int n;
| ^~~
a.cc:6:1: error: expected primary-expression before '?' token
6 | ???cout.fill('0');
| ^
a.cc:6:2: error: expected primary-expression before '?' token
6 | ???cout.fill('0');
| ^
a.cc:6:3: error: expected primary-expression before '?' token
6 | ???cout.fill('0');
| ^
a.cc:6:18: error: expected ':' before ';' token
6 | ???cout.fill('0');
| ^
| :
a.cc:6:18: error: expected primary-expression before ';' token
a.cc:6:18: error: expected ':' before ';' token
6 | ???cout.fill('0');
| ^
| :
a.cc:6:18: error: expected primary-expression before ';' token
a.cc:6:18: error: expected ':' before ';' token
6 | ???cout.fill('0');
| ^
| :
a.cc:6:18: error: expected primary-expression before ';' token
a.cc:7:1: error: expected primary-expression before '?' token
7 | ???while(cin>>n){
| ^
a.cc:7:2: error: expected primary-expression before '?' token
7 | ???while(cin>>n){
| ^
a.cc:7:3: error: expected primary-expression before '?' token
7 | ???while(cin>>n){
| ^
a.cc:7:4: error: expected primary-expression before 'while'
7 | ???while(cin>>n){
| ^~~~~
a.cc:7:4: error: expected ':' before 'while'
7 | ???while(cin>>n){
| ^~~~~
| :
a.cc:7:4: error: expected primary-expression before 'while'
7 | ???while(cin>>n){
| ^~~~~
a.cc:7:4: error: expected ':' before 'while'
7 | ???while(cin>>n){
| ^~~~~
| :
a.cc:7:4: error: expected primary-expression before 'while'
7 | ???while(cin>>n){
| ^~~~~
a.cc:7:4: error: expected ':' before 'while'
7 | ???while(cin>>n){
| ^~~~~
| :
a.cc:7:4: error: expected primary-expression before 'while'
7 | ???while(cin>>n){
| ^~~~~
|
s939916842 | p00148 | C++ | using System;
class myclass
{
public static void Main()
{
string s;
int g,x=0;
int[] k=new int[20];
for (int i = 0; i < 20; i++){
s = Console.ReadLine();
if (s == "EOF"){
x = i;
break;
}
g = Int32.Parse(s);
k[i] = g % 39;
}
for (int i = 0; i < x; i++){
if (k[i] == 0)
{
Console.WriteLine("3C39");
}
else if (k[i] < 10)
{
Console.WriteLine("3C0" + k[i]);
}
else Console.WriteLine("3C" + k[i]);
}
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:5:11: error: expected ':' before 'static'
5 | public static void Main()
| ^~~~~~~
| :
a.cc:32:2: error: expected ';' after class definition
32 | }
| ^
| ;
a.cc: In static member function 'static void myclass::Main()':
a.cc:7:9: error: 'string' was not declared in this scope
7 | string s;
| ^~~~~~
a.cc:9:12: error: structured binding declaration cannot have type 'int'
9 | int[] k=new int[20];
| ^~
a.cc:9:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:9:12: error: empty structured binding declaration
a.cc:9:15: error: expected initializer before 'k'
9 | int[] k=new int[20];
| ^
a.cc:11:13: error: 's' was not declared in this scope
11 | s = Console.ReadLine();
| ^
a.cc:11:17: error: 'Console' was not declared in this scope
11 | s = Console.ReadLine();
| ^~~~~~~
a.cc:16:17: error: 'Int32' was not declared in this scope
16 | g = Int32.Parse(s);
| ^~~~~
a.cc:17:13: error: 'k' was not declared in this scope
17 | k[i] = g % 39;
| ^
a.cc:20:17: error: 'k' was not declared in this scope
20 | if (k[i] == 0)
| ^
a.cc:22:17: error: 'Console' was not declared in this scope
22 | Console.WriteLine("3C39");
| ^~~~~~~
a.cc:26:17: error: 'Console' was not declared in this scope
26 | Console.WriteLine("3C0" + k[i]);
| ^~~~~~~
a.cc:28:18: error: 'Console' was not declared in this scope
28 | else Console.WriteLine("3C" + k[i]);
| ^~~~~~~
|
s264653172 | p00148 | C++ | #include <bits/stdc++.h>
#define r(i,a,n) for(int i=a;i<n;i++)
using namespace std;
int main(){
int a;
while(cin>>a){
(a-1)%=39;
a++;
cout<<3<<'c';
if(a<10)cout<<0;
cout<<a<<endl;
}
} | a.cc: In function 'int main()':
a.cc:7:19: error: lvalue required as left operand of assignment
7 | (a-1)%=39;
| ~~^~~
|
s561573274 | p00148 | C++ | #include<bits/stdc++.h>
using namespace std;
int a;
int main(){
while(scanf("%d",&a)!=EOF){
if(a%39!=0)printf("3C%02d\n",a%39);A
else cout<<"3C39"<<endl;
}
} | a.cc: In function 'int main()':
a.cc:6:41: error: 'A' was not declared in this scope
6 | if(a%39!=0)printf("3C%02d\n",a%39);A
| ^
|
s541171977 | p00148 | C++ | #include<stdio.h>
int main(void)
{
int a;
while(scanf("%d",&a)!=EOF){
if(a%39==0) printf("3c39\n");
else{
if(a%39>=10) printf("3C%d",a%39);
else printf("3C0%d",a%39);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:2: error: expected '}' at end of input
12 | }
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s497797884 | p00148 | C++ | #include<stdio.h>
int main(void)
{
int x;
scanf("%d",&x);
while(1){
a=a-39;
if(a<=39) break;
}
if(a<10){
printf("3C0%d\n",a);
}
else {
printf("3C%d\n",a);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:17: error: 'a' was not declared in this scope
7 | a=a-39;
| ^
a.cc:10:12: error: 'a' was not declared in this scope
10 | if(a<10){
| ^
|
s635301852 | p00148 | C++ | #include<stdio.h>
int main(void)
{
int a,b;
while(scanf("%d",&a)!=EOF) {
b=a%39
if(b==0) b=39;
printf("3C%02d\n",a);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:19: error: expected ';' before 'if'
6 | b=a%39
| ^
| ;
7 | if(b==0) b=39;
| ~~
|
s501578051 | p00148 | C++ | int main(){
while(!std::cin.eof()){
int in;
std::cin >> in;
std::cout << "3C" << 1+(in%39)<<std::endl;
}
} | a.cc: In function 'int main()':
a.cc:2:14: error: 'cin' is not a member of 'std'
2 | while(!std::cin.eof()){
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | int main(){
a.cc:4:6: error: 'cin' is not a member of 'std'
4 | std::cin >> in;
| ^~~
a.cc:4:6: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:5:6: error: 'cout' is not a member of 'std'
5 | std::cout << "3C" << 1+(in%39)<<std::endl;
| ^~~~
a.cc:5:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:5:38: error: 'endl' is not a member of 'std'
5 | std::cout << "3C" << 1+(in%39)<<std::endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | int main(){
|
s056152722 | p00148 | C++ | #include<iostream>
int main(){
while(!std::cin.eof()){
int in;
std::cin >> in;
if(!in%=39) in =39;
std::printf("3C%02d\n",in);
}
} | a.cc: In function 'int main()':
a.cc:6:5: error: lvalue required as left operand of assignment
6 | if(!in%=39) in =39;
| ^~~
|
s584760582 | p00148 | C++ | #include<iostream>
int main(){
while(!std::cin.eof()){
int in;
std::cin >> in;
if(!in=in%39) in =39;
std::printf("3C%02d\n",in);
}
} | a.cc: In function 'int main()':
a.cc:6:5: error: lvalue required as left operand of assignment
6 | if(!in=in%39) in =39;
| ^~~
|
s665922305 | p00148 | C++ | #include<iostream>
main()for(int n;std::cin>>n;)printf("3C%02d\n",--n%39+1); | a.cc:2:7: error: expected constructor, destructor, or type conversion before 'for'
2 | main()for(int n;std::cin>>n;)printf("3C%02d\n",--n%39+1);
| ^~~
a.cc:2:22: error: 'cin' in namespace 'std' does not name a type
2 | main()for(int n;std::cin>>n;)printf("3C%02d\n",--n%39+1);
| ^~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:2:29: error: expected unqualified-id before ')' token
2 | main()for(int n;std::cin>>n;)printf("3C%02d\n",--n%39+1);
| ^
|
s391736226 | p00148 | C++ | #include <iostream>
using namespace std;
int main(){
while( cin >> n ){
int x = n%39 + 1;
cout << "3C";
if( x < 10 ) cout << 0;
cout << x << endl;
}
} | a.cc: In function 'int main()':
a.cc:5:19: error: 'n' was not declared in this scope
5 | while( cin >> n ){
| ^
|
s761365814 | p00148 | C++ | main(n){
for(;~scanf("%d",&n);printf(n<10?"3C0%d\n":"3C%d\n",n))
n=(n-1)%39+1;
} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(n){
| ^
|
s238807516 | p00148 | C++ | i;main(n){for(;i=~scanf("%d",&n);printf("3C%02d\n",n))n=(n%39)?n%39:39;} | a.cc:1:1: error: 'i' does not name a type
1 | i;main(n){for(;i=~scanf("%d",&n);printf("3C%02d\n",n))n=(n%39)?n%39:39;}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | i;main(n){for(;i=~scanf("%d",&n);printf("3C%02d\n",n))n=(n%39)?n%39:39;}
| ^
|
s752872736 | p00148 | C++ | #include <iostream>
using namespace std;
int main()
{
while(true)
{
int candy;
cin >> candy;
if ( cin.eof() ) break;
cout << "3C" << candy&39 << endl;
}
} | a.cc: In function 'int main()':
a.cc:11:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
11 | cout << "3C" << candy&39 << endl;
| ~~~^~~~~~~
|
s491060446 | p00148 | C++ | #include<stdio.h>
int main(void)
{
int n;
while(1){
if(scanf("%d",&n)==EOF){
break;
}
while(n>=39){
n=n-39
}
if(n<10){
printf("3C0%d",n);
}
else{
printf("3C%d\n",n);
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:31: error: expected ';' before '}' token
10 | n=n-39
| ^
| ;
11 | }
| ~
|
s206229385 | p00148 | C++ | #include<stdio.h>
int main(void)
{
int x,ama;
while(1) {
if(scanf("%d",&x)==EOF){
break;
}
while(n>=39){
n=n-39;
}
if(ama==0) {
ama=39;
}
if(ama<10) {
printf("3C0%d\n",ama);
}
else {
printf("3C%d\n",ama);
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:23: error: 'n' was not declared in this scope
10 | while(n>=39){
| ^
|
s649607135 | p00148 | C++ | #include <iostream>
using namespace std;
int main()
{
int n;
while (cin>>n)
cout << "3C" << setw(2) << setfill('0') << (n%39==0?39:n%39) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:33: error: 'setw' was not declared in this scope
7 | cout << "3C" << setw(2) << setfill('0') << (n%39==0?39:n%39) << endl;
| ^~~~
a.cc:2:1: note: 'std::setw' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
1 | #include <iostream>
+++ |+#include <iomanip>
2 | using namespace std;
a.cc:7:44: error: 'setfill' was not declared in this scope
7 | cout << "3C" << setw(2) << setfill('0') << (n%39==0?39:n%39) << endl;
| ^~~~~~~
a.cc:7:44: note: 'std::setfill' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
|
s530167926 | p00148 | C++ | #include<iostream>
using namespace std;
int main(){
int in;
while(cin>>in){
cout<<"3C"<<etfill(’0′) << setw(2) << right<<(in-1)%39+1<<endl;
}
} | a.cc:6:20: error: extended character ’ is not valid in an identifier
6 | cout<<"3C"<<etfill(’0′) << setw(2) << right<<(in-1)%39+1<<endl;
| ^
a.cc:6:20: error: extended character ′ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:6:20: error: '\U000020190\U00002032' was not declared in this scope
6 | cout<<"3C"<<etfill(’0′) << setw(2) << right<<(in-1)%39+1<<endl;
| ^~~
a.cc:6:13: error: 'etfill' was not declared in this scope
6 | cout<<"3C"<<etfill(’0′) << setw(2) << right<<(in-1)%39+1<<endl;
| ^~~~~~
a.cc:6:28: error: 'setw' was not declared in this scope
6 | cout<<"3C"<<etfill(’0′) << setw(2) << right<<(in-1)%39+1<<endl;
| ^~~~
a.cc:2:1: note: 'std::setw' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
1 | #include<iostream>
+++ |+#include <iomanip>
2 | using namespace std;
|
s905815482 | p00148 | C++ | #include<iostream>
#include<iomanip>
using namespace std;
int main(){
int in;
while(cin>>in){
cout<<"3C"<<etfill(’0′) << setw(2) << right<<(in-1)%39+1<<endl;
}
} | a.cc:7:20: error: extended character ’ is not valid in an identifier
7 | cout<<"3C"<<etfill(’0′) << setw(2) << right<<(in-1)%39+1<<endl;
| ^
a.cc:7:20: error: extended character ′ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:7:20: error: '\U000020190\U00002032' was not declared in this scope
7 | cout<<"3C"<<etfill(’0′) << setw(2) << right<<(in-1)%39+1<<endl;
| ^~~
a.cc:7:13: error: 'etfill' was not declared in this scope
7 | cout<<"3C"<<etfill(’0′) << setw(2) << right<<(in-1)%39+1<<endl;
| ^~~~~~
|
s370713437 | p00149 | C | #include<stdio.h>
int main(void){
double l,r;
int countla=0;
int countra=0;
int countlb=0;
int countrb=0;
int countlc=0;
int countrc=0;
int countld=0;
int countrd=0;
while(scanf("%lf %lf",&l,&r) != EOF){
if(l>=1.1){
countla++;
}
else if(l<1.1&&l>=0.6){
countlb++;
}
else if(l<0.6&&l>=0.2){
countlc++;
}
else if(l<0.2){
countld++;
}
if(r>=1.1){
countra++;
}
else if(r<1.1&&r>=0.6){
countrb++;
}
else if(r<0.6&&r>=0.2){
countrc++;
}
else if(r<0.2){
countrd++;
}
printf("%d %d\n",countla++,countra++);
printf("%d %d\n",countlb++,countrb++);
printf("%d %d\n",countlc++,countrc++);
printf("%d %d\n",countld++,countrd++);
return 0;
}
| main.c: In function 'main':
main.c:49:1: error: expected declaration or statement at end of input
49 | }
| ^
|
s630020320 | p00149 | C | #include <stdio.h>
int main(void)
{
float judge[4] = {1.1, 0.6, 0.2, 0.0};
float f, i;
int eye[4][2] = {0};
while (scanf("%f", &f) != EOF){
i = 0;
while (1){
if (f >= judge[i]){
eye[i][0]++;
break;
}
i++;
}
scanf("%f", &f);
i = 0;
while (1){
if (f >= judge[i]){
eye[i][1]++;
break;
}
i++;
}
}
for (i = 0; i < 4; i++){
printf("%d %d\n", eye[i][0], eye[i][1]);
}
return (0);
} | main.c: In function 'main':
main.c:12:39: error: array subscript is not an integer
12 | if (f >= judge[i]){
| ^
main.c:13:36: error: array subscript is not an integer
13 | eye[i][0]++;
| ^
main.c:22:39: error: array subscript is not an integer
22 | if (f >= judge[i]){
| ^
main.c:23:36: error: array subscript is not an integer
23 | eye[i][1]++;
| ^
main.c:31:38: error: array subscript is not an integer
31 | printf("%d %d\n", eye[i][0], eye[i][1]);
| ^
main.c:31:49: error: array subscript is not an integer
31 | printf("%d %d\n", eye[i][0], eye[i][1]);
| ^
|
s489051356 | p00149 | C | #include <stdio.h>
void check(double eye, int table[4]);
int main(void)
{
int right[4] = {0};
int left[4] = {0};
double r, l;
while (scanf("%lf %lf", &r, &l) != EOF){
check(r, right);
check(l, lef);
}
for (i = 0; i < 4; i++){
printf("%d %d\n", left[i], right[i]);
}
return 0;
}
void check(double eye, int table[4])
{
if (eye >= 1.1){
table[0]++;
}
else if (eye >= 0.6){
table[1]++;
}
else if (eye >= 0.2){
table[2]++;
}
else {
table[3]++;
}
} | main.c: In function 'main':
main.c:13:26: error: 'lef' undeclared (first use in this function); did you mean 'left'?
13 | check(l, lef);
| ^~~
| left
main.c:13:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:14: error: 'i' undeclared (first use in this function)
15 | for (i = 0; i < 4; i++){
| ^
|
s424215474 | p00149 | C | main(l[4],r[4],i){float a,b;for(;~scanf("%f%f",&a,&b);){l[a<0.2?3:a<0.6?2:a<1.1?1:0]++;r[b<0.2?3:b<0.6?2:b<1.1?1:0]++;}for(i=0;i<4;i++){printf("%d %d\n",l[i],r[i]);}} | main.c:1:6: error: unknown type name 'l'
1 | main(l[4],r[4],i){float a,b;for(;~scanf("%f%f",&a,&b);){l[a<0.2?3:a<0.6?2:a<1.1?1:0]++;r[b<0.2?3:b<0.6?2:b<1.1?1:0]++;}for(i=0;i<4;i++){printf("%d %d\n",l[i],r[i]);}}
| ^
main.c:1:11: error: unknown type name 'r'
1 | main(l[4],r[4],i){float a,b;for(;~scanf("%f%f",&a,&b);){l[a<0.2?3:a<0.6?2:a<1.1?1:0]++;r[b<0.2?3:b<0.6?2:b<1.1?1:0]++;}for(i=0;i<4;i++){printf("%d %d\n",l[i],r[i]);}}
| ^
main.c:1:16: error: unknown type name 'i'
1 | main(l[4],r[4],i){float a,b;for(;~scanf("%f%f",&a,&b);){l[a<0.2?3:a<0.6?2:a<1.1?1:0]++;r[b<0.2?3:b<0.6?2:b<1.1?1:0]++;}for(i=0;i<4;i++){printf("%d %d\n",l[i],r[i]);}}
| ^
|
s351031176 | p00149 | C | /* https://tausiq.wordpress.com/2008/12/09/uva-100-the-3n-1-problem/ */
#include <cstdio>
#include <algorithm>
#define long
long LL
using namespace std;
int main ()
{
int i, j;
while ( scanf ("%d %d", &i, &j) != EOF ) {
int temp_i =
i;
int temp_j = j;
if ( i > j ) swap (i, j);
int max_cycle_length = 0;
int cycle_length;
while ( i <= j ) {
unsigned int n = i;
cycle_length = 1;
while ( n != 1 ) {
if ( n % 2 == 1 ) n = 3 * n + 1;
else n /= 2;
cycle_length++;
}
if ( cycle_length > max_cycle_length )
max_cycle_length = cycle_length;
i++;
}
printf ("%d %d %d\n", temp_i, temp_j, max_cycle_length);
}
return 0;
} | main.c:2:10: fatal error: cstdio: No such file or directory
2 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s380174812 | p00149 | C | #include <stdio.h>
int main(void){
int ans[4][2]={0},i,j;
double l,r;
while(scanf("%lf %lf",&l,&r)!=EOF){
if(l>1.1)ans[0][0]++;
else if(l>0.6)ans[1][0]++;
else if(l>0.2)ans[2][0]++;
else ans[3][0]++;
if(r>1.1)ans[0][1]++;
else if(r>0.6)ans[1][1]++;
else if(r>0.2)ans[2][1]++;
else ans[3][1]++;
}
for(i=0;i<4;i++)
printf("%d %d\n",a[i][0],a[i][1]);
return 0;
} | main.c: In function 'main':
main.c:16:22: error: 'a' undeclared (first use in this function)
16 | printf("%d %d\n",a[i][0],a[i][1]);
| ^
main.c:16:22: note: each undeclared identifier is reported only once for each function it appears in
|
s505967588 | p00149 | C | int main(){
int s[4][2]={0,0,0,0,0,0,0,0};
double b[2];
while(scanf("%lf %lf",&b[0],&b[1])!=EOF){
for(j=0;j<2;j++){
if(b[j]>=1.1)
s[0][j]++;
else if(b[j]>=0.6)
s[1][j]++;
else if(b[j]>=0.2)
s[2][j]++;
else s[3][j]++;
}
for(j=0;j<4;j++)
printf("%lf %lf\n",s[i][0],s[i][1]);
}
return 0;
} | main.c: In function 'main':
main.c:4:7: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | while(scanf("%lf %lf",&b[0],&b[1])!=EOF){
| ^~~~~
main.c:1:8: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(){
main.c:4:7: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | while(scanf("%lf %lf",&b[0],&b[1])!=EOF){
| ^~~~~
main.c:4:7: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:37: error: 'EOF' undeclared (first use in this function)
4 | while(scanf("%lf %lf",&b[0],&b[1])!=EOF){
| ^~~
main.c:4:37: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:4:37: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:5: error: 'j' undeclared (first use in this function)
5 | for(j=0;j<2;j++){
| ^
main.c:15:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
15 | printf("%lf %lf\n",s[i][0],s[i][1]);
| ^~~~~~
main.c:15:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:22: error: 'i' undeclared (first use in this function)
15 | printf("%lf %lf\n",s[i][0],s[i][1]);
| ^
|
s916664107 | p00149 | C | int main(){
int s[4][2]={0,0,0,0,0,0,0,0};
double b[2];
while(scanf("%lf %lf",&b[0],&b[1])!=EOF){
for(j=0;j<2;j++){
if(b[j]>=1.1)
s[0][j]++;
else if(b[j]>=0.6)
s[1][j]++;
else if(b[j]>=0.2)
s[2][j]++;
else s[3][j]++;
}
for(j=0;j<4;j++)
printf("%d %d\n",s[i][0],s[i][1]);
}
return 0;
} | main.c: In function 'main':
main.c:4:7: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | while(scanf("%lf %lf",&b[0],&b[1])!=EOF){
| ^~~~~
main.c:1:8: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(){
main.c:4:7: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | while(scanf("%lf %lf",&b[0],&b[1])!=EOF){
| ^~~~~
main.c:4:7: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:37: error: 'EOF' undeclared (first use in this function)
4 | while(scanf("%lf %lf",&b[0],&b[1])!=EOF){
| ^~~
main.c:4:37: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:4:37: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:5: error: 'j' undeclared (first use in this function)
5 | for(j=0;j<2;j++){
| ^
main.c:15:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
15 | printf("%d %d\n",s[i][0],s[i][1]);
| ^~~~~~
main.c:15:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:20: error: 'i' undeclared (first use in this function)
15 | printf("%d %d\n",s[i][0],s[i][1]);
| ^
|
s988858211 | p00149 | C | #include<stdio.h>
int main(){
int s[4][2]={0,0,0,0,0,0,0,0};
double b[2];
while(scanf("%lf %lf",&b[0],&b[1])!=EOF){
for(j=0;j<2;j++){
if(b[j]>=1.1)
s[0][j]++;
else if(b[j]>=0.6)
s[1][j]++;
else if(b[j]>=0.2)
s[2][j]++;
else s[3][j]++;
}
for(j=0;j<4;j++)
printf("%d %d\n",s[i][0],s[i][1]);
}
return 0;
} | main.c: In function 'main':
main.c:6:5: error: 'j' undeclared (first use in this function)
6 | for(j=0;j<2;j++){
| ^
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:20: error: 'i' undeclared (first use in this function)
16 | printf("%d %d\n",s[i][0],s[i][1]);
| ^
|
s749661896 | p00149 | C | #include<stdio.h>
int main(){
int s[4][2]={0,0,0,0,0,0,0,0},j;
double b[2];
while(scanf("%lf %lf",&b[0],&b[1])!=EOF){
for(j=0;j<2;j++){
if(b[j]>=1.1)
s[0][j]++;
else if(b[j]>=0.6)
s[1][j]++;
else if(b[j]>=0.2)
s[2][j]++;
else s[3][j]++;
}
for(j=0;j<4;j++)
printf("%d %d\n",s[i][0],s[i][1]);
}
return 0;
} | main.c: In function 'main':
main.c:16:20: error: 'i' undeclared (first use in this function)
16 | printf("%d %d\n",s[i][0],s[i][1]);
| ^
main.c:16:20: note: each undeclared identifier is reported only once for each function it appears in
|
s800815471 | p00149 | C | #include<stdio.h>
int main(void)
{
int a,b,i;
float x,y;
a=0;b=0;
scanf("%d %d",&x,&y);
while(x!=0 && y!=0) {
if(x>=1.1) {
printf("A\n");
}
if(0.6<=x && x<1.1) {
printf("B\n");
}
if(0.2<=x && x<0.6) {
printf("C\n");
}
if(x<0.2) {
printf("D\n");
}
if(y>=1.1) {
printf("A\n");
}
if(0.6<=y && y<1.1) {
printf("B\n");
}
if(0.2<=y && y<0.6) {
printf("C\n");
}
if(y<0.2) {
printf("D\n");
}
a+=X;
b+=Y;
scanf("%d %d",&a,&b);
return 0;
} | main.c: In function 'main':
main.c:33:20: error: 'X' undeclared (first use in this function)
33 | a+=X;
| ^
main.c:33:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:20: error: 'Y' undeclared (first use in this function)
34 | b+=Y;
| ^
main.c:37:1: error: expected declaration or statement at end of input
37 | }
| ^
|
s985137393 | p00149 | C | #include <stdio.h>
typedef struct eye{
int Left,Right;
};
int main(){
eye A,B,C,D;
A.Left=B.Left=C.Left=D.Left=0;
A.Right=B.Right=C.Right=D.Right=0;
float L,R;
while(scanf("%f%f",&L,&R)!=EOF){
if(L>=1.1) A.Left++;
else if(L>=0.6) B.Left++;
else if(L>=0.2) C.Left++;
else D.Left++;
if(R>=1.1) A.Right++;
else if(R>=0.6) B.Right++;
else if(R>=0.2) C.Right++;
else D.Right++;
}
printf("%d %d\n",A.Left,A.Right);
printf("%d %d\n",B.Left,B.Right);
printf("%d %d\n",C.Left,C.Right);
printf("%d %d\n",D.Left,D.Right);
return 0;
} | main.c:5:1: warning: useless storage class specifier in empty declaration
5 | };
| ^
main.c: In function 'main':
main.c:8:9: error: unknown type name 'eye'; use 'struct' keyword to refer to the type
8 | eye A,B,C,D;
| ^~~
| struct
main.c:9:10: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:9:17: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:9:24: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:9:31: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:10:10: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:10:18: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:10:26: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:10:34: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:13:29: error: request for member 'Left' in something not a structure or union
13 | if(L>=1.1) A.Left++;
| ^
main.c:14:34: error: request for member 'Left' in something not a structure or union
14 | else if(L>=0.6) B.Left++;
| ^
main.c:15:34: error: request for member 'Left' in something not a structure or union
15 | else if(L>=0.2) C.Left++;
| ^
main.c:16:23: error: request for member 'Left' in something not a structure or union
16 | else D.Left++;
| ^
main.c:17:29: error: request for member 'Right' in something not a structure or union
17 | if(R>=1.1) A.Right++;
| ^
main.c:18:34: error: request for member 'Right' in something not a structure or union
18 | else if(R>=0.6) B.Right++;
| ^
main.c:19:34: error: request for member 'Right' in something not a structure or union
19 | else if(R>=0.2) C.Right++;
| ^
main.c:20:23: error: request for member 'Right' in something not a structure or union
20 | else D.Right++;
| ^
main.c:22:27: error: request for member 'Left' in something not a structure or union
22 | printf("%d %d\n",A.Left,A.Right);
| ^
main.c:22:34: error: request for member 'Right' in something not a structure or union
22 | printf("%d %d\n",A.Left,A.Right);
| ^
main.c:23:27: error: request for member 'Left' in something not a structure or union
23 | printf("%d %d\n",B.Left,B.Right);
| ^
main.c:23:34: error: request for member 'Right' in something not a structure or union
23 | printf("%d %d\n",B.Left,B.Right);
| ^
main.c:24:27: error: request for member 'Left' in something not a structure or union
24 | printf("%d %d\n",C.Left,C.Right);
| ^
main.c:24:34: error: request for member 'Right' in something not a structure or union
24 | printf("%d %d\n",C.Left,C.Right);
| ^
main.c:25:27: error: request for member 'Left' in something not a structure or union
25 | printf("%d %d\n",D.Left,D.Right);
| ^
main.c:25:34: error: request for member 'Right' in something not a structure or union
25 | printf("%d %d\n",D.Left,D.Right);
| ^
|
s381719824 | p00149 | C | #include <stdio.h>
typedef struct eye{
int Left,Right;
};
int main(){
eye A,B,C,D;
A.Left=B.Left=C.Left=D.Left=0;
A.Right=B.Right=C.Right=D.Right=0;
float L,R;
while(scanf("%f%f",&L,&R)!=EOF){
if(L>=1.1) A.Left++;
else if(L>=0.6) B.Left++;
else if(L>=0.2) C.Left++;
else D.Left++;
if(R>=1.1) A.Right++;
else if(R>=0.6) B.Right++;
else if(R>=0.2) C.Right++;
else D.Right++;
}
printf("%d %d\n",A.Left,A.Right);
printf("%d %d\n",B.Left,B.Right);
printf("%d %d\n",C.Left,C.Right);
printf("%d %d\n",D.Left,D.Right);
return 0;
} | main.c:5:1: warning: useless storage class specifier in empty declaration
5 | };
| ^
main.c: In function 'main':
main.c:8:9: error: unknown type name 'eye'; use 'struct' keyword to refer to the type
8 | eye A,B,C,D;
| ^~~
| struct
main.c:9:10: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:9:17: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:9:24: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:9:31: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:10:10: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:10:18: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:10:26: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:10:34: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:13:29: error: request for member 'Left' in something not a structure or union
13 | if(L>=1.1) A.Left++;
| ^
main.c:14:34: error: request for member 'Left' in something not a structure or union
14 | else if(L>=0.6) B.Left++;
| ^
main.c:15:34: error: request for member 'Left' in something not a structure or union
15 | else if(L>=0.2) C.Left++;
| ^
main.c:16:23: error: request for member 'Left' in something not a structure or union
16 | else D.Left++;
| ^
main.c:17:29: error: request for member 'Right' in something not a structure or union
17 | if(R>=1.1) A.Right++;
| ^
main.c:18:34: error: request for member 'Right' in something not a structure or union
18 | else if(R>=0.6) B.Right++;
| ^
main.c:19:34: error: request for member 'Right' in something not a structure or union
19 | else if(R>=0.2) C.Right++;
| ^
main.c:20:23: error: request for member 'Right' in something not a structure or union
20 | else D.Right++;
| ^
main.c:22:27: error: request for member 'Left' in something not a structure or union
22 | printf("%d %d\n",A.Left,A.Right);
| ^
main.c:22:34: error: request for member 'Right' in something not a structure or union
22 | printf("%d %d\n",A.Left,A.Right);
| ^
main.c:23:27: error: request for member 'Left' in something not a structure or union
23 | printf("%d %d\n",B.Left,B.Right);
| ^
main.c:23:34: error: request for member 'Right' in something not a structure or union
23 | printf("%d %d\n",B.Left,B.Right);
| ^
main.c:24:27: error: request for member 'Left' in something not a structure or union
24 | printf("%d %d\n",C.Left,C.Right);
| ^
main.c:24:34: error: request for member 'Right' in something not a structure or union
24 | printf("%d %d\n",C.Left,C.Right);
| ^
main.c:25:27: error: request for member 'Left' in something not a structure or union
25 | printf("%d %d\n",D.Left,D.Right);
| ^
main.c:25:34: error: request for member 'Right' in something not a structure or union
25 | printf("%d %d\n",D.Left,D.Right);
| ^
|
s694129805 | p00149 | C | #include <stdio.h>
struct eye{
int Left,Right;
};
int main(){
eye A,B,C,D;
A.Left=B.Left=C.Left=D.Left=0;
A.Right=B.Right=C.Right=D.Right=0;
float L,R;
while(scanf("%f%f",&L,&R)!=EOF){
if(L>=1.1) A.Left++;
else if(L>=0.6) B.Left++;
else if(L>=0.2) C.Left++;
else D.Left++;
if(R>=1.1) A.Right++;
else if(R>=0.6) B.Right++;
else if(R>=0.2) C.Right++;
else D.Right++;
}
printf("%d %d\n",A.Left,A.Right);
printf("%d %d\n",B.Left,B.Right);
printf("%d %d\n",C.Left,C.Right);
printf("%d %d\n",D.Left,D.Right);
return 0;
} | main.c: In function 'main':
main.c:8:9: error: unknown type name 'eye'; use 'struct' keyword to refer to the type
8 | eye A,B,C,D;
| ^~~
| struct
main.c:9:10: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:9:17: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:9:24: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:9:31: error: request for member 'Left' in something not a structure or union
9 | A.Left=B.Left=C.Left=D.Left=0;
| ^
main.c:10:10: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:10:18: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:10:26: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:10:34: error: request for member 'Right' in something not a structure or union
10 | A.Right=B.Right=C.Right=D.Right=0;
| ^
main.c:13:29: error: request for member 'Left' in something not a structure or union
13 | if(L>=1.1) A.Left++;
| ^
main.c:14:34: error: request for member 'Left' in something not a structure or union
14 | else if(L>=0.6) B.Left++;
| ^
main.c:15:34: error: request for member 'Left' in something not a structure or union
15 | else if(L>=0.2) C.Left++;
| ^
main.c:16:23: error: request for member 'Left' in something not a structure or union
16 | else D.Left++;
| ^
main.c:17:29: error: request for member 'Right' in something not a structure or union
17 | if(R>=1.1) A.Right++;
| ^
main.c:18:34: error: request for member 'Right' in something not a structure or union
18 | else if(R>=0.6) B.Right++;
| ^
main.c:19:34: error: request for member 'Right' in something not a structure or union
19 | else if(R>=0.2) C.Right++;
| ^
main.c:20:23: error: request for member 'Right' in something not a structure or union
20 | else D.Right++;
| ^
main.c:22:27: error: request for member 'Left' in something not a structure or union
22 | printf("%d %d\n",A.Left,A.Right);
| ^
main.c:22:34: error: request for member 'Right' in something not a structure or union
22 | printf("%d %d\n",A.Left,A.Right);
| ^
main.c:23:27: error: request for member 'Left' in something not a structure or union
23 | printf("%d %d\n",B.Left,B.Right);
| ^
main.c:23:34: error: request for member 'Right' in something not a structure or union
23 | printf("%d %d\n",B.Left,B.Right);
| ^
main.c:24:27: error: request for member 'Left' in something not a structure or union
24 | printf("%d %d\n",C.Left,C.Right);
| ^
main.c:24:34: error: request for member 'Right' in something not a structure or union
24 | printf("%d %d\n",C.Left,C.Right);
| ^
main.c:25:27: error: request for member 'Left' in something not a structure or union
25 | printf("%d %d\n",D.Left,D.Right);
| ^
main.c:25:34: error: request for member 'Right' in something not a structure or union
25 | printf("%d %d\n",D.Left,D.Right);
| ^
|
s103995970 | p00149 | C | #include <stdio.h>
struct eye{
int Left,Right;
};
int main(){
eye A={0,0},B={0,0},C={0,0},D={0,0};
/*A.Left=B.Left=C.Left=D.Left=0;
A.Right=B.Right=C.Right=D.Right=0;*/
float L,R;
while(scanf("%f%f",&L,&R)!=EOF){
if(L>=1.1) A.Left++;
else if(L>=0.6) B.Left++;
else if(L>=0.2) C.Left++;
else D.Left++;
if(R>=1.1) A.Right++;
else if(R>=0.6) B.Right++;
else if(R>=0.2) C.Right++;
else D.Right++;
}
printf("%d %d\n",A.Left,A.Right);
printf("%d %d\n",B.Left,B.Right);
printf("%d %d\n",C.Left,C.Right);
printf("%d %d\n",D.Left,D.Right);
return 0;
} | main.c: In function 'main':
main.c:8:9: error: unknown type name 'eye'; use 'struct' keyword to refer to the type
8 | eye A={0,0},B={0,0},C={0,0},D={0,0};
| ^~~
| struct
main.c:8:18: warning: excess elements in scalar initializer
8 | eye A={0,0},B={0,0},C={0,0},D={0,0};
| ^
main.c:8:18: note: (near initialization for 'A')
main.c:8:26: warning: excess elements in scalar initializer
8 | eye A={0,0},B={0,0},C={0,0},D={0,0};
| ^
main.c:8:26: note: (near initialization for 'B')
main.c:8:34: warning: excess elements in scalar initializer
8 | eye A={0,0},B={0,0},C={0,0},D={0,0};
| ^
main.c:8:34: note: (near initialization for 'C')
main.c:8:42: warning: excess elements in scalar initializer
8 | eye A={0,0},B={0,0},C={0,0},D={0,0};
| ^
main.c:8:42: note: (near initialization for 'D')
main.c:13:29: error: request for member 'Left' in something not a structure or union
13 | if(L>=1.1) A.Left++;
| ^
main.c:14:34: error: request for member 'Left' in something not a structure or union
14 | else if(L>=0.6) B.Left++;
| ^
main.c:15:34: error: request for member 'Left' in something not a structure or union
15 | else if(L>=0.2) C.Left++;
| ^
main.c:16:23: error: request for member 'Left' in something not a structure or union
16 | else D.Left++;
| ^
main.c:17:29: error: request for member 'Right' in something not a structure or union
17 | if(R>=1.1) A.Right++;
| ^
main.c:18:34: error: request for member 'Right' in something not a structure or union
18 | else if(R>=0.6) B.Right++;
| ^
main.c:19:34: error: request for member 'Right' in something not a structure or union
19 | else if(R>=0.2) C.Right++;
| ^
main.c:20:23: error: request for member 'Right' in something not a structure or union
20 | else D.Right++;
| ^
main.c:22:27: error: request for member 'Left' in something not a structure or union
22 | printf("%d %d\n",A.Left,A.Right);
| ^
main.c:22:34: error: request for member 'Right' in something not a structure or union
22 | printf("%d %d\n",A.Left,A.Right);
| ^
main.c:23:27: error: request for member 'Left' in something not a structure or union
23 | printf("%d %d\n",B.Left,B.Right);
| ^
main.c:23:34: error: request for member 'Right' in something not a structure or union
23 | printf("%d %d\n",B.Left,B.Right);
| ^
main.c:24:27: error: request for member 'Left' in something not a structure or union
24 | printf("%d %d\n",C.Left,C.Right);
| ^
main.c:24:34: error: request for member 'Right' in something not a structure or union
24 | printf("%d %d\n",C.Left,C.Right);
| ^
main.c:25:27: error: request for member 'Left' in something not a structure or union
25 | printf("%d %d\n",D.Left,D.Right);
| ^
main.c:25:34: error: request for member 'Right' in something not a structure or union
25 | printf("%d %d\n",D.Left,D.Right);
| ^
|
s058640380 | p00149 | C | main(){float e;int d[4][2]={0},i;for(i=0;~scanf("%f",&e);i^=1)e>1.0?d[0][i]++:e>0.5?d[1][i]++:e>0.2?d[2][i]++:d[3][i]++;for(i=0;i<4;i++)printf("%d %d\n",d[i][0],d[i][1]);exit(0)} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){float e;int d[4][2]={0},i;for(i=0;~scanf("%f",&e);i^=1)e>1.0?d[0][i]++:e>0.5?d[1][i]++:e>0.2?d[2][i]++:d[3][i]++;for(i=0;i<4;i++)printf("%d %d\n",d[i][0],d[i][1]);exit(0)}
| ^~~~
main.c: In function 'main':
main.c:1:43: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(){float e;int d[4][2]={0},i;for(i=0;~scanf("%f",&e);i^=1)e>1.0?d[0][i]++:e>0.5?d[1][i]++:e>0.2?d[2][i]++:d[3][i]++;for(i=0;i<4;i++)printf("%d %d\n",d[i][0],d[i][1]);exit(0)}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(){float e;int d[4][2]={0},i;for(i=0;~scanf("%f",&e);i^=1)e>1.0?d[0][i]++:e>0.5?d[1][i]++:e>0.2?d[2][i]++:d[3][i]++;for(i=0;i<4;i++)printf("%d %d\n",d[i][0],d[i][1]);exit(0)}
main.c:1:43: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(){float e;int d[4][2]={0},i;for(i=0;~scanf("%f",&e);i^=1)e>1.0?d[0][i]++:e>0.5?d[1][i]++:e>0.2?d[2][i]++:d[3][i]++;for(i=0;i<4;i++)printf("%d %d\n",d[i][0],d[i][1]);exit(0)}
| ^~~~~
main.c:1:43: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:137: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | main(){float e;int d[4][2]={0},i;for(i=0;~scanf("%f",&e);i^=1)e>1.0?d[0][i]++:e>0.5?d[1][i]++:e>0.2?d[2][i]++:d[3][i]++;for(i=0;i<4;i++)printf("%d %d\n",d[i][0],d[i][1]);exit(0)}
| ^~~~~~
main.c:1:137: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:137: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:137: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:171: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
1 | main(){float e;int d[4][2]={0},i;for(i=0;~scanf("%f",&e);i^=1)e>1.0?d[0][i]++:e>0.5?d[1][i]++:e>0.2?d[2][i]++:d[3][i]++;for(i=0;i<4;i++)printf("%d %d\n",d[i][0],d[i][1]);exit(0)}
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | main(){float e;int d[4][2]={0},i;for(i=0;~scanf("%f",&e);i^=1)e>1.0?d[0][i]++:e>0.5?d[1][i]++:e>0.2?d[2][i]++:d[3][i]++;for(i=0;i<4;i++)printf("%d %d\n",d[i][0],d[i][1]);exit(0)}
main.c:1:171: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
1 | main(){float e;int d[4][2]={0},i;for(i=0;~scanf("%f",&e);i^=1)e>1.0?d[0][i]++:e>0.5?d[1][i]++:e>0.2?d[2][i]++:d[3][i]++;for(i=0;i<4;i++)printf("%d %d\n",d[i][0],d[i][1]);exit(0)}
| ^~~~
main.c:1:171: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:1:178: error: expected ';' before '}' token
1 | main(){float e;int d[4][2]={0},i;for(i=0;~scanf("%f",&e);i^=1)e>1.0?d[0][i]++:e>0.5?d[1][i]++:e>0.2?d[2][i]++:d[3][i]++;for(i=0;i<4;i++)printf("%d %d\n",d[i][0],d[i][1]);exit(0)}
| ^
| ;
|
s457046861 | p00149 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
const double eps = 0.001;
#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)
int main(){
int eye[4][2]={};
while(1){
rep(i,2){
if(a[i]+eps>1.1){
eye[0][i]++;
} else if(a[i]+eps>0.6){
eye[1][i]++;
} else if(a[i]+eps>0.2){
eye[2][i]++;
} else{
eye[3][i]++;
}
}
}
rep(i,4){
cout<<eye[i][0]<<" "<<eye[i][1]<<endl;
}
} | a.cc: In function 'int main()':
a.cc:14:16: error: 'a' was not declared in this scope
14 | if(a[i]+eps>1.1){
| ^
|
s076590629 | p00149 | C++ | 1.0 1.2
0.8 1.5
1.2 0.7
2.0 2.0 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1.0 1.2
| ^~~
|
s011772984 | p00149 | C++ | #include<stdio.h>
int main(){
int x1,x2,y1,y2;
int A[5]={},B[5]={};
while(scanf("%d.%d %d.%d",x1,x2,y1,y2)!=EOF)
{
if(x1>=2)A[0]++;
else if(x1==1&&x2>=1)A[0]++;
else if(x1==0&&x2>=6)A[1]++;
else if(x1==0&&x2>=2)A[2]++;
else if(x1==0&&x2<2)A[3]++;
if(Y1>=2)B[0]++;
else if(y1==1&&y2>=1)B[0]++;
else if(y1==0&&y2>=6)B[1]++;
else if(y1==0&&y2>=2)B[2]++;
else if(y1==0&&y2<2)B[3]++;
}
for(int i=0;i<3;i++)
printf("%d %d\n"A[i],B[i]);
return 0;
} | a.cc: In function 'int main()':
a.cc:15:4: error: 'Y1' was not declared in this scope; did you mean 'y1'?
15 | if(Y1>=2)B[0]++;
| ^~
| y1
a.cc:22:8: error: unable to find string literal operator 'operator""A' with 'const char [7]', 'long unsigned int' arguments
22 | printf("%d %d\n"A[i],B[i]);
| ^~~~~~~~~~
|
s581940360 | p00149 | C++ | #include<iostream>
using namespace std;
int main(){
double a[2];
int b[4][2]={0};
cin>>n;
while(cin>>a[0]>>a[1]){
for(int i=0;i<2;i++){
if(a[i]<0.2)
b[3][i]++;
else if(a[i]<0.6)
b[2][i]++;
else if(a[i]<1.1)
b[1][i]++;
else
b[0][i]++;
}
}
for(int i=0;i<4;i++)
cout<<b[i][0]<<" "<<b[i][1]<<endl;
} | a.cc: In function 'int main()':
a.cc:8:14: error: 'n' was not declared in this scope
8 | cin>>n;
| ^
|
s964919543 | p00149 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int leye[4]={0,0,0,0},reye[4]={0,0,0,0};
double lef,righ;
while(cin>>lef>>righ){
if(lef==0.1)leye[0]++;
?????? else if(lef<0.6)leye[1]++;
else if(lef<1.1)leye[2]++;
else leye[3]++;
if(righ==0.1)reye[0]++;
else if(righ<0.6)reye[1]++;
else if(righ<1.1)reye[2]++;
else reye[3]++;
}
for(int i=3;i>-1;i--)cout<<leye[i]<<" "<<reye[i]<<endl;
} | a.cc: In function 'int main()':
a.cc:9:1: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:2: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:3: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:4: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:5: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:6: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:10:2: error: 'else' without a previous 'if'
10 | else if(lef<1.1)leye[2]++;
| ^~~~
|
s994466206 | p00149 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int leye[4]={0,0,0,0},reye[4]={0,0,0,0};
double lef,righ;
while(cin>>lef>>righ){
if(lef==0.1)leye[0]++;
?????? else if(lef<0.6)leye[1]++;
else if(lef<1.1)leye[2]++;
else leye[3]++;
if(righ==0.1)reye[0]++;
else if(righ<0.6)reye[1]++;
else if(righ<1.1)reye[2]++;
else reye[3]++;
}
for(int i=3;i>-1;i--)cout<<leye[i]<<" "<<reye[i]<<endl;
} | a.cc: In function 'int main()':
a.cc:9:1: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:2: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:3: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:4: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:5: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:6: error: expected primary-expression before '?' token
9 | ?????? else if(lef<0.6)leye[1]++;
| ^
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:9:7: error: expected ':' before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~~
| :
a.cc:9:8: error: expected primary-expression before 'else'
9 | ?????? else if(lef<0.6)leye[1]++;
| ^~~~
a.cc:10:2: error: 'else' without a previous 'if'
10 | else if(lef<1.1)leye[2]++;
| ^~~~
|
s042060779 | p00149 | C++ | #include<iostream>
using namespace std;
void main() {
int right_a = 0, right_b = 0, right_c = 0, right_d = 0;
int left_a = 0, left_b = 0, left_c = 0, left_d = 0;
double right_eye, left_eye;
while (cin >> left_eye >> right_eye) {
if (left_eye >= 1.1)left_a++;
else if (left_eye >= 0.6&&left_eye < 1.1)left_b++;
else if (left_eye >= 0.2&&left_eye < 0.6)left_c++;
else if (left_eye < 0.2)left_d++;
if (right_eye >= 1.1)right_a++;
else if (right_eye >= 0.6&&right_eye < 1.1)right_b++;
else if (right_eye >= 0.2&&right_eye < 0.6)right_c++;
else if (right_eye < 0.2)right_d++;
}
cout << left_a << ' ' << right_a << endl;
cout << left_b << ' ' << right_b << endl;
cout << left_c << ' ' << right_c << endl;
cout << left_d << ' ' << right_d << endl;
} | a.cc:4:1: error: '::main' must return 'int'
4 | void main() {
| ^~~~
|
s894247127 | p00149 | C++ | #include<iostream>
using namespace std;
int main(){
double left, right;
while( cin >> left >> right ) {
int A[2] = {};
int B[2] = {};
int C[2] = {};
int D[2] = {};
if( left >= 1.1) A[0] ++;
if( 0.6 <= left && left < 1.1) B[0] ++;
if( 0.2 <= left && left < 0.6) C[0] ++;
if( left < 0.2) D[0] ++;
if( right >= 1.1) A[1] ++;
if( 0.6 <= right && right < 1.1) B[1] ++;
if( 0.2 <= right && right < 0.6) C[1] ++;
if( right < 0.2) D[1] ++;
}
cout << A[0] << " " << A[1] << "\n";
cout << B[0] << " " << B[1] << "\n";
cout << C[0] << " " << C[1] << "\n";
cout << D[0] << " " << D[1] << "\n";
return 0;
}
| a.cc: In function 'int main()':
a.cc:28:17: error: 'A' was not declared in this scope
28 | cout << A[0] << " " << A[1] << "\n";
| ^
a.cc:29:17: error: 'B' was not declared in this scope
29 | cout << B[0] << " " << B[1] << "\n";
| ^
a.cc:30:17: error: 'C' was not declared in this scope
30 | cout << C[0] << " " << C[1] << "\n";
| ^
a.cc:31:17: error: 'D' was not declared in this scope
31 | cout << D[0] << " " << D[1] << "\n";
| ^
|
s586548212 | p00149 | C++ | #include<bits/c++.h>
using namespace std;
int main(){
double l;
double r;
int l_a=0;
int l_b=0;
int l_c=0;
int l_d=0;
int r_a=0;
int r_b=0;
int r_c=0;
int r_d=0;
while(cin>>l>>r){
if(l>=1.1)
l_a++;
else if(l>=0.6 && l<1.1)
l_b++;
else if(l>=0.2 && l<0.6)
l_c++;
else if(l<0.2)
l_d++;
if(r>=1.1)
r_a++;
else if(r>=0.6 && r<1.1)
r_b++;
else if(r>=0.2 && r<0.6)
r_c++;
else if(r<0.2)
r_d++;
}
cout<<l_a<<" "<<r_a<<endl;
cout<<l_b<<" "<<r_b<<endl;
cout<<l_c<<" "<<r_c<<endl;
cout<<l_d<<" "<<r_d<<endl;
}
| a.cc:1:9: fatal error: bits/c++.h: No such file or directory
1 | #include<bits/c++.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s436759376 | p00149 | C++ | main(i){int l[4][2]={0};float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(i){int l[4][2]={0};float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);}
| ^
|
s432522297 | p00149 | C++ | main(){int l[4][2]={0},i;float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){int l[4][2]={0},i;float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:42: error: 'scanf' was not declared in this scope
1 | main(){int l[4][2]={0},i;float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);}
| ^~~~~
a.cc:1:146: error: 'printf' was not declared in this scope
1 | main(){int l[4][2]={0},i;float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | main(){int l[4][2]={0},i;float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);}
|
s540322662 | p00149 | C++ | main(){int l[4][2]={0},i;float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){int l[4][2]={0},i;float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:42: error: 'scanf' was not declared in this scope
1 | main(){int l[4][2]={0},i;float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);}
| ^~~~~
a.cc:1:146: error: 'printf' was not declared in this scope
1 | main(){int l[4][2]={0},i;float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | main(){int l[4][2]={0},i;float a;for(i=0;scanf("%f",&a)+1;i++)a<0.2?l[3][i%2]++:(a<0.6?l[2][i%2]++:(a<1.1?l[1][i%2]++:l[0][i%2]++));for(i=0;i<4;)printf("%d %d\n",l[i++][0],l[i][1]);}
|
s606887583 | p00149 | C++ | #include<stdio.h>
int main(void)
{
double h,m;
int cMA,cHA;
int cMB,cHB;
int cMC,cHC;
int cMD,cHD;
cMA=0;
cHA=0;
cMB=0;
cHB=0;
cMC=0;
cHC=0;
cMD=0;
cHD=0;
while(scanf("%lf %lf",&h,&m)!=EOF){
if(h>=1.1){
cHA++;
}
else if(0.6<=h){
cHB++;
}
else if(0.2<=h){
cHC++;
}
else{
cHD++;
}
if(m>=1.1){
cMA++;
}
else if(0.6<=m m<1.1){
cMB++;
}
else if(0.2<=m && m<0.6){
cMC++;
}
else if(0.2>m){
cMD++;
}
}
printf("%d %d\n%d %d\n%d %d\n%d %d\n",cHA,cMA,cHB,cMB,cHC,cMC,cHD,cMD);
return 0;
} | a.cc: In function 'int main()':
a.cc:33:39: error: expected ')' before 'm'
33 | else if(0.6<=m m<1.1){
| ~ ^~
| )
|
s295703506 | p00149 | C++ | cout << la << " " << ra << endl; | a.cc:1:5: error: 'cout' does not name a type
1 | cout << la << " " << ra << endl;
| ^~~~
|
s503351505 | p00149 | C++ | include <iostream>
#include <stdio.h>
using namespace std;
int an[4][2],n,i,j;
int main() {
double ey[2];
while(cin >> ey[0] >> ey[1]) {
for (i=0;i<2;i++) {
if (ey[i]>=1.1) j=0;
if (ey[i]>=0.6 && ey[i]<1.1) j=1;
if (ey[i]>=0.2 && ey[i]<0.6) j=2;
if (ey[i]<0.2) j=3;
an[j][i]++;
}
}
for (i=0;i<4;i++) cout << an[i][0] << ' ' << an[i][1] << endl;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
8 | while(cin >> ey[0] >> ey[1]) {
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <stdio.h>
+++ |+#include <iostream>
3 |
a.cc:17:21: error: 'cout' was not declared in this scope
17 | for (i=0;i<4;i++) cout << an[i][0] << ' ' << an[i][1] << endl;
| ^~~~
a.cc:17:21: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:60: error: 'endl' was not declared in this scope
17 | for (i=0;i<4;i++) cout << an[i][0] << ' ' << an[i][1] << endl;
| ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
2 | #include <stdio.h>
+++ |+#include <ostream>
3 |
|
s698830024 | p00150 | Java | import java.util.Scanner;
public class Q4 {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.nextInt();
boolean judge = true;
int count = 0;
int so[] = new int[a];
int Max = 0; int Max2 = 0;
for(int num = 2; num < a; num++){
for(int i = 2; i < num; i++){
if(num % i == 0){
judge = false;
break;
}
}
if(judge){
//System.out.print(num + " ");
so[count] = num;
count++;
}
judge = true;
}
for(int i = 1; i< count; i++){
int check = so[i-1] + 2;
if(check == so[i]){
Max = so[i-1];
Max2 = so[i];
}
}
System.out.println(Max + " " + Max2);
}
} | Main.java:3: error: class Q4 is public, should be declared in a file named Q4.java
public class Q4 {
^
1 error
|
s297057237 | p00150 | Java | import java.util.Scanner;
public class TestX {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while (true) {
int a = s.nextInt();
if(a == 0) break;
boolean judge = true;
int count = 0;
int so[] = new int[a];
int Max = 0;
int Max2 = 0;
for (int num = 2; num < a; num++) {
for (int i = 2; i < num; i++) {
if (num % i == 0) {
judge = false;
break;
}
}
if (judge) {
//System.out.print(num + " ");
so[count] = num;
count++;
}
judge = true;
}
for (int i = 1; i < count; i++) {
int check = so[i - 1] + 2;
if (check == so[i]) {
Max = so[i - 1];
Max2 = so[i];
}
}
System.out.println(Max + " " + Max2);
}
}
} | Main.java:3: error: class TestX is public, should be declared in a file named TestX.java
public class TestX {
^
1 error
|
s678040914 | p00150 | Java | import java.util.Scanner;
public class sample {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = 0,i,j,b=0;
int[] data= new int [10001];
/*for(i=2;i<=10000;i++){
data[i]=0;
}*/
for(i=2;i<=10000;i++){
if(data[i]==0){
for(j=2;i*j<=10000;j++){
data[i*j]=1;
}
}
}
while(b!=1){
a += sc.nextInt();
if(a==0)break;
for(i=a;i>=2;i--){
if(data[i]==0&&data[i-2]==0){
System.out.println( +data[i-2]);System.out.println(+data[i]);
break;
}
}
}
}
}
| Main.java:3: error: class sample is public, should be declared in a file named sample.java
public class sample {
^
1 error
|
s193241487 | p00150 | Java | import java.util.Scanner;
public class sample {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = 0,i,j,b=0,k=0;
System.out.println("\u0047"+"\u004F");
int[] data= new int [10001];
char ku=' ';
for(i=2;i<=10000;i++){
if(data[i]==0){
for(j=2;i*j<=10000;j++){
data[i*j]=1;
}
}
}
while(b!=1){
a=0;
a += sc.nextInt();
if(a==0){
break;
}
for(i=a;i>=3;i--){
if(data[i]==0&&data[i-2]==0){
System.out.println(+i-2+" "+i+"\n");
break;
}
}
}
}
} | Main.java:3: error: class sample is public, should be declared in a file named sample.java
public class sample {
^
1 error
|
s093734568 | p00150 | Java | import java.util.Scanner;
public class Twin Prime {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = 0,i,j,b=0,k=0;
System.out.println("\u0047"+"\u004F");
int[] data= new int [10001];
char ku=' ';
for(i=2;i<=10000;i++){
if(data[i]==0){
for(j=2;i*j<=10000;j++){
data[i*j]=1;
}
}
}
while(b!=1){
a=0;
a += sc.nextInt();
if(a==0){
break;
}
for(i=a;i>=3;i--){
if(data[i]==0&&data[i-2]==0){
System.out.println(+i-2+" "+i+"\n");
break;
}
}
}
}
} | Main.java:3: error: '{' expected
public class Twin Prime {
^
1 error
|
s956472751 | p00150 | Java | import java.util.Scanner;
Public class sample {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = 0,i,j,b=0,k=0;
int[] data= new int [10001];
char ku=' ';
for(i=2;i<=10000;i++){
if(data[i]==0){
for(j=2;i*j<=10000;j++){
data[i*j]=1;
}
}
}
while(b!=1){
a=0;
a += sc.nextInt();
if(a==0){
break;
}
for(i=a;i>=3;i--){
if(data[i]==0&&data[i-2]==0){
System.out.println(+i-2+" "+i+"\n");
break;
}
}
}
}
} | Main.java:3: error: class, interface, enum, or record expected
Public class sample {
^
1 error
|
s917572144 | p00150 | Java | import java.util.Scanner;
Public class twin prime {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = 0,i,j,b=0,k=0;
int[] data= new int [10001];
char ku=' ';
for(i=2;i<=10000;i++){
if(data[i]==0){
for(j=2;i*j<=10000;j++){
data[i*j]=1;
}
}
}
while(b!=1){
a=0;
a += sc.nextInt();
if(a==0){
break;
}
for(i=a;i>=3;i--){
if(data[i]==0&&data[i-2]==0){
System.out.println(+i-2+" "+i+"\n");
break;
}
}
}
}
} | Main.java:3: error: class, interface, enum, or record expected
Public class twin prime {
^
Main.java:3: error: '{' expected
Public class twin prime {
^
2 errors
|
s651987622 | p00150 | Java | import java.util.Scanner;
Public class twin {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = 0,i,j,b=0,k=0;
int[] data= new int [10001];
char ku=' ';
for(i=2;i<=10000;i++){
if(data[i]==0){
for(j=2;i*j<=10000;j++){
data[i*j]=1;
}
}
}
while(b!=1){
a=0;
a += sc.nextInt();
if(a==0){
break;
}
for(i=a;i>=3;i--){
if(data[i]==0&&data[i-2]==0){
System.out.println(+i-2+" "+i+"\n");
break;
}
}
}
}
} | Main.java:3: error: class, interface, enum, or record expected
Public class twin {
^
1 error
|
s969427114 | p00150 | Java | import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = 0,i,j,b=0,k=0;
int[] data= new int [10001];
char ku=' ';
for(i=2;i<=10000;i++){
if(data[i]==0){
for(j=2;i*j<=10000;j++){
data[i*j]=1;
}
}
}
while(b!=1){
a=0;
a += sc.nextInt();
if(a==0){
break;
}
for(i=a;i>=3;i--){
if(data[i]==0&&data[i-2]==0){
System.out.println(+i-2+" "+i+"\n");
break;
}
}
}
}
} | Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s877865732 | p00150 | C | #include <stdio.h>
#include <math.h>
int isprime(int x){
int i, k=1;
for(i=3; i<=1sqrt(x); i++){
if(x%i==0) {
k=0;
break;
}
}
return k;
}
int main(void){
while(1){
int n;
scanf(" %d", &n);
if(n==0) break;
if(n%2 == 0) n--;
while(isprime(n) != 1 || isprime(n-2) != 1){
n-=2;
}
printf("%d %d\n", n-2, n);
}
return 0;
} | main.c: In function 'isprime':
main.c:7:21: error: invalid suffix "sqrt" on integer constant
7 | for(i=3; i<=1sqrt(x); i++){
| ^~~~~
|
s720327227 | p00150 | C | #include <stdio.h>
const int max = 10000; //素数表最大数
int prime[max + 1]; //素数表配列
int idx, idx2, tmp;
void list(); //素数表作成
void judge(int n); //双子素数判定
int main(){
int n;
list();
while (scanf("%d", &n)){
if (n == 0) break;
judge(n);
printf("%d %d\n", idx2, idx);
}
return 0;
}
void list(){
int i, k;
for (i = 2; i <= max; i++){
prime[i] = 1;
}
for (i = 2; i * i <= max; i++){
if (prime[i]){
for (k = 2 * i; k <= max; k += i){
prime[k] = 0;
}
}
}
}
void judge(int n){
int i;
for (i = n; 0 < n; i--){
tmp = i - 2;
if(prime[i]){
if(prime[tmp]){
idx = i;
idx2 = tmp;
break;
}
}
}
} | main.c:4:5: error: variably modified 'prime' at file scope
4 | int prime[max + 1]; //素数表配列
| ^~~~~
|
s153626740 | p00150 | C | #include <stdio.h>
const int max = 10000; //素数表最大数
int prime[max + 1]; //素数表配列
int idx, idx2, tmp;
void list(void); //素数表作成
void judge(int n); //双子素数判定
int main(){
int n;
list();
while (scanf("%d", &n)){
if (n == 0) break;
judge(n);
printf("%d %d\n", idx2, idx);
}
return 0;
}
void list(void){
int i, k;
for (i = 2; i <= max; i++){
prime[i] = 1;
}
for (i = 2; i * i <= max; i++){
if (prime[i]){
for (k = 2 * i; k <= max; k += i){
prime[k] = 0;
}
}
}
}
void judge(int n){
int i;
for (i = n; 0 < n; i--){
tmp = i - 2;
if(prime[i]){
if(prime[tmp]){
idx = i;
idx2 = tmp;
break;
}
}
}
} | main.c:4:5: error: variably modified 'prime' at file scope
4 | int prime[max + 1]; //素数表配列
| ^~~~~
|
s253693235 | p00150 | C | #include <stdio.h>
#include <math.h>
#include <string>
int isprime(int n) {
int i;
if(n<=1){
return 0;
}
for(i = 2; i*i<=n; i++) {
if(n % i == 0){
return 0;
}
}
return 1;
}
int main(){
int n,i;
while(1){
scanf("%d",&n);
if(n==0){
break;
}
for(i = n;i>=2;i--){
if(isprime(i)&&isprime(i-2)){
printf("%d %d",i-2,i);
break;
}
}
}
return 0;
} | main.c:3:10: fatal error: string: No such file or directory
3 | #include <string>
| ^~~~~~~~
compilation terminated.
|
s754256279 | p00150 | C | #include <stdio.h>
const in MAX_V = 10000;
int prime[MAX_V + 1];
int main() {
int i, k, n;
for(i = 2; i <= MAX_V; i++) {
prime[i] = 1;
}
for(i = 2; i * i <= MAX_V; i++) {
if(prime[i]) {
for( k = 2 * i; k <= MAX_V; k += i) {
prime[k] = 0;
}
}
}
while(scanf("%d", &n) = 0) {
for( i = n; i > 1; i--) {
if(isprime(i) == 1 && isprime(i - 2) == 1) break;
}
p1 = i - 2;
q1 = i;
printf("%d %d\n", p1, q1);
}
return 0;
} | main.c:3:7: error: unknown type name 'in'; did you mean 'int'?
3 | const in MAX_V = 10000;
| ^~
| int
main.c:4:5: error: variably modified 'prime' at file scope
4 | int prime[MAX_V + 1];
| ^~~~~
main.c: In function 'main':
main.c:18:31: error: lvalue required as left operand of assignment
18 | while(scanf("%d", &n) = 0) {
| ^
main.c:20:28: error: implicit declaration of function 'isprime' [-Wimplicit-function-declaration]
20 | if(isprime(i) == 1 && isprime(i - 2) == 1) break;
| ^~~~~~~
main.c:22:17: error: 'p1' undeclared (first use in this function)
22 | p1 = i - 2;
| ^~
main.c:22:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:17: error: 'q1' undeclared (first use in this function)
23 | q1 = i;
| ^~
|
s671116591 | p00150 | C | #include <stdio.h>
int isprime(int n) {
int i;
for(i = 2; i * i <= n; i++) {
if(n % i == 0) return 0;
}
return 1;
}
int main(){
int i = 0, k, cnt, max[100];
while(1){
scanf("%d", &n);
if(n == 0) break;
for(i = 7;i < n;i++){
if(isprime(k) == 1 && isprime(k - 2) == 1) max = k;
}
printf("%d %d\n", max - 2, max);
}
return 0;
} | main.c: In function 'main':
main.c:13:18: error: 'n' undeclared (first use in this function)
13 | scanf("%d", &n);
| ^
main.c:13:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:54: error: assignment to expression with array type
16 | if(isprime(k) == 1 && isprime(k - 2) == 1) max = k;
| ^
|
s089897600 | p00150 | C | #include <stdio.h>
int isprime(int n) {
int i;
for(i = 2; i * i <= n; i++) {
if(n % i == 0) return 0;
}
return 1;
}
int main(){
int i, n, max;
while(1){
scanf("%d", &n);
if(n == 0) break;
for(i = n;i > 0;i--){
if(isprime(i) == 1 && isprime(i - 2) == 1){
max = i;
break;
}
printf("%d %d\n", max - 2, max);
}
return 0;
} | main.c: In function 'main':
main.c:23:1: error: expected declaration or statement at end of input
23 | }
| ^
|
s360043547 | p00150 | C | #include<stdio.h>
#include<math.h>
int Prime(int x){
int n;
if(x == 2)return 1;
if(x < 2 || x % 2 == 0)return 0;
for(n = 3; n <= sqrt((double)x); n += 2){
if(x % n == 0)return 0;
}
return 1;
}
int isprime(int n){
for(int i = 2; i * i <= n; i++){
if(n % i == 0) return 0;
}
return 1;
}
int main(){
int n, i, cnt = 0, max = 0, data[100000];
while(1){
cnt=0;
max=0;
scanf("%d", &n);
if(n==0) break;
for(i = 0; i <= n; i++){
if(isprime(i) == 1){
data[cnt] = i;
cnt++;
}
}
for(i = 1; i <= cnt; i++){
if(data[i] - data[i - 1] == 2)max = i;
}
if(max != 0)printf("%d %d\n", data[max - 1], data[max]);
}
return 0;
} | /usr/bin/ld: /tmp/cceRsCak.o: in function `Prime':
main.c:(.text+0x72): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
|
s378071471 | p00150 | C | #include<stdio.h>
const int MAX_V = 10000;
int prime[MAX_V+1];
int main(void){
int i,k,n,p1,q1;
for(i = 2; i <= MAX_V; i ++){
prime[i] = 1;
}
for(i = 2; i * i <= MAX_V; i ++ ){
if(prime[i]){
for(k = 2 * i; k <= MAX_V; k += i){
prime[k] = 0;
}
}
}
while(1){
scanf("%d",&n);
if(n == 0)break;
for(i = n; i >= 2; i --){
if(prime[i] == 1 && prime[i-2] == 1){
q1 = i;
p1 = i - 2;
printf("%d %d\n",p1,q1);
break;
}
}
}
return 0;
} | main.c:3:5: error: variably modified 'prime' at file scope
3 | int prime[MAX_V+1];
| ^~~~~
|
s177004373 | p00150 | C | #include<stdio.h>
const int MAX_V = 10000; // 1??????????????°??´???°??¨?????????
int prime[MAX_V+1]; // 1???????´???°,0???????´???°????????°???????
int main(){
int i, k, n =10, cnt = 0;
int border[10];
for( i = 2; i <= MAX_V; i++) {
prime[i] = 1; // 2??\?????°??´???°??¨??????
}
for(i = 2; i*i <= MAX_V; i++){
if(prime[i]) {
for(k = 2 * i; k <= MAX_V; k += i){
prime[k] = 0; // ?´???°??°?2?????\?????°??????°??°??´???°????????°???????
//printf("prime[%d]=%d\n", k, prime[k]); // ???????????°??¨
}
}
}
//printf("cnt = %d\n", cnt); // ???????????°??¨
int difference[MAX_V+1];
int idx = 2;
for( i = 2; i < MAX_V; i++){ // ?????????????´???°??¨??????????±??????¨?????????
if(prime[i] == 1){
difference[i] = i - idx;
idx = i;
//printf("difference[%d]=%d\n", i, difference[i]); // ???????????°??¨
}
}
for( i = 0; i < n; i++){ // ?????¶?????\?????????
scanf("%d", &border[i]);
if(border[i] == 0) break;
cnt++;
//printf("border[%d]=%d\n", i, border[i]); // ???????????°??¨
}
int max[10] = {0};
for( i = 0; i < cnt; i++){ // ?????¶??\?????????????´???°????????§???????????????????´???????
for( k = 2; k <= border[i]; k++){
if( difference[k] == 2 && k > max[i]){
max[i] = k;
//printf("max[%d] = %d\n", i, max[i]); // ???????????°??¨
}
}
}
for( i = 0; i < cnt; i++){ // ???????????????
printf("%d %d\n", max[i] - 2, max[i]);
}
return 0;
} | main.c:3:5: error: variably modified 'prime' at file scope
3 | int prime[MAX_V+1]; // 1???????´???°,0???????´???°????????°???????
| ^~~~~
|
s990950716 | p00150 | C | #include<stdio.h>
const int MAX_V = 10000;
int prime[MAX_V+1];
int main(){
int i, k, n =10, cnt = 0;
int border[10];
for( i = 2; i <= MAX_V; i++) {
prime[i] = 1;
}
for(i = 2; i*i <= MAX_V; i++){
if(prime[i]) {
for(k = 2 * i; k <= MAX_V; k += i){
prime[k] = 0;
//printf("prime[%d]=%d\n", k, prime[k]);
}
}
}
//printf("cnt = %d\n", cnt);
int difference[MAX_V+1];
int idx = 2;
for( i = 2; i < MAX_V; i++){
if(prime[i] == 1){
difference[i] = i - idx;
idx = i;
//printf("difference[%d]=%d\n", i, difference[i]);
}
}
for( i = 0; i < n; i++){
scanf("%d", &border[i]);
if(border[i] == 0) break;
cnt++;
//printf("border[%d]=%d\n", i, border[i]);
}
int max[10] = {0};
for( i = 0; i < cnt; i++){
for( k = 2; k <= border[i]; k++){
if( difference[k] == 2 && k > max[i]){
max[i] = k;
//printf("max[%d] = %d\n", i, max[i]);
}
}
}
for( i = 0; i < cnt; i++){
printf("%d %d\n", max[i] - 2, max[i]);
}
return 0;
} | main.c:3:5: error: variably modified 'prime' at file scope
3 | int prime[MAX_V+1];
| ^~~~~
|
s373188540 | p00150 | C | #include<stdio.h>
const int MAX_V = 10000;
int prime[MAX_V+1];
int main(){
int i, k, n =10, cnt = 0;
int border[10];
for( i = 2; i <= MAX_V; i++) {
prime[i] = 1;
}
for(i = 2; i*i <= MAX_V; i++){
if(prime[i]) {
for(k = 2 * i; k <= MAX_V; k += i){
prime[k] = 0;
}
}
}
int difference[MAX_V+1];
int idx = 2;
for( i = 2; i < MAX_V; i++){
if(prime[i] == 1){
difference[i] = i - idx;
idx = i;
}
}
for( i = 0; i < n; i++){
scanf("%d", &border[i]);
if(border[i] == 0) break;
cnt++;
}
int max[10] = {0};
for( i = 0; i < cnt; i++){
for( k = 2; k <= border[i]; k++){
if( difference[k] == 2 && k > max[i]){
max[i] = k;
}
}
}
for( i = 0; i < cnt; i++){
printf("%d %d\n", max[i] - 2, max[i]);
}
return 0;
} | main.c:3:5: error: variably modified 'prime' at file scope
3 | int prime[MAX_V+1];
| ^~~~~
|
s189238273 | p00150 | C | #include<stdio.h>
const int MAX_V = 10000;
int prime[MAX_V];
int main(){
int i, k, n =10, cnt = 0;
int border[10];
for( i = 2; i <= MAX_V; i++) {
prime[i] = 1;
}
for(i = 2; i*i <= MAX_V; i++){
if(prime[i]) {
for(k = 2 * i; k <= MAX_V; k += i){
prime[k] = 0;
}
}
}
int difference[MAX_V+1];
int idx = 2;
for( i = 2; i < MAX_V; i++){
if(prime[i] == 1){
difference[i] = i - idx;
idx = i;
}
}
for( i = 0; i < n; i++){
scanf("%d", &border[i]);
if(border[i] == 0) break;
cnt++;
}
int max[10] = {0};
for( i = 0; i < cnt; i++){
for( k = 2; k <= border[i]; k++){
if( difference[k] == 2 && k > max[i]){
max[i] = k;
}
}
printf("%d %d\n", max[i] - 2, max[i]);
}
return 0;
} | main.c:3:5: error: variably modified 'prime' at file scope
3 | int prime[MAX_V];
| ^~~~~
|
s374092441 | p00150 | C | #include<stdio.h>
const int MAX_V = 10000;
int prime[MAX_V];
int main(){
int i, k, n =10, cnt = 0;
int border[10];
for( i = 2; i <= MAX_V; i++) {
prime[i] = 1;
}
for(i = 2; i*i <= MAX_V; i++){
if(prime[i]) {
for(k = 2 * i; k <= MAX_V; k += i){
prime[k] = 0;
}
}
}
int difference[MAX_V+1];
int idx = 2;
for( i = 2; i < MAX_V; i++){
if(prime[i] == 1){
difference[i] = i - idx;
idx = i;
}
}
for( i = 0; i < n; i++){
scanf("%d", &border[i]);
if(border[i] == 0) break;
cnt++;
}
int max[10] = {0};
for( i = 0; i < cnt; i++){
for( k = 2; k <= border[i]; k++){
if( difference[k] == 2 && k > max[i]){
max[i] = k;
}
}
printf("%d %d\n", max[i] - 2, max[i]);
}
return 0;
} | main.c:3:5: error: variably modified 'prime' at file scope
3 | int prime[MAX_V];
| ^~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.