Created
October 18, 2015 12:42
-
-
Save StrixG/4a0b8f2754a82f55d2d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.util.StringTokenizer; | |
public class Main { | |
public static void main(String[] args) throws IOException { | |
FastScanner in = new FastScanner(System.in); | |
long n = in.nextLong(); | |
long sum = n * (n - 1) / 2 + n; | |
for (long i = 0; i < n - 1; i++) { | |
sum -= in.nextLong(); | |
} | |
System.out.println(sum); | |
} | |
} | |
class FastScanner { | |
BufferedReader br; | |
StringTokenizer stok; | |
FastScanner(InputStream is) { | |
br = new BufferedReader(new InputStreamReader(is)); | |
} | |
String nextToken() throws IOException { | |
while (stok == null || !stok.hasMoreTokens()) { | |
String s = br.readLine(); | |
if (s == null) { | |
return null; | |
} | |
stok = new StringTokenizer(s); | |
} | |
return stok.nextToken(); | |
} | |
int nextInt() throws IOException { | |
return Integer.parseInt(nextToken()); | |
} | |
long nextLong() throws IOException { | |
return Long.parseLong(nextToken()); | |
} | |
double nextDouble() throws IOException { | |
return Double.parseDouble(nextToken()); | |
} | |
char nextChar() throws IOException { | |
return (char) (br.read()); | |
} | |
String nextLine() throws IOException { | |
return br.readLine(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment