submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s858382877
p00100
Java
# include <iostream> # include <cstring> int n; int a[3]; int x[4001]; int main() { while (1) { std::cin >> n; if (n == 0) break; int count = 0; std::memset(x, 0, sizeof(x)); for (int i = 0; i < n; ++i) { for (int j = 0; j < 3; ++j) std::cin >> a[j]; x[a[0]] += a[1] * a[2]; } for (int i = 1; i <= 4000; ++i) { if (x[i] >= 1000000) { std::cout << i << std::endl; ++count; } } if (count==0) std::cout << "NA" << std::endl; } return 0; }
Main.java:1: error: illegal character: '#' # include <iostream> ^ Main.java:2: error: illegal character: '#' # include <cstring> ^ Main.java:5: error: class, interface, enum, or record expected int a[3]; ^ Main.java:6: error: class, interface, enum, or record expected int x[4001]; ^ Main.java:10: error: not a statement std::cin >> n; ^ Main.java:14: error: not a statement std::memset(x, 0, sizeof(x)); ^ Main.java:14: error: not a statement std::memset(x, 0, sizeof(x)); ^ Main.java:17: error: not a statement std::cin >> a[j]; ^ Main.java:22: error: not a statement std::cout << i << std::endl; ^ Main.java:27: error: not a statement std::cout << "NA" << std::endl; ^ Main.java:8: error: unnamed classes are a preview feature and are disabled by default. int main() { ^ (use --enable-preview to enable unnamed classes) Main.java:14: error: ';' expected std::memset(x, 0, sizeof(x)); ^ Main.java:14: error: ';' expected std::memset(x, 0, sizeof(x)); ^ Main.java:14: error: ';' expected std::memset(x, 0, sizeof(x)); ^ 14 errors
s456925328
p00100
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; class Main { private long sales; boolean isAchieved; Salesman(long price, long goodsnum){ addSales(price,goodsnum); } void addSales(long price, long number) { this.sales += price * number; this.isAchieved = isAchieved(); } private boolean isAchieved() { return sales >= 1000000; } } public class AOJ100 { public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); StringTokenizer st; try { while (true) { String line; long price,goodsnum; int num; int n = Integer.parseInt(br.readLine()); if(n ==0){ break; } HashMap<Integer, Salesman> list = new HashMap<>(); for (int i = 0; i < n; i++) { line = br.readLine(); st = new StringTokenizer(line); num = Integer.parseInt(st.nextToken()); price = Long.parseLong(st.nextToken()); goodsnum= Long.parseLong(st.nextToken()); if(list.containsKey(num)){ list.get(num).addSales(price,goodsnum); }else{ list.put(num,new Salesman(price,goodsnum)); } } List<Map.Entry<Integer,Salesman>> entries = new ArrayList<>(list.entrySet()); Collections.sort(entries, new Comparator<Map.Entry<Integer, Salesman>>() { @Override public int compare(Map.Entry<Integer, Salesman> o1, Map.Entry<Integer, Salesman> o2) { return o1.getKey().compareTo(o2.getKey()); } }); boolean isExist = false; for (Map.Entry<Integer, Salesman> entry : entries) { if(entry.getValue().isAchieved){ System.out.println(entry.getKey()); isExist = true; } } if (!isExist){ System.out.println("NA"); } } } catch (Exception e) { e.printStackTrace(); } } }
Main.java:9: error: invalid method declaration; return type required Salesman(long price, long goodsnum){ ^ 1 error
s079943054
p00100
Java
import java.util.Hashtable; import java.util.Scanner; public class BestEmployee { public static void main(String[] args) { int total = 0, id =0, p=0, q = 0, i=1; long mul = 1; Scanner sc = new Scanner(System.in); while(true) { total = sc.nextInt(); if(total==0 ) { return; } Hashtable<Integer, Long> sales = new Hashtable<Integer, Long>(); for(i=1; i<=total; i++) { id = sc.nextInt(); p = sc.nextInt(); q = sc.nextInt(); mul = p*q; if(sales.containsKey(id) ) { if(sales.get(id).longValue() < 1000000) { sales.put(id, mul + sales.get(id).longValue()); } } else { sales.put(id, mul ); } } boolean hasMax = false; for (int key : sales.keySet()) { mul = sales.get(key); if(mul >= 1000000 ) { hasMax = true; System.out.println(key); } } if(hasMax == false) { System.out.println("NA"); } } } }
Main.java:6: error: class BestEmployee is public, should be declared in a file named BestEmployee.java public class BestEmployee { ^ 1 error
s338725974
p00100
Java
import java.util.Scanner; import java.util.HashMap; import java.util.Comparator; import java.util.Arrays; class Record { int id; int uriage; int jyun; Record(int id, int uriage, int jyun) { this.id = id; this.uriage = uriage; this.jyun = jyun; } int getId() { return this.id; } int getUriage() { return this.uriage; } int getJyun() { return this.jyun; } int addUriage(int uri) { this.uriage += uri; return this.uriage; } } class CmpJyun implements Comparator<Record> { public int compare(Record record1, Record record2) { return record1.getJyun() - record2.getJyun(); } } public class Main { public static void main(String[] args) { final int lim=1000000; Cmp rc = new Cmp(); Scanner scan = new Scanner(System.in); while (true) { HashMap<Integer,Record> h = new HashMap<Integer,Record>(); int n = scan.nextInt(); if (n==0) break; for (int jyun=0; jyun<n; jyun++){ int id = scan.nextInt(); int tanka = scan.nextInt(); int ryou = scan.nextInt(); if (h.containsKey(id)){ h.get(id).addUriage(tanka*ryou); } else { h.put(id,new Record(id, tanka*ryou, jyun)); } } Record[] rec = new Record[h.size()]; int j=0; for (Integer id : h.keySet()) { rec[j] = h.get(id); j += 1; } boolean none=true; Arrays.sort(rec, rc); for (int i=0; i<h.size(); i++){ if (rec[i].getUriage() >= lim){ System.out.println(rec[i].getId()); none=false; } } if (none) System.out.println("NA"); } } }
Main.java:48: error: cannot find symbol Cmp rc = new Cmp(); ^ symbol: class Cmp location: class Main Main.java:48: error: cannot find symbol Cmp rc = new Cmp(); ^ symbol: class Cmp location: class Main 2 errors
s073909815
p00100
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; ?? class Salesman { ????????private long sales; ????????boolean isAchieved; ?? ????????Salesman(long price, long goodsnum){ ????????????????this.sales += price * goodsnum; ????????????????this.isAchieved = this.sales >= 1000000; ????????} ????????void addSales(long price, long number) { ????????????????this.sales += price * number; ????????????????this.isAchieved = this.sales >= 1000000; ????????} } ?? public class Main{ ????????public static void main(String[] args) { ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ????????????????StringBuilder sb = new StringBuilder(); ????????????????StringTokenizer st; ????????????????try { ????????????????????????while (true) { ????????????????????????????????String line; ????????????????????????????????long price,goodsnum; ????????????????????????????????int num; ????????????????????????????????int n = Integer.parseInt(br.readLine()); ????????????????????????????????if(n ==0){ ????????????????????????????????????????break; ????????????????????????????????} ????????????????????????????????LinkedHashMap<Integer, Salesman> list = new LinkedHashMap<>(); ?? ????????????????????????????????for (int i = 0; i < n; i++) { ????????????????????????????????????????line = br.readLine(); ????????????????????????????????????????st = new StringTokenizer(line); ????????????????????????????????????????num = Integer.parseInt(st.nextToken()); ????????????????????????????????????????price = Long.parseLong(st.nextToken()); ????????????????????????????????????????goodsnum= Long.parseLong(st.nextToken()); ????????????????????????????????????????if(list.containsKey(num)){ ????????????????????????????????????????????????list.get(num).addSales(price,goodsnum); ????????????????????????????????????????}else{ ????????????????????????????????????????????????list.put(num,new Salesman(price,goodsnum)); ????????????????????????????????????????} ????????????????????????????????} ?? ????????????????????????????????boolean isExist = false; ????????????????????????????????for (Map.Entry<Integer, Salesman> entry : list.entrySet()) { ????????????????????????????????????????if(entry.getValue().isAchieved){ ????????????????????????????????????????????????System.out.println(entry.getKey()); ????????????????????????????????????????????????isExist = true; ????????????????????????????????????????} ????????????????????????????????} ????????????????????????????????if (!isExist){ ????????????????????????????????????????System.out.println("NA"); ????????????????????????????????} ????????????????????????} ?? ?? ????????????????} catch (Exception e) { ????????????????????????e.printStackTrace(); ????????????????} ?? ????????} }
Main.java:4: error: class, interface, enum, or record expected ?? ^ Main.java:6: error: illegal start of type ????????private long sales; ^ Main.java:7: error: illegal start of type ????????boolean isAchieved; ^ Main.java:8: error: illegal start of type ?? ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: : expected ????????????????this.sales += price * goodsnum; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: : expected ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:13: error: illegal start of type ????????void addSales(long price, long number) { ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: : expected ????????????????this.sales += price * number; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: : expected ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:18: error: class, interface, enum, or record expected ?? ^ Main.java:20: error: illegal start of type ????????public static void main(String[] args) { ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReade
s629363181
p00100
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; ?? class Salesman { ????????private long sales; ????????boolean isAchieved; ?? ????????Salesman(long price, long goodsnum){ ????????????????this.sales += price * goodsnum; ????????????????this.isAchieved = this.sales >= 1000000; ????????} ????????void addSales(long price, long number) { ????????????????this.sales += price * number; ????????????????this.isAchieved = this.sales >= 1000000; ????????} } ?? public class Main{ ????????public static void main(String[] args) { ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ????????????????StringBuilder sb = new StringBuilder(); ????????????????StringTokenizer st; ????????????????try { ????????????????????????while (true) { ????????????????????????????????String line; ????????????????????????????????long price,goodsnum; ????????????????????????????????int num; ????????????????????????????????int n = Integer.parseInt(br.readLine()); ????????????????????????????????if(n ==0){ ????????????????????????????????????????break; ????????????????????????????????} ????????????????????????????????LinkedHashMap<Integer, Salesman> list = new LinkedHashMap<>(); ?? ????????????????????????????????for (int i = 0; i < n; i++) { ????????????????????????????????????????line = br.readLine(); ????????????????????????????????????????st = new StringTokenizer(line); ????????????????????????????????????????num = Integer.parseInt(st.nextToken()); ????????????????????????????????????????price = Long.parseLong(st.nextToken()); ????????????????????????????????????????goodsnum= Long.parseLong(st.nextToken()); ????????????????????????????????????????if(list.containsKey(num)){ ????????????????????????????????????????????????list.get(num).addSales(price,goodsnum); ????????????????????????????????????????}else{ ????????????????????????????????????????????????list.put(num,new Salesman(price,goodsnum)); ????????????????????????????????????????} ????????????????????????????????} ?? ????????????????????????????????boolean isExist = false; ????????????????????????????????for (Map.Entry<Integer, Salesman> entry : list.entrySet()) { ????????????????????????????????????????if(entry.getValue().isAchieved){ ????????????????????????????????????????????????System.out.println(entry.getKey()); ????????????????????????????????????????????????isExist = true; ????????????????????????????????????????} ????????????????????????????????} ????????????????????????????????if (!isExist){ ????????????????????????????????????????System.out.println("NA"); ????????????????????????????????} ????????????????????????} ?? ?? ????????????????} catch (Exception e) { ????????????????????????e.printStackTrace(); ????????????????} ?? ????????} }
Main.java:4: error: class, interface, enum, or record expected ?? ^ Main.java:6: error: illegal start of type ????????private long sales; ^ Main.java:7: error: illegal start of type ????????boolean isAchieved; ^ Main.java:8: error: illegal start of type ?? ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: illegal start of expression ????????????????this.sales += price * goodsnum; ^ Main.java:10: error: : expected ????????????????this.sales += price * goodsnum; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:11: error: : expected ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:12: error: illegal start of expression ????????} ^ Main.java:13: error: illegal start of type ????????void addSales(long price, long number) { ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: illegal start of expression ????????????????this.sales += price * number; ^ Main.java:14: error: : expected ????????????????this.sales += price * number; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: illegal start of expression ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:15: error: : expected ????????????????this.isAchieved = this.sales >= 1000000; ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:16: error: illegal start of expression ????????} ^ Main.java:18: error: class, interface, enum, or record expected ?? ^ Main.java:20: error: illegal start of type ????????public static void main(String[] args) { ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ Main.java:21: error: illegal start of expression ????????????????BufferedReade
s549739349
p00100
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n; int b; int t; int s; int gaku=0; int flag=0; int ban=0; int count=0; for(;flag!=9;){ n=sc.nextInt(); int AA[]=new int[n]; for(int i=0;i<n;i++){ b=sc.nextInt(); t=sc.nextInt(); s=sc.nextInt(); if(ban==b){ gaku = gaku+(t*s); }else{ gaku = t*s; } if(gaku>=1000000){ System.out.println(b); count++; } if(count==0){ System.out.println("NA"); } ban=b; } gaku=0; count=0; ban=0; if(n==0){ flag=9; } }
Main.java:45: error: reached end of file while parsing } ^ 1 error
s054704911
p00100
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n; int b; int t; int s; int gaku=0; int flag=0; int ban=0; int count=0; for(;flag!=9;){ n=sc.nextInt(); for(int i=0;i<n;i++){ b=sc.nextInt(); t=sc.nextInt(); s=sc.nextInt(); if(ban==b){ gaku = gaku+(t*s); }else{ gaku = t*s; } if(gaku>=1000000){ System.out.println(b); count++; } ban=b; } gaku=0; count=0; ban=0; if(n==0){ flag=9; }else { System.out.prinln("NA"); } } } }
Main.java:42: error: cannot find symbol System.out.prinln("NA"); ^ symbol: method prinln(String) location: variable out of type PrintStream 1 error
s314814717
p00100
Java
import java.util.Scanner; class ?????????{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n; int b; int t; int s; int gaku=0; int flag=0; int ban=0; int count=0; for(;flag!=9;){ n=sc.nextInt(); for(int i=0;i<n;i++){ b=sc.nextInt(); t=sc.nextInt(); s=sc.nextInt(); if(ban==b){ gaku = gaku+(t*s); }else{ gaku = t*s; } if(gaku>=1000000){ System.out.println(b); count++; } ban=b; } gaku=0; count=0; ban=0; if(n==0){ flag=9; }else { System.out.println("NA"); } } } }
Main.java:2: error: <identifier> expected class ?????????{ ^ 1 error
s351962168
p00100
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n; int b; int t; int s; int gaku=0; int flag=0; int ban=0; int count=0; for(;flag!=9;){ n=sc.nextInt(); for(int i=0;i<n;i++){ b=sc.nextInt(); t=sc.nextInt(); s=sc.nextInt(); if(ban==b){ gaku = gaku+(t*s); }else{ gaku = t*s; } if(gaku>=1000000){ System.out.println(b); count++; } if(n!=0&&count==0){ System.out.println("NA"); } ban=b; } gaku=0; count=0; ban=0; if(n==0){ flag=9; } }
Main.java:46: error: reached end of file while parsing } ^ 1 error
s691023143
p00100
Java
import java.util.*; public class SaleResult { public static void main(String[] args) { Scanner in = new Scanner(System.in); final int THRESHOLD = 1000000; final int MAX_EMPLOYEE = 3999; Map<Integer, Integer> data = new HashMap<Integer, Integer>(3999); int n; int id, numOfSale, price; int count; while((n=in.nextInt()) != 0) { for(int i=0; i<n; i++) { id = in.nextInt(); price = in.nextInt(); numOfSale = in.nextInt(); if(data.containsKey(id)) { data.put(id, data.get(id)+(price*numOfSale)); } else { data.put(id, price*numOfSale); } } count = 0; for(int x: data.keySet()) { if(data.get(x)>=THRESHOLD) { System.out.println(x); count++; } } if(count==0) System.out.println("NA"); data.clear(); } } }
Main.java:3: error: class SaleResult is public, should be declared in a file named SaleResult.java public class SaleResult { ^ 1 error
s562437415
p00100
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); for(; ;) { int n = scanner.nextInt(); if(n == 0) { break; } class Data { int e; long sum; boolean is_view; } Data[] data = new Data[n]; for(int i=0; i<n; i++) { data[i] = new Data(); data[i].e = scanner.nextInt(); long p = scanner.nextLong(); long q = scanner.nextLong(); data[i].sum = p * q; data[i].is_view = true; } for(int i=0; i<n; i++) { if(data[i].is_view) { for(int j=i+1; j<n; j++) { if(data[i].e == data[j].e) { data[i].sum += data[j].sum; data[j].is_view = false; } } } } int count = 0; for(int i=0; i<n; i++) { if(data[i].is_view && data[i].sum>=1000000) { System.out.println(data[i].e); count ++; } } if(count == 0) { System.out.println("NA"); } } }
Main.java:65: error: reached end of file while parsing } ^ 1 error
s602709430
p00100
Java
import java.util.HashMap; import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main(); } public Main() { sc = new Scanner(System.in); int lines = Integer.parseInt(sc.nextLine()); while (lines != 0) { HashMap<String, Integer> nico = new HashMap<String, Integer>(); for (int i = 0; i < lines; i++) { String line = sc.nextLine(); String[] data = line.split(" "); int sales = Integer.parseInt(data[1]) * Integer.parseInt(data[2]); if (nico.containsKey(data[0]) == true) { nico.put(data[0], nico.get(data[0]) + sales); } else { nico.put(data[0], sales); } boolean na = true; for (String key : nico.keySet()) { if (nico.get(key) >= 1000000) { System.out.println(key); na = false; } } if (na == true) System.out.println("NA"); lines = Integer.parseInt(sc.nextLine()); } } }
Main.java:42: error: reached end of file while parsing } ^ 1 error
s111464552
p00100
Java
import Control.Monad import Control.Applicative import Data.List main :: IO () main = do n <- readLn :: IO Int if n == 0 then return () else do ns <- getData n let ans = solve ns if null ans then putStrLn "NA" else mapM_ print ans main getData :: Int -> IO [((Int, Int), Int)] getData n = go 0 where go :: Int -> IO [((Int, Int), Int)] go m | m == n = return [] | otherwise = do [i, x, y] <- map read . words <$> getLine :: IO [Int] (:) ((m, i), x * y) <$> go (m+1) solve :: [((Int, Int), Int)] -> [Int] solve ns = map fst $ sortBy (\(x,_) (x2,_) -> compare x x2) $ filter ((>= 1000000) . snd) $ map (\ls -> (snd (fst (head ls)), sum (map snd ls))) $ groupBy (\((_, y1), _) ((_, y2), _) -> y1 == y2) $ sortBy (\((_, y1), _) ((_, y2), _) -> compare y1 y2) ns
Main.java:1: error: ';' expected import Control.Monad ^ Main.java:2: error: ';' expected import Control.Applicative ^ Main.java:3: error: ';' expected import Data.List ^ Main.java:29: error: illegal character: '\' $ sortBy (\(x,_) (x2,_) -> compare x x2) ^ Main.java:31: error: illegal character: '\' $ map (\ls -> (snd (fst (head ls)), sum (map snd ls))) ^ Main.java:32: error: illegal character: '\' $ groupBy (\((_, y1), _) ((_, y2), _) -> y1 == y2) ^ Main.java:33: error: illegal character: '\' $ sortBy (\((_, y1), _) ((_, y2), _) -> ^ 7 errors
s214058643
p00100
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; public class Sale_Result { public static void main(String[] args) throws Exception { // TODO ????????????????????????????????????????????? boolean[] arg = null; int length=0; int i=0; boolean first=false; ArrayList arr=new ArrayList(); Map<Integer,Integer> map=new HashMap<Integer,Integer>(); try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { String line; while ((line = br.readLine()) != null ) { if(line.equals("0")){ break; } String[] tokens = line.split(" "); if(tokens.length==1){ i=0; first=false; map=new HashMap(); length=Integer.parseInt(tokens[0]); }else{ int a= Integer.parseInt(tokens[0]); int b = Integer.parseInt(tokens[1]); int c = Integer.parseInt(tokens[2]); if(map.get(a)==null){ map.put(a, b*c); }else{ map.put(a, map.get(a)+b*c); } i++; } if(i==length){ for(Map.Entry<Integer, Integer> entry : map.entrySet()) { if(entry.getValue()>=1000000){ arr.add(entry.getKey()); first=true; } } if(!first){ arr.add("NA"); } } } } for(int k=0;k<arr.size();k++){ System.out.println(arr.get(k)); } } }
Main.java:7: error: class Sale_Result is public, should be declared in a file named Sale_Result.java public class Sale_Result { ^ Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
s181301695
p00100
Java
import java.math.BigDecimal; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Scanner; public class ID0100 { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n;//????????????????????° int e;//???????????? BigDecimal p;//????£??????? BigDecimal q;//?£??????°??? //?????????????????????????????§??????????¶??¶??????????????????¢????????§??????????????\ while(sc.hasNext()){ Map<Integer,BigDecimal> saleResultMap=new HashMap<Integer,BigDecimal>(); n=sc.nextInt(); if(n==0)break; for(int i=0;i<n;i++){ e=sc.nextInt(); p=new BigDecimal(sc.nextInt()); q=new BigDecimal(sc.nextInt()); if(saleResultMap.get(e)==null){ saleResultMap.put(e, p.multiply(q)); }else{ saleResultMap.put(e, saleResultMap.get(e).add(p.multiply(q))); } } boolean existMillionSeller=false; Iterator<Integer> it=saleResultMap.keySet().iterator(); while(it.hasNext()){ e=it.next(); BigDecimal result=saleResultMap.get(e); if(result.compareTo(new BigDecimal(1000000))!=-1){ existMillionSeller=true; System.out.println(e); } } if(!existMillionSeller) System.out.println("NA"); } } }
Main.java:7: error: class ID0100 is public, should be declared in a file named ID0100.java public class ID0100 { ^ 1 error
s673724890
p00100
Java
import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) throws java.io.IOException{ Scanner scan = new Scanner(System.in); long [] syatiku = new String[4000]; boolean flag =true; while(flag){ int n= scan.nextInt(); if(n==0){flag =false;break;} for(int i=0;i<n;i++){ syatiku[scan.nextInt()] = scan.nextLong() * scan.nextLong(); }int max =0; int number=0; for(int i=0;i<n;i++){ if(syatiku[i]>max){max = syatiku[max]; number =i;} } System.out.println(number); } } }
Main.java:8: error: incompatible types: String[] cannot be converted to long[] long [] syatiku = new String[4000]; ^ Main.java:19: error: incompatible types: possible lossy conversion from long to int if(syatiku[i]>max){max = syatiku[max]; number =i;} ^ 2 errors
s433846020
p00100
Java
import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) throws java.io.IOException{ Scanner scan = new Scanner(System.in); long [] syatiku = new long[4000]; boolean flag =true; while(flag){ int n= scan.nextInt(); if(n==0){flag =false;break;} for(int i=0;i<n;i++){ syatiku[scan.nextInt()] = scan.nextLong() * scan.nextLong(); }int max =0; int number=0; for(int i=0;i<n;i++){ if(syatiku[i]>max){max = syatiku[max]; number =i;} } System.out.println(number); } } }
Main.java:19: error: incompatible types: possible lossy conversion from long to int if(syatiku[i]>max){max = syatiku[max]; number =i;} ^ 1 error
s398918881
p00100
Java
import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) throws java.io.IOException{ Scanner scan = new Scanner(System.in); long [] syatiku = new long[4000]; boolean flag =true; while(flag){ int n= scan.nextInt(); if(n==0){flag =false;break;} for(int i=0;i<n;i++){ syatiku[scan.nextInt()] = scan.nextLong() * scan.nextLong(); }long max =0; int number=0; for(int i=0;i<n;i++){ if(syatiku[i]>max){max = syatiku[max]; number =i;} } System.out.println(number); } } }
Main.java:19: error: incompatible types: possible lossy conversion from long to int if(syatiku[i]>max){max = syatiku[max]; number =i;} ^ 1 error
s443458803
p00100
Java
import java.util.*; public class AOJ0100 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int i,n,no,k,t;; int p[]; long workers[]=new long[4001]; Set<Integer> s=new TreeSet<Integer>(); boolean flag; while(true){ flag=false; Arrays.fill(workers, 0); n=sc.nextInt(); if(n==0) break; p=new int[n]; for(i=0;i<n;i++){ no=sc.nextInt(); k=sc.nextInt(); t=sc.nextInt(); if(s.add(no)){ p[i]=no; } workers[no]+=k*t; } for(i=0;i<n;i++){ if(1000000<=workers[p[i]]){ System.out.println(p[i]); flag=true; } } if(!flag){ System.out.println("NA"); } } } }
Main.java:3: error: class AOJ0100 is public, should be declared in a file named AOJ0100.java public class AOJ0100 { ^ 1 error
s739984765
p00100
Java
public class Main { public static void main(String[] args) throws IOException { int overCount = 0; BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in)); int n, count; int[] emp; emp = new int[4000]; clearAry(emp); while ( (count = strRead()) != 0 ) { n = 0; while ( n < count ) { String str = bReader.readLine(); String[] strEd = str.split(" "); int empCnt = Integer.parseInt(strEd[0]); int emp_price = Integer.parseInt(strEd[1]); int emp_q = Integer.parseInt(strEd[2]); emp[empCnt] = emp[empCnt] + emp_price * emp_q; n++; } for ( int i = 0; i < 4000; i++ ) { if ( emp[i] > 1000000 ) { System.out.println(i + 1); overCount++; } } if ( overCount == 0 ) { System.out.println("NA"); } overCount = 0; clearAry(emp); } } public static int strRead() throws IOException { BufferedReader br_dataCount = new BufferedReader(new InputStreamReader(System.in)); return Integer.parseInt(br_dataCount.readLine()); } public static void clearAry(int[] ar) { for ( int i = 0; i < 4000; i++ ) { ar[i] = 0; } } }
Main.java:4: error: cannot find symbol public static void main(String[] args) throws IOException ^ symbol: class IOException location: class Main Main.java:51: error: cannot find symbol public static int strRead() throws IOException ^ symbol: class IOException location: class Main Main.java:7: error: cannot find symbol BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:7: error: cannot find symbol BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:7: error: cannot find symbol BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main Main.java:54: error: cannot find symbol BufferedReader br_dataCount = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:54: error: cannot find symbol BufferedReader br_dataCount = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:54: error: cannot find symbol BufferedReader br_dataCount = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main 8 errors
s478892018
p00100
Java
import java.io.*; public class Main { public static void main(String[] args) { int overCount = 0; BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in)); int n, count; int[] emp; emp = new int[4001]; clearAry(emp); while ( (count = strRead()) != 0 ) { n = 0; while ( n < count ) { String str = bReader.readLine(); String[] strEd = str.split(" "); int empCnt = Integer.parseInt(strEd[0]); int emp_price = Integer.parseInt(strEd[1]); int emp_q = Integer.parseInt(strEd[2]); emp[empCnt] = emp[empCnt] + emp_price * emp_q; n++; } for ( int i = 0; i < 4000; i++ ) { if ( emp[i] >= 1000000 ) { System.out.println(i); overCount++; } } if ( overCount == 0 ) { System.out.println("NA"); } overCount = 0; clearAry(emp); } } public static int strRead() { BufferedReader br_dataCount = new BufferedReader(new InputStreamReader(System.in)); return Integer.parseInt(br_dataCount.readLine()); } public static void clearAry(int[] ar) { for ( int i = 0; i <= 4000; i++ ) { ar[i] = 0; } } }
Main.java:23: error: unreported exception IOException; must be caught or declared to be thrown String str = bReader.readLine(); ^ Main.java:56: error: unreported exception IOException; must be caught or declared to be thrown return Integer.parseInt(br_dataCount.readLine()); ^ 2 errors
s191255054
p00100
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import sun.java2d.Disposer; public class Main { public static void main(String[] args) throws IOException { BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in)); int overCount = 0, count, n, empID, price, quantitiy; long total; Queue<Integer> iQueue = new LinkedList<Integer>(); long[] emp = new long[4000]; while ( (count = Integer.parseInt(bReader.readLine())) != 0 ) { n = 0; while ( n < count ) { String str = bReader.readLine(); String[] editedstr = str.split(" "); empID = Integer.parseInt(editedstr[0]); //社員番号 price = Integer.parseInt(editedstr[1]); //単価 quantitiy = Integer.parseInt(editedstr[2]); //販売個数 total = price * quantitiy; //実績 if ( emp[empID] == 0 ) //初めての入力 { emp[empID] = total; iQueue.offer(empID); } else if ( emp[empID] <= 1000000 ) //2回目以降の入力かつ100万を超えない値の場合 { emp[empID] += total; } else { } n++; } for ( int a : iQueue ) { if(emp[a] >= 1000000) { System.out.println(a); overCount++; } } if ( overCount == 0 ) { System.out.println("NA"); } overCount = 0; iQueue.clear(); emp = null; emp = new long[4000]; } } }
Main.java:7: error: package sun.java2d is not visible import sun.java2d.Disposer; ^ (package sun.java2d is declared in module java.desktop, which does not export it) 1 error
s687163022
p00100
Java
package test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br = null; try{ br = new BufferedReader (new InputStreamReader(System.in)); while(true){ int n = Integer.parseInt(br.readLine()); if(n == 0)break; List list = new ArrayList<int[]>(); for(int i = 0; i < n;i++){ String[] buf = br.readLine().split(" "); int p ,q,id; id = Integer.parseInt(buf[0]); p = Integer.parseInt(buf[1]);q = Integer.parseInt(buf[2]); int[] data = null; boolean bool = false; for(int j = 0; j<list.size();j++){ data = (int[])list.get(j); if(data[0] == id){ data[1] += p*q; list.set(j, data); bool = true; break; } } if(!bool){ data= new int[2]; data[0] = id; data[1] = p*q; list.add(data); } } boolean bool = false; Iterator it = list.iterator(); while(it.hasNext()){ int[] data = (int[])it.next(); if(data[1] >=1000000){ bool = true; System.out.println(data[0]); } } if(!bool){ System.out.println("NA"); } } }finally{ br.close(); } }
Main.java:59: error: reached end of file while parsing } ^ 1 error
s379641293
p00100
C
#include <stdio.h> main(){ int n,i,j,con=0,ans[111111]={0},bangou[4000]={0},tanka[1111111]={0},kazu[100000]={0}; while(1){ scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++){ scanf("%d %d %d",&bangou[i],&tanka[i],&kazu[i]); ans[i]=tanka[i]*kazu[i]; for(j=0;j<i;j++){ if(ans[i]==ans[j]){ ans[j]=ans[i]+ans[j]; ans[i]=0; } } } for(j=0;j<n;j++){ if(ans[j]>=1000000){ printf("%d\n",bangou[j]); con++; } } if(con==0){ printf("NA\n"); } con=0 } return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:26:10: error: expected ';' before '}' token 26 | con=0 | ^ | ; 27 | } | ~
s313870765
p00100
C
#include <cstdio> #include <map> using namespace std; typedef long long ll; int n; int main(){ while(scanf("%d", &n),n){ map<int,ll> m; map<int,ll>::iterator it; for(int i = 0; i < n; i++){ int x; ll p, q; scanf("%d%lld%lld", &x, &p, &q); m[x] += p*q; } bool ok = true; for(it = m.begin(); it != m.end(); it++){ if(it->second >= 1000000){ ok = false; printf("%d\n", it->first); } } if(ok) printf("NA\n"); } return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s571605337
p00100
C
#include <stdio.h> int main(void) { __int64 member[4000]; int n, i, number, unit, num, f; while (scanf("%d", &n), n != 0){ f = 0; for (i = 0; i < 4000; i++){ member[i] = 0; } for (i = 0; i < n; i++){ scanf("%d %d %d", &number, &unit, &num); member[number - 1] += unit * num; } for (i = 0; i < 4000; i++){ if (member[i] >= 1000000){ printf("%d\n", i + 1); f = 1; } } if (f == 0){ printf("NA\n"); } } return (0); }
main.c: In function 'main': main.c:5:9: error: unknown type name '__int64'; did you mean '__int64_t'? 5 | __int64 member[4000]; | ^~~~~~~ | __int64_t
s594095834
p00100
C
#include <stdio.h> int main(void) { __int64 member[4000], unit, num; int n, i, number, f; while (scanf("%d", &n), n != 0){ f = 0; for (i = 0; i < 4000; i++){ member[i] = 0; } for (i = 0; i < n; i++){ scanf("%d %I64d %I64d", &number, &unit, &num); member[number - 1] += (unit * num); } for (i = 0; i < n; i++){ if (member[i] >= 1000000){ printf("%d\n", i + 1); f = 1; } } if (f == 0){ printf("NA\n"); } } return (0); }
main.c: In function 'main': main.c:5:9: error: unknown type name '__int64'; did you mean '__int64_t'? 5 | __int64 member[4000], unit, num; | ^~~~~~~ | __int64_t
s273532098
p00100
C
#include<stdio.h> int main(void){ int n,i,number,price,howmany; long long int score[4001]; scanf("%d",n); while(n!=0){ count for(i=0; i<=4000; i++){ score[i]=0; } for(i=0; i<n; i++){ scanf("%d%d%d",number,price,howmany); score[number]+=price*howmany; } for(i=1; i<=4000; i++){ if(score[i]>=1000000){ printf("%d\n",i+1); score[0]++; } } if(score[0]==0){ printf("NA\n",i+1); } scanf("%d",n); } }
main.c: In function 'main': main.c:7:17: error: 'count' undeclared (first use in this function) 7 | count | ^~~~~ main.c:7:17: note: each undeclared identifier is reported only once for each function it appears in main.c:7:22: error: expected ';' before 'for' 7 | count | ^ | ; 8 | for(i=0; i<=4000; i++){ | ~~~
s467252352
p00100
C
#include<stdio.h> int main(void){ int n,i,number,price,howmany; long long int score[4001]; scanf("%d",n); while(n!=0){ count for(i=0; i<=4000; i++){ score[i]=0; } for(i=0; i<n; i++){ scanf("%d%d%d",number,price,howmany); score[number]+=price*howmany; } for(i=1; i<=4000; i++){ if(score[i]>=1000000){ printf("%lld\n",i+1); score[0]++; } } if(score[0]==0){ printf("NA\n",i+1); } scanf("%d",n); } }
main.c: In function 'main': main.c:7:17: error: 'count' undeclared (first use in this function) 7 | count | ^~~~~ main.c:7:17: note: each undeclared identifier is reported only once for each function it appears in main.c:7:22: error: expected ';' before 'for' 7 | count | ^ | ; 8 | for(i=0; i<=4000; i++){ | ~~~
s062411799
p00100
C
#include <stdio.h> long long int members_number[4001]; void reset(void) { int i; for(i = 0; i < 4001; i++ ) { members_number[i] = 0; } } void scan_result(long int n) { int staff, number, i; long long int price; for(i = 0; i < n; i++ ) { scanf("%d %lld %d",&staff, &price, &number); members_number[staff] += price * number; } } void output(void) { int i, flag = 0; for(i = 1; i < 4001; i++ ) { if(members_number[i] >= 1000000) { printf("%d\n",i); flag = 1; } } if(!count) { puts("NA"); } } int main(void) { long int n; scanf("%ld",&n); while(n) { reset(); scan_result(n); output(); scanf("%ld",&n); } return 0; }
main.c: In function 'output': main.c:29:7: error: 'count' undeclared (first use in this function) 29 | if(!count) { | ^~~~~ main.c:29:7: note: each undeclared identifier is reported only once for each function it appears in
s024311690
p00100
C
#include<stdio.h> int main(void){ int n; int number[4001]; int price[4001]; int kosu[4001]; int harasyo[4001]; long long int sum[4001]; int i,j; int flag; while(scanf("%d",&n)){ harasyo[4001]={0}; sum[4001]={0}; flag=0; if(n==0){ break; } for(i=0;i<n;i++){ scanf("%d %d %d",&number[i],&price[i],&kosu[i]); sum[i]=price[i]*kosu[i]; } for(i=0;i<n;i++){ for(j=1;j<n;j++){ if(number[i]==number[i+j]){ sum[i]+=sum[i+j]; } } } for(i=0;i<n;i++){ if(sum[i]>=1000000){ harasyo[i]=number[i]; flag=1; } } if(flag==0){ printf("NA\n"); } for(i=0;i<=4000;i++){ if(harasyo[i]!=0){ printf("%d\n",harasyo[i]); } } } return 0; }
main.c: In function 'main': main.c:12:31: error: expected expression before '{' token 12 | harasyo[4001]={0}; | ^ main.c:13:27: error: expected expression before '{' token 13 | sum[4001]={0}; | ^
s842605700
p00100
C
#include <stdio.h> #include <stdlib.h> int checkProfit (long long int); typedef struct { int Number; int price; int sold; long long int profit; } employee; int main () { employee data[4096]; int n, i, j, k; while (scanf ("%d", &n) != EOF) { if (n == 0) break; k = 0; for (i = 0;i < n;i++) { scanf ("%d %d %d", &data[i].Number, &data[i].price, &data[i].sold); data[i].profit = data[i].price * data[i].sold } for (i = 0;i < n-1;i++) { for (j = i+1;j < n;j++) { if (data[i].profit != 0 && data[j].profit != 0) { if (data[i].Number == data[j].Number) { data[i].profit += data[j].profit; data[j].profit = 0; data[j].Number = 0; } } } } for (i = 0;i < n;i++) { if (checkProfit(data[i].profit) == 1) { printf ("%d\n", data[i].Number); k = 1; } } if (k == 0) printf ("NA\n"); } return 0; } int checkProfit (long long int a) { if (a >= 1000000) { return 1; } else { return 0; } }
main.c: In function 'main': main.c:20:70: error: expected ';' before '}' token 20 | data[i].profit = data[i].price * data[i].sold | ^ | ; 21 | } | ~
s852923077
p00100
C
#include<stdio.h> int main() { int i,n; int tag=0; int flag=0; int t; __int64 p,q; __int64 id[4001]; int ord[4001]; for(i=0;i<4001;i++) id[i]=0; while(scanf("%d",&n)&&n!=0) { for(i=0;i<n;i++) { scanf("%d%I64d%I64d",&t,&p,&q); id[t]+=p*q; ord[flag++]=t; } for(i=0;i<flag;i++) { if(id[ord[i]]>=1000000) { printf("%I64d\n",ord[i]); id[ord[i]]=0; tag++; } } if(tag==0) printf("NA\n"); tag=0; } return 0; }
main.c: In function 'main': main.c:8:9: error: unknown type name '__int64'; did you mean '__int64_t'? 8 | __int64 p,q; | ^~~~~~~ | __int64_t main.c:9:9: error: unknown type name '__int64'; did you mean '__int64_t'? 9 | __int64 id[4001]; | ^~~~~~~ | __int64_t
s398376565
p00100
C
// a.c.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include <stdio.h> int main(void){ int n; int ban, tan, suu; long long int bango[4001]; int flg,i; while (1){ for (i = 1; i <= 4000; i++){ bango[i] = 0; } scanf_s("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf_s("%d %d %d", &ban, &tan, &suu); bango[ban] += tan*suu; } flg = 0; for (i = 1; i <= 4000; i++){ if (bango[i]>=1000000){ printf("%d\n", i); flg = 1; } } if (!flg){ printf("NA\n"); } } return 0; }
main.c: In function 'main': main.c:14:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 14 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s574575185
p00100
C
#include <stdio.h> int main() { int n, num, val, sell, flag; while (1) { flag = 0; scanf("%d", &n); if (n == 0) { break; } for (int i = 0; i < n; i++) { scanf("%d", &num); scanf("%d", &val); scans("%d", &sell); if (val * sell >= 1000000) { printf("%d\n", num); flag = 1; } } if (flag == 0) { printf("NA\n"); } } return 0; }
main.c: In function 'main': main.c:17:25: error: implicit declaration of function 'scans'; did you mean 'scanf'? [-Wimplicit-function-declaration] 17 | scans("%d", &sell); | ^~~~~ | scanf
s679237762
p00100
C
#include <stdio.h> int main() { int n, num, val, sell, flag; while (1) { flag = 0; scanf("%d", &n); if (n == 0) { break; } for (int i = 0; i < n; i++) { scanf("%d", &num); scanf("%d", &val); scans("%d", &sell); if (val * sell >= 1000000) { printf("%d\n", num); flag = 1; } } if (flag == 0) { printf("NA\n"); } } return 0; }
main.c: In function 'main': main.c:17:25: error: implicit declaration of function 'scans'; did you mean 'scanf'? [-Wimplicit-function-declaration] 17 | scans("%d", &sell); | ^~~~~ | scanf
s184903978
p00100
C
#include <stdio.h> int main() { int i, n, num, val, sell, flag; while (1) { flag = 0; scanf("%d", &n); if (n == 0) { break; } for (i = 0; i < n; i++) { scanf("%d", &num); scanf("%d", &val); scans("%d", &sell); if (val * sell >= 1000000) { printf("%d\n", num); flag = 1; } } if (flag == 0) { printf("NA\n"); } } return 0; }
main.c: In function 'main': main.c:17:25: error: implicit declaration of function 'scans'; did you mean 'scanf'? [-Wimplicit-function-declaration] 17 | scans("%d", &sell); | ^~~~~ | scanf
s798804928
p00100
C
int main() { int n, num, val, sell, flag; while (1) { flag = 0; int total[4000] = {}; scanf("%d", &n); if (n == 0) { break; } for (int i = 0; i < n; i++) { scanf("%d", &num); scanf("%d", &val); scanf("%d", &sell); total[num] += val * sell; } for (int j = 0; j < 4000; j++) { if (total[j] >= 1000000) { printf("%d\n", j); flag = 1; } } if (flag == 0) { printf("NA\n"); } } return 0; }
main.c: In function 'main': main.c:8:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 8 | scanf("%d", &n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main() { main.c:8:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 8 | scanf("%d", &n); | ^~~~~ main.c:8:17: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:23:33: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 23 | printf("%d\n", j); | ^~~~~~ main.c:23:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:23:33: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:23:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:29:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 29 | printf("NA\n"); | ^~~~~~ main.c:29:25: note: include '<stdio.h>' or provide a declaration of 'printf'
s949787023
p00100
C
#include <stdio.h> int output[50000]; int count=0; void input(int); int main(void){ int n,i; while(true){ scanf("%d",&n); if(n>0){ input(n); }else{ break; } } for(i=0;i<count;i++){ if(output[i]!=0){ printf("%d\n",output[i]); }else{ printf("NA\n"); } } return 0; } void input(int n){ int e[4000]; int p[1000000]; int q[100000]; int c[n]; int i; for(i=0;i<n;i++){ scanf("%d",&e[i]); scanf("%d",&p[i]); scanf("%d",&q[i]); c[i] = p[i]*q[i]; } int j; for(i=0;i<n-1;i++){ for(j=1;j<n;j++){ if(e[i]==e[j]){ c[i]=c[i]+c[j]; c[j]=0; } } } int ch = 0; for(i=0;i<n-1;i++){ if(c[i]>=1000000){ output[count]=e[i]; count++; ch = 1; } } if(ch == 0){ output[count]=0; count++; } }
main.c: In function 'main': main.c:9:15: error: 'true' undeclared (first use in this function) 9 | while(true){ | ^~~~ main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include <stdio.h> +++ |+#include <stdbool.h> 2 | main.c:9:15: note: each undeclared identifier is reported only once for each function it appears in 9 | while(true){ | ^~~~
s631873036
p00100
C
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #define N 4001 typedef struct { int num, sum, index; }DATA; void Initialization(DATA[],int *); #include<stdio.h> int main() { DATA d[N]; int flg,n,e,p,q,index=1; while(scanf("%d",&n),n!=0){ Initialization(d, &flg); for (n; n > 0; --n) { scanf("%d%d%d", &e, &p, &q); d[e].num = e; d[e].sum += p*q; if (d[e].index == 0)d[e].index = index++; flg = d[e].sum >= 1000000; } if (!flg) puts("NA"); else { for (n = 1; n < index; n++) { for (int i = 1; i < N; i++) if (d[i].index == n&&d[i].sum >= 1000000) printf("%d\n", d[i].num); } } } return 0; } void Initialization(DATA d[],int *flg){ int i; for (i = 1; i < N; i++) d[i] = { 0,0,0 }; flg = 0; }
main.c: In function 'Initialization': main.c:35:40: error: expected expression before '{' token 35 | for (i = 1; i < N; i++) d[i] = { 0,0,0 }; | ^
s920384898
p00100
C
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #define N 4001 typedef struct { int num, sum, index; }DATA; void Initialization(DATA[],int *); #include<stdio.h> int main() { DATA d[N]; int flg,n,e,p,q,index=1,i; while(scanf("%d",&n),n!=0){ Initialization(d, &flg); for (n; n > 0; --n) { scanf("%d%d%d", &e, &p, &q); d[e].num = e; d[e].sum += p*q; if (d[e].index == 0)d[e].index = index++; flg = d[e].sum >= 1000000; } if (!flg) puts("NA"); else { for (n = 1; n < index; n++) { for (i = 1; i < N; i++) if (d[i].index == n&&d[i].sum >= 1000000) printf("%d\n", d[i].num); } } } return 0; } void Initialization(DATA d[],int *flg){ int i; for (i = 1; i < N; i++) d[i] = { 0,0,0 }; flg = 0; }
main.c: In function 'Initialization': main.c:35:40: error: expected expression before '{' token 35 | for (i = 1; i < N; i++) d[i] = { 0,0,0 }; | ^
s934421065
p00100
C
#include<stdio.h> void search(struct data *s, int t); struct data { int a; int b; int c; }; int main(void) { struct data base[50]; int n, i; scanf("%d", &n); for(i=0;i<n;i++) { scanf("%d %d %d", &base[i].a, &base[i].b, &data[i].c); } search(base,n); return 0; } void search(struct data *s, int t) { int u, i; for(i=0;i>b;i++) { u=(s->b)*(s->c); if(u>=1000000) { printf("%d\n", s->a); } s++; } }
main.c:2:20: warning: 'struct data' declared inside parameter list will not be visible outside of this definition or declaration 2 | void search(struct data *s, int t); | ^~~~ main.c: In function 'main': main.c:16:60: error: 'data' undeclared (first use in this function) 16 | scanf("%d %d %d", &base[i].a, &base[i].b, &data[i].c); | ^~~~ main.c:16:60: note: each undeclared identifier is reported only once for each function it appears in main.c:18:16: error: passing argument 1 of 'search' from incompatible pointer type [-Wincompatible-pointer-types] 18 | search(base,n); | ^~~~ | | | struct data * main.c:2:26: note: expected 'struct data *' but argument is of type 'struct data *' 2 | void search(struct data *s, int t); | ~~~~~~~~~~~~~^ main.c: At top level: main.c:21:6: error: conflicting types for 'search'; have 'void(struct data *, int)' 21 | void search(struct data *s, int t) | ^~~~~~ main.c:2:6: note: previous declaration of 'search' with type 'void(struct data *, int)' 2 | void search(struct data *s, int t); | ^~~~~~ main.c: In function 'search': main.c:24:19: error: 'b' undeclared (first use in this function) 24 | for(i=0;i>b;i++) | ^
s490072097
p00100
C
#include<stdio.h> void search(struct data *s, int t); struct data { int a; int b; int c; }; int main(void) { struct data base[50]; int n, i; scanf("%d", &n); for(i=0;i<n;i++) { scanf("%d %d %d", &base[i].a, &base[i].b, &base[i].c); } search(base,n); return 0; } void search(struct data *s, int t) { int u, i; for(i=0;i>t;i++) { u=(s->b)*(s->c); if(u>=1000000) { printf("%d\n", s->a); } s++; } }
main.c:2:20: warning: 'struct data' declared inside parameter list will not be visible outside of this definition or declaration 2 | void search(struct data *s, int t); | ^~~~ main.c: In function 'main': main.c:18:16: error: passing argument 1 of 'search' from incompatible pointer type [-Wincompatible-pointer-types] 18 | search(base,n); | ^~~~ | | | struct data * main.c:2:26: note: expected 'struct data *' but argument is of type 'struct data *' 2 | void search(struct data *s, int t); | ~~~~~~~~~~~~~^ main.c: At top level: main.c:21:6: error: conflicting types for 'search'; have 'void(struct data *, int)' 21 | void search(struct data *s, int t) | ^~~~~~ main.c:2:6: note: previous declaration of 'search' with type 'void(struct data *, int)' 2 | void search(struct data *s, int t); | ^~~~~~
s220898593
p00100
C
#include<stdio.h> int main(){ int n; while(scanf("%d",&n), n){ int i, k, num[4000], flag=0; long unitPrice[4000], saleQuantity[4000], earning[4000]={0}; for(i=0; i<n; i++){ scanf("%d%ld%ld", &num[i], &unitPrice[i], &saleQuantity[i]); earning[i] = unitPrice[i]*saleQuantity[i]; for(k=0; k<i; k++){ if(num[i] == num[k]){ earning[k] = earning[i] + earning[k]; earning[i] = 0; } } } for(i=0; i<n; i++){ if(earning[i]>=1000000){ printf("%d\n", num[i]); flag+=1; } } if(flag == 0){ printf("NA\n"); } flag2 += 1; } return 0; }
main.c: In function 'main': main.c:28:5: error: 'flag2' undeclared (first use in this function); did you mean 'flag'? 28 | flag2 += 1; | ^~~~~ | flag main.c:28:5: note: each undeclared identifier is reported only once for each function it appears in
s240269743
p00100
C
#include <stdio.h> typedef struct { unsigned int id; unsigned long long total; }info; info s_info[4000]; int main() { unsigned int i; unsigned int data_num; /* ????????? */ for (i = 0; i < 4000; i++) { s_info[i].id = 0;3 s_info[i].total = 0; } while (1) { unsigned int clear = 0; unsigned long long uri; unsigned long long kazu; scanf("%d", &data_num); if (data_num == 0) { break; } for (i = 0; i<data_num; i++) { scanf("%d %lld %lld", &s_info[i].id, &uri, &kazu); /* id?????????scanf?????§ */ /* ?£????????????? */ s_info[i].total = uri * kazu; } for (i = 0; i < data_num; i++) { if (s_info[i].total >= 1000000) { printf("%d\n", s_info[i].id); clear++; } } if (clear == 0) { printf("NA\n"); } } return 0; }
main.c: In function 'main': main.c:19:35: error: expected ';' before 's_info' 19 | s_info[i].id = 0;3 | ^ | ; 20 | s_info[i].total = 0; | ~~~~~~
s944437303
p00100
C
#include <bits/stdc++.h> using namespace std; long long int p,q,x[100002]; map<long long int,long long int>sells,vis; vector<long long int>v; int main() { long long int a,b,c,d,i,j,y,z; while(scanf("%lld",&a)!=EOF) { v.clear(); sells.clear(); vis.clear(); if(a==0)break; for(i=1;i<=a;i++) { scanf("%lld %lld %lld",&z,&p,&q); sells[z]+=p*q; if(sells[z]>=1000000 && vis[z]!=1) { vis[z]=1; v.push_back(z); } } if(v.size()==0) { printf("NA\n"); continue; } for(i=0;i<v.size();i++) { printf("%lld\n",v[i]); } } return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s966986580
p00100
C
#include "stdafx.h" int main() { int no[4000], pri[4000], num[4000], i=0,j,n; scanf("%d", &n); while (n) { scanf("%d %d %d", &no[i], &pri[i], &num[i]); i++; n--; } for (j = 0; j < i; i++) if (pri[j] * num[j] >= 100000) printf("%d\n", no[j]); return 0; }
main.c:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s533111012
p00100
C
#include <stdio.h> #include <cassert> #define MAX 4001 int ans[MAX][2]; long long sum[MAX]; int tasu(int); main(){ long long p, q; int id; int i, j, n, f, temp; while(1){ scanf("%d", &n); if(n==0) break; f=0; j=0; ans[0][0]=-1; for(i=0;i<n;i++){ sum[i]=0; } for(i=0;i<n;i++){ scanf("%d %d %d", &id, &p, &q); assert(id < 1000000); temp=tasu(id); sum[temp]+=p*q; } for(i=0;;i++){ if(ans[i][0]==-1) break; if(sum[i]>=1000000){ ans[i][1]=1; f=1; } else ans[i][0]=0; } if(f==0){ printf("NA\n"); continue; } for(i=0;;i++){ if(ans[i][0]==-1) break; if(ans[i][1]==1){ printf("%d\n", ans[i][0]); } } } return 0; } int tasu(int a){ int i, f=0, temp; for(i=0;;i++){ if(ans[i][0]==-1){ temp=i; break; } if(ans[i][0]==a){ f=1; return i; } } ans[temp][0]=a; ans[temp+1][0]=-1; return temp; }
main.c:2:10: fatal error: cassert: No such file or directory 2 | #include <cassert> | ^~~~~~~~~ compilation terminated.
s832362762
p00100
C
#include<stdio.h> int main(void){ int n; int i,j; int id[4000]; long long int value[4000],num[4000],sale[4000]; int c; while(1){ scanf("%d",&n); if(!n)break; for(i=0;i<n;i++){ scanf("%d %lld %lld",&id[i],&value[i],&num[i]); sale[i] = value[i] * num[i]; for(j=0;j<i;j++)if(id[j] == id[i])break; if(j!=i){ sale[j] += sale[i]; i--; n--; } } c = 0; for(i=0;i<n;i++){ if(1000000.0 - sale[i] < 1e-10){ printf("%d\n",id[i]); c++; } } if(!c)printf("NA\n"); } return 0;
main.c: In function 'main': main.c:35:2: error: expected declaration or statement at end of input 35 | return 0; | ^~~~~~
s538950175
p00100
C
#include <stdio.h> int main(void){ int n , no , i , flag; __int64 table[4001] , a , b; while(1){ scanf("%d" , &n); if(n==0) break; for(i=1;i<=4000;i++) table[i] = 0; for(i=1;i<=n;i++){ scanf("%d %lld %lld" , &no , &a , &b); table[no] += a * b; } flag = 0; for(i=1;i<=4000;i++){ if(table[i]>=1000000){ printf("%d\n" , i); flag = 1; } } if(flag == 0) printf("NA\n"); } return 0; }
main.c: In function 'main': main.c:5:9: error: unknown type name '__int64'; did you mean '__int64_t'? 5 | __int64 table[4001] , a , b; | ^~~~~~~ | __int64_t
s505624270
p00100
C
#include <stdio.h> int main(){ int setsize; int i; int num, tanka, suuryo; long uriage[4001][2]; int order[4001]; int count; bool na_flag; for(i=1; i<4001; i++){ uriage[i][0]=0; uriage[i][1]=0; } while(1){ scanf("%d", &setsize); if(setsize==0) break; count=0; na_flag=true; for(i=0; i<setsize; i++){ scanf("%d %d %d", &num, &tanka, &suuryo); if(uriage[num][0]==0){ order[count]=num; count++; } uriage[num][0]+=(long)tanka*(long)suuryo; if(uriage[num][0]>=1000000) uriage[num][1]=1; } for(i=0; i<count; i++){ num=order[i]; if(uriage[num][1]==1){ printf("%d\n", num); na_flag=false; } uriage[num][0]=0; uriage[num][1]=0; } if(na_flag) printf("NA\n"); } return 0; }
main.c: In function 'main': main.c:10:3: error: unknown type name 'bool' 10 | bool na_flag; | ^~~~ main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include <stdio.h> +++ |+#include <stdbool.h> 2 | main.c:18:22: error: 'true' undeclared (first use in this function) 18 | count=0; na_flag=true; | ^~~~ main.c:18:22: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c:18:22: note: each undeclared identifier is reported only once for each function it appears in main.c:31:17: error: 'false' undeclared (first use in this function) 31 | na_flag=false; | ^~~~~ main.c:31:17: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
s318424095
p00100
C
#include <stdio.h> int main(){ int setsize; int i; int num long tanka, suuryo; long uriage[4001][2]; int order[4001]; int count; int na_flag; for(i=1; i<4001; i++){ uriage[i][0]=0; uriage[i][1]=0; } while(1){ scanf("%d", &setsize); if(setsize==0) break; count=0; na_flag=1; for(i=0; i<setsize; i++){ scanf("%d %ld %ld", &num, &tanka, &suuryo); if(uriage[num][0]==0){ order[count]=num; count++; } uriage[num][0]+=tanka*suuryo; if(uriage[num][0]>=1000000) uriage[num][1]=1; } for(i=0; i<count; i++){ num=order[i]; if(uriage[num][1]==1){ printf("%d\n", num); na_flag=0; } uriage[num][0]=0; uriage[num][1]=0; } if(na_flag) printf("NA\n"); } return 0; }
main.c: In function 'main': main.c:6:10: error: expected ';' before 'long' 6 | int num | ^ | ; 7 | long tanka, suuryo; | ~~~~ main.c:21:28: error: 'num' undeclared (first use in this function) 21 | scanf("%d %ld %ld", &num, &tanka, &suuryo); | ^~~ main.c:21:28: note: each undeclared identifier is reported only once for each function it appears in
s110888762
p00100
C
include<stdio.h> int main(){ int n,id,tan,kazu,i,count=0,sum; while(1){ count=0; scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++){ scanf("%d%d%d",&id,&tan,&kazu); sum=tan*kazu; if(sum>=1000000){ printf("%d\n",id); count++; } }/*for*/ if(count==0){ printf("NA\n"); } }/*while*/ return 0; }/*main*/
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s833389170
p00100
C
#include<stdio.h> struct staff_data{ int num; long unsigned int price,volume,total; }; int main(void){ int n,i,j,hantei; int num,price,volume; struct staff_data dt[4000]={0}; while(scanf("%d",&n)!=0){ if(n==0){ break; } staff_data dt[4000]={0}; for(i=0;i<n;i++){ scanf("%d %d %d",&num,&price,&volume); for(j=i;j<=i;j++){ if(dt[j].num==num || dt[j].num==0){ dt[j].num=num; dt[j].total=(price)*(volume)+dt[j].total; break; } } } hantei=0; for(j=0;j<n;j++){ if(dt[j].total>=1000000){ printf("%4d\n",dt[j].num); hantei=1; } } if(hantei==0){ printf("NA\n"); } } return 0; }
main.c: In function 'main': main.c:20:17: error: unknown type name 'staff_data'; use 'struct' keyword to refer to the type 20 | staff_data dt[4000]={0}; | ^~~~~~~~~~ | struct main.c:28:41: error: request for member 'num' in something not a structure or union 28 | if(dt[j].num==num || dt[j].num==0){ | ^ main.c:28:59: error: request for member 'num' in something not a structure or union 28 | if(dt[j].num==num || dt[j].num==0){ | ^ main.c:30:46: error: request for member 'num' in something not a structure or union 30 | dt[j].num=num; | ^ main.c:31:46: error: request for member 'total' in something not a structure or union 31 | dt[j].total=(price)*(volume)+dt[j].total; | ^ main.c:31:75: error: request for member 'total' in something not a structure or union 31 | dt[j].total=(price)*(volume)+dt[j].total; | ^ main.c:42:33: error: request for member 'total' in something not a structure or union 42 | if(dt[j].total>=1000000){ | ^ main.c:43:53: error: request for member 'num' in something not a structure or union 43 | printf("%4d\n",dt[j].num); | ^
s904166974
p00100
C
#include <stdio.h> int main(void) { int num; int employ_num; __int64 employ[4001]; __int64 employ_money, employ_sell; int i; int flag; while (1){ scanf("%d", &num); if (num == 0){ break; } flag = 0; for (i = 0; i < num; i++){ scanf("%d%I64d%I64d", &employ_num, &employ_money, &employ_sell); employ[employ_num] += employ_sell * employ_money; if (employ[employ_num] >= 1000000){ printf("%d\n", employ_num); flag = 1; } } if (flag != 1){ printf("NA\n"); } } return (0); }
main.c: In function 'main': main.c:7:9: error: unknown type name '__int64'; did you mean '__int64_t'? 7 | __int64 employ[4001]; | ^~~~~~~ | __int64_t main.c:8:9: error: unknown type name '__int64'; did you mean '__int64_t'? 8 | __int64 employ_money, employ_sell; | ^~~~~~~ | __int64_t
s759765482
p00100
C
#include<stdio.h> int main(void){ long long x,emp[4001],val[4001]; long long emp1,val1,con,flag; int i,j; while(scanf("%lld",&x),x){ for(i=0;i<4001;i++){ emp[i]=0; val[i]=0; } for(i=0;i<x;i++){ scanf("%lld %lld") flag=0; for(j=0;j<x;j++){ if(emp[j]==emp1){ flag=1; val[j]+=val1*con; break; } } if(flag==0){ for(j=0;j<4001;j++){ if(emp[j]==0){ emp[j]=emp1; val[j]=val1*con; break; } } } } flag=0; for(j=0;j<4001;j++){ if(val[j]>=1000000){ printf("%d\n",emp[j]); flag=1; } } if(flag==0)printf("NA\n"); } return 0; }
main.c: In function 'main': main.c:15:25: error: expected ';' before 'flag' 15 | scanf("%lld %lld") | ^ | ; 16 | 17 | flag=0; | ~~~~
s373090896
p00100
C
#include<stdio.h> void main(void) { int a,b,c,d,i; int count; count=0; for(;;) { scanf(“%d”,&a); if(a==0) break; for(i=0;i<a;i++) { scanf(“%d%d%d”,&b,&c,&d); if(b*c<=1000000) { printf(“%d”,b); count++; } if(count==0) printf(“NA”); } } }
main.c: In function 'main': main.c:9:23: error: stray '\342' in program 9 | scanf(<U+201C>%d<U+201D>,&a); | ^~~~~~~~ main.c:9:24: error: expected expression before '%' token 9 | scanf(“%d”,&a); | ^ main.c:9:26: error: stray '\342' in program 9 | scanf(<U+201C>%d<U+201D>,&a); | ^~~~~~~~ main.c:13:31: error: stray '\342' in program 13 | scanf(<U+201C>%d%d%d<U+201D>,&b,&c,&d); | ^~~~~~~~ main.c:13:32: error: expected expression before '%' token 13 | scanf(“%d%d%d”,&b,&c,&d); | ^ main.c:13:38: error: stray '\342' in program 13 | scanf(<U+201C>%d%d%d<U+201D>,&b,&c,&d); | ^~~~~~~~ main.c:16:8: error: stray '\342' in program 16 | printf(<U+201C>%d<U+201D>,b); | ^~~~~~~~ main.c:16:9: error: expected expression before '%' token 16 | printf(“%d”,b); | ^ main.c:16:11: error: stray '\342' in program 16 | printf(<U+201C>%d<U+201D>,b); | ^~~~~~~~ main.c:19:45: error: stray '\342' in program 19 | if(count==0) printf(<U+201C>NA<U+201D>); | ^~~~~~~~ main.c:19:48: error: stray '\342' in program 19 | if(count==0) printf(<U+201C>NA<U+201D>); | ^~~~~~~~ main.c:19:46: error: 'NA' undeclared (first use in this function) 19 | if(count==0) printf(“NA”); | ^~ main.c:19:46: note: each undeclared identifier is reported only once for each function it appears in
s903917825
p00100
C
#include<stdio.h> int main(void) { int a,b,c,d,i; int count; count=0; while(1) { scanf(“%d”,&a); if(a==0) break; for(i=0;i<a;i++) { scanf(“%d %d %d”,&b,&c,&d); if(c*d<=1000000) { printf(“%d”,b); count++; } if(count==0) printf(“NA”); } } return 0; }
main.c: In function 'main': main.c:9:23: error: stray '\342' in program 9 | scanf(<U+201C>%d<U+201D>,&a); | ^~~~~~~~ main.c:9:24: error: expected expression before '%' token 9 | scanf(“%d”,&a); | ^ main.c:9:26: error: stray '\342' in program 9 | scanf(<U+201C>%d<U+201D>,&a); | ^~~~~~~~ main.c:13:31: error: stray '\342' in program 13 | scanf(<U+201C>%d %d %d<U+201D>,&b,&c,&d); | ^~~~~~~~ main.c:13:32: error: expected expression before '%' token 13 | scanf(“%d %d %d”,&b,&c,&d); | ^ main.c:13:40: error: stray '\342' in program 13 | scanf(<U+201C>%d %d %d<U+201D>,&b,&c,&d); | ^~~~~~~~ main.c:16:8: error: stray '\342' in program 16 | printf(<U+201C>%d<U+201D>,b); | ^~~~~~~~ main.c:16:9: error: expected expression before '%' token 16 | printf(“%d”,b); | ^ main.c:16:11: error: stray '\342' in program 16 | printf(<U+201C>%d<U+201D>,b); | ^~~~~~~~ main.c:19:45: error: stray '\342' in program 19 | if(count==0) printf(<U+201C>NA<U+201D>); | ^~~~~~~~ main.c:19:48: error: stray '\342' in program 19 | if(count==0) printf(<U+201C>NA<U+201D>); | ^~~~~~~~ main.c:19:46: error: 'NA' undeclared (first use in this function) 19 | if(count==0) printf(“NA”); | ^~ main.c:19:46: note: each undeclared identifier is reported only once for each function it appears in
s672949963
p00100
C
#include <stdio.h> int n,num[4000]; long long int tanka[4000],sale_num[4000],sale_all[4001]; bool judge[4001]; int main(void) { int i,j,k; while(scanf("%d",&n),n){ for(i=0;i<n;i++){ scanf("%d %lld %lld",&num[i],&tanka[i],&sale_num[i]); } k=0; for(j=0;j<4001;j++){ judge[j]=0; sale_all[i]=0; } for(i=0;i<n;i++){ sale_all[num[i]] += tanka[i]*sale_num[i]; } for(i=0; i < n; i++){ if((sale_all[num[i]] >= 1000000)&&(judge[num[i]]==0)){ printf("%d\n",num[i]); judge[num[i]]=1; k=1; } } if(k!=1)printf("NA\n"); } return 0; }
main.c:5:1: error: unknown type name 'bool' 5 | bool judge[4001]; | ^~~~ main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include <stdio.h> +++ |+#include <stdbool.h> 2 |
s239168952
p00100
C
#include <stdio.h> int n,num[4000]; long long int tanka,sale_num,sale_sum[4000],sale_all[4001]; short judge[4001]; int main(void) { int i,j,k; while(scanf("%d",&n),n){ for(i=0;i<n;i++){ scanf("%d %lld %lld",&num[i],&tanka,&sale_num); sale_sum[i] = tanka*sale_num; } k=0; for(j=0;j<4001;j++){ judge[j]=0; sale_all[j]=0; } for(i=0;i<n;i++){ sale_all[num[i]] += tanka[i]*sale_num[i]; } for(i=0; i < n; i++){ if((sale_all[num[i]] >= 1000000)&&(judge[num[i]]==0)){ printf("%d\n",num[i]); judge[num[i]]=1; k=1; } } if(k!=1)printf("NA\n"); } return 0; }
main.c: In function 'main': main.c:22:34: error: subscripted value is neither array nor pointer nor vector 22 | sale_all[num[i]] += tanka[i]*sale_num[i]; | ^ main.c:22:46: error: subscripted value is neither array nor pointer nor vector 22 | sale_all[num[i]] += tanka[i]*sale_num[i]; | ^
s454738530
p00100
C
int main(void) { int n=0; int i=0; int tanka[4001]={0}; int hito[4001]={0}; int flg=0; int uriage[4001]={0}; int bangou[4001]={0}; int ccc=0; while(true) { flg=0; ccc=0; scanf("%d",&n); if (n==0) { break; } for (i=1;i<=n;i++) { ccc++; scanf("%d %d %d",&bangou[ccc],&tanka[ccc],&uriage[ccc]); } for (i=1;i<=ccc;i++) { if (tanka[i]*uriage[i]>=1000000) { printf("%d\n",bangou[i]); flg=1; } } if (flg==0) { printf("NA\n"); } } return 0; }
main.c: In function 'main': main.c:11:15: error: 'true' undeclared (first use in this function) 11 | while(true) | ^~~~ main.c:1:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' +++ |+#include <stdbool.h> 1 | int main(void) main.c:11:15: note: each undeclared identifier is reported only once for each function it appears in 11 | while(true) | ^~~~ main.c:15:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 15 | scanf("%d",&n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void) main.c:15:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 15 | scanf("%d",&n); | ^~~~~ main.c:15:17: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:29:33: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 29 | printf("%d\n",bangou[i]); | ^~~~~~ main.c:29:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:29:33: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:29:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:35:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 35 | printf("NA\n"); | ^~~~~~ main.c:35:25: note: include '<stdio.h>' or provide a declaration of 'printf'
s217463018
p00100
C
#include <stdio.h> #include <string.h> int main(void){ long long i,j,k,l; long long n; long long flag; long long data[3]; long lomg judge[4000]={0}; long long src[4000]; while(1){ k=0; memset(src,0,sizeof(src)); scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++){ scanf("%d %d %d",&data[0],&data[1],&data[2]); flag=0; for(j=0;j<k+1;j++){ if(data[0]==judge[j]){ src[j]+=data[1]*data[2]; flag=1; } } if(flag==0){ judge[k]=data[0]; src[k]+=data[1]*data[2]; k++; } } flag=0; for(i=0;i<k+1;i++){ if(src[i]>=1000000){ printf("%d\n",judge[i]); flag=1; } } if(flag==0){ printf("NA\n"); } } return(0); }
main.c: In function 'main': main.c:10:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'judge' 10 | long lomg judge[4000]={0}; | ^~~~~ main.c:10:13: error: 'judge' undeclared (first use in this function) main.c:10:13: note: each undeclared identifier is reported only once for each function it appears in main.c:10:25: error: expected expression before '{' token 10 | long lomg judge[4000]={0}; | ^
s679965864
p00100
C
long int shain[4000]; int million[4000]; int n; int i; int c; long int bango,tanka,kosu; scanf("%d",&n); while(n!=0){ for(i=0;i<4000;i++){ shain[i]=0; million[i]=0; } for(i=0;i<n;i++){ scanf("%d %d %d",&bango,&tanka,&kosu); shain[bango-1]+=tanka*kosu; } for(i=0;i<4000;i++){ if(shain[i]>=1000000){ million[c]=i+1; c++; } } if(c==0){ printf("NA\n"); }else{ for(i=0;i<c;i++){ printf("%d\n",million[i]); } } scanf("%d",&n); c=0; } return 0; }
main.c:9:11: error: expected declaration specifiers or '...' before string constant 9 | scanf("%d",&n); | ^~~~ main.c:9:16: error: expected declaration specifiers or '...' before '&' token 9 | scanf("%d",&n); | ^ main.c:11:5: error: expected identifier or '(' before 'while' 11 | while(n!=0){ | ^~~~~ main.c:40:5: error: expected identifier or '(' before 'return' 40 | return 0; | ^~~~~~ main.c:41:1: error: expected identifier or '(' before '}' token 41 | } | ^
s578427547
p00100
C
include<stdio.h> main(){ long long int a[4000],b[4000],c[4000]; int date,to,i,j,cou[4000]={0}; while(1){ scanf("%d",&date); if(date == 0) break; for(i=0;i<date;i++){ scanf("%d %lld %lld",&a[i],&b[i],&c[i]); cou[i] = b[i]*c[i]; for(j=0;j<i;j++){ if(cou[i] == cou[j]){ cou[j] = cou[i] + cou[j]; cou[i] = 0; } } } to = 0; for(i=0;i<date;i++){ if(cou[i]>=1000000){ printf("%d\n",a[i]); to=1; } } if(to == 0){ printf("NA\n"); } } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s507674253
p00100
C
#include <stdio.h> int main(void) { int n, sales, num, sales; int i, j, mem; long long int staf[4005][2]; int flag; while (1){ scanf("%d", &n); if (n == 0) break; mem = 0; for (i = 0; i < n; i++){ scanf("%d %d %d", &num, &cost, &sales); flag = 0; for (j = 0; j < mem; j++){ if (staf[j][0] == num){ staf[j][1] += cost * sales; flag = 1; } } if (flag == 0) { staf[i][0] = num; staf[i][1] = cost * sales; mem++; } } flag = 0; for (i = 0; i < mem; i++){ if (staf[i][1] >= 1000000){ printf("%lld\n", staf[i][0]); flag = 1; } } if (flag == 0) puts("NA"); } return (0); }
main.c: In function 'main': main.c:5:28: error: redeclaration of 'sales' with no linkage 5 | int n, sales, num, sales; | ^~~~~ main.c:5:16: note: previous declaration of 'sales' with type 'int' 5 | int n, sales, num, sales; | ^~~~~ main.c:19:50: error: 'cost' undeclared (first use in this function) 19 | scanf("%d %d %d", &num, &cost, &sales); | ^~~~ main.c:19:50: note: each undeclared identifier is reported only once for each function it appears in
s403630680
p00100
C++
int main(){ int n; while (cin >> n) { bool f = false; int e[4000], p[4000], q[4000], t[4000]; for (int i = 0; i < n; i++) { cin >> e[i]; cin >> p[i]; cin >> q[i]; t[i] = p[i] * q[i]; } for (int a = 0; a < n; a++) { if (t[a] >= 1000000) { cout << e[a] << endl; f = true; } } if (!f) { cout << "NA" << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:3:16: error: 'cin' was not declared in this scope 3 | while (cin >> n) | ^~~ a.cc:18:33: error: 'cout' was not declared in this scope 18 | cout << e[a] << endl; | ^~~~ a.cc:18:49: error: 'endl' was not declared in this scope 18 | cout << e[a] << endl; | ^~~~ a.cc:26:25: error: 'cout' was not declared in this scope 26 | cout << "NA" << endl; | ^~~~ a.cc:26:41: error: 'endl' was not declared in this scope 26 | cout << "NA" << endl; | ^~~~
s745073627
p00100
C++
#include <cstdio> #include <queue> using namespace std; const int sales = 1000000; int main() { int n; while(scanf("%d",&n),n) { bool flag[4000]={flalse}; queue<int> employee_n; for(int i=0;i<n;++i) { int number,a,b; scanf("%d %d %d",&number,&a,&b); if(sales>a*b||flag[number-1]) continue; flag[number-1]=true; employee_n.push(number); } while(!employee_n.empty()){ printf("%d\n",employee_n.front()); employee_n.pop(); } if(employee_n.empty()) puts("NA"); } return 0; }
a.cc: In function 'int main()': a.cc:11:34: error: 'flalse' was not declared in this scope 11 | bool flag[4000]={flalse}; | ^~~~~~
s194824966
p00100
C++
#include <iostream> using namespace std; int main(){ int n;//データ数 while(cin >> n){ int arr[4000];//社員番号 int selling[n];//販売単科 int sales[n];//売り上げ数量 int num; int check=0; //社員は4000人未満 memset(arr,0,sizeof(arr)); if(n==0) break; for(int i=0;i<n;i++){ cin >> num >> selling[i] >> sales[i]; arr[num]+=selling[i]*sales[i]; if(arr[num]>=1000000){ cout << num << endl; check++; } } if(check==0) cout << "NA" << endl; check=0; } }
a.cc: In function 'int main()': a.cc:13:5: error: 'memset' was not declared in this scope 13 | memset(arr,0,sizeof(arr)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s069946860
p00100
C++
int main(){ long all[4001] = {}; long code, a, b, n, i,j; while (1){ j = 0; for (i = 0; i < 4001; i++){ all[i] = 0; } cin >> n; if (n == 0){ break; } for (i = 0; i < n; i++){ cin >> code >> a >> b; all[code] += a*b; } for (i = 0; i < 4001; i++){ if (all[i] >= 1000000){ cout << i << endl; j++; } } if (j == 0){ cout << "NA" << endl; } } }
a.cc: In function 'int main()': a.cc:14:17: error: 'cin' was not declared in this scope 14 | cin >> n; | ^~~ a.cc:27:33: error: 'cout' was not declared in this scope 27 | cout << i << endl; | ^~~~ a.cc:27:46: error: 'endl' was not declared in this scope 27 | cout << i << endl; | ^~~~ a.cc:33:25: error: 'cout' was not declared in this scope 33 | cout << "NA" << endl; | ^~~~ a.cc:33:41: error: 'endl' was not declared in this scope 33 | cout << "NA" << endl; | ^~~~
s585205930
p00100
C++
while (scanf("%d", &data_num)) { if (data_num == 0) break; data_num_update = data_num; for (int i = 0; i < data_num; ++i) { scanf("%d %lld %lld", &employee_num[i], &unit_sale_num[i], &sale_num[i]); } int data_check = 0; while (data_check < data_num - 1) { for (int i = data_check + 1; i < data_num; ++i) { if (employee_num[data_check] == employee_num[i]) { sale_num[data_check] += sale_num[i]; unit_sale_num[data_check] += unit_sale_num[i]; data_num_update--; } } data_check++; } bool result_flag = true; for (int i = 0; i < data_num_update; ++i) { if (unit_sale_num[i] * sale_num[i] >= 1000000) { printf("%d\n", employee_num[i]); result_flag = false; } if (result_flag) { printf("NA\n"); break; } } } return 0; }
a.cc:1:5: error: expected unqualified-id before 'while' 1 | while (scanf("%d", &data_num)) { | ^~~~~ a.cc:38:5: error: expected unqualified-id before 'return' 38 | return 0; | ^~~~~~ a.cc:39:1: error: expected declaration before '}' token 39 | } | ^
s164738265
p00100
C++
using System; using System.Collections.Generic; class _0100 { public static void Main() { bool flag; string[] data; long sum, val; Dictionary<string, long> d = new Dictionary<string, long>(); List<string> sortDKey; int n = int.Parse(Console.ReadLine()); while (n != 0) { d.Clear(); flag = false; for (int i = 0; i < n; i++) { data = Console.ReadLine().Split(); sum = long.Parse(data[1]) * long.Parse(data[2]); if (d.TryGetValue(data[0], out val)) { d.Remove(data[0]); d.Add(data[0], val + sum); } else d.Add(data[0], sum); } sortDKey = new List<string>(d.Keys); sortDKey.Sort(); foreach (string k in sortDKey) { if(d[k] >= 1000000) { flag = (!flag) ? true : flag; Console.WriteLine(k); } } if (!flag) Console.WriteLine("NA"); n = int.Parse(Console.ReadLine()); } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:5:11: error: expected ':' before 'static' 5 | public static void Main() | ^~~~~~~ | : a.cc:42:2: error: expected ';' after class definition 42 | } | ^ | ; a.cc: In static member function 'static void _0100::Main()': a.cc:8:9: error: 'string' was not declared in this scope 8 | string[] data; | ^~~~~~ a.cc:8:16: error: expected primary-expression before ']' token 8 | string[] data; | ^ a.cc:10:9: error: 'Dictionary' was not declared in this scope 10 | Dictionary<string, long> d = new Dictionary<string, long>(); | ^~~~~~~~~~ a.cc:10:28: error: expected primary-expression before 'long' 10 | Dictionary<string, long> d = new Dictionary<string, long>(); | ^~~~ a.cc:11:9: error: 'List' was not declared in this scope 11 | List<string> sortDKey; | ^~~~ a.cc:11:22: error: 'sortDKey' was not declared in this scope 11 | List<string> sortDKey; | ^~~~~~~~ a.cc:12:17: error: expected primary-expression before 'int' 12 | int n = int.Parse(Console.ReadLine()); | ^~~ a.cc:15:13: error: 'd' was not declared in this scope 15 | d.Clear(); | ^ a.cc:19:17: error: 'data' was not declared in this scope 19 | data = Console.ReadLine().Split(); | ^~~~ a.cc:19:24: error: 'Console' was not declared in this scope 19 | data = Console.ReadLine().Split(); | ^~~~~~~ a.cc:20:23: error: expected primary-expression before 'long' 20 | sum = long.Parse(data[1]) * long.Parse(data[2]); | ^~~~ a.cc:21:44: error: 'out' was not declared in this scope 21 | if (d.TryGetValue(data[0], out val)) | ^~~ a.cc:28:28: error: 'List' does not name a type 28 | sortDKey = new List<string>(d.Keys); | ^~~~ a.cc:30:29: error: expected ')' before 'k' 30 | foreach (string k in sortDKey) | ^ a.cc:30:21: note: to match this '(' 30 | foreach (string k in sortDKey) | ^ a.cc:30:13: error: 'foreach' was not declared in this scope 30 | foreach (string k in sortDKey) | ^~~~~~~ a.cc:38:24: error: 'Console' was not declared in this scope 38 | if (!flag) Console.WriteLine("NA"); | ^~~~~~~ a.cc:39:17: error: expected primary-expression before 'int' 39 | n = int.Parse(Console.ReadLine()); | ^~~
s706554799
p00100
C++
#include <iostream> #include <map> #include <vector> #define int long long int using namespace std; void main() { bool f; vector<pair<int, int> > v; int n, a, b, c; while (cin >> n && n > 0) { v.clear(); for (int i = 0; i < n; i++) { cin >> a >> b >> c; f = 0; for (int j = 0; j < v.size(); j++) { if (v[j].first == a) { v[j].second += b * c; f = 1; } } if (!f) { v.push_back(pair<int, int>(a, b * c)); } } f = 0; for (int i = 0; i < v.size(); i++) { if (v[i].second >= 1000000) { cout << v[i].first << endl; f = 1; } } if (!f) { cout << "NA" << endl; } } }
a.cc:6:1: error: '::main' must return 'int' 6 | void main() { | ^~~~
s802053377
p00100
C++
#include <iostream> #include <vector> using namespace std; int n; long long id[4000]; long long value[4000]; long long count[4000]; int main(){ cin >> n; for(int i=0;i<n;i++){ cin >> id[i] >> value[i] >> count[i] >> endl; } vector<long long> v; for(int i=0;i<n;i++){ if(value[i]*count[i] >= 1000000 ){ v.append(id[i]); } } for (vector<long long>::iterator it=v.begin();it!=v.end();++it){ count << *it << endl; } }
a.cc: In function 'int main()': a.cc:14:46: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 14 | cin >> id[i] >> value[i] >> count[i] >> endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 |
s171961951
p00100
C++
#include <iostream> #include <vector> #include <map> using namespace std; int n; long long id[4000]; unsigned long long value[4000]; unsigned long long number[4000]; map<unsigned long long, unsigned long long> total; int main() { while(true){ cin >> n; if(n==0){ return 0; } for (int i = 0; i < n; i++) { cin >> id[i] >> value[i] >> number[i]; if(total.find(id[i])==total.end()){ total.insert(make_pair(id[i], 0)); } total[id[i]] += value[i] * number[i]; } vector<long long> v; if(!total.empty()) { map<unsigned long long, unsigned long long>::iterator it = total.begin(); while (it != total.end()) { if ((*it).second >= 1000000) { v.push_back((*it).first); } ++it; } } if (v.empty()) { cout << "NA" << endl; } for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { cout << *it << endl; } v.clear(); total.clear(); } }
a.cc: In function 'int main()': a.cc:39:59: error: conversion from '__normal_iterator<long long int*,vector<long long int>>' to non-scalar type '__normal_iterator<long long unsigned int*,vector<long long unsigned int>>' requested 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ~~~~~~~^~ a.cc:39:66: error: no match for 'operator!=' (operand types are 'std::vector<long long unsigned int>::iterator' and 'std::vector<long long int>::iterator') 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ~~ ^~ ~~~~~~~ | | | | | __normal_iterator<long long int*,vector<long long int>> | __normal_iterator<long long unsigned int*,vector<long long unsigned int>> In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:39:75: note: 'std::vector<long long unsigned int>::iterator' is not derived from 'const std::fpos<_StateT>' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ^ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:39:75: note: 'std::vector<long long unsigned int>::iterator' is not derived from 'const std::allocator<_CharT>' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ^ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:39:75: note: 'std::vector<long long unsigned int>::iterator' is not derived from 'const std::reverse_iterator<_Iterator>' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ^ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:39:75: note: 'std::vector<long long unsigned int>::iterator' is not derived from 'const std::reverse_iterator<_Iterator>' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:39:75: note: 'std::vector<long long unsigned int>::iterator' is not derived from 'const std::move_iterator<_IteratorL>' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:39:75: note: 'std::vector<long long unsigned int>::iterator' is not derived from 'const std::move_iterator<_IteratorL>' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:39:75: note: 'std::vector<long long unsigned int>::iterator' is not derived from 'const std::pair<_T1, _T2>' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:39:75: note: '__gnu_cxx::__normal_iterator<long long unsigned int*, std::vector<long long unsigned int> >' is not derived from 'std::basic_string_view<_CharT, _Traits>' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ^ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:39:75: note: '__gnu_cxx::__normal_iterator<long long unsigned int*, std::vector<long long unsigned int> >' is not derived from 'std::basic_string_view<_CharT, _Traits>' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ^ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:39:75: note: '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::basic_string_view<_CharT, _Traits>' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ^ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:39:75: note: 'std::vector<long long unsigned int>::iterator' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); ++it) { | ^ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:39:75: note: mismatched types 'const _CharT*' and '__gnu_cxx::__normal_iterator<long long unsigned int*, std::vector<long long unsigned int> >' 39 | for (vector<unsigned long long>::iterator it = v.begin(); it != v.end(); +
s170229935
p00100
C++
#include <iostream> #include <vector> #include <map> using namespace std; int n; long long id[4000]; unsigned long long value[4000]; unsigned long long number[4000]; map<unsigned long long, unsigned long long> total; int main() { while(true){ cin >> n; if(n==0){ return 0; } vector<long long> v; for (int i = 0; i < n; i++) { cin >> id[i] >> value[i] >> number[i]; if(total.find(id[i])==total.end()){ total.insert(make_pair(id[i], 0)); } total[id[i]] += value[i] * number[i]; // if (total[id[i]] > 1000000 && find(v.begin(), v.end(), id[i]) == v.end()) { // v.push_back(id[i]); // } } if(!total.empty()) { map<unsigned long long, unsigned long long>::iterator it = total.begin(); while (it != total.end()) { if ((*it).second >= 1000000) { v.push_back((*it).first); } ++it; } } if (v.empty()) { cout << "NA" << endl; } // for (vector<long long>::iterator it = v.begin(); it != v.end(); ++it) { // cout << *it << endl; // } vector<long long> used; for(int i=0; i<n;i++){ if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ cout << id[i] << endl; used.push_back(id[i]); } } v.clear(); total.clear(); } }
a.cc: In function 'int main()': a.cc:47:14: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int&)' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:47:14: note: '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:47:60: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int&)' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:47:60: note: '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s261021086
p00100
C++
#include <iostream> #include <vector> #include <map> using namespace std; int n; long long id[4000]; unsigned long long value[4000]; unsigned long long number[4000]; map<unsigned long long, unsigned long long> total; int main() { while(true){ cin >> n; if(n==0){ return 0; } vector<long long> v; for (int i = 0; i < n; i++) { cin >> id[i] >> value[i] >> number[i]; if(total.find(id[i])==total.end()){ total.insert(make_pair(id[i], 0)); } total[id[i]] += value[i] * number[i]; // if (total[id[i]] > 1000000 && find(v.begin(), v.end(), id[i]) == v.end()) { // v.push_back(id[i]); // } } if(!total.empty()) { map<unsigned long long, unsigned long long>::iterator it = total.begin(); while (it != total.end()) { if ((*it).second >= 1000000) { v.push_back((*it).first); } ++it; } } if (v.empty()) { cout << "NA" << endl; } // for (vector<long long>::iterator it = v.begin(); it != v.end(); ++it) { // cout << *it << endl; // } vector<long long> used; for(int i=0; i<n;i++){ if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ cout << id[i] << endl; used.push_back(id[i]); } } v.clear(); total.clear(); } }
a.cc: In function 'int main()': a.cc:47:14: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int&)' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:47:14: note: '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:47:60: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int&)' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:47:60: note: '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s958039400
p00100
C++
#include <iostream> #include <vector> #include <map> using namespace std; int n; long long id[4000]; long long value[4000]; long long number[4000]; map<long long, long long> total; int main() { while(true){ cin >> n; if(n==0){ return 0; } vector<long long> v; for (int i = 0; i < n; i++) { cin >> id[i] >> value[i] >> number[i]; if(total.find(id[i])==total.end()){ total.insert(make_pair(id[i], 0)); } total[id[i]] += value[i] * number[i]; // if (total[id[i]] > 1000000 && find(v.begin(), v.end(), id[i]) == v.end()) { // v.push_back(id[i]); // } } if(!total.empty()) { map< long long, long long>::iterator it = total.begin(); while (it != total.end()) { if ((*it).second >= 1000000) { v.push_back((*it).first); } ++it; } } if (v.empty()) { cout << "NA" << endl; } // for (vector<long long>::iterator it = v.begin(); it != v.end(); ++it) { // cout << *it << endl; // } vector<long long> used; for(int i=0; i<n;i++){ if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ cout << id[i] << endl; used.push_back(id[i]); } } v.clear(); total.clear(); } }
a.cc: In function 'int main()': a.cc:47:14: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int&)' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:47:14: note: '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:47:60: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int&)' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:47:60: note: '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 47 | if(find(v.begin(), v.end(), id[i]) != v.end() && find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s004951416
p00100
C++
#include <iostream> #include <vector> #include <map> using namespace std; int n; long long id[4000]; long long value[4000]; long long number[4000]; map<long long, long long> total; int main() { while(true){ cin >> n; if(n==0){ return 0; } vector<long long> v; for (int i = 0; i < n; i++) { cin >> id[i] >> value[i] >> number[i]; if(total.find(id[i])==total.end()){ total.insert(make_pair(id[i], 0)); } total[id[i]] += value[i] * number[i]; // if (total[id[i]] > 1000000 && find(v.begin(), v.end(), id[i]) == v.end()) { // v.push_back(id[i]); // } } if(!total.empty()) { map< long long, long long>::iterator it = total.begin(); while (it != total.end()) { if ((*it).second >= 1000000) { v.push_back((*it).first); } ++it; } } if (v.empty()) { cout << "NA" << endl; } // for (vector<long long>::iterator it = v.begin(); it != v.end(); ++it) { // cout << *it << endl; // } vector<long long> used; for(int i=0; i<n;i++){ if(std::find(v.begin(), v.end(), id[i]) != v.end() && std::find(used.begin(), used.end(), id[i]) == used.end()){ cout << id[i] << endl; used.push_back(id[i]); } } v.clear(); total.clear(); } }
a.cc: In function 'int main()': a.cc:47:19: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int&)' 47 | if(std::find(v.begin(), v.end(), id[i]) != v.end() && std::find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:47:19: note: '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 47 | if(std::find(v.begin(), v.end(), id[i]) != v.end() && std::find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:47:70: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int&)' 47 | if(std::find(v.begin(), v.end(), id[i]) != v.end() && std::find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:47:70: note: '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 47 | if(std::find(v.begin(), v.end(), id[i]) != v.end() && std::find(used.begin(), used.end(), id[i]) == used.end()){ | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s499200881
p00100
C++
#include <iostream> #include <vector> #include <map> using namespace std; int n; long long id[4000]; long long value[4000]; long long number[4000]; map<long long, long long> total; int main() { while(true){ cin >> n; if(n==0){ return 0; } vector<long long> v; for (int i = 0; i < n; i++) { cin >> id[i] >> value[i] >> number[i]; if(total.find(id[i])==total.end()){ total.insert(make_pair(id[i], 0)); } total[id[i]] += value[i] * number[i]; // if (total[id[i]] > 1000000 && find(v.begin(), v.end(), id[i]) == v.end()) { // v.push_back(id[i]); // } } if(!total.empty()) { map< long long, long long>::iterator it = total.begin(); while (it != total.end()) { if ((*it).second >= 1000000) { v.push_back((*it).first); } ++it; } } if (v.empty()) { cout << "NA" << endl; } // for (vector<long long>::iterator it = v.begin(); it != v.end(); ++it) { // cout << *it << endl; // } vector<long long> used; for(int i=0; i<n;i++){ if(std::find(v.begin(), v.end(), &(id[i])) != v.end() && std::find(used.begin(), used.end(), &(id[i])) == used.end()){ cout << id[i] << endl; used.push_back(id[i]); } } v.clear(); total.clear(); } }
a.cc: In function 'int main()': a.cc:47:19: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int*)' 47 | if(std::find(v.begin(), v.end(), &(id[i])) != v.end() && std::find(used.begin(), used.end(), &(id[i])) == used.end()){ | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:47:19: note: '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 47 | if(std::find(v.begin(), v.end(), &(id[i])) != v.end() && std::find(used.begin(), used.end(), &(id[i])) == used.end()){ | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:47:73: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int*)' 47 | if(std::find(v.begin(), v.end(), &(id[i])) != v.end() && std::find(used.begin(), used.end(), &(id[i])) == used.end()){ | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:47:73: note: '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 47 | if(std::find(v.begin(), v.end(), &(id[i])) != v.end() && std::find(used.begin(), used.end(), &(id[i])) == used.end()){ | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s116846836
p00100
C++
#include <iostream> #include <vector> #include <cstdio> #define TOTAL_SALES_TH (1000000) struct SALES_INFO { int employeeID; int totalSales; }; void updataSalesInfos(std::vector<SALES_INFO>& salesInfos, int ID, int unitPrice, int amount) { for (std::vector<SALES_INFO>::iterator it = salesInfos.begin(); it != salesInfos.end(); ++it) { if (it->employeeID == ID) { it->totalSales += unitPrice * amount; return; } } SALES_INFO newInfo; newInfo.employeeID = ID; newInfo.totalSales = unitPrice * amount; salesInfos.push_back(newInfo); } int main(void) { while (true) { int numOfInput; std::cin >> numOfInput; if (numOfInput == 0) { break; } int ID, unitPrice, amount; char deli; std::vector<SALES_INFO> salesInfos; for (int i = 0; i < numOfInput; i++) { scanf_s("%d %d %d", &ID, &unitPrice, &amount); updataSalesInfos(salesInfos, ID, unitPrice, amount); } std::vector<int> achieveList; for (std::vector<SALES_INFO>::iterator it = salesInfos.begin(); it != salesInfos.end(); ++it) { if (it->totalSales >= TOTAL_SALES_TH) { achieveList.push_back(it->employeeID); } } if (achieveList.size() == 0) { std::cout << "NA" << std::endl; } else { for (std::vector<int>::iterator it = achieveList.begin(); it != achieveList.end(); ++it) { std::cout << *it << std::endl; } } } return 0; }
a.cc: In function 'int main()': a.cc:47:7: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 47 | scanf_s("%d %d %d", &ID, &unitPrice, &amount); | ^~~~~~~ | scanf
s380400994
p00100
C++
#include <cstdio> using namespace std; typedef __int64 Int; int main(){ const int AIM = 1000000; int n; int num, per, sum; bool exist; bool comp[4001]; Int pro[4001]; while(true){ scanf("%d", &n); if(n == 0) break; for(int i = 1; i <= 4000; i++){ comp[i] = false; pro[i] = 0; } exist = false; for(int i = 0; i < n; i++){ scanf("%d%d%d", &num, &per, &sum); if(comp[num]) continue; if(pro[num] + (Int)per * sum >= AIM){ exist = true; comp[num] = true; printf("%d\n", num); } else{ pro[num] += (Int)per * sum; } } if(!exist) printf("NA\n"); } return 0; }
a.cc:4:9: error: '__int64' does not name a type; did you mean '__int64_t'? 4 | typedef __int64 Int; | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:12:9: error: 'Int' was not declared in this scope; did you mean 'int'? 12 | Int pro[4001]; | ^~~ | int a.cc:19:25: error: 'pro' was not declared in this scope 19 | pro[i] = 0; | ^~~ a.cc:25:28: error: 'pro' was not declared in this scope 25 | if(pro[num] + (Int)per * sum >= AIM){ | ^~~ a.cc:25:44: error: expected ')' before 'per' 25 | if(pro[num] + (Int)per * sum >= AIM){ | ~ ^~~ | )
s904440212
p00100
C++
#include <map> #include <iostream> #include <vector> using namespace std; int main(){ map<int,long long int> emps; vector<int> ids; int id,cost,amount,n; while(cin >> n,n){ for(int i=0;i<n;i++){ cin >> id >> cost >> amount; if(emps.find(id)!=emps.end()){ emps[id]+=cost*amount; }else{ emps[id]=cost*amount; ids.push_back(id); } } sort(ids.begin(),ids.end()); for(int i=0;i<ids.size();i++){ if(emps.at(ids[i])>=1000000) cout << ids[i] << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'? 19 | sort(ids.begin(),ids.end()); | ^~~~ | short
s837696939
p00100
C++
//AOJ0100 #include<iostream> #include<string> #include<vector> #include<cstdio> #include<sstream> #include<algorithm> #include<cmath> #include<map> using namespace std; #define int long long void main(){ int n; while(cin>>n,n!=0){ vector< pair<int,int> >ta; ta.clear(); for(int i=0;i<n;i++){ int a,b,c; cin>>a>>b>>c; bool f=0; int index=0; for(int j=0;j<ta.size();j++)if(ta[j].first==a)f=1,index=j; if(f==0)ta.push_back(pair<int,int>(a,b*c)); else ta[index].second+=b*c; } bool f=0; for(int i=0;i<ta.size();i++){ cout<<ta[i].first<<" "<<ta[i].second<<endl; if(ta[i].second>=1000000){cout<<ta[i].first<<endl;;f=1;} } if(!f)cout<<"NA"<<endl; } return ; }
a.cc:12:1: error: '::main' must return 'int' 12 | void main(){ | ^~~~ a.cc: In function 'int main()': a.cc:33:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 33 | return ; | ^~~~~~
s453462974
p00100
C++
/* -- 0100:Sale Result -- */ #include <iostream> #include <map> using namespace std; typedef unsigned __int64 ull; int main(void) { int n, buf_n, buf_c, buf_p; bool flag; ull buf_t; map<int, ull> List; while(1) { cin >> n; if(n == 0) { break; } flag = true; List.clear(); for(int i=0; i<n; i++) { cin >> buf_n >> buf_p >> buf_c; buf_t = buf_p * buf_c; if(List.find(buf_n) == List.end()) { List[buf_n] = buf_t; } else { List[buf_n] += buf_t; } } map<int, ull>::iterator it = List.begin(); while( it != List.end() ) { if(it->second >= 1000000) { flag = false; cout << it->first << endl; } it++; } if(flag) { cout << "NA" << endl; } } return 0; }
a.cc:7:26: error: expected initializer before 'ull' 7 | typedef unsigned __int64 ull; | ^~~ a.cc: In function 'int main()': a.cc:12:9: error: 'ull' was not declared in this scope 12 | ull buf_t; | ^~~ a.cc:13:21: error: template argument 4 is invalid 13 | map<int, ull> List; | ^ a.cc:20:22: error: request for member 'clear' in 'List', which is of non-class type 'int' 20 | List.clear(); | ^~~~~ a.cc:23:25: error: 'buf_t' was not declared in this scope; did you mean 'buf_p'? 23 | buf_t = buf_p * buf_c; | ^~~~~ | buf_p a.cc:24:33: error: request for member 'find' in 'List', which is of non-class type 'int' 24 | if(List.find(buf_n) == List.end()) { | ^~~~ a.cc:24:53: error: request for member 'end' in 'List', which is of non-class type 'int' 24 | if(List.find(buf_n) == List.end()) { | ^~~ a.cc:25:37: error: invalid types 'int[int]' for array subscript 25 | List[buf_n] = buf_t; | ^ a.cc:27:37: error: invalid types 'int[int]' for array subscript 27 | List[buf_n] += buf_t; | ^ a.cc:30:29: error: template argument 4 is invalid 30 | map<int, ull>::iterator it = List.begin(); | ^ a.cc:30:41: error: expected initializer before 'it' 30 | map<int, ull>::iterator it = List.begin(); | ^~ a.cc:31:24: error: 'it' was not declared in this scope; did you mean 'int'? 31 | while( it != List.end() ) { | ^~ | int a.cc:31:35: error: request for member 'end' in 'List', which is of non-class type 'int' 31 | while( it != List.end() ) { | ^~~
s780077438
p00100
C++
#include <iostream> using namespace std; int main(){ int bangou,tanka,kosuu; int number; cin >> number; do{ int man[4000]; for(int i=0;i<4000;i++){ man[i]=0; } for(int i=0;i<number;i++){ cin >> bangou >> tanka >> kosuu; man[bangou] += tanka*kosuu; } int count =0; for(int i=0;i<4000;i++){ if(man[i]>=1000000){ cout << i; count++; } } if(count==0) cout<< "NA" << endl; cin >> number; }while(number !=0) }
a.cc: In function 'int main()': a.cc:25:23: error: expected ';' before '}' token 25 | }while(number !=0) | ^ | ; 26 | 27 | } | ~
s361982547
p00100
C++
#include<stdio.h> int main(){ int N; int n,m,p; int P[4001][3]={}; int PT[4001][3]={}; while(1){ scanf("%d",&N);if(N==0)break; for(int i=1;i<=N;i++){ scanf("%d %d %d",&n,&m,&p); P[n][0]+=m*p;if(P[n][1]==0)P[n][1]=i; } int c=0; for(int i=0;i<4000;i++) if(1000000<=P[i][0]){PT[c][0]=P[i][0];PT[c][1]=P[i][1];c++;} for(int i=0;i<c;i++) for(int j=c-1;j>i;j--) if(PT[j][1]<PT[j-1][1]){int TT=PT[j][1];PT[j][1]=PT[j-1][1];PT[j-1][1]=TT;} for(int i=0;i<c;i++) printf("%d\n",PT[i][1]); } RETURN 0; }
a.cc: In function 'int main()': a.cc:27:1: error: 'RETURN' was not declared in this scope 27 | RETURN 0; | ^~~~~~
s568629132
p00100
C++
#include <iostream> #include <vector> using namespace std; int main() { vector<int> id; int index,n,s,id; cin >> index; for(int i; i < index; i++) { cin >> id >> s >> n; if(s*n >1000000) { id.push_back(id); } } for(int a: id) cout << a << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:23: error: conflicting declaration 'int id' 9 | int index,n,s,id; | ^~ a.cc:8:21: note: previous declaration as 'std::vector<int> id' 8 | vector<int> id; | ^~ a.cc:13:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 13 | cin >> id >> s >> n; | ~~~ ^~ ~~ | | | | | std::vector<int> | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<int>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<int>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<int>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<int>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<int>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); |
s462596903
p00100
C++
#include<cstdio> using namespace std; const int target = 1000000; int main() { int data; while (1) { scanf_s("%d", &data); if (data == 0)break; bool hero = false; for (int i = 0; i < data; i++) { int num, sell, cnt; scanf_s("%d %d %d", num, sell, cnt); if (sell*cnt >= target) { printf("%d\n", num); hero = true; } } if (hero == false) printf("NA\n"); } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 11 | scanf_s("%d", &data); | ^~~~~~~ | scanf
s166736793
p00100
C++
#include<cstdio> #include<vector> using namespace std; const int target = 1000000; vector<int> heros; int main() { int data; while (1) { scanf_s("%d", &data); if (data == 0)break; bool hero = false; for (int i = 0; i < data; i++) { int num, sell, cnt; scanf_s("%d %d %d", &num, &sell, &cnt); if (sell*cnt >= target) { bool already = false; for (int j = 0; j < heros.size(); j++) { if (heros[j] == num) already = true; } if (already == false) { printf("%d\n", num); heros.push_back(num); hero = true; } } } if (hero==false) printf("NA\n"); } return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 13 | scanf_s("%d", &data); | ^~~~~~~ | scanf
s105866714
p00100
C++
#include<cstdio> #include<algorithm> #include<vector> using namespace std; const int target = 1000000; int main() { int data; while (1) { scanf_s("%d", &data); if (data == 0)break; vector<pair<int,int>> company; pair<int, int> sells; bool hero = false; int num, sell, cnt; for (int i = 0; i < data; i++) { scanf("%d %d %d", &num, &sell, &cnt); bool search = false; for (int j = 0; j < company.size(); j++) { if (company[j].first == num){ search = true; company[j].second += sell*cnt; break; } } if (search == false) { sells.first = num; sells.second = sell*cnt; company.push_back(sells); } } for (int i = 0; i < company.size(); i++) { if (company[i].second >= target) { hero = true; printf("%d\n", company[i].first); } } if (hero == false) printf("NA\n"); } return 0; }
a.cc: In function 'int main()': a.cc:12:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 12 | scanf_s("%d", &data); | ^~~~~~~ | scanf
s202083624
p00100
C++
#include <iostream> using namespace std; int p[4001]; int result[1000000]; int main(){ int i ,j=0 , n , id , price , num , cnt; while(cin>>n){ cnt=0; memset(p,0 , sizeof(p)/sizeof(p[0])); if (n==0) break; for(i=0 ; i<4001 ; i++){ p[i]=false; } for(i=0 ; i<n ; i++){ cin >> id >> price >> num; p[id]+=price*num; } for(i=0 ; i<4001 ; i++){ if(p[i]>=1000000){ result[j++]=i; cnt++; } } if (cnt==0) { result[j++]=0; } } for(i=0;i<j;i++){ if (result[i]==0) { cout << "NA" << endl; } else { cout << result[i] << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: 'memset' was not declared in this scope 11 | memset(p,0 , sizeof(p)/sizeof(p[0])); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s446459255
p00100
C++
#include <cstdio> #include <iostream> #include <iomanip> #include <string> #include <vector> using namespace std; int in; cin >> in int p[in][in * 3],i,ii,c = 0,uri[in],k; for(i = 1;in >= i;i++){ cin >> p[i][0] >> p[i][1] >> p[i][2];uri[i] = 0;} for(i = 1;in >= i;i++){ for(ii = 1;in >= ii;ii++){if(p[i][0] == p[ii][0]){ uri[ii] = uri[ii] + p[i][1] * p[i][2];}} } for(i = 1;in >= i;i++){ k = 0; for(ii = 1;i > ii;ii++){if(p[i][0] == p[ii][0]){ k = 1;} } if(uri[i] >= 1000000 and k == 0){cout << p[i][0] << endl; c++;} } if(c == 0 and in != 0) cout << "NA" << endl; }
a.cc:9:1: error: 'cin' does not name a type 9 | cin >> in | ^~~ a.cc:11:9: error: expected unqualified-id before 'for' 11 | for(i = 1;in >= i;i++){ cin >> p[i][0] >> p[i][1] >> p[i][2];uri[i] = 0;} | ^~~ a.cc:11:19: error: 'in' does not name a type; did you mean 'int'? 11 | for(i = 1;in >= i;i++){ cin >> p[i][0] >> p[i][1] >> p[i][2];uri[i] = 0;} | ^~ | int a.cc:11:27: error: 'i' does not name a type 11 | for(i = 1;in >= i;i++){ cin >> p[i][0] >> p[i][1] >> p[i][2];uri[i] = 0;} | ^ a.cc:12:9: error: expected unqualified-id before 'for' 12 | for(i = 1;in >= i;i++){ | ^~~ a.cc:12:19: error: 'in' does not name a type; did you mean 'int'? 12 | for(i = 1;in >= i;i++){ | ^~ | int a.cc:12:27: error: 'i' does not name a type 12 | for(i = 1;in >= i;i++){ | ^ a.cc:15:9: error: expected unqualified-id before 'for' 15 | for(i = 1;in >= i;i++){ | ^~~ a.cc:15:19: error: 'in' does not name a type; did you mean 'int'? 15 | for(i = 1;in >= i;i++){ | ^~ | int a.cc:15:27: error: 'i' does not name a type 15 | for(i = 1;in >= i;i++){ | ^ a.cc:20:9: error: expected unqualified-id before 'if' 20 | if(c == 0 and in != 0) cout << "NA" << endl; | ^~ a.cc:22:1: error: expected declaration before '}' token 22 | } | ^
s333433046
p00100
C++
#include <iostream> #include <string> #include <vector> std::vector<std::string> split(std::string ref,char c){ vector<std::string> res; size_t current=0, found; while((found=ref.find_first_of(c,current))!=std::string::npos){ res.push_back(std::string(ref,current,found-current)); current=found+1; } res.push_back(std::string(ref,current,ref.size()-current)); return res; } int main(void){ int it_num; std::string str; std::vector<std::string> ref; std::vector<int> res; cin >> it_num; while(it_num!=0){ for(int i=0;i<it_num;i++){ getline(cin,str); ref=split(str," "); if(std::stoi(ref[1])*std::stoi(ref[2])>=1000000){ res.push_back(ref[0]); } } cin >> it_num } for(int j=0;j<res.size();j++){ std::cout << res[j] << std::endl; } return 0; }
a.cc: In function 'std::vector<std::__cxx11::basic_string<char> > split(std::string, char)': a.cc:6:1: error: 'vector' was not declared in this scope 6 | vector<std::string> res; | ^~~~~~ a.cc:6:1: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:6:19: error: expected primary-expression before '>' token 6 | vector<std::string> res; | ^ a.cc:6:21: error: 'res' was not declared in this scope; did you mean 'ref'? 6 | vector<std::string> res; | ^~~ | ref a.cc: In function 'int main()': a.cc:23:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 23 | cin >> it_num; | ^~~ | std::cin 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:27:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 27 | ref=split(str," "); | ^~~ | | | const char* a.cc:5:53: note: initializing argument 2 of 'std::vector<std::__cxx11::basic_string<char> > split(std::string, char)' 5 | std::vector<std::string> split(std::string ref,char c){ | ~~~~~^ a.cc:29:14: error: no matching function for call to 'std::vector<int>::push_back(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' 29 | res.push_back(ref[0]); | ~~~~~~~~~~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const std::vector<int>::value_type&' {aka 'const int&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<int>::value_type&&' {aka 'int&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~
s655817775
p00100
C++
#include <iostream> #include <string> #include <vector> std::vector<std::string> split(std::string ref,char c){ std::vector<std::string> res; size_t current=0, found; while((found=ref.find_first_of(c,current))!=std::string::npos){ res.push_back(std::string(ref,current,found-current)); current=found+1; } res.push_back(std::string(ref,current,ref.size()-current)); return res; } int main(void){ int it_num; std::string str; std::vector<std::string> ref; std::vector<int> res; std::cin >> it_num; while(it_num!=0){ for(int i=0;i<it_num;i++){ std::getline(cin,str); ref=split(str," "); if(std::stoi(ref[1])*std::stoi(ref[2])>=1000000){ res.push_back(ref[0]); } } std::cin >> it_num } for(int j=0;j<res.size();j++){ std::cout << res[j] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:26:14: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 26 | std::getline(cin,str); | ^~~ | std::cin 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:27:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 27 | ref=split(str," "); | ^~~ | | | const char* a.cc:5:53: note: initializing argument 2 of 'std::vector<std::__cxx11::basic_string<char> > split(std::string, char)' 5 | std::vector<std::string> split(std::string ref,char c){ | ~~~~~^ a.cc:29:14: error: no matching function for call to 'std::vector<int>::push_back(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' 29 | res.push_back(ref[0]); | ~~~~~~~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const std::vector<int>::value_type&' {aka 'const int&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<int>::value_type&&' {aka 'int&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ a.cc:32:19: error: expected ';' before '}' token 32 | std::cin >> it_num | ^ | ; 33 | } | ~
s256282285
p00100
C++
#include <iostream> #include <string> #include <vector> std::vector<std::string> split(std::string ref,char c){ std::vector<std::string> res; size_t current=0, found; while((found=ref.find_first_of(c,current))!=std::string::npos){ res.push_back(std::string(ref,current,found-current)); current=found+1; } res.push_back(std::string(ref,current,ref.size()-current)); return res; } int main(void){ int it_num; std::string str; std::vector<std::string> ref; std::vector<int> res; std::cin >> it_num; while(it_num!=0){ for(int i=0;i<it_num;i++){ std::getline(std::cin,str); ref=split(str," "); if(std::stoi(ref[1])*std::stoi(ref[2])>=1000000){ res.push_back(ref[0]); } } std::cin >> it_num } for(int j=0;j<res.size();j++){ std::cout << res[j] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:27:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 27 | ref=split(str," "); | ^~~ | | | const char* a.cc:5:53: note: initializing argument 2 of 'std::vector<std::__cxx11::basic_string<char> > split(std::string, char)' 5 | std::vector<std::string> split(std::string ref,char c){ | ~~~~~^ a.cc:29:14: error: no matching function for call to 'std::vector<int>::push_back(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' 29 | res.push_back(ref[0]); | ~~~~~~~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const std::vector<int>::value_type&' {aka 'const int&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<int>::value_type&&' {aka 'int&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ a.cc:32:19: error: expected ';' before '}' token 32 | std::cin >> it_num | ^ | ; 33 | } | ~
s691531141
p00100
C++
#include <iostream> #include <string> #include <vector> std::vector<std::string> split(const std::string& ref,const char c){ std::vector<std::string> res; size_t current=0, found; while((found=ref.find_first_of(c,current))!=std::string::npos){ res.push_back(std::string(ref,current,found-current)); current=found+1; } res.push_back(std::string(ref,current,ref.size()-current)); return res; } int main(void){ int it_num; std::string str; std::vector<std::string> ref; std::vector<int> res; std::cin >> it_num; while(it_num!=0){ for(int i=0;i<it_num;i++){ std::getline(std::cin,str); ref=split(str," "); if(std::stoi(ref[1])*std::stoi(ref[2])>=1000000){ res.push_back(ref[0]); } } std::cin >> it_num } for(int j=0;j<res.size();j++){ std::cout << res[j] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:27:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 27 | ref=split(str," "); | ^~~ | | | const char* a.cc:5:66: note: initializing argument 2 of 'std::vector<std::__cxx11::basic_string<char> > split(const std::string&, char)' 5 | std::vector<std::string> split(const std::string& ref,const char c){ | ~~~~~~~~~~~^ a.cc:29:14: error: no matching function for call to 'std::vector<int>::push_back(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' 29 | res.push_back(ref[0]); | ~~~~~~~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const std::vector<int>::value_type&' {aka 'const int&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<int>::value_type&&' {aka 'int&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ a.cc:32:19: error: expected ';' before '}' token 32 | std::cin >> it_num | ^ | ; 33 | } | ~
s644570141
p00100
C++
#include <iostream> #include <string> #include <vector> std::vector<std::string> split(const std::string& ref,const char c){ std::vector<std::string> res; size_t current=0, found; while((found=ref.find_first_of(c,current))!=std::string::npos){ res.push_back(std::string(ref,current,found-current)); current=found+1; } res.push_back(std::string(ref,current,ref.size()-current)); return res; } int main(void){ int it_num; std::string str; std::vector<std::string> ref; std::vector<int> res; std::cin >> it_num; while(it_num!=0){ for(int i=0;i<it_num;i++){ std::getline(std::cin,str); ref=split(str," "); if((std::stoi(ref[1])*std::stoi(ref[2]))>=1000000){ res.push_back(ref[0]); } } std::cin >> it_num } for(int j=0;j<res.size();j++){ std::cout << res[j] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:27:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 27 | ref=split(str," "); | ^~~ | | | const char* a.cc:5:66: note: initializing argument 2 of 'std::vector<std::__cxx11::basic_string<char> > split(const std::string&, char)' 5 | std::vector<std::string> split(const std::string& ref,const char c){ | ~~~~~~~~~~~^ a.cc:29:14: error: no matching function for call to 'std::vector<int>::push_back(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' 29 | res.push_back(ref[0]); | ~~~~~~~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const std::vector<int>::value_type&' {aka 'const int&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<int>::value_type&&' {aka 'int&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ a.cc:32:19: error: expected ';' before '}' token 32 | std::cin >> it_num | ^ | ; 33 | } | ~
s936900322
p00100
C++
#include <iostream> #include <string> #include <vector> std::vector<std::string> split(const std::string& ref,char c){ std::vector<std::string> res; size_t current=0, found; while((found=ref.find_first_of(c,current))!=std::string::npos){ res.push_back(std::string(ref,current,found-current)); current=found+1; } res.push_back(std::string(ref,current,ref.size()-current)); return res; } int main(void){ int it_num; std::string str; std::vector<std::string> ref; std::vector<int> res; std::cin >> it_num; while(it_num!=0){ for(int i=0;i<it_num;i++){ std::getline(std::cin,str); ref=split(str," "); if((std::stoi(ref[1])*std::stoi(ref[2]))>=1000000){ res.push_back(ref[0]); } } std::cin >> it_num } for(int j=0;j<res.size();j++){ std::cout << res[j] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:27:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 27 | ref=split(str," "); | ^~~ | | | const char* a.cc:5:60: note: initializing argument 2 of 'std::vector<std::__cxx11::basic_string<char> > split(const std::string&, char)' 5 | std::vector<std::string> split(const std::string& ref,char c){ | ~~~~~^ a.cc:29:14: error: no matching function for call to 'std::vector<int>::push_back(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' 29 | res.push_back(ref[0]); | ~~~~~~~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const std::vector<int>::value_type&' {aka 'const int&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<int>::value_type&&' {aka 'int&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ a.cc:32:19: error: expected ';' before '}' token 32 | std::cin >> it_num | ^ | ; 33 | } | ~
s363672892
p00100
C++
#include <iostream> #include <string> #include <vector> std::vector<std::string> split(const std::string& ref,char c){ std::vector<std::string> res; size_t current=0, found; while((found=ref.find_first_of(c,current))!=std::string::npos){ res.push_back(std::string(ref,current,found-current)); current=found+1; } res.push_back(std::string(ref,current,ref.size()-current)); return res; } int main(void){ int it_num; std::string str; std::vector<std::string> ref; std::vector<int> res; std::cin >> it_num; while(it_num!=0){ for(int i=0;i<it_num;i++){ std::getline(std::cin,str); ref=split(str,' '); if((std::stoi(ref[1])*std::stoi(ref[2]))>=1000000){ res.push_back(ref[0]); } } std::cin >> it_num } for(int j=0;j<res.size();j++){ std::cout << res[j] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:29:14: error: no matching function for call to 'std::vector<int>::push_back(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' 29 | res.push_back(ref[0]); | ~~~~~~~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const std::vector<int>::value_type&' {aka 'const int&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<int>::value_type&&' {aka 'int&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ a.cc:32:19: error: expected ';' before '}' token 32 | std::cin >> it_num | ^ | ; 33 | } | ~