結果
問題 |
No.8016 unordered_mapなるたけ落とすマン
|
ユーザー |
|
提出日時 | 2016-05-22 00:49:16 |
言語 | Java (openjdk 23) |
結果 |
MLE
|
実行時間 | - |
コード長 | 602 bytes |
コンパイル時間 | 2,454 ms |
コンパイル使用メモリ | 77,060 KB |
実行使用メモリ | 81,476 KB |
最終ジャッジ日時 | 2024-10-07 05:46:39 |
合計ジャッジ時間 | 10,041 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | MLE * 3 |
other | TLE * 41 MLE * 7 |
ソースコード
package yukicoder; import java.util.HashMap; import java.util.Scanner; public class Main{ public static void main(String[] args){ new Main().solve(); } void solve(){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int m=sc.nextInt(); HashMap<Long,Integer> map=new HashMap<>(); for(int i=0;i<n;i++){ long a=sc.nextLong(); if(map.containsKey(a))map.put(a, map.get(a)+1); else map.put(a, 1); } for(int i=0;i<m;i++){ long b=sc.nextLong(); if(map.containsKey(b))System.out.print(map.get(b)+(i==m-1?"\n":" ")); else System.out.print(0+(i==m-1?"\n":" ")); } } }